Code

add selmodified connection to force dialog update on undo
authorbuliabyak <buliabyak@users.sourceforge.net>
Mon, 9 Jun 2008 05:46:29 +0000 (05:46 +0000)
committerbuliabyak <buliabyak@users.sourceforge.net>
Mon, 9 Jun 2008 05:46:29 +0000 (05:46 +0000)
src/ui/dialog/livepatheffect-editor.cpp
src/ui/dialog/livepatheffect-editor.h

index 2dc4fda71062dcd1259bbe597cd54640fb66809b..c1bbaa022c503118a81db3c6f743af42f0f95cd4 100644 (file)
@@ -55,6 +55,12 @@ static void lpeeditor_selection_changed (Inkscape::Selection * selection, gpoint
     lpeeditor->onSelectionChanged(selection);
 }
 
+static void lpeeditor_selection_modified (Inkscape::Selection * selection, guint /*flags*/, gpointer data)
+{
+    LivePathEffectEditor *lpeeditor = static_cast<LivePathEffectEditor *>(data);
+    lpeeditor->onSelectionChanged(selection);
+}
+
 
 /*#######################
  * LivePathEffectEditor
@@ -157,6 +163,7 @@ LivePathEffectEditor::~LivePathEffectEditor()
 
     if (current_desktop) {
         selection_changed_connection.disconnect();
+        selection_modified_connection.disconnect();
     }
 }
 
@@ -238,7 +245,7 @@ LivePathEffectEditor::onSelectionChanged(Inkscape::Selection *sel)
             }
               else
             {
-                showText(_("Item is not compound by paths"));
+                showText(_("Item is not a path or shape"));
                 set_sensitize_all(false);
             }
         } else {
@@ -278,6 +285,7 @@ LivePathEffectEditor::setDesktop(SPDesktop *desktop)
 
     if (current_desktop) {
         selection_changed_connection.disconnect();
+        selection_modified_connection.disconnect();
     }
 
     current_desktop = desktop;
@@ -285,6 +293,8 @@ LivePathEffectEditor::setDesktop(SPDesktop *desktop)
         Inkscape::Selection *selection = sp_desktop_selection(desktop);
         selection_changed_connection = selection->connectChanged(
             sigc::bind (sigc::ptr_fun(&lpeeditor_selection_changed), this ) );
+        selection_modified_connection = selection->connectModified(
+            sigc::bind (sigc::ptr_fun(&lpeeditor_selection_modified), this ) );
 
         onSelectionChanged(selection);
     } else {
@@ -350,10 +360,10 @@ void LivePathEffectEditor::onUp()
         SPItem *item = sel->singleItem();
         if ( item && SP_IS_LPE_ITEM(item) ) {
             
-                       sp_lpe_item_up_current_path_effect(SP_LPE_ITEM(item));
+                             sp_lpe_item_up_current_path_effect(SP_LPE_ITEM(item));
             
             sp_document_done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT, 
-                               _("Remove path effect") );
+                               _("Move path effect up") );
 
             effect_list_update(SP_LPE_ITEM(item));
         }
@@ -368,10 +378,10 @@ void LivePathEffectEditor::onDown()
         SPItem *item = sel->singleItem();
         if ( item && SP_IS_LPE_ITEM(item) ) {
             
-                       sp_lpe_item_down_current_path_effect(SP_LPE_ITEM(item));
+                       sp_lpe_item_down_current_path_effect(SP_LPE_ITEM(item));
             
             sp_document_done ( sp_desktop_document (current_desktop), SP_VERB_DIALOG_LIVE_PATH_EFFECT, 
-                               _("Remove path effect") );
+                               _("Move path effect down") );
 
             effect_list_update(SP_LPE_ITEM(item));
         }
index e2c7da3220bc6bb2421dcc38ea6bc68245e1cfaa..49b25d6077a9b61af9d138b6f8720567315340ee 100644 (file)
@@ -49,6 +49,7 @@ public:
 
 private:
     sigc::connection selection_changed_connection;
+    sigc::connection selection_modified_connection;
 
     void set_sensitize_all(bool sensitive);