mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-02-18 17:00:17 +00: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
@ -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");
|
||||
}
|
||||
|
||||
|
@ -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()
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -39,6 +39,7 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#include "../node/Constants.hpp"
|
||||
#include "../node/Node.hpp"
|
||||
#include "../node/Utils.hpp"
|
||||
|
||||
|
@ -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"/>
|
||||
|
@ -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()
|
||||
|
@ -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;
|
||||
|
@ -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
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user