summaryrefslogtreecommitdiff
path: root/client/Dialog.cpp
diff options
context:
space:
mode:
authorAlex Borisov <borisov.alexandr@rambler.ru>2011-11-13 05:33:34 +0200
committerAlex Borisov <borisov.alexandr@rambler.ru>2011-11-13 05:33:34 +0200
commitef03bf6e719f256554878c8efe19f4856a39dd03 (patch)
tree9cad2c2bfb518407b92b20e1cbc5156cfae587bf /client/Dialog.cpp
parent348104dd920480815504c28eaf12e193fd3e9ce9 (diff)
CSS style support and sample. Revert to file config for testing purposes
Diffstat (limited to 'client/Dialog.cpp')
-rw-r--r--client/Dialog.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/client/Dialog.cpp b/client/Dialog.cpp
index e9d3883..bf0c530 100644
--- a/client/Dialog.cpp
+++ b/client/Dialog.cpp
@@ -12,9 +12,11 @@ using namespace std;
ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent)
{
UpdatedConfig *cfg = UpdatedConfig::CurrentConfig();
+ cfg->AcquireConfig();
/* generic proxy panel */
topLabel = new QLabel(QString::fromLocal8Bit(cfg->TopPanelText.c_str()));
+ topLabel->setObjectName("topLabel");
topLabel->setAlignment(Qt::AlignHCenter);
countryBox = new QComboBox;
stateBox = new QComboBox;
@@ -45,6 +47,7 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent)
/* static proxy panel */
bottomLabel = new QLabel(QString::fromLocal8Bit(cfg->BottomPanelText.c_str()));
+ bottomLabel->setObjectName("bottomLabel");
bottomLabel->setAlignment(Qt::AlignHCenter);
QGridLayout *bottomPanelLayout = new QGridLayout;
unsigned nlines = cfg->GetStaticProxyGuiLines();
@@ -74,6 +77,7 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent)
btnLayout->addWidget(btnLabel);
btnLayout->setSizeConstraint(QLayout::SetMinimumSize);
QPushButton *btn = new QPushButton();
+ btn->setObjectName("bottomBtn");
btn->setLayout(btnLayout);
btn->setCheckable(true);
bottomPanelLayout->addWidget(btn, i, j);
@@ -87,6 +91,14 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent)
mainLayout->addWidget(bottomLabel);
mainLayout->addLayout(bottomPanelLayout);
setLayout(mainLayout);
+
+ QFile file("style.qss");
+ file.open(QFile::ReadOnly);
+ QString cssStr = QString::fromLocal8Bit(file.readAll());
+ file.close();
+
+ Logger::Debug("Going to apply css style: %s\n", cssStr.toLocal8Bit().data());
+ setStyleSheet(cssStr);
}
void ProxyDialog::CountryActivated(int index)