From 81f49a9623007bbf27b2c9aaadae85e57606073d Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Sat, 7 May 2022 12:55:06 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E7=BC=96=E8=AF=91&&=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E4=BE=9D=E8=B5=96=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/control | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/debian/control b/debian/control index f6ffc54b..e2b2fab6 100644 --- a/debian/control +++ b/debian/control @@ -23,7 +23,7 @@ Build-Depends: debhelper (>=9), libgtk-3-dev, libukcc-dev (>= 3.1.1+1217), libukui-log4qt-dev, - libkysdk-applications, + libkysdk-qtwidgets-dev, libukui-common-dev, Standards-Version: 4.5.0 Rules-Requires-Root: no @@ -35,7 +35,7 @@ Package: kylin-nm Architecture: any Depends: network-manager (>=1.2.6), ukui-control-center (>= 3.1.1+1217), - libkysdk-applications, + libkysdk-qtwidgets, ${shlibs:Depends}, ${misc:Depends} Description: Gui Applet tool for display and edit network simply From 3e1725105752c0b5cb467daa3305f1001c0e987e Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Mon, 9 May 2022 15:26:07 +0800 Subject: [PATCH 2/4] =?UTF-8?q?=E4=B8=89=E6=9D=83=E5=88=86=E7=AB=8B?= =?UTF-8?q?=E5=BC=80=E5=90=AF=E5=BC=8F=E9=9A=90=E8=97=8F=E6=8E=A7=E5=88=B6?= =?UTF-8?q?=E9=9D=A2=E6=9D=BF=E5=85=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/frontend/mainwindow.cpp | 13 +++++++++++++ src/frontend/mainwindow.h | 5 +++++ src/frontend/tab-pages/tabpage.h | 8 ++++++++ src/src.pro | 2 +- 4 files changed, 27 insertions(+), 1 deletion(-) diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index a1bf9740..056421bb 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -10,6 +10,8 @@ #include "kylinnetworkdeviceresource.h" #include "../backend/dbus-interface/kylinagentinterface.h" + + #define MAINWINDOW_WIDTH 420 #define MAINWINDOW_HEIGHT 476 #define LAYOUT_MARGINS 0,0,0,0 @@ -53,6 +55,17 @@ void MainWindow::showMainwindow() this->raise(); this->activateWindow(); emit this->mainWindowVisibleChanged(true); +#ifdef WITHKYSEC + if (!kysec_is_disabled() && kysec_get_3adm_status() && (getuid() || geteuid())){ + if (nullptr != m_wlanWidget) { + m_wlanWidget->hideSetting(); + } + if (nullptr != m_lanWidget) { + m_lanWidget->hideSetting(); + } + } +#endif + } /** diff --git a/src/frontend/mainwindow.h b/src/frontend/mainwindow.h index 93e3e4b4..95ccf4a6 100644 --- a/src/frontend/mainwindow.h +++ b/src/frontend/mainwindow.h @@ -16,6 +16,11 @@ #include "netdetails/netdetail.h" #include +#ifdef WITHKYSEC +#include +#include +#endif + enum IconActiveType { NOT_CONNECTED = 0, LAN_CONNECTED, diff --git a/src/frontend/tab-pages/tabpage.h b/src/frontend/tab-pages/tabpage.h index 7be11d55..a4a3a981 100644 --- a/src/frontend/tab-pages/tabpage.h +++ b/src/frontend/tab-pages/tabpage.h @@ -64,6 +64,12 @@ public: // QString getDefaultDevice(); static void showDesktopNotify(const QString &message); + void hideSetting() { + if (nullptr != m_settingsFrame && m_settingsFrame->isVisible()) { + m_settingsFrame->hide(); + } + } + signals: void deviceStatusChanged(); void deviceNameChanged(QString oldName, QString newName, int type); @@ -105,6 +111,8 @@ protected: QComboBox * m_deviceComboBox = nullptr; QLabel * m_tipsLabel = nullptr; + + public slots: virtual void onDeviceComboxIndexChanged(int currentIndex) = 0; void onPaletteChanged(); diff --git a/src/src.pro b/src/src.pro index 08d5a271..407a9c6f 100644 --- a/src/src.pro +++ b/src/src.pro @@ -35,7 +35,7 @@ INSTALLS += target \ # any feature of Qt which has been marked as deprecated (the exact warnings # depend on your compiler). Please consult the documentation of the # deprecated API in order to know how to port your code away from it. -DEFINES += QT_DEPRECATED_WARNINGS +DEFINES += QT_DEPRECATED_WARNINGS WITHKYSEC # You can also make your code fail to compile if you use deprecated APIs. # In order to do so, uncomment the following line. From e4f19eab4781c8005c03b05f46f0359e77fceabc Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Mon, 9 May 2022 16:08:46 +0800 Subject: [PATCH 3/4] fix --- src/frontend/mainwindow.cpp | 8 +++++++- src/frontend/tab-pages/tabpage.h | 11 ++++++++++- src/src.pro | 2 +- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/src/frontend/mainwindow.cpp b/src/frontend/mainwindow.cpp index 056421bb..1372a8ff 100644 --- a/src/frontend/mainwindow.cpp +++ b/src/frontend/mainwindow.cpp @@ -11,7 +11,6 @@ #include "../backend/dbus-interface/kylinagentinterface.h" - #define MAINWINDOW_WIDTH 420 #define MAINWINDOW_HEIGHT 476 #define LAYOUT_MARGINS 0,0,0,0 @@ -63,6 +62,13 @@ void MainWindow::showMainwindow() if (nullptr != m_lanWidget) { m_lanWidget->hideSetting(); } + } else { + if (nullptr != m_wlanWidget) { + m_wlanWidget->showSetting(); + } + if (nullptr != m_lanWidget) { + m_lanWidget->showSetting(); + } } #endif diff --git a/src/frontend/tab-pages/tabpage.h b/src/frontend/tab-pages/tabpage.h index a4a3a981..d8bd8712 100644 --- a/src/frontend/tab-pages/tabpage.h +++ b/src/frontend/tab-pages/tabpage.h @@ -65,8 +65,17 @@ public: static void showDesktopNotify(const QString &message); void hideSetting() { - if (nullptr != m_settingsFrame && m_settingsFrame->isVisible()) { + if (nullptr != m_settingsFrame) { m_settingsFrame->hide(); + m_inactivatedNetDivider->hide(); + m_inactivatedNetFrame->setMinimumHeight(INACTIVE_AREA_MIN_HEIGHT + 100); + } + } + void showSetting() { + if (nullptr != m_settingsFrame) { + m_inactivatedNetFrame->setMinimumHeight(INACTIVE_AREA_MIN_HEIGHT); + m_settingsFrame->show(); + m_inactivatedNetDivider->show(); } } diff --git a/src/src.pro b/src/src.pro index 407a9c6f..603befdd 100644 --- a/src/src.pro +++ b/src/src.pro @@ -18,7 +18,7 @@ PKGCONFIG +=gio-2.0 glib-2.0 gio-unix-2.0 libnm libnma libsecret-1 gtk+-3.0 gset INCLUDEPATH += /usr/include/KF5/NetworkManagerQt -LIBS += -L/usr/lib/ -lgsettings-qt -lX11 -lKF5NetworkManagerQt -lukui-log4qt -lukui-com4c -lukui-com4cxx +LIBS += -L/usr/lib/ -lgsettings-qt -lX11 -lKF5NetworkManagerQt -lukui-log4qt -lukui-com4c -lukui-com4cxx -lkysec #LIBS += -lkysec target.path = /usr/bin target.source += $$TARGET From 09c93bebed35118cb9fc86b936caa31a7f7470f1 Mon Sep 17 00:00:00 2001 From: jzxc95 <907297917@qq.com> Date: Mon, 9 May 2022 16:16:20 +0800 Subject: [PATCH 4/4] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BE=9D=E8=B5=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- debian/control | 1 + 1 file changed, 1 insertion(+) diff --git a/debian/control b/debian/control index e2b2fab6..2dc9eaa8 100644 --- a/debian/control +++ b/debian/control @@ -25,6 +25,7 @@ Build-Depends: debhelper (>=9), libukui-log4qt-dev, libkysdk-qtwidgets-dev, libukui-common-dev, + libkysec-dev, Standards-Version: 4.5.0 Rules-Requires-Root: no Homepage: https://github.com/ukui/kylin-nm