summaryrefslogtreecommitdiff
path: root/ZeroTierUI
diff options
context:
space:
mode:
authorAdam Ierymenko <adam.ierymenko@zerotier.com>2014-01-27 23:13:36 -0800
committerAdam Ierymenko <adam.ierymenko@zerotier.com>2014-01-27 23:13:36 -0800
commitf80ec871f6f4c63a28b9b8192477114b7aac696d (patch)
treeb2b02a40d9d9e0ee9f0dd0478fe192e966e274bc /ZeroTierUI
parente0cb5caef21243cf045cecc25ed064869d1594d4 (diff)
downloadinfinitytier-f80ec871f6f4c63a28b9b8192477114b7aac696d.tar.gz
infinitytier-f80ec871f6f4c63a28b9b8192477114b7aac696d.zip
Make EthernetTap creation occur in a background thread in Network since it's a time consuming operation on Windows. This fixes one of the last remaining Windows problems.
Diffstat (limited to 'ZeroTierUI')
-rw-r--r--ZeroTierUI/mainwindow.cpp15
-rw-r--r--ZeroTierUI/mainwindow.h1
-rw-r--r--ZeroTierUI/stylesheet.css3
3 files changed, 14 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)) {
diff --git a/ZeroTierUI/mainwindow.h b/ZeroTierUI/mainwindow.h
index 92cfabf1..c4bb72ae 100644
--- a/ZeroTierUI/mainwindow.h
+++ b/ZeroTierUI/mainwindow.h
@@ -86,6 +86,7 @@ private:
QString myAddress;
QString myStatus;
QString myVersion;
+ bool firstTimerTick;
int pollServiceTimerId;
unsigned int numPeers;
unsigned int cyclesSinceResponseFromService;
diff --git a/ZeroTierUI/stylesheet.css b/ZeroTierUI/stylesheet.css
index 9639f2b5..31904df5 100644
--- a/ZeroTierUI/stylesheet.css
+++ b/ZeroTierUI/stylesheet.css
@@ -64,6 +64,9 @@ QListWidget.ipAddressList::item {
}
QListWidget.ipAddressList::item:selected {
background: transparent;
+ border-top: 0;
+ border-left: 0;
+ border-right: 0;
border-bottom: 1px solid transparent;
}
QListWidget.ipAddressList::item:hover {