Compare commits

...

11 Commits

Author SHA1 Message Date
openeuler-ci-bot
d272e1e2ec !10 fix bug closing settings window causes the main process to exit
From: @dou33
Reviewed-by: @tanyulong2021
Signed-off-by: @tanyulong2021
2021-10-28 09:52:25 +00:00
dou33
67fda4999a fix bug closing settings window causes the main process to exit 2021-10-28 14:53:11 +08:00
openeuler-ci-bot
9dcd6c6895 !8 fix desktop notificatio window show error
From: @dou33
Reviewed-by: @tanyulong2021
Signed-off-by: @tanyulong2021
2021-10-26 08:10:26 +00:00
dou33
cdc9cce7c1 fix desktop notificatio window show error 2021-10-26 15:31:04 +08:00
openeuler-ci-bot
cb8fbd2913 !6 sync with master
From: @dou33
Reviewed-by: @tanyulong2021
Signed-off-by: @tanyulong2021
2021-10-26 06:51:12 +00:00
dou33
a9f467e047 modify url 2021-10-25 14:25:32 +08:00
openeuler-ci-bot
00bc81ae96 !3 sync
From: @myshow2258
Reviewed-by: @dou33
Signed-off-by: @dou33
2021-01-26 09:55:58 +08:00
dou33
7d4b226de5 !2 update to version 3.0.2-1
Merge pull request !2 from dou33/update
2020-11-03 11:49:32 +08:00
dou33
0057c910f9 update to version 3.0.2-1 2020-11-03 11:44:07 +08:00
openeuler-ci-bot
9dba3b4625 !1 update source
Merge pull request !1 from yangzhao_kl/update_source
2020-07-24 17:36:30 +08:00
yangzhao_kl
c5b5f6e15c update_source 2020-07-24 15:07:20 +08:00
4 changed files with 281 additions and 0 deletions

View File

