diff options
| author | gustav_b <gustav_b@users.sourceforge.net> | 2007-11-22 00:14:41 +0000 |
|---|---|---|
| committer | gustav_b <gustav_b@users.sourceforge.net> | 2007-11-22 00:14:41 +0000 |
| commit | 5caa6ff4dfb7b538555d60fa2732272bf8b9828b (patch) | |
| tree | 65c6fb0232f8621fa6cecdcdf68d0790bd955777 /src/ui/dialog/document-metadata.cpp | |
| parent | Fix ordering of LPE parameters (no longer use map, just use vector) (diff) | |
| download | inkscape-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/document-metadata.cpp')
| -rw-r--r-- | src/ui/dialog/document-metadata.cpp | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/src/ui/dialog/document-metadata.cpp b/src/ui/dialog/document-metadata.cpp index 22f6f64be..5671e08fe 100644 --- a/src/ui/dialog/document-metadata.cpp +++ b/src/ui/dialog/document-metadata.cpp @@ -62,13 +62,13 @@ static Inkscape::XML::NodeEventVector const _repr_events = { }; -DocumentMetadata* -DocumentMetadata::create(Behavior::BehaviorFactory behavior_factory) +DocumentMetadata & +DocumentMetadata::getInstance() { - if (_instance) return _instance; - _instance = new DocumentMetadata(behavior_factory); + if (_instance) return *_instance; + _instance = new DocumentMetadata(); _instance->init(); - return _instance; + return *_instance; } void @@ -81,16 +81,15 @@ DocumentMetadata::destroy() } } -DocumentMetadata::DocumentMetadata(Behavior::BehaviorFactory behavior_factory) - : Dialog (behavior_factory, "dialogs.documentmetadata", SP_VERB_DIALOG_METADATA), +DocumentMetadata::DocumentMetadata() + : UI::Widget::Panel ("", "dialogs.documentmetadata", SP_VERB_DIALOG_METADATA), _page_metadata1(1, 1), _page_metadata2(1, 1), _prefs_path("dialogs.documentmetadata") { hide(); - set_resizable (true); _tt.enable(); - get_vbox()->set_spacing (4); - get_vbox()->pack_start (_notebook, true, true); + _getContents()->set_spacing (4); + _getContents()->pack_start(_notebook, true, true); _notebook.append_page(_page_metadata1, _("Metadata")); _notebook.append_page(_page_metadata2, _("License")); @@ -115,7 +114,6 @@ DocumentMetadata::init() G_CALLBACK(on_deactivate_desktop), 0); show_all_children(); - present(); } DocumentMetadata::~DocumentMetadata() @@ -236,12 +234,6 @@ DocumentMetadata::update() //-------------------------------------------------------------------- -void -DocumentMetadata::on_response (int id) -{ - if (id == Gtk::RESPONSE_CLOSE) - hide(); -} /** * Called when XML node attribute changed; updates dialog widgets. |
