summaryrefslogtreecommitdiff
path: root/client/Dialog.cpp
diff options
context:
space:
mode:
authorAlex Borisov <borisov.alexandr@rambler.ru>2011-11-20 01:14:22 +0200
committerAlex Borisov <borisov.alexandr@rambler.ru>2011-11-20 01:14:22 +0200
commit17bde4246c7e3f25c566f15e1ed218cf646a0f93 (patch)
treee9a879bf36c55b51079be7413dcd78c04e9e837b /client/Dialog.cpp
parent3b45f27f389976718efaccdf71878e5455303da2 (diff)
FIX click event handling on bottom buttons
Diffstat (limited to 'client/Dialog.cpp')
-rw-r--r--client/Dialog.cpp18
1 files changed, 16 insertions, 2 deletions
diff --git a/client/Dialog.cpp b/client/Dialog.cpp
index 40f1a1c..f90d5b1 100644
--- a/client/Dialog.cpp
+++ b/client/Dialog.cpp
@@ -6,6 +6,7 @@
#include "UpdatedConfig.h"
#include "Dialog.h"
#include "Proxy.h"
+#include "RichTextPushButton.h"
using namespace std;
@@ -43,6 +44,7 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent)
topPanelLayout->addWidget(stateBox, 1, 0);
topPanelLayout->addWidget(cityBox, 2, 0);
genericProxyGroup = new QButtonGroup;
+ staticProxyGroup = new QButtonGroup;
/* static proxy panel */
bottomLabel = new QLabel(QString::fromLocal8Bit(cfg->BottomPanelText.c_str()));
@@ -69,16 +71,18 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent)
ss << " ";
}
ss << staticProxyLine[j].name;
-
+
QString btnStr = QString::fromLocal8Bit(ss.str().c_str());
QLabel *btnLabel = new QLabel(btnStr);
+ btnLabel->setAttribute(Qt::WA_TransparentForMouseEvents);
QHBoxLayout *btnLayout = new QHBoxLayout;
btnLayout->addWidget(btnLabel);
btnLayout->setSizeConstraint(QLayout::SetMinimumSize);
QPushButton *btn = new QPushButton();
btn->setObjectName("bottomBtn");
- btn->setLayout(btnLayout);
btn->setCheckable(true);
+ btn->setLayout(btnLayout);
+ staticProxyGroup->addButton(btn);
bottomPanelLayout->addWidget(btn, i, j);
}
}
@@ -92,6 +96,16 @@ ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent)
setLayout(mainLayout);
}
+void ProxyDialog::StaticToggle(bool val)
+{
+ Logger::Debug("toggle: %s\n", val ? "true" : "false");
+}
+
+void ProxyDialog::StaticClick()
+{
+ Logger::Debug("click\n");
+}
+
void ProxyDialog::CountryActivated(int index)
{
Logger::Trace("Country activated. Activated index=%d\n", index);