Convert the rest of the error and warning dialogs to Gtk::MessageDialog since it...
authorpabs <pabs@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 9 Mar 2007 06:57:18 +0000 (06:57 +0000)
committerpabs <pabs@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 9 Mar 2007 06:57:18 +0000 (06:57 +0000)
git-svn-id: http://svn.voria.com/code@276 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-studio/trunk/src/gtkmm/app.cpp
synfig-studio/trunk/src/gtkmm/canvasview.cpp

index e1d1a6e..31a03dc 100644 (file)
@@ -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();
 }
index f882d12..c70048d 100644 (file)
@@ -37,6 +37,7 @@
 #include <gtkmm/paned.h>
 #include <gtkmm/scale.h>
 #include <gtkmm/dialog.h>
+#include <gtkmm/messagedialog.h>
 #include <gtkmm/treemodelsort.h>
 #include <gtkmm/buttonbox.h>
 
@@ -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();