summaryrefslogtreecommitdiff
path: root/client/Dialog.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'client/Dialog.cpp')
-rw-r--r--client/Dialog.cpp30
1 files changed, 21 insertions, 9 deletions
diff --git a/client/Dialog.cpp b/client/Dialog.cpp
index 375fd98..3b477e1 100644
--- a/client/Dialog.cpp
+++ b/client/Dialog.cpp
@@ -1,11 +1,14 @@
#include <QtGui>
+#include <iostream>
#include "client.h"
#include "Config.h"
#include "Dialog.h"
#include "Proxy.h"
+using namespace std;
+
ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent)
{
//WIPE it out!!! COnfig shoud be reread by timer event!
@@ -16,22 +19,31 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent)
Logger::Fatal("No valid configuration found! Can't proceed.");
return ;
}
+ vector<string> countries = cfg->GetCountries();
+ string country = "Ukraine";
+ vector<string> states = cfg->GetStates(country);
+ string state = "AR Krym";
+ vector<string> cities = cfg->GetCities(country, state);
+
topLabel = new QLabel(tr("Top Panel"));
countryBox = new QComboBox;
- countryBox->addItem(tr("Ukraine"));
- countryBox->addItem(tr("Russia"));
+ for (unsigned i = 0; i < countries.size(); i++)
+ {
+ countryBox->addItem(countries[i].c_str());
+ }
stateBox = new QComboBox;
- stateBox->addItem("AR Krym");
- stateBox->addItem("Kharkovskaya obl.");
- stateBox->addItem("Odesskaya obl.");
+ for (unsigned i = 0; i < states.size(); i++)
+ {
+ stateBox->addItem(states[i].c_str());
+ }
cityBox = new QComboBox;
- cityBox->addItem("Alushta");
- cityBox->addItem("Simferopol");
- cityBox->addItem("Yalta");
- cityBox->addItem("Sevastopol");
+ for (unsigned i = 0; i < cities.size(); i++)
+ {
+ cityBox->addItem(cities[i].c_str());
+ }
/* proxy buttons */
QPushButton *topProxy1 = new QPushButton("proxy 1");