summaryrefslogtreecommitdiffstats
path: root/gui/listbox.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/listbox.cpp')
-rw-r--r--gui/listbox.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/gui/listbox.cpp b/gui/listbox.cpp
index d2973bb6e..eeddff954 100644
--- a/gui/listbox.cpp
+++ b/gui/listbox.cpp
@@ -26,6 +26,9 @@ extern "C" {
#include "rapidxml.hpp"
#include "objects.hpp"
#include "../data.hpp"
+#include "pages.hpp"
+
+extern std::vector<language_struct> Language_List;
GUIListBox::GUIListBox(xml_node<>* node) : GUIScrollList(node)
{
@@ -56,6 +59,21 @@ GUIListBox::GUIListBox(xml_node<>* node) : GUIScrollList(node)
DataManager::SetValue(mVariable, attr->value());
// Get the currently selected value for the list
DataManager::GetValue(mVariable, currentValue);
+ if (mVariable == "tw_language") {
+ std::vector<language_struct>::iterator iter;
+ for (iter = Language_List.begin(); iter != Language_List.end(); iter++) {
+ ListItem data;
+ data.displayName = (*iter).displayvalue;
+ data.variableValue = (*iter).filename;
+ data.action = NULL;
+ if (currentValue == (*iter).filename) {
+ data.selected = 1;
+ DataManager::SetValue("tw_language_display", (*iter).displayvalue);
+ } else
+ data.selected = 0;
+ mListItems.push_back(data);
+ }
+ }
}
else
allowSelection = false; // allows using listbox as a read-only list or menu