Merge pull request #70 from mammonsama666/0128-dev

fix(wifi): New wifi connected failed.
This commit is contained in:
chenlelin 2021-01-28 11:04:35 +08:00 committed by GitHub
commit 62bba09cc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 20 additions and 16 deletions

View File

@ -1635,10 +1635,12 @@ void MainWindow::getConnListDone(QStringList slist)
if (isAddedWifi) {
isAddedWifi = false;
//如果是新添加的wifi尝试激活这个wifi
this->is_stop_check_net_state = 1;
BackThread *bt = new BackThread();
bt->execConnWifi(lastAddedConn);
connect(bt, SIGNAL(connDone(int)), this, SLOT(connWifiDone(int)));
if (! is_stop_check_net_state) {
this->is_stop_check_net_state = 1;
BackThread *bt = new BackThread();
bt->execConnWifi(lastAddedConn);
connect(bt, SIGNAL(connDone(int)), this, SLOT(connWifiDone(int)));
}
}
oldConnSlist.clear();
oldConnSlist = newConnSlist;

View File

@ -660,18 +660,20 @@ void OneConnForm::on_btnConnPWD_clicked()
t->start();
}
mw->is_stop_check_net_state = 1;
QThread *t = new QThread();
BackThread *bt = new BackThread();
bt->moveToThread(t);
connect(t, SIGNAL(finished()), t, SLOT(deleteLater()));
connect(t, SIGNAL(started()), this, SLOT(slotConnWifiPWD()));
connect(this, SIGNAL(sigConnWifiPWD(QString, QString, QString)),
bt, SLOT(execConnWifiPWD(QString, QString, QString)));
connect(bt, SIGNAL(connDone(int)), mw, SLOT(connWifiDone(int)));
connect(bt, SIGNAL(connDone(int)), this, SLOT(slotConnWifiResult(int)));
connect(bt, SIGNAL(btFinish()), t, SLOT(quit()));
t->start();
if (! mw->is_stop_check_net_state) {
mw->is_stop_check_net_state = 1;
QThread *t = new QThread();
BackThread *bt = new BackThread();
bt->moveToThread(t);
connect(t, SIGNAL(finished()), t, SLOT(deleteLater()));
connect(t, SIGNAL(started()), this, SLOT(slotConnWifiPWD()));
connect(this, SIGNAL(sigConnWifiPWD(QString, QString, QString)),
bt, SLOT(execConnWifiPWD(QString, QString, QString)));
connect(bt, SIGNAL(connDone(int)), mw, SLOT(connWifiDone(int)));
connect(bt, SIGNAL(connDone(int)), this, SLOT(slotConnWifiResult(int)));
connect(bt, SIGNAL(btFinish()), t, SLOT(quit()));
t->start();
}
}
//点击后弹出连接隐藏wifi网络窗口