diff options
| author | Ted Gould <ted@gould.cx> | 2007-09-01 04:31:13 +0000 |
|---|---|---|
| committer | gouldtj <gouldtj@users.sourceforge.net> | 2007-09-01 04:31:13 +0000 |
| commit | 375a65d6fe1a9f94f7dfbbe7a60f0f958e61692b (patch) | |
| tree | 0993c1647fede02351fbd9399bb022c600ec6e50 /src | |
| parent | r16267@tres: ted | 2007-08-16 23:04:38 -0700 (diff) | |
| download | inkscape-375a65d6fe1a9f94f7dfbbe7a60f0f958e61692b.tar.gz inkscape-375a65d6fe1a9f94f7dfbbe7a60f0f958e61692b.zip | |
(bzr r3637)
Diffstat (limited to 'src')
| -rw-r--r-- | src/extension/prefdialog.cpp | 13 | ||||
| -rw-r--r-- | src/extension/prefdialog.h | 16 |
2 files changed, 25 insertions, 4 deletions
diff --git a/src/extension/prefdialog.cpp b/src/extension/prefdialog.cpp index c9c218b4d..66a04dc1d 100644 --- a/src/extension/prefdialog.cpp +++ b/src/extension/prefdialog.cpp @@ -72,14 +72,23 @@ PrefDialog::PrefDialog (Glib::ustring name, gchar const * help, Gtk::Widget * co // If we're working with an effect that can be live and // the dialog can be pinned, put those options in too if (_exEnv != NULL) { + if (_param_preview == NULL) { + XML::Document * doc = sp_repr_read_mem(live_param_xml, strlen(live_param_xml), NULL); + _param_preview = Parameter::make(doc->root(), _exEnv->_effect); + } + if (_param_pinned == NULL) { + XML::Document * doc = sp_repr_read_mem(pinned_param_xml, strlen(pinned_param_xml), NULL); + _param_pinned = Parameter::make(doc->root(), _exEnv->_effect); + } + Gtk::HSeparator * sep = Gtk::manage(new Gtk::HSeparator()); sep->show(); this->get_vbox()->pack_start(*sep, true, true, 4); hbox = Gtk::manage(new Gtk::HBox()); - _button_preview = Gtk::manage(new Gtk::CheckButton(_("Live Preview"))); + _button_preview = _param_preview->get_widget(NULL, NULL, &_signal_preview); _button_preview->show(); - _button_pinned = Gtk::manage(new Gtk::CheckButton(_("Pin Dialog"))); + _button_pinned = _param_pinned->get_widget(NULL, NULL, &_signal_pinned); _button_pinned->show(); hbox->pack_start(*_button_preview, true, true,6); hbox->pack_start(*_button_pinned, true, true,6); diff --git a/src/extension/prefdialog.h b/src/extension/prefdialog.h index 90dcb14ae..059cfce45 100644 --- a/src/extension/prefdialog.h +++ b/src/extension/prefdialog.h @@ -19,6 +19,7 @@ #include <gtkmm/socket.h> #include "execution-env.h" +#include "parameter.h" namespace Inkscape { namespace Extension { @@ -38,15 +39,25 @@ class PrefDialog : public Gtk::Dialog { Gtk::Button * _button_cancel; /** \brief Button to control live preview */ - Gtk::CheckButton * _button_preview; + Gtk::Widget * _button_preview; /** \brief Button to control whether the dialog is pinned */ - Gtk::CheckButton * _button_pinned; + Gtk::Widget * _button_pinned; + + /** \brief Parameter to control live preview */ + Parameter * _param_preview; + /** \brief Parameter to control pinning the dialog */ + Parameter * _param_pinned; /** \brief XML to define the pinned parameter on the dialog */ static const char * pinned_param_xml; /** \brief XML to define the live effects parameter on the dialog */ static const char * live_param_xml; + /** \brief Signal that the user is changing the live effect state */ + sigc::signal<void> _signal_preview; + /** \brief Signal that the user is changing the pinned state */ + sigc::signal<void> _signal_pinned; + Effect * _effect; void preview_toggle(void); @@ -60,6 +71,7 @@ public: Gtk::Widget * controls, ExecutionEnv * exEnv = NULL, Effect * effect = NULL); + ~PrefDialog (); int run (void); void setPreviewState (Glib::ustring state); |
