mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-05 20:13:44 +02:00
Windows UI appearance fixes (font issue, etc.) and fix to WinSock init on GUI client.
This commit is contained in:
parent
80997f652b
commit
28665079a0
9 changed files with 77 additions and 4 deletions
|
@ -29,7 +29,9 @@
|
||||||
#include "ui_aboutwindow.h"
|
#include "ui_aboutwindow.h"
|
||||||
|
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QFont>
|
||||||
|
|
||||||
|
#include "../node/Constants.hpp"
|
||||||
#include "../node/Node.hpp"
|
#include "../node/Node.hpp"
|
||||||
|
|
||||||
AboutWindow::AboutWindow(QWidget *parent) :
|
AboutWindow::AboutWindow(QWidget *parent) :
|
||||||
|
@ -37,7 +39,6 @@ AboutWindow::AboutWindow(QWidget *parent) :
|
||||||
ui(new Ui::AboutWindow)
|
ui(new Ui::AboutWindow)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
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");
|
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");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,11 +5,22 @@
|
||||||
#include "licensedialog.h"
|
#include "licensedialog.h"
|
||||||
#include "ui_licensedialog.h"
|
#include "ui_licensedialog.h"
|
||||||
|
|
||||||
|
#include "../node/Constants.hpp"
|
||||||
|
|
||||||
LicenseDialog::LicenseDialog(QWidget *parent) :
|
LicenseDialog::LicenseDialog(QWidget *parent) :
|
||||||
QDialog(parent),
|
QDialog(parent),
|
||||||
ui(new Ui::LicenseDialog)
|
ui(new Ui::LicenseDialog)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
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()
|
LicenseDialog::~LicenseDialog()
|
||||||
|
|
|
@ -32,6 +32,12 @@
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
#include <QDir>
|
#include <QDir>
|
||||||
#include <QString>
|
#include <QString>
|
||||||
|
#include <QFont>
|
||||||
|
|
||||||
|
#ifdef __WINDOWS__
|
||||||
|
#include <WinSock2.h>
|
||||||
|
#include <windows.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
QSettings *settings = (QSettings *)0;
|
QSettings *settings = (QSettings *)0;
|
||||||
|
|
||||||
|
@ -39,6 +45,13 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
QApplication a(argc, argv);
|
QApplication a(argc, argv);
|
||||||
|
|
||||||
|
#ifdef __WINDOWS__
|
||||||
|
{
|
||||||
|
WSADATA wsaData;
|
||||||
|
WSAStartup(MAKEWORD(2,2),&wsaData);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
{
|
{
|
||||||
QFile qss(":css/stylesheet.css");
|
QFile qss(":css/stylesheet.css");
|
||||||
qss.open(QFile::ReadOnly);
|
qss.open(QFile::ReadOnly);
|
||||||
|
|
|
@ -44,6 +44,7 @@
|
||||||
#include <QVBoxLayout>
|
#include <QVBoxLayout>
|
||||||
#include <QScrollBar>
|
#include <QScrollBar>
|
||||||
#include <QEventLoop>
|
#include <QEventLoop>
|
||||||
|
#include <QFont>
|
||||||
|
|
||||||
#include "main.h"
|
#include "main.h"
|
||||||
#include "mainwindow.h"
|
#include "mainwindow.h"
|
||||||
|
@ -106,6 +107,15 @@ MainWindow::MainWindow(QWidget *parent) :
|
||||||
widget->setAttribute(Qt::WA_MacShowFocusRect,false);
|
widget->setAttribute(Qt::WA_MacShowFocusRect,false);
|
||||||
#endif
|
#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->setVisible(true);
|
||||||
ui->noNetworksLabel->setText("Connecting to Service...");
|
ui->noNetworksLabel->setText("Connecting to Service...");
|
||||||
ui->bottomContainerWidget->setVisible(false);
|
ui->bottomContainerWidget->setVisible(false);
|
||||||
|
@ -206,7 +216,6 @@ void MainWindow::timerEvent(QTimerEvent *event)
|
||||||
|
|
||||||
void MainWindow::customEvent(QEvent *event)
|
void MainWindow::customEvent(QEvent *event)
|
||||||
{
|
{
|
||||||
QMessageBox::information(this,"event","event",QMessageBox::Ok);
|
|
||||||
ZTMessageEvent *m = (ZTMessageEvent *)event; // only one custom event type so far
|
ZTMessageEvent *m = (ZTMessageEvent *)event; // only one custom event type so far
|
||||||
if (m->ztMessage.size() == 0)
|
if (m->ztMessage.size() == 0)
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -39,6 +39,7 @@
|
||||||
#include <vector>
|
#include <vector>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
#include "../node/Constants.hpp"
|
||||||
#include "../node/Node.hpp"
|
#include "../node/Node.hpp"
|
||||||
#include "../node/Utils.hpp"
|
#include "../node/Utils.hpp"
|
||||||
|
|
||||||
|
|
|
@ -230,9 +230,14 @@
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>668</width>
|
<width>668</width>
|
||||||
<height>18</height>
|
<height>24</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>12</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
<property name="layoutDirection">
|
<property name="layoutDirection">
|
||||||
<enum>Qt::LeftToRight</enum>
|
<enum>Qt::LeftToRight</enum>
|
||||||
</property>
|
</property>
|
||||||
|
@ -255,7 +260,7 @@
|
||||||
<widget class="QStatusBar" name="statusBar">
|
<widget class="QStatusBar" name="statusBar">
|
||||||
<property name="font">
|
<property name="font">
|
||||||
<font>
|
<font>
|
||||||
<pointsize>12</pointsize>
|
<pointsize>10</pointsize>
|
||||||
</font>
|
</font>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
|
@ -263,11 +268,21 @@
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>About</string>
|
<string>About</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
</action>
|
</action>
|
||||||
<action name="actionExit">
|
<action name="actionExit">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Exit</string>
|
<string>Exit</string>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<pointsize>10</pointsize>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
</action>
|
</action>
|
||||||
</widget>
|
</widget>
|
||||||
<layoutdefault spacing="6" margin="11"/>
|
<layoutdefault spacing="6" margin="11"/>
|
||||||
|
|
|
@ -36,6 +36,9 @@
|
||||||
#include <QProcess>
|
#include <QProcess>
|
||||||
#include <QList>
|
#include <QList>
|
||||||
#include <QMessageBox>
|
#include <QMessageBox>
|
||||||
|
#include <QFont>
|
||||||
|
|
||||||
|
#include "../node/Constants.hpp"
|
||||||
|
|
||||||
NetworkWidget::NetworkWidget(QWidget *parent,const std::string &nwid) :
|
NetworkWidget::NetworkWidget(QWidget *parent,const std::string &nwid) :
|
||||||
QWidget(parent),
|
QWidget(parent),
|
||||||
|
@ -50,9 +53,20 @@ NetworkWidget::NetworkWidget(QWidget *parent,const std::string &nwid) :
|
||||||
ui->ipListWidget->setMinimumHeight(lineHeight * 4);
|
ui->ipListWidget->setMinimumHeight(lineHeight * 4);
|
||||||
ui->ipListWidget->setMaximumHeight(lineHeight * 4);
|
ui->ipListWidget->setMaximumHeight(lineHeight * 4);
|
||||||
|
|
||||||
|
#ifdef __APPLE__
|
||||||
QWidgetList widgets = this->findChildren<QWidget*>();
|
QWidgetList widgets = this->findChildren<QWidget*>();
|
||||||
foreach(QWidget* widget, widgets)
|
foreach(QWidget* widget, widgets)
|
||||||
widget->setAttribute(Qt::WA_MacShowFocusRect,false);
|
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()
|
NetworkWidget::~NetworkWidget()
|
||||||
|
|
|
@ -11,6 +11,7 @@ QToolButton:focus {
|
||||||
}
|
}
|
||||||
QToolButton:hover {
|
QToolButton:hover {
|
||||||
background: palette(highlight);
|
background: palette(highlight);
|
||||||
|
color: palette(highlight-text);
|
||||||
}
|
}
|
||||||
QToolButton:pressed {
|
QToolButton:pressed {
|
||||||
border: 1px solid #000000;
|
border: 1px solid #000000;
|
||||||
|
@ -75,6 +76,10 @@ QLabel.networkName {
|
||||||
text-align: right;
|
text-align: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStatusBar {
|
||||||
|
background: palette(button);
|
||||||
|
}
|
||||||
|
|
||||||
#joinNetworkButton {
|
#joinNetworkButton {
|
||||||
margin: 1px;
|
margin: 1px;
|
||||||
padding: 0;
|
padding: 0;
|
||||||
|
|
|
@ -45,6 +45,10 @@ class Node
|
||||||
public:
|
public:
|
||||||
/**
|
/**
|
||||||
* Client for controlling a local ZeroTier One node
|
* 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
|
class LocalClient
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue