From d9a7ccf4eb0fe6d44cf1a7361b331889a98ff85b Mon Sep 17 00:00:00 2001 From: Alex Borisov Date: Fri, 11 Nov 2011 00:42:50 +0200 Subject: Self-updated config. Various fixes and improvements. TODO: test client/server communication --- client/Dialog.cpp | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'client/Dialog.cpp') 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 #include #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 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 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 proxies; - Config *cfg = Config::CurrentConfig(); + UpdatedConfig *cfg = UpdatedConfig::CurrentConfig(); string country(countryBox->currentText().toUtf8().constData()); string city(cityBox->currentText().toUtf8().constData()); if (stateBox->isVisible()) -- cgit v1.2.3