summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMartin Owens <doctormo@gmail.com>2013-04-22 14:58:19 +0000
committerMartin Owens <doctormo@gmail.com>2013-04-22 14:58:19 +0000
commit3c5cd145660b50b8b96bfa8c22bd6b28d72e452c (patch)
tree8bf34a4bffa22db113eeb2cd544a85d678c08212 /src
parentdefine booleans as booleans (prevent future errors in comparisons) (diff)
downloadinkscape-3c5cd145660b50b8b96bfa8c22bd6b28d72e452c.tar.gz
inkscape-3c5cd145660b50b8b96bfa8c22bd6b28d72e452c.zip
Add balloon symbols and connect defs modified signal.
Fixed bugs: - https://launchpad.net/bugs/1170817 (bzr r12298)
Diffstat (limited to 'src')
-rw-r--r--src/selection-chemistry.cpp8
-rw-r--r--src/ui/dialog/symbols.cpp17
-rw-r--r--src/ui/dialog/symbols.h3
3 files changed, 18 insertions, 10 deletions
diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp
index fc410897a..28dd51e81 100644
--- a/src/selection-chemistry.cpp
+++ b/src/selection-chemistry.cpp
@@ -2973,7 +2973,6 @@ void sp_selection_symbol(SPDesktop *desktop, bool /*apply*/ )
*/
void sp_selection_unsymbol(SPDesktop *desktop)
{
-
if (desktop == NULL) {
return;
}
@@ -2992,13 +2991,8 @@ void sp_selection_unsymbol(SPDesktop *desktop)
SPObject* use = selection->single();
// Make sure we have only one object in selection.
- if( use == NULL ) {
- desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select only one <b>symbol</b> to convert to group."));
- return;
- }
-
// Require that we really have a <use> that references a <symbol>.
- if( !SP_IS_USE( use ) && !SP_IS_SYMBOL( use->firstChild() ) ) {
+ if( use == NULL || ( !SP_IS_USE( use ) && !SP_IS_SYMBOL( use->firstChild() ))) {
desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select only one <b>symbol</b> to convert to group."));
return;
}
diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp
index 57e2e7285..989375bbd 100644
--- a/src/ui/dialog/symbols.cpp
+++ b/src/ui/dialog/symbols.cpp
@@ -49,6 +49,7 @@
#include "inkscape.h"
#include "sp-root.h"
#include "sp-use.h"
+#include "sp-defs.h"
#include "sp-symbol.h"
#ifdef WITH_LIBVISIO
@@ -246,12 +247,19 @@ SymbolsDialog::SymbolsDialog( gchar const* prefsPath ) :
key = SPItem::display_key_new(1);
renderDrawing.setRoot(previewDocument->getRoot()->invoke_show(renderDrawing, key, SP_ITEM_SHOW_DISPLAY ));
+ // This might need to be a global variable so setTargetDesktop can modify it
+ SPDefs *defs = currentDocument->getDefs();
+ sigc::connection defsModifiedConn = (SP_OBJECT(defs))->connectModified(
+ sigc::mem_fun(*this, &SymbolsDialog::defsModified));
+ instanceConns.push_back(defsModifiedConn);
+
get_symbols();
draw_symbols( currentDocument ); /* Defaults to current document */
- desktopChangeConn =
+ sigc::connection desktopChangeConn =
deskTrack.connectDesktopChanged( sigc::mem_fun(*this, &SymbolsDialog::setTargetDesktop) );
instanceConns.push_back( desktopChangeConn );
+
deskTrack.connect(GTK_WIDGET(gobj()));
}
@@ -304,6 +312,13 @@ void SymbolsDialog::iconDragDataGet(const Glib::RefPtr<Gdk::DragContext>& /*cont
}
+void SymbolsDialog::defsModified(SPObject *object, guint flags)
+{
+ if ( !symbolSets[symbolSet->get_active_text()] ) {
+ rebuild();
+ }
+}
+
void SymbolsDialog::iconChanged() {
#if WITH_GTKMM_3_0
std::vector<Gtk::TreePath> iconArray = iconView->get_selected_items();
diff --git a/src/ui/dialog/symbols.h b/src/ui/dialog/symbols.h
index 2d408386f..b81f6981e 100644
--- a/src/ui/dialog/symbols.h
+++ b/src/ui/dialog/symbols.h
@@ -46,6 +46,7 @@ private:
static SymbolColumns *getColumns();
void rebuild();
+ void defsModified(SPObject *object, guint flags);
void iconChanged();
void iconDragDataGet(const Glib::RefPtr<Gdk::DragContext>& context, Gtk::SelectionData& selection_data, guint info, guint time);
@@ -84,8 +85,6 @@ private:
Inkscape::Drawing renderDrawing;
std::vector<sigc::connection> instanceConns;
- sigc::connection desktopChangeConn;
-
};
} //namespace Dialogs