Clear menu stack when changing languages to force recreation of menus with the correc...
authorIngo Ruhnke <grumbel@gmail.com>
Sun, 10 Aug 2014 03:56:41 +0000 (05:56 +0200)
committerIngo Ruhnke <grumbel@gmail.com>
Sun, 10 Aug 2014 03:56:41 +0000 (05:56 +0200)
src/supertux/menu/language_menu.cpp

index ce74595..399ec21 100644 (file)
@@ -62,14 +62,14 @@ LanguageMenu::menu_action(MenuItem* item)
     dictionary_manager->set_language(language); // set currently detected language
     g_config->locale = ""; // do auto detect every time on startup
     g_config->save();
-    MenuManager::instance().pop_menu();
+    MenuManager::instance().clear_menu_stack();
   }
   else if (item->id == MNID_LANGUAGE_ENGLISH) // english
   {
     g_config->locale = "en";
     dictionary_manager->set_language(tinygettext::Language::from_name(g_config->locale));
     g_config->save();
-    MenuManager::instance().pop_menu();
+    MenuManager::instance().clear_menu_stack();
   }
   else
   {
@@ -83,7 +83,7 @@ LanguageMenu::menu_action(MenuItem* item)
         g_config->locale = i->str();
         dictionary_manager->set_language(*i);
         g_config->save();
-        MenuManager::instance().pop_menu();
+        MenuManager::instance().clear_menu_stack();
         break;
       }
     }