summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 597994b)
raw | patch | inline | side by side (parent: 597994b)
author | gouldtj <gouldtj@users.sourceforge.net> | |
Sat, 1 Sep 2007 04:31:13 +0000 (04:31 +0000) | ||
committer | gouldtj <gouldtj@users.sourceforge.net> | |
Sat, 1 Sep 2007 04:31:13 +0000 (04:31 +0000) |
src/extension/prefdialog.cpp | patch | blob | history | |
src/extension/prefdialog.h | patch | blob | history |
index c9c218b4d93633bc80b41fb77428616e8ddd2915..66a04dc1def0fb7c9b4283aaaf7fff25254eefa6 100644 (file)
@@ -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);
index 90dcb14aebbb491dd5bc9b7af265b6f38e163e1a..059cfce45965a15964a3d1d5dd2f2dc08e021785 100644 (file)
#include <gtkmm/socket.h>
#include "execution-env.h"
+#include "parameter.h"
namespace Inkscape {
namespace Extension {
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);
Gtk::Widget * controls,
ExecutionEnv * exEnv = NULL,
Effect * effect = NULL);
+ ~PrefDialog ();
int run (void);
void setPreviewState (Glib::ustring state);