summaryrefslogtreecommitdiff
path: root/ZeroTierUI/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ZeroTierUI/mainwindow.cpp')
-rw-r--r--ZeroTierUI/mainwindow.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/ZeroTierUI/mainwindow.cpp b/ZeroTierUI/mainwindow.cpp
index 1b3f57cd..ffb27af1 100644
--- a/ZeroTierUI/mainwindow.cpp
+++ b/ZeroTierUI/mainwindow.cpp
@@ -121,7 +121,8 @@ MainWindow::MainWindow(QWidget *parent) :
ui->bottomContainerWidget->setVisible(false);
ui->networkListWidget->setVisible(false);
- this->pollServiceTimerId = this->startTimer(1000);
+ this->firstTimerTick = true;
+ this->pollServiceTimerId = this->startTimer(200);
this->cyclesSinceResponseFromService = 0;
}
@@ -133,15 +134,19 @@ MainWindow::~MainWindow()
mainWindow = (MainWindow *)0;
}
-void MainWindow::timerEvent(QTimerEvent *event)
+void MainWindow::timerEvent(QTimerEvent *event) // event can be null since code also calls this directly
{
- event->accept();
-
if (this->isHidden())
return;
- if (pollServiceTimerId < 0)
+ if (this->pollServiceTimerId < 0)
return;
+ if (this->firstTimerTick) {
+ this->firstTimerTick = false;
+ this->killTimer(this->pollServiceTimerId);
+ this->pollServiceTimerId = this->startTimer(1500);
+ }
+
if (!zeroTierClient) {
std::string authToken;
if (!ZeroTier::Utils::readFile(ZeroTier::Node::LocalClient::authTokenDefaultUserPath().c_str(),authToken)) {