From fe35721e648ada3a5da50e5f80364ec9874ac392 Mon Sep 17 00:00:00 2001 From: huayadong Date: Tue, 7 Dec 2021 17:52:26 +0800 Subject: [PATCH] fix bug closing settings window causes the main process to exit 2 --- ...ow-causes-the-main-process-to-exit-2.patch | 144 ++++++++++++++++++ kylin-nm.spec | 7 +- 2 files changed, 150 insertions(+), 1 deletion(-) create mode 100644 Fix-bug-closing-the-settings-window-causes-the-main-process-to-exit-2.patch diff --git a/Fix-bug-closing-the-settings-window-causes-the-main-process-to-exit-2.patch b/Fix-bug-closing-the-settings-window-causes-the-main-process-to-exit-2.patch new file mode 100644 index 0000000..e5b8866 --- /dev/null +++ b/Fix-bug-closing-the-settings-window-causes-the-main-process-to-exit-2.patch @@ -0,0 +1,144 @@ +From f70832dd27e37657c19b1d8002c460cfa034eb3c Mon Sep 17 00:00:00 2001 +From: huayadong +Date: Tue, 7 Dec 2021 17:40:44 +0800 +Subject: [PATCH] xxxxxx + +--- + debian/changelog | 6 ------ + debian/source/format | 2 +- + src/confform.cpp | 10 +--------- + src/confform.h | 3 +-- + src/confform.ui | 3 --- + src/mainwindow.cpp | 3 +-- + src/utils.cpp | 2 +- + 7 files changed, 5 insertions(+), 24 deletions(-) + +diff --git a/debian/changelog b/debian/changelog +index d0582f3..c4b66aa 100755 +--- a/debian/changelog ++++ b/debian/changelog +@@ -1,9 +1,3 @@ +-kylin-nm (3.0.1-1+1026) focal; urgency=medium +- +- * Daily build. +- +- -- liuliang Mon, 27 May 2019 15:48:18 +0800 +- + kylin-nm (3.0.1-1) unstable; urgency=medium + + * New upstream bugfix release. +diff --git a/debian/source/format b/debian/source/format +index 89ae9db..163aaf8 100755 +--- a/debian/source/format ++++ b/debian/source/format +@@ -1 +1 @@ +-3.0 (native) ++3.0 (quilt) +diff --git a/src/confform.cpp b/src/confform.cpp +index d62cbb4..f0c04ce 100755 +--- a/src/confform.cpp ++++ b/src/confform.cpp +@@ -30,7 +30,7 @@ + extern QString llname, lwname; + + ConfForm::ConfForm(QWidget *parent) : +- QDialog(parent), ++ QWidget(parent), + ui(new Ui::ConfForm) + { + ui->setupUi(this); +@@ -92,12 +92,6 @@ ConfForm::ConfForm(QWidget *parent) : + // ui->btnCancel->setStyleSheet(btnOffQss); + // ui->btnOk->setStyleSheet(btnOnQss); + // ui->btnCreate->setStyleSheet(btnOnQss); +- ui->leAddr->setContextMenuPolicy(Qt::NoContextMenu); +- ui->leName->setContextMenuPolicy(Qt::NoContextMenu); +- ui->leDns->setContextMenuPolicy(Qt::NoContextMenu); +- ui->leDns2->setContextMenuPolicy(Qt::NoContextMenu); +- ui->leGateway->setContextMenuPolicy(Qt::NoContextMenu); +- + ui->lineUp->setStyleSheet(lineQss); + ui->lineDown->setStyleSheet(lineQss); + ui->lineUp->hide(); +@@ -154,7 +148,6 @@ void ConfForm::mousePressEvent(QMouseEvent *event) + this->dragPos = event->globalPos(); + event->accept(); + } +- return QDialog::mousePressEvent(event); + } + void ConfForm::mouseReleaseEvent(QMouseEvent *event) + { +@@ -166,7 +159,6 @@ void ConfForm::mouseMoveEvent(QMouseEvent *event) + this->move(this->winPos - (this->dragPos - event->globalPos())); + event->accept(); + } +- return QDialog::mouseMoveEvent(event); + } + + //网络配置参数设置界面的显示内容 +diff --git a/src/confform.h b/src/confform.h +index b40d2c2..e29cdd2 100755 +--- a/src/confform.h ++++ b/src/confform.h +@@ -25,14 +25,13 @@ + #include + #include + #include +-#include + #include + + namespace Ui { + class ConfForm; + } + +-class ConfForm : public QDialog ++class ConfForm : public QWidget + { + Q_OBJECT + +diff --git a/src/confform.ui b/src/confform.ui +index a312a94..3b117a5 100755 +--- a/src/confform.ui ++++ b/src/confform.ui +@@ -13,9 +13,6 @@ + + + +- +- +- + + + +diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp +index 7d9bfdf..6461855 100755 +--- a/src/mainwindow.cpp ++++ b/src/mainwindow.cpp +@@ -1871,10 +1871,9 @@ void MainWindow::onBtnCreateNetClicked() + + QApplication::setQuitOnLastWindowClosed(false); + ConfForm *m_cf = new ConfForm(); +- m_cf->setAttribute(Qt::WA_DeleteOnClose); + m_cf->cbTypeChanged(3); + m_cf->move(primaryGeometry.width() / 2 - m_cf->width() / 2, primaryGeometry.height() / 2 - m_cf->height() / 2); +- m_cf->exec(); ++ m_cf->show(); + } + + +diff --git a/src/utils.cpp b/src/utils.cpp +index f5b2bd2..7821508 100755 +--- a/src/utils.cpp ++++ b/src/utils.cpp +@@ -83,7 +83,7 @@ void Utils::onRequestSendDesktopNotify(QString message) + QList args; + args<<(QCoreApplication::applicationName()) + <<((unsigned int) 0) +- < - 3.0.2-5 +- add patch:Fix-bug-closing-the-settings-window-causes-the-main-process-to-exit-1104.patch + * Thu Oct 28 2021 douyan - 3.0.2-4 - fix bug closing settings window causes the main process to exit