Code

Connected two toolbar buttons with the associated verbs
authorJasper van de Gronde <th.v.d.gronde@hccnet.nl>
Tue, 7 Sep 2010 08:35:34 +0000 (10:35 +0200)
committerJasper van de Gronde <th.v.d.gronde@hccnet.nl>
Tue, 7 Sep 2010 08:35:34 +0000 (10:35 +0200)
src/verbs.cpp
src/widgets/toolbox.cpp

index 6ba0aa562a6912d65015190277bada40c3bf3e56..67211e38e3087e86f1311354d7ae43cea8cd98fb 100644 (file)
@@ -2312,8 +2312,8 @@ Verb *Verb::_base_verbs[] = {
                  N_("Deselect any selected objects or nodes"), INKSCAPE_ICON_EDIT_SELECT_NONE),
     new EditVerb(SP_VERB_EDIT_GUIDES_AROUND_PAGE, "EditGuidesAroundPage", N_("_Guides Around Page"),
                  N_("Create four guides aligned with the page borders"), NULL),
-    new EditVerb(SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER, "EditNextPathEffectParameter", N_("Next Path Effect Parameter"),
-                 N_("Show next Path Effect parameter for editing"), INKSCAPE_ICON_PATH_EFFECT_PARAMETER_NEXT),
+    new EditVerb(SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER, "EditNextPathEffectParameter", N_("Next path effect parameter"),
+                 N_("Show next editable path effect parameter"), INKSCAPE_ICON_PATH_EFFECT_PARAMETER_NEXT),
 
     /* Selection */
     new SelectionVerb(SP_VERB_SELECTION_TO_FRONT, "SelectionToFront", N_("Raise to _Top"),
@@ -2557,7 +2557,7 @@ Verb *Verb::_base_verbs[] = {
     new ZoomVerb(SP_VERB_TOGGLE_SCROLLBARS, "ToggleScrollbars", N_("Scroll_bars"), N_("Show or hide the canvas scrollbars"), NULL),
     new ZoomVerb(SP_VERB_TOGGLE_GRID, "ToggleGrid", N_("_Grid"), N_("Show or hide the grid"), INKSCAPE_ICON_SHOW_GRID),
     new ZoomVerb(SP_VERB_TOGGLE_GUIDES, "ToggleGuides", N_("G_uides"), N_("Show or hide guides (drag from a ruler to create a guide)"), INKSCAPE_ICON_SHOW_GUIDES),
-    new ZoomVerb(SP_VERB_TOGGLE_SNAPPING, "ToggleSnapGlobal", N_("Snap"), N_("Toggle snapping on or off"), INKSCAPE_ICON_SNAP),
+    new ZoomVerb(SP_VERB_TOGGLE_SNAPPING, "ToggleSnapGlobal", N_("Snap"), N_("Enable snapping"), INKSCAPE_ICON_SNAP),
     new ZoomVerb(SP_VERB_ZOOM_NEXT, "ZoomNext", N_("Nex_t Zoom"), N_("Next zoom (from the history of zooms)"),
                  INKSCAPE_ICON_ZOOM_NEXT),
     new ZoomVerb(SP_VERB_ZOOM_PREV, "ZoomPrev", N_("Pre_vious Zoom"), N_("Previous zoom (from the history of zooms)"),
index f6a6735e9eab250fecf4f58ad7f25fe83e2575b8..f6af1ca55102fc9b0cb85bbe18a2c26d567b6509 100644 (file)
@@ -303,7 +303,7 @@ static gchar const * ui_descr =
         "    <separator />"
         "    <toolitem action='ObjectEditClipPathAction' />"
         "    <toolitem action='ObjectEditMaskPathAction' />"
-        "    <toolitem action='EditNextLPEParameterAction' />"
+        "    <toolitem action='EditNextPathEffectParameter' />"
         "    <separator />"
         "    <toolitem action='NodesShowTransformHandlesAction' />"
         "    <toolitem action='NodesShowHandlesAction' />"
@@ -1500,9 +1500,10 @@ static void sp_node_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions
     }
 
     {
-        InkAction* inky = ink_action_new( "EditNextLPEParameterAction",
-                                          _("Next path effect parameter"),
-                                          _("Show next editable path effect parameter"),
+        Inkscape::Verb* verb = Inkscape::Verb::get(SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER);
+        InkAction* inky = ink_action_new( verb->get_id(),
+                                          verb->get_name(),
+                                          verb->get_tip(),
                                           INKSCAPE_ICON_PATH_EFFECT_PARAMETER_NEXT,
                                           secondarySize );
         g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_node_path_edit_nextLPEparam), desktop );
@@ -2175,8 +2176,13 @@ void setup_snap_toolbox(GtkWidget *toolbox, SPDesktop *desktop)
     Inkscape::IconSize secondarySize = ToolboxFactory::prefToSize("/toolbox/secondary", 1);
 
     {
-        InkToggleAction* act = ink_toggle_action_new("ToggleSnapGlobal",
-                                                     _("Snap"), _("Enable snapping"), INKSCAPE_ICON_SNAP, secondarySize,
+        // TODO: This is a cludge. On the one hand we have verbs+actions,
+        //       on the other we have all these explicit callbacks specified here.
+        //       We should really unify these (should save some lines of code as well).
+        //       For example, this action could be based on the verb(+action) + PrefsPusher.
+        Inkscape::Verb* verb = Inkscape::Verb::get(SP_VERB_TOGGLE_SNAPPING);
+        InkToggleAction* act = ink_toggle_action_new(verb->get_id(),
+                                                     verb->get_name(), verb->get_tip(), INKSCAPE_ICON_SNAP, secondarySize,
                                                      SP_ATTR_INKSCAPE_SNAP_GLOBAL);
 
         gtk_action_group_add_action( mainActions->gobj(), GTK_ACTION( act ) );