diff --git a/src/verbs.cpp b/src/verbs.cpp
index a362d3c0f9e3678901c64648b3e6be595c61b7a3..8c5ce310b67e3089a2466b5e17e3cd612eb1c210 100644 (file)
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
#include <gtkmm/filechooserdialog.h>
#include <gtkmm/stock.h>
+#include "layer-manager.h"
#include "dialogs/text-edit.h"
#include "dialogs/xml-tree.h"
#include "dialogs/item-properties.h"
case SP_VERB_EDIT_UNLINK_CLONE:
sp_selection_unlink();
break;
+ case SP_VERB_EDIT_RELINK_CLONE:
+ sp_selection_relink();
+ break;
case SP_VERB_EDIT_CLONE_SELECT_ORIGINAL:
sp_select_clone_original();
break;
break;
}
+ case SP_VERB_LAYER_DUPLICATE: {
+ if ( dt->currentLayer() != dt->currentRoot() ) {
+ SPObject *new_layer = Inkscape::create_layer(dt->currentRoot(), dt->currentLayer(), LPOS_BELOW);
+ if ( dt->currentLayer()->label() ) {
+ gchar* name = g_strdup_printf(_("%s copy"), dt->currentLayer()->label());
+ dt->layer_manager->renameLayer( new_layer, name );
+ g_free(name);
+ }
+
+ sp_edit_select_all();
+ sp_selection_duplicate(true);
+ sp_selection_to_prev_layer(true);
+ dt->setCurrentLayer(new_layer);
+ sp_edit_select_all();
+
+ sp_document_done(sp_desktop_document(dt), SP_VERB_LAYER_DUPLICATE,
+ _("Duplicate layer"));
+
+ // TRANSLATORS: this means "The layer has been duplicated."
+ dt->messageStack()->flash(Inkscape::NORMAL_MESSAGE, _("Duplicated layer."));
+ } else {
+ dt->messageStack()->flash(Inkscape::ERROR_MESSAGE, _("No current layer."));
+ }
+ break;
+ }
case SP_VERB_LAYER_DELETE: {
if ( dt->currentLayer() != dt->currentRoot() ) {
sp_desktop_selection(dt)->clear();
// While drawing with the pen/pencil tool, zoom towards the end of the unfinished path
if (tools_isactive(dt, TOOLS_FREEHAND_PENCIL) || tools_isactive(dt, TOOLS_FREEHAND_PEN)) {
SPCurve *rc = SP_DRAW_CONTEXT(ec)->red_curve;
- if (rc->last_bpath()) {
+ if (!rc->is_empty()) {
NR::Point const zoom_to (rc->last_point());
dt->zoom_relative_keep_point(zoom_to, mul*zoom_inc);
break;
// While drawing with the pen/pencil tool, zoom away from the end of the unfinished path
if (tools_isactive(dt, TOOLS_FREEHAND_PENCIL) || tools_isactive(dt, TOOLS_FREEHAND_PEN)) {
SPCurve *rc = SP_DRAW_CONTEXT(ec)->red_curve;
- if (rc->last_bpath()) {
+ if (!rc->is_empty()) {
NR::Point const zoom_to (rc->last_point());
dt->zoom_relative_keep_point(zoom_to, 1 / (mul*zoom_inc));
break;
case SP_VERB_DIALOG_FILTER_EFFECTS:
dt->_dlg_mgr->showDialog("FilterEffectsDialog");
break;
+ case SP_VERB_DIALOG_SVG_FONTS:
+ dt->_dlg_mgr->showDialog("SvgFontsDialog");
+ break;
default:
break;
}
new EditVerb(SP_VERB_EDIT_CLONE, "EditClone", N_("Create Clo_ne"),
N_("Create a clone (a copy linked to the original) of selected object"), "edit_clone"),
new EditVerb(SP_VERB_EDIT_UNLINK_CLONE, "EditUnlinkClone", N_("Unlin_k Clone"),
- N_("Cut the selected clone's link to its original, turning it into a standalone object"), "edit_unlink_clone"),
+ N_("Cut the selected clones' links to the originals, turning them into standalone objects"), "edit_unlink_clone"),
+ new EditVerb(SP_VERB_EDIT_RELINK_CLONE, "EditRelinkClone", N_("Relink to Copied"),
+ N_("Relink the selected clones to the object currently on the clipboard"), NULL),
new EditVerb(SP_VERB_EDIT_CLONE_SELECT_ORIGINAL, "EditCloneSelectOriginal", N_("Select _Original"),
N_("Select the object to which the selected clone is linked"), "edit_select_original"),
// TRANSLATORS: Convert selection to a line marker
N_("Raise the current layer"), "raise_layer"),
new LayerVerb(SP_VERB_LAYER_LOWER, "LayerLower", N_("_Lower Layer"),
N_("Lower the current layer"), "lower_layer"),
+ new LayerVerb(SP_VERB_LAYER_DUPLICATE, "LayerDuplicate", N_("Duplicate Current Layer..."),
+ N_("Duplicate an existing layer"), 0),
new LayerVerb(SP_VERB_LAYER_DELETE, "LayerDelete", N_("_Delete Current Layer"),
N_("Delete the current layer"), "delete_layer"),
- new LayerVerb(SP_VERB_LAYER_SOLO, "LayerSolo", N_("_Solo Current Layer"),
+ new LayerVerb(SP_VERB_LAYER_SOLO, "LayerSolo", N_("_Show/hide other layers"),
N_("Solo the current layer"), 0),
/* Object */
N_("Manage path effects"), NULL),
new DialogVerb(SP_VERB_DIALOG_FILTER_EFFECTS, "DialogFilterEffects", N_("Filter Effects..."),
N_("Manage SVG filter effects"), NULL),
+ new DialogVerb(SP_VERB_DIALOG_SVG_FONTS, "DialogSVGFonts", N_("SVG Fonts..."),
+ N_("Manage SVG fonts"), NULL),
/* Help */
new HelpVerb(SP_VERB_HELP_ABOUT_EXTENSIONS, "HelpAboutExtensions", N_("About E_xtensions"),