@ -0,0 +1,198 @@
From bec5f07f273ec5427730c13a9c64cd5b24d2c3ac Mon Sep 17 00:00:00 2001
From: dou33 <johnwo3396@hotmail.com>
Date: Thu, 28 Oct 2021 14:48:57 +0800
Subject: [PATCH] fix bug closing settings window causes the main process to
exit
---
src/confform.cpp | 14 +++++++++++++-
src/confform.h | 3 ++-
src/confform.ui | 3 +++
src/mainwindow.cpp | 5 ++++-
wireless-security/dlgconnhidwifi.cpp | 6 ++++--
wireless-security/dlgconnhidwifiwpa.cpp | 4 +++-
6 files changed, 29 insertions(+), 6 deletions(-)
diff --git a/src/confform.cpp b/src/confform.cpp
index a83fc34..d62cbb4 100755
--- a/src/confform.cpp
+++ b/src/confform.cpp
@@ -30,7 +30,7 @@
extern QString llname, lwname;
ConfForm::ConfForm(QWidget *parent) :
- QWidget(parent),
+ QDialog(parent),
ui(new Ui::ConfForm)
{
ui->setupUi(this);
@@ -92,6 +92,12 @@ 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();
@@ -148,6 +154,7 @@ void ConfForm::mousePressEvent(QMouseEvent *event)
this->dragPos = event->globalPos();
event->accept();
}
+ return QDialog::mousePressEvent(event);
}
void ConfForm::mouseReleaseEvent(QMouseEvent *event)
{
@@ -159,6 +166,7 @@ void ConfForm::mouseMoveEvent(QMouseEvent *event)
this->move(this->winPos - (this->dragPos - event->globalPos()));
event->accept();
}
+ return QDialog::mouseMoveEvent(event);
}
//网络配置参数设置界面的显示内容
@@ -213,6 +221,7 @@ void ConfForm::on_btnCreate_clicked()
if (mIfname == "") {
QString tip(tr("Can not create new wired network for without wired card"));
kylindbus.showDesktopNotify(tip);
+ //this->close();
this->hide();
return;
}
@@ -231,6 +240,7 @@ void ConfForm::on_btnCreate_clicked()
kylindbus.showDesktopNotify(txt);
}
+ //this->close();
this->hide();
}
@@ -265,6 +275,7 @@ void ConfForm::on_btnOk_clicked()
KylinDBus kylindbus;
+ //this->close();
this->hide();
QString txt(tr("New network settings already finished"));
@@ -293,6 +304,7 @@ void ConfForm::on_btnOk_clicked()
//点击取消按钮
void ConfForm::on_btnCancel_clicked()
{
+ //this->close();
this->hide();
}
diff --git a/src/confform.h b/src/confform.h
index e29cdd2..b40d2c2 100755
--- a/src/confform.h
+++ b/src/confform.h
@@ -25,13 +25,14 @@
#include <QPoint>
#include <QPainter>
#include <QPainterPath>
+#include <QDialog>
#include <QListView>
namespace Ui {
class ConfForm;
}
-class ConfForm : public QWidget
+class ConfForm : public QDialog
{
Q_OBJECT
diff --git a/src/confform.ui b/src/confform.ui
index 3b117a5..a312a94 100755
--- a/src/confform.ui
+++ b/src/confform.ui
@@ -13,6 +13,9 @@
<property name="windowTitle">
<string/>
</property>
+ <property name="toolTip">
+ <string/>
+ </property>
<widget class="QWidget" name="centralWidget" native="true">
<property name="geometry">
<rect>
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 78fa74f..7d9bfdf 100755
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -84,6 +84,7 @@ MainWindow::MainWindow(QWidget *parent) :
objNetSpeed = new NetworkSpeed();
+ QApplication::setQuitOnLastWindowClosed(false);
this->confForm = new ConfForm();
this->ksnm = new KSimpleNM();
@@ -1868,10 +1869,12 @@ void MainWindow::onBtnCreateNetClicked()
primaryGeometry = qApp->primaryScreen()->geometry();
}
+ 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->show();
+ m_cf->exec();
}
diff --git a/wireless-security/dlgconnhidwifi.cpp b/wireless-security/dlgconnhidwifi.cpp
index 7cb1f75..f38a88f 100755
--- a/wireless-security/dlgconnhidwifi.cpp
+++ b/wireless-security/dlgconnhidwifi.cpp
@@ -230,7 +230,8 @@ void DlgConnHidWifi::changeWindow(){
void DlgConnHidWifi::on_btnCancel_clicked()
{
- this->close();
+ //this->close();
+ this->hide();
}
void DlgConnHidWifi::on_btnConnect_clicked()
@@ -276,7 +277,8 @@ void DlgConnHidWifi::on_btnConnect_clicked()
connect(this, SIGNAL(sendMessage()), this,SLOT(emitSignal() ));
QTimer::singleShot(4*1000, this, SLOT(emitSignal() ));
}
- this->close();
+ //this->close();
+ this->hide();
}
void DlgConnHidWifi::on_leNetName_textEdited(const QString &arg1)
diff --git a/wireless-security/dlgconnhidwifiwpa.cpp b/wireless-security/dlgconnhidwifiwpa.cpp
index 022df7f..6457463 100755
--- a/wireless-security/dlgconnhidwifiwpa.cpp
+++ b/wireless-security/dlgconnhidwifiwpa.cpp
@@ -244,7 +244,8 @@ void DlgConnHidWifiWpa::changeWindow()
void DlgConnHidWifiWpa::on_btnCancel_clicked()
{
- this->close();
+ //this->close();
+ this->hide();
}
void DlgConnHidWifiWpa::on_btnConnect_clicked()
@@ -289,6 +290,7 @@ void DlgConnHidWifiWpa::on_btnConnect_clicked()
QTimer::singleShot(4*1000, this, SLOT(emitSignal() ));
}
this->close();
+ this->hide();
}
void DlgConnHidWifiWpa::on_checkBoxPwd_stateChanged(int arg1)
--
2.24.3 (Apple Git-128)

