Author: sapient
Date: Sat Jun  2 10:43:06 2007
New Revision: 18011

URL: http://svn.gna.org/viewcvs/wesnoth?rev=18011&view=rev
Log:
* used front() instead of [0]
* added a few comments to the server_list dialog_button

Modified:
    trunk/src/game.cpp
    trunk/src/multiplayer.cpp
    trunk/src/preferences.cpp

Modified: trunk/src/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game.cpp?rev=18011&r1=18010&r2=18011&view=diff
==============================================================================
--- trunk/src/game.cpp (original)
+++ trunk/src/game.cpp Sat Jun  2 10:43:06 2007
@@ -1272,7 +1272,7 @@
                } else if(res == 0 || res == 1) {
                        std::string host;
                        if(res == 0) {
-                               host = preferences::server_list()[0].address;
+                               host = 
preferences::server_list().front().address;
                        }
 
                        mp::start_client(disp(), game_config_, units_data_, 
host);

Modified: trunk/src/multiplayer.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/multiplayer.cpp?rev=18011&r1=18010&r2=18011&view=diff
==============================================================================
--- trunk/src/multiplayer.cpp (original)
+++ trunk/src/multiplayer.cpp Sat Jun  2 10:43:06 2007
@@ -100,6 +100,7 @@
 protected:
        int action(gui::dialog_process_info &dp_info)
        {
+               //diaplay a dialog with a list of known servers
                gui::dialog server_dialog(dialog()->get_display(), _("List of 
Servers"),
                        _("Choose a known server from the list"), 
gui::OK_CANCEL);
                std::vector<std::string> servers;
@@ -110,8 +111,10 @@
                }
                server_dialog.set_menu(servers);
                if(server_dialog.show() >= 0) {
+                       //now save the result back to the parent dialog
                        
dialog()->get_textbox().set_text(preferences::server_list()[server_dialog.result()].address);
                }
+               //the button state should be cleared after popping up an 
intermediate dialog
                dp_info.clear_buttons();
                return gui::CONTINUE_DIALOG;
        }
@@ -246,7 +249,7 @@
                }
        } while(!(data.child("join_lobby") || data.child("join_game")));
 
-       if (h != preferences::server_list()[0].address)
+       if (h != preferences::server_list().front().address)
                preferences::set_network_host(h);
 
        if (data.child("join_lobby")) {

Modified: trunk/src/preferences.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/preferences.cpp?rev=18011&r1=18010&r2=18011&view=diff
==============================================================================
--- trunk/src/preferences.cpp (original)
+++ trunk/src/preferences.cpp Sat Jun  2 10:43:06 2007
@@ -422,7 +422,7 @@
 {
        t_string& res = prefs["host"];
        if(res.empty())
-               res = server_list()[0].address;
+               res = server_list().front().address;
 
        return res;
 }


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

Reply via email to