summaryrefslogtreecommitdiff
path: root/client/Dialog.cpp
diff options
context:
space:
mode:
authorAlex Borisov <borisov.alexandr@rambler.ru>2011-10-23 04:10:55 +0300
committerAlex Borisov <borisov.alexandr@rambler.ru>2011-10-23 04:10:55 +0300
commit21ad7eac963bc329395fa893300fb5c8f721fd77 (patch)
tree10dda6e6170071332aab490faeeb599f10ff6e03 /client/Dialog.cpp
parent3eef0376635624c354a5e1b8a2680b74eb23a423 (diff)
Logging facility, Config class, tray icon, custom QApplication subclass
Diffstat (limited to 'client/Dialog.cpp')
-rw-r--r--client/Dialog.cpp70
1 files changed, 70 insertions, 0 deletions
diff --git a/client/Dialog.cpp b/client/Dialog.cpp
new file mode 100644
index 0000000..375fd98
--- /dev/null
+++ b/client/Dialog.cpp
@@ -0,0 +1,70 @@
+
+#include <QtGui>
+#include "client.h"
+#include "Config.h"
+#include "Dialog.h"
+#include "Proxy.h"
+
+
+ProxyDialog::ProxyDialog(QWidget *parent): QDialog(parent)
+{
+ //WIPE it out!!! COnfig shoud be reread by timer event!
+ Config *cfg = Config::CurrentConfig();
+ cfg->AcquireConfig();
+ if (! cfg->IsConfigValid())
+ {
+ Logger::Fatal("No valid configuration found! Can't proceed.");
+ return ;
+ }
+
+ topLabel = new QLabel(tr("Top Panel"));
+ countryBox = new QComboBox;
+ countryBox->addItem(tr("Ukraine"));
+ countryBox->addItem(tr("Russia"));
+
+ stateBox = new QComboBox;
+ stateBox->addItem("AR Krym");
+ stateBox->addItem("Kharkovskaya obl.");
+ stateBox->addItem("Odesskaya obl.");
+
+ cityBox = new QComboBox;
+ cityBox->addItem("Alushta");
+ cityBox->addItem("Simferopol");
+ cityBox->addItem("Yalta");
+ cityBox->addItem("Sevastopol");
+
+ /* proxy buttons */
+ QPushButton *topProxy1 = new QPushButton("proxy 1");
+ QPushButton *topProxy2 = new QPushButton("proxy 2");
+
+ QPushButton *bottomProxy1 = new QPushButton("proxy 3");
+ QPushButton *bottomProxy2 = new QPushButton("proxy 4");
+
+ bottomLabel = new QLabel(tr("Bottom Panel"));
+
+ /* setup layouting */
+ QVBoxLayout *comboBoxLayout = new QVBoxLayout;
+ comboBoxLayout->addWidget(countryBox);
+ comboBoxLayout->addWidget(stateBox);
+ comboBoxLayout->addWidget(cityBox);
+
+ QVBoxLayout *proxyButtonLayout = new QVBoxLayout;
+ proxyButtonLayout->addWidget(topProxy1);
+ proxyButtonLayout->addWidget(topProxy2);
+
+ QHBoxLayout *topPanelLayout = new QHBoxLayout;
+ topPanelLayout->addLayout(comboBoxLayout);
+ topPanelLayout->addLayout(proxyButtonLayout);
+
+ QHBoxLayout *bottomPanelLayout = new QHBoxLayout;
+ bottomPanelLayout->addWidget(bottomProxy1);
+ bottomPanelLayout->addWidget(bottomProxy2);
+
+ QVBoxLayout *mainLayout = new QVBoxLayout;
+ mainLayout->addWidget(topLabel);
+ mainLayout->addLayout(topPanelLayout);
+ mainLayout->addWidget(bottomLabel);
+ mainLayout->addLayout(bottomPanelLayout);
+
+ setLayout(mainLayout);
+} \ No newline at end of file