mirror of
https://github.com/zerotier/ZeroTierOne.git
synced 2025-06-06 20:43:44 +02:00
Few small cleanup things...
This commit is contained in:
parent
9d67a02b5f
commit
80997f652b
2 changed files with 13 additions and 14 deletions
|
@ -190,9 +190,9 @@ void MainWindow::timerEvent(QTimerEvent *event)
|
||||||
zeroTierClient = new ZeroTier::Node::LocalClient(authToken.c_str(),0,&handleZTMessage,this);
|
zeroTierClient = new ZeroTier::Node::LocalClient(authToken.c_str(),0,&handleZTMessage,this);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (++this->cyclesSinceResponseFromService >= 4) {
|
if (++this->cyclesSinceResponseFromService >= 3) {
|
||||||
if (this->cyclesSinceResponseFromService == 4)
|
if (this->cyclesSinceResponseFromService == 3)
|
||||||
QMessageBox::warning(this,"Service Not Running","Can't Connect to the ZeroTier One service. Is it running?",QMessageBox::Ok);
|
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->setVisible(true);
|
||||||
ui->noNetworksLabel->setText("Connecting to Service...");
|
ui->noNetworksLabel->setText("Connecting to Service...");
|
||||||
ui->bottomContainerWidget->setVisible(false);
|
ui->bottomContainerWidget->setVisible(false);
|
||||||
|
@ -206,18 +206,19 @@ 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;
|
||||||
|
|
||||||
|
this->cyclesSinceResponseFromService = 0;
|
||||||
|
|
||||||
std::vector<std::string> hdr(ZeroTier::Node::LocalClient::splitLine(m->ztMessage[0]));
|
std::vector<std::string> hdr(ZeroTier::Node::LocalClient::splitLine(m->ztMessage[0]));
|
||||||
if (hdr.size() < 2)
|
if (hdr.size() < 2)
|
||||||
return;
|
return;
|
||||||
if (hdr[0] != "200")
|
if (hdr[0] != "200")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
this->cyclesSinceResponseFromService = 0;
|
|
||||||
|
|
||||||
if (hdr[1] == "info") {
|
if (hdr[1] == "info") {
|
||||||
if (hdr.size() >= 3)
|
if (hdr.size() >= 3)
|
||||||
this->myAddress = hdr[2].c_str();
|
this->myAddress = hdr[2].c_str();
|
||||||
|
|
|
@ -47,6 +47,13 @@
|
||||||
#include <ShlObj.h>
|
#include <ShlObj.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef __UNIX_LIKE__
|
||||||
|
#include <fcntl.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <signal.h>
|
||||||
|
#include <sys/file.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#include "Condition.hpp"
|
#include "Condition.hpp"
|
||||||
#include "Node.hpp"
|
#include "Node.hpp"
|
||||||
#include "Topology.hpp"
|
#include "Topology.hpp"
|
||||||
|
@ -71,15 +78,6 @@
|
||||||
#include "Service.hpp"
|
#include "Service.hpp"
|
||||||
#include "SoftwareUpdater.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"
|
#include "../version.h"
|
||||||
|
|
||||||
namespace ZeroTier {
|
namespace ZeroTier {
|
||||||
|
|
Loading…
Add table
Reference in a new issue