Merge pull request #80 from CrankyPants123/master

Fix bug#40360 Cursor exception
This commit is contained in:
chenlelin 2021-03-04 20:26:26 +08:00 committed by GitHub
commit 2359b3f242
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 20 additions and 14 deletions

View File

@ -184,7 +184,6 @@ void ConfForm::setProp(QString connName, QString uuidName, QString v4method, QSt
ui->cbType->setCurrentIndex(1); ui->cbType->setCurrentIndex(1);
cbTypeChanged(1); cbTypeChanged(1);
} }
if (v6method == "manual") { if (v6method == "manual") {
ui->leAddr_ipv6->setText(v6addr); ui->leAddr_ipv6->setText(v6addr);
} }
@ -227,8 +226,8 @@ void ConfForm::on_btnCreate_clicked()
if (kylindbus.multiWiredIfName.size() == 0) { if (kylindbus.multiWiredIfName.size() == 0) {
QString tip(tr("Can not create new wired network for without wired card")); QString tip(tr("Can not create new wired network for without wired card"));
kylindbus.showDesktopNotify(tip); kylindbus.showDesktopNotify(tip);
//this->close(); //this->close();this->hide();
this->hide(); onConfformHide();
return; return;
} else { } else {
mIfname = kylindbus.multiWiredIfName.at(0); mIfname = kylindbus.multiWiredIfName.at(0);
@ -274,7 +273,7 @@ void ConfForm::on_btnCreate_clicked()
Utils::m_system(cmdStr.toUtf8().data()); Utils::m_system(cmdStr.toUtf8().data());
} }
this->hide(); onConfformHide();
} }
//点击了保存更改网络设置的按钮 //点击了保存更改网络设置的按钮
@ -303,7 +302,7 @@ void ConfForm::on_btnSave_clicked()
QString tip(tr("Can not save wired network for without wired card")); QString tip(tr("Can not save wired network for without wired card"));
kylindbus.showDesktopNotify(tip); kylindbus.showDesktopNotify(tip);
//this->close(); //this->close();
this->hide(); onConfformHide();
return; return;
} else { } else {
mIfname = kylindbus.multiWiredIfName.at(0); mIfname = kylindbus.multiWiredIfName.at(0);
@ -418,7 +417,7 @@ void ConfForm::saveNetworkConfiguration()
} }
} }
this->hide(); onConfformHide();
} }
bool ConfForm::check_ip_conflict(QString ifname) bool ConfForm::check_ip_conflict(QString ifname)
@ -469,8 +468,7 @@ bool ConfForm::check_ip_conflict(QString ifname)
//点击取消按钮 //点击取消按钮
void ConfForm::on_btnCancel_clicked() void ConfForm::on_btnCancel_clicked()
{ {
//this->close(); onConfformHide();
this->hide();
} }
//根据需要设置的种类(自动或手动等)显示界面内容 //根据需要设置的种类(自动或手动等)显示界面内容
@ -641,6 +639,17 @@ bool ConfForm::getIpv6EditState(QString text)
return match; return match;
} }
void ConfForm::onConfformHide()
{
clearFocus();
ui->leAddr->clearFocus();
ui->leAddr_ipv6->clearFocus();
ui->leGateway->clearFocus();
ui->leDns->clearFocus();
ui->leDns2->clearFocus();
this->hide();
}
//设置创建或保存按钮不可点击 //设置创建或保存按钮不可点击
void ConfForm::setBtnEnableFalse() void ConfForm::setBtnEnableFalse()
{ {

View File

@ -81,7 +81,7 @@ private:
void mouseMoveEvent(QMouseEvent *event); void mouseMoveEvent(QMouseEvent *event);
bool check_ip_conflict(QString ifname); bool check_ip_conflict(QString ifname);
void onConfformHide();
bool isPress; bool isPress;
QPoint winPos; QPoint winPos;
QPoint dragPos; QPoint dragPos;

View File

@ -645,7 +645,6 @@ void MainWindow::iconActivated(QSystemTrayIcon::ActivationReason reason)
switch (reason) { switch (reason) {
case QSystemTrayIcon::Trigger: case QSystemTrayIcon::Trigger:
case QSystemTrayIcon::MiddleClick: case QSystemTrayIcon::MiddleClick:
handleIconClicked(); handleIconClicked();
if (this->isHidden()) { if (this->isHidden()) {
@ -991,7 +990,7 @@ void MainWindow::onPhysicalCarrierChanged(bool flag)
} else { } else {
qDebug()<<"拔出了有线网的网线"; qDebug()<<"拔出了有线网的网线";
syslog(LOG_DEBUG,"wired physical cable is already plug out"); syslog(LOG_DEBUG,"wired physical cable is already plug out");
activeLanDisconn();
BackThread *bt = new BackThread(); BackThread *bt = new BackThread();
IFace *iface = bt->execGetIface(); IFace *iface = bt->execGetIface();
if (iface->lstate != 0) { if (iface->lstate != 0) {
@ -2726,7 +2725,6 @@ void MainWindow::activeLanDisconn()
QString txt(tr("Wired net is disconnected")); QString txt(tr("Wired net is disconnected"));
objKyDBus->showDesktopNotify(txt); objKyDBus->showDesktopNotify(txt);
currSelNetName = ""; currSelNetName = "";
oldActLanName = ""; oldActLanName = "";
oldDbusActLanDNS = 0; oldDbusActLanDNS = 0;
@ -2751,7 +2749,6 @@ void MainWindow::activeWifiDisconn()
void MainWindow::activeStartLoading() void MainWindow::activeStartLoading()
{ {
syslog(LOG_DEBUG, "Wi-Fi is disconnected"); syslog(LOG_DEBUG, "Wi-Fi is disconnected");
QString txt(tr("Wi-Fi is disconnected")); QString txt(tr("Wi-Fi is disconnected"));
objKyDBus->showDesktopNotify(txt); objKyDBus->showDesktopNotify(txt);

Binary file not shown.

View File

@ -1465,7 +1465,7 @@
<message> <message>
<location filename="../src/mainwindow.cpp" line="2359"/> <location filename="../src/mainwindow.cpp" line="2359"/>
<source>Wired net is disconnected</source> <source>Wired net is disconnected</source>
<translation type="unfinished">线</translation> <translation type="unfinished">线</translation>
</message> </message>
<message> <message>
<location filename="../src/mainwindow.cpp" line="2385"/> <location filename="../src/mainwindow.cpp" line="2385"/>