From 37c1a351b7db98d0d09531f811e310615abd955e Mon Sep 17 00:00:00 2001 From: Alex Valavanis Date: Sat, 21 Nov 2015 11:57:48 +0000 Subject: Hide unused verbs if Potrace is not available (bzr r14449.1.7) --- src/verbs.cpp | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index e0ef27b0d..6b13eabb6 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -832,7 +832,14 @@ Verb *Verb::getbyid(gchar const *id) verb = verb_found->second; } - if (verb == NULL) + if (verb == NULL +#if !HAVE_POTRACE + // Squash warning about disabled features + && strcmp(id, "ToolPaintBucket") != 0 + && strcmp(id, "SelectionTrace") != 0 + && strcmp(id, "PaintBucketPrefs") != 0 +#endif + ) printf("Unable to find: %s\n", id); return verb; @@ -1201,10 +1208,14 @@ void SelectionVerb::perform(SPAction *action, void *data) case SP_VERB_SELECTION_REVERSE: SelectionHelper::reverse(dt); break; + +#if HAVE_POTRACE case SP_VERB_SELECTION_TRACE: INKSCAPE.dialogs_unhide(); dt->_dlg_mgr->showDialog("Trace"); break; +#endif + case SP_VERB_SELECTION_PIXEL_ART: INKSCAPE.dialogs_unhide(); dt->_dlg_mgr->showDialog("PixelArt"); @@ -1606,7 +1617,7 @@ void ContextVerb::perform(SPAction *action, void *data) /** \todo !!! hopefully this can go away soon and actions can look after * themselves */ - for (vidx = SP_VERB_CONTEXT_SELECT; vidx <= SP_VERB_CONTEXT_PAINTBUCKET_PREFS; vidx++) + for (vidx = SP_VERB_CONTEXT_SELECT; vidx <= SP_VERB_CONTEXT_LPETOOL_PREFS; vidx++) { SPAction *tool_action= get((sp_verb_t)vidx)->get_action(action->context); if (tool_action) { @@ -1673,9 +1684,13 @@ void ContextVerb::perform(SPAction *action, void *data) case SP_VERB_CONTEXT_CONNECTOR: tools_switch(dt, TOOLS_CONNECTOR); break; + +#if HAVE_POTRACE case SP_VERB_CONTEXT_PAINTBUCKET: tools_switch(dt, TOOLS_PAINTBUCKET); break; +#endif + case SP_VERB_CONTEXT_ERASER: tools_switch(dt, TOOLS_ERASER); break; @@ -1759,10 +1774,14 @@ void ContextVerb::perform(SPAction *action, void *data) prefs->setInt("/dialogs/preferences/page", PREFS_PAGE_TOOLS_CONNECTOR); dt->_dlg_mgr->showDialog("InkscapePreferences"); break; + +#if HAVE_POTRACE case SP_VERB_CONTEXT_PAINTBUCKET_PREFS: prefs->setInt("/dialogs/preferences/page", PREFS_PAGE_TOOLS_PAINTBUCKET); dt->_dlg_mgr->showDialog("InkscapePreferences"); break; +#endif + case SP_VERB_CONTEXT_ERASER_PREFS: prefs->setInt("/dialogs/preferences/page", PREFS_PAGE_TOOLS_ERASER); dt->_dlg_mgr->showDialog("InkscapePreferences"); @@ -2160,10 +2179,14 @@ void TutorialVerb::perform(SPAction *action, void *data) // TRANSLATORS: See "tutorial-basic.svg" comment. sp_help_open_tutorial(NULL, (gpointer)_("tutorial-advanced.svg")); break; + +#if HAVE_POTRACE case SP_VERB_TUTORIAL_TRACING: // TRANSLATORS: See "tutorial-basic.svg" comment. sp_help_open_tutorial(NULL, (gpointer)_("tutorial-tracing.svg")); break; +#endif + case SP_VERB_TUTORIAL_TRACING_PIXELART: sp_help_open_tutorial(NULL, (gpointer)_("tutorial-tracing-pixelart.svg")); break; @@ -2593,9 +2616,13 @@ Verb *Verb::_base_verbs[] = { N_("Simplify selected paths (remove extra nodes)"), INKSCAPE_ICON("path-simplify")), new SelectionVerb(SP_VERB_SELECTION_REVERSE, "SelectionReverse", N_("_Reverse"), N_("Reverse the direction of selected paths (useful for flipping markers)"), INKSCAPE_ICON("path-reverse")), + +#if HAVE_POTRACE // TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize) new SelectionVerb(SP_VERB_SELECTION_TRACE, "SelectionTrace", N_("_Trace Bitmap..."), N_("Create one or more paths from a bitmap by tracing it"), INKSCAPE_ICON("bitmap-trace")), +#endif + new SelectionVerb(SP_VERB_SELECTION_PIXEL_ART, "SelectionPixelArt", N_("Trace Pixel Art..."), N_("Create paths using Kopf-Lischinski algorithm to vectorize pixel art"), INKSCAPE_ICON("pixelart-trace")), new SelectionVerb(SP_VERB_SELECTION_CREATE_BITMAP, "SelectionCreateBitmap", N_("Make a _Bitmap Copy"), @@ -2733,8 +2760,12 @@ Verb *Verb::_base_verbs[] = { N_("Pick colors from image"), INKSCAPE_ICON("color-picker")), new ContextVerb(SP_VERB_CONTEXT_CONNECTOR, "ToolConnector", NC_("ContextVerb", "Connector"), N_("Create diagram connectors"), INKSCAPE_ICON("draw-connector")), + +#if HAVE_POTRACE new ContextVerb(SP_VERB_CONTEXT_PAINTBUCKET, "ToolPaintBucket", NC_("ContextVerb", "Paint Bucket"), N_("Fill bounded areas"), INKSCAPE_ICON("color-fill")), +#endif + new ContextVerb(SP_VERB_CONTEXT_LPE, "ToolLPE", NC_("ContextVerb", "LPE Edit"), N_("Edit Path Effect parameters"), NULL), new ContextVerb(SP_VERB_CONTEXT_ERASER, "ToolEraser", NC_("ContextVerb", "Eraser"), @@ -2780,8 +2811,12 @@ Verb *Verb::_base_verbs[] = { N_("Open Preferences for the Dropper tool"), NULL), new ContextVerb(SP_VERB_CONTEXT_CONNECTOR_PREFS, "ConnectorPrefs", N_("Connector Preferences"), N_("Open Preferences for the Connector tool"), NULL), + +#if HAVE_POTRACE new ContextVerb(SP_VERB_CONTEXT_PAINTBUCKET_PREFS, "PaintBucketPrefs", N_("Paint Bucket Preferences"), N_("Open Preferences for the Paint Bucket tool"), NULL), +#endif + new ContextVerb(SP_VERB_CONTEXT_ERASER_PREFS, "EraserPrefs", N_("Eraser Preferences"), N_("Open Preferences for the Eraser tool"), NULL), new ContextVerb(SP_VERB_CONTEXT_LPETOOL_PREFS, "LPEToolPrefs", N_("LPE Tool Preferences"), @@ -2937,9 +2972,13 @@ Verb *Verb::_base_verbs[] = { N_("Using shape tools to create and edit shapes"), NULL), new TutorialVerb(SP_VERB_TUTORIAL_ADVANCED, "TutorialsAdvanced", N_("Inkscape: _Advanced"), N_("Advanced Inkscape topics"), NULL/*"tutorial_advanced"*/), + +#if HAVE_POTRACE // TRANSLATORS: "to trace" means "to convert a bitmap to vector graphics" (to vectorize) new TutorialVerb(SP_VERB_TUTORIAL_TRACING, "TutorialsTracing", N_("Inkscape: T_racing"), N_("Using bitmap tracing"), NULL/*"tutorial_tracing"*/), +#endif + new TutorialVerb(SP_VERB_TUTORIAL_TRACING_PIXELART, "TutorialsTracingPixelArt", N_("Inkscape: Tracing Pixel Art"), N_("Using Trace Pixel Art dialog"), NULL), new TutorialVerb(SP_VERB_TUTORIAL_CALLIGRAPHY, "TutorialsCalligraphy", N_("Inkscape: _Calligraphy"), -- cgit v1.2.3 From 1cab611c173b2903512268994343f58ef83883ec Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Thu, 3 Dec 2015 21:51:29 +0100 Subject: Add global lock guides to the rulers (bzr r14500.1.5) --- src/verbs.cpp | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 6b13eabb6..029deac3c 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1989,6 +1989,9 @@ void ZoomVerb::perform(SPAction *action, void *data) case SP_VERB_VIEW_CMS_TOGGLE: dt->toggleColorProfAdjust(); break; + case SP_VERB_VIEW_GUIDES_LOCK_TOGGLE: + dt->toggleGuidesLock(); + break; case SP_VERB_VIEW_ICON_PREVIEW: INKSCAPE.dialogs_unhide(); dt->_dlg_mgr->showDialog("IconPreviewPanel"); @@ -2877,6 +2880,8 @@ Verb *Verb::_base_verbs[] = { new ZoomVerb(SP_VERB_VIEW_CMS_TOGGLE, "ViewCmsToggle", N_("Color-managed view"), N_("Toggle color-managed display for this document window"), INKSCAPE_ICON("color-management")), + new ZoomVerb(SP_VERB_VIEW_GUIDES_LOCK_TOGGLE, "GuidesLockToggle", N_("Lock or unlock guides"), + N_("Lock or unlock guides"), INKSCAPE_ICON("object-locked")), new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview..."), N_("Open a window to preview objects at different icon resolutions"), INKSCAPE_ICON("dialog-icon-preview")), -- cgit v1.2.3 From dad44686e614958c26cfa2056891ebe9ea6db0dc Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Thu, 3 Dec 2015 22:15:42 +0100 Subject: String desc fix (bzr r14500.1.6) --- src/verbs.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 029deac3c..6eace6048 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -2880,8 +2880,8 @@ Verb *Verb::_base_verbs[] = { new ZoomVerb(SP_VERB_VIEW_CMS_TOGGLE, "ViewCmsToggle", N_("Color-managed view"), N_("Toggle color-managed display for this document window"), INKSCAPE_ICON("color-management")), - new ZoomVerb(SP_VERB_VIEW_GUIDES_LOCK_TOGGLE, "GuidesLockToggle", N_("Lock or unlock guides"), - N_("Lock or unlock guides"), INKSCAPE_ICON("object-locked")), + new ZoomVerb(SP_VERB_VIEW_GUIDES_LOCK_TOGGLE, "GuidesLockToggle", N_("Lock all guides"), + N_("Lock all guides"), INKSCAPE_ICON("object-locked")), new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview..."), N_("Open a window to preview objects at different icon resolutions"), INKSCAPE_ICON("dialog-icon-preview")), -- cgit v1.2.3 From e649a1d9cd29f39b2d1cf343cec97ccebce9cf08 Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sat, 5 Dec 2015 23:55:57 +0100 Subject: Changed from Desktop to namedview to handle multiples documents (bzr r14500.1.8) --- src/verbs.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index 6eace6048..afcc37bc4 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -1938,6 +1938,9 @@ void ZoomVerb::perform(SPAction *action, void *data) case SP_VERB_TOGGLE_GUIDES: sp_namedview_toggle_guides(doc, repr); break; + case SP_VERB_TOGGLE_GUIDES_LOCK: + sp_namedview_toggle_guides_lock(doc, repr); + break; case SP_VERB_TOGGLE_SNAPPING: dt->toggleSnapGlobal(); break; @@ -1989,9 +1992,6 @@ void ZoomVerb::perform(SPAction *action, void *data) case SP_VERB_VIEW_CMS_TOGGLE: dt->toggleColorProfAdjust(); break; - case SP_VERB_VIEW_GUIDES_LOCK_TOGGLE: - dt->toggleGuidesLock(); - break; case SP_VERB_VIEW_ICON_PREVIEW: INKSCAPE.dialogs_unhide(); dt->_dlg_mgr->showDialog("IconPreviewPanel"); @@ -2831,6 +2831,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_("Page _Grid"), N_("Show or hide the page 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_GUIDES_LOCK, "ToggleGuidesLook", N_("Gui_des Lock"), N_("Lock or unlock all guides"), INKSCAPE_ICON("object-locked")), new ZoomVerb(SP_VERB_TOGGLE_SNAPPING, "ToggleSnapGlobal", N_("Snap"), N_("Enable snapping"), INKSCAPE_ICON("snap")), new ZoomVerb(SP_VERB_TOGGLE_COMMANDS_TOOLBAR, "ToggleCommandsToolbar", N_("_Commands Bar"), N_("Show or hide the Commands bar (under the menu)"), NULL), new ZoomVerb(SP_VERB_TOGGLE_SNAP_TOOLBAR, "ToggleSnapToolbar", N_("Sn_ap Controls Bar"), N_("Show or hide the snapping controls"), NULL), @@ -2880,8 +2881,6 @@ Verb *Verb::_base_verbs[] = { new ZoomVerb(SP_VERB_VIEW_CMS_TOGGLE, "ViewCmsToggle", N_("Color-managed view"), N_("Toggle color-managed display for this document window"), INKSCAPE_ICON("color-management")), - new ZoomVerb(SP_VERB_VIEW_GUIDES_LOCK_TOGGLE, "GuidesLockToggle", N_("Lock all guides"), - N_("Lock all guides"), INKSCAPE_ICON("object-locked")), new ZoomVerb(SP_VERB_VIEW_ICON_PREVIEW, "ViewIconPreview", N_("Ico_n Preview..."), N_("Open a window to preview objects at different icon resolutions"), INKSCAPE_ICON("dialog-icon-preview")), -- cgit v1.2.3 From 266cd1e5c43e6a46cd37f7db5138270b80d0944e Mon Sep 17 00:00:00 2001 From: Jabier Arraiza Cenoz Date: Sun, 6 Dec 2015 22:39:31 +0100 Subject: Fixes UX pointed in suv review (bzr r14500.1.9) --- src/verbs.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'src/verbs.cpp') diff --git a/src/verbs.cpp b/src/verbs.cpp index afcc37bc4..ed4b1ceb0 100644 --- a/src/verbs.cpp +++ b/src/verbs.cpp @@ -952,6 +952,10 @@ void EditVerb::perform(SPAction *action, void *data) g_return_if_fail(ensure_desktop_valid(action)); SPDesktop *dt = sp_action_get_desktop(action); + SPDocument *doc = dt->getDocument(); + + Inkscape::XML::Node *repr = dt->namedview->getRepr(); + switch (reinterpret_cast(data)) { case SP_VERB_EDIT_UNDO: sp_undo(dt, dt->getDocument()); @@ -1079,10 +1083,12 @@ void EditVerb::perform(SPAction *action, void *data) case SP_VERB_EDIT_DELETE_ALL_GUIDES: sp_guide_delete_all_guides(dt); break; + case SP_VERB_EDIT_GUIDES_TOGGLE_LOCK: + dt->toggleGuidesLock(); + break; case SP_VERB_EDIT_GUIDES_AROUND_PAGE: sp_guide_create_guides_around_page(dt); break; - case SP_VERB_EDIT_NEXT_PATHEFFECT_PARAMETER: sp_selection_next_patheffect_param(dt); break; @@ -1938,9 +1944,6 @@ void ZoomVerb::perform(SPAction *action, void *data) case SP_VERB_TOGGLE_GUIDES: sp_namedview_toggle_guides(doc, repr); break; - case SP_VERB_TOGGLE_GUIDES_LOCK: - sp_namedview_toggle_guides_lock(doc, repr); - break; case SP_VERB_TOGGLE_SNAPPING: dt->toggleSnapGlobal(); break; @@ -2543,6 +2546,7 @@ Verb *Verb::_base_verbs[] = { N_("Deselect any selected objects or nodes"), INKSCAPE_ICON("edit-select-none")), new EditVerb(SP_VERB_EDIT_DELETE_ALL_GUIDES, "EditRemoveAllGuides", N_("Delete All Guides"), N_("Delete all the guides in the document"), NULL), + new EditVerb(SP_VERB_EDIT_GUIDES_TOGGLE_LOCK, "EditGuidesToggleLock", N_("Lock All Guides"), N_("Toggle lock of all guides in the document"), NULL), new EditVerb(SP_VERB_EDIT_GUIDES_AROUND_PAGE, "EditGuidesAroundPage", N_("Create _Guides Around the 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"), @@ -2831,7 +2835,6 @@ 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_("Page _Grid"), N_("Show or hide the page 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_GUIDES_LOCK, "ToggleGuidesLook", N_("Gui_des Lock"), N_("Lock or unlock all guides"), INKSCAPE_ICON("object-locked")), new ZoomVerb(SP_VERB_TOGGLE_SNAPPING, "ToggleSnapGlobal", N_("Snap"), N_("Enable snapping"), INKSCAPE_ICON("snap")), new ZoomVerb(SP_VERB_TOGGLE_COMMANDS_TOOLBAR, "ToggleCommandsToolbar", N_("_Commands Bar"), N_("Show or hide the Commands bar (under the menu)"), NULL), new ZoomVerb(SP_VERB_TOGGLE_SNAP_TOOLBAR, "ToggleSnapToolbar", N_("Sn_ap Controls Bar"), N_("Show or hide the snapping controls"), NULL), -- cgit v1.2.3