From: buliabyak Date: Mon, 9 Jun 2008 05:46:29 +0000 (+0000) Subject: add selmodified connection to force dialog update on undo X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=a95be1234ba4df33d6d074589edaa56f0d546069;p=inkscape.git add selmodified connection to force dialog update on undo --- diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index 2dc4fda71..c1bbaa022 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -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(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)); } diff --git a/src/ui/dialog/livepatheffect-editor.h b/src/ui/dialog/livepatheffect-editor.h index e2c7da322..49b25d607 100644 --- a/src/ui/dialog/livepatheffect-editor.h +++ b/src/ui/dialog/livepatheffect-editor.h @@ -49,6 +49,7 @@ public: private: sigc::connection selection_changed_connection; + sigc::connection selection_modified_connection; void set_sensitize_all(bool sensitive);