mail[Wesnoth-commits] r40184 - /trunk/src/gui/dialogs/lobby_main.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by kailoran on December 11, 2009 - 01:59:
Author: ilor
Date: Fri Dec 11 01:59:13 2009
New Revision: 40184

URL: http://svn.gna.org/viewcvs/wesnoth?rev=40184&view=rev
Log:
partial work around for bugs #14741 and #14847 -- reselect the 
previously-selected game on a gamelist update

Modified:
    trunk/src/gui/dialogs/lobby_main.cpp

Modified: trunk/src/gui/dialogs/lobby_main.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/gui/dialogs/lobby_main.cpp?rev=40184&r1=40183&r2=40184&view=diff
==============================================================================
--- trunk/src/gui/dialogs/lobby_main.cpp (original)
+++ trunk/src/gui/dialogs/lobby_main.cpp Fri Dec 11 01:59:13 2009
@@ -446,8 +446,12 @@
        symbols["num_total"] = 
lexical_cast<std::string>(lobby_info_.games().size());
        std::string games_string = vgettext("Games: showing $num_shown out of 
$num_total", symbols);
        find_widget<tlabel>(gamelistbox_, "map", 
false).set_label(games_string);
+       int select_row = -1;
        for (unsigned i = 0; i < lobby_info_.games_filtered().size(); ++i) {
                const game_info& game = *lobby_info_.games_filtered()[i];
+               if (game.id == selected_game_id_) {
+                       select_row = i;
+               }
                std::map<std::string, string_map> data;
 
                const char* color_string;
@@ -532,6 +536,7 @@
                set_visible_if_exists(grid, "use_map_settings", 
game.use_map_settings);
                set_visible_if_exists(grid, "no_era", !game.have_era);
 
+
                tbutton* join_button = 
dynamic_cast<tbutton*>(grid->find("join", false));
                if (join_button) {
                        join_button->set_callback_mouse_left_click(
@@ -549,6 +554,9 @@
                        minimap->set_config(&game_config_);
                        minimap->set_map_data(game.map_data);
                }
+       }
+       if (select_row >= 0) {
+               gamelistbox_->select_row(select_row);
        }
        update_selected_game();
 }




Related Messages


Powered by MHonArc, Updated Fri Dec 11 02:00:08 2009