summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2017-09-22 16:00:59 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2017-09-22 16:00:59 +0000
commit1711a79b8604d9e6d936e25eaf966154ff122483 (patch)
treef03084c6e81d58583f1ff705b9392a8d215643aa /src
parentAdd some sugesstions and fixes from CR to measure segments (diff)
downloadinkscape-1711a79b8604d9e6d936e25eaf966154ff122483.tar.gz
inkscape-1711a79b8604d9e6d936e25eaf966154ff122483.zip
Add tooltip to set default LPE widget
Diffstat (limited to 'src')
-rw-r--r--src/live_effects/effect.cpp29
-rw-r--r--src/live_effects/effect.h4
-rw-r--r--src/live_effects/parameter/array.h4
-rw-r--r--src/live_effects/parameter/bool.cpp7
-rw-r--r--src/live_effects/parameter/bool.h1
-rw-r--r--src/live_effects/parameter/enum.h7
-rw-r--r--src/live_effects/parameter/fontbutton.cpp8
-rw-r--r--src/live_effects/parameter/fontbutton.h1
-rw-r--r--src/live_effects/parameter/hidden.cpp9
-rw-r--r--src/live_effects/parameter/hidden.h1
-rw-r--r--src/live_effects/parameter/item.cpp6
-rw-r--r--src/live_effects/parameter/item.h1
-rw-r--r--src/live_effects/parameter/originalitemarray.cpp5
-rw-r--r--src/live_effects/parameter/originalitemarray.h1
-rw-r--r--src/live_effects/parameter/originalpatharray.cpp5
-rw-r--r--src/live_effects/parameter/originalpatharray.h1
-rw-r--r--src/live_effects/parameter/parameter.cpp9
-rw-r--r--src/live_effects/parameter/parameter.h2
-rw-r--r--src/live_effects/parameter/path.cpp6
-rw-r--r--src/live_effects/parameter/path.h1
-rw-r--r--src/live_effects/parameter/point.cpp9
-rw-r--r--src/live_effects/parameter/point.h1
-rw-r--r--src/live_effects/parameter/random.cpp9
-rw-r--r--src/live_effects/parameter/random.h1
-rw-r--r--src/live_effects/parameter/text.cpp9
-rw-r--r--src/live_effects/parameter/text.h1
-rw-r--r--src/live_effects/parameter/togglebutton.cpp7
-rw-r--r--src/live_effects/parameter/togglebutton.h1
-rw-r--r--src/live_effects/parameter/transformedpoint.cpp9
-rw-r--r--src/live_effects/parameter/transformedpoint.h1
-rw-r--r--src/live_effects/parameter/unit.cpp6
-rw-r--r--src/live_effects/parameter/unit.h1
-rw-r--r--src/live_effects/parameter/vector.cpp9
-rw-r--r--src/live_effects/parameter/vector.h1
34 files changed, 163 insertions, 10 deletions
diff --git a/src/live_effects/effect.cpp b/src/live_effects/effect.cpp
index b2ba0acdc..dcc60af14 100644
--- a/src/live_effects/effect.cpp
+++ b/src/live_effects/effect.cpp
@@ -826,29 +826,36 @@ Effect::defaultParamSet()
Glib::ustring * tip = param->param_getTooltip();
const gchar * key = param->param_key.c_str();
const gchar * value = param->param_label.c_str();
- const gchar * tooltip_extra = _(". Change custom values for this parameter");
- Glib::ustring tooltip = param->param_tooltip + (Glib::ustring)tooltip_extra;
+
Glib::ustring pref_path = (Glib::ustring)"/live_effects/" +
effectkey +
(Glib::ustring)"/" +
(Glib::ustring)key;
bool valid = prefs->getEntry(pref_path).isValid();
const gchar * set_or_upd;
+ Glib::ustring def = Glib::ustring(_("<b>Default value:</b> ")) + Glib::ustring(param->param_getDefaultSVGValue()) + Glib::ustring("\n");
+ Glib::ustring ove = Glib::ustring(_("<b>Default value overrided:</b> ")) + Glib::ustring(prefs->getString(pref_path)) + Glib::ustring("\n");
if (valid) {
set_or_upd = _("Update");
+ def = Glib::ustring(_("<b>Default value:</b> <s>")) + Glib::ustring(param->param_getDefaultSVGValue()) + Glib::ustring("</s>\n");
} else {
set_or_upd = _("Set");
+ ove = Glib::ustring(_("<b>Default value overrided:</b> None\n"));
}
+ Glib::ustring cur = Glib::ustring(_("<b>Current parameter value:</b> ")) + Glib::ustring(param->param_getSVGValue());
Gtk::HBox * vbox_param = Gtk::manage( new Gtk::HBox(true) );
Gtk::Label *parameter_label = Gtk::manage(new Gtk::Label(value, Gtk::ALIGN_START));
parameter_label->set_use_markup(true);
- parameter_label->set_use_underline (true);
+ parameter_label->set_use_underline(true);
+ Glib::ustring tooltip = Glib::ustring("<b>") + parameter_label->get_text () + Glib::ustring("</b>\n") + param->param_tooltip + Glib::ustring("\n");
parameter_label->set_ellipsize(Pango::ELLIPSIZE_END);
+ parameter_label->set_tooltip_markup((tooltip + def + ove + cur).c_str());
vbox_param->pack_start(*parameter_label, true, true, 2);
Gtk::Button *set = Gtk::manage(new Gtk::Button((Glib::ustring)set_or_upd));
Gtk::Button *unset = Gtk::manage(new Gtk::Button(Glib::ustring(_("Unset"))));
- unset->signal_clicked().connect(sigc::bind<Glib::ustring, Gtk::Button *, Gtk::Button *>(sigc::mem_fun(*this, &Effect::unsetDefaultParam), pref_path, set, unset));
- set->signal_clicked().connect(sigc::bind<Glib::ustring, gchar *, Gtk::Button *, Gtk::Button *>(sigc::mem_fun(*this, &Effect::setDefaultParam), pref_path, param->param_getSVGValue(), set, unset));
+ unset->signal_clicked().connect(sigc::bind<Glib::ustring, Glib::ustring, gchar *, gchar *, Gtk::Label *,Gtk::Button *, Gtk::Button *>(sigc::mem_fun(*this, &Effect::unsetDefaultParam), pref_path, tooltip, param->param_getSVGValue(), param->param_getDefaultSVGValue(), parameter_label, set, unset));
+
+ set->signal_clicked().connect(sigc::bind<Glib::ustring, Glib::ustring, gchar *, gchar *, Gtk::Label *,Gtk::Button *, Gtk::Button *>(sigc::mem_fun(*this, &Effect::setDefaultParam), pref_path, tooltip, param->param_getSVGValue(), param->param_getDefaultSVGValue(), parameter_label, set, unset));
if (!valid) {
unset->set_sensitive(false);
}
@@ -873,23 +880,31 @@ Effect::defaultParamSet()
}
void
-Effect::setDefaultParam(Glib::ustring pref_path, gchar * value, Gtk::Button *set , Gtk::Button *unset)
+Effect::setDefaultParam(Glib::ustring pref_path, Glib::ustring tooltip, gchar * value, gchar * defvalue, Gtk::Label *parameter_label, Gtk::Button *set , Gtk::Button *unset)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
prefs->setString(pref_path, (Glib::ustring)value);
gchar * label = _("Update");
set->set_label((Glib::ustring)label);
unset->set_sensitive(true);
+ Glib::ustring def = Glib::ustring(_("<b>Default value:</b> <s>")) + Glib::ustring(defvalue) + Glib::ustring("</s>\n");
+ Glib::ustring ove = Glib::ustring(_("<b>Default value overrided:</b> ")) + Glib::ustring(value) + Glib::ustring("\n");
+ Glib::ustring cur = Glib::ustring(_("<b>Current parameter value:</b> ")) + Glib::ustring(value);
+ parameter_label->set_tooltip_markup((tooltip + def + ove + cur).c_str());
}
void
-Effect::unsetDefaultParam(Glib::ustring pref_path, Gtk::Button *set, Gtk::Button *unset)
+Effect::unsetDefaultParam(Glib::ustring pref_path, Glib::ustring tooltip, gchar * value, gchar * defvalue, Gtk::Label *parameter_label, Gtk::Button *set , Gtk::Button *unset)
{
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
prefs->remove(pref_path);
gchar * label = _("Set");
set->set_label((Glib::ustring)label);
unset->set_sensitive(false);
+ Glib::ustring def = Glib::ustring(_("<b>Default value:</b> ")) + Glib::ustring(defvalue) + Glib::ustring("\n");
+ Glib::ustring ove = Glib::ustring(_("<b>Default value overrided:</b> None\n"));
+ Glib::ustring cur = Glib::ustring(_("<b>Current parameter value:</b> ")) + Glib::ustring(value);
+ parameter_label->set_tooltip_markup((tooltip + def + ove + cur).c_str());
}
Inkscape::XML::Node *Effect::getRepr()
diff --git a/src/live_effects/effect.h b/src/live_effects/effect.h
index e353eba23..d0024f877 100644
--- a/src/live_effects/effect.h
+++ b/src/live_effects/effect.h
@@ -181,8 +181,8 @@ protected:
std::vector<Geom::Point> selectedNodesPoints;
private:
- void setDefaultParam(Glib::ustring pref_path, gchar * value, Gtk::Button *set , Gtk::Button *unset);
- void unsetDefaultParam(Glib::ustring pref_path, Gtk::Button *set , Gtk::Button *unset);
+ void setDefaultParam(Glib::ustring pref_path, Glib::ustring par, gchar * value, gchar * defvalue, Gtk::Label *parameter_label, Gtk::Button *set , Gtk::Button *unset);
+ void unsetDefaultParam(Glib::ustring pref_path, Glib::ustring par, gchar * value, gchar * defvalue, Gtk::Label *parameter_label, Gtk::Button *set , Gtk::Button *unset);
bool provides_own_flash_paths; // if true, the standard flash path is suppressed
bool is_ready;
diff --git a/src/live_effects/parameter/array.h b/src/live_effects/parameter/array.h
index e65d3b55c..c66d53266 100644
--- a/src/live_effects/parameter/array.h
+++ b/src/live_effects/parameter/array.h
@@ -67,6 +67,10 @@ public:
gchar * str = g_strdup(os.str().c_str());
return str;
}
+
+ virtual gchar * param_getDefaultSVGValue() const {
+ return g_strdup("");
+ }
void param_setValue(std::vector<StorageType> const &new_vector) {
_vector = new_vector;
diff --git a/src/live_effects/parameter/bool.cpp b/src/live_effects/parameter/bool.cpp
index f291a8104..1a01f269b 100644
--- a/src/live_effects/parameter/bool.cpp
+++ b/src/live_effects/parameter/bool.cpp
@@ -61,6 +61,13 @@ BoolParam::param_getSVGValue() const
return str;
}
+gchar *
+BoolParam::param_getDefaultSVGValue() const
+{
+ gchar * str = g_strdup(defvalue ? "true" : "false");
+ return str;
+}
+
Gtk::Widget *
BoolParam::param_newWidget()
{
diff --git a/src/live_effects/parameter/bool.h b/src/live_effects/parameter/bool.h
index 417752050..1aa0e3c4a 100644
--- a/src/live_effects/parameter/bool.h
+++ b/src/live_effects/parameter/bool.h
@@ -32,6 +32,7 @@ public:
virtual bool param_readSVGValue(const gchar * strvalue);
virtual gchar * param_getSVGValue() const;
+ virtual gchar * param_getDefaultSVGValue() const;
void param_setValue(bool newvalue);
virtual void param_set_default();
diff --git a/src/live_effects/parameter/enum.h b/src/live_effects/parameter/enum.h
index 78fa87a4f..ca237c0f7 100644
--- a/src/live_effects/parameter/enum.h
+++ b/src/live_effects/parameter/enum.h
@@ -64,7 +64,12 @@ public:
gchar * str = g_strdup( enumdataconv->get_key(value).c_str() );
return str;
};
-
+
+ gchar * param_getDefaultSVGValue() const {
+ gchar * str = g_strdup( enumdataconv->get_key(defvalue).c_str() );
+ return str;
+ };
+
E get_value() const {
return value;
}
diff --git a/src/live_effects/parameter/fontbutton.cpp b/src/live_effects/parameter/fontbutton.cpp
index ca8908f0e..49edb850a 100644
--- a/src/live_effects/parameter/fontbutton.cpp
+++ b/src/live_effects/parameter/fontbutton.cpp
@@ -55,6 +55,14 @@ FontButtonParam::param_getSVGValue() const
return g_strdup(value.c_str());
}
+gchar *
+FontButtonParam::param_getDefaultSVGValue() const
+{
+ return g_strdup(defvalue.c_str());
+}
+
+
+
Gtk::Widget *
FontButtonParam::param_newWidget()
{
diff --git a/src/live_effects/parameter/fontbutton.h b/src/live_effects/parameter/fontbutton.h
index 60e1aa46e..e2d0e1bb2 100644
--- a/src/live_effects/parameter/fontbutton.h
+++ b/src/live_effects/parameter/fontbutton.h
@@ -28,6 +28,7 @@ public:
virtual bool param_readSVGValue(const gchar * strvalue);
void param_update_default(const gchar * default_value);
virtual gchar * param_getSVGValue() const;
+ virtual gchar * param_getDefaultSVGValue() const;
void param_setValue(Glib::ustring newvalue);
diff --git a/src/live_effects/parameter/hidden.cpp b/src/live_effects/parameter/hidden.cpp
index e8c55ebd3..e08881f6d 100644
--- a/src/live_effects/parameter/hidden.cpp
+++ b/src/live_effects/parameter/hidden.cpp
@@ -59,6 +59,15 @@ HiddenParam::param_getSVGValue() const
return str;
}
+gchar *
+HiddenParam::param_getDefaultSVGValue() const
+{
+ Inkscape::SVGOStringStream os;
+ os << defvalue;
+ gchar * str = g_strdup(os.str().c_str());
+ return str;
+}
+
Gtk::Widget *
HiddenParam::param_newWidget()
{
diff --git a/src/live_effects/parameter/hidden.h b/src/live_effects/parameter/hidden.h
index c3fba5575..b41c6c93c 100644
--- a/src/live_effects/parameter/hidden.h
+++ b/src/live_effects/parameter/hidden.h
@@ -37,6 +37,7 @@ public:
virtual bool param_readSVGValue(const gchar * strvalue);
virtual gchar * param_getSVGValue() const;
+ virtual gchar * param_getDefaultSVGValue() const;
void param_setValue(Glib::ustring newvalue, bool write = false);
virtual void param_set_default();
diff --git a/src/live_effects/parameter/item.cpp b/src/live_effects/parameter/item.cpp
index 71134b118..149fd6627 100644
--- a/src/live_effects/parameter/item.cpp
+++ b/src/live_effects/parameter/item.cpp
@@ -104,6 +104,12 @@ ItemParam::param_getSVGValue() const
return g_strdup(href);
}
+gchar *
+ItemParam::param_getDefaultSVGValue() const
+{
+ return g_strdup(defvalue);
+}
+
Gtk::Widget *
ItemParam::param_newWidget()
{
diff --git a/src/live_effects/parameter/item.h b/src/live_effects/parameter/item.h
index 89c32f9bd..b98294258 100644
--- a/src/live_effects/parameter/item.h
+++ b/src/live_effects/parameter/item.h
@@ -34,6 +34,7 @@ public:
virtual bool param_readSVGValue(const gchar * strvalue);
virtual gchar * param_getSVGValue() const;
+ virtual gchar * param_getDefaultSVGValue() const;
virtual void param_set_default();
virtual void param_update_default(const gchar * default_value);
diff --git a/src/live_effects/parameter/originalitemarray.cpp b/src/live_effects/parameter/originalitemarray.cpp
index 24b002e18..83c237f2e 100644
--- a/src/live_effects/parameter/originalitemarray.cpp
+++ b/src/live_effects/parameter/originalitemarray.cpp
@@ -442,6 +442,11 @@ gchar * OriginalItemArrayParam::param_getSVGValue() const
return str;
}
+gchar * OriginalItemArrayParam::param_getDefaultSVGValue() const
+{
+ return "";
+}
+
void OriginalItemArrayParam::update()
{
for (std::vector<ItemAndActive*>::iterator iter = _vector.begin(); iter != _vector.end(); ++iter) {
diff --git a/src/live_effects/parameter/originalitemarray.h b/src/live_effects/parameter/originalitemarray.h
index f600aba34..f93d865ec 100644
--- a/src/live_effects/parameter/originalitemarray.h
+++ b/src/live_effects/parameter/originalitemarray.h
@@ -62,6 +62,7 @@ public:
virtual Gtk::Widget * param_newWidget();
virtual bool param_readSVGValue(const gchar * strvalue);
virtual gchar * param_getSVGValue() const;
+ virtual gchar * param_getDefaultSVGValue() const;
virtual void param_set_default();
virtual void param_update_default(const gchar * default_value){};
/** Disable the canvas indicators of parent class by overriding this method */
diff --git a/src/live_effects/parameter/originalpatharray.cpp b/src/live_effects/parameter/originalpatharray.cpp
index d67f08e5b..4535b6aa5 100644
--- a/src/live_effects/parameter/originalpatharray.cpp
+++ b/src/live_effects/parameter/originalpatharray.cpp
@@ -527,6 +527,11 @@ gchar * OriginalPathArrayParam::param_getSVGValue() const
return str;
}
+gchar * OriginalPathArrayParam::param_getDefaultSVGValue() const
+{
+ return "";
+}
+
void OriginalPathArrayParam::update()
{
for (std::vector<PathAndDirectionAndVisible*>::iterator iter = _vector.begin(); iter != _vector.end(); ++iter) {
diff --git a/src/live_effects/parameter/originalpatharray.h b/src/live_effects/parameter/originalpatharray.h
index 0ba6984c2..c80d5daf3 100644
--- a/src/live_effects/parameter/originalpatharray.h
+++ b/src/live_effects/parameter/originalpatharray.h
@@ -66,6 +66,7 @@ public:
virtual Gtk::Widget * param_newWidget();
virtual bool param_readSVGValue(const gchar * strvalue);
virtual gchar * param_getSVGValue() const;
+ virtual gchar * param_getDefaultSVGValue() const;
virtual void param_set_default();
virtual void param_update_default(const gchar * default_value){};
/** Disable the canvas indicators of parent class by overriding this method */
diff --git a/src/live_effects/parameter/parameter.cpp b/src/live_effects/parameter/parameter.cpp
index 2f73488aa..319ab3fe8 100644
--- a/src/live_effects/parameter/parameter.cpp
+++ b/src/live_effects/parameter/parameter.cpp
@@ -95,6 +95,15 @@ ScalarParam::param_getSVGValue() const
return str;
}
+gchar *
+ScalarParam::param_getDefaultSVGValue() const
+{
+ Inkscape::SVGOStringStream os;
+ os << defvalue;
+ gchar * str = g_strdup(os.str().c_str());
+ return str;
+}
+
void
ScalarParam::param_set_default()
{
diff --git a/src/live_effects/parameter/parameter.h b/src/live_effects/parameter/parameter.h
index 7ab7e30dd..1586ef346 100644
--- a/src/live_effects/parameter/parameter.h
+++ b/src/live_effects/parameter/parameter.h
@@ -57,6 +57,7 @@ public:
virtual bool param_readSVGValue(const gchar * strvalue) = 0; // returns true if new value is valid / accepted.
virtual gchar * param_getSVGValue() const = 0;
+ virtual gchar * param_getDefaultSVGValue() const = 0;
virtual void param_widget_is_visible(bool is_visible) {widget_is_visible = is_visible;}
void write_to_SVG();
@@ -109,6 +110,7 @@ public:
virtual bool param_readSVGValue(const gchar * strvalue);
virtual gchar * param_getSVGValue() const;
+ virtual gchar * param_getDefaultSVGValue() const;
virtual void param_set_default();
void param_update_default(gdouble default_value);
diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp
index a91e50db8..bd6608737 100644
--- a/src/live_effects/parameter/path.cpp
+++ b/src/live_effects/parameter/path.cpp
@@ -173,6 +173,12 @@ PathParam::param_getSVGValue() const
}
}
+gchar *
+PathParam::param_getDefaultSVGValue() const
+{
+ return g_strdup(defvalue);
+}
+
void
PathParam::set_buttons(bool edit_button, bool copy_button, bool paste_button, bool link_button)
{
diff --git a/src/live_effects/parameter/path.h b/src/live_effects/parameter/path.h
index c8efb11e0..635056772 100644
--- a/src/live_effects/parameter/path.h
+++ b/src/live_effects/parameter/path.h
@@ -38,6 +38,7 @@ public:
virtual bool param_readSVGValue(const gchar * strvalue);
virtual gchar * param_getSVGValue() const;
+ virtual gchar * param_getDefaultSVGValue() const;
virtual void param_set_default();
virtual void param_update_default(const gchar * default_value);
diff --git a/src/live_effects/parameter/point.cpp b/src/live_effects/parameter/point.cpp
index 331a86f81..da6edf812 100644
--- a/src/live_effects/parameter/point.cpp
+++ b/src/live_effects/parameter/point.cpp
@@ -115,6 +115,15 @@ PointParam::param_getSVGValue() const
return str;
}
+gchar *
+PointParam::param_getDefaultSVGValue() const
+{
+ Inkscape::SVGOStringStream os;
+ os << defvalue;
+ gchar * str = g_strdup(os.str().c_str());
+ return str;
+}
+
void
PointParam::param_transform_multiply(Geom::Affine const& postmul, bool /*set*/)
{
diff --git a/src/live_effects/parameter/point.h b/src/live_effects/parameter/point.h
index a5153ad80..03256f6d0 100644
--- a/src/live_effects/parameter/point.h
+++ b/src/live_effects/parameter/point.h
@@ -38,6 +38,7 @@ public:
bool param_readSVGValue(const gchar * strvalue);
gchar * param_getSVGValue() const;
+ gchar * param_getDefaultSVGValue() const;
inline const gchar *handleTip() const { return handle_tip ? handle_tip : param_tooltip.c_str(); }
void param_setValue(Geom::Point newpoint, bool write = false);
void param_set_default();
diff --git a/src/live_effects/parameter/random.cpp b/src/live_effects/parameter/random.cpp
index b1375adda..c2c1b5440 100644
--- a/src/live_effects/parameter/random.cpp
+++ b/src/live_effects/parameter/random.cpp
@@ -71,6 +71,15 @@ RandomParam::param_getSVGValue() const
return str;
}
+gchar *
+RandomParam::param_getDefaultSVGValue() const
+{
+ Inkscape::SVGOStringStream os;
+ os << defvalue << ';' << defseed;
+ gchar * str = g_strdup(os.str().c_str());
+ return str;
+}
+
void
RandomParam::param_set_default()
{
diff --git a/src/live_effects/parameter/random.h b/src/live_effects/parameter/random.h
index 5fb6027ac..c10473e85 100644
--- a/src/live_effects/parameter/random.h
+++ b/src/live_effects/parameter/random.h
@@ -31,6 +31,7 @@ public:
virtual bool param_readSVGValue(const gchar * strvalue);
virtual gchar * param_getSVGValue() const;
+ virtual gchar * param_getDefaultSVGValue() const;
virtual void param_set_default();
virtual Gtk::Widget * param_newWidget();
diff --git a/src/live_effects/parameter/text.cpp b/src/live_effects/parameter/text.cpp
index f40708917..3f41bfeed 100644
--- a/src/live_effects/parameter/text.cpp
+++ b/src/live_effects/parameter/text.cpp
@@ -115,6 +115,15 @@ TextParam::param_getSVGValue() const
return str;
}
+gchar *
+TextParam::param_getDefaultSVGValue() const
+{
+ Inkscape::SVGOStringStream os;
+ os << defvalue;
+ gchar * str = g_strdup(os.str().c_str());
+ return str;
+}
+
Gtk::Widget *
TextParam::param_newWidget()
{
diff --git a/src/live_effects/parameter/text.h b/src/live_effects/parameter/text.h
index 137f3ee02..460ef8629 100644
--- a/src/live_effects/parameter/text.h
+++ b/src/live_effects/parameter/text.h
@@ -38,6 +38,7 @@ public:
virtual bool param_readSVGValue(const gchar * strvalue);
virtual gchar * param_getSVGValue() const;
+ virtual gchar * param_getDefaultSVGValue() const;
void param_setValue(Glib::ustring newvalue);
void param_hide_canvas_text();
diff --git a/src/live_effects/parameter/togglebutton.cpp b/src/live_effects/parameter/togglebutton.cpp
index 6aad8b3a6..16b8f9067 100644
--- a/src/live_effects/parameter/togglebutton.cpp
+++ b/src/live_effects/parameter/togglebutton.cpp
@@ -59,6 +59,13 @@ ToggleButtonParam::param_getSVGValue() const
return str;
}
+gchar *
+ToggleButtonParam::param_getDefaultSVGValue() const
+{
+ gchar * str = g_strdup(defvalue ? "true" : "false");
+ return str;
+}
+
void
ToggleButtonParam::param_update_default(bool default_value)
{
diff --git a/src/live_effects/parameter/togglebutton.h b/src/live_effects/parameter/togglebutton.h
index 02b9d5127..4d043b340 100644
--- a/src/live_effects/parameter/togglebutton.h
+++ b/src/live_effects/parameter/togglebutton.h
@@ -41,6 +41,7 @@ public:
virtual bool param_readSVGValue(const gchar * strvalue);
virtual gchar * param_getSVGValue() const;
+ virtual gchar * param_getDefaultSVGValue() const;
void param_setValue(bool newvalue);
virtual void param_set_default();
diff --git a/src/live_effects/parameter/transformedpoint.cpp b/src/live_effects/parameter/transformedpoint.cpp
index 22d5ba3a4..6ec2d0943 100644
--- a/src/live_effects/parameter/transformedpoint.cpp
+++ b/src/live_effects/parameter/transformedpoint.cpp
@@ -82,6 +82,15 @@ TransformedPointParam::param_getSVGValue() const
return str;
}
+gchar *
+TransformedPointParam::param_getDefaultSVGValue() const
+{
+ Inkscape::SVGOStringStream os;
+ os << defvalue;
+ gchar * str = g_strdup(os.str().c_str());
+ return str;
+}
+
void
TransformedPointParam::param_update_default(Geom::Point default_point)
{
diff --git a/src/live_effects/parameter/transformedpoint.h b/src/live_effects/parameter/transformedpoint.h
index 269cc508e..8b92d81ba 100644
--- a/src/live_effects/parameter/transformedpoint.h
+++ b/src/live_effects/parameter/transformedpoint.h
@@ -37,6 +37,7 @@ public:
virtual bool param_readSVGValue(const gchar * strvalue);
virtual gchar * param_getSVGValue() const;
+ virtual gchar * param_getDefaultSVGValue() const;
Geom::Point getVector() const { return vector; };
Geom::Point getOrigin() const { return origin; };
diff --git a/src/live_effects/parameter/unit.cpp b/src/live_effects/parameter/unit.cpp
index b9b91c1e6..9199e592d 100644
--- a/src/live_effects/parameter/unit.cpp
+++ b/src/live_effects/parameter/unit.cpp
@@ -48,6 +48,12 @@ UnitParam::param_getSVGValue() const
return g_strdup(unit->abbr.c_str());
}
+gchar *
+UnitParam::param_getDefaultSVGValue() const
+{
+ return g_strdup(defunit->abbr.c_str());
+}
+
void
UnitParam::param_set_default()
{
diff --git a/src/live_effects/parameter/unit.h b/src/live_effects/parameter/unit.h
index c662b6edc..86e1a24b3 100644
--- a/src/live_effects/parameter/unit.h
+++ b/src/live_effects/parameter/unit.h
@@ -31,6 +31,7 @@ public:
virtual bool param_readSVGValue(const gchar * strvalue);
virtual gchar * param_getSVGValue() const;
+ virtual gchar * param_getDefaultSVGValue() const;
virtual void param_set_default();
void param_set_value(Inkscape::Util::Unit const &val);
virtual void param_update_default(const gchar * default_unit);
diff --git a/src/live_effects/parameter/vector.cpp b/src/live_effects/parameter/vector.cpp
index 470fa9c2d..6b565536e 100644
--- a/src/live_effects/parameter/vector.cpp
+++ b/src/live_effects/parameter/vector.cpp
@@ -101,6 +101,15 @@ VectorParam::param_getSVGValue() const
return str;
}
+gchar *
+VectorParam::param_getDefaultSVGValue() const
+{
+ Inkscape::SVGOStringStream os;
+ os << defvalue;
+ gchar * str = g_strdup(os.str().c_str());
+ return str;
+}
+
Gtk::Widget *
VectorParam::param_newWidget()
{
diff --git a/src/live_effects/parameter/vector.h b/src/live_effects/parameter/vector.h
index d270e9f43..8c842e805 100644
--- a/src/live_effects/parameter/vector.h
+++ b/src/live_effects/parameter/vector.h
@@ -36,6 +36,7 @@ public:
virtual bool param_readSVGValue(const gchar * strvalue);
virtual gchar * param_getSVGValue() const;
+ virtual gchar * param_getDefaultSVGValue() const;
Geom::Point getVector() const { return vector; };
Geom::Point getOrigin() const { return origin; };