From 6dc9aa5a0656bfb2c710e5c3c30dab07507de04a Mon Sep 17 00:00:00 2001 From: Ted Gould Date: Sat, 1 Sep 2007 04:27:55 +0000 Subject: r16003@tres: ted | 2007-07-27 08:51:45 -0700 Nothing new is working really, but this is a good stopping point in the restructuring. (bzr r3633) --- src/extension/prefdialog.cpp | 54 +++++++++++++++++++++++++++++++++----------- 1 file changed, 41 insertions(+), 13 deletions(-) (limited to 'src/extension/prefdialog.cpp') diff --git a/src/extension/prefdialog.cpp b/src/extension/prefdialog.cpp index 7c3b76639..2bc971d01 100644 --- a/src/extension/prefdialog.cpp +++ b/src/extension/prefdialog.cpp @@ -2,12 +2,14 @@ * Authors: * Ted Gould * - * Copyright (C) 2005-2006 Authors + * Copyright (C) 2005-2007 Authors * * Released under GNU GPL, read the file 'COPYING' for more information */ #include +#include +#include #include #include "../dialogs/dialog-events.h" @@ -17,6 +19,7 @@ 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) @@ -26,31 +29,47 @@ 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) : - 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); @@ -73,7 +92,11 @@ PrefDialog::run (void) { while (resp == Gtk::RESPONSE_HELP) { resp = Gtk::Dialog::run(); if (resp == Gtk::RESPONSE_HELP) { - + /* + if (_helpDialog == NULL) { + _helpDialog = new HelpDialog(_help); + } + */ } } return resp; @@ -89,6 +112,11 @@ PrefDialog::setPinned (bool in_pin) { set_modal(!in_pin); } +#include "internal/clear-n_.h" + +const char * PrefDialog::pinned_param_xml = "false"; +const char * PrefDialog::live_param_xml = "false"; + }; }; /* namespace Inkscape, Extension */ /* -- cgit v1.2.3