summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/guides.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui/dialog/guides.cpp')
-rw-r--r--src/ui/dialog/guides.cpp43
1 files changed, 15 insertions, 28 deletions
diff --git a/src/ui/dialog/guides.cpp b/src/ui/dialog/guides.cpp
index e84f25733..80740113c 100644
--- a/src/ui/dialog/guides.cpp
+++ b/src/ui/dialog/guides.cpp
@@ -68,20 +68,6 @@ void GuidelinePropertiesDialog::showDialog(SPGuide *guide, SPDesktop *desktop) {
dialog.run();
}
-void GuidelinePropertiesDialog::_colorChanged()
-{
-#if WITH_GTKMM_3_0
- const Gdk::RGBA c = _color.get_rgba();
- unsigned r = c.get_red_u()/257, g = c.get_green_u()/257, b = c.get_blue_u()/257;
-#else
- const Gdk::Color c = _color.get_color();
- unsigned r = c.get_red()/257, g = c.get_green()/257, b = c.get_blue()/257;
-#endif
- //TODO: why 257? verify this!
-
- sp_guide_set_color(*_guide, r, g, b, true);
-}
-
void GuidelinePropertiesDialog::_modeChanged()
{
_mode = !_relative_toggle.get_active();
@@ -100,7 +86,7 @@ void GuidelinePropertiesDialog::_modeChanged()
}
}
-void GuidelinePropertiesDialog::_onApply()
+void GuidelinePropertiesDialog::_onOK()
{
double deg_angle = _spin_angle.getValue(DEG);
if (!_mode)
@@ -124,18 +110,26 @@ void GuidelinePropertiesDialog::_onApply()
sp_guide_moveto(*_guide, newpos, true);
- const gchar* name = _label_entry.getEntry()->get_text().c_str();
+ const gchar* name = g_strdup( _label_entry.getEntry()->get_text().c_str() );
+
sp_guide_set_label(*_guide, name, true);
+ g_free((gpointer) name);
+
+#if WITH_GTKMM_3_0
+ const Gdk::RGBA c = _color.get_rgba();
+ unsigned r = c.get_red_u()/257, g = c.get_green_u()/257, b = c.get_blue_u()/257;
+#else
+ const Gdk::Color c = _color.get_color();
+ unsigned r = c.get_red()/257, g = c.get_green()/257, b = c.get_blue()/257;
+#endif
+ //TODO: why 257? verify this!
+
+ sp_guide_set_color(*_guide, r, g, b, true);
DocumentUndo::done(_guide->document, SP_VERB_NONE,
_("Set guide properties"));
}
-void GuidelinePropertiesDialog::_onOK()
-{
- _onApply();
-}
-
void GuidelinePropertiesDialog::_onDelete()
{
SPDocument *doc = _guide->document;
@@ -157,10 +151,6 @@ void GuidelinePropertiesDialog::_response(gint response)
break;
case Gtk::RESPONSE_DELETE_EVENT:
break;
-/* case GTK_RESPONSE_APPLY:
- _onApply();
- break;
-*/
default:
g_assert_not_reached();
}
@@ -222,9 +212,6 @@ void GuidelinePropertiesDialog::_setup() {
1, 3, 3, 4, Gtk::EXPAND | Gtk::FILL, Gtk::FILL);
#endif
- _color.signal_color_set().connect(sigc::mem_fun(*this, &GuidelinePropertiesDialog::_colorChanged));
-
-
// unitmenus
/* fixme: We should allow percents here too, as percents of the canvas size */
_unit_menu.setUnitType(UNIT_TYPE_LINEAR);