summaryrefslogtreecommitdiff
path: root/client/Dialog.cpp
diff options
context:
space:
mode:
authorAlex Borisov <borisov.alexandr@rambler.ru>2011-11-11 00:42:50 +0200
committerAlex Borisov <borisov.alexandr@rambler.ru>2011-11-11 00:42:50 +0200
commitd9a7ccf4eb0fe6d44cf1a7361b331889a98ff85b (patch)
treea01b1a8265601788d2e4b3003940bc2f33669755 /client/Dialog.cpp
parentfe4520fc09dca52c158437f5621f5909d7d6974f (diff)
Self-updated config. Various fixes and improvements. TODO: test client/server communication
Diffstat (limited to 'client/Dialog.cpp')
-rw-r--r--client/Dialog.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/client/Dialog.cpp b/client/Dialog.cpp
index 45ef01b..3a7f473 100644
--- a/client/Dialog.cpp
+++ b/client/Dialog.cpp
@@ -3,7 +3,7 @@
#include <iostream>
#include <sstream>
#include "client.h"
-#include "Config.h"
+#include "UpdatedConfig.h"
#include "Dialog.h"
#include "Proxy.h"
@@ -12,13 +12,8 @@ using namespace std;
ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent)
{
//WIPE it out!!! COnfig shoud be reread by timer event!
- Config *cfg = Config::CurrentConfig();
+ UpdatedConfig *cfg = UpdatedConfig::CurrentConfig();
cfg->AcquireConfig();
- if (! cfg->IsConfigValid())
- {
- Logger::Fatal((string)"No valid configuration found! Can't proceed.");
- return ;
- }
/* generic proxy panel */
topLabel = new QLabel(QString::fromLocal8Bit(cfg->TopPanelText.c_str()));
@@ -109,7 +104,7 @@ void ProxyDialog::CountryActivated(int index)
string country(countryBox->currentText().toUtf8().constData());
Logger::Info("Country %s was selected\n", country.c_str());
- Config *cfg = Config::CurrentConfig();
+ UpdatedConfig *cfg = UpdatedConfig::CurrentConfig();
vector<string> states = cfg->GetStates(country);
if (states.empty())
{
@@ -152,7 +147,7 @@ void ProxyDialog::StateActivated(int index)
string state(stateBox->currentText().toUtf8().constData());
Logger::Info("State %s was selected\n", state.c_str());
- Config *cfg = Config::CurrentConfig();
+ UpdatedConfig *cfg = UpdatedConfig::CurrentConfig();
vector<string> cities = cfg->GetCities(country, state);
cityBox->clear();
for (unsigned i = 0; i < cities.size(); i++)
@@ -174,7 +169,7 @@ void ProxyDialog::CityActivated(int index)
}
vector<string> proxies;
- Config *cfg = Config::CurrentConfig();
+ UpdatedConfig *cfg = UpdatedConfig::CurrentConfig();
string country(countryBox->currentText().toUtf8().constData());
string city(cityBox->currentText().toUtf8().constData());
if (stateBox->isVisible())