diff options
| author | Adam Ierymenko <adam.ierymenko@zerotier.com> | 2014-01-26 10:59:33 -0800 |
|---|---|---|
| committer | Adam Ierymenko <adam.ierymenko@zerotier.com> | 2014-01-26 10:59:33 -0800 |
| commit | 80997f652b2c2cbca615174f9b2dd09411d723a9 (patch) | |
| tree | ae7f04ae3f787fd2e62ff9b81a72c8fd15d9d492 | |
| parent | 9d67a02b5f691583220ab858cd2c6a92079e107f (diff) | |
| download | infinitytier-80997f652b2c2cbca615174f9b2dd09411d723a9.tar.gz infinitytier-80997f652b2c2cbca615174f9b2dd09411d723a9.zip | |
Few small cleanup things...
| -rw-r--r-- | ZeroTierUI/mainwindow.cpp | 11 | ||||
| -rw-r--r-- | node/Node.cpp | 16 |
2 files changed, 13 insertions, 14 deletions
diff --git a/ZeroTierUI/mainwindow.cpp b/ZeroTierUI/mainwindow.cpp index 3e4e96a0..4e73ccfa 100644 --- a/ZeroTierUI/mainwindow.cpp +++ b/ZeroTierUI/mainwindow.cpp @@ -190,9 +190,9 @@ void MainWindow::timerEvent(QTimerEvent *event) zeroTierClient = new ZeroTier::Node::LocalClient(authToken.c_str(),0,&handleZTMessage,this); } - if (++this->cyclesSinceResponseFromService >= 4) { - if (this->cyclesSinceResponseFromService == 4) - QMessageBox::warning(this,"Service Not Running","Can't Connect to the ZeroTier One service. Is it running?",QMessageBox::Ok); + if (++this->cyclesSinceResponseFromService >= 3) { + if (this->cyclesSinceResponseFromService == 3) + QMessageBox::warning(this,"Service Not Running","Can't connect to the ZeroTier One service. Is it running?",QMessageBox::Ok); ui->noNetworksLabel->setVisible(true); ui->noNetworksLabel->setText("Connecting to Service..."); ui->bottomContainerWidget->setVisible(false); @@ -206,18 +206,19 @@ 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; + this->cyclesSinceResponseFromService = 0; + std::vector<std::string> hdr(ZeroTier::Node::LocalClient::splitLine(m->ztMessage[0])); if (hdr.size() < 2) return; if (hdr[0] != "200") return; - this->cyclesSinceResponseFromService = 0; - if (hdr[1] == "info") { if (hdr.size() >= 3) this->myAddress = hdr[2].c_str(); diff --git a/node/Node.cpp b/node/Node.cpp index 25c08067..71f3e087 100644 --- a/node/Node.cpp +++ b/node/Node.cpp @@ -47,6 +47,13 @@ #include <ShlObj.h> #endif +#ifdef __UNIX_LIKE__ +#include <fcntl.h> +#include <unistd.h> +#include <signal.h> +#include <sys/file.h> +#endif + #include "Condition.hpp" #include "Node.hpp" #include "Topology.hpp" @@ -71,15 +78,6 @@ #include "Service.hpp" #include "SoftwareUpdater.hpp" -#ifdef __WINDOWS__ -#include <Windows.h> -#else -#include <fcntl.h> -#include <unistd.h> -#include <signal.h> -#include <sys/file.h> -#endif - #include "../version.h" namespace ZeroTier { |
