mirror of
https://github.com/ZeroTier/ZeroTierOne
synced 2025-08-21 13:54:15 -07:00
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.
This commit is contained in:
parent
e0cb5caef2
commit
f80ec871f6
12 changed files with 239 additions and 105 deletions
|
@ -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)) {
|
||||
|
|
|
@ -86,6 +86,7 @@ private:
|
|||
QString myAddress;
|
||||
QString myStatus;
|
||||
QString myVersion;
|
||||
bool firstTimerTick;
|
||||
int pollServiceTimerId;
|
||||
unsigned int numPeers;
|
||||
unsigned int cyclesSinceResponseFromService;
|
||||
|
|
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue