diff --git a/src/actions/actions-edit-document.cpp b/src/actions/actions-edit-document.cpp index 5835d2ff7d2df31dbb3fa710036014ed052da578..f6384e4f453c687e9a4f167d95f3ab779489a30a 100644 --- a/src/actions/actions-edit-document.cpp +++ b/src/actions/actions-edit-document.cpp @@ -56,7 +56,7 @@ fit_canvas_drawing(SPDocument* document) { // Fit Page to Drawing if (fit_canvas_to_drawing(document)) { - Inkscape::DocumentUndo::done(document, _("Fit Page to Drawing"), ""); + Inkscape::DocumentUndo::done(document, C_("Undo", "Fit Page to Drawing"), ""); } } @@ -67,7 +67,7 @@ set_display_unit(Glib::ustring abbr, SPDocument* document) Inkscape::XML::Node *repr = document->getNamedView()->getRepr(); repr->setAttribute("inkscape:document-units", abbr); document->setModifiedSinceSave(); - Inkscape::DocumentUndo::done(document, _("Changed default display unit"), ""); + Inkscape::DocumentUndo::done(document, C_("Undo", "Changed default display unit"), ""); } void toggle_clip_to_page(SPDocument* document) { @@ -76,7 +76,7 @@ void toggle_clip_to_page(SPDocument* document) { auto clip = !document->getNamedView()->clip_to_page; document->getNamedView()->change_bool_setting(SPAttr::INKSCAPE_CLIP_TO_PAGE_RENDERING, clip); document->setModifiedSinceSave(); - Inkscape::DocumentUndo::done(document, _("Clip to page"), ""); + Inkscape::DocumentUndo::done(document, C_("Undo", "Clip to page"), ""); } void diff --git a/src/actions/actions-edit.cpp b/src/actions/actions-edit.cpp index 798a100b91c9214f7b2b8be052306ce0cb7914ea..d2a9ff9decd1edd952d08f1b73f52181b7a8a280 100644 --- a/src/actions/actions-edit.cpp +++ b/src/actions/actions-edit.cpp @@ -161,7 +161,7 @@ void duplicate_transform(InkscapeApplication *app) auto selection = app->get_active_selection(); selection->duplicate(true); selection->reapplyAffine(); - Inkscape::DocumentUndo::done(app->get_active_document(), _("Duplicate and Transform"), + Inkscape::DocumentUndo::done(app->get_active_document(), C_("Undo", "Duplicate and Transform"), INKSCAPE_ICON("edit-duplicate")); } diff --git a/src/actions/actions-file.cpp b/src/actions/actions-file.cpp index 6dc623c01da9d1e131c19f6993bd789479d3ac5a..65e57b7f7424941914d1a13c9b461330c595fbdb 100644 --- a/src/actions/actions-file.cpp +++ b/src/actions/actions-file.cpp @@ -84,7 +84,7 @@ file_rebase(const Glib::VariantBase& value, InkscapeApplication *app) document->rebase(s.get()); document->ensureUpToDate(); - Inkscape::DocumentUndo::done(document, _("Replace file contents"), ""); + Inkscape::DocumentUndo::done(document, C_("Undo", "Replace file contents"), ""); } // Need to create a document_revert that doesn't depend on windows. diff --git a/src/actions/actions-hide-lock.cpp b/src/actions/actions-hide-lock.cpp index 80fd132687101d6f6007a68b8a4aa077cd02b7c6..67f2c2a44552b8658ee8263105a309b3f9d9de87 100644 --- a/src/actions/actions-hide-lock.cpp +++ b/src/actions/actions-hide-lock.cpp @@ -79,7 +79,7 @@ hide_lock_unhide_all(InkscapeApplication* app) bool changed = hide_lock_recurse(&hide_lock_hide, root, false); // Unhide if (changed) { - Inkscape::DocumentUndo::done(document, _("Unhid all objects in the current layer"), ""); + Inkscape::DocumentUndo::done(document, C_("Undo", "Unhid all objects in the current layer"), ""); } } @@ -93,7 +93,7 @@ hide_lock_unlock_all(InkscapeApplication* app) bool changed = hide_lock_recurse(&hide_lock_lock, root, false); // Unlock if (changed) { - Inkscape::DocumentUndo::done(document, _("Unlocked all objects in the current layer"), ""); + Inkscape::DocumentUndo::done(document, C_("Undo", "Unlocked all objects in the current layer"), ""); } } @@ -116,7 +116,7 @@ hide_lock_unhide_below(InkscapeApplication *app) if (changed) { auto document = app->get_active_document(); - Inkscape::DocumentUndo::done(document, _("Unhid selected items and their descendents."), ""); + Inkscape::DocumentUndo::done(document, C_("Undo", "Unhid selected items and their descendents."), ""); } } @@ -139,7 +139,7 @@ hide_lock_unlock_below(InkscapeApplication *app) if (changed) { auto document = app->get_active_document(); - Inkscape::DocumentUndo::done(document, _("Unlocked selected items and their descendents."), ""); + Inkscape::DocumentUndo::done(document, C_("Undo", "Unlocked selected items and their descendents."), ""); } } @@ -162,7 +162,8 @@ hide_lock_hide_selected(InkscapeApplication* app, bool hide) if (changed) { auto document = app->get_active_document(); - Inkscape::DocumentUndo::done(document, (hide ? _("Hid selected items.") : _("Unhid selected items.")), ""); + Inkscape::DocumentUndo::done( + document, (hide ? C_("Undo", "Hid selected items.") : C_("Undo", "Unhid selected items.")), ""); selection->clear(); } } @@ -186,7 +187,8 @@ hide_lock_lock_selected(InkscapeApplication* app, bool lock) if (changed) { auto document = app->get_active_document(); - Inkscape::DocumentUndo::done(document, (lock ? _("Locked selected items.") : _("Unlocked selected items.")), ""); + Inkscape::DocumentUndo::done( + document, (lock ? C_("Undo", "Locked selected items.") : C_("Undo", "Unlocked selected items.")), ""); selection->clear(); } } diff --git a/src/actions/actions-layer.cpp b/src/actions/actions-layer.cpp index 68065ad549df0346d91d2bdc333a4b1d77ed86fa..69bacc3134310dbff564d0671c80d7ce6db5adaa 100644 --- a/src/actions/actions-layer.cpp +++ b/src/actions/actions-layer.cpp @@ -61,8 +61,8 @@ layer_new_above(InkscapeWindow* win) desktop->layerManager().renameLayer(new_layer, current_layer->label(), true); desktop->getSelection()->clear(); desktop->layerManager().setCurrentLayer(new_layer); - Inkscape::DocumentUndo::done(document, _("Add layer"), INKSCAPE_ICON("layer-new")); - desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("New layer created.")); + Inkscape::DocumentUndo::done(document, C_("Undo", "Add layer"), INKSCAPE_ICON("layer-new")); + desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, C_("Undo", "New layer created.")); } void @@ -73,8 +73,9 @@ layer_duplicate (InkscapeWindow* win) if (!dt->layerManager().isRoot()) { dt->getSelection()->duplicate(true, true); // This requires the selection to be a layer! - Inkscape::DocumentUndo::done(dt->getDocument(), _("Duplicate layer"), INKSCAPE_ICON("layer-duplicate")); - dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Duplicated layer.")); + Inkscape::DocumentUndo::done(dt->getDocument(), C_("Undo", "Duplicate layer"), + INKSCAPE_ICON("layer-duplicate")); + dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, C_("Undo", "Duplicated layer.")); } else { dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer.")); @@ -125,8 +126,8 @@ layer_delete (InkscapeWindow* win) dt->layerManager().setCurrentLayer(survivor); } - Inkscape::DocumentUndo::done(dt->getDocument(), _("Delete layer"), INKSCAPE_ICON("layer-delete")); - dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Deleted layer.")); + Inkscape::DocumentUndo::done(dt->getDocument(), C_("Undo", "Delete layer"), INKSCAPE_ICON("layer-delete")); + dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, C_("Undo", "Deleted layer.")); } else { dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer.")); @@ -181,7 +182,7 @@ layer_hide_toggle_others (InkscapeWindow* win) dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer.")); } else { dt->layerManager().toggleLayerSolo( layer ); // Weird name! - Inkscape::DocumentUndo::done(dt->getDocument(), _("Hide other layers"), ""); + Inkscape::DocumentUndo::done(dt->getDocument(), C_("Undo", "Hide other layers"), ""); } } @@ -224,7 +225,7 @@ layer_lock_toggle_others (InkscapeWindow* win) dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer.")); } else { dt->layerManager().toggleLockOtherLayers( layer ); - Inkscape::DocumentUndo::done(dt->getDocument(), _("Lock other layers"), ""); + Inkscape::DocumentUndo::done(dt->getDocument(), C_("Undo", "Lock other layers"), ""); } } @@ -236,8 +237,9 @@ layer_previous (InkscapeWindow* win) SPObject *next = Inkscape::next_layer(dt->layerManager().currentRoot(), dt->layerManager().currentLayer()); if (next) { dt->layerManager().setCurrentLayer(next); - Inkscape::DocumentUndo::done(dt->getDocument(), _("Switch to next layer"), INKSCAPE_ICON("layer-previous")); - dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Switched to next layer.")); + Inkscape::DocumentUndo::done(dt->getDocument(), C_("Undo", "Switch to next layer"), + INKSCAPE_ICON("layer-previous")); + dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, C_("Undo", "Switched to next layer.")); } else { dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot go past last layer.")); } @@ -251,8 +253,9 @@ layer_next (InkscapeWindow* win) SPObject *prev=Inkscape::previous_layer(dt->layerManager().currentRoot(), dt->layerManager().currentLayer()); if (prev) { dt->layerManager().setCurrentLayer(prev); - Inkscape::DocumentUndo::done(dt->getDocument(), _("Switch to previous layer") ,INKSCAPE_ICON("layer-next")); - dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Switched to previous layer.")); + Inkscape::DocumentUndo::done(dt->getDocument(), C_("Undo", "Switch to previous layer"), + INKSCAPE_ICON("layer-next")); + dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, C_("Undo", "Switched to previous layer.")); } else { dt->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Cannot go before first layer.")); } @@ -303,7 +306,7 @@ layer_top (InkscapeWindow* win) if (layer->getNext() != old_pos) { char const * message = g_strdup_printf(_("Raised layer %s."), layer->defaultLabel()); - Inkscape::DocumentUndo::done(dt->getDocument(), _("Layer to top"), INKSCAPE_ICON("layer-top")); + Inkscape::DocumentUndo::done(dt->getDocument(), C_("Undo", "Layer to top"), INKSCAPE_ICON("layer-top")); dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, message); g_free((void *) message); @@ -334,7 +337,7 @@ layer_raise (InkscapeWindow* win) if (layer->getNext() != old_pos) { char const * message = g_strdup_printf(_("Raised layer %s."), layer->defaultLabel()); - Inkscape::DocumentUndo::done(dt->getDocument(), _("Raise layer"), INKSCAPE_ICON("layer-raise")); + Inkscape::DocumentUndo::done(dt->getDocument(), C_("Undo", "Raise layer"), INKSCAPE_ICON("layer-raise")); dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, message); g_free((void *) message); @@ -361,7 +364,7 @@ layer_lower (InkscapeWindow* win) if (layer->getNext() != old_pos) { char const * message = g_strdup_printf(_("Lowered layer %s."), layer->defaultLabel()); - Inkscape::DocumentUndo::done(dt->getDocument(), _("Lower layer"), INKSCAPE_ICON("layer-lower")); + Inkscape::DocumentUndo::done(dt->getDocument(), C_("Undo", "Lower layer"), INKSCAPE_ICON("layer-lower")); dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, message); g_free((void *) message); @@ -388,7 +391,7 @@ layer_bottom (InkscapeWindow* win) if (layer->getNext() != old_pos) { char const * message = g_strdup_printf(_("Lowered layer %s."), layer->defaultLabel()); - Inkscape::DocumentUndo::done(dt->getDocument(), _("Layer to bottom"), INKSCAPE_ICON("layer-bottom")); + Inkscape::DocumentUndo::done(dt->getDocument(), C_("Undo", "Layer to bottom"), INKSCAPE_ICON("layer-bottom")); dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, message); g_free((void *) message); @@ -411,7 +414,7 @@ layer_to_group (InkscapeWindow* win) layer->setLayerMode(SPGroup::GROUP); layer->updateRepr(SP_OBJECT_WRITE_NO_CHILDREN | SP_OBJECT_WRITE_EXT); dt->getSelection()->set(layer); - Inkscape::DocumentUndo::done(dt->getDocument(), _("Layer to group"), INKSCAPE_ICON("dialog-objects")); + Inkscape::DocumentUndo::done(dt->getDocument(), C_("Undo", "Layer to group"), INKSCAPE_ICON("dialog-objects")); } void @@ -431,7 +434,8 @@ layer_from_group (InkscapeWindow* win) group->setLayerMode(SPGroup::LAYER); group->updateRepr(SP_OBJECT_WRITE_NO_CHILDREN | SP_OBJECT_WRITE_EXT); selection->set(group); - Inkscape::DocumentUndo::done(dt->getDocument(), _("Group to layer"), INKSCAPE_ICON("dialog-objects")); + Inkscape::DocumentUndo::done(dt->getDocument(), C_("Undo", "Group to layer"), + INKSCAPE_ICON("dialog-objects")); } else { dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Group already layer.")); } diff --git a/src/actions/actions-object-align.cpp b/src/actions/actions-object-align.cpp index 0926243fc068dc9b03e38ea923733bc4880357e1..504696f1b5f3c5411140056c5d581cf49b8aadb9 100644 --- a/src/actions/actions-object-align.cpp +++ b/src/actions/actions-object-align.cpp @@ -264,7 +264,7 @@ object_align(const Glib::VariantBase& value, InkscapeApplication *app) } if (changed) { - Inkscape::DocumentUndo::done(document, _("Align"), INKSCAPE_ICON("dialog-align-and-distribute")); + Inkscape::DocumentUndo::done(document, C_("Undo", "Align"), INKSCAPE_ICON("dialog-align-and-distribute")); } } @@ -384,7 +384,7 @@ object_distribute(const Glib::VariantBase& value, InkscapeApplication *app) prefs->setInt("/options/clonecompensation/value", saved_compensation); if (changed) { - Inkscape::DocumentUndo::done( document, _("Distribute"), INKSCAPE_ICON("dialog-align-and-distribute")); + Inkscape::DocumentUndo::done(document, C_("Undo", "Distribute"), INKSCAPE_ICON("dialog-align-and-distribute")); } } @@ -460,7 +460,7 @@ object_distribute_text(const Glib::VariantBase& value, InkscapeApplication *app) ++i; } - Inkscape::DocumentUndo::done( document, _("Distribute"), INKSCAPE_ICON("dialog-align-and-distribute")); + Inkscape::DocumentUndo::done(document, C_("Undo", "Distribute"), INKSCAPE_ICON("dialog-align-and-distribute")); } void @@ -567,7 +567,7 @@ object_align_text(const Glib::VariantBase& value, InkscapeApplication *app) } } - Inkscape::DocumentUndo::done( document, _("Align"), INKSCAPE_ICON("dialog-align-and-distribute")); + Inkscape::DocumentUndo::done(document, C_("Undo", "Align"), INKSCAPE_ICON("dialog-align-and-distribute")); } /* --------------- Rearrange ----------------- */ @@ -728,7 +728,7 @@ object_rearrange(const Glib::VariantBase& value, InkscapeApplication *app) // Restore compensation setting. prefs->setInt("/options/clonecompensation/value", saved_compensation); - Inkscape::DocumentUndo::done( document, _("Rearrange"), INKSCAPE_ICON("dialog-align-and-distribute")); + Inkscape::DocumentUndo::done(document, C_("Undo", "Rearrange"), INKSCAPE_ICON("dialog-align-and-distribute")); } @@ -763,7 +763,7 @@ object_remove_overlaps(const Glib::VariantBase& value, InkscapeApplication *app) // Restore compensation setting. prefs->setInt("/options/clonecompensation/value", saved_compensation); - Inkscape::DocumentUndo::done( document, _("Remove overlaps"), INKSCAPE_ICON("dialog-align-and-distribute")); + Inkscape::DocumentUndo::done(document, C_("Undo", "Remove overlaps"), INKSCAPE_ICON("dialog-align-and-distribute")); } diff --git a/src/actions/actions-object.cpp b/src/actions/actions-object.cpp index b42729b23be82133d4e1a0f2b02cb27c4a4d038d..35a96f9cce350bff9ac4142af6db68f478f41026 100644 --- a/src/actions/actions-object.cpp +++ b/src/actions/actions-object.cpp @@ -190,7 +190,7 @@ object_clip_set(InkscapeApplication *app) // Object Clip Set selection->setMask(true, false, should_remove_original()); - Inkscape::DocumentUndo::done(selection->document(), _("Set clipping path"), ""); + Inkscape::DocumentUndo::done(selection->document(), C_("Undo", "Set clipping path"), ""); } void @@ -201,7 +201,7 @@ object_clip_set_inverse(InkscapeApplication *app) // Object Clip Set Inverse selection->setMask(true, false, should_remove_original()); Inkscape::LivePathEffect::sp_inverse_powerclip(app->get_active_selection()); - Inkscape::DocumentUndo::done(app->get_active_document(), _("Set Inverse Clip(LPE)"), ""); + Inkscape::DocumentUndo::done(app->get_active_document(), C_("Undo", "Set Inverse Clip(LPE)"), ""); } void @@ -212,7 +212,7 @@ object_clip_release(InkscapeApplication *app) // Object Clip Release Inkscape::LivePathEffect::sp_remove_powerclip(app->get_active_selection()); selection->unsetMask(true, true, should_remove_original()); - Inkscape::DocumentUndo::done(app->get_active_document(), _("Release clipping path"), ""); + Inkscape::DocumentUndo::done(app->get_active_document(), C_("Undo", "Release clipping path"), ""); } void @@ -230,7 +230,7 @@ object_mask_set(InkscapeApplication *app) // Object Mask Set selection->setMask(false, false, should_remove_original()); - Inkscape::DocumentUndo::done(selection->document(), _("Set mask"), ""); + Inkscape::DocumentUndo::done(selection->document(), C_("Undo", "Set mask"), ""); } void @@ -241,7 +241,7 @@ object_mask_set_inverse(InkscapeApplication *app) // Object Mask Set Inverse selection->setMask(false, false, should_remove_original()); Inkscape::LivePathEffect::sp_inverse_powermask(app->get_active_selection()); - Inkscape::DocumentUndo::done(app->get_active_document(), _("Set Inverse Mask (LPE)"), ""); + Inkscape::DocumentUndo::done(app->get_active_document(), C_("Undo", "Set Inverse Mask (LPE)"), ""); } void @@ -252,7 +252,7 @@ object_mask_release(InkscapeApplication *app) // Object Mask Release Inkscape::LivePathEffect::sp_remove_powermask(app->get_active_selection()); selection->unsetMask(false, true, should_remove_original()); - Inkscape::DocumentUndo::done(app->get_active_document(), _("Release mask"), ""); + Inkscape::DocumentUndo::done(app->get_active_document(), C_("Undo", "Release mask"), ""); } void @@ -295,7 +295,8 @@ object_flip_horizontal(InkscapeApplication *app) // Object Flip Horizontal selection->scaleRelative(center, Geom::Scale(-1.0, 1.0)); - Inkscape::DocumentUndo::done(app->get_active_document(), _("Flip horizontally"), INKSCAPE_ICON("object-flip-horizontal")); + Inkscape::DocumentUndo::done(app->get_active_document(), C_("Undo", "Flip horizontally"), + INKSCAPE_ICON("object-flip-horizontal")); } void @@ -318,7 +319,8 @@ object_flip_vertical(InkscapeApplication *app) // Object Flip Vertical selection->scaleRelative(center, Geom::Scale(1.0, -1.0)); - Inkscape::DocumentUndo::done(app->get_active_document(), _("Flip vertically"), INKSCAPE_ICON("object-flip-vertical")); + Inkscape::DocumentUndo::done(app->get_active_document(), C_("Undo", "Flip vertically"), + INKSCAPE_ICON("object-flip-vertical")); } @@ -346,10 +348,12 @@ object_add_corners_lpe(InkscapeApplication *app) { if (auto lpeitem = cast(i)) { if (auto lpe = lpeitem->getFirstPathEffectOfType(Inkscape::LivePathEffect::FILLET_CHAMFER)) { lpeitem->removePathEffect(lpe, false); - Inkscape::DocumentUndo::done(document, _("Remove Live Path Effect"), INKSCAPE_ICON("dialog-path-effects")); + Inkscape::DocumentUndo::done(document, C_("Undo", "Remove Live Path Effect"), + INKSCAPE_ICON("dialog-path-effects")); } else { Inkscape::LivePathEffect::Effect::createAndApply("fillet_chamfer", document, lpeitem); - Inkscape::DocumentUndo::done(document, _("Create and apply path effect"), INKSCAPE_ICON("dialog-path-effects")); + Inkscape::DocumentUndo::done(document, C_("Undo", "Create and apply path effect"), + INKSCAPE_ICON("dialog-path-effects")); } if (auto lpe = lpeitem->getCurrentLPE()) { lpe->refresh_widgets = true; diff --git a/src/actions/actions-selection-object.cpp b/src/actions/actions-selection-object.cpp index 5ff34506c95897493ab505939ace8eee6066af21..7ad1783bdcd37346f1ec1d31fefdd1a646c97990 100644 --- a/src/actions/actions-selection-object.cpp +++ b/src/actions/actions-selection-object.cpp @@ -43,7 +43,7 @@ select_object_ungroup(InkscapeApplication* app) Inkscape::Selection *selection = app->get_active_selection(); selection->ungroup(); - Inkscape::DocumentUndo::done(selection->document(), _("Ungroup"), INKSCAPE_ICON("object-ungroup")); + Inkscape::DocumentUndo::done(selection->document(), C_("Undo", "Ungroup"), INKSCAPE_ICON("object-ungroup")); } void @@ -66,7 +66,7 @@ select_object_link(InkscapeApplication* app) // Open dialog to set link. selection->desktop()->getContainer()->new_dialog("ObjectProperties"); - Inkscape::DocumentUndo::done(selection->document(), _("Anchor"), INKSCAPE_ICON("object-group")); + Inkscape::DocumentUndo::done(selection->document(), C_("Undo", "Anchor"), INKSCAPE_ICON("object-group")); } void @@ -138,7 +138,7 @@ page_fit_to_selection(InkscapeApplication *app) } document->getPageManager().fitToSelection(selection); - Inkscape::DocumentUndo::done(document, _("Resize page to fit"), INKSCAPE_ICON("tool-pages")); + Inkscape::DocumentUndo::done(document, C_("Undo", "Resize page to fit"), INKSCAPE_ICON("tool-pages")); } std::vector> raw_data_selection_object = diff --git a/src/desktop-events.cpp b/src/desktop-events.cpp index 52ce5381ca4b031492a48caf205ac352a0538be4..16b0f586752595d7bcaeb4af606b487e2d7dbf38 100644 --- a/src/desktop-events.cpp +++ b/src/desktop-events.cpp @@ -242,7 +242,7 @@ bool sp_dt_guide_event(Inkscape::CanvasEvent const &event, Inkscape::CanvasItemG if (guide_item->get_canvas()->world_point_inside_canvas(event.pos)) { move_guide(event_dt, event.modifiers, true); - DocumentUndo::done(desktop->getDocument(), _("Move guide"), ""); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Move guide"), ""); } else { // Undo movement of any attached shapes. guide->moveto(guide->getPoint(), false); @@ -251,7 +251,7 @@ bool sp_dt_guide_event(Inkscape::CanvasEvent const &event, Inkscape::CanvasItemG guide_item = nullptr; desktop->getTool()->use_tool_cursor(); - DocumentUndo::done(desktop->getDocument(), _("Delete guide"), ""); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Delete guide"), ""); } guide_moved = false; @@ -308,7 +308,7 @@ bool sp_dt_guide_event(Inkscape::CanvasEvent const &event, Inkscape::CanvasItemG auto doc = guide->document; guide->remove(); guide_item = nullptr; - DocumentUndo::done(doc, _("Delete guide"), ""); + DocumentUndo::done(doc, C_("Undo", "Delete guide"), ""); ret = true; desktop->getTool()->discard_delayed_snap_event(); desktop->getTool()->use_tool_cursor(); diff --git a/src/file-update.cpp b/src/file-update.cpp index 50f0ed37240fd337aa2d6860bb567b2d8dd79050..578077b89d5e1fdb57da8ff5662db689c2df2304 100644 --- a/src/file-update.cpp +++ b/src/file-update.cpp @@ -630,7 +630,7 @@ void sp_file_convert_dpi(SPDocument *doc) } // Look for SPNamedView and SPDefs loop // desktop->getDocument()->ensureUpToDate(); // Does not update box3d! - DocumentUndo::done(doc, _("Update Document"), ""); + DocumentUndo::done(doc, C_("Undo", "Update Document"), ""); } // pre-1.1: diff --git a/src/file.cpp b/src/file.cpp index 067fc7f961dd087943c29e5f7bb5fa1b6f487dc0..38ba6a7706c8d730c47c6cef5fc1452fe3031b7e 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -212,7 +212,7 @@ void sp_file_vacuum(SPDocument *doc) { unsigned int diff = doc->vacuumDocument(); - DocumentUndo::done(doc, _("Clean up document"), INKSCAPE_ICON("document-cleanup")); + DocumentUndo::done(doc, C_("Undo", "Clean up document"), INKSCAPE_ICON("document-cleanup")); SPDesktop *dt = SP_ACTIVE_DESKTOP; if (dt != nullptr) { @@ -843,7 +843,7 @@ file_import(SPDocument *in_doc, const std::string &path, Inkscape::Extension::Ex // in order to indicate if pages are being imported or if objects are. if (doc->getPageManager().hasPages()) { file_import_pages(in_doc, doc.get()); - DocumentUndo::done(in_doc, _("Import Pages"), INKSCAPE_ICON("document-import")); + DocumentUndo::done(in_doc, C_("Undo", "Import Pages"), INKSCAPE_ICON("document-import")); // This return is only used by dbus in document-interface.cpp (now removed). return nullptr; } @@ -940,7 +940,7 @@ file_import(SPDocument *in_doc, const std::string &path, Inkscape::Extension::Ex } } - DocumentUndo::done(in_doc, _("Import"), INKSCAPE_ICON("document-import")); + DocumentUndo::done(in_doc, C_("Undo", "Import"), INKSCAPE_ICON("document-import")); return new_obj; } else if (!cancelled) { gchar *text = g_strdup_printf(_("Failed to load the requested file %s"), path.c_str()); diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp index 3106cc071a1e89318bc2cc8a6cb0e18129cc9b36..a28421a4e9815e3ac1624c8712b2dee76932b4d3 100644 --- a/src/gradient-chemistry.cpp +++ b/src/gradient-chemistry.cpp @@ -763,7 +763,7 @@ void sp_gradient_delete_stop(SPGradient* gradient, SPStop* stop) { if (gradient->getStopCount() > 2) { // 2 is the minimum gradient->getRepr()->removeChild(stop->getRepr()); - DocumentUndo::done(gradient->document, _("Delete gradient stop"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(gradient->document, C_("Undo", "Delete gradient stop"), INKSCAPE_ICON("color-gradient")); } } @@ -848,7 +848,7 @@ SPStop* sp_gradient_add_stop(SPGradient* gradient, SPStop* current) { newstop->setColor(stop->getColor().averaged(next->getColor())); sp_repr_set_css_double(newstop->getRepr(), "offset", (double)newstop->offset); Inkscape::GC::release(new_stop_repr); - DocumentUndo::done(gradient->document, _("Add gradient stop"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(gradient->document, C_("Undo", "Add gradient stop"), INKSCAPE_ICON("color-gradient")); return newstop; } @@ -865,7 +865,7 @@ SPStop* sp_gradient_add_stop_at(SPGradient* gradient, double offset) { if (stops.first || stops.second) { auto stop = sp_vector_add_stop(gradient, stops.first, stops.second, offset); if (stop) { - DocumentUndo::done(gradient->document, _("Add gradient stop"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(gradient->document, C_("Undo", "Add gradient stop"), INKSCAPE_ICON("color-gradient")); } return stop; } @@ -1791,7 +1791,7 @@ void sp_gradient_invert_selected_gradients(SPDesktop *desktop, Inkscape::PaintTa } // we did an undoable action - DocumentUndo::done(desktop->getDocument(), _("Invert gradient colors"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Invert gradient colors"), INKSCAPE_ICON("color-gradient")); } void sp_gradient_reverse_selected_gradients(SPDesktop *desktop) @@ -1817,7 +1817,7 @@ void sp_gradient_reverse_selected_gradients(SPDesktop *desktop) } // we did an undoable action - DocumentUndo::done(desktop->getDocument(), _("Reverse gradient"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Reverse gradient"), INKSCAPE_ICON("color-gradient")); } void sp_gradient_unset_swatch(SPDesktop *desktop, std::string const &id) @@ -1830,7 +1830,7 @@ void sp_gradient_unset_swatch(SPDesktop *desktop, std::string const &id) auto grad = cast(gradient); if ( id == grad->getId() ) { grad->setSwatch(false); - DocumentUndo::done(doc, _("Delete swatch"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(doc, C_("Undo", "Delete swatch"), INKSCAPE_ICON("color-gradient")); break; } } diff --git a/src/gradient-drag.cpp b/src/gradient-drag.cpp index 9000030a1bcdc86c15f253d884e26a0a6026575f..546e02d3b7ff607cf9059a3b35ba614ff71f4970 100644 --- a/src/gradient-drag.cpp +++ b/src/gradient-drag.cpp @@ -533,7 +533,8 @@ SPStop *GrDrag::addStopNearPoint(SPItem *item, Geom::Point mouse_p, double toler mg->array.built = false; mg->ensureArray(); // How do we do this? - DocumentUndo::done(desktop->getDocument(), _("Added patch row or column"), INKSCAPE_ICON("mesh-gradient")); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Added patch row or column"), + INKSCAPE_ICON("mesh-gradient")); } // Mesh } @@ -839,7 +840,8 @@ static void gr_knot_moved_handler(SPKnot *knot, Geom::Point const &ppointer, gui d_new->updateKnotShape (); d_new->updateTip (); d_new->updateDependencies(true); - DocumentUndo::done(d_new->parent->desktop->getDocument(), _("Merge gradient handles"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(d_new->parent->desktop->getDocument(), C_("Undo", "Merge gradient handles"), + INKSCAPE_ICON("color-gradient")); return; } } @@ -1150,7 +1152,8 @@ static void gr_knot_ungrabbed_handler(SPKnot *knot, unsigned int state, gpointer dragger->updateDependencies(true); // we did an undoable action - DocumentUndo::done(dragger->parent->desktop->getDocument(), _("Move gradient handle"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(dragger->parent->desktop->getDocument(), C_("Undo", "Move gradient handle"), + INKSCAPE_ICON("color-gradient")); } /** @@ -1208,7 +1211,7 @@ static void gr_knot_clicked_handler(SPKnot */*knot*/, guint state, gpointer data } gradient->getRepr()->removeChild(stop->getRepr()); - DocumentUndo::done(gradient->document, _("Delete gradient stop"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(gradient->document, C_("Undo", "Delete gradient stop"), INKSCAPE_ICON("color-gradient")); } } else { // select the dragger @@ -1256,7 +1259,7 @@ static void gr_knot_doubleclicked_handler(SPKnot */*knot*/, guint /*state*/, gpo drag->updateDraggers(); drag->local_change = true; drag->selectByStop(newstop); - DocumentUndo::done(gradient->document, _("Add gradient stop"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(gradient->document, C_("Undo", "Add gradient stop"), INKSCAPE_ICON("color-gradient")); } } } @@ -3140,7 +3143,7 @@ void GrDrag::deleteSelected(bool just_one) } if (document) { - DocumentUndo::done( document, _("Delete gradient stop(s)"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(document, C_("Undo", "Delete gradient stop(s)"), INKSCAPE_ICON("color-gradient")); } } diff --git a/src/io/fix-broken-links.cpp b/src/io/fix-broken-links.cpp index 6aba9b062b426218c4cc004e5b461f546598c3e0..55a85b571e8455ce2f03e591eb9e8082dd903ca6 100644 --- a/src/io/fix-broken-links.cpp +++ b/src/io/fix-broken-links.cpp @@ -349,7 +349,7 @@ bool fixBrokenLinks(SPDocument *doc) } } if ( changed ) { - DocumentUndo::done( doc, _("Fixup broken links"), INKSCAPE_ICON("dialog-xml-editor")); + DocumentUndo::done(doc, C_("Undo", "Fixup broken links"), INKSCAPE_ICON("dialog-xml-editor")); } } diff --git a/src/object/persp3d.cpp b/src/object/persp3d.cpp index a0809f091406f56aa414e9e89094a0ac9ff1c39c..b2360a65f2ed66d29de01a5b250115d6e0273248 100644 --- a/src/object/persp3d.cpp +++ b/src/object/persp3d.cpp @@ -349,7 +349,8 @@ Persp3D::toggle_VP (Proj::Axis axis, bool set_undo) { this->update_box_reprs(); this->updateRepr(SP_OBJECT_WRITE_EXT); if (set_undo) { - DocumentUndo::done(SP_ACTIVE_DESKTOP->getDocument(), _("Toggle vanishing point"), INKSCAPE_ICON("draw-cuboid")); + DocumentUndo::done(SP_ACTIVE_DESKTOP->getDocument(), C_("Undo", "Toggle vanishing point"), + INKSCAPE_ICON("draw-cuboid")); } } @@ -359,7 +360,8 @@ Persp3D::toggle_VPs (std::list list, Proj::Axis axis) { for (Persp3D *persp : list) { persp->toggle_VP(axis, false); } - DocumentUndo::done(SP_ACTIVE_DESKTOP->getDocument(), _("Toggle multiple vanishing points"), INKSCAPE_ICON("draw-cuboid")); + DocumentUndo::done(SP_ACTIVE_DESKTOP->getDocument(), C_("Undo", "Toggle multiple vanishing points"), + INKSCAPE_ICON("draw-cuboid")); } void diff --git a/src/object/sp-guide.cpp b/src/object/sp-guide.cpp index 705b68d9de4b8c023f200891e5bd3640d304b3e2..fa49eeace63d36f24c1110f1f2c4301b9085c8d4 100644 --- a/src/object/sp-guide.cpp +++ b/src/object/sp-guide.cpp @@ -284,7 +284,7 @@ void sp_guide_create_guides_around_page(SPDocument *doc) pts.emplace_back(bounds.corner(3), bounds.corner(0)); sp_guide_pt_pairs_to_guides(doc, pts); - DocumentUndo::done(doc, _("Create Guides Around the Current Page"), ""); + DocumentUndo::done(doc, C_("Undo", "Create Guides Around the Current Page"), ""); } void sp_guide_delete_all_guides(SPDocument *doc) @@ -296,7 +296,7 @@ void sp_guide_delete_all_guides(SPDocument *doc) current = doc->getResourceList("guide"); } - DocumentUndo::done(doc, _("Delete All Guides"),""); + DocumentUndo::done(doc, C_("Undo", "Delete All Guides"), ""); } // Actually, create a new guide. diff --git a/src/path-chemistry.cpp b/src/path-chemistry.cpp index cbd8158cd8f33307c38f1647a664403cb08f61ab..88a29a7e829568b485a7e6b774833ad9837a32b1 100644 --- a/src/path-chemistry.cpp +++ b/src/path-chemistry.cpp @@ -186,7 +186,7 @@ void ObjectSet::combine(bool skip_undo, bool silent) parent->addChildAtPos(repr, position > 0 ? position : 0); if (!skip_undo) { - DocumentUndo::done(doc, _("Combine"), INKSCAPE_ICON("path-combine")); + DocumentUndo::done(doc, C_("Undo", "Combine"), INKSCAPE_ICON("path-combine")); } set(repr); @@ -290,7 +290,7 @@ ObjectSet::breakApart(bool skip_undo, bool overlapping, bool silent) if (did) { if ( !skip_undo ) { - DocumentUndo::done(document(), _("Break apart"), INKSCAPE_ICON("path-break-apart")); + DocumentUndo::done(document(), C_("Undo", "Break apart"), INKSCAPE_ICON("path-break-apart")); } } else if (desktop() && !silent) { desktop()->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No path(s) to break apart in the selection.")); @@ -331,7 +331,7 @@ void ObjectSet::toCurves(bool skip_undo, bool clonesjustunlink) desktop()->clearWaitingCursor(); } if (did && !skip_undo) { - DocumentUndo::done(document(), _("Object to path"), INKSCAPE_ICON("object-to-path")); + DocumentUndo::done(document(), C_("Undo", "Object to path"), INKSCAPE_ICON("object-to-path")); } else { if(desktop()) desktop()->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No objects to convert to path in the selection.")); @@ -690,7 +690,7 @@ ObjectSet::pathReverse() desktop()->clearWaitingCursor(); if (did) { - DocumentUndo::done(document(), _("Reverse path"), INKSCAPE_ICON("path-reverse")); + DocumentUndo::done(document(), C_("Undo", "Reverse path"), INKSCAPE_ICON("path-reverse")); } else { if(desktop()) desktop()->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No paths to reverse in the selection.")); diff --git a/src/path/path-object-set.cpp b/src/path/path-object-set.cpp index 68d7ef31e8e217acc25d67c9abb8d0c69e62c68e..ac4388012a5e15bf2cb9c49b5091b11bf2d56a52 100644 --- a/src/path/path-object-set.cpp +++ b/src/path/path-object-set.cpp @@ -70,7 +70,7 @@ ObjectSet::strokesToPaths(bool legacy, bool skip_undo) } if (did && !skip_undo) { - Inkscape::DocumentUndo::done(document(), _("Convert stroke to path"), ""); + Inkscape::DocumentUndo::done(document(), C_("Undo", "Convert stroke to path"), ""); } else if (!did && !skip_undo) { Inkscape::DocumentUndo::cancel(document()); } @@ -131,7 +131,7 @@ ObjectSet::simplifyPaths(bool skip_undo) } if (pathsSimplified > 0 && !skip_undo) { - DocumentUndo::done(document(), _("Simplify"), INKSCAPE_ICON("path-simplify")); + DocumentUndo::done(document(), C_("Undo", "Simplify"), INKSCAPE_ICON("path-simplify")); } if (desktop()) { diff --git a/src/path/path-offset.cpp b/src/path/path-offset.cpp index ba1fecdf555b575adfa50b57663b8f5db16c4759..219fa8935556ba0b5d076799e5a2d1ab66140299 100644 --- a/src/path/path-offset.cpp +++ b/src/path/path-offset.cpp @@ -185,10 +185,8 @@ void sp_selected_path_create_offset_object(SPDesktop *desktop, int expand, bool // pas vraiment de points sur le resultat // donc il ne reste rien DocumentUndo::done(desktop->getDocument(), - (updating ? _("Create linked offset") - : _("Create dynamic offset")), - (updating ? INKSCAPE_ICON("path-offset-linked") - : INKSCAPE_ICON("path-offset-dynamic"))); + (updating ? C_("Undo", "Create linked offset") : _("Create dynamic offset")), + (updating ? INKSCAPE_ICON("path-offset-linked") : INKSCAPE_ICON("path-offset-dynamic"))); selection->clear(); delete res; @@ -250,10 +248,8 @@ void sp_selected_path_create_offset_object(SPDesktop *desktop, int expand, bool } DocumentUndo::done(desktop->getDocument(), - (updating ? _("Create linked offset") - : _("Create dynamic offset")), - (updating ? INKSCAPE_ICON("path-offset-linked") - : INKSCAPE_ICON("path-offset-dynamic"))); + (updating ? C_("Undo", "Create linked offset") : _("Create dynamic offset")), + (updating ? INKSCAPE_ICON("path-offset-linked") : INKSCAPE_ICON("path-offset-dynamic"))); delete res; } @@ -440,8 +436,7 @@ sp_selected_path_do_offset(SPDesktop *desktop, bool expand, double prefOffset) } if (did) { - DocumentUndo::done(desktop->getDocument(), - (expand ? _("Outset path") : _("Inset path")), + DocumentUndo::done(desktop->getDocument(), (expand ? C_("Undo", "Outset path") : C_("Undo", "Inset path")), (expand ? INKSCAPE_ICON("path-outset") : INKSCAPE_ICON("path-inset"))); } else { desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No paths to inset/outset in the selection.")); diff --git a/src/selection-chemistry.cpp b/src/selection-chemistry.cpp index fa0e480908d61fcf7947665727845740ae4e733b..44e295327b7a046c03ec493ca26706eb60a956a9 100644 --- a/src/selection-chemistry.cpp +++ b/src/selection-chemistry.cpp @@ -379,7 +379,7 @@ void ObjectSet::deleteItems(bool skip_undo) } if(document()) { - DocumentUndo::done(document(), _("Delete"), INKSCAPE_ICON("edit-delete")); + DocumentUndo::done(document(), C_("Undo", "Delete"), INKSCAPE_ICON("edit-delete")); } } @@ -596,11 +596,11 @@ void ObjectSet::duplicate(bool suppressDone, bool duplicateLayer) if (!duplicateLayer) { setReprList(newsel); if ( !suppressDone ) { - DocumentUndo::done(document(), _("Duplicate"), INKSCAPE_ICON("edit-duplicate")); + DocumentUndo::done(document(), C_("Undo", "Duplicate"), INKSCAPE_ICON("edit-duplicate")); } } else { if ( !suppressDone ) { - DocumentUndo::done(document(), _("Duplicate"), INKSCAPE_ICON("edit-duplicate")); + DocumentUndo::done(document(), C_("Undo", "Duplicate"), INKSCAPE_ICON("edit-duplicate")); } SPObject* new_layer = doc->getObjectByRepr(copies[0]); @@ -632,7 +632,7 @@ void sp_edit_clear_all(Inkscape::Selection *selection) item->deleteObject(); } - DocumentUndo::done(doc, _("Delete all"), ""); + DocumentUndo::done(doc, C_("Undo", "Delete all"), ""); } /* @@ -865,8 +865,8 @@ void ObjectSet::popFromGroup(){ toLayer(*grandparents.begin()); if(document()) - DocumentUndo::done(document(), _("Pop selection from group"), INKSCAPE_ICON("object-ungroup-pop-selection")); - + DocumentUndo::done(document(), C_("Undo", "Pop selection from group"), + INKSCAPE_ICON("object-ungroup-pop-selection")); } /** @@ -942,7 +942,7 @@ void ObjectSet::ungroup(bool skip_undo) ungroup_impl(this); if(document() && !skip_undo) - DocumentUndo::done(document(), _("Ungroup"), INKSCAPE_ICON("object-ungroup")); + DocumentUndo::done(document(), C_("Undo", "Ungroup"), INKSCAPE_ICON("object-ungroup")); } /** @@ -1073,7 +1073,7 @@ void ObjectSet::raiseToTop(bool skip_undo) { repr->setPosition(-1); } if (document() && !skip_undo) { - DocumentUndo::done(document(), _("Raise to top"), INKSCAPE_ICON("selection-top")); + DocumentUndo::done(document(), C_("Undo", "Raise to top"), INKSCAPE_ICON("selection-top")); } } @@ -1163,7 +1163,7 @@ void ObjectSet::lowerToBottom(bool skip_undo){ repr->setPosition(minpos); } if (document() && !skip_undo) { - DocumentUndo::done(document(), _("Lower to bottom"), INKSCAPE_ICON("selection-bottom")); + DocumentUndo::done(document(), C_("Undo", "Lower to bottom"), INKSCAPE_ICON("selection-bottom")); } } @@ -1241,7 +1241,7 @@ void ObjectSet::cut() // Text and Node tools have their own CUT responses instead of deleteItems if (auto text_tool = dynamic_cast(_desktop->getTool())) { if (text_tool->deleteSelection()) { - DocumentUndo::done(desktop()->getDocument(), _("Cut text"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(desktop()->getDocument(), C_("Undo", "Cut text"), INKSCAPE_ICON("draw-text")); return; } } @@ -1319,7 +1319,7 @@ void sp_selection_paste(SPDesktop *desktop, bool in_place, bool on_page) { Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get(); if (cm->paste(desktop, in_place, on_page)) { - DocumentUndo::done(desktop->getDocument(), _("Paste"), INKSCAPE_ICON("edit-paste")); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Paste"), INKSCAPE_ICON("edit-paste")); } } @@ -1327,7 +1327,7 @@ void ObjectSet::pasteStyle() { Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get(); if (cm->pasteStyle(this)) { - DocumentUndo::done(document(), _("Paste style"), INKSCAPE_ICON("edit-paste-style")); + DocumentUndo::done(document(), C_("Undo", "Paste style"), INKSCAPE_ICON("edit-paste-style")); } } @@ -1335,7 +1335,7 @@ void ObjectSet::pastePathEffect() { Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get(); if (cm->pastePathEffect(this)) { - DocumentUndo::done(document(), _("Paste live path effect"), ""); + DocumentUndo::done(document(), C_("Undo", "Paste live path effect"), ""); } } @@ -1367,7 +1367,7 @@ void ObjectSet::removeLPE() } if (document()) { - DocumentUndo::done(document(), _("Remove live path effect"), ""); + DocumentUndo::done(document(), C_("Undo", "Remove live path effect"), ""); } } @@ -1396,7 +1396,7 @@ void ObjectSet::removeFilter() } sp_repr_css_attr_unref(css); if (document()) { - DocumentUndo::done(document(), _("Remove filter"), ""); + DocumentUndo::done(document(), C_("Undo", "Remove filter"), ""); } } @@ -1405,7 +1405,7 @@ void ObjectSet::pasteSize(bool apply_x, bool apply_y) { Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get(); if (cm->pasteSize(this, false, apply_x, apply_y)) { - DocumentUndo::done(document(), _("Paste size"), INKSCAPE_ICON("edit-paste-size")); + DocumentUndo::done(document(), C_("Undo", "Paste size"), INKSCAPE_ICON("edit-paste-size")); } } @@ -1413,7 +1413,8 @@ void ObjectSet::pasteSizeSeparately(bool apply_x, bool apply_y) { Inkscape::UI::ClipboardManager *cm = Inkscape::UI::ClipboardManager::get(); if (cm->pasteSize(this, true, apply_x, apply_y)) { - DocumentUndo::done(document(), _("Paste size separately"), INKSCAPE_ICON("edit-paste-size-separately")); + DocumentUndo::done(document(), C_("Undo", "Paste size separately"), + INKSCAPE_ICON("edit-paste-size-separately")); } } @@ -1468,7 +1469,8 @@ void ObjectSet::toNextLayer(bool skip_undo) setReprList(copied); if (next) dt->layerManager().setCurrentLayer(next); if ( !skip_undo ) { - DocumentUndo::done(dt->getDocument(), _("Raise to next layer"), INKSCAPE_ICON("selection-move-to-layer-above")); + DocumentUndo::done(dt->getDocument(), C_("Undo", "Raise to next layer"), + INKSCAPE_ICON("selection-move-to-layer-above")); } } else { no_more = true; @@ -1514,7 +1516,8 @@ void ObjectSet::toPrevLayer(bool skip_undo) setReprList( copied); if (next) dt->layerManager().setCurrentLayer(next); if ( !skip_undo ) { - DocumentUndo::done(dt->getDocument(), _("Lower to previous layer"), INKSCAPE_ICON("selection-move-to-layer-below")); + DocumentUndo::done(dt->getDocument(), C_("Undo", "Lower to previous layer"), + INKSCAPE_ICON("selection-move-to-layer-below")); } } else { no_more = true; @@ -1855,7 +1858,7 @@ void ObjectSet::removeTransform() } if (document()) { - DocumentUndo::done(document(), _("Remove transform"), ""); + DocumentUndo::done(document(), C_("Undo", "Remove transform"), ""); } } @@ -2265,7 +2268,7 @@ void ObjectSet::move(double dx, double dy) } else if (dy == 0) { DocumentUndo::maybeDone(document(), "selector:move:horizontal", _("Move horizontally"), INKSCAPE_ICON("tool-pointer")); } else { - DocumentUndo::done(document(), _("Move"), INKSCAPE_ICON("tool-pointer")); + DocumentUndo::done(document(), C_("Undo", "Move"), INKSCAPE_ICON("tool-pointer")); } } } @@ -2310,7 +2313,7 @@ void ObjectSet::moveScreen(double dx, double dy) } else if (dy == 0) { DocumentUndo::maybeDone(doc, "selector:move:horizontal", _("Move horizontally by pixels"), INKSCAPE_ICON("tool-pointer")); } else { - DocumentUndo::done(doc, _("Move"), INKSCAPE_ICON("tool-pointer")); + DocumentUndo::done(doc, C_("Undo", "Move"), INKSCAPE_ICON("tool-pointer")); } } @@ -2684,7 +2687,7 @@ void ObjectSet::relink() if(desktop()) desktop()->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No clones to relink in the selection.")); } else { - DocumentUndo::done(document(), _("Relink clone"), INKSCAPE_ICON("edit-clone-unlink")); + DocumentUndo::done(document(), C_("Undo", "Relink clone"), INKSCAPE_ICON("edit-clone-unlink")); } } @@ -2777,7 +2780,7 @@ bool ObjectSet::unlink(const bool skip_undo, const bool silent) } if (!skip_undo) { - DocumentUndo::done(document(), _("Unlink clone"), INKSCAPE_ICON("edit-clone-unlink")); + DocumentUndo::done(document(), C_("Undo", "Unlink clone"), INKSCAPE_ICON("edit-clone-unlink")); } return unlinked; } @@ -2814,7 +2817,7 @@ bool ObjectSet::unlinkRecursive(const bool skip_undo, const bool force, const bo desktop()->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No clones to unlink in the selection.")); } if (!skip_undo) { - DocumentUndo::done(document(), _("Unlink clone recursively"), INKSCAPE_ICON("edit-clone-unlink")); + DocumentUndo::done(document(), C_("Undo", "Unlink clone recursively"), INKSCAPE_ICON("edit-clone-unlink")); } setList(items_); return unlinked; @@ -3016,9 +3019,10 @@ void ObjectSet::cloneOriginalPathLPE(bool allow_transforms, bool sync, bool skip } if (!skip_undo) { if (multiple) { - DocumentUndo::done(document(), _("Fill between many"), INKSCAPE_ICON("edit-clone-link-lpe")); + DocumentUndo::done(document(), C_("Undo", "Fill between many"), + INKSCAPE_ICON("edit-clone-link-lpe")); } else { - DocumentUndo::done(document(), _("Clone original"), INKSCAPE_ICON("edit-clone-link-lpe")); + DocumentUndo::done(document(), C_("Undo", "Clone original"), INKSCAPE_ICON("edit-clone-link-lpe")); } } } @@ -3100,9 +3104,7 @@ void ObjectSet::toMarker(bool apply) // restore compensation setting prefs->setInt("/options/clonecompensation/value", saved_compensation); - - - DocumentUndo::done(doc, _("Objects to marker"), ""); + DocumentUndo::done(doc, C_("Undo", "Objects to marker"), ""); } static void sp_selection_to_guides_recursive(SPItem *item, bool wholegroups) { @@ -3146,7 +3148,7 @@ void ObjectSet::toGuides() sp_selection_delete_impl(items_); } - DocumentUndo::done(doc, _("Objects to guides"), ""); + DocumentUndo::done(doc, C_("Undo", "Objects to guides"), ""); } /* @@ -3294,7 +3296,7 @@ void ObjectSet::toSymbol() // Clean up Inkscape::GC::release(symbol_repr); - DocumentUndo::done(doc, _("Group to symbol"), ""); + DocumentUndo::done(doc, C_("Undo", "Group to symbol"), ""); } /* @@ -3311,7 +3313,7 @@ void ObjectSet::unSymbol() } } } - DocumentUndo::done(document(), _("unSymbol all selected symbols"), ""); + DocumentUndo::done(document(), C_("Undo", "unSymbol all selected symbols"), ""); } void ObjectSet::tile(bool apply) @@ -3410,8 +3412,7 @@ void ObjectSet::tile(bool apply) set(rectangle); } - - DocumentUndo::done(doc, _("Objects to pattern"), ""); + DocumentUndo::done(doc, C_("Undo", "Objects to pattern"), ""); } void ObjectSet::untile() @@ -3485,7 +3486,7 @@ void ObjectSet::untile() if(desktop()) desktop()->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No pattern fills in the selection.")); } else { - DocumentUndo::done(document(), _("Pattern to objects"), ""); + DocumentUndo::done(document(), C_("Undo", "Pattern to objects"), ""); setList(new_select); } } @@ -3600,7 +3601,7 @@ void ObjectSet::createBitmapCopy() delete pb; // Complete undoable transaction - DocumentUndo::done(doc, _("Create bitmap"), INKSCAPE_ICON("selection-make-bitmap-copy")); + DocumentUndo::done(doc, C_("Undo", "Create bitmap"), INKSCAPE_ICON("selection-make-bitmap-copy")); } if(desktop()) { @@ -3704,7 +3705,7 @@ void ObjectSet::setClipGroup() Inkscape::GC::release(clone); set(outer); - DocumentUndo::done(doc, _("Create Clip Group"), ""); + DocumentUndo::done(doc, C_("Undo", "Create Clip Group"), ""); } void ObjectSet::chameleonFill() @@ -3743,7 +3744,7 @@ void ObjectSet::chameleonFill() doc->getRoot()->invoke_hide(dkey); - DocumentUndo::done(doc, _("Chameleon Fill"), ""); + DocumentUndo::done(doc, C_("Undo", "Chameleon Fill"), ""); } /** @@ -4064,7 +4065,7 @@ bool ObjectSet::fitCanvas(bool with_margins, bool skip_undo) if (bbox) { document()->fitToRect(*bbox, with_margins); if(!skip_undo) - DocumentUndo::done(document(), _("Fit Page to Selection"), ""); + DocumentUndo::done(document(), C_("Undo", "Fit Page to Selection"), ""); return true; } else { return false; @@ -4139,7 +4140,7 @@ void ObjectSet::swapFillStroke() sp_repr_css_attr_unref (css); } - DocumentUndo::done(document(), _("Swap fill and stroke of an object"), ""); + DocumentUndo::done(document(), C_("Undo", "Swap fill and stroke of an object"), ""); } /** @@ -4212,7 +4213,7 @@ void ObjectSet::fillBetweenMany() clear(); add(fillRepr); - DocumentUndo::done(doc, _("Create linked fill object between paths"), ""); + DocumentUndo::done(doc, C_("Undo", "Create linked fill object between paths"), ""); } /** @@ -4293,7 +4294,7 @@ void fit_canvas_to_drawing(SPDesktop *desktop) { if (fit_canvas_to_drawing(desktop->getDocument())) { - DocumentUndo::done(desktop->getDocument(), _("Fit Page to Drawing"), ""); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Fit Page to Drawing"), ""); } } diff --git a/src/selection.cpp b/src/selection.cpp index efd45101dfb105a0e8e45965e23a1b9c0999e7a9..eee51c255b0c6c917402d0d85fb4ed04f8f63d20 100644 --- a/src/selection.cpp +++ b/src/selection.cpp @@ -243,9 +243,9 @@ void Selection::rotateAnchored(double angle_degrees, double zoom) rotateRelative(center, angle_degrees); if (angle_degrees == 90.0) { - DocumentUndo::done(document(), _("Rotate 90\xc2\xb0 CW"), INKSCAPE_ICON("object-rotate-right")); + DocumentUndo::done(document(), C_("Undo", "Rotate 90\xc2\xb0 CW"), INKSCAPE_ICON("object-rotate-right")); } else if (angle_degrees == -90.0) { - DocumentUndo::done(document(), _("Rotate 90\xc2\xb0 CCW"), INKSCAPE_ICON("object-rotate-left")); + DocumentUndo::done(document(), C_("Undo", "Rotate 90\xc2\xb0 CCW"), INKSCAPE_ICON("object-rotate-left")); } else { DocumentUndo::maybeDone(document(), ( ( angle_degrees > 0 )? "selector:rotate:ccw": "selector:rotate:cw" ), diff --git a/src/seltrans.cpp b/src/seltrans.cpp index ea58619bce1824856e99117e16edf23f37d62b71..a23645169b105a1fe6cf230b145409770c9697a6 100644 --- a/src/seltrans.cpp +++ b/src/seltrans.cpp @@ -483,13 +483,13 @@ void Inkscape::SelTrans::ungrab() // when trying to stretch a perfectly vertical line in horizontal direction, which will not be allowed // by the handles; this would be identified as a (zero) translation by isTranslation() if (_current_relative_affine.isTranslation()) { - DocumentUndo::done(_desktop->getDocument(), _("Move"), INKSCAPE_ICON("tool-pointer")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Move"), INKSCAPE_ICON("tool-pointer")); } else if (_current_relative_affine.withoutTranslation().isScale()) { - DocumentUndo::done(_desktop->getDocument(), _("Scale"), INKSCAPE_ICON("tool-pointer")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Scale"), INKSCAPE_ICON("tool-pointer")); } else if (_current_relative_affine.withoutTranslation().isRotation()) { - DocumentUndo::done(_desktop->getDocument(), _("Rotate"), INKSCAPE_ICON("tool-pointer")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Rotate"), INKSCAPE_ICON("tool-pointer")); } else { - DocumentUndo::done(_desktop->getDocument(), _("Skew"), INKSCAPE_ICON("tool-pointer")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Skew"), INKSCAPE_ICON("tool-pointer")); } } else { _updateHandles(); @@ -506,7 +506,7 @@ void Inkscape::SelTrans::ungrab() SPItem *it = item; it->updateRepr(); } - DocumentUndo::done(_desktop->getDocument(), _("Set center"), INKSCAPE_ICON("tool-pointer")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Set center"), INKSCAPE_ICON("tool-pointer")); } _items.clear(); @@ -659,7 +659,7 @@ void Inkscape::SelTrans::stamp(bool clone) original_item->unsetTmpSuccessor(); } } - DocumentUndo::done(_desktop->getDocument(), _("Stamp"), INKSCAPE_ICON("tool-pointer")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Stamp"), INKSCAPE_ICON("tool-pointer")); } if ( fixup && _stamped ) { @@ -877,7 +877,7 @@ void Inkscape::SelTrans::handleClick(SPKnot *knot, guint state, SPSelTransHandle _center_is_set = false; // center has changed _updateHandles(); } - DocumentUndo::done(_desktop->getDocument(), _("Reset center"), INKSCAPE_ICON("tool-pointer")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Reset center"), INKSCAPE_ICON("tool-pointer")); } // no break, continue. case HANDLE_STRETCH: diff --git a/src/text-chemistry.cpp b/src/text-chemistry.cpp index 1aaf91e7d1dbbffd5ece581db5297a2980b12bef..67ac7e747de9db71fa68c55c5d00674be298c54b 100644 --- a/src/text-chemistry.cpp +++ b/src/text-chemistry.cpp @@ -173,7 +173,7 @@ text_put_on_path() text->removeAttribute("x"); text->removeAttribute("y"); - DocumentUndo::done(desktop->getDocument(), _("Put text on path"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Put text on path"), INKSCAPE_ICON("draw-text")); } void @@ -205,7 +205,7 @@ text_remove_from_path() if (!did) { desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No texts-on-paths in the selection.")); } else { - DocumentUndo::done(desktop->getDocument(), _("Remove text from path"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Remove text from path"), INKSCAPE_ICON("draw-text")); std::vector vec(selection->items().begin(), selection->items().end()); selection->setList(vec); // reselect to update statusbar description } @@ -269,7 +269,7 @@ text_remove_all_kerns() if (!did) { desktop->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("Select text(s) to remove kerns from.")); } else { - DocumentUndo::done(desktop->getDocument(), _("Remove manual kerns"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Remove manual kerns"), INKSCAPE_ICON("draw-text")); } } @@ -299,7 +299,7 @@ text_flow_shape_subtract() text->style->shape_subtract.read(shapes.c_str()); text->updateRepr(); - DocumentUndo::done(doc, _("Flow text subtract shape"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(doc, C_("Undo", "Flow text subtract shape"), INKSCAPE_ICON("draw-text")); } else { // SVG 1.2 Flowed Text desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Subtraction not available for SVG 1.2 Flowed text.")); @@ -356,7 +356,7 @@ text_flow_into_shape() text->style->white_space.read("pre-wrap"); // Respect new lines. text->updateRepr(); - DocumentUndo::done(doc, _("Flow text into shape"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(doc, C_("Undo", "Flow text into shape"), INKSCAPE_ICON("draw-text")); } } else { if (is(text) || is(text)) { @@ -424,7 +424,7 @@ text_flow_into_shape() text->deleteObject(true); - DocumentUndo::done(doc, _("Flow text into shape"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(doc, C_("Undo", "Flow text into shape"), INKSCAPE_ICON("draw-text")); desktop->getSelection()->set(cast(root_object)); @@ -565,7 +565,7 @@ text_unflow () } } - DocumentUndo::done(doc, _("Unflow flowed text"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(doc, C_("Undo", "Unflow flowed text"), INKSCAPE_ICON("draw-text")); } void @@ -645,7 +645,7 @@ text_to_glyphs() desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select text(s) to convert to glyphs.")); } else { - DocumentUndo::done(doc, _("Convert text to glyphs"), INKSCAPE_ICON("text-convert-to-regular")); + DocumentUndo::done(doc, C_("Undo", "Convert text to glyphs"), INKSCAPE_ICON("text-convert-to-regular")); selection->setList(results); } } @@ -698,7 +698,8 @@ flowtext_to_text() } if (did) { - DocumentUndo::done(desktop->getDocument(), _("Convert flowed text to text"), INKSCAPE_ICON("text-convert-to-regular")); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Convert flowed text to text"), + INKSCAPE_ICON("text-convert-to-regular")); selection->setReprList(reprs); } else if (ignored) { // no message for (did && ignored) because it is immediately overwritten diff --git a/src/trace/trace.cpp b/src/trace/trace.cpp index e2d7e8f086c9f89516106c5b29bdbf83440e68cc..d483681cf617112cd001160a6ce46295bbd2acf0 100644 --- a/src/trace/trace.cpp +++ b/src/trace/trace.cpp @@ -532,7 +532,7 @@ void TraceTask::do_final_work(std::unique_ptr self) } // Inform the document, so we can undo. - DocumentUndo::done(doc, _("Trace bitmap"), INKSCAPE_ICON("bitmap-trace")); + DocumentUndo::done(doc, C_("Undo", "Trace bitmap"), INKSCAPE_ICON("bitmap-trace")); auto const msg = Glib::ustring::compose(_("Trace: Done. %1 node(s) created"), totalNodeCount); log(Inkscape::NORMAL_MESSAGE, msg.c_str()); diff --git a/src/ui/contextmenu.cpp b/src/ui/contextmenu.cpp index 69844f12a095b0b704e61370b29f85305084aac1..6e67b6178ddea7631211db1a9afb4494a97d72ae 100644 --- a/src/ui/contextmenu.cpp +++ b/src/ui/contextmenu.cpp @@ -420,7 +420,7 @@ ContextMenu::unhide_or_unlock(SPDocument* document, bool unhide) } // We wouldn't be here if we didn't make a change. - Inkscape::DocumentUndo::done(document, (unhide ? _("Unhid objects") : _("Unlocked objects")), ""); + Inkscape::DocumentUndo::done(document, (unhide ? C_("Undo", "Unhid objects") : C_("Undo", "Unlocked objects")), ""); } /* diff --git a/src/ui/dialog/clonetiler.cpp b/src/ui/dialog/clonetiler.cpp index 458bc4db40610f835e1c1ad270fe7cd195b058ad..7577cacab454b21e8e48d16de5fe690817eaa081 100644 --- a/src/ui/dialog/clonetiler.cpp +++ b/src/ui/dialog/clonetiler.cpp @@ -1984,7 +1984,7 @@ void CloneTiler::unclump() reverse(to_unclump.begin(),to_unclump.end()); ::unclump (to_unclump); - DocumentUndo::done(getDocument(), _("Unclump tiled clones"), INKSCAPE_ICON("dialog-tile-clones")); + DocumentUndo::done(getDocument(), C_("Undo", "Unclump tiled clones"), INKSCAPE_ICON("dialog-tile-clones")); } guint CloneTiler::number_of_clones(SPObject *obj) @@ -2032,7 +2032,7 @@ void CloneTiler::remove(bool do_undo/* = true*/) change_selection (selection); if (do_undo) { - DocumentUndo::done(getDocument(), _("Delete tiled clones"), INKSCAPE_ICON("dialog-tile-clones")); + DocumentUndo::done(getDocument(), C_("Undo", "Delete tiled clones"), INKSCAPE_ICON("dialog-tile-clones")); } } @@ -2476,7 +2476,7 @@ void CloneTiler::apply() change_selection(selection); desktop->clearWaitingCursor(); - DocumentUndo::done(getDocument(), _("Create tiled clones"), INKSCAPE_ICON("dialog-tile-clones")); + DocumentUndo::done(getDocument(), C_("Undo", "Create tiled clones"), INKSCAPE_ICON("dialog-tile-clones")); } Gtk::Box * CloneTiler::new_tab(Gtk::Notebook *nb, const gchar *label) diff --git a/src/ui/dialog/color-item.cpp b/src/ui/dialog/color-item.cpp index 912253fc250d142b23a734ecbc8810f2a30a5348..38b58ef7e67211a1c2affeb40bae64426c9a493a 100644 --- a/src/ui/dialog/color-item.cpp +++ b/src/ui/dialog/color-item.cpp @@ -447,7 +447,7 @@ void ColorItem::action_delete() if (!grad) return; grad->setSwatch(false); - DocumentUndo::done(grad->document, _("Delete swatch"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(grad->document, C_("Undo", "Delete swatch"), INKSCAPE_ICON("color-gradient")); } void ColorItem::action_edit() @@ -483,7 +483,8 @@ void ColorItem::action_toggle_pin() if (!grad) return; grad->setPinned(!is_pinned()); - DocumentUndo::done(grad->document, is_pinned() ? _("Pin swatch") : _("Unpin swatch"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(grad->document, is_pinned() ? C_("Undo", "Pin swatch") : C_("Undo", "Unpin swatch"), + INKSCAPE_ICON("color-gradient")); } else { Inkscape::Preferences::get()->setBool(pinned_pref, !is_pinned()); } @@ -502,7 +503,7 @@ void ColorItem::action_convert(Glib::ustring const &name) auto const grad = static_cast(*it); grad->setSwatch(); - DocumentUndo::done(doc, _("Add gradient stop"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(doc, C_("Undo", "Add gradient stop"), INKSCAPE_ICON("color-gradient")); } Glib::RefPtr ColorItem::on_drag_prepare() diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp index bf8261cb84a1f6d5a41be68b0fe5582081bc46f1..45409fd7a3d827ed36d5c74df703bfb1f8ffccf1 100644 --- a/src/ui/dialog/document-properties.cpp +++ b/src/ui/dialog/document-properties.cpp @@ -337,7 +337,7 @@ void set_document_dimensions(SPDesktop* desktop, double width, double height, co // } doc->setWidthAndHeight(new_width_q, new_height_q, true); - DocumentUndo::done(doc, _("Set page size"), ""); + DocumentUndo::done(doc, C_("Undo", "Set page size"), ""); } void DocumentProperties::set_viewbox_pos(SPDesktop* desktop, double x, double y) { @@ -348,7 +348,7 @@ void DocumentProperties::set_viewbox_pos(SPDesktop* desktop, double x, double y) auto box = document->getViewBox(); document->setViewBox(Geom::Rect::from_xywh(x, y, box.width(), box.height())); - DocumentUndo::done(document, _("Set viewbox position"), ""); + DocumentUndo::done(document, C_("Undo", "Set viewbox position"), ""); update_scale_ui(desktop); } @@ -360,7 +360,7 @@ void DocumentProperties::set_viewbox_size(SPDesktop* desktop, double width, doub auto box = document->getViewBox(); document->setViewBox(Geom::Rect::from_xywh(box.min()[Geom::X], box.min()[Geom::Y], width, height)); - DocumentUndo::done(document, _("Set viewbox size"), ""); + DocumentUndo::done(document, C_("Undo", "Set viewbox size"), ""); update_scale_ui(desktop); } @@ -412,7 +412,7 @@ void DocumentProperties::set_document_scale(SPDesktop* desktop, double scale) { set_document_scale_helper(*document, scale); update_viewbox_ui(desktop); update_scale_ui(desktop); - DocumentUndo::done(document, _("Set page scale"), ""); + DocumentUndo::done(document, C_("Undo", "Set page scale"), ""); } } @@ -591,7 +591,7 @@ void DocumentProperties::build_page() page_manager.selectPage(0); // fit page to selection or content, if there's no selection page_manager.fitToSelection(_wr.desktop()->getSelection()); - DocumentUndo::done(document, _("Resize page to fit"), INKSCAPE_ICON("tool-pages")); + DocumentUndo::done(document, C_("Undo", "Resize page to fit"), INKSCAPE_ICON("tool-pages")); update_widgets(); } }); @@ -714,7 +714,7 @@ void DocumentProperties::linkSelectedProfile() auto filename = Glib::filename_to_uri(Glib::filename_from_utf8(file)); document->getDocumentCMS().attachProfileToDoc(filename, ColorProfileStorage::HREF_FILE, Colors::RenderingIntent::AUTO, name); // inform the document, so we can undo - DocumentUndo::done(document, _("Link Color Profile"), ""); + DocumentUndo::done(document, C_("Undo", "Link Color Profile"), ""); populate_linked_profiles_box(); } @@ -764,7 +764,7 @@ void DocumentProperties::removeSelectedProfile(){ if (auto document = getDocument()) { if (auto colorprofile = document->getDocumentCMS().getColorProfileForSpace(name)) { colorprofile->deleteObject(true, false); - DocumentUndo::done(document, _("Remove linked color profile"), ""); + DocumentUndo::done(document, C_("Undo", "Remove linked color profile"), ""); } } @@ -1116,7 +1116,7 @@ void DocumentProperties::addExternalScript(){ xml_doc->root()->addChild(scriptRepr, nullptr); // inform the document, so we can undo - DocumentUndo::done(document, _("Add external script..."), ""); + DocumentUndo::done(document, C_("Undo", "Add external script..."), ""); populate_script_lists(); } @@ -1176,7 +1176,7 @@ void DocumentProperties::addEmbeddedScript(){ xml_doc->root()->addChild(scriptRepr, nullptr); // inform the document, so we can undo - DocumentUndo::done(document, _("Add embedded script..."), ""); + DocumentUndo::done(document, C_("Undo", "Add embedded script..."), ""); populate_script_lists(); } } @@ -1208,7 +1208,7 @@ void DocumentProperties::removeExternalScript(){ sp_repr_unparent(repr); // inform the document, so we can undo - DocumentUndo::done(document, _("Remove external script"), ""); + DocumentUndo::done(document, C_("Undo", "Remove external script"), ""); } } } @@ -1236,7 +1236,7 @@ void DocumentProperties::removeEmbeddedScript(){ sp_repr_unparent(repr); // inform the document, so we can undo - DocumentUndo::done(document, _("Remove embedded script"), ""); + DocumentUndo::done(document, C_("Undo", "Remove embedded script"), ""); } } } @@ -1333,7 +1333,7 @@ void DocumentProperties::editEmbeddedScript(){ //TODO repr->set_content(_EmbeddedContent.get_buffer()->get_text()); // inform the document, so we can undo - DocumentUndo::done(document, _("Edit embedded script"), ""); + DocumentUndo::done(document, C_("Undo", "Edit embedded script"), ""); } } } @@ -1670,7 +1670,7 @@ void DocumentProperties::onNewGrid(GridType grid_type) // flip global switch, so snapping to grid works desktop->getNamedView()->newGridCreated(); - DocumentUndo::done(document, _("Create new grid"), INKSCAPE_ICON("document-properties")); + DocumentUndo::done(document, C_("Undo", "Create new grid"), INKSCAPE_ICON("document-properties")); // scroll to the last (newly added) grid, so we can see it; postponed till idle time, since scrolling // range is not yet updated, despite new grid UI being in place already @@ -1912,7 +1912,7 @@ GridWidget::GridWidget(SPGrid *grid) _delete->signal_clicked().connect([this](){ auto doc = getGrid()->document; getGrid()->deleteObject(); - DocumentUndo::done(doc, _("Remove grid"), INKSCAPE_ICON("document-properties")); + DocumentUndo::done(doc, C_("Undo", "Remove grid"), INKSCAPE_ICON("document-properties")); }); _delete->set_hexpand(); _delete->set_halign(Gtk::Align::END); diff --git a/src/ui/dialog/document-resources.cpp b/src/ui/dialog/document-resources.cpp index f6445de5ff8650d5f802f36c823ca3506a5cb05e..2b82cae284d281508745ff273f595a27eabec391 100644 --- a/src/ui/dialog/document-resources.cpp +++ b/src/ui/dialog/document-resources.cpp @@ -228,12 +228,12 @@ static void delete_object(SPObject* object, Inkscape::Selection* selection) { if (auto pattern = cast(object)) { // delete action fails for patterns; remove them by deleting them directly pattern->deleteObject(true); - DocumentUndo::done(document, _("Delete pattern"), INKSCAPE_ICON("document-resources")); + DocumentUndo::done(document, C_("Undo", "Delete pattern"), INKSCAPE_ICON("document-resources")); } else if (auto gradient = cast(object)) { // delete action fails for gradients; remove them by deleting them directly gradient->deleteObject(true); - DocumentUndo::done(document, _("Delete gradient"), INKSCAPE_ICON("document-resources")); + DocumentUndo::done(document, C_("Undo", "Delete gradient"), INKSCAPE_ICON("document-resources")); } else { selection->set(object); @@ -1267,7 +1267,7 @@ void DocumentResources::end_editing(const Glib::ustring& path, const Glib::ustri // row[g_item_columns.label] = label_fmt(new_text.c_str(), id); if (auto document = object->document) { - DocumentUndo::done(document, _("Edit object title"), INKSCAPE_ICON("document-resources")); + DocumentUndo::done(document, C_("Undo", "Edit object title"), INKSCAPE_ICON("document-resources")); } } diff --git a/src/ui/dialog/export-batch.cpp b/src/ui/dialog/export-batch.cpp index aee93f23ac9a4750824120d734c8ff946681a758..685904460619b3d2db8c6a2943deac321ac8abf4 100644 --- a/src/ui/dialog/export-batch.cpp +++ b/src/ui/dialog/export-batch.cpp @@ -748,7 +748,7 @@ void BatchExport::onExport() setBatchPath(path); setBatchName(name); - DocumentUndo::done(_document, _("Set Batch Export Options"), INKSCAPE_ICON("export")); + DocumentUndo::done(_document, C_("Undo", "Set Batch Export Options"), INKSCAPE_ICON("export")); // create vector of exports int num_rows = export_list.get_rows(); diff --git a/src/ui/dialog/export-single.cpp b/src/ui/dialog/export-single.cpp index 7b9c3cf02231a182b38cd488209b739da3719879..ca5858182e767b8522ae2033910657e7c8cb94f5 100644 --- a/src/ui/dialog/export-single.cpp +++ b/src/ui/dialog/export-single.cpp @@ -785,7 +785,7 @@ void SingleExport::onExport() } if (target) { saveExportHints(target); - DocumentUndo::done(_document, _("Set Export Options"), INKSCAPE_ICON("export")); + DocumentUndo::done(_document, C_("Undo", "Set Export Options"), INKSCAPE_ICON("export")); } } setExporting(false); diff --git a/src/ui/dialog/filter-effects-dialog.cpp b/src/ui/dialog/filter-effects-dialog.cpp index e1c8cd014e46f1219095f0d2fbaa7d85239dcb33..c89dd409c2493641bd834c983b9c0e44e035ebb9 100644 --- a/src/ui/dialog/filter-effects-dialog.cpp +++ b/src/ui/dialog/filter-effects-dialog.cpp @@ -1062,7 +1062,8 @@ private: g_assert(filter); filter->requestModified(SP_OBJECT_MODIFIED_FLAG); - DocumentUndo::done(prim->document, _("New transfer function type"), INKSCAPE_ICON("dialog-filters")); + DocumentUndo::done(prim->document, C_("Undo", "New transfer function type"), + INKSCAPE_ICON("dialog-filters")); update(); } } @@ -1194,7 +1195,7 @@ private: Inkscape::GC::release(repr); } - DocumentUndo::done(prim->document, _("New light source"), INKSCAPE_ICON("dialog-filters")); + DocumentUndo::done(prim->document, C_("Undo", "New light source"), INKSCAPE_ICON("dialog-filters")); update(); } @@ -1387,7 +1388,7 @@ void FilterEffectsDialog::FilterModifier::on_name_edited(const Glib::ustring& pa if (auto iter = _filters_model->get_iter(path)) { SPFilter* filter = (*iter)[_columns.filter]; filter->setLabel(text.c_str()); - DocumentUndo::done(filter->document, _("Rename filter"), INKSCAPE_ICON("dialog-filters")); + DocumentUndo::done(filter->document, C_("Undo", "Rename filter"), INKSCAPE_ICON("dialog-filters")); if (iter) { (*iter)[_columns.label] = text; } @@ -1445,7 +1446,7 @@ void FilterEffectsDialog::FilterModifier::selection_toggled(Gtk::TreeModel::iter } update_selection(sel); - DocumentUndo::done(doc, _("Apply filter"), INKSCAPE_ICON("dialog-filters")); + DocumentUndo::done(doc, C_("Undo", "Apply filter"), INKSCAPE_ICON("dialog-filters")); } void FilterEffectsDialog::FilterModifier::update_counts() @@ -1572,7 +1573,7 @@ void FilterEffectsDialog::FilterModifier::add_filter() select_filter(filter); - DocumentUndo::done(doc, _("Add filter"), INKSCAPE_ICON("dialog-filters")); + DocumentUndo::done(doc, C_("Undo", "Add filter"), INKSCAPE_ICON("dialog-filters")); } void FilterEffectsDialog::FilterModifier::remove_filter() @@ -1605,7 +1606,7 @@ void FilterEffectsDialog::FilterModifier::remove_filter() //XML Tree being used directly here while it shouldn't be. sp_repr_unparent(filter->getRepr()); - DocumentUndo::done(doc, _("Remove filter"), INKSCAPE_ICON("dialog-filters")); + DocumentUndo::done(doc, C_("Undo", "Remove filter"), INKSCAPE_ICON("dialog-filters")); update_filters(); @@ -1627,7 +1628,7 @@ void FilterEffectsDialog::FilterModifier::duplicate_filter() repr = repr->duplicate(repr->document()); parent->appendChild(repr); - DocumentUndo::done(filter->document, _("Duplicate filter"), INKSCAPE_ICON("dialog-filters")); + DocumentUndo::done(filter->document, C_("Undo", "Duplicate filter"), INKSCAPE_ICON("dialog-filters")); update_filters(); } @@ -1890,7 +1891,8 @@ void FilterEffectsDialog::PrimitiveList::remove_selected() //XML Tree being used directly here while it shouldn't be. sp_repr_unparent(prim->getRepr()); - DocumentUndo::done(_dialog.getDocument(), _("Remove filter primitive"), INKSCAPE_ICON("dialog-filters")); + DocumentUndo::done(_dialog.getDocument(), C_("Undo", "Remove filter primitive"), + INKSCAPE_ICON("dialog-filters")); update(); } @@ -2410,7 +2412,8 @@ FilterEffectsDialog::PrimitiveList::on_click_released(Gtk::GestureClick const &c if(!in_val) { //XML Tree being used directly here while it shouldn't be. sp_repr_unparent(o.getRepr()); - DocumentUndo::done(prim->document, _("Remove merge node"), INKSCAPE_ICON("dialog-filters")); + DocumentUndo::done(prim->document, C_("Undo", "Remove merge node"), + INKSCAPE_ICON("dialog-filters")); selected_iter->set_value(_columns.primitive, prim); } else { _dialog.set_attr(&o, SPAttr::IN_, in_val); @@ -2529,7 +2532,7 @@ void FilterEffectsDialog::PrimitiveList::on_drag_end(Glib::RefPtr con } filter->requestModified(SP_OBJECT_MODIFIED_FLAG); - DocumentUndo::done(filter->document, _("Reorder filter primitive"), INKSCAPE_ICON("dialog-filters")); + DocumentUndo::done(filter->document, C_("Undo", "Reorder filter primitive"), INKSCAPE_ICON("dialog-filters")); } static void autoscroll(Glib::RefPtr const &a, double const delta) @@ -3050,7 +3053,7 @@ void FilterEffectsDialog::add_filter_primitive(Filters::FilterPrimitiveType type if (auto filter = _filter_modifier.get_selected_filter()) { SPFilterPrimitive* prim = filter_add_primitive(filter, type); _primitive_list.select(prim); - DocumentUndo::done(filter->document, _("Add filter primitive"), INKSCAPE_ICON("dialog-filters")); + DocumentUndo::done(filter->document, C_("Undo", "Add filter primitive"), INKSCAPE_ICON("dialog-filters")); } } @@ -3072,7 +3075,7 @@ void FilterEffectsDialog::duplicate_primitive() repr = origprim->getRepr()->duplicate(origprim->getRepr()->document()); filter->getRepr()->appendChild(repr); - DocumentUndo::done(filter->document, _("Duplicate filter primitive"), INKSCAPE_ICON("dialog-filters")); + DocumentUndo::done(filter->document, C_("Undo", "Duplicate filter primitive"), INKSCAPE_ICON("dialog-filters")); _primitive_list.update(); } diff --git a/src/ui/dialog/find.cpp b/src/ui/dialog/find.cpp index 92b7ac19fb6fa6708ae0c1c21235f43ce7e2f129..1cedb2afac2dd4632e1f03402e8890463130137e 100644 --- a/src/ui/dialog/find.cpp +++ b/src/ui/dialog/find.cpp @@ -1022,7 +1022,8 @@ void Find::onAction() scroll_to_show_item(desktop, item); if (_action_replace) { - DocumentUndo::done(desktop->getDocument(), _("Replace text or property"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Replace text or property"), + INKSCAPE_ICON("draw-text")); } } else { diff --git a/src/ui/dialog/glyphs.cpp b/src/ui/dialog/glyphs.cpp index d51713211f4525c208449cb5a80cddca8e2a4f98..1fe454d336009ca2d30a0379468411795c2698a1 100644 --- a/src/ui/dialog/glyphs.cpp +++ b/src/ui/dialog/glyphs.cpp @@ -587,7 +587,7 @@ void GlyphsPanel::insertText() Glib::ustring combined = sp_te_get_string_multiline(textItem); combined += glyphs; sp_te_set_repr_text_multiline(textItem, combined.c_str()); - DocumentUndo::done(getDocument(), _("Append text"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(getDocument(), C_("Undo", "Append text"), INKSCAPE_ICON("draw-text")); } } } diff --git a/src/ui/dialog/grid-arrange-tab.cpp b/src/ui/dialog/grid-arrange-tab.cpp index 2b4126e711dc57e67a11cd173bbaf9a38a20ba3e..6ef73080e7aec12d93bcf5bad438ac60ec71334f 100644 --- a/src/ui/dialog/grid-arrange-tab.cpp +++ b/src/ui/dialog/grid-arrange-tab.cpp @@ -256,7 +256,8 @@ void GridArrangeTab::arrange() } } - DocumentUndo::done(desktop->getDocument(), _("Arrange in a grid"), INKSCAPE_ICON("dialog-align-and-distribute")); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Arrange in a grid"), + INKSCAPE_ICON("dialog-align-and-distribute")); } //######################################################################### diff --git a/src/ui/dialog/guides.cpp b/src/ui/dialog/guides.cpp index d059eb062a95c7056e6f99334956fbbe125d0cb0..0e2c9e3dc9574bfd554d9f9ca4f4d228070e95ff 100644 --- a/src/ui/dialog/guides.cpp +++ b/src/ui/dialog/guides.cpp @@ -96,7 +96,7 @@ void GuidelinePropertiesDialog::_modeChanged() void GuidelinePropertiesDialog::_onOK() { _onOKimpl(); - DocumentUndo::done(_guide->document, _("Set guide properties"), ""); + DocumentUndo::done(_guide->document, C_("Undo", "Set guide properties"), ""); } void GuidelinePropertiesDialog::_onOKimpl() @@ -147,14 +147,14 @@ void GuidelinePropertiesDialog::_onDelete() { SPDocument *doc = _guide->document; if (_guide->remove(true)) - DocumentUndo::done(doc, _("Delete guide"), ""); + DocumentUndo::done(doc, C_("Undo", "Delete guide"), ""); } void GuidelinePropertiesDialog::_onDuplicate() { _guide = _guide->duplicate(); _onOKimpl(); - DocumentUndo::done(_guide->document, _("Duplicate guide"), ""); + DocumentUndo::done(_guide->document, C_("Undo", "Duplicate guide"), ""); } void GuidelinePropertiesDialog::_setup() diff --git a/src/ui/dialog/layer-properties.cpp b/src/ui/dialog/layer-properties.cpp index 8d03d7ffa170cbf9f9d542f596cd6a0eda71b88a..cae536abaee87febfbb77269ef667a70f239e805 100644 --- a/src/ui/dialog/layer-properties.cpp +++ b/src/ui/dialog/layer-properties.cpp @@ -161,8 +161,8 @@ void LayerPropertiesDialog::_doCreate() } _desktop->getSelection()->clear(); _desktop->layerManager().setCurrentLayer(new_layer); - DocumentUndo::done(_desktop->getDocument(), _("Add layer"), INKSCAPE_ICON("layer-new")); - _desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("New layer created.")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Add layer"), INKSCAPE_ICON("layer-new")); + _desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, C_("Undo", "New layer created.")); } /** Moves selection to the chosen layer */ @@ -170,7 +170,8 @@ void LayerPropertiesDialog::_doMove() { if (auto moveto = _selectedLayer()) { _desktop->getSelection()->toLayer(moveto); - DocumentUndo::done(_desktop->getDocument(), _("Move selection to layer"), INKSCAPE_ICON("selection-move-to-layer")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Move selection to layer"), + INKSCAPE_ICON("selection-move-to-layer")); } } @@ -190,7 +191,7 @@ void LayerPropertiesDialog::_doRename() layman.renameLayer(layman.currentLayer(), name.c_str(), false); - DocumentUndo::done(_desktop->getDocument(), _("Rename layer"), INKSCAPE_ICON("layer-rename")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Rename layer"), INKSCAPE_ICON("layer-rename")); // TRANSLATORS: This means "The layer has been renamed" _desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Renamed layer")); } diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index 70c58e55a65260c27a92cc0458f7def238c8425a..e7842415498d871e292ea180779bdda60f3d9601 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -298,7 +298,7 @@ LivePathEffectEditor::toggleVisible(Inkscape::LivePathEffect::Effect *lpe , Gtk: lpe->doOnVisibilityToggled(current_lpeitem); DocumentUndo::done(getDocument(), - !visible ? _("Deactivate path effect") : _("Activate path effect"), + !visible ? C_("Undo", "Deactivate path effect") : C_("Undo", "Activate path effect"), INKSCAPE_ICON("dialog-path-effects")); } @@ -455,7 +455,8 @@ void LivePathEffectEditor::onAdd(LivePathEffect::EffectType etype) if (key == "clone_original") { current_lpeitem->getCurrentLPE()->refresh_widgets = true; selection_changed_lock = false; - DocumentUndo::done(getDocument(), _("Create and apply path effect"), INKSCAPE_ICON("dialog-path-effects")); + DocumentUndo::done(getDocument(), C_("Undo", "Create and apply path effect"), + INKSCAPE_ICON("dialog-path-effects")); return; } } @@ -463,7 +464,8 @@ void LivePathEffectEditor::onAdd(LivePathEffect::EffectType etype) if (current_lpeitem) { LivePathEffect::Effect::createAndApply(key.c_str(), getDocument(), current_lpeitem); current_lpeitem->getCurrentLPE()->refresh_widgets = true; - DocumentUndo::done(getDocument(), _("Create and apply path effect"), INKSCAPE_ICON("dialog-path-effects")); + DocumentUndo::done(getDocument(), C_("Undo", "Create and apply path effect"), + INKSCAPE_ICON("dialog-path-effects")); } } @@ -943,7 +945,7 @@ LivePathEffectEditor::lpeFlatten(PathEffectSharedPtr const &lperef) if (selection && selection->isEmpty() ) { selection->add(current_lpeitem); } - DocumentUndo::done(getDocument(), _("Flatten path effect(s)"), INKSCAPE_ICON("dialog-path-effects")); + DocumentUndo::done(getDocument(), C_("Undo", "Flatten path effect(s)"), INKSCAPE_ICON("dialog-path-effects")); return false; } @@ -965,7 +967,7 @@ LivePathEffectEditor::removeEffect(Gtk::Expander * expander) { } effect_list_reload(current_lpeitem); } - DocumentUndo::done(getDocument(), _("Remove path effect"), INKSCAPE_ICON("dialog-path-effects")); + DocumentUndo::done(getDocument(), C_("Undo", "Remove path effect"), INKSCAPE_ICON("dialog-path-effects")); } /* diff --git a/src/ui/dialog/object-attributes.cpp b/src/ui/dialog/object-attributes.cpp index f73c6d515168495177bd16ed349e609f6fed09bc..10753187205487c0ce5619a50678df8d24543727 100644 --- a/src/ui/dialog/object-attributes.cpp +++ b/src/ui/dialog/object-attributes.cpp @@ -244,7 +244,7 @@ void remove_lpeffect(SPLPEItem* item, LivePathEffect::EffectType type) { item->setCurrentPathEffect(effect); auto document = item->document; item->removeCurrentPathEffect(false); - DocumentUndo::done(document, _("Removed live path effect"), INKSCAPE_ICON("dialog-path-effects")); + DocumentUndo::done(document, C_("Undo", "Removed live path effect"), INKSCAPE_ICON("dialog-path-effects")); } } @@ -316,7 +316,8 @@ void details::AttributesPanel::change_value_px(SPObject* object, const Glib::Ref object->removeAttribute(attr); } - DocumentUndo::done(object->document, _("Change object attribute"), ""); //TODO INKSCAPE_ICON("draw-rectangle")); + DocumentUndo::done(object->document, C_("Undo", "Change object attribute"), + ""); // TODO INKSCAPE_ICON("draw-rectangle")); } void details::AttributesPanel::change_angle(SPObject* object, const Glib::RefPtr& adj, std::function&& setter) { @@ -327,7 +328,8 @@ void details::AttributesPanel::change_angle(SPObject* object, const Glib::RefPtr auto value = degree_to_radians_mod2pi(adj->get_value()); setter(value); - DocumentUndo::done(object->document, _("Change object attribute"), ""); //TODO INKSCAPE_ICON("draw-rectangle")); + DocumentUndo::done(object->document, C_("Undo", "Change object attribute"), + ""); // TODO INKSCAPE_ICON("draw-rectangle")); } void details::AttributesPanel::change_value(SPObject* object, const Glib::RefPtr& adj, std::function&& setter) { @@ -338,7 +340,8 @@ void details::AttributesPanel::change_value(SPObject* object, const Glib::RefPtr auto value = adj ? adj->get_value() : 0; setter(value); - DocumentUndo::done(object->document, _("Change object attribute"), ""); //TODO INKSCAPE_ICON("draw-rectangle")); + DocumentUndo::done(object->document, C_("Undo", "Change object attribute"), + ""); // TODO INKSCAPE_ICON("draw-rectangle")); } /////////////////////////////////////////////////////////////////////////////// @@ -514,7 +517,8 @@ public: // add flexible corners effect if not yet present if (!find_lpeffect(_rect, LivePathEffect::FILLET_CHAMFER)) { LivePathEffect::Effect::createAndApply("fillet_chamfer", _rect->document, _rect); - DocumentUndo::done(_rect->document, _("Add fillet/chamfer effect"), INKSCAPE_ICON("dialog-path-effects")); + DocumentUndo::done(_rect->document, C_("Undo", "Add fillet/chamfer effect"), + INKSCAPE_ICON("dialog-path-effects")); } }); } @@ -657,7 +661,7 @@ public: _ellipse->setAttribute("sodipodi:open", open ? "true" : nullptr); _ellipse->setAttribute("sodipodi:arc-type", arc_type.c_str()); _ellipse->updateRepr(); - DocumentUndo::done(_ellipse->document, _("Change arc type"), INKSCAPE_ICON("draw-ellipse")); + DocumentUndo::done(_ellipse->document, C_("Undo", "Change arc type"), INKSCAPE_ICON("draw-ellipse")); } private: diff --git a/src/ui/dialog/object-properties.cpp b/src/ui/dialog/object-properties.cpp index 4c24dc2029ad4b2321fb225b3af559e64d3cbb1f..4a7397c30bca7eb899e8b3f3c307f5c2499227c3 100644 --- a/src/ui/dialog/object-properties.cpp +++ b/src/ui/dialog/object-properties.cpp @@ -431,7 +431,7 @@ void ObjectProperties::_labelChanged() } else { _label_id.set_markup_with_mnemonic(_("_ID:") + Glib::ustring(" ")); item->setAttribute("id", id); - DocumentUndo::done(getDocument(), _("Set object ID"), INKSCAPE_ICON("dialog-object-properties")); + DocumentUndo::done(getDocument(), C_("Undo", "Set object ID"), INKSCAPE_ICON("dialog-object-properties")); } g_free(id); @@ -445,19 +445,19 @@ void ObjectProperties::_labelChanged() char const *currentlabel = obj->label(); if (label.compare(currentlabel ? currentlabel : "")) { obj->setLabel(label.c_str()); - DocumentUndo::done(getDocument(), _("Set object label"), INKSCAPE_ICON("dialog-object-properties")); + DocumentUndo::done(getDocument(), C_("Undo", "Set object label"), INKSCAPE_ICON("dialog-object-properties")); } /* Retrieve the title */ if (obj->setTitle(_entry_title.get_text().c_str())) { - DocumentUndo::done(getDocument(), _("Set object title"), INKSCAPE_ICON("dialog-object-properties")); + DocumentUndo::done(getDocument(), C_("Undo", "Set object title"), INKSCAPE_ICON("dialog-object-properties")); } /* Retrieve the DPI */ if (is(obj)) { Glib::ustring dpi_value = Inkscape::ustring::format_classic(_spin_dpi.get_value()); obj->setAttribute("inkscape:svg-dpi", dpi_value); - DocumentUndo::done(getDocument(), _("Set image DPI"), INKSCAPE_ICON("dialog-object-properties")); + DocumentUndo::done(getDocument(), C_("Undo", "Set image DPI"), INKSCAPE_ICON("dialog-object-properties")); } /* Retrieve the description */ @@ -465,7 +465,8 @@ void ObjectProperties::_labelChanged() _tv_description.get_buffer()->get_bounds(start, end); Glib::ustring desc = _tv_description.get_buffer()->get_text(start, end, TRUE); if (obj->setDesc(desc.c_str())) { - DocumentUndo::done(getDocument(), _("Set object description"), INKSCAPE_ICON("dialog-object-properties")); + DocumentUndo::done(getDocument(), C_("Undo", "Set object description"), + INKSCAPE_ICON("dialog-object-properties")); } _blocked = false; @@ -478,7 +479,8 @@ void ObjectProperties::_highlightChanged(Colors::Color const &color) if (auto item = getSelection()->singleItem()) { item->setHighlight(color); - DocumentUndo::done(getDocument(), _("Set item highlight color"), INKSCAPE_ICON("dialog-object-properties")); + DocumentUndo::done(getDocument(), C_("Undo", "Set item highlight color"), + INKSCAPE_ICON("dialog-object-properties")); } } @@ -493,7 +495,8 @@ void ObjectProperties::_sensitivityToggled() _blocked = true; item->setLocked(_cb_lock.get_active()); - DocumentUndo::done(getDocument(), _cb_lock.get_active() ? _("Lock object") : _("Unlock object"), INKSCAPE_ICON("dialog-object-properties")); + DocumentUndo::done(getDocument(), _cb_lock.get_active() ? C_("Undo", "Lock object") : C_("Undo", "Unlock object"), + INKSCAPE_ICON("dialog-object-properties")); _blocked = false; } @@ -519,7 +522,7 @@ void ObjectProperties::_aspectRatioToggled() if (is(item)) { Glib::ustring dpi_value = Inkscape::ustring::format_classic(_spin_dpi.get_value()); item->setAttribute("preserveAspectRatio", active); - DocumentUndo::done(getDocument(), _("Set preserve ratio"), INKSCAPE_ICON("dialog-object-properties")); + DocumentUndo::done(getDocument(), C_("Undo", "Set preserve ratio"), INKSCAPE_ICON("dialog-object-properties")); } _blocked = false; } @@ -535,7 +538,8 @@ void ObjectProperties::_hiddenToggled() _blocked = true; item->setExplicitlyHidden(_cb_hide.get_active()); - DocumentUndo::done(getDocument(), _cb_hide.get_active() ? _("Hide object") : _("Unhide object"), INKSCAPE_ICON("dialog-object-properties")); + DocumentUndo::done(getDocument(), _cb_hide.get_active() ? C_("Undo", "Hide object") : C_("Undo", "Unhide object"), + INKSCAPE_ICON("dialog-object-properties")); _blocked = false; } diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp index 50c899242853593af6949dead75c2b40e05f9e8d..75251731f005575bfd0c0a92e2513e5f15c84cd7 100644 --- a/src/ui/dialog/objects.cpp +++ b/src/ui/dialog/objects.cpp @@ -874,7 +874,7 @@ ObjectsPanel::ObjectsPanel() for (auto const &btn : _blend_items) { btn.second->property_active().set_value(btn.first == data.id); } - DocumentUndo::done(getDocument(), "set-blend-mode", _("Change blend mode")); + DocumentUndo::done(getDocument(), "set-blend-mode", C_("Undo", "Change blend mode")); } }); _blend_items[data.id] = check; @@ -1264,7 +1264,7 @@ bool ObjectsPanel::toggleVisible(Gdk::ModifierType const state, Gtk::TreeModel:: // Toggle Visible for layers (hide all other layers) if (desktop->layerManager().isLayer(item)) { desktop->layerManager().toggleLayerSolo(item); - DocumentUndo::done(getDocument(), _("Hide other layers"), ""); + DocumentUndo::done(getDocument(), C_("Undo", "Hide other layers"), ""); } return true; } @@ -1334,7 +1334,7 @@ bool ObjectsPanel::toggleLocked(Gdk::ModifierType const state, Gtk::TreeModel::R // Toggle lock for layers (lock all other layers) if (desktop->layerManager().isLayer(item)) { desktop->layerManager().toggleLockOtherLayers(item); - DocumentUndo::done(getDocument(), _("Lock other layers"), ""); + DocumentUndo::done(getDocument(), C_("Undo", "Lock other layers"), ""); } return true; } @@ -1737,7 +1737,7 @@ void ObjectsPanel::_handleEdited(const Glib::ustring& path, const Glib::ustring& obj->setHighlight(obj->highlight_color()); } item->setLabel(new_text.c_str()); - DocumentUndo::done(getDocument(), _("Rename object"), ""); + DocumentUndo::done(getDocument(), C_("Undo", "Rename object"), ""); } } } @@ -1925,7 +1925,7 @@ bool ObjectsPanel::on_drag_drop(Glib::ValueBase const &/*value*/, double x, doub ? drop_repr : drop_repr->prev(); selection->toLayer(item->parent, after); } - DocumentUndo::done(document, _("Move items"), INKSCAPE_ICON("selection-move-to-layer")); + DocumentUndo::done(document, C_("Undo", "Move items"), INKSCAPE_ICON("selection-move-to-layer")); } drag_end_impl(); diff --git a/src/ui/dialog/polar-arrange-tab.cpp b/src/ui/dialog/polar-arrange-tab.cpp index 9e4739f9715056e5a6a32385d8f74011e50f8dea..7dcb09d1ecd5934905093e6797f22bf420f9da76 100644 --- a/src/ui/dialog/polar-arrange-tab.cpp +++ b/src/ui/dialog/polar-arrange-tab.cpp @@ -357,7 +357,8 @@ void PolarArrangeTab::arrange() } } - DocumentUndo::done(parent->getDesktop()->getDocument(), _("Arrange on ellipse"), INKSCAPE_ICON("dialog-align-and-distribute")); + DocumentUndo::done(parent->getDesktop()->getDocument(), C_("Undo", "Arrange on ellipse"), + INKSCAPE_ICON("dialog-align-and-distribute")); } void PolarArrangeTab::updateSelection() diff --git a/src/ui/dialog/selectorsdialog.cpp b/src/ui/dialog/selectorsdialog.cpp index 484263d69005f72c4d558337d540826693a43dee..eb4607b90c5141f244dff6229f150f6183558f5b 100644 --- a/src/ui/dialog/selectorsdialog.cpp +++ b/src/ui/dialog/selectorsdialog.cpp @@ -586,7 +586,7 @@ void SelectorsDialog::_writeStyleElement() } textNode->setContent(styleContent.c_str()); - DocumentUndo::done(SP_ACTIVE_DOCUMENT, _("Edited style element."), INKSCAPE_ICON("dialog-selectors")); + DocumentUndo::done(SP_ACTIVE_DOCUMENT, C_("Undo", "Edited style element."), INKSCAPE_ICON("dialog-selectors")); _updating = false; _scrollock = false; diff --git a/src/ui/dialog/spellcheck.cpp b/src/ui/dialog/spellcheck.cpp index b83de6fb58cd2fb1577cd9ce289fe94de2e604ea..613647e39b54b8ea88b9ea8ab8d1f7a372cc3be0 100644 --- a/src/ui/dialog/spellcheck.cpp +++ b/src/ui/dialog/spellcheck.cpp @@ -533,7 +533,7 @@ void SpellCheck::onAccept() // find the end of the word anew _end_w = _begin_w; _end_w.nextEndOfWord(); - DocumentUndo::done(getDocument(), _("Fix spelling"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(getDocument(), C_("Undo", "Fix spelling"), INKSCAPE_ICON("draw-text")); } } diff --git a/src/ui/dialog/styledialog.cpp b/src/ui/dialog/styledialog.cpp index 0bb1571dfaf103d1a4c7e627c9f14e3a7c25bd37..a2ed30df829bfd433d5f5aec56cf9e8ba5c05de0 100644 --- a/src/ui/dialog/styledialog.cpp +++ b/src/ui/dialog/styledialog.cpp @@ -1094,7 +1094,7 @@ void StyleDialog::_writeStyleElement(Glib::RefPtr const &store, iter->style->readFromObject(iter); iter->requestDisplayUpdate(SP_OBJECT_MODIFIED_FLAG | SP_OBJECT_STYLE_MODIFIED_FLAG); } - DocumentUndo::done(SP_ACTIVE_DOCUMENT, _("Edited style element."), ""); + DocumentUndo::done(SP_ACTIVE_DOCUMENT, C_("Undo", "Edited style element."), ""); g_debug("StyleDialog::_writeStyleElement(): | %s |", styleContent.c_str()); } diff --git a/src/ui/dialog/svg-fonts-dialog.cpp b/src/ui/dialog/svg-fonts-dialog.cpp index 20ef7beb1ebd79301c57e3f993080be57d045842..b669a8aca072a66c623e8e403aba5a58c6a2af68 100644 --- a/src/ui/dialog/svg-fonts-dialog.cpp +++ b/src/ui/dialog/svg-fonts-dialog.cpp @@ -509,7 +509,7 @@ SPItem* get_or_create_layer_for_glyph(SPDesktop* desktop, const Glib::ustring& f layers.renameLayer(layer, name.c_str(), false); - DocumentUndo::done(desktop->getDocument(), _("Add layer"), ""); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Add layer"), ""); return cast(layer); } @@ -808,7 +808,7 @@ void set_up_typography_canvas(SPDocument* document, double em, double asc, doubl guide->set_locked(true, true); } - DocumentUndo::done(document, _("Set up typography canvas"), ""); + DocumentUndo::done(document, C_("Undo", "Set up typography canvas"), ""); } const int MARGIN_SPACE = 4; @@ -1038,7 +1038,7 @@ void SvgFontsDialog::add_glyph(){ // empty name to begin with SPGlyph* glyph = font->create_new_glyph("", str.c_str()); - DocumentUndo::done(document, _("Add glyph"), ""); + DocumentUndo::done(document, C_("Undo", "Add glyph"), ""); // select newly added glyph set_selected_glyph(glyph); @@ -1106,7 +1106,7 @@ void SvgFontsDialog::set_glyph_description_from_selected_path() { auto units_per_em = get_font_units_per_em(font); //XML Tree being directly used here while it shouldn't be. glyph->setAttribute("d", sp_svg_write_path(flip_coordinate_system(pathv, font, units_per_em))); - DocumentUndo::done(getDocument(), _("Set glyph curves"), ""); + DocumentUndo::done(getDocument(), C_("Undo", "Set glyph curves"), ""); update_glyphs(glyph); } @@ -1141,7 +1141,7 @@ void SvgFontsDialog::missing_glyph_description_from_selected_path(){ if (is(&obj)){ //XML Tree being directly used here while it shouldn't be. obj.setAttribute("d", sp_svg_write_path(flip_coordinate_system(pathv, font, units_per_em))); - DocumentUndo::done(getDocument(), _("Set glyph curves"), ""); + DocumentUndo::done(getDocument(), C_("Undo", "Set glyph curves"), ""); } } @@ -1153,7 +1153,7 @@ void SvgFontsDialog::reset_missing_glyph_description(){ if (is(&obj)){ //XML Tree being directly used here while it shouldn't be. obj.setAttribute("d", "M0,0h1000v1024h-1000z"); - DocumentUndo::done(getDocument(), _("Reset missing-glyph"), ""); + DocumentUndo::done(getDocument(), C_("Undo", "Reset missing-glyph"), ""); } } refresh_svgfont(); @@ -1185,7 +1185,7 @@ void SvgFontsDialog::glyph_name_edit(const Glib::ustring&, const Glib::ustring& //XML Tree being directly used here while it shouldn't be. glyph->setAttribute("glyph-name", str); - DocumentUndo::done(getDocument(), _("Edit glyph name"), ""); + DocumentUndo::done(getDocument(), C_("Undo", "Edit glyph name"), ""); update_glyphs(glyph); }); } @@ -1200,7 +1200,7 @@ void SvgFontsDialog::glyph_unicode_edit(const Glib::ustring&, const Glib::ustrin // XML Tree being directly used here while it shouldn't be. glyph->setAttribute("unicode", str); - DocumentUndo::done(getDocument(), _("Set glyph unicode"), ""); + DocumentUndo::done(getDocument(), C_("Undo", "Set glyph unicode"), ""); update_glyphs(glyph); }); } @@ -1219,7 +1219,7 @@ void SvgFontsDialog::glyph_advance_edit(const Glib::ustring&, const Glib::ustrin // Check if input valid if ((is >> value)) { glyph->setAttribute("horiz-adv-x", str); - DocumentUndo::done(getDocument(), _("Set glyph advance"), ""); + DocumentUndo::done(getDocument(), C_("Undo", "Set glyph advance"), ""); update_glyphs(glyph); } else { @@ -1233,7 +1233,7 @@ void SvgFontsDialog::remove_selected_font(){ //XML Tree being directly used here while it shouldn't be. sp_repr_unparent(font->getRepr()); - DocumentUndo::done(getDocument(), _("Remove font"), ""); + DocumentUndo::done(getDocument(), C_("Undo", "Remove font"), ""); update_fonts(false); } @@ -1244,7 +1244,7 @@ void SvgFontsDialog::remove_selected_glyph(){ //XML Tree being directly used here while it shouldn't be. sp_repr_unparent(glyph->getRepr()); - DocumentUndo::done(getDocument(), _("Remove glyph"), ""); + DocumentUndo::done(getDocument(), C_("Undo", "Remove glyph"), ""); update_glyphs(); } @@ -1255,7 +1255,7 @@ void SvgFontsDialog::remove_selected_kerning_pair() { //XML Tree being directly used here while it shouldn't be. sp_repr_unparent(pair->getRepr()); - DocumentUndo::done(getDocument(), _("Remove kerning pair"), ""); + DocumentUndo::done(getDocument(), C_("Undo", "Remove kerning pair"), ""); update_glyphs(); } @@ -1305,7 +1305,7 @@ void SvgFontsDialog::edit_glyph(SPGlyph* glyph) { layers.setCurrentLayer(layer, true); layers.toggleLayerSolo(layer, true); layers.toggleLockOtherLayers(layer, true); - DocumentUndo::done(document, _("Toggle layer solo"), ""); + DocumentUndo::done(document, C_("Undo", "Toggle layer solo"), ""); } } @@ -1546,7 +1546,7 @@ void SvgFontsDialog::add_kerning_pair() { }); } - DocumentUndo::done(getDocument(), _("Add kerning pair"), ""); + DocumentUndo::done(getDocument(), C_("Undo", "Add kerning pair"), ""); } Gtk::Box* SvgFontsDialog::kerning_tab(){ @@ -1642,7 +1642,7 @@ void set_font_family(SPFont* font, char* str){ } } - DocumentUndo::done(font->document, _("Set font family"), ""); + DocumentUndo::done(font->document, C_("Undo", "Set font family"), ""); } void SvgFontsDialog::add_font(){ @@ -1665,7 +1665,7 @@ void SvgFontsDialog::add_font(){ update_fonts(false); on_font_selection_changed(); - DocumentUndo::done(doc, _("Add font"), ""); + DocumentUndo::done(doc, C_("Undo", "Add font"), ""); } SvgFontsDialog::SvgFontsDialog() diff --git a/src/ui/dialog/symbols.cpp b/src/ui/dialog/symbols.cpp index 9bc1c3f23660c7cf4026e7f7877693c9ce74cb27..0726bdbe685b85cfeab7e1ae40410cea36f5166f 100644 --- a/src/ui/dialog/symbols.cpp +++ b/src/ui/dialog/symbols.cpp @@ -740,7 +740,7 @@ void SymbolsDialog::revertSymbol() { if (auto current = SymbolsDialog::get_selected_symbol()) { if (auto symbol = cast(document->getObjectById(current->symbol_id))) { symbol->unSymbol(); - Inkscape::DocumentUndo::done(document, _("Group from symbol"), ""); + Inkscape::DocumentUndo::done(document, C_("Undo", "Group from symbol"), ""); } } } diff --git a/src/ui/dialog/text-edit.cpp b/src/ui/dialog/text-edit.cpp index efb5643dfc26124ca2dfffc48d4a16d2593cf497..cb05adfc75ba342e2090f0d79caaaf52d51249ba 100644 --- a/src/ui/dialog/text-edit.cpp +++ b/src/ui/dialog/text-edit.cpp @@ -530,7 +530,7 @@ void TextEdit::apply_changes(bool continuous) { DocumentUndo::maybeDone(desktop->getDocument(), "text-style", _("Set text style"), INKSCAPE_ICON("draw-text")); } else { - DocumentUndo::done(desktop->getDocument(), _("Set text style"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Set text style"), INKSCAPE_ICON("draw-text")); apply_button.set_sensitive(false); } diff --git a/src/ui/dialog/transformation.cpp b/src/ui/dialog/transformation.cpp index c1d1bad2a15cadb03e475e06a77c150239ea76d8..0b47aaf1f8e641092242844b5fbea87f64bc6bd4 100644 --- a/src/ui/dialog/transformation.cpp +++ b/src/ui/dialog/transformation.cpp @@ -731,7 +731,7 @@ void Transformation::applyPageMove(Inkscape::Selection *selection) } } - DocumentUndo::done( selection->desktop()->getDocument(), _("Move"), INKSCAPE_ICON("dialog-transform")); + DocumentUndo::done(selection->desktop()->getDocument(), C_("Undo", "Move"), INKSCAPE_ICON("dialog-transform")); } void Transformation::applyPageScale(Inkscape::Selection *selection) @@ -793,7 +793,7 @@ void Transformation::applyPageScale(Inkscape::Selection *selection) } } - DocumentUndo::done(selection->desktop()->getDocument(), _("Scale"), INKSCAPE_ICON("dialog-transform")); + DocumentUndo::done(selection->desktop()->getDocument(), C_("Undo", "Scale"), INKSCAPE_ICON("dialog-transform")); } void Transformation::applyPageRotate(Inkscape::Selection *selection) @@ -818,7 +818,7 @@ void Transformation::applyPageRotate(Inkscape::Selection *selection) } } - DocumentUndo::done(selection->desktop()->getDocument(), _("Rotate"), INKSCAPE_ICON("dialog-transform")); + DocumentUndo::done(selection->desktop()->getDocument(), C_("Undo", "Rotate"), INKSCAPE_ICON("dialog-transform")); } void Transformation::applyPageSkew(Inkscape::Selection *selection) @@ -914,7 +914,7 @@ void Transformation::applyPageSkew(Inkscape::Selection *selection) } } - DocumentUndo::done(selection->desktop()->getDocument(), _("Skew"), INKSCAPE_ICON("dialog-transform")); + DocumentUndo::done(selection->desktop()->getDocument(), C_("Undo", "Skew"), INKSCAPE_ICON("dialog-transform")); } void Transformation::applyPageTransform(Inkscape::Selection *selection) @@ -943,7 +943,8 @@ void Transformation::applyPageTransform(Inkscape::Selection *selection) selection->applyAffine(displayed); // post-multiply each object's transform } - DocumentUndo::done(selection->desktop()->getDocument(), _("Edit transformation matrix"), INKSCAPE_ICON("dialog-transform")); + DocumentUndo::done(selection->desktop()->getDocument(), C_("Undo", "Edit transformation matrix"), + INKSCAPE_ICON("dialog-transform")); } /*######################################################################## diff --git a/src/ui/drag-and-drop.cpp b/src/ui/drag-and-drop.cpp index a7b9976f8fd07b16ad3d3a94038f3722babc7002..fc70821d1939858cfd7c8ba0e8eb60838ebf6b16 100644 --- a/src/ui/drag-and-drop.cpp +++ b/src/ui/drag-and-drop.cpp @@ -244,17 +244,17 @@ bool on_drop(Glib::ValueBase const &value, double x, double y, SPDesktopWidget * if (desktop->getTool() && desktop->getTool()->get_drag()) { if (desktop->getTool()->get_drag()->dropColor(item, colorspec.c_str(), dt_pos)) { - DocumentUndo::done(doc , _("Drop color on gradient"), ""); + DocumentUndo::done(doc, C_("Undo", "Drop color on gradient"), ""); desktop->getTool()->get_drag()->updateDraggers(); return true; } } - //if (tools_active(desktop, TOOLS_TEXT)) { - // if (sp_text_context_drop_color(c, button_doc)) { - // SPDocumentUndo::done(doc , _("Drop color on gradient stop"), ""); - // } - //} + // if (tools_active(desktop, TOOLS_TEXT)) { + // if (sp_text_context_drop_color(c, button_doc)) { + // SPDocumentUndo::done(doc , C_("Undo", "Drop color on gradient stop"), ""); + // } + // } bool fillnotstroke = drop_target->get_current_drop()->get_actions() != Gdk::DragAction::MOVE; if (fillnotstroke && (is(item) || is(item) || is(item))) { @@ -284,7 +284,7 @@ bool on_drop(Glib::ValueBase const &value, double x, double y, SPDesktopWidget * sp_repr_css_attr_unref(css); item->updateRepr(); - DocumentUndo::done(doc, _("Drop color"), ""); + DocumentUndo::done(doc, C_("Undo", "Drop color"), ""); return true; } else if (auto const dndsvg = GlibValue::get(value)) { auto const data = get_span(dndsvg->bytes); @@ -325,7 +325,7 @@ bool on_drop(Glib::ValueBase const &value, double x, double y, SPDesktopWidget * } Inkscape::GC::release(newgroup); - DocumentUndo::done(doc, _("Drop SVG"), ""); + DocumentUndo::done(doc, C_("Undo", "Drop SVG"), ""); return true; } else if (G_VALUE_HOLDS(value.gobj(), GDK_TYPE_FILE_LIST)) { auto list = reinterpret_cast(g_value_get_boxed(value.gobj())); @@ -340,7 +340,7 @@ bool on_drop(Glib::ValueBase const &value, double x, double y, SPDesktopWidget * } else if (GlibValue::holds(value)) { auto cm = Inkscape::UI::ClipboardManager::get(); cm->insertSymbol(desktop, dt_pos, false); - DocumentUndo::done(doc, _("Drop Symbol"), ""); + DocumentUndo::done(doc, C_("Undo", "Drop Symbol"), ""); return true; } else if (G_VALUE_HOLDS(value.gobj(), GDK_TYPE_TEXTURE)) { auto const ext = Inkscape::Extension::find_by_mime("image/png"); @@ -357,7 +357,7 @@ bool on_drop(Glib::ValueBase const &value, double x, double y, SPDesktopWidget * ext->set_param_optiongroup("link", save ? "embed" : "link"); ext->set_gui(true); - DocumentUndo::done(doc, _("Drop bitmap image"), ""); + DocumentUndo::done(doc, C_("Undo", "Drop bitmap image"), ""); return true; } diff --git a/src/ui/knot/knot-holder.cpp b/src/ui/knot/knot-holder.cpp index 6d8043c96b4557c3b9f85f36d180b160d38aca9a..33a32f2c496957ad5540db5e37175fe3dddbc574 100644 --- a/src/ui/knot/knot-holder.cpp +++ b/src/ui/knot/knot-holder.cpp @@ -197,7 +197,7 @@ KnotHolder::knot_clicked_handler(SPKnot *knot, guint state) // for drag, this is done by ungrabbed_handler, but for click we must do it here if (saved_item && saved_item->document) { // increasingly aggressive sanity checks - DocumentUndo::done(saved_item->document, _("Change handle"), icon_name); + DocumentUndo::done(saved_item->document, C_("Undo", "Change handle"), icon_name); } else { std::terminate(); } @@ -318,7 +318,7 @@ KnotHolder::knot_ungrabbed_handler(SPKnot *knot, guint state) } else if (auto offset = cast(object)) { icon_name = offset->sourceHref ? INKSCAPE_ICON("path-offset-linked") : INKSCAPE_ICON("path-offset-dynamic"); } - DocumentUndo::done(object->document, _("Move handle"), icon_name); + DocumentUndo::done(object->document, C_("Undo", "Move handle"), icon_name); } void KnotHolder::add(KnotHolderEntity *e) diff --git a/src/ui/toolbar/arc-toolbar.cpp b/src/ui/toolbar/arc-toolbar.cpp index fdab410a6658ed7ad12554fcb41b582d7c5bf4d7..21f56553694c96dafba2352e48ac03cdd12d714d 100644 --- a/src/ui/toolbar/arc-toolbar.cpp +++ b/src/ui/toolbar/arc-toolbar.cpp @@ -234,7 +234,8 @@ void ArcToolbar::_valueChanged(Glib::RefPtr const &adj, Glib::u } if (modified) { - DocumentUndo::done(_desktop->getDocument(), _("Ellipse: Change radius"), INKSCAPE_ICON("draw-ellipse")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Ellipse: Change radius"), + INKSCAPE_ICON("draw-ellipse")); } } @@ -319,7 +320,7 @@ void ArcToolbar::_typeChanged(int type) } if (modified) { - DocumentUndo::done(_desktop->getDocument(), _("Arc: Change arc type"), INKSCAPE_ICON("draw-ellipse")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Arc: Change arc type"), INKSCAPE_ICON("draw-ellipse")); } } diff --git a/src/ui/toolbar/connector-toolbar.cpp b/src/ui/toolbar/connector-toolbar.cpp index 3303b6ee3bcb89036d0c4e5b9b3869595a338ae7..756af60cc40c970130447d1303ef39012de32b3f 100644 --- a/src/ui/toolbar/connector-toolbar.cpp +++ b/src/ui/toolbar/connector-toolbar.cpp @@ -176,7 +176,9 @@ void ConnectorToolbar::orthogonal_toggled() if (!modified) { Preferences::get()->setBool("/tools/connector/orthogonal", is_orthog); } else { - DocumentUndo::done(doc, is_orthog ? _("Set connector type: orthogonal"): _("Set connector type: polyline"), INKSCAPE_ICON("draw-connector")); + DocumentUndo::done( + doc, is_orthog ? C_("Undo", "Set connector type: orthogonal") : C_("Undo", "Set connector type: polyline"), + INKSCAPE_ICON("draw-connector")); } } @@ -212,7 +214,7 @@ void ConnectorToolbar::curvature_changed() if (!modified) { Preferences::get()->setDouble(Glib::ustring("/tools/connector/curvature"), newValue); } else { - DocumentUndo::done(doc, _("Change connector curvature"), INKSCAPE_ICON("draw-connector")); + DocumentUndo::done(doc, C_("Undo", "Change connector curvature"), INKSCAPE_ICON("draw-connector")); } } @@ -253,7 +255,7 @@ void ConnectorToolbar::spacing_changed() } if (modified) { - DocumentUndo::done(doc, _("Change connector spacing"), INKSCAPE_ICON("draw-connector")); + DocumentUndo::done(doc, C_("Undo", "Change connector spacing"), INKSCAPE_ICON("draw-connector")); } } @@ -271,7 +273,8 @@ void ConnectorToolbar::graph_layout() prefs->setInt("/options/clonecompensation/value", saved_compensation); - DocumentUndo::done(_desktop->getDocument(), _("Arrange connector network"), INKSCAPE_ICON("dialog-align-and-distribute")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Arrange connector network"), + INKSCAPE_ICON("dialog-align-and-distribute")); } void ConnectorToolbar::length_changed() diff --git a/src/ui/toolbar/gradient-toolbar.cpp b/src/ui/toolbar/gradient-toolbar.cpp index 0e316ca82523d46de424a1fe52fd2eba7cdfcd2e..80708c50577685ca857a66ec59857c16ffaa9347 100644 --- a/src/ui/toolbar/gradient-toolbar.cpp +++ b/src/ui/toolbar/gradient-toolbar.cpp @@ -556,7 +556,8 @@ void GradientToolbar::gradient_changed(int active) gr_apply_gradient(selection, ev ? ev->get_drag() : nullptr, gr); - DocumentUndo::done(_desktop->getDocument(), _("Assign gradient to object"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Assign gradient to object"), + INKSCAPE_ICON("color-gradient")); } /** @@ -598,7 +599,7 @@ void GradientToolbar::spread_changed(int active) item->setSpread(spread); item->updateRepr(); } - DocumentUndo::done(_desktop->getDocument(), _("Set gradient repeat"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Set gradient repeat"), INKSCAPE_ICON("color-gradient")); } } diff --git a/src/ui/toolbar/mesh-toolbar.cpp b/src/ui/toolbar/mesh-toolbar.cpp index d711e1d3e8722c4c96a1e8b135289da07dc439e4..aa1a880c9c217b461273cc138eeea38934766b34 100644 --- a/src/ui/toolbar/mesh-toolbar.cpp +++ b/src/ui/toolbar/mesh-toolbar.cpp @@ -398,7 +398,7 @@ void MeshToolbar::type_changed(int mode) } if (!meshes.empty()) { - DocumentUndo::done(_desktop->getDocument(), _("Set mesh type"), INKSCAPE_ICON("mesh-gradient")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Set mesh type"), INKSCAPE_ICON("mesh-gradient")); } } diff --git a/src/ui/toolbar/page-toolbar.cpp b/src/ui/toolbar/page-toolbar.cpp index 8845ddace2a4eb727f135e6c22403310891f4a81..347a10d9fb1ae779d20c3a0e0d06f71752be3ef5 100644 --- a/src/ui/toolbar/page-toolbar.cpp +++ b/src/ui/toolbar/page-toolbar.cpp @@ -383,7 +383,7 @@ void PageToolbar::sizeChanged() double height = _unit_to_size(match.fetch(4), height_unit, width_unit); if (width > 0 && height > 0) { _document->getPageManager().resizePage(width, height); - DocumentUndo::done(_document, _("Set page size"), INKSCAPE_ICON("tool-pages")); + DocumentUndo::done(_document, C_("Undo", "Set page size"), INKSCAPE_ICON("tool-pages")); } } setSizeText(); diff --git a/src/ui/toolbar/rect-toolbar.cpp b/src/ui/toolbar/rect-toolbar.cpp index 4887e6078d8eb2aa2a96a2590862ef0577ccadbc..2a39a61a621b9004401997f0b1e97e8114220405 100644 --- a/src/ui/toolbar/rect-toolbar.cpp +++ b/src/ui/toolbar/rect-toolbar.cpp @@ -234,7 +234,7 @@ void RectToolbar::_valueChanged(DerivedSpinButton &btn) _sensitivize(); if (modified) { - DocumentUndo::done(_desktop->getDocument(), _("Change rectangle"), INKSCAPE_ICON("draw-rectangle")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Change rectangle"), INKSCAPE_ICON("draw-rectangle")); } } diff --git a/src/ui/toolbar/spiral-toolbar.cpp b/src/ui/toolbar/spiral-toolbar.cpp index 3647e11ba3e2a501340b29bd60d27f939d2e7789..016497c3453f2d0098a8c54d0060a907e44648a2 100644 --- a/src/ui/toolbar/spiral-toolbar.cpp +++ b/src/ui/toolbar/spiral-toolbar.cpp @@ -173,7 +173,7 @@ void SpiralToolbar::_valueChanged(Glib::RefPtr &adj, Glib::ustr } if (modified) { - DocumentUndo::done(_desktop->getDocument(), _("Change spiral"), INKSCAPE_ICON("draw-spiral")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Change spiral"), INKSCAPE_ICON("draw-spiral")); } } diff --git a/src/ui/toolbar/star-toolbar.cpp b/src/ui/toolbar/star-toolbar.cpp index 30595c6999a331a65a235056e82dfa48965e619e..faf4784600c65754ac2651ff1e1c5d5f11475b4e 100644 --- a/src/ui/toolbar/star-toolbar.cpp +++ b/src/ui/toolbar/star-toolbar.cpp @@ -237,7 +237,8 @@ void StarToolbar::side_mode_changed(int mode) } if (!_batchundo) { - DocumentUndo::done(_desktop->getDocument(), flat ? _("Make polygon") : _("Make star"), INKSCAPE_ICON("draw-polygon-star")); + DocumentUndo::done(_desktop->getDocument(), flat ? C_("Undo", "Make polygon") : C_("Undo", "Make star"), + INKSCAPE_ICON("draw-polygon-star")); } } @@ -416,7 +417,8 @@ void StarToolbar::_setDefaults() _roundedness_item.get_adjustment()->set_value(rounded); _randomization_item.get_adjustment()->set_value(randomized); - DocumentUndo::done(_desktop->getDocument(), _("Star: Reset to defaults"), INKSCAPE_ICON("draw-polygon-star")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Star: Reset to defaults"), + INKSCAPE_ICON("draw-polygon-star")); _batchundo = false; } diff --git a/src/ui/toolbar/text-toolbar.cpp b/src/ui/toolbar/text-toolbar.cpp index 204d5976d6bb1ffc057627237becec5a903708d3..49c026054116ce20cef75b295776090734a062da 100644 --- a/src/ui/toolbar/text-toolbar.cpp +++ b/src/ui/toolbar/text-toolbar.cpp @@ -520,7 +520,8 @@ void TextToolbar::fontfamily_value_changed() if (mergeDefaultStyle(css)) { // If there is a selection, update - DocumentUndo::done(_desktop->getDocument(), _("Text: Change font family"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Text: Change font family"), + INKSCAPE_ICON("draw-text")); } sp_repr_css_attr_unref(css); } @@ -615,7 +616,8 @@ void TextToolbar::fontstyle_value_changed() sp_desktop_set_style(_desktop, css, true, true); if (mergeDefaultStyle(css)) { - DocumentUndo::done(_desktop->getDocument(), _("Text: Change font style"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Text: Change font style"), + INKSCAPE_ICON("draw-text")); } sp_repr_css_attr_unref(css); @@ -819,7 +821,7 @@ void TextToolbar::align_mode_changed(int mode) } if (mergeDefaultStyle(css)) { - DocumentUndo::done(_desktop->getDocument(), _("Text: Change alignment"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Text: Change alignment"), INKSCAPE_ICON("draw-text")); } sp_repr_css_attr_unref(css); @@ -854,7 +856,8 @@ void TextToolbar::writing_mode_changed(int mode) } if (mergeDefaultStyle(css)) { - DocumentUndo::done(_desktop->getDocument(), _("Text: Change writing mode"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Text: Change writing mode"), + INKSCAPE_ICON("draw-text")); } sp_repr_css_attr_unref(css); @@ -889,7 +892,7 @@ void TextToolbar::orientation_changed(int mode) } if (mergeDefaultStyle(css)) { - DocumentUndo::done(_desktop->getDocument(), _("Text: Change orientation"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Text: Change orientation"), INKSCAPE_ICON("draw-text")); } sp_repr_css_attr_unref (css); onDefocus(); @@ -920,7 +923,7 @@ void TextToolbar::direction_changed(int mode) } if (mergeDefaultStyle(css)) { - DocumentUndo::done(_desktop->getDocument(), _("Text: Change direction"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Text: Change direction"), INKSCAPE_ICON("draw-text")); } sp_repr_css_attr_unref(css); diff --git a/src/ui/tools/arc-tool.cpp b/src/ui/tools/arc-tool.cpp index 8f221914cb5e08ca919652848d0e1625bf2865c8..3829d5346743e8ee52b1f3cef9b4ac22cf826827 100644 --- a/src/ui/tools/arc-tool.cpp +++ b/src/ui/tools/arc-tool.cpp @@ -403,7 +403,7 @@ void ArcTool::finishItem() sp_lpe_item_update_patheffect(this->arc.get(), true, true); _desktop->getSelection()->set(arc.get()); - DocumentUndo::done(_desktop->getDocument(), _("Create ellipse"), INKSCAPE_ICON("draw-ellipse")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Create ellipse"), INKSCAPE_ICON("draw-ellipse")); this->arc = nullptr; } diff --git a/src/ui/tools/box3d-tool.cpp b/src/ui/tools/box3d-tool.cpp index 65228d319a0b23195f221ea1fd4ac3af971059b0..4a876f4e0678fd9618a705d156fc0dfc5b8020b5 100644 --- a/src/ui/tools/box3d-tool.cpp +++ b/src/ui/tools/box3d-tool.cpp @@ -296,37 +296,37 @@ bool Box3dTool::root_handler(CanvasEvent const &event) case GDK_KEY_bracketright: document->getCurrentPersp3D()->rotate_VP (Proj::X, 180 / snaps * y_dir, mod_alt(event)); - DocumentUndo::done(document, _("Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); + DocumentUndo::done(document, C_("Undo", "Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); ret = true; break; case GDK_KEY_bracketleft: document->getCurrentPersp3D()->rotate_VP (Proj::X, -180 / snaps * y_dir, mod_alt(event)); - DocumentUndo::done(document, _("Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); + DocumentUndo::done(document, C_("Undo", "Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); ret = true; break; case GDK_KEY_parenright: document->getCurrentPersp3D()->rotate_VP (Proj::Y, 180 / snaps * y_dir, mod_alt(event)); - DocumentUndo::done(document, _("Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); + DocumentUndo::done(document, C_("Undo", "Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); ret = true; break; case GDK_KEY_parenleft: document->getCurrentPersp3D()->rotate_VP (Proj::Y, -180 / snaps * y_dir, mod_alt(event)); - DocumentUndo::done(document, _("Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); + DocumentUndo::done(document, C_("Undo", "Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); ret = true; break; case GDK_KEY_braceright: document->getCurrentPersp3D()->rotate_VP (Proj::Z, 180 / snaps * y_dir, mod_alt(event)); - DocumentUndo::done(document, _("Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); + DocumentUndo::done(document, C_("Undo", "Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); ret = true; break; case GDK_KEY_braceleft: document->getCurrentPersp3D()->rotate_VP (Proj::Z, -180 / snaps * y_dir, mod_alt(event)); - DocumentUndo::done(document, _("Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); + DocumentUndo::done(document, C_("Undo", "Change perspective (angle of PLs)"), INKSCAPE_ICON("draw-cuboid")); ret = true; break; @@ -521,7 +521,7 @@ void Box3dTool::finishItem() box3d->relabel_corners(); - DocumentUndo::done(_desktop->getDocument(), _("Create 3D box"), INKSCAPE_ICON("draw-cuboid")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Create 3D box"), INKSCAPE_ICON("draw-cuboid")); box3d = nullptr; } diff --git a/src/ui/tools/calligraphic-tool.cpp b/src/ui/tools/calligraphic-tool.cpp index 00670f99bf134aed61ae47204765fd4360afcb53..366f8a5a448d5c8c84673863dbc4240f13724b10 100644 --- a/src/ui/tools/calligraphic-tool.cpp +++ b/src/ui/tools/calligraphic-tool.cpp @@ -883,7 +883,8 @@ void CalligraphicTool::set_to_accumulated(bool unionize, bool subtract) { this->repr = nullptr; } - DocumentUndo::done(_desktop->getDocument(), _("Draw calligraphic stroke"), INKSCAPE_ICON("draw-calligraphic")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Draw calligraphic stroke"), + INKSCAPE_ICON("draw-calligraphic")); } static void diff --git a/src/ui/tools/connector-tool.cpp b/src/ui/tools/connector-tool.cpp index 1f8a40ddd565e26eb31d2cbcedeaf6c7384bd362..8a972b22f3e8db24a90da3e9ae391e6a88517a9a 100644 --- a/src/ui/tools/connector-tool.cpp +++ b/src/ui/tools/connector-tool.cpp @@ -719,7 +719,7 @@ void ConnectorTool::_reroutingFinish(Geom::Point *const p) this->clickeditem->setHidden(false); sp_conn_reroute_path_immediate(cast(this->clickeditem)); this->clickeditem->updateRepr(); - DocumentUndo::done(doc, _("Reroute connector"), INKSCAPE_ICON("draw-connector")); + DocumentUndo::done(doc, C_("Undo", "Reroute connector"), INKSCAPE_ICON("draw-connector")); this->cc_set_active_conn(this->clickeditem); } @@ -866,7 +866,7 @@ void ConnectorTool::_flushWhite(SPCurve *c) Inkscape::GC::release(repr); } - DocumentUndo::done(doc, _("Create connector"), INKSCAPE_ICON("draw-connector")); + DocumentUndo::done(doc, C_("Undo", "Create connector"), INKSCAPE_ICON("draw-connector")); } @@ -1237,9 +1237,8 @@ void cc_selection_set_avoid(SPDesktop *desktop, bool const set_avoid) return; } - char *event_desc = (set_avoid) ? - _("Make connectors avoid selected objects") : - _("Make connectors ignore selected objects"); + auto event_desc = (set_avoid) ? C_("Undo", "Make connectors avoid selected objects") + : C_("Undo", "Make connectors ignore selected objects"); DocumentUndo::done(document, event_desc, INKSCAPE_ICON("draw-connector")); } diff --git a/src/ui/tools/dropper-tool.cpp b/src/ui/tools/dropper-tool.cpp index 65feb76da6ea6fed6a8305cb3cb7ff91084b87dd..bec164c056651445e79475c45232e728600ffffd 100644 --- a/src/ui/tools/dropper-tool.cpp +++ b/src/ui/tools/dropper-tool.cpp @@ -275,7 +275,8 @@ bool DropperTool::root_handler(CanvasEvent const &event) // REJON: set aux. toolbar input to hex color! if (!_desktop->getSelection()->isEmpty()) { - DocumentUndo::done(_desktop->getDocument(), _("Set picked color"), INKSCAPE_ICON("color-picker")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Set picked color"), + INKSCAPE_ICON("color-picker")); } if (dropping) { diff --git a/src/ui/tools/eraser-tool.cpp b/src/ui/tools/eraser-tool.cpp index ccfe045aaf5e08fd433061f341d4d74a48014a5e..6e1fb44739ab930c39cb5123a90c5ab0a13f344c 100644 --- a/src/ui/tools/eraser-tool.cpp +++ b/src/ui/tools/eraser-tool.cpp @@ -432,7 +432,7 @@ bool EraserTool::root_handler(CanvasEvent const &event) // Perform the actual erase operation auto document = _desktop->getDocument(); if (_doWork()) { - DocumentUndo::done(document, _("Draw eraser stroke"), INKSCAPE_ICON("draw-eraser")); + DocumentUndo::done(document, C_("Undo", "Draw eraser stroke"), INKSCAPE_ICON("draw-eraser")); } else { DocumentUndo::cancel(document); } diff --git a/src/ui/tools/flood-tool.cpp b/src/ui/tools/flood-tool.cpp index 3122d3507baeed3a1bb713e44a88af34fe40822c..a19972b6a155996d53b382735812ac4a6896ce4f 100644 --- a/src/ui/tools/flood-tool.cpp +++ b/src/ui/tools/flood-tool.cpp @@ -1011,8 +1011,8 @@ static void sp_flood_do_flood_fill(SPDesktop *desktop, Geom::Point const &cursor Geom::Affine inverted_affine = Geom::Translate(min_x, min_y) * doc2img.inverse(); do_trace(bci, trace_px.get(), desktop, inverted_affine, min_x, max_x, min_y, max_y, union_with_selection); - - DocumentUndo::done(document, _("Fill bounded area"), INKSCAPE_ICON("color-fill")); + + DocumentUndo::done(document, C_("Undo", "Fill bounded area"), INKSCAPE_ICON("color-fill")); } bool FloodTool::item_handler(SPItem *item, CanvasEvent const &event) @@ -1029,7 +1029,7 @@ bool FloodTool::item_handler(SPItem *item, CanvasEvent const &event) // Set style _desktop->applyCurrentOrToolStyle(item, "/tools/paintbucket", false); - DocumentUndo::done(_desktop->getDocument(), _("Set style on object"), INKSCAPE_ICON("color-fill")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Set style on object"), INKSCAPE_ICON("color-fill")); ret = true; } }, @@ -1139,7 +1139,7 @@ void FloodTool::finishItem() item->updateRepr(); _desktop->getSelection()->set(item); - DocumentUndo::done(_desktop->getDocument(), _("Fill bounded area"), INKSCAPE_ICON("color-fill")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Fill bounded area"), INKSCAPE_ICON("color-fill")); item = nullptr; } diff --git a/src/ui/tools/freehand-base.cpp b/src/ui/tools/freehand-base.cpp index ad284ea08304cede29d01a6a309b3b607727f2e6..b1b09ea64631779780c6dcff36a17097da79a873 100644 --- a/src/ui/tools/freehand-base.cpp +++ b/src/ui/tools/freehand-base.cpp @@ -810,7 +810,8 @@ static void spdc_flush_white(FreehandBase *dc, std::shared_ptr gc) if (lpeitem && lpeitem->hasPathEffectRecursive()) { sp_lpe_item_update_patheffect(lpeitem, true, false); } - DocumentUndo::done(doc, _("Draw path"), SP_IS_PEN_CONTEXT(dc)? INKSCAPE_ICON("draw-path") : INKSCAPE_ICON("draw-freehand")); + DocumentUndo::done(doc, C_("Undo", "Draw path"), + SP_IS_PEN_CONTEXT(dc) ? INKSCAPE_ICON("draw-path") : INKSCAPE_ICON("draw-freehand")); // When quickly drawing several subpaths with Shift, the next subpath may be finished and // flushed before the selection_modified signal is fired by the previous change, which @@ -937,8 +938,8 @@ void spdc_create_single_dot(ToolBase *tool, Geom::Point const &pt, char const *p desktop->getSelection()->set(item); - desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Creating single dot")); - DocumentUndo::done(desktop->getDocument(), _("Create single dot"), ""); + desktop->messageStack()->flash(Inkscape::NORMAL_MESSAGE, C_("Undo", "Creating single dot")); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Create single dot"), ""); } } // namespace Inkscape::UI::Tools diff --git a/src/ui/tools/gradient-tool.cpp b/src/ui/tools/gradient-tool.cpp index cbcdf8e39719b61c8749bf4ef00f5e337127547e..08b7f931b11a05fd37c18cec739eb775842c82b3 100644 --- a/src/ui/tools/gradient-tool.cpp +++ b/src/ui/tools/gradient-tool.cpp @@ -272,7 +272,7 @@ void GradientTool::add_stops_between_selected_stops() _grdrag->updateDraggers(); _grdrag->local_change = true; _grdrag->selectByStop(newstop); - DocumentUndo::done(gradient->document, _("Add gradient stop"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(gradient->document, C_("Undo", "Add gradient stop"), INKSCAPE_ICON("color-gradient")); return; } } @@ -325,7 +325,7 @@ void GradientTool::add_stops_between_selected_stops() } if (!ret.these_stops.empty() && doc) { - DocumentUndo::done(doc, _("Add gradient stop"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(doc, C_("Undo", "Add gradient stop"), INKSCAPE_ICON("color-gradient")); _grdrag->updateDraggers(); // so that it does not automatically update draggers in idle loop, as this would deselect _grdrag->local_change = true; @@ -387,7 +387,7 @@ void GradientTool::simplify(double tolerance) } if (!todel.empty()) { - DocumentUndo::done(doc, _("Simplify gradient"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(doc, C_("Undo", "Simplify gradient"), INKSCAPE_ICON("color-gradient")); drag->local_change = true; drag->updateDraggers(); drag->selectByCoords(ret.coords); @@ -399,7 +399,7 @@ void GradientTool::add_stop_near_point(SPItem *item, Geom::Point const &mouse_p) // item is the selected item. mouse_p the location in doc coordinates of where to add the stop auto newstop = get_drag()->addStopNearPoint(item, mouse_p, tolerance / _desktop->current_zoom()); - DocumentUndo::done(_desktop->getDocument(), _("Add gradient stop"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Add gradient stop"), INKSCAPE_ICON("color-gradient")); get_drag()->updateDraggers(); get_drag()->local_change = true; @@ -437,7 +437,8 @@ bool GradientTool::root_handler(CanvasEvent const &event) SPGradient *priv = sp_item_set_gradient(item, vector, new_type, fsmode); sp_gradient_reset_to_userspace(priv, item); } - DocumentUndo::done(_desktop->getDocument(), _("Create default gradient"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Create default gradient"), + INKSCAPE_ICON("color-gradient")); } ret = true; diff --git a/src/ui/tools/measure-tool.cpp b/src/ui/tools/measure-tool.cpp index aee9814bdf1b708bbca61d06d2471d14b0ef412b..1750d02e6c35a833f5a8bdfaae5925c1dbabee3e 100644 --- a/src/ui/tools/measure-tool.cpp +++ b/src/ui/tools/measure-tool.cpp @@ -687,7 +687,8 @@ void MeasureTool::toGuides() setGuide(end,Geom::rad_from_deg(90),""); showCanvasItems(true); doc->ensureUpToDate(); - DocumentUndo::done(_desktop->getDocument(), _("Add guides from measure tool"), INKSCAPE_ICON("tool-measure")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Add guides from measure tool"), + INKSCAPE_ICON("tool-measure")); } void MeasureTool::toPhantom() @@ -702,7 +703,8 @@ void MeasureTool::toPhantom() showCanvasItems(false, false, true); doc->ensureUpToDate(); - DocumentUndo::done(_desktop->getDocument(), _("Keep last measure on the canvas, for reference"), INKSCAPE_ICON("tool-measure")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Keep last measure on the canvas, for reference"), + INKSCAPE_ICON("tool-measure")); } void MeasureTool::toItem() @@ -721,7 +723,7 @@ void MeasureTool::toItem() Inkscape::GC::release(rgroup); measure_item->updateRepr(); doc->ensureUpToDate(); - DocumentUndo::done(_desktop->getDocument(), _("Convert measure to items"), INKSCAPE_ICON("tool-measure")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Convert measure to items"), INKSCAPE_ICON("tool-measure")); reset(); } @@ -764,7 +766,7 @@ void MeasureTool::toMarkDimension() setLabelText(total, middle, fontsize, textangle, color); doc->ensureUpToDate(); - DocumentUndo::done(_desktop->getDocument(), _("Add global measure line"), INKSCAPE_ICON("tool-measure")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Add global measure line"), INKSCAPE_ICON("tool-measure")); } void MeasureTool::setGuide(Geom::Point origin, double angle, const char *label) diff --git a/src/ui/tools/mesh-tool.cpp b/src/ui/tools/mesh-tool.cpp index 9ff6e197898f6da959b16d167a21b3a3a08c3bf5..aee4201f049115c53f55b77d0a5dad3a47fa70db 100644 --- a/src/ui/tools/mesh-tool.cpp +++ b/src/ui/tools/mesh-tool.cpp @@ -227,7 +227,7 @@ void MeshTool::split_near_point(SPItem *item, Geom::Point mouse_p) // item is the selected item. mouse_p the location in doc coordinates of where to add the stop get_drag()->addStopNearPoint(item, mouse_p, tolerance / _desktop->current_zoom()); - DocumentUndo::done(_desktop->getDocument(), _("Split mesh row/column"), INKSCAPE_ICON("mesh-gradient")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Split mesh row/column"), INKSCAPE_ICON("mesh-gradient")); get_drag()->updateDraggers(); } @@ -314,32 +314,36 @@ void MeshTool::corner_operation(MeshCornerOperation operation) switch (operation) { case MG_CORNER_SIDE_TOGGLE: - DocumentUndo::done(doc, _("Toggled mesh path type."), INKSCAPE_ICON("mesh-gradient")); + DocumentUndo::done(doc, C_("Undo", "Toggled mesh path type."), INKSCAPE_ICON("mesh-gradient")); _grdrag->local_change = true; // Don't create new draggers. break; case MG_CORNER_SIDE_ARC: - DocumentUndo::done(doc, _("Approximated arc for mesh side."), INKSCAPE_ICON("mesh-gradient")); + DocumentUndo::done(doc, C_("Undo", "Approximated arc for mesh side."), + INKSCAPE_ICON("mesh-gradient")); _grdrag->local_change = true; // Don't create new draggers. break; case MG_CORNER_TENSOR_TOGGLE: - DocumentUndo::done(doc, _("Toggled mesh tensors."), INKSCAPE_ICON("mesh-gradient")); + DocumentUndo::done(doc, C_("Undo", "Toggled mesh tensors."), INKSCAPE_ICON("mesh-gradient")); _grdrag->local_change = true; // Don't create new draggers. break; case MG_CORNER_COLOR_SMOOTH: - DocumentUndo::done(doc, _("Smoothed mesh corner color."), INKSCAPE_ICON("mesh-gradient")); + DocumentUndo::done(doc, C_("Undo", "Smoothed mesh corner color."), + INKSCAPE_ICON("mesh-gradient")); _grdrag->local_change = true; // Don't create new draggers. break; case MG_CORNER_COLOR_PICK: - DocumentUndo::done(doc, _("Picked mesh corner color."), INKSCAPE_ICON("mesh-gradient")); + DocumentUndo::done(doc, C_("Undo", "Picked mesh corner color."), + INKSCAPE_ICON("mesh-gradient")); _grdrag->local_change = true; // Don't create new draggers. break; case MG_CORNER_INSERT: - DocumentUndo::done(doc, _("Inserted new row or column."), INKSCAPE_ICON("mesh-gradient")); + DocumentUndo::done(doc, C_("Undo", "Inserted new row or column."), + INKSCAPE_ICON("mesh-gradient")); break; default: @@ -402,7 +406,8 @@ void MeshTool::fit_mesh_in_bbox() } } if (changed) { - DocumentUndo::done(_desktop->getDocument(), _("Fit mesh inside bounding box"), INKSCAPE_ICON("mesh-gradient")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Fit mesh inside bounding box"), + INKSCAPE_ICON("mesh-gradient")); } } @@ -877,7 +882,7 @@ void MeshTool::new_default() css = nullptr; } - DocumentUndo::done(_desktop->getDocument(), _("Create mesh"), INKSCAPE_ICON("mesh-gradient")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Create mesh"), INKSCAPE_ICON("mesh-gradient")); // status text; we do not track coords because this branch is run once, not all the time // during drag diff --git a/src/ui/tools/rect-tool.cpp b/src/ui/tools/rect-tool.cpp index 12916edfce348ad5ccc5459101858c0a2aee6b49..3bb606fdd5c5100b298649a08af9d6149bb45cea 100644 --- a/src/ui/tools/rect-tool.cpp +++ b/src/ui/tools/rect-tool.cpp @@ -400,7 +400,7 @@ void RectTool::finishItem() { sp_lpe_item_update_patheffect(this->rect.get(), true, true); _desktop->getSelection()->set(rect.get()); - DocumentUndo::done(_desktop->getDocument(), _("Create rectangle"), INKSCAPE_ICON("draw-rectangle")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Create rectangle"), INKSCAPE_ICON("draw-rectangle")); this->rect = nullptr; } diff --git a/src/ui/tools/spiral-tool.cpp b/src/ui/tools/spiral-tool.cpp index cb147c5443e1bd5fa5b2231369c1f4ef6c6b6df9..86d216611a7a43fb083ac37853117f48c69194c3 100644 --- a/src/ui/tools/spiral-tool.cpp +++ b/src/ui/tools/spiral-tool.cpp @@ -353,7 +353,7 @@ void SpiralTool::finishItem() { // update while creating inside a LPE group sp_lpe_item_update_patheffect(this->spiral.get(), true, true); _desktop->getSelection()->set(spiral.get()); - DocumentUndo::done(_desktop->getDocument(), _("Create spiral"), INKSCAPE_ICON("draw-spiral")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Create spiral"), INKSCAPE_ICON("draw-spiral")); this->spiral = nullptr; } diff --git a/src/ui/tools/spray-tool.cpp b/src/ui/tools/spray-tool.cpp index 629cfa5a6b9c82fb5e47e02aa92627247393367a..dd3633362636a87703c0265a2dc78f2279c56fb3 100644 --- a/src/ui/tools/spray-tool.cpp +++ b/src/ui/tools/spray-tool.cpp @@ -1302,13 +1302,16 @@ bool SprayTool::root_handler(CanvasEvent const &event) single_click = false; switch (mode) { case SPRAY_MODE_COPY: - DocumentUndo::done(_desktop->getDocument(), _("Spray with copies"), INKSCAPE_ICON("tool-spray")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Spray with copies"), + INKSCAPE_ICON("tool-spray")); break; case SPRAY_MODE_CLONE: - DocumentUndo::done(_desktop->getDocument(), _("Spray with clones"), INKSCAPE_ICON("tool-spray")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Spray with clones"), + INKSCAPE_ICON("tool-spray")); break; case SPRAY_MODE_SINGLE_PATH: - DocumentUndo::done(_desktop->getDocument(), _("Spray in single path"), INKSCAPE_ICON("tool-spray")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Spray in single path"), + INKSCAPE_ICON("tool-spray")); break; } } diff --git a/src/ui/tools/star-tool.cpp b/src/ui/tools/star-tool.cpp index cfeac044c2caf6752781b71459740b2b61b6fc46..15aeaeb9a88e4d822dbb2d28338fcfb51d67e396 100644 --- a/src/ui/tools/star-tool.cpp +++ b/src/ui/tools/star-tool.cpp @@ -366,7 +366,7 @@ void StarTool::finishItem() { // update while creating inside a LPE group sp_lpe_item_update_patheffect(this->star.get(), true, true); _desktop->getSelection()->set(star.get()); - DocumentUndo::done(_desktop->getDocument(), _("Create star"), INKSCAPE_ICON("draw-polygon-star")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Create star"), INKSCAPE_ICON("draw-polygon-star")); this->star = nullptr; } diff --git a/src/ui/tools/text-tool.cpp b/src/ui/tools/text-tool.cpp index 211757836c7309c4d1a74cd6269e84d5c986a954..3d5a6a20da980b2ad258ddcc923b45b7d2a8d3a3 100644 --- a/src/ui/tools/text-tool.cpp +++ b/src/ui/tools/text-tool.cpp @@ -178,7 +178,7 @@ TextTool::~TextTool() void TextTool::deleteSelected() { deleteSelection(); - DocumentUndo::done(_desktop->getDocument(), _("Delete text"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Delete text"), INKSCAPE_ICON("draw-text")); } bool TextTool::item_handler(SPItem *item, CanvasEvent const &event) @@ -286,7 +286,7 @@ void TextTool::_setupText() text_item->updateRepr(); text_item->doWriteTransform(text_item->transform, nullptr, true); - DocumentUndo::done(_desktop->getDocument(), _("Create text"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Create text"), INKSCAPE_ICON("draw-text")); } /** @@ -323,7 +323,7 @@ void TextTool::_insertUnichar() text_sel_start = text_sel_end = sp_te_replace(text, text_sel_start, text_sel_end, u); _updateCursor(); _updateTextSelection(); - DocumentUndo::done(_desktop->getDocument(), _("Insert Unicode character"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Insert Unicode character"), INKSCAPE_ICON("draw-text")); } } @@ -572,8 +572,9 @@ bool TextTool::root_handler(CanvasEvent const &event) _desktop->getSelection()->set(ft); } - _desktop->messageStack()->flash(NORMAL_MESSAGE, _("Flowed text is created.")); - DocumentUndo::done(_desktop->getDocument(), _("Create flowed text"), INKSCAPE_ICON("draw-text")); + _desktop->messageStack()->flash(NORMAL_MESSAGE, C_("Undo", "Flowed text is created.")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Create flowed text"), + INKSCAPE_ICON("draw-text")); } else { _desktop->messageStack()->flash(ERROR_MESSAGE, _("The frame is too small for the current font size. Flowed text not created.")); @@ -718,8 +719,9 @@ bool TextTool::root_handler(CanvasEvent const &event) text_sel_start = text_sel_end = sp_te_replace(text, text_sel_start, text_sel_end, "\302\240"); _updateCursor(); _updateTextSelection(); - _desktop->messageStack()->flash(NORMAL_MESSAGE, _("No-break space")); - DocumentUndo::done(_desktop->getDocument(), _("Insert no-break space"), INKSCAPE_ICON("draw-text")); + _desktop->messageStack()->flash(NORMAL_MESSAGE, C_("Undo", "No-break space")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Insert no-break space"), + INKSCAPE_ICON("draw-text")); ret = true; return; } @@ -757,7 +759,8 @@ bool TextTool::root_handler(CanvasEvent const &event) } sp_te_apply_style(text, text_sel_start, text_sel_end, css); sp_repr_css_attr_unref(css); - DocumentUndo::done(_desktop->getDocument(), _("Make bold"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Make bold"), + INKSCAPE_ICON("draw-text")); _updateCursor(); _updateTextSelection(); ret = true; @@ -776,7 +779,8 @@ bool TextTool::root_handler(CanvasEvent const &event) } sp_te_apply_style(text, text_sel_start, text_sel_end, css); sp_repr_css_attr_unref(css); - DocumentUndo::done(_desktop->getDocument(), _("Make italic"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Make italic"), + INKSCAPE_ICON("draw-text")); _updateCursor(); _updateTextSelection(); ret = true; @@ -819,7 +823,8 @@ bool TextTool::root_handler(CanvasEvent const &event) _updateCursor(); _updateTextSelection(); - DocumentUndo::done(_desktop->getDocument(), _("New line"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "New line"), + INKSCAPE_ICON("draw-text")); ret = true; return; } @@ -861,7 +866,8 @@ bool TextTool::root_handler(CanvasEvent const &event) _updateCursor(); _updateTextSelection(); - DocumentUndo::done(_desktop->getDocument(), _("Backspace"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Backspace"), + INKSCAPE_ICON("draw-text")); } ret = true; return; @@ -899,7 +905,8 @@ bool TextTool::root_handler(CanvasEvent const &event) _updateCursor(); _updateTextSelection(); - DocumentUndo::done(_desktop->getDocument(), _("Delete"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Delete"), + INKSCAPE_ICON("draw-text")); } ret = true; return; @@ -1282,7 +1289,7 @@ bool TextTool::pasteInline(Glib::ustring const clip_text) if (flowtext) { flowtext->fix_overflow_flowregion(true); } - DocumentUndo::done(_desktop->getDocument(), _("Paste text"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Paste text"), INKSCAPE_ICON("draw-text")); return true; } @@ -1407,7 +1414,7 @@ bool TextTool::_styleSet(SPCSSAttr const *css) sptext->updateRepr(); } - DocumentUndo::done(_desktop->getDocument(), _("Set text style"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Set text style"), INKSCAPE_ICON("draw-text")); _updateCursor(); _updateTextSelection(); return true; @@ -1720,19 +1727,20 @@ void TextTool::_forgetText() /* FIXME: this automatic deletion when nothing is inputted crashes the XML editor and also crashes when duplicating an empty flowtext. So don't create an empty flowtext in the first place? Create it when first character is typed. */ -/* - if ((is(ti) || is(ti)) && sp_te_input_is_empty(ti)) { - auto text_repr = ti->getRepr(); - // the repr may already have been unparented - // if we were called e.g. as the result of - // an undo or the element being removed from - // the XML editor - if (text_repr && text_repr->parent()) { - sp_repr_unparent(text_repr); - DocumentUndo::done(_desktop->getDocument(), _("Remove empty text"), INKSCAPE_ICON("draw-text")); + /* + if ((is(ti) || is(ti)) && sp_te_input_is_empty(ti)) { + auto text_repr = ti->getRepr(); + // the repr may already have been unparented + // if we were called e.g. as the result of + // an undo or the element being removed from + // the XML editor + if (text_repr && text_repr->parent()) { + sp_repr_unparent(text_repr); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Remove empty text"), + INKSCAPE_ICON("draw-text")); + } } - } -*/ + */ } void TextTool::_commit(GtkIMContext *, char *string) @@ -1746,7 +1754,7 @@ void TextTool::_commit(GtkIMContext *, char *string) _updateCursor(); _updateTextSelection(); - DocumentUndo::done(text->document, _("Type text"), INKSCAPE_ICON("draw-text")); + DocumentUndo::done(text->document, C_("Undo", "Type text"), INKSCAPE_ICON("draw-text")); } void TextTool::placeCursor(SPObject *other_text, Text::Layout::iterator where) diff --git a/src/ui/widget/canvas-grid.cpp b/src/ui/widget/canvas-grid.cpp index e2eff48a896e72c1b2add9e3d72b79b93f915bf1..a2bfcf36e978dca4e20d8f1b5c7196a11cc70574 100644 --- a/src/ui/widget/canvas-grid.cpp +++ b/src/ui/widget/canvas-grid.cpp @@ -644,7 +644,7 @@ void CanvasGrid::_createGuide(Geom::Point origin, Geom::Point normal) repr->setAttributePoint("orientation", normal); desktop->getNamedView()->appendChild(repr); GC::release(repr); - DocumentUndo::done(desktop->getDocument(), _("Create guide"), ""); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Create guide"), ""); } // End guide creation or toggle guides on/off. diff --git a/src/ui/widget/fill-style.cpp b/src/ui/widget/fill-style.cpp index 7f227334772ecec30634badacdfc074d2dcb56bb..617667fd9d57ddb9db635b826609a41d32ca4632 100644 --- a/src/ui/widget/fill-style.cpp +++ b/src/ui/widget/fill-style.cpp @@ -291,7 +291,7 @@ void FillNStroke::setFillrule(UI::Widget::PaintSelector::FillRule mode) sp_repr_css_attr_unref(css); css = nullptr; - DocumentUndo::done(_desktop->doc(), _("Change fill rule"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->doc(), C_("Undo", "Change fill rule"), INKSCAPE_ICON("dialog-fill-and-stroke")); } } @@ -434,7 +434,8 @@ void FillNStroke::updateFromPaint(bool switch_style) sp_repr_css_attr_unref(css); css = nullptr; - DocumentUndo::done(document, (kind == FILL) ? _("Remove fill") : _("Remove stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(document, (kind == FILL) ? C_("Undo", "Remove fill") : C_("Undo", "Remove stroke"), + INKSCAPE_ICON("dialog-fill-and-stroke")); break; } @@ -517,7 +518,10 @@ void FillNStroke::updateFromPaint(bool switch_style) // these are controlled by the gradient stops themselves. item->style->clear(kind == FILL ? SPAttr::FILL_OPACITY : SPAttr::STROKE_OPACITY); } - DocumentUndo::done(document, (kind == FILL) ? _("Set gradient on fill") : _("Set gradient on stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(document, + (kind == FILL) ? C_("Undo", "Set gradient on fill") + : C_("Undo", "Set gradient on stroke"), + INKSCAPE_ICON("dialog-fill-and-stroke")); } break; @@ -610,7 +614,9 @@ void FillNStroke::updateFromPaint(bool switch_style) css = nullptr; } - DocumentUndo::done(document, (kind == FILL) ? _("Set mesh on fill") : _("Set mesh on stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(document, + (kind == FILL) ? C_("Undo", "Set mesh on fill") : C_("Undo", "Set mesh on stroke"), + INKSCAPE_ICON("dialog-fill-and-stroke")); } break; #endif @@ -692,7 +698,9 @@ void FillNStroke::updateFromPaint(bool switch_style) g_free(urltext); } // end if - DocumentUndo::done(document, (kind == FILL) ? _("Set pattern on fill") : _("Set pattern on stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done( + document, (kind == FILL) ? C_("Undo", "Set pattern on fill") : C_("Undo", "Set pattern on stroke"), + INKSCAPE_ICON("dialog-fill-and-stroke")); } // end if break; @@ -722,7 +730,8 @@ void FillNStroke::updateFromPaint(bool switch_style) sp_repr_css_attr_unref(css); css = nullptr; - DocumentUndo::done(document, (kind == FILL) ? _("Unset fill") : _("Unset stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(document, (kind == FILL) ? C_("Undo", "Unset fill") : C_("Undo", "Unset stroke"), + INKSCAPE_ICON("dialog-fill-and-stroke")); } break; diff --git a/src/ui/widget/gradient-editor.cpp b/src/ui/widget/gradient-editor.cpp index 6f42d78ea5612582806e27223926def66b7fb552..fba5c8021e3849fae8d9f0c197259b024f53236f 100644 --- a/src/ui/widget/gradient-editor.cpp +++ b/src/ui/widget/gradient-editor.cpp @@ -470,7 +470,7 @@ void GradientEditor::turn_gradient(double angle, bool relative) { _gradient->updateRepr(); - DocumentUndo::done(_document, _("Rotate gradient"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(_document, C_("Undo", "Rotate gradient"), INKSCAPE_ICON("color-gradient")); } } @@ -481,7 +481,7 @@ void GradientEditor::reverse_gradient() { if (vector) { sp_gradient_reverse_vector(vector); - DocumentUndo::done(_document, _("Reverse gradient"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(_document, C_("Undo", "Reverse gradient"), INKSCAPE_ICON("color-gradient")); } } } @@ -496,7 +496,7 @@ void GradientEditor::set_repeat_mode(SPGradientSpread mode) { _gradient->setSpread(mode); _gradient->updateRepr(); - DocumentUndo::done(_document, _("Set gradient repeat"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(_document, C_("Undo", "Set gradient repeat"), INKSCAPE_ICON("color-gradient")); set_repeat_icon(mode); } diff --git a/src/ui/widget/gradient-selector.cpp b/src/ui/widget/gradient-selector.cpp index 60761f930750c8c8b3ca4b3a1dabb76d9e6c15b2..fe1b0a9e65016a454df515ee3c4e4e87167fbc7e 100644 --- a/src/ui/widget/gradient-selector.cpp +++ b/src/ui/widget/gradient-selector.cpp @@ -213,7 +213,8 @@ void GradientSelector::onGradientRename(const Glib::ustring &path_string, const if (obj) { if (!new_text.empty() && new_text != gr_prepare_label(obj)) { obj->setLabel(new_text.c_str()); - Inkscape::DocumentUndo::done(obj->document, _("Rename gradient"), INKSCAPE_ICON("color-gradient")); + Inkscape::DocumentUndo::done(obj->document, C_("Undo", "Rename gradient"), + INKSCAPE_ICON("color-gradient")); } row[_columns->name] = gr_prepare_label(obj); } diff --git a/src/ui/widget/image-properties.cpp b/src/ui/widget/image-properties.cpp index 8bc781838952e4ead6346df674f2a40d2476046d..3fff6cc064192c0c7b6195b3aec67e01881c5716 100644 --- a/src/ui/widget/image-properties.cpp +++ b/src/ui/widget/image-properties.cpp @@ -84,7 +84,7 @@ void link_image(Gtk::Window* window, SPImage* image) { // SPImage modifies size when href changes; trigger it now before undo concludes // TODO: this needs to be fixed in SPImage image->document->_updateDocument(0); - DocumentUndo::done(image->document, _("Change image"), INKSCAPE_ICON("shape-image")); + DocumentUndo::done(image->document, C_("Undo", "Change image"), INKSCAPE_ICON("shape-image")); } void set_rendering_mode(SPImage* image, int index) { @@ -98,7 +98,7 @@ void set_rendering_mode(SPImage* image, int index) { sp_repr_css_set_property(css, "image-rendering", render[index]); if (auto image_node = image->getRepr()) { sp_repr_css_change(image_node, css, "style"); - DocumentUndo::done(image->document, _("Set image rendering option"), INKSCAPE_ICON("shape-image")); + DocumentUndo::done(image->document, C_("Undo", "Set image rendering option"), INKSCAPE_ICON("shape-image")); } sp_repr_css_attr_unref(css); } @@ -106,7 +106,7 @@ void set_rendering_mode(SPImage* image, int index) { void set_aspect_ratio(SPImage* image, bool preserve_aspect_ratio) { if (!image) return; image->setAttribute("preserveAspectRatio", preserve_aspect_ratio ? "xMidYMid" : "none"); - DocumentUndo::done(image->document, _("Preserve image aspect ratio"), INKSCAPE_ICON("shape-image")); + DocumentUndo::done(image->document, C_("Undo", "Preserve image aspect ratio"), INKSCAPE_ICON("shape-image")); } } // unnamed namespace @@ -154,7 +154,7 @@ ImageProperties::ImageProperties() : // embed image in the current document Inkscape::Pixbuf copy(*_image->pixbuf); sp_embed_image(_image->getRepr(), ©); - DocumentUndo::done(_image->document, _("Embed image"), INKSCAPE_ICON("selection-make-bitmap-copy")); + DocumentUndo::done(_image->document, C_("Undo", "Embed image"), INKSCAPE_ICON("selection-make-bitmap-copy")); }); _rendering.signal_changed().connect([this](){ diff --git a/src/ui/widget/layer-selector.cpp b/src/ui/widget/layer-selector.cpp index fbe6092d34615c126beaf6bced9a002a15d70303..dc495f01e665b9bff677e12f5797e80f0e7f02b9 100644 --- a/src/ui/widget/layer-selector.cpp +++ b/src/ui/widget/layer-selector.cpp @@ -183,7 +183,7 @@ void LayerSelector::_lockLayer() bool lock = _lock_toggle.get_active(); if (auto layer = _desktop->layerManager().currentLayer()) { layer->setLocked(lock); - DocumentUndo::done(_desktop->getDocument(), lock ? _("Lock layer") : _("Unlock layer"), ""); + DocumentUndo::done(_desktop->getDocument(), lock ? C_("Undo", "Lock layer") : C_("Undo", "Unlock layer"), ""); } } @@ -192,7 +192,7 @@ void LayerSelector::_hideLayer() bool hide = _eye_toggle.get_active(); if (auto layer = _desktop->layerManager().currentLayer()) { layer->setHidden(hide); - DocumentUndo::done(_desktop->getDocument(), hide ? _("Hide layer") : _("Unhide layer"), ""); + DocumentUndo::done(_desktop->getDocument(), hide ? C_("Undo", "Hide layer") : C_("Undo", "Unhide layer"), ""); } } diff --git a/src/ui/widget/licensor.cpp b/src/ui/widget/licensor.cpp index 6fb8dbbed2dc5aae1aace24e17c29950a4a27fd9..634edf3bbe671d8fc81f3fb18883573373f988df 100644 --- a/src/ui/widget/licensor.cpp +++ b/src/ui/widget/licensor.cpp @@ -70,7 +70,7 @@ void LicenseItem::on_toggled() SPDocument *doc = _wr.desktop()->getDocument(); rdf_set_license (doc, _lic->details ? _lic : nullptr); if (doc->isSensitive()) { - DocumentUndo::done(doc, _("Document license updated"), ""); + DocumentUndo::done(doc, C_("Undo", "Document license updated"), ""); } _wr.setUpdating (false); static_cast(_eep->_packable)->set_text (_lic->uri); diff --git a/src/ui/widget/selected-style.cpp b/src/ui/widget/selected-style.cpp index 86366adbe74e91d558ab033e5951fa429cc279e2..c9283b7fc8e5a65eadec4d8ad71eb72bde753fb6 100644 --- a/src/ui/widget/selected-style.cpp +++ b/src/ui/widget/selected-style.cpp @@ -189,7 +189,7 @@ SelectedStyle::SelectedStyle() sp_desktop_set_style(tracker.parent->_desktop, css); sp_repr_css_attr_unref(css); - DocumentUndo::done(tracker.parent->_desktop->getDocument(), _("Drop color"), ""); + DocumentUndo::done(tracker.parent->_desktop->getDocument(), C_("Undo", "Drop color"), ""); return true; }, true); swatch[i]->add_controller(target); @@ -283,7 +283,7 @@ void SelectedStyle::on_fill_remove() { sp_repr_css_set_property (css, "fill", "none"); sp_desktop_set_style (_desktop, css, true, true); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Remove fill"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Remove fill"), INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_stroke_remove() { @@ -291,7 +291,7 @@ void SelectedStyle::on_stroke_remove() { sp_repr_css_set_property (css, "stroke", "none"); sp_desktop_set_style (_desktop, css, true, true); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Remove stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Remove stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_fill_unset() { @@ -299,8 +299,7 @@ void SelectedStyle::on_fill_unset() { sp_repr_css_unset_property (css, "fill"); sp_desktop_set_style (_desktop, css, true, true); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Unset fill"), INKSCAPE_ICON("dialog-fill-and-stroke")); - + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Unset fill"), INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_stroke_unset() { @@ -315,7 +314,7 @@ void SelectedStyle::on_stroke_unset() { sp_repr_css_unset_property (css, "stroke-dasharray"); sp_desktop_set_style (_desktop, css, true, true); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Unset stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Unset stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_fill_opaque() { @@ -323,7 +322,8 @@ void SelectedStyle::on_fill_opaque() { sp_repr_css_set_property (css, "fill-opacity", "1"); sp_desktop_set_style (_desktop, css, true); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Make fill opaque"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Make fill opaque"), + INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_stroke_opaque() { @@ -331,7 +331,8 @@ void SelectedStyle::on_stroke_opaque() { sp_repr_css_set_property (css, "stroke-opacity", "1"); sp_desktop_set_style (_desktop, css, true); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Make fill opaque"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Make fill opaque"), + INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_fill_lastused() { @@ -340,7 +341,8 @@ void SelectedStyle::on_fill_lastused() { sp_repr_css_set_property_string(css, "fill", color ? color->toString() : "none"); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Apply last set color to fill"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Apply last set color to fill"), + INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_stroke_lastused() { @@ -349,7 +351,8 @@ void SelectedStyle::on_stroke_lastused() { sp_repr_css_set_property_string(css, "fill", color ? color->toString() : "none"); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Apply last set color to stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Apply last set color to stroke"), + INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_fill_lastselected() { @@ -357,7 +360,8 @@ void SelectedStyle::on_fill_lastselected() { sp_repr_css_set_property_string(css, "fill", _lastselected[SS_FILL] ? _lastselected[SS_FILL]->toString() : ""); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Apply last selected color to fill"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Apply last selected color to fill"), + INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_stroke_lastselected() { @@ -365,7 +369,8 @@ void SelectedStyle::on_stroke_lastselected() { sp_repr_css_set_property_string(css, "stroke", _lastselected[SS_STROKE] ? _lastselected[SS_STROKE]->toString() : ""); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Apply last selected color to stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Apply last selected color to stroke"), + INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_fill_invert() { @@ -382,7 +387,7 @@ void SelectedStyle::on_fill_invert() { sp_repr_css_set_property_string(css, "fill", color->toString()); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Invert fill"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Invert fill"), INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_stroke_invert() { @@ -397,7 +402,7 @@ void SelectedStyle::on_stroke_invert() { sp_repr_css_set_property_string(css, "stroke", color->toString()); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Invert stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Invert stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_fill_white() { @@ -406,7 +411,7 @@ void SelectedStyle::on_fill_white() { sp_repr_css_set_property (css, "fill-opacity", "1"); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("White fill"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "White fill"), INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_stroke_white() { @@ -415,7 +420,7 @@ void SelectedStyle::on_stroke_white() { sp_repr_css_set_property (css, "stroke-opacity", "1"); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("White stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "White stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_fill_black() { @@ -424,7 +429,7 @@ void SelectedStyle::on_fill_black() { sp_repr_css_set_property (css, "fill-opacity", "1.0"); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Black fill"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Black fill"), INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_stroke_black() { @@ -433,7 +438,7 @@ void SelectedStyle::on_stroke_black() { sp_repr_css_set_property (css, "stroke-opacity", "1.0"); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Black stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Black stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); } void SelectedStyle::on_fill_copy() { @@ -473,7 +478,9 @@ void SelectedStyle::_on_paste_callback(Glib::RefPtr& result, G sp_repr_css_set_property_string(css, "fill", color->toString()); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), typepaste == "fill" ? _("Paste fill") : _("Paste stroke"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), + typepaste == "fill" ? C_("Undo", "Paste fill") : C_("Undo", "Paste stroke"), + INKSCAPE_ICON("dialog-fill-and-stroke")); } } @@ -572,7 +579,7 @@ SelectedStyle::on_opacity_click(Gtk::GestureClick const & /*click*/, sp_repr_css_set_property (css, "opacity", opacity); sp_desktop_set_style (_desktop, css); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Change opacity"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Change opacity"), INKSCAPE_ICON("dialog-fill-and-stroke")); return Gtk::EventSequenceState::CLAIMED; } @@ -706,7 +713,7 @@ void SelectedStyle::on_popup_preset(int i) { // FIXME: update dash patterns! sp_desktop_set_style (_desktop, css, true); sp_repr_css_attr_unref (css); - DocumentUndo::done(_desktop->getDocument(), _("Change stroke width"), INKSCAPE_ICON("swatches")); + DocumentUndo::done(_desktop->getDocument(), C_("Undo", "Change stroke width"), INKSCAPE_ICON("swatches")); } void SelectedStyle::onDefocus() diff --git a/src/ui/widget/stroke-style.cpp b/src/ui/widget/stroke-style.cpp index 7af7572a51cc5450934dded3e2d1a6d01f0f4174..9e00fcca0d5f8f4502ece28a4113d1b1b402ed01 100644 --- a/src/ui/widget/stroke-style.cpp +++ b/src/ui/widget/stroke-style.cpp @@ -573,7 +573,7 @@ void StrokeStyle::markerSelectCB(MarkerComboBox *marker_combo, SPMarkerLoc const // so they can be collected by DocumentUndo::done collect orphans document->ensureUpToDate(); - DocumentUndo::done(document, _("Set markers"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(document, C_("Undo", "Set markers"), INKSCAPE_ICON("dialog-fill-and-stroke")); } // edit marker mode - update @@ -621,8 +621,8 @@ void StrokeStyle::unitChangedCB() sp_desktop_set_style(desktop, css); sp_repr_css_attr_unref(css); css = nullptr; - DocumentUndo::done(desktop->getDocument(), _("Remove hairline stroke"), - INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Remove hairline stroke"), + INKSCAPE_ICON("dialog-fill-and-stroke")); } if (_old_unit->type == Inkscape::Util::UNIT_TYPE_DIMENSIONLESS) { // Prevent update of unit (inf-loop) in updateLine @@ -1024,8 +1024,7 @@ void StrokeStyle::setStrokeWidth() sp_desktop_set_style (desktop, css, false); sp_repr_css_attr_unref(css); - DocumentUndo::done(desktop->getDocument(), _("Set stroke width"), - INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Set stroke width"), INKSCAPE_ICON("dialog-fill-and-stroke")); if (unit->abbr == "%") { // reset to 100 percent @@ -1066,8 +1065,7 @@ void StrokeStyle::setStrokeDash() sp_desktop_set_style (desktop, css, false); sp_repr_css_attr_unref(css); - DocumentUndo::done(document, _("Set stroke dash"), - INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(document, C_("Undo", "Set stroke dash"), INKSCAPE_ICON("dialog-fill-and-stroke")); update = false; } @@ -1088,8 +1086,7 @@ void StrokeStyle::setStrokeMiter() } sp_desktop_set_style (desktop, css, false); sp_repr_css_attr_unref(css); - DocumentUndo::done(desktop->getDocument(), _("Set stroke miter"), - INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(desktop->getDocument(), C_("Undo", "Set stroke miter"), INKSCAPE_ICON("dialog-fill-and-stroke")); update = false; } @@ -1145,7 +1142,8 @@ void StrokeStyle::buttonToggledCB(StrokeStyleButton *tb, StrokeStyle *spw) sp_repr_css_attr_unref(css); css = nullptr; - DocumentUndo::done(spw->desktop->getDocument(), _("Set stroke style"), INKSCAPE_ICON("dialog-fill-and-stroke")); + DocumentUndo::done(spw->desktop->getDocument(), C_("Undo", "Set stroke style"), + INKSCAPE_ICON("dialog-fill-and-stroke")); } } diff --git a/src/ui/widget/swatch-selector.cpp b/src/ui/widget/swatch-selector.cpp index c3404be01e6a8ab6af0a9f025deaf59623fc0d97..320cbc389193eab36a438c660e59e82bcf5afee2 100644 --- a/src/ui/widget/swatch-selector.cpp +++ b/src/ui/widget/swatch-selector.cpp @@ -62,7 +62,7 @@ void SwatchSelector::_changedCb() if (auto stop = ngr->getFirstStop()) { stop->setColor(_colors->getAverage()); - DocumentUndo::done(ngr->document, _("Change swatch color"), INKSCAPE_ICON("color-gradient")); + DocumentUndo::done(ngr->document, C_("Undo", "Change swatch color"), INKSCAPE_ICON("color-gradient")); } } } diff --git a/src/vanishing-point.cpp b/src/vanishing-point.cpp index e3c3207721464ef63982ae8e856a0b57ff220b32..f549e9cbbdc4b59dce188b037d134afad3ee47dc 100644 --- a/src/vanishing-point.cpp +++ b/src/vanishing-point.cpp @@ -113,7 +113,8 @@ static void vp_knot_moved_handler(SPKnot *knot, Geom::Point const &ppointer, gui } // FIXME: Do we need to create a new dragger as well? dragger->updateZOrders(); - DocumentUndo::done(SP_ACTIVE_DESKTOP->getDocument(), _("Split vanishing points"), INKSCAPE_ICON("draw-cuboid")); + DocumentUndo::done(SP_ACTIVE_DESKTOP->getDocument(), C_("Undo", "Split vanishing points"), + INKSCAPE_ICON("draw-cuboid")); return; } } @@ -159,7 +160,8 @@ static void vp_knot_moved_handler(SPKnot *knot, Geom::Point const &ppointer, gui // deleted according to changes in the svg representation, not based on any user input // as is currently the case. - DocumentUndo::done(SP_ACTIVE_DESKTOP->getDocument(), _("Merge vanishing points"), INKSCAPE_ICON("draw-cuboid")); + DocumentUndo::done(SP_ACTIVE_DESKTOP->getDocument(), C_("Undo", "Merge vanishing points"), + INKSCAPE_ICON("draw-cuboid")); return; } @@ -226,7 +228,8 @@ static void vp_knot_ungrabbed_handler(SPKnot *knot, guint /*state*/, gpointer da // TODO: Undo machinery!! g_return_if_fail(dragger->parent); g_return_if_fail(dragger->parent->document); - DocumentUndo::done(dragger->parent->document, _("3D box: Move vanishing point"), INKSCAPE_ICON("draw-cuboid")); + DocumentUndo::done(dragger->parent->document, C_("Undo", "3D box: Move vanishing point"), + INKSCAPE_ICON("draw-cuboid")); } unsigned int VanishingPoint::global_counter = 0; diff --git a/src/widgets/sp-attribute-widget.cpp b/src/widgets/sp-attribute-widget.cpp index 9a1dc01e2c71e681f939f6dec076773527d2d03a..d6a602725c86c415181e35b3c0476864f4b8cb49 100644 --- a/src/widgets/sp-attribute-widget.cpp +++ b/src/widgets/sp-attribute-widget.cpp @@ -209,7 +209,7 @@ void SPAttributeTable::attribute_table_entry_changed(size_t index) { if (_object) { auto text = e.get_text(); _object->getRepr()->setAttribute(_attributes[index], text); - DocumentUndo::done(_object->document, _("Set attribute"), ""); + DocumentUndo::done(_object->document, C_("Undo", "Set attribute"), ""); } blocked = false; }