diff options
-rw-r--r-- | ZeroTierUI/aboutwindow.cpp | 3 | ||||
-rw-r--r-- | ZeroTierUI/licensedialog.cpp | 11 | ||||
-rw-r--r-- | ZeroTierUI/main.cpp | 13 | ||||
-rw-r--r-- | ZeroTierUI/mainwindow.cpp | 11 | ||||
-rw-r--r-- | ZeroTierUI/mainwindow.h | 1 | ||||
-rw-r--r-- | ZeroTierUI/mainwindow.ui | 19 | ||||
-rw-r--r-- | ZeroTierUI/networkwidget.cpp | 14 | ||||
-rw-r--r-- | ZeroTierUI/stylesheet.css | 5 | ||||
-rw-r--r-- | node/Node.hpp | 4 |
9 files changed, 77 insertions, 4 deletions
diff --git a/ZeroTierUI/aboutwindow.cpp b/ZeroTierUI/aboutwindow.cpp index ddac50f5..d57de3e7 100644 --- a/ZeroTierUI/aboutwindow.cpp +++ b/ZeroTierUI/aboutwindow.cpp @@ -29,7 +29,9 @@ #include "ui_aboutwindow.h" #include <QMessageBox> +#include <QFont> +#include "../node/Constants.hpp" #include "../node/Node.hpp" AboutWindow::AboutWindow(QWidget *parent) : @@ -37,7 +39,6 @@ AboutWindow::AboutWindow(QWidget *parent) : ui(new Ui::AboutWindow) { ui->setupUi(this); - ui->aboutTextLabel->setText(QString("ZeroTier One\nVersion ")+ZeroTier::Node::versionString()+"\nQt Graphical User Interface\n\n(c)2011-2014 ZeroTier Networks LLC\n\nReleased under the terms of the GNU\nGeneral Public License v3.0, see: http://gplv3.fsf.org for terms.\n\nAuthor(s): Adam Ierymenko"); } diff --git a/ZeroTierUI/licensedialog.cpp b/ZeroTierUI/licensedialog.cpp index bda9488d..8df3cc4c 100644 --- a/ZeroTierUI/licensedialog.cpp +++ b/ZeroTierUI/licensedialog.cpp @@ -5,11 +5,22 @@ #include "licensedialog.h" #include "ui_licensedialog.h" +#include "../node/Constants.hpp" + LicenseDialog::LicenseDialog(QWidget *parent) : QDialog(parent), ui(new Ui::LicenseDialog) { ui->setupUi(this); + +#ifdef __WINDOWS__ + QWidgetList widgets = this->findChildren<QWidget*>(); + foreach(QWidget *widget, widgets) { + QFont font(widget->font()); + font.setPointSizeF(font.pointSizeF() * 0.75); + widget->setFont(font); + } +#endif } LicenseDialog::~LicenseDialog() diff --git a/ZeroTierUI/main.cpp b/ZeroTierUI/main.cpp index 5814849c..612d7c83 100644 --- a/ZeroTierUI/main.cpp +++ b/ZeroTierUI/main.cpp @@ -32,6 +32,12 @@ #include <QApplication> #include <QDir> #include <QString> +#include <QFont> + +#ifdef __WINDOWS__ +#include <WinSock2.h> +#include <windows.h> +#endif QSettings *settings = (QSettings *)0; @@ -39,6 +45,13 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); +#ifdef __WINDOWS__ + { + WSADATA wsaData; + WSAStartup(MAKEWORD(2,2),&wsaData); + } +#endif + { QFile qss(":css/stylesheet.css"); qss.open(QFile::ReadOnly); diff --git a/ZeroTierUI/mainwindow.cpp b/ZeroTierUI/mainwindow.cpp index 4e73ccfa..1b3f57cd 100644 --- a/ZeroTierUI/mainwindow.cpp +++ b/ZeroTierUI/mainwindow.cpp @@ -44,6 +44,7 @@ #include <QVBoxLayout> #include <QScrollBar> #include <QEventLoop> +#include <QFont> #include "main.h" #include "mainwindow.h" @@ -106,6 +107,15 @@ MainWindow::MainWindow(QWidget *parent) : widget->setAttribute(Qt::WA_MacShowFocusRect,false); #endif +#ifdef __WINDOWS__ + QWidgetList widgets = this->findChildren<QWidget*>(); + foreach(QWidget *widget, widgets) { + QFont font(widget->font()); + font.setPointSizeF(font.pointSizeF() * 0.75); + widget->setFont(font); + } +#endif + ui->noNetworksLabel->setVisible(true); ui->noNetworksLabel->setText("Connecting to Service..."); ui->bottomContainerWidget->setVisible(false); @@ -206,7 +216,6 @@ void MainWindow::timerEvent(QTimerEvent *event) void MainWindow::customEvent(QEvent *event) { - QMessageBox::information(this,"event","event",QMessageBox::Ok); ZTMessageEvent *m = (ZTMessageEvent *)event; // only one custom event type so far if (m->ztMessage.size() == 0) return; diff --git a/ZeroTierUI/mainwindow.h b/ZeroTierUI/mainwindow.h index 390e822d..92cfabf1 100644 --- a/ZeroTierUI/mainwindow.h +++ b/ZeroTierUI/mainwindow.h @@ -39,6 +39,7 @@ #include <vector> #include <string> +#include "../node/Constants.hpp" #include "../node/Node.hpp" #include "../node/Utils.hpp" diff --git a/ZeroTierUI/mainwindow.ui b/ZeroTierUI/mainwindow.ui index 0f686b28..913f2683 100644 --- a/ZeroTierUI/mainwindow.ui +++ b/ZeroTierUI/mainwindow.ui @@ -230,9 +230,14 @@ <x>0</x> <y>0</y> <width>668</width> - <height>18</height> + <height>24</height> </rect> </property> + <property name="font"> + <font> + <pointsize>12</pointsize> + </font> + </property> <property name="layoutDirection"> <enum>Qt::LeftToRight</enum> </property> @@ -255,7 +260,7 @@ <widget class="QStatusBar" name="statusBar"> <property name="font"> <font> - <pointsize>12</pointsize> + <pointsize>10</pointsize> </font> </property> </widget> @@ -263,11 +268,21 @@ <property name="text"> <string>About</string> </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> </action> <action name="actionExit"> <property name="text"> <string>Exit</string> </property> + <property name="font"> + <font> + <pointsize>10</pointsize> + </font> + </property> </action> </widget> <layoutdefault spacing="6" margin="11"/> diff --git a/ZeroTierUI/networkwidget.cpp b/ZeroTierUI/networkwidget.cpp index 8b0ec0a7..bdc18d92 100644 --- a/ZeroTierUI/networkwidget.cpp +++ b/ZeroTierUI/networkwidget.cpp @@ -36,6 +36,9 @@ #include <QProcess> #include <QList> #include <QMessageBox> +#include <QFont> + +#include "../node/Constants.hpp" NetworkWidget::NetworkWidget(QWidget *parent,const std::string &nwid) : QWidget(parent), @@ -50,9 +53,20 @@ NetworkWidget::NetworkWidget(QWidget *parent,const std::string &nwid) : ui->ipListWidget->setMinimumHeight(lineHeight * 4); ui->ipListWidget->setMaximumHeight(lineHeight * 4); +#ifdef __APPLE__ QWidgetList widgets = this->findChildren<QWidget*>(); foreach(QWidget* widget, widgets) widget->setAttribute(Qt::WA_MacShowFocusRect,false); +#endif + +#ifdef __WINDOWS__ + QWidgetList widgets = this->findChildren<QWidget*>(); + foreach(QWidget *widget, widgets) { + QFont font(widget->font()); + font.setPointSizeF(font.pointSizeF() * 0.75); + widget->setFont(font); + } +#endif } NetworkWidget::~NetworkWidget() diff --git a/ZeroTierUI/stylesheet.css b/ZeroTierUI/stylesheet.css index 3a5795c5..c8764ea2 100644 --- a/ZeroTierUI/stylesheet.css +++ b/ZeroTierUI/stylesheet.css @@ -11,6 +11,7 @@ QToolButton:focus { } QToolButton:hover { background: palette(highlight); + color: palette(highlight-text); } QToolButton:pressed { border: 1px solid #000000; @@ -75,6 +76,10 @@ QLabel.networkName { text-align: right; } +QStatusBar { + background: palette(button); +} + #joinNetworkButton { margin: 1px; padding: 0; diff --git a/node/Node.hpp b/node/Node.hpp index a6410992..974a51b6 100644 --- a/node/Node.hpp +++ b/node/Node.hpp @@ -45,6 +45,10 @@ class Node public: /** * Client for controlling a local ZeroTier One node + * + * Windows note: be sure you call WSAStartup() before using this, + * otherwise it will be unable to open a local UDP socket to + * communicate with the service. */ class LocalClient { |