summaryrefslogtreecommitdiff
path: root/client/Dialog.cpp
diff options
context:
space:
mode:
authorAlex <b0ris@b0ris-satellite.localdomain>2011-11-06 22:28:42 +0200
committerAlex <b0ris@b0ris-satellite.localdomain>2011-11-06 22:28:42 +0200
commitf95edb6b7eaf3148f72fc9b69e3974f58ebcae70 (patch)
treec0e6a4fc6052bce65b6dfb74490db7d53b8438c9 /client/Dialog.cpp
parentec933b1cb13a3cb2eb94975d933c5a56eae8b416 (diff)
Static button labels + FIX speed visibility bug
Diffstat (limited to 'client/Dialog.cpp')
-rw-r--r--client/Dialog.cpp24
1 files changed, 14 insertions, 10 deletions
diff --git a/client/Dialog.cpp b/client/Dialog.cpp
index abd3178..45ef01b 100644
--- a/client/Dialog.cpp
+++ b/client/Dialog.cpp
@@ -61,21 +61,25 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent)
for (unsigned j = 0; j < staticProxyLine.size(); j++)
{
stringstream ss;
- if (staticProxyLine[j].speed > cfg->StaticProxySpeedLow)
+ if (cfg->IsSpeedVisible)
{
- ss << "<font color=\"green\"><b>" << staticProxyLine[j].speed << "</b></font>";
+ if (staticProxyLine[j].speed > cfg->StaticProxySpeedLow)
+ {
+ ss << "<font color=\"green\"><b>" << staticProxyLine[j].speed << "</b></font>";
+ }
+ else
+ {
+ ss << "<font color=\"red\"><b>" << staticProxyLine[j].speed << "</b></font>";
+ }
+ ss << " ";
}
- else
- {
- ss << "<font color=\"red\"><b>" << staticProxyLine[j].speed << "</b></font>";
- }
- QLabel *speedLabel = new QLabel(ss.str().c_str());
- QString btnStr = QString::fromUtf8(staticProxyLine[j]. name.c_str());
+ ss << staticProxyLine[j].name;
+
+ QString btnStr = QString::fromLocal8Bit(ss.str().c_str());
QLabel *btnLabel = new QLabel(btnStr);
QHBoxLayout *btnLayout = new QHBoxLayout;
- btnLayout->setSizeConstraint(QLayout::SetMinimumSize);
- btnLayout->addWidget(speedLabel);
btnLayout->addWidget(btnLabel);
+ btnLayout->setSizeConstraint(QLayout::SetMinimumSize);
QPushButton *btn = new QPushButton();
btn->setLayout(btnLayout);
btn->setCheckable(true);