View File

@ -0,0 +1,12 @@
diff -Naur kylin-nm-3.0.2/src/utils.cpp kylin-nm-3.0.2~/src/utils.cpp
--- kylin-nm-3.0.2/src/utils.cpp 2019-05-27 15:48:18.000000000 +0800
+++ kylin-nm-3.0.2~/src/utils.cpp 2021-10-26 14:59:00.660899943 +0800
@@ -83,7 +83,7 @@
QList<QVariant> args;
args<<(QCoreApplication::applicationName())
<<((unsigned int) 0)
- <<QString("qweq")
+ <<QString("/usr/share/icons/ukui-icon-theme-default/22x22/devices/network-wired.png")
<<tr("kylin network applet desktop message") //显示的是什么类型的信息
<<message //显示的具体信息
<<QStringList()

BIN
kylin-nm-3.0.2.tar.gz Normal file

Binary file not shown.

71
kylin-nm.spec Normal file
View File

@ -0,0 +1,71 @@
Name: kylin-nm
Version: 3.0.2
Release: 4
Summary: Gui Applet tool for display and edit network simply
License: GPL-3+
URL: https://github.com/ukui/kylin-nm/
Source0: %{name}-%{version}.tar.gz
Patch0: fix-desktop-notification-window-show-error.patch
Patch1: 0001-fix-bug-closing-settings-window-causes-the-main-proc.patch
BuildRequires: qt5-qtbase-devel
BuildRequires: qtchooser
BuildRequires: qt5-qtscript-devel
BuildRequires: qt5-qttools-devel
BuildRequires: qt5-qtx11extras-devel
BuildRequires: gsettings-qt-devel
BuildRequires: kf5-kwindowsystem-devel
BuildRequires: libX11-devel
BuildRequires: qt5-qtsvg-devel
Requires: NetworkManager
Requires: network-manager-applet
%description
Kylin NM is a Applet tool for managing network settings simply.
It has beautiful UI and very comfortable to use.
It's better work together with UKUI.
%prep
%setup -q
%patch0 -p1
%patch1 -p1
%build
%{qmake_qt5} %{_qt5_qmake_flags} CONFIG+=enable-by-default kylin-nm.pro
%{make_build}
%install
rm -rf $RPM_BUILD_ROOT
make INSTALL_ROOT=%{buildroot} install
mkdir -p %{buildroot}/usr/share/doc/kylin-nm/
mkdir -p %{buildroot}/usr/share/man/man1/
cp debian/copyright %{buildroot}/usr/share/doc/kylin-nm/
gzip -c debian/changelog > %{buildroot}/usr/share/doc/kylin-nm/changelog.gz
gzip -c man/kylin-nm.1 > %{buildroot}/usr/share/man/man1/kylin-nm.1.gz
%clean
rm -rf $RPM_BUILD_ROOT
%files
%{_sysconfdir}/xdg/autostart/kylin-nm.desktop
%{_bindir}/kylin-nm
%{_datadir}/doc/kylin-nm/changelog.gz
%{_datadir}/doc/kylin-nm/copyright
%{_mandir}/man1/kylin-nm.1.gz
%changelog
* Thu Oct 28 2021 douyan <douyan@kylinos.cn> - 3.0.2-4
- fix bug closing settings window causes the main process to exit
* Tue Oct 26 2021 douyan <douyan@kylinos.cn> - 3.0.2-3
- add Patch:fix-desktop-notification-window-show-error.patch
* Mon Oct 25 2021 douyan <douyan@kylinos.cn> - 3.0.2-2
- update URL
* Mon Oct 26 2020 douyan <douyan@kylinos.cn> - 3.0.2-1
- update to upstream version 3.0.1-1+1026
* Thu Jul 9 2020 douyan <douyan@kylinos.cn> - 1.2.4-1
- Init package for openEuler