summaryrefslogtreecommitdiffstats
path: root/src/live_effects/parameter/path.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/live_effects/parameter/path.cpp')
-rw-r--r--src/live_effects/parameter/path.cpp36
1 files changed, 24 insertions, 12 deletions
diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp
index db1064511..2b558d2dd 100644
--- a/src/live_effects/parameter/path.cpp
+++ b/src/live_effects/parameter/path.cpp
@@ -46,6 +46,7 @@ PathParam::PathParam( const Glib::ustring& label, const Glib::ustring& tip,
edit_button = NULL;
defvalue = g_strdup(default_value);
param_readSVGValue(defvalue);
+ oncanvas_editable = true;
}
PathParam::~PathParam()
@@ -128,18 +129,35 @@ PathParam::param_getWidget()
}
void
-PathParam::on_edit_button_click()
+PathParam::param_editOncanvas(SPItem * item, SPDesktop * dt)
{
- // Switch to node edit tool:
- tools_switch_current(TOOLS_NODES);
+ // If not already in nodecontext, goto it!
+ if (!tools_isactive(dt, TOOLS_NODES)) {
+ tools_switch_current(TOOLS_NODES);
+ }
- // set this parameter to edit:
- ShapeEditor * shape_editor = SP_NODE_CONTEXT( SP_ACTIVE_DESKTOP->event_context )->shape_editor;
- SPItem * item = sp_desktop_selection(SP_ACTIVE_DESKTOP)->singleItem();
+ ShapeEditor * shape_editor = SP_NODE_CONTEXT( dt->event_context )->shape_editor;
shape_editor->set_item_livepatheffect_parameter(item, SP_OBJECT(param_effect->getLPEObj()), param_key.c_str());
}
void
+PathParam::param_write_to_repr(const char * svgd)
+{
+ param_effect->getRepr()->setAttribute(param_key.c_str(), svgd);
+}
+
+
+/* CALLBACK FUNCTIONS FOR THE BUTTONS */
+void
+PathParam::on_edit_button_click()
+{
+ SPItem * item = sp_desktop_selection(SP_ACTIVE_DESKTOP)->singleItem();
+ if (item != NULL) {
+ param_editOncanvas(item, SP_ACTIVE_DESKTOP);
+ }
+}
+
+void
PathParam::on_paste_button_click()
{
// check if something is in the clipboard
@@ -170,12 +188,6 @@ PathParam::on_paste_button_click()
}
}
-void
-PathParam::param_write_to_repr(const char * svgd)
-{
- param_effect->getRepr()->setAttribute(param_key.c_str(), svgd);
-}
-
} /* namespace LivePathEffect */