summaryrefslogtreecommitdiffstats
path: root/src/extension/prefdialog.cpp
diff options
context:
space:
mode:
authorTed Gould <ted@gould.cx>2007-09-01 04:34:22 +0000
committergouldtj <gouldtj@users.sourceforge.net>2007-09-01 04:34:22 +0000
commitc832235b1dc76af96cd2a9ac8b5127871f6bec6c (patch)
treeb45b1461598f06080dc15b8f07b65b39198afce2 /src/extension/prefdialog.cpp
parentr16405@tres: ted | 2007-08-29 19:50:24 -0700 (diff)
downloadinkscape-c832235b1dc76af96cd2a9ac8b5127871f6bec6c.tar.gz
inkscape-c832235b1dc76af96cd2a9ac8b5127871f6bec6c.zip
r16406@tres: ted | 2007-08-29 20:14:55 -0700
Reroute the way that the preferences signal changes so that pinning works as expected. Fixes a segmentation fault. (bzr r3645)
Diffstat (limited to 'src/extension/prefdialog.cpp')
-rw-r--r--src/extension/prefdialog.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/extension/prefdialog.cpp b/src/extension/prefdialog.cpp
index 7da2a9e29..cef642d50 100644
--- a/src/extension/prefdialog.cpp
+++ b/src/extension/prefdialog.cpp
@@ -38,7 +38,7 @@ namespace Extension {
in the title. It adds a few buttons and sets up handlers for
them. It also places the passed in widgets into the dialog.
*/
-PrefDialog::PrefDialog (Glib::ustring name, gchar const * help, Gtk::Widget * controls, ExecutionEnv * exEnv, Effect * effect) :
+PrefDialog::PrefDialog (Glib::ustring name, gchar const * help, Gtk::Widget * controls, ExecutionEnv * exEnv, Effect * effect, sigc::signal<void> * changeSignal) :
Gtk::Dialog::Dialog(_(name.c_str()), true, true),
_help(help),
_name(name),
@@ -50,7 +50,8 @@ PrefDialog::PrefDialog (Glib::ustring name, gchar const * help, Gtk::Widget * co
_button_pinned(NULL),
_param_preview(NULL),
_param_pinned(NULL),
- _effect(effect)
+ _effect(effect),
+ _signal_param_change(changeSignal)
{
Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox());
hbox->pack_start(*controls, true, true, 6);
@@ -182,7 +183,7 @@ PrefDialog::pinned_toggle (void) {
_button_cancel->set_label(Gtk::Stock::CANCEL.id);
if (_exEnv == NULL) {
- _exEnv = new ExecutionEnv(_effect, SP_ACTIVE_DESKTOP, NULL, this);
+ _exEnv = new ExecutionEnv(_effect, SP_ACTIVE_DESKTOP, NULL, _signal_param_change, this);
_createdExEnv = true;
preview_toggle();
_exEnv->run();
@@ -201,6 +202,12 @@ PrefDialog::on_response (int signal) {
if (signal == Gtk::RESPONSE_OK) {
_effect->effect(SP_ACTIVE_DESKTOP);
+ } else {
+ this->hide();
+ delete _signal_param_change; // This is not in the destructor because
+ // it is the only situation that we need
+ // to delete it in
+ delete this;
}
this->hide();