From: pabs Date: Fri, 9 Mar 2007 06:57:18 +0000 (+0000) Subject: Convert the rest of the error and warning dialogs to Gtk::MessageDialog since it... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=cadb5ae616105e83ba0c7603fef81a02618cda98;p=synfig.git Convert the rest of the error and warning dialogs to Gtk::MessageDialog since it is more standard and pretty. git-svn-id: http://svn.voria.com/code@276 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-studio/trunk/src/gtkmm/app.cpp b/synfig-studio/trunk/src/gtkmm/app.cpp index e1d1a6e..31a03dc 100644 --- a/synfig-studio/trunk/src/gtkmm/app.cpp +++ b/synfig-studio/trunk/src/gtkmm/app.cpp @@ -335,16 +335,7 @@ public: virtual bool error(const std::string &err) { - Gtk::Dialog dialog( - "Error", // Title - true, // Modal - true // use_separator - ); - Gtk::Label label(err); - label.show(); - - dialog.get_vbox()->pack_start(label); - dialog.add_button(Gtk::StockID("gtk-ok"),RESPONSE_OK); + Gtk::MessageDialog dialog(err, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true); dialog.show(); dialog.run(); return true; @@ -1870,16 +1861,8 @@ App::dialog_saveas_file(const std::string &title, std::string &filename) void App::dialog_error_blocking(const std::string &title, const std::string &message) { - Gtk::Dialog dialog( - title, // Title - true, // Modal - true // use_separator - ); - Gtk::Label label(message); - label.show(); - - dialog.get_vbox()->pack_start(label); - dialog.add_button(Gtk::StockID("gtk-ok"),1); + Gtk::MessageDialog dialog(message, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true); + dialog.set_title(title); dialog.show(); dialog.run(); } @@ -1887,16 +1870,8 @@ App::dialog_error_blocking(const std::string &title, const std::string &message) void App::dialog_warning_blocking(const std::string &title, const std::string &message) { - Gtk::Dialog dialog( - title, // Title - true, // Modal - true // use_separator - ); - Gtk::Label label(message); - label.show(); - - dialog.get_vbox()->pack_start(label); - dialog.add_button(Gtk::StockID("gtk-ok"),1); + Gtk::MessageDialog dialog(message, false, Gtk::MESSAGE_WARNING, Gtk::BUTTONS_CLOSE, true); + dialog.set_title(title); dialog.show(); dialog.run(); } diff --git a/synfig-studio/trunk/src/gtkmm/canvasview.cpp b/synfig-studio/trunk/src/gtkmm/canvasview.cpp index f882d12..c70048d 100644 --- a/synfig-studio/trunk/src/gtkmm/canvasview.cpp +++ b/synfig-studio/trunk/src/gtkmm/canvasview.cpp @@ -37,6 +37,7 @@ #include #include #include +#include #include #include @@ -336,18 +337,7 @@ public: // then just go ahead and return false -- // don't bother displaying a dialog if(view->cancel)return false; - - Gtk::Dialog dialog( - "Error", // Title - *view, // Parent - true, // Modal - true // use_separator - ); - Gtk::Label label(err); - label.show(); - - dialog.get_vbox()->pack_start(label); - dialog.add_button(Gtk::StockID("gtk-ok"),RESPONSE_OK); + Gtk::MessageDialog dialog(*view, err, false, Gtk::MESSAGE_ERROR, Gtk::BUTTONS_CLOSE, true); dialog.show(); dialog.run(); view->statusbar->pop();