Author: mordante
Date: Fri May 22 16:59:19 2009
New Revision: 35821

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

Modified:
    trunk/src/addon_management.cpp
    trunk/src/game.cpp
    trunk/src/menu_events.cpp
    trunk/src/multiplayer.cpp
    trunk/src/playcampaign.cpp
    trunk/src/savegame.cpp
    trunk/src/wml_exception.cpp

Modified: trunk/src/addon_management.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/addon_management.cpp?rev=35821&r1=35820&r2=35821&view=diff
==============================================================================
--- trunk/src/addon_management.cpp (original)
+++ trunk/src/addon_management.cpp Fri May 22 16:59:19 2009
@@ -466,14 +466,14 @@
                config data;
                sock = network::receive_data(data,sock,5000);
                if(!sock) {
-                       gui::show_error_message(disp, _("Connection timed 
out"));
+                       gui2::show_error_message(disp.video(), _("Connection 
timed out"));
                        return;
                } else if (const config &c = data.child("error")) {
                        std::string error_message = _("The server responded 
with an error: \"$error|\"");
                        utils::string_map symbols;
                        symbols["error"] = c["message"].str();
                        error_message = 
utils::interpolate_variables_into_string(error_message, &symbols);
-                       gui::show_error_message(disp, error_message);
+                       gui2::show_error_message(disp.video(), error_message);
                        return;
                } else if (const config &c = data.child("message")) {
                        /* GCC-3.3 needs a temp var otherwise compilation fails 
*/
@@ -515,7 +515,7 @@
                if(!sock) {
                        return;
                } else if (const config &c = data.child("error")) {
-                       gui::show_error_message(disp, _("The server responded 
with an error: \"") +
+                       gui2::show_error_message(disp.video(), _("The server 
responded with an error: \"") +
                                                c["message"].str() + '"');
                } else if (const config &c = data.child("message")) {
                        /* GCC-3.3 needs a temp var otherwise compilation fails 
*/
@@ -540,9 +540,9 @@
 
                sock = network::receive_data(data,sock,5000);
                if(!sock) {
-                       gui::show_error_message(disp, _("Connection timed 
out"));
+                       gui2::show_error_message(disp.video(), _("Connection 
timed out"));
                } else if (const config &c = data.child("error")) {
-                       gui::show_error_message(disp, _("The server responded 
with an error: \"") +
+                       gui2::show_error_message(disp.video(), _("The server 
responded with an error: \"") +
                                                c["message"].str() + '"');
                } else if (const config &c = data.child("message")) {
                        /* GCC-3.3 needs a temp var otherwise compilation fails 
*/
@@ -584,12 +584,12 @@
                }
 
                if (config const &dlerror = cfg.child("error")) {
-                       gui::show_error_message(disp, dlerror["message"]);
+                       gui2::show_error_message(disp.video(), 
dlerror["message"]);
                        return false;
                }
 
                if(!check_names_legal(cfg)) {
-                       gui::show_error_message(disp, _("The add-on has an 
invalid file or directory name and can not be installed."));
+                       gui2::show_error_message(disp.video(), _("The add-on 
has an invalid file or directory name and can not be installed."));
                        return false;
                }
 
@@ -891,7 +891,7 @@
                                dialogs::network_connect_dialog(disp, 
_("Connecting to add-ons server..."),
                                                                remote_host, 
remote_port);
                        if(!sock) {
-                               gui::show_error_message(disp, _("Could not 
connect to host."));
+                               gui2::show_error_message(disp.video(), _("Could 
not connect to host."));
                                preferences::set_campaign_server(old_host);
                                return;
                        }
@@ -905,13 +905,13 @@
                        }
 
                        if (config const &error = cfg.child("error")) {
-                               gui::show_error_message(disp, error["message"]);
+                               gui2::show_error_message(disp.video(), 
error["message"]);
                                return;
                        }
 
                        config const &addons_tree = cfg.child("campaigns");
                        if (!addons_tree) {
-                               gui::show_error_message(disp, _("An error 
occurred while communicating with the server."));
+                               gui2::show_error_message(disp.video(), _("An 
error occurred while communicating with the server."));
                                return;
                        }
 
@@ -1006,7 +1006,7 @@
                        }
 
                        if(addons.empty() && publish_options.empty()) {
-                               gui::show_error_message(disp, _("There are no 
add-ons available for download from this server."));
+                               gui2::show_error_message(disp.video(), _("There 
are no add-ons available for download from this server."));
                                return;
                        }
 
@@ -1069,13 +1069,13 @@
 
                } catch(config::error& e) {
                        ERR_CFG << "config::error thrown during transaction 
with add-on server; \""<< e.message << "\"\n";
-                       gui::show_error_message(disp, _("Network communication 
error."));
+                       gui2::show_error_message(disp.video(), _("Network 
communication error."));
                } catch(network::error& e) {
                        ERR_NET << "network::error thrown during transaction 
with add-on server; \""<< e.message << "\"\n";
-                       gui::show_error_message(disp, _("Remote host 
disconnected."));
+                       gui2::show_error_message(disp.video(), _("Remote host 
disconnected."));
                } catch(io_exception& e) {
                        ERR_FS << "io_exception thrown while installing an 
addon; \"" << e.what() << "\"\n";
-                       gui::show_error_message(disp, _("A problem occurred 
when trying to create the files necessary to install this add-on."));
+                       gui2::show_error_message(disp.video(), _("A problem 
occurred when trying to create the files necessary to install this add-on."));
                } catch(twml_exception& e) {
                        e.show(disp);
                }

Modified: trunk/src/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game.cpp?rev=35821&r1=35820&r2=35821&view=diff
==============================================================================
--- trunk/src/game.cpp (original)
+++ trunk/src/game.cpp Fri May 22 16:59:19 2009
@@ -35,6 +35,7 @@
 #include "gui/dialogs/addon_connect.hpp"
 #include "gui/dialogs/campaign_selection.hpp"
 #include "gui/dialogs/language_selection.hpp"
+#include "gui/dialogs/message.hpp"
 #include "gui/dialogs/mp_method_selection.hpp"
 #include "gui/dialogs/title_screen.hpp"
 #ifdef DEBUG_WINDOW_LAYOUT_GRAPHS
@@ -921,22 +922,22 @@
                return false;
        } catch(config::error& e) {
                if(e.message.empty()) {
-                       gui::show_error_message(disp(), _("The file you have 
tried to load is corrupt"));
+                       gui2::show_error_message(disp().video(), _("The file 
you have tried to load is corrupt"));
                }
                else {
-                       gui::show_error_message(disp(), _("The file you have 
tried to load is corrupt: '") + e.message + '\'');
+                       gui2::show_error_message(disp().video(), _("The file 
you have tried to load is corrupt: '") + e.message + '\'');
                }
                return false;
        } catch(game::error& e) {
                if(e.message.empty()) {
-                       gui::show_error_message(disp(), _("The file you have 
tried to load is corrupt"));
+                       gui2::show_error_message(disp().video(), _("The file 
you have tried to load is corrupt"));
                }
                else {
-                       gui::show_error_message(disp(), _("The file you have 
tried to load is corrupt: '") + e.message + '\'');
+                       gui2::show_error_message(disp().video(), _("The file 
you have tried to load is corrupt: '") + e.message + '\'');
                }
                return false;
        } catch(io_exception&) {
-               gui::show_error_message(disp(), _("File I/O Error while reading 
the game"));
+               gui2::show_error_message(disp().video(), _("File I/O Error 
while reading the game"));
                return false;
        } catch(twml_exception& e) {
                e.show(disp());
@@ -1022,7 +1023,7 @@
        if(gui2::new_widgets) {
 
                if(campaigns.begin() == campaigns.end()) {
-                 gui::show_error_message(disp(),
+                 gui2::show_error_message(disp().video(),
                                          _("No campaigns are available.\n"));
                        return false;
                }
@@ -1058,7 +1059,7 @@
                }
 
                if(campaign_names.size() <= 0) {
-                 gui::show_error_message(disp(),
+                 gui2::show_error_message(disp().video(),
                                          _("No campaigns are available.\n"));
                        return false;
                }
@@ -1321,11 +1322,11 @@
                }
 
        } catch(game::mp_server_error& e) {
-               gui::show_error_message(disp(), _("Error while starting server: 
") + e.message);
+               gui2::show_error_message(disp().video(), _("Error while 
starting server: ") + e.message);
        } catch(game::load_game_failed& e) {
-               gui::show_error_message(disp(), _("The game could not be 
loaded: ") + e.message);
+               gui2::show_error_message(disp().video(), _("The game could not 
be loaded: ") + e.message);
        } catch(game::game_error& e) {
-               gui::show_error_message(disp(), _("Error while playing the 
game: ") + e.message);
+               gui2::show_error_message(disp().video(), _("Error while playing 
the game: ") + e.message);
        } catch(network::error& e) {
                if(e.message != "") {
                        ERR_NET << "caught network::error: " << e.message << 
"\n";
@@ -1345,7 +1346,7 @@
                        ERR_CONFIG << "caught config::error\n";
                }
        } catch(incorrect_map_format_exception& e) {
-               gui::show_error_message(disp(), std::string(_("The game map 
could not be loaded: ")) + e.msg_);
+               gui2::show_error_message(disp().video(), std::string(_("The 
game map could not be loaded: ")) + e.msg_);
        } catch(game::load_game_exception& e) {
                //this will make it so next time through the title screen loop, 
this game is loaded
                loaded_game_ = e.game;
@@ -1412,7 +1413,7 @@
                game_config::load_config(cfg ? &cfg : NULL);
        } catch(game::error& e) {
                ERR_CONFIG << "Error loading game configuration files\n";
-               gui::show_error_message(disp(), _("Error loading game 
configuration files: '") +
+               gui2::show_error_message(disp().video(), _("Error loading game 
configuration files: '") +
                        font::nullify_markup(e.message) + _("' (The game will 
now exit)"));
                throw;
        }
@@ -1517,7 +1518,7 @@
 
                                msg << "\n" << _("ERROR DETAILS:") << "\n" << 
font::nullify_markup(user_error_log);
 
-                               gui::show_error_message(disp(),msg.str());
+                               
gui2::show_error_message(disp().video(),msg.str());
                        }
                }
 
@@ -1533,7 +1534,7 @@
 
        } catch(game::error& e) {
                ERR_CONFIG << "Error loading game configuration files\n";
-               gui::show_error_message(disp(), _("Error loading game 
configuration files: '") +
+               gui2::show_error_message(disp().video(), _("Error loading game 
configuration files: '") +
                        font::nullify_markup(e.message) + _("' (The game will 
now exit)"));
                throw;
        }

Modified: trunk/src/menu_events.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/menu_events.cpp?rev=35821&r1=35820&r2=35821&view=diff
==============================================================================
--- trunk/src/menu_events.cpp (original)
+++ trunk/src/menu_events.cpp Fri May 22 16:59:19 2009
@@ -3067,7 +3067,7 @@
        void menu_handler::user_command_3()
        {
                gui::message_dialog(*gui_, "Info", _("User-Command#3")).show();
-               //gui::show_error_message(disp(), "User-Command#3");
+               //gui2::show_error_message(disp().video(), "User-Command#3");
                //sound::play_sound("heal.wav");
                sound::play_sound("select.wav");
        }

Modified: trunk/src/multiplayer.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/multiplayer.cpp?rev=35821&r1=35820&r2=35821&view=diff
==============================================================================
--- trunk/src/multiplayer.cpp (original)
+++ trunk/src/multiplayer.cpp Fri May 22 16:59:19 2009
@@ -17,6 +17,7 @@
 #include "dialogs.hpp"
 #include "gettext.hpp"
 #include "log.hpp"
+#include "gui/dialogs/message.hpp"
 #include "gui/dialogs/mp_connect.hpp"
 #include "gui/dialogs/mp_create_game.hpp"
 #include "gui/widgets/window.hpp"
@@ -503,7 +504,7 @@
                                enter_wait_mode(disp, game_config, chat, 
gamelist, false);
                        } catch(config::error& error) {
                                if(!error.message.empty()) {
-                                       gui::show_error_message(disp, 
error.message);
+                                       gui2::show_error_message(disp.video(), 
error.message);
                                }
                                //update lobby content
                                network::send_data(config("refresh_lobby"), 0, 
true);
@@ -514,7 +515,7 @@
                                enter_wait_mode(disp, game_config, chat, 
gamelist, true);
                        } catch(config::error& error) {
                                if(!error.message.empty()) {
-                                       gui::show_error_message(disp, 
error.message);
+                                       gui2::show_error_message(disp.video(), 
error.message);
                                }
                        }
                        // update lobby content unconditionally because we 
might have left only after the
@@ -526,7 +527,7 @@
                                enter_create_mode(disp, game_config, chat, 
gamelist, mp::CNTR_NETWORK);
                        } catch(config::error& error) {
                                if (!error.message.empty())
-                                       gui::show_error_message(disp, 
error.message);
+                                       gui2::show_error_message(disp.video(), 
error.message);
                                //update lobby content
                                network::send_data(config("refresh_lobby"), 0, 
true);
                        }

Modified: trunk/src/playcampaign.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/playcampaign.cpp?rev=35821&r1=35820&r2=35821&view=diff
==============================================================================
--- trunk/src/playcampaign.cpp (original)
+++ trunk/src/playcampaign.cpp Fri May 22 16:59:19 2009
@@ -21,6 +21,7 @@
 #include "global.hpp"
 
 #include "foreach.hpp"
+#include "gui/dialogs/message.hpp"
 #include "playcampaign.hpp"
 #include "map_create.hpp"
 #include "playmp_controller.hpp"
@@ -93,11 +94,11 @@
                gamestate.replay_data.clear();
 
        } catch(game::load_game_failed& e) {
-               gui::show_error_message(disp, _("The game could not be loaded: 
") + e.message);
+               gui2::show_error_message(disp.video(), _("The game could not be 
loaded: ") + e.message);
        } catch(game::game_error& e) {
-               gui::show_error_message(disp, _("Error while playing the game: 
") + e.message);
+               gui2::show_error_message(disp.video(), _("Error while playing 
the game: ") + e.message);
        } catch(incorrect_map_format_exception& e) {
-               gui::show_error_message(disp, std::string(_("The game map could 
not be loaded: ")) + e.msg_);
+               gui2::show_error_message(disp.video(), std::string(_("The game 
map could not be loaded: ")) + e.msg_);
        } catch(twml_exception& e) {
                e.show(disp);
        }
@@ -364,17 +365,17 @@
                                break;
                        }
                } catch(game::load_game_failed& e) {
-                       gui::show_error_message(disp, _("The game could not be 
loaded: ") + e.message);
+                       gui2::show_error_message(disp.video(), _("The game 
could not be loaded: ") + e.message);
                        return QUIT;
                } catch(game::game_error& e) {
-                       gui::show_error_message(disp, _("Error while playing 
the game: ") + e.message);
+                       gui2::show_error_message(disp.video(), _("Error while 
playing the game: ") + e.message);
                        return QUIT;
                } catch(incorrect_map_format_exception& e) {
-                       gui::show_error_message(disp, std::string(_("The game 
map could not be loaded: ")) + e.msg_);
+                       gui2::show_error_message(disp.video(), 
std::string(_("The game map could not be loaded: ")) + e.msg_);
                        return QUIT;
                } catch(config::error& e) {
                        std::cerr << "caught config::error...\n";
-                       gui::show_error_message(disp, _("Error while reading 
the WML: ") + e.message);
+                       gui2::show_error_message(disp.video(), _("Error while 
reading the WML: ") + e.message);
                        return QUIT;
                } catch(twml_exception& e) {
                        e.show(disp);
@@ -576,7 +577,7 @@
                utils::string_map symbols;
                symbols["scenario"] = gamestate.scenario;
                message = utils::interpolate_variables_into_string(message, 
&symbols);
-               gui::show_error_message(disp, message);
+               gui2::show_error_message(disp.video(), message);
                return QUIT;
        }
 

Modified: trunk/src/savegame.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/savegame.cpp?rev=35821&r1=35820&r2=35821&view=diff
==============================================================================
--- trunk/src/savegame.cpp (original)
+++ trunk/src/savegame.cpp Fri May 22 16:59:19 2009
@@ -365,11 +365,11 @@
 
        if(!error_log.empty()) {
         try {
-                   gui::show_error_message(gui_,
+                   gui2::show_error_message(gui_.video(),
                                    _("Warning: The file you have tried to load 
is corrupt. Loading anyway.\n") +
                                    error_log);
         } catch (utils::invalid_utf8_exception&) {
-                   gui::show_error_message(gui_,
+                   gui2::show_error_message(gui_.video(),
                                    _("Warning: The file you have tried to load 
is corrupt. Loading anyway.\n") +
                     std::string("(UTF-8 ERROR)"));
         }
@@ -443,7 +443,7 @@
        }
 
        if(!error_log.empty()) {
-               gui::show_error_message(gui_,
+               gui2::show_error_message(gui_.video(),
                                _("The file you have tried to load is corrupt: 
'") +
                                error_log);
                throw load_game_cancelled_exception();

Modified: trunk/src/wml_exception.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/wml_exception.cpp?rev=35821&r1=35820&r2=35821&view=diff
==============================================================================
--- trunk/src/wml_exception.cpp (original)
+++ trunk/src/wml_exception.cpp Fri May 22 16:59:19 2009
@@ -22,8 +22,9 @@
 #include "global.hpp"
 #include "wml_exception.hpp"
 
+#include "display.hpp"
 #include "gettext.hpp"
-#include "show_dialog.hpp"
+#include "gui/dialogs/message.hpp"
 #include "formula_string_utils.hpp"
 
 
@@ -54,7 +55,7 @@
                << _("When reporting the bug please include the following error 
message :")
                << "\n" << dev_message;
 
-       gui::show_error_message(disp, sstr.str());
+       gui2::show_error_message(disp.video(), sstr.str());
 }
 
 t_string missing_mandatory_wml_key(const std::string& section, const 
std::string& key,


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

Reply via email to