summaryrefslogtreecommitdiff
path: root/ZeroTierUI
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@zerotier.com>2014-02-27 21:56:57 -0800
committerAdam Ierymenko <adam.ierymenko@zerotier.com>2014-02-27 21:56:57 -0800
commit9ae6403346b03b59d302d27206c93ba696d585cb (patch)
treeab3aea1942e71f597785cadac263c05d3b9b9dda /ZeroTierUI
parent39d411ce0b9da63802f7639d3f565e3411a5632d (diff)
downloadinfinitytier-9ae6403346b03b59d302d27206c93ba696d585cb.tar.gz
infinitytier-9ae6403346b03b59d302d27206c93ba696d585cb.zip
Installer works, and fix for ugly fonts in pulldown menus in main windows in UI. Also remove dummy installer, which we don't need anymore.
Diffstat (limited to 'ZeroTierUI')
-rw-r--r--ZeroTierUI/main.cpp12
-rw-r--r--ZeroTierUI/mainwindow.cpp8
2 files changed, 13 insertions, 7 deletions
diff --git a/ZeroTierUI/main.cpp b/ZeroTierUI/main.cpp
index 84e1e121..e62b904e 100644
--- a/ZeroTierUI/main.cpp
+++ b/ZeroTierUI/main.cpp
@@ -42,11 +42,15 @@
#include "../node/Constants.hpp"
#include "../node/Defaults.hpp"
+// Uncomment for testing to disable making sure Windows service is running
+//#define DISABLE_WINDOWS_SERVICE_MANAGEMENT
+
#ifdef __WINDOWS__
#include <WinSock2.h>
#include <windows.h>
#include "../windows/ZeroTierOne/ZeroTierOneService.h"
+#ifndef DISABLE_WINDOWS_SERVICE_MANAGEMENT
// Returns true if started or already running, false if failed or not installed
static bool startWindowsService()
{
@@ -58,7 +62,7 @@ static bool startWindowsService()
if (schSCManager == NULL)
return false;
- schService = OpenService(schSCManager, ZT_SERVICE_NAME, SERVICE_QUERY_STATUS | SERVICE_START);
+ schService = OpenServiceA(schSCManager, ZT_SERVICE_NAME, SERVICE_QUERY_STATUS | SERVICE_START);
if (schService == NULL) {
CloseServiceHandle(schSCManager);
return false;
@@ -81,8 +85,7 @@ static bool startWindowsService()
continue;
}
- memset(&ssSvcStatus,0,sizeof(ssSvcStatus));
- ControlService(schService, SERVICE_CONTROL_START, &ssSvcStatus);
+ StartService(schService,0,NULL);
Sleep(500);
}
@@ -90,6 +93,7 @@ static bool startWindowsService()
CloseServiceHandle(schSCManager);
return running;
}
+#endif // !DISABLE_WINDOWS_SERVICE_MANAGEMENT
#endif // __WINDOWS__
// Globally visible settings for the app
@@ -142,7 +146,7 @@ int main(int argc, char *argv[])
ld.exec();
}
-#ifdef __WINDOWS__
+#if defined(__WINDOWS__) && !defined(DISABLE_WINDOWS_SERVICE_MANAGEMENT)
{
bool winSvcInstalled = false;
while (!startWindowsService()) {
diff --git a/ZeroTierUI/mainwindow.cpp b/ZeroTierUI/mainwindow.cpp
index a7f92af7..9ea6a8f9 100644
--- a/ZeroTierUI/mainwindow.cpp
+++ b/ZeroTierUI/mainwindow.cpp
@@ -111,9 +111,11 @@ MainWindow::MainWindow(QWidget *parent) :
#ifdef __WINDOWS__
QWidgetList widgets = this->findChildren<QWidget*>();
foreach(QWidget *widget, widgets) {
- QFont font(widget->font());
- font.setPointSizeF(font.pointSizeF() * 0.75);
- widget->setFont(font);
+ if ((typeid(*widget) != typeid(ui->menuBar))&&(typeid(*widget) != typeid(ui->menuFile))) {
+ QFont font(widget->font());
+ font.setPointSizeF(font.pointSizeF() * 0.75);
+ widget->setFont(font);
+ }
}
#endif