Author: mordante
Date: Sat Aug 23 20:59:45 2008
New Revision: 28890
URL: http://svn.gna.org/viewcvs/wesnoth?rev=28890&view=rev
Log:
Change the language dialog with the new widgets one.
Modified:
trunk/src/game.cpp
Modified: trunk/src/game.cpp
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/src/game.cpp?rev=28890&r1=28889&r2=28890&view=diff
==============================================================================
--- trunk/src/game.cpp (original)
+++ trunk/src/game.cpp Sat Aug 23 20:59:45 2008
@@ -1387,57 +1387,20 @@
bool game_controller::change_language()
{
- if(gui2::new_widgets) {
- gui2::tlanguage_selection dlg;
-
- dlg.show(disp().video());
-
- if(dlg.get_retval() == gui2::twindow::OK) {
- if(!no_gui_) {
- std::string wm_title_string = _("The
Battle for Wesnoth");
- wm_title_string += " - " +
game_config::revision;
-
SDL_WM_SetCaption(wm_title_string.c_str(), NULL);
- }
-
- refresh_game_cfg(true);
- }
-
- } else {
- const std::vector<language_def>& languages = get_languages();
- std::vector<std::string> langs;
-
- for (std::vector<language_def>::const_iterator itor =
languages.begin();
- itor != languages.end(); ++itor) {
- if (*itor == get_language()) {
- langs.push_back("*" + itor->language);
- } else {
- langs.push_back(itor->language);
- }
- }
-
- gui::dialog lmenu(disp(),_("Language"),
- _("Choose your
preferred language:"),
-
gui::OK_CANCEL);
- lmenu.set_menu(langs);
- const int res = lmenu.show();
- if(size_t(res) < langs.size()) {
- ::set_language(languages[res]);
- preferences::set_language(languages[res].localename);
-
- if(!no_gui_) {
- std::string wm_title_string = _("The Battle for
Wesnoth");
- wm_title_string += " - " +
game_config::revision;
- SDL_WM_SetCaption(wm_title_string.c_str(),
NULL);
- }
-
- refresh_game_cfg(true);
- } else {
- return false;
- }
-
- font::load_font_config();
- hotkey::load_descriptions();
- }
+ gui2::tlanguage_selection dlg;
+
+ dlg.show(disp().video());
+
+ if(dlg.get_retval() == gui2::twindow::OK) {
+ if(!no_gui_) {
+ std::string wm_title_string = _("The Battle for
Wesnoth");
+ wm_title_string += " - " + game_config::revision;
+ SDL_WM_SetCaption(wm_title_string.c_str(), NULL);
+ }
+
+ refresh_game_cfg(true);
+ }
+
return true;
}
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits