From 5caa6ff4dfb7b538555d60fa2732272bf8b9828b Mon Sep 17 00:00:00 2001 From: gustav_b Date: Thu, 22 Nov 2007 00:14:41 +0000 Subject: 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) --- src/ui/dialog/tracedialog.cpp | 33 ++++++++++++++++----------------- 1 file changed, 16 insertions(+), 17 deletions(-) (limited to 'src/ui/dialog/tracedialog.cpp') diff --git a/src/ui/dialog/tracedialog.cpp b/src/ui/dialog/tracedialog.cpp index b7602b36a..84d7978fb 100644 --- a/src/ui/dialog/tracedialog.cpp +++ b/src/ui/dialog/tracedialog.cpp @@ -50,7 +50,7 @@ class TraceDialogImpl : public TraceDialog /** * Constructor */ - TraceDialogImpl(Behavior::BehaviorFactory behavior_factory); + TraceDialogImpl(); /** * Destructor @@ -376,11 +376,11 @@ void TraceDialogImpl::responseCallback(int response_id) /** * Constructor */ -TraceDialogImpl::TraceDialogImpl(Behavior::BehaviorFactory behavior_factory) : - TraceDialog(behavior_factory) +TraceDialogImpl::TraceDialogImpl() : + TraceDialog() { - Gtk::VBox *mainVBox = get_vbox(); + Gtk::Box *contents = _getContents(); #define MARGIN 2 //#### begin left panel @@ -664,32 +664,31 @@ TraceDialogImpl::TraceDialogImpl(Behavior::BehaviorFactory behavior_factory) : //#### Global stuff - mainVBox->pack_start(mainHBox); + contents->pack_start(mainHBox); //## The OK button - mainCancelButton = add_button(Gtk::Stock::STOP, GTK_RESPONSE_CANCEL); - if (mainCancelButton) - { - tips.set_tip((*mainCancelButton), _("Abort a trace in progress")); - mainCancelButton->set_sensitive(false); - } - mainOkButton = add_button(Gtk::Stock::OK, GTK_RESPONSE_OK); + mainCancelButton = addResponseButton(Gtk::Stock::STOP, GTK_RESPONSE_CANCEL); + if (mainCancelButton) { + tips.set_tip((*mainCancelButton), _("Abort a trace in progress")); + mainCancelButton->set_sensitive(false); + } + mainOkButton = addResponseButton(Gtk::Stock::OK, GTK_RESPONSE_OK); tips.set_tip((*mainOkButton), _("Execute the trace")); show_all_children(); //## Connect the signal - signal_response().connect( - sigc::mem_fun(*this, &TraceDialogImpl::responseCallback) ); + signalResponse().connect( + sigc::mem_fun(*this, &TraceDialogImpl::responseCallback)); } /** * Factory method. Use this to create a new TraceDialog */ -TraceDialog *TraceDialog::create(Behavior::BehaviorFactory behavior_factory) +TraceDialog &TraceDialog::getInstance() { - TraceDialog *dialog = new TraceDialogImpl(behavior_factory); - return dialog; + TraceDialog *dialog = new TraceDialogImpl(); + return *dialog; } -- cgit v1.2.3