summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 1590947)
raw | patch | inline | side by side (parent: 1590947)
author | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 19 Mar 2008 08:54:26 +0000 (08:54 +0000) | ||
committer | buliabyak <buliabyak@users.sourceforge.net> | |
Wed, 19 Mar 2008 08:54:26 +0000 (08:54 +0000) |
diff --git a/src/menus-skeleton.h b/src/menus-skeleton.h
index ced61031ef0803dc8365e952e3c470bc6c4839b4..6e4285311d97eb600072e14afe2ff624208b60c5 100644 (file)
--- a/src/menus-skeleton.h
+++ b/src/menus-skeleton.h
" <verb verb-id=\"EditPaste\" />\n"
" <verb verb-id=\"EditPasteInPlace\" />\n"
" <verb verb-id=\"EditPasteStyle\" />\n"
-" <verb verb-id=\"EditPasteLivePathEffect\" />\n"
" <submenu name=\"" N_("Paste Si_ze") "\">\n"
" <verb verb-id=\"EditPasteSize\" />\n"
" <verb verb-id=\"EditPasteWidth\" />\n"
" <verb verb-id=\"SelectionSimplify\" />\n"
" <verb verb-id=\"SelectionReverse\" />\n"
" <separator/>\n"
-" <verb verb-id=\"DialogLivePathEffect\" />\n"
+" <submenu name=\"" N_("Path Effects") "\">\n"
+" <verb verb-id=\"DialogLivePathEffect\" />\n"
+" <verb verb-id=\"PasteLivePathEffect\" />\n"
+" <verb verb-id=\"RemoveLivePathEffect\" />\n"
+" </submenu>\n"
" </submenu>\n"
" <submenu name=\"" N_("_Text") "\">\n"
" <verb verb-id=\"DialogText\" />\n"
index 3a79565952ea5d61919d7d7425eda82d8fc81c16..501f334a2c103a4f887257e82a9d070e85cf4740 100644 (file)
_("Paste live path effect"));
}
+
+void sp_selection_remove_livepatheffect_impl(SPItem *item)
+{
+ if ( item && SP_IS_SHAPE(item) ) {
+ sp_shape_remove_path_effect(SP_SHAPE(item));
+ } else if (item && SP_IS_GROUP (item)) {
+ for (SPObject *child = sp_object_first_child(SP_OBJECT(item)) ; child != NULL; child = SP_OBJECT_NEXT(child) ) {
+ if (!SP_IS_ITEM (child))
+ continue;
+ sp_selection_remove_livepatheffect_impl (SP_ITEM(child));
+ }
+ }
+}
+
+void sp_selection_remove_livepatheffect()
+{
+ SPDesktop *desktop = SP_ACTIVE_DESKTOP;
+ if (desktop == NULL) return;
+
+ Inkscape::Selection *selection = sp_desktop_selection(desktop);
+
+ // check if something is selected
+ if (selection->isEmpty()) {
+ desktop->messageStack()->flash(Inkscape::WARNING_MESSAGE, _("Select <b>object(s)</b> to remove live path effects from."));
+ return;
+ }
+
+ for ( GSList const *itemlist = selection->itemList(); itemlist != NULL; itemlist = g_slist_next(itemlist) ) {
+ SPItem *item = reinterpret_cast<SPItem*>(itemlist->data);
+
+ sp_selection_remove_livepatheffect_impl(item);
+
+ }
+
+ sp_document_done(sp_desktop_document (desktop), SP_VERB_EDIT_PASTE_LIVEPATHEFFECT,
+ _("Remove live path effect"));
+}
+
void sp_selection_paste_size (bool apply_x, bool apply_y)
{
SPDesktop *desktop = SP_ACTIVE_DESKTOP;
index 9307fe5c06c75b227352f386d59223521f5dfb7e..86edc90916e043003970ab0b5a1beb8a6098a88f 100644 (file)
void sp_selection_paste(bool in_place);
void sp_selection_paste_style();
void sp_selection_paste_livepatheffect();
+void sp_selection_remove_livepatheffect();
void sp_set_style_clipboard (SPCSSAttr *css);
diff --git a/src/verbs.cpp b/src/verbs.cpp
index 7bd17575506cede95b653d1df062c25c6fac42d0..060f6aae33360b66468fa6bd32a31bdf3d339227 100644 (file)
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
case SP_VERB_EDIT_PASTE_LIVEPATHEFFECT:
sp_selection_paste_livepatheffect();
break;
+ case SP_VERB_EDIT_REMOVE_LIVEPATHEFFECT:
+ sp_selection_remove_livepatheffect();
+ break;
case SP_VERB_EDIT_DELETE:
sp_selection_delete();
break;
N_("Scale each selected object vertically to match the height of the copied object"), NULL),
new EditVerb(SP_VERB_EDIT_PASTE_IN_PLACE, "EditPasteInPlace", N_("Paste _In Place"),
N_("Paste objects from clipboard to the original location"), "selection_paste_in_place"),
- new EditVerb(SP_VERB_EDIT_PASTE_LIVEPATHEFFECT, "EditPasteLivePathEffect", N_("Paste Path _Effect"),
+ new EditVerb(SP_VERB_EDIT_PASTE_LIVEPATHEFFECT, "PasteLivePathEffect", N_("Paste Path _Effect"),
N_("Apply the path effect of the copied object to selection"), NULL),
+ new EditVerb(SP_VERB_EDIT_REMOVE_LIVEPATHEFFECT, "RemoveLivePathEffect", N_("Remove Path _Effect"),
+ N_("Remove any path effects from selected objects"), NULL),
new EditVerb(SP_VERB_EDIT_DELETE, "EditDelete", N_("_Delete"),
N_("Delete selection"), GTK_STOCK_DELETE),
new EditVerb(SP_VERB_EDIT_DUPLICATE, "EditDuplicate", N_("Duplic_ate"),
diff --git a/src/verbs.h b/src/verbs.h
index 6924a4bfd0c725b630d8999ea8194edc31d9de4d..dc09636f6be63dee35adcee7bbaa70be1acf2c18 100644 (file)
--- a/src/verbs.h
+++ b/src/verbs.h
SP_VERB_EDIT_PASTE_SIZE_SEPARATELY_Y,
SP_VERB_EDIT_PASTE_IN_PLACE,
SP_VERB_EDIT_PASTE_LIVEPATHEFFECT,
+ SP_VERB_EDIT_REMOVE_LIVEPATHEFFECT,
SP_VERB_EDIT_DELETE,
SP_VERB_EDIT_DUPLICATE,
SP_VERB_EDIT_CLONE,