From f1b0178a856d930c11e5f715c29bdb4fd2a110b2 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Fri, 15 Nov 2013 17:04:32 -0500 Subject: [PATCH] More UI work... --- ZeroTierUI/ZeroTierUI.pro | 9 +- ZeroTierUI/aboutwindow.cpp | 18 +++ ZeroTierUI/aboutwindow.h | 25 ++++ ZeroTierUI/aboutwindow.ui | 271 +++++++++++++++++++++++++++++++++++++ ZeroTierUI/mainwindow.cpp | 31 +++++ ZeroTierUI/mainwindow.h | 8 ++ ZeroTierUI/mainwindow.ui | 138 ++++++++++++------- 7 files changed, 451 insertions(+), 49 deletions(-) create mode 100644 ZeroTierUI/aboutwindow.cpp create mode 100644 ZeroTierUI/aboutwindow.h create mode 100644 ZeroTierUI/aboutwindow.ui diff --git a/ZeroTierUI/ZeroTierUI.pro b/ZeroTierUI/ZeroTierUI.pro index ce1af63f1..fcdba8cae 100644 --- a/ZeroTierUI/ZeroTierUI.pro +++ b/ZeroTierUI/ZeroTierUI.pro @@ -14,13 +14,16 @@ TEMPLATE = app SOURCES += main.cpp\ mainwindow.cpp \ - network.cpp + network.cpp \ + aboutwindow.cpp HEADERS += mainwindow.h \ - network.h + network.h \ + aboutwindow.h FORMS += mainwindow.ui \ - network.ui + network.ui \ + aboutwindow.ui RESOURCES += \ resources.qrc diff --git a/ZeroTierUI/aboutwindow.cpp b/ZeroTierUI/aboutwindow.cpp new file mode 100644 index 000000000..83d680b1d --- /dev/null +++ b/ZeroTierUI/aboutwindow.cpp @@ -0,0 +1,18 @@ +#include "aboutwindow.h" +#include "ui_aboutwindow.h" + +AboutWindow::AboutWindow(QWidget *parent) : + QDialog(parent), + ui(new Ui::AboutWindow) +{ + ui->setupUi(this); +} + +AboutWindow::~AboutWindow() +{ + delete ui; +} + +void AboutWindow::on_uninstallButton_clicked() +{ +} diff --git a/ZeroTierUI/aboutwindow.h b/ZeroTierUI/aboutwindow.h new file mode 100644 index 000000000..41adc64d3 --- /dev/null +++ b/ZeroTierUI/aboutwindow.h @@ -0,0 +1,25 @@ +#ifndef AboutWindow_H +#define AboutWindow_H + +#include + +namespace Ui { +class AboutWindow; +} + +class AboutWindow : public QDialog +{ + Q_OBJECT + +public: + explicit AboutWindow(QWidget *parent = 0); + ~AboutWindow(); + +private slots: + void on_uninstallButton_clicked(); + +private: + Ui::AboutWindow *ui; +}; + +#endif // AboutWindow_H diff --git a/ZeroTierUI/aboutwindow.ui b/ZeroTierUI/aboutwindow.ui new file mode 100644 index 000000000..34ad0235c --- /dev/null +++ b/ZeroTierUI/aboutwindow.ui @@ -0,0 +1,271 @@ + + + AboutWindow + + + + 0 + 0 + 508 + 261 + + + + Dialog + + + + :/img/zt1icon.png:/img/zt1icon.png + + + true + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + 6 + + + 6 + + + 6 + + + 6 + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 128 + 128 + + + + + 128 + 128 + + + + + + + Qt::PlainText + + + :/img/zt1icon.png + + + true + + + Qt::NoTextInteraction + + + + + + + Qt::Vertical + + + + 20 + 40 + + + + + + + + + + + + 0 + 0 + + + + QFrame::StyledPanel + + + QFrame::Raised + + + + + + + 0 + 0 + + + + + 50 + false + + + + ZeroTier One GUI +(c)2012-2013 ZeroTier Networks LLC + +Author(s): Adam Ierymenko +Version: 1.0 + + + Qt::PlainText + + + Qt::AlignHCenter|Qt::AlignTop + + + Qt::NoTextInteraction + + + + + + + + 0 + + + 0 + + + 0 + + + 0 + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Uninstall + + + false + + + + + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Ok + + + true + + + + + + + + + + + buttonBox + accepted() + AboutWindow + accept() + + + 248 + 254 + + + 157 + 274 + + + + + buttonBox + rejected() + AboutWindow + reject() + + + 316 + 260 + + + 286 + 274 + + + + + diff --git a/ZeroTierUI/mainwindow.cpp b/ZeroTierUI/mainwindow.cpp index 3137cb14a..41d949870 100644 --- a/ZeroTierUI/mainwindow.cpp +++ b/ZeroTierUI/mainwindow.cpp @@ -1,6 +1,9 @@ #include "mainwindow.h" +#include "aboutwindow.h" #include "ui_mainwindow.h" +#include + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow) @@ -12,3 +15,31 @@ MainWindow::~MainWindow() { delete ui; } + +void MainWindow::on_joinNetworkButton_clicked() +{ +} + +void MainWindow::on_actionAbout_triggered() +{ + AboutWindow *about = new AboutWindow(this); + about->show(); +} + +void MainWindow::on_actionJoin_Network_triggered() +{ + on_joinNetworkButton_clicked(); +} + +void MainWindow::on_actionShow_Detailed_Status_triggered() +{ +} + +void MainWindow::on_networkIdLineEdit_textChanged(const QString &text) +{ +} + +void MainWindow::on_statusAndAddressButton_clicked() +{ + // QApplication::clipboard()->setText(ui->myAddressCopyButton->text()); +} diff --git a/ZeroTierUI/mainwindow.h b/ZeroTierUI/mainwindow.h index 8c7efd741..b68ba4f79 100644 --- a/ZeroTierUI/mainwindow.h +++ b/ZeroTierUI/mainwindow.h @@ -15,6 +15,14 @@ public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); +private slots: + void on_joinNetworkButton_clicked(); + void on_actionAbout_triggered(); + void on_actionJoin_Network_triggered(); + void on_actionShow_Detailed_Status_triggered(); + void on_networkIdLineEdit_textChanged(const QString &arg1); + void on_statusAndAddressButton_clicked(); + private: Ui::MainWindow *ui; }; diff --git a/ZeroTierUI/mainwindow.ui b/ZeroTierUI/mainwindow.ui index d7a654fdf..c9366ccfc 100644 --- a/ZeroTierUI/mainwindow.ui +++ b/ZeroTierUI/mainwindow.ui @@ -19,6 +19,9 @@ + + 6 + 6 @@ -39,19 +42,25 @@ 0 + + + Qt::ScrollBarAlwaysOff true + + Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop + 0 0 654 - 222 + 236 @@ -80,49 +89,79 @@ + + 6 + + + QLayout::SetDefaultConstraint + - 2 + 0 0 - 2 + 0 0 - + - + 0 0 - - OFFLINE (0 direct peers) - - - - - Courier 12 - - true + + Click to Copy Address to Clipboard - - [Network ID, e.g. 8056c2e21c000001] + + border: 0; + + + 0000000000 (OFFLINE, 0 peers) + + + Qt::ToolButtonTextOnly - + + + + 0 + 0 + + + + + Courier + 12 + + + + Enter Hexadecimal Network ID + + + true + + + (Numeric ID of Network to Join) + + + + + 0 @@ -131,22 +170,27 @@ - 75 - true + Courier + 12 + 50 + false false + + Join Network + false + + + - + Join + Join - - false - - - true + + Qt::ToolButtonTextOnly @@ -171,41 +215,26 @@ Help - + File - + - + - - - Join Network - - - - - Exit - - About - - - About - - - + Join Network @@ -215,7 +244,7 @@ Show Detailed Status - + Exit @@ -225,5 +254,22 @@ - + + + actionExit + triggered() + MainWindow + close() + + + -1 + -1 + + + 333 + 149 + + + +