summaryrefslogtreecommitdiffstats
path: root/src/ui/dialog/inkscape-preferences.cpp
diff options
context:
space:
mode:
authorgustav_b <gustav_b@users.sourceforge.net>2007-11-22 00:14:41 +0000
committergustav_b <gustav_b@users.sourceforge.net>2007-11-22 00:14:41 +0000
commit5caa6ff4dfb7b538555d60fa2732272bf8b9828b (patch)
tree65c6fb0232f8621fa6cecdcdf68d0790bd955777 /src/ui/dialog/inkscape-preferences.cpp
parentFix ordering of LPE parameters (no longer use map, just use vector) (diff)
downloadinkscape-5caa6ff4dfb7b538555d60fa2732272bf8b9828b.tar.gz
inkscape-5caa6ff4dfb7b538555d60fa2732272bf8b9828b.zip
The dialog to panel refactoring:
* Made the current dialogs subclass the Panel class instead of the Dialog class. * Extended the Panel class with some functionality that the dialogs relied on. * Added a PanelDialog class which is a dialog container for a single panel with the dialog behavior as a template parameter. (* Fixed coding style for the Panel and Dialog class) For details, see http://www.nabble.com/Re%3A-Dockable-dialogs%2C-todo-list-p12728194.html http://www.nabble.com/Re%3A-Inkscape-overcomes-Xara-in-Google-Trends-p13126622.html (bzr r4126)
Diffstat (limited to 'src/ui/dialog/inkscape-preferences.cpp')
-rw-r--r--src/ui/dialog/inkscape-preferences.cpp29
1 files changed, 15 insertions, 14 deletions
diff --git a/src/ui/dialog/inkscape-preferences.cpp b/src/ui/dialog/inkscape-preferences.cpp
index 5d747807b..df2952f20 100644
--- a/src/ui/dialog/inkscape-preferences.cpp
+++ b/src/ui/dialog/inkscape-preferences.cpp
@@ -43,8 +43,8 @@ namespace Inkscape {
namespace UI {
namespace Dialog {
-InkscapePreferences::InkscapePreferences(Behavior::BehaviorFactory behavior_factory)
- : Dialog (behavior_factory, "dialogs.preferences", SP_VERB_DIALOG_DISPLAY),
+InkscapePreferences::InkscapePreferences()
+ : UI::Widget::Panel ("", "dialogs.preferences", SP_VERB_DIALOG_DISPLAY),
_max_dialog_width(0),
_max_dialog_height(0),
_current_page(0)
@@ -52,19 +52,19 @@ InkscapePreferences::InkscapePreferences(Behavior::BehaviorFactory behavior_fact
//get the width of a spinbutton
Gtk::SpinButton* sb = new Gtk::SpinButton;
sb->set_width_chars(6);
- this->get_vbox()->add(*sb);
- this->show_all_children();
- Gtk:: Requisition sreq;
+ _getContents()->add(*sb);
+ show_all_children();
+ Gtk::Requisition sreq;
sb->size_request(sreq);
_sb_width = sreq.width;
- this->get_vbox()->remove(*sb);
+ _getContents()->remove(*sb);
delete sb;
//Main HBox
Gtk::HBox* hbox_list_page = Gtk::manage(new Gtk::HBox());
hbox_list_page->set_border_width(12);
hbox_list_page->set_spacing(12);
- this->get_vbox()->add(*hbox_list_page);
+ _getContents()->add(*hbox_list_page);
//Pagelist
Gtk::Frame* list_frame = Gtk::manage(new Gtk::Frame());
@@ -106,11 +106,13 @@ InkscapePreferences::InkscapePreferences(Behavior::BehaviorFactory behavior_fact
initPageCMS();
initPageMisc();
+ signalPresent().connect(sigc::mem_fun(*this, &InkscapePreferences::_presentPages));
+
//calculate the size request for this dialog
this->show_all_children();
_page_list.expand_all();
_page_list_model->foreach_iter(sigc::mem_fun(*this, &InkscapePreferences::SetMaxDialogSize));
- this->set_size_request(_max_dialog_width, _max_dialog_height);
+ _getContents()->set_size_request(_max_dialog_width, _max_dialog_height);
_page_list.collapse_all();
}
@@ -118,12 +120,6 @@ InkscapePreferences::~InkscapePreferences()
{
}
-void InkscapePreferences::present()
-{
- _page_list_model->foreach_iter(sigc::mem_fun(*this, &InkscapePreferences::PresentPage));
- Dialog::present();
-}
-
Gtk::TreeModel::iterator InkscapePreferences::AddPage(DialogPage& p, Glib::ustring title, int id)
{
return AddPage(p, title, Gtk::TreeModel::iterator() , id);
@@ -871,6 +867,11 @@ void InkscapePreferences::on_pagelist_selection_changed()
}
}
+void InkscapePreferences::_presentPages()
+{
+ _page_list_model->foreach_iter(sigc::mem_fun(*this, &InkscapePreferences::PresentPage));
+}
+
} // namespace Dialog
} // namespace UI
} // namespace Inkscape