Author: mordante
Date: Fri May 22 16:59:30 2009
New Revision: 35823

URL: http://svn.gna.org/viewcvs/wesnoth?rev=35823&view=rev
Log:
Convert some calls to gui2::show_error_message.

Found some function that use "Error" as title instead of using the
specialized function, so converted them.

Modified:
    trunk/src/addon_management.cpp
    trunk/src/editor2/editor_controller.cpp
    trunk/src/savegame.cpp

Modified: trunk/src/addon_management.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/addon_management.cpp?rev=35823&r1=35822&r2=35823&view=diff
==============================================================================
--- trunk/src/addon_management.cpp (original)
+++ trunk/src/addon_management.cpp Fri May 22 16:59:30 2009
@@ -1092,8 +1092,7 @@
                prepare_addons_list_for_display(addons, addon_dirs, parentdir);
 
                if (addons.empty()) {
-                       /** @todo should use a dialog which always shows the 
close button. */
-                       gui2::show_message(disp.video(), _("Error"),
+                       gui2::show_error_message(disp.video(),
                                _("You have no add-ons installed."));
                        return;
                }
@@ -1148,13 +1147,10 @@
                }
                else
                {
-                       const std::string err_msg_title = _("Error");
                        std::string err_msg = _("Add-on could not be deleted 
properly:");
                        err_msg += '\n';
                        err_msg += removal_log;
-                       /* GCC-3.3 needs a temp var otherwise compilation fails 
*/
-                       gui::dialog dlg2(disp, err_msg_title, err_msg, 
gui::OK_ONLY);
-                       dlg2.show();
+                       gui2::show_error_message(disp.video(), err_msg);
                }
        }
 

Modified: trunk/src/editor2/editor_controller.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/editor2/editor_controller.cpp?rev=35823&r1=35822&r2=35823&view=diff
==============================================================================
--- trunk/src/editor2/editor_controller.cpp (original)
+++ trunk/src/editor2/editor_controller.cpp Fri May 22 16:59:30 2009
@@ -23,6 +23,7 @@
 #include "gui/dialogs/editor_generate_map.hpp"
 #include "gui/dialogs/editor_resize_map.hpp"
 #include "gui/dialogs/editor_settings.hpp"
+#include "gui/dialogs/message.hpp"
 #include "gui/widgets/window.hpp"
 
 #include "../clipboard.hpp"
@@ -366,7 +367,8 @@
 void editor_controller::editor_settings_dialog()
 {
        if (tods_.empty()) {
-               gui::message_dialog(gui(), _("Error"), _("No editor time-of-day 
found.")).show();
+               gui2::show_error_message(gui().video(),
+                               _("No editor time-of-day found."));
                return;
        }
 
@@ -476,7 +478,8 @@
 void editor_controller::generate_map_dialog()
 {
        if (map_generators_.empty()) {
-               gui::message_dialog(gui(), _("Error"), _("No random map 
generators found.")).show();
+               gui2::show_error_message(gui().video(),
+                               _("No random map generators found."));
                return;
        }
        gui2::teditor_generate_map dialog;
@@ -512,7 +515,7 @@
                        gui::message_dialog(gui(), _("Error loading mask"), 
e.what()).show();
                        return;
                } catch (editor_action_exception& e) {
-                       gui::message_dialog(gui(), _("Error"), e.what()).show();
+                       gui2::show_error_message(gui().video(), e.what());
                        return;
                }
        }
@@ -534,7 +537,7 @@
                        gui::message_dialog(gui(), _("Error loading map"), 
e.what()).show();
                        return;
                } catch (editor_action_exception& e) {
-                       gui::message_dialog(gui(), _("Error"), e.what()).show();
+                       gui2::show_error_message(gui().video(), e.what());
                        return;
                }
        }

Modified: trunk/src/savegame.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/savegame.cpp?rev=35823&r1=35822&r2=35823&view=diff
==============================================================================
--- trunk/src/savegame.cpp (original)
+++ trunk/src/savegame.cpp Fri May 22 16:59:30 2009
@@ -573,7 +573,7 @@
 void savegame::check_filename(const std::string& filename, CVideo& video)
 {
        if (is_gzip_file(filename)) {
-               gui2::show_message(video, _("Error"), _("Save names should not 
end on '.gz'. "
+               gui2::show_error_message(video, _("Save names should not end on 
'.gz'. "
                        "Please choose a different name."));
                throw illegal_filename_exception();
        }
@@ -639,7 +639,7 @@
                return true;
        } catch(game::save_game_failed&) {
                if (video != NULL){
-                       gui2::show_message(*video,_("Error"), error_message_);
+                       gui2::show_error_message(*video,error_message_);
                        //do not bother retrying, since the user can just try 
to save the game again
                        //maybe show a yes-no dialog for "disable autosaves 
now"?
                }


_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits

Reply via email to