From f95edb6b7eaf3148f72fc9b69e3974f58ebcae70 Mon Sep 17 00:00:00 2001 From: Alex Date: Sun, 6 Nov 2011 22:28:42 +0200 Subject: Static button labels + FIX speed visibility bug --- client/Dialog.cpp | 24 ++++++++++++++---------- 1 file changed, 14 insertions(+), 10 deletions(-) (limited to 'client/Dialog.cpp') 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 << "" << staticProxyLine[j].speed << ""; + if (staticProxyLine[j].speed > cfg->StaticProxySpeedLow) + { + ss << "" << staticProxyLine[j].speed << ""; + } + else + { + ss << "" << staticProxyLine[j].speed << ""; + } + ss << " "; } - else - { - ss << "" << staticProxyLine[j].speed << ""; - } - 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); -- cgit v1.2.3