summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e3f1035)
raw | patch | inline | side by side (parent: e3f1035)
author | gouldtj <gouldtj@users.sourceforge.net> | |
Sat, 1 Sep 2007 04:27:55 +0000 (04:27 +0000) | ||
committer | gouldtj <gouldtj@users.sourceforge.net> | |
Sat, 1 Sep 2007 04:27:55 +0000 (04:27 +0000) |
Nothing new is working really, but this is a good stopping point in the
restructuring.
restructuring.
src/extension/execution-env.cpp | patch | blob | history | |
src/extension/prefdialog.cpp | patch | blob | history | |
src/extension/prefdialog.h | patch | blob | history |
index f43e953299c4c14e8128bd0e4f40b933a35689df..547eb5a300eec6f83e39fa7e0836347263fae313 100644 (file)
delete _visibleDialog;
}
- _visibleDialog = new PrefDialog(_effect->get_name(), _effect->get_help(), controls);
+ _visibleDialog = new PrefDialog(_effect->get_name(), _effect->get_help(), controls, this);
_visibleDialog->signal_response().connect(sigc::mem_fun(this, &ExecutionEnv::preferencesResponse));
_visibleDialog->show();
index 7c3b766391735df675158ced38c8ee370cade300..2bc971d01fb675ec37cf226bae18ee246c4d4a73 100644 (file)
* Authors:
* Ted Gould <ted@gould.cx>
*
- * Copyright (C) 2005-2006 Authors
+ * Copyright (C) 2005-2007 Authors
*
* Released under GNU GPL, read the file 'COPYING' for more information
*/
#include <gtkmm/stock.h>
+#include <gtkmm/checkbutton.h>
+#include <gtkmm/separator.h>
#include <glibmm/i18n.h>
#include "../dialogs/dialog-events.h"
namespace Inkscape {
namespace Extension {
+
/** \brief Creates a new preference dialog for extension preferences
\param name Name of the Extension who's dialog this is
\param help The help string for the extension (NULL if none)
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) :
- Gtk::Dialog::Dialog(_(name.c_str()), true, true), _help(help), _name(name)
+PrefDialog::PrefDialog (Glib::ustring name, gchar const * help, Gtk::Widget * controls, ExecutionEnv * exEnv) :
+ Gtk::Dialog::Dialog(_(name.c_str()), true, true),
+ _help(help),
+ _name(name),
+ _exEnv(exEnv),
+ _button_ok(NULL),
+ _button_cancel(NULL),
+ _button_preview(NULL),
+ _button_pinned(NULL)
{
- // I'm leaving the following in here as I'm perhaps missing something
- /* A hack to internationalize the title properly */
- //gchar * title = g_strdup_printf("%s", name.c_str());
- //this->set_title(title);
- //g_free(title);
-
Gtk::HBox * hbox = Gtk::manage(new Gtk::HBox());
hbox->pack_start(*controls, true, true, 6);
hbox->show();
this->get_vbox()->pack_start(*hbox, true, true, 6);
+ if (_exEnv != NULL) {
+ 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->show();
+ _button_pinned = Gtk::manage(new Gtk::CheckButton(_("Pin Dialog")));
+ _button_pinned->show();
+ hbox->pack_start(*_button_preview, true, true,6);
+ hbox->pack_start(*_button_pinned, true, true,6);
+ hbox->show();
+ this->get_vbox()->pack_start(*hbox, true, true, 6);
+ }
/*
Gtk::Button * help_button = add_button(Gtk::Stock::HELP, Gtk::RESPONSE_HELP);
if (_help == NULL)
help_button->set_sensitive(false);
*/
- add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
+ _button_cancel = add_button(Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
- Gtk::Button * ok = add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
+ _button_ok = add_button(Gtk::Stock::OK, Gtk::RESPONSE_OK);
set_default_response(Gtk::RESPONSE_OK);
- ok->grab_focus();
+ _button_ok->grab_focus();
GtkWidget *dlg = GTK_WIDGET(gobj());
sp_transientize(dlg);
while (resp == Gtk::RESPONSE_HELP) {
resp = Gtk::Dialog::run();
if (resp == Gtk::RESPONSE_HELP) {
-
+ /*
+ if (_helpDialog == NULL) {
+ _helpDialog = new HelpDialog(_help);
+ }
+ */
}
}
return resp;
set_modal(!in_pin);
}
+#include "internal/clear-n_.h"
+
+const char * PrefDialog::pinned_param_xml = "<param name=\"__pinned__\" type=\"boolean\" gui-text=\"" N_("Pin Dialog") "\" gui-description=\"" N_("Toggles whether the dialog stays for multiple executions or disappears after one") "\" scope=\"user\">false</param>";
+const char * PrefDialog::live_param_xml = "<param name=\"__live_effect__\" type=\"boolean\" gui-text=\"" N_("Live Preview") "\" gui-description=\"" N_("Controls whether the effect settings are rendered live on canvas") "\" scope=\"user\">false</param>";
+
}; }; /* namespace Inkscape, Extension */
/*
index 4b7aa67b57294c9e72765031b19c757c2a8071a6..1965b7e96677bc4c9cb038ad90532b237742cb03 100644 (file)
#include <gdkmm/types.h>
#include <gtkmm/dialog.h>
+#include <gtkmm/checkbutton.h>
#include <gtkmm/socket.h>
+#include "execution-env.h"
+
namespace Inkscape {
namespace Extension {
gchar const * _help;
/** \brief Name of the extension */
Glib::ustring _name;
+ /** \brief An execution environment if there is one */
+ ExecutionEnv * _exEnv;
+
+ /** \brief A pointer to the OK button */
+ Gtk::Button * _button_ok;
+ /** \brief A pointer to the CANCEL button */
+ Gtk::Button * _button_cancel;
+
+ /** \brief Button to control live preview */
+ Gtk::CheckButton * _button_preview;
+ /** \brief Button to control whether the dialog is pinned */
+ Gtk::CheckButton * _button_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;
public:
- PrefDialog (Glib::ustring name, gchar const * help, Gtk::Widget * controls);
+ PrefDialog (Glib::ustring name,
+ gchar const * help,
+ Gtk::Widget * controls,
+ ExecutionEnv * exEnv = NULL);
int run (void);
void setPreviewState (Glib::ustring state);