feature(audio&network):Add labels to volume and network plugins to support automated testing
fix(network):Temporarily do not overwrite the NetworkManager configuration and optimize the code - 音量和网络插件新增accessiblename,以支持自动化测试 暂时不覆盖NetworkManager配置,优化代码
This commit is contained in:
parent
c878ccf469
commit
5be6c84b4a
1227
0001-feature-audio-network-Add-labels-to-volume-and-netwo.patch
Normal file
1227
0001-feature-audio-network-Add-labels-to-volume-and-netwo.patch
Normal file
File diff suppressed because it is too large
Load Diff
246
0002-fix-network-Temporarily-do-not-overwrite-the-Network.patch
Normal file
246
0002-fix-network-Temporarily-do-not-overwrite-the-Network.patch
Normal file
@ -0,0 +1,246 @@
|
||||
From a06103989392882b5693a310b1e1540b5a998af0 Mon Sep 17 00:00:00 2001
|
||||
From: luoqing <luoqing@kylinsec.com.cn>
|
||||
Date: Thu, 25 Aug 2022 19:28:58 +0800
|
||||
Subject: [PATCH 2/2] fix(network):Temporarily do not overwrite the
|
||||
NetworkManager configuration and optimize the code
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 暂时不覆盖NetworkManager配置,优化代码
|
||||
---
|
||||
plugins/network/CMakeLists.txt | 2 +-
|
||||
plugins/network/src/tray/network-tray.cpp | 25 ++++++++++++++---------
|
||||
plugins/network/src/tray/tray-page.cpp | 25 +++++++++++++++--------
|
||||
plugins/network/src/tray/tray-page.h | 7 +++----
|
||||
plugins/network/src/tray/tray-page.ui | 3 +++
|
||||
plugins/network/src/utils.cpp | 0
|
||||
plugins/network/src/utils.h | 0
|
||||
7 files changed, 38 insertions(+), 24 deletions(-)
|
||||
create mode 100644 plugins/network/src/utils.cpp
|
||||
create mode 100644 plugins/network/src/utils.h
|
||||
|
||||
diff --git a/plugins/network/CMakeLists.txt b/plugins/network/CMakeLists.txt
|
||||
index 02dbe3a..802c52f 100644
|
||||
--- a/plugins/network/CMakeLists.txt
|
||||
+++ b/plugins/network/CMakeLists.txt
|
||||
@@ -117,7 +117,7 @@ SET(link_target ${CMAKE_CURRENT_BINARY_DIR}/${TARGET_NAME}-link.desktop)
|
||||
|
||||
set(NETWORK_SERVER_CONF /etc/NetworkManager/conf.d)
|
||||
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/data/00-server.conf.in ${CMAKE_CURRENT_BINARY_DIR}/00-server.conf @ONLY)
|
||||
-install(FILES ${CMAKE_CURRENT_BINARY_DIR}/00-server.conf DESTINATION ${NETWORK_SERVER_CONF}/)
|
||||
+# install(FILES ${CMAKE_CURRENT_BINARY_DIR}/00-server.conf DESTINATION ${NETWORK_SERVER_CONF}/)
|
||||
|
||||
#安装插件和二进制文件
|
||||
install(TARGETS ${TARGET_NAME} DESTINATION ${PLUGIN_LIBS_INSTALL_DIR}/)
|
||||
diff --git a/plugins/network/src/tray/network-tray.cpp b/plugins/network/src/tray/network-tray.cpp
|
||||
index 232882b..a282cf9 100644
|
||||
--- a/plugins/network/src/tray/network-tray.cpp
|
||||
+++ b/plugins/network/src/tray/network-tray.cpp
|
||||
@@ -15,6 +15,7 @@
|
||||
#include "network-tray.h"
|
||||
#include <qt5-log-i.h>
|
||||
#include <style-palette.h>
|
||||
+#include <NetworkManagerQt/Settings>
|
||||
#include <QMenu>
|
||||
#include <QPainter>
|
||||
#include <QPainterPath>
|
||||
@@ -47,6 +48,8 @@ void NetworkTray::init()
|
||||
initUI();
|
||||
initMenu();
|
||||
initConnect();
|
||||
+
|
||||
+ NetworkManager::Connection::List listConnections();
|
||||
}
|
||||
|
||||
void NetworkTray::initUI()
|
||||
@@ -127,6 +130,7 @@ void NetworkTray::initConnect()
|
||||
} });
|
||||
|
||||
connect(notifier(), &Notifier::deviceRemoved, this, &NetworkTray::handleDeviceRemoved);
|
||||
+
|
||||
connect(notifier(), &Notifier::statusChanged, this, &NetworkTray::handleNetworkManagerStatusChanged);
|
||||
|
||||
connect(notifier(), &Notifier::primaryConnectionChanged, this, &NetworkTray::handlePrimaryConnectionChanged);
|
||||
@@ -152,6 +156,7 @@ void NetworkTray::initTrayIcon()
|
||||
{
|
||||
m_systemTray = new QSystemTrayIcon();
|
||||
setTrayIcon(NetworkManager::status());
|
||||
+ KLOG_DEBUG() << " NetworkManager::status():" << NetworkManager::status();
|
||||
m_systemTray->show();
|
||||
}
|
||||
|
||||
@@ -187,9 +192,8 @@ void NetworkTray::getAvailableDeviceList()
|
||||
KLOG_DEBUG() << "dev->interfaceName():" << dev->interfaceName();
|
||||
KLOG_DEBUG() << "dev->state():" << dev->state();
|
||||
KLOG_DEBUG() << "dev->isValid():" << dev->isValid();
|
||||
+ KLOG_DEBUG() << "dev->managed():" << dev->managed();
|
||||
|
||||
- if (dev->state() == Device::Unavailable)
|
||||
- continue;
|
||||
if (dev->state() == Device::Unmanaged)
|
||||
continue;
|
||||
|
||||
@@ -317,21 +321,24 @@ void NetworkTray::setTrayIcon(NetworkManager::Status status)
|
||||
// int signalStrength = wirelessNetwork->signalStrength();
|
||||
|
||||
m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wireless-4.svg"));
|
||||
+ KLOG_DEBUG() << "setIcon kcp-network-images/wireless-4.svg";
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-connection.svg"));
|
||||
+ KLOG_DEBUG() << "setIcon kcp-network-images/wireless-connection.svg";
|
||||
}
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- // 可用
|
||||
- m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-connection.svg"));
|
||||
}
|
||||
}
|
||||
- else if (status == NetworkManager::Status::Disconnecting || NetworkManager::Status::Connecting)
|
||||
+ else if ((status == NetworkManager::Status::Disconnecting) || (status == NetworkManager::Status::Connecting))
|
||||
{
|
||||
// TODO:加载动画
|
||||
+ KLOG_DEBUG() << "setIcon null";
|
||||
}
|
||||
else
|
||||
{
|
||||
m_systemTray->setIcon(trayIconColorSwitch(":/kcp-network-images/wired-disconnected.svg"));
|
||||
+ KLOG_DEBUG() << "setIcon kcp-network-images/wireless-disconnected.svg";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -396,8 +403,6 @@ void NetworkTray::handleDeviceManagedChanged()
|
||||
* XXX:由于在禁用和开启wifi时,并没有发出Wireless设备的deviceRemoved和deviceAdded信号
|
||||
* 并且当WirelessEnabledChanged信号发送时,device state 还处在unavailbel 不可用状态,需要处理
|
||||
*/
|
||||
-
|
||||
-// TODO:托盘对不可用状态进行提示
|
||||
void NetworkTray::handleWirelessEnabledChanged(bool enable)
|
||||
{
|
||||
KLOG_DEBUG() << "-----------------------handleWirelessEnabledChanged:" << enable;
|
||||
diff --git a/plugins/network/src/tray/tray-page.cpp b/plugins/network/src/tray/tray-page.cpp
|
||||
index c854d36..fd986fd 100644
|
||||
--- a/plugins/network/src/tray/tray-page.cpp
|
||||
+++ b/plugins/network/src/tray/tray-page.cpp
|
||||
@@ -35,28 +35,33 @@ void TrayPage::init()
|
||||
{
|
||||
if (m_deviceList.count() != 0)
|
||||
{
|
||||
- Device::Type deviceType = m_deviceList.value(0)->type();
|
||||
- initUI(deviceType);
|
||||
+ initUI();
|
||||
initConnection();
|
||||
}
|
||||
}
|
||||
|
||||
// XXX:修改初始化
|
||||
-void TrayPage::initUI(Device::Type deviceType)
|
||||
+void TrayPage::initUI()
|
||||
{
|
||||
setFixedWidth(240);
|
||||
setMaximumHeight(434);
|
||||
ui->stackedWidget->setContentsMargins(0, 0, 0, 0);
|
||||
|
||||
// if (m_deviceList.count() > 1)
|
||||
- // setMultiDeviceWidget(deviceType);
|
||||
+ // setMultiDeviceWidget();
|
||||
// else if (m_deviceList.count() == 1)
|
||||
// {
|
||||
- // setSingleDeviceWidget(deviceType);
|
||||
+ // setSingleDeviceWidget();
|
||||
// }
|
||||
+ // else
|
||||
+ // {
|
||||
+ // // m_deviceeList.count == 0
|
||||
+ // return;
|
||||
+ // }
|
||||
+
|
||||
if (m_deviceList.count() != 0)
|
||||
{
|
||||
- setMultiDeviceWidget(deviceType);
|
||||
+ setMultiDeviceWidget();
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -69,12 +74,13 @@ void TrayPage::initConnection()
|
||||
{
|
||||
}
|
||||
|
||||
-void TrayPage::setMultiDeviceWidget(Device::Type deviceType)
|
||||
+void TrayPage::setMultiDeviceWidget()
|
||||
{
|
||||
for (Device::Ptr dev : m_deviceList)
|
||||
{
|
||||
QString devicePath = dev->uni();
|
||||
QString deviceName = dev->interfaceName();
|
||||
+ Device::Type deviceType = dev->type();
|
||||
ui->deviceComboBox->addItem(deviceName, devicePath);
|
||||
|
||||
if (deviceType == Device::Ethernet)
|
||||
@@ -111,10 +117,11 @@ void TrayPage::setMultiDeviceWidget(Device::Type deviceType)
|
||||
ui->selectDevicewidget->setVisible(true);
|
||||
}
|
||||
|
||||
-void TrayPage::setSingleDeviceWidget(Device::Type deviceType)
|
||||
+void TrayPage::setSingleDeviceWidget()
|
||||
{
|
||||
ui->selectDevicewidget->setVisible(false);
|
||||
- QString devicePath = m_deviceList.at(0)->uni();
|
||||
+ QString devicePath = m_deviceList.value(0)->uni();
|
||||
+ Device::Type deviceType = m_deviceList.value(0)->type();
|
||||
if (deviceType == Device::Ethernet)
|
||||
{
|
||||
WiredTrayWidget *wiredTrayWidget = new WiredTrayWidget(devicePath, this);
|
||||
diff --git a/plugins/network/src/tray/tray-page.h b/plugins/network/src/tray/tray-page.h
|
||||
index 20cacd0..d49e670 100644
|
||||
--- a/plugins/network/src/tray/tray-page.h
|
||||
+++ b/plugins/network/src/tray/tray-page.h
|
||||
@@ -24,7 +24,6 @@ class TrayPage;
|
||||
}
|
||||
QT_END_NAMESPACE
|
||||
|
||||
-
|
||||
class TrayPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -34,11 +33,11 @@ public:
|
||||
~TrayPage() override;
|
||||
|
||||
void init();
|
||||
- void initUI(NetworkManager::Device::Type deviceType);
|
||||
+ void initUI();
|
||||
void initConnection();
|
||||
|
||||
- void setMultiDeviceWidget(NetworkManager::Device::Type deviceType);
|
||||
- void setSingleDeviceWidget(NetworkManager::Device::Type deviceType);
|
||||
+ void setMultiDeviceWidget();
|
||||
+ void setSingleDeviceWidget();
|
||||
QStringList devicePathList();
|
||||
|
||||
public slots:
|
||||
diff --git a/plugins/network/src/tray/tray-page.ui b/plugins/network/src/tray/tray-page.ui
|
||||
index f922c84..7a089ca 100644
|
||||
--- a/plugins/network/src/tray/tray-page.ui
|
||||
+++ b/plugins/network/src/tray/tray-page.ui
|
||||
@@ -31,6 +31,9 @@
|
||||
<property name="windowTitle">
|
||||
<string>TrayPage</string>
|
||||
</property>
|
||||
+ <property name="styleSheet">
|
||||
+ <string notr="true"/>
|
||||
+ </property>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
diff --git a/plugins/network/src/utils.cpp b/plugins/network/src/utils.cpp
|
||||
new file mode 100644
|
||||
index 0000000..e69de29
|
||||
diff --git a/plugins/network/src/utils.h b/plugins/network/src/utils.h
|
||||
new file mode 100644
|
||||
index 0000000..e69de29
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
Name: kiran-control-panel
|
||||
Version: 2.3.4
|
||||
Release: 8
|
||||
Release: 9
|
||||
Summary: Kiran Control Panel
|
||||
Summary(zh_CN): Kiran桌面控制面板
|
||||
|
||||
@ -23,6 +23,8 @@ Patch0013: 0005-fix-network-fix-invalid-configuration-created-for-th.patch
|
||||
Patch0014: 0006-fix-network-only-L2TP-type-is-supported-temporary-an.patch
|
||||
Patch0015: 0007-feature-network-update-translations.patch
|
||||
Patch0016: 0001-feat-accessibleName-updates-accessiblename.patch
|
||||
Patch0017: 0001-feature-audio-network-Add-labels-to-volume-and-netwo.patch
|
||||
Patch0018: 0002-fix-network-Temporarily-do-not-overwrite-the-Network.patch
|
||||
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
@ -65,6 +67,9 @@ Requires: zeromq
|
||||
Requires: libnotify
|
||||
Requires: pam
|
||||
|
||||
Requires: NetworkManager-l2tp
|
||||
#Requires: NetworkManager-pptp
|
||||
|
||||
Obsoletes: kiran-cpanel-account
|
||||
Obsoletes: kiran-cpanel-appearance
|
||||
Obsoletes: kiran-cpanel-display
|
||||
@ -75,8 +80,6 @@ Obsoletes: kiran-cpanel-power
|
||||
Obsoletes: kiran-cpanel-system
|
||||
Obsoletes: kiran-cpanel-timedate
|
||||
|
||||
#Requires: NetworkManager-pptp
|
||||
#Requires: NetworkManager-l2tp
|
||||
|
||||
%description
|
||||
Kiran Control Panel
|
||||
@ -145,7 +148,7 @@ make %{?_smp_mflags}
|
||||
#network
|
||||
%{_sysconfdir}/xdg/autostart/kiran-network-status-icon.desktop
|
||||
%{_bindir}/kiran-network-status-icon
|
||||
/etc/NetworkManager/conf.d/00-server.conf
|
||||
# /etc/NetworkManager/conf.d/00-server.conf
|
||||
|
||||
#display
|
||||
%{_datadir}/kiran-cpanel-display/translations/*
|
||||
@ -183,6 +186,10 @@ make %{?_smp_mflags}
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%changelog
|
||||
* Thu Aug 25 2022 luoqing <luoqing@kylinsec.com.cn> - 2.3.4-9
|
||||
- KYOS-F: Add labels to volume and network plugins to support automated testing
|
||||
- KYOS-F: Temporarily do not overwrite the NetworkManager configuration and optimize the code
|
||||
|
||||
* Thu Aug 25 2022 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.3.4-8
|
||||
- KYOS-F: updates accessiblename,support automated testing
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user