!126 v2.6版本发布:音量优化、网络优化、字体设置功能优化、系统信息UI优化、新增media-keys快捷键、自启动应用管理、默认应用管理

From: @niko_yhc 
Reviewed-by: @liubuguiii 
Signed-off-by: @liubuguiii
This commit is contained in:
openeuler-ci-bot 2024-01-18 03:15:47 +00:00 committed by Gitee
commit 507835f3fb
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
22 changed files with 10167 additions and 2495 deletions

View File

@ -0,0 +1,32 @@
From 558754678f0a34d1e624dcc9c17b583bc05d4d80 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Tue, 12 Dec 2023 20:26:29 +0800
Subject: [PATCH] fix(pkgconfig): Fix the issue of incorrect content in the PC
file provided by pkgconfig
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复提供的pkgconfig配置内容缺失的问题
---
data/kiran-control-panel.pc.in | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/data/kiran-control-panel.pc.in b/data/kiran-control-panel.pc.in
index de3ae6b..1e50a0d 100644
--- a/data/kiran-control-panel.pc.in
+++ b/data/kiran-control-panel.pc.in
@@ -1,7 +1,7 @@
-includedir=@KCP_INSTALL_INCLUDE@
+includedir=@KCP_INCLUDEDIR@
-category_desktop_location=@CATEGORY_DESKTOP_INSTALL_DIR@
-category_icon_location=@CATEGORY_ICON_INSTALL_DIR@
+category_desktop_location=@CATEGORY_DESKTOP_DIR@
+category_icon_location=@CATEGORY_ICON_DIR@
plugin_location=@PLUGIN_LIBS_DIR@
plugin_desktop_location=@PLUGIN_DESKTOP_DIR@
--
2.27.0

File diff suppressed because it is too large Load Diff

View File

@ -1,121 +0,0 @@
From c3f02b61332c2cbac185e0306ff2583f639e5ca8 Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Tue, 22 Aug 2023 15:57:19 +0800
Subject: [PATCH 1/5] fix(network):After receiving the Connection::Update
signal from an active connection, the connection is no longer automatically
reactivated
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 收到已激活的连接的更新信号Connection::Update后不再自动重新激活连接
Related #13231
---
.../src/plugin/manager/wired-manager.cpp | 69 +++++++++----------
1 file changed, 32 insertions(+), 37 deletions(-)
diff --git a/plugins/network/src/plugin/manager/wired-manager.cpp b/plugins/network/src/plugin/manager/wired-manager.cpp
index ffe33b3..32ac227 100644
--- a/plugins/network/src/plugin/manager/wired-manager.cpp
+++ b/plugins/network/src/plugin/manager/wired-manager.cpp
@@ -91,27 +91,34 @@ void WiredManager::handleActivateSelectedConnection(const QString &connectionPat
auto devicestate = device->state();
KLOG_DEBUG() << "device state:" << devicestate ;
- if(devicestate != Device::Unavailable)
+ if(devicestate == Device::Unavailable)
{
- QDBusPendingReply<QDBusObjectPath> reply =
- NetworkManager::activateConnection(connectionPath, m_devicePath, connectionParameter);
+ StatusNotification::connectitonFailedNotifyByReason(tr("The current device is not available"));
+ return;
+ }
- reply.waitForFinished();
- if (reply.isError())
+ QDBusPendingReply<QDBusObjectPath> reply =
+ NetworkManager::activateConnection(connectionPath, m_devicePath, connectionParameter);
+
+ reply.waitForFinished();
+ if (reply.isError())
+ {
+ // 此处处理进入激活流程失败的原因,并不涉及流程中某个具体阶段失败的原因
+ KLOG_ERROR() << "activate connection failed:" << reply.error();
+ QString errorMessage = reply.error().message();
+ if (errorMessage.contains("device has no carrier"))
{
- // 此处处理进入激活流程失败的原因,并不涉及流程中某个具体阶段失败的原因
- KLOG_ERROR() << "activate connection failed:" << reply.error();
- QString errorMessage = reply.error().message();
- if (errorMessage.contains("device has no carrier"))
- StatusNotification::connectitonFailedNotifyByReason(tr("The carrier is pulled out"));
- else
- StatusNotification::connectitonFailedNotify(connectionPath);
+ StatusNotification::connectitonFailedNotifyByReason(tr("The carrier is pulled out"));
}
else
- KLOG_DEBUG() << "activateConnection reply:" << reply.reply();
+ {
+ StatusNotification::connectitonFailedNotify(connectionPath);
+ }
}
else
- StatusNotification::connectitonFailedNotifyByReason(tr("The current device is not available"));
+ {
+ KLOG_DEBUG() << "activateConnection reply:" << reply.reply();
+ }
}
// 获取到当前激活对象后,开启等待动画,判断完激活状态后停止等待动画
@@ -141,7 +148,7 @@ void WiredManager::handleActiveConnectionAdded(const QString &path)
break;
}
}
- connect(activatedConnection.data(), &ActiveConnection::stateChanged, this, &WiredManager::handleActiveConnectionStateChanged);
+ connect(activatedConnection.data(), &ActiveConnection::stateChanged, this, &WiredManager::handleActiveConnectionStateChanged, Qt::UniqueConnection);
}
}
@@ -214,28 +221,16 @@ void WiredManager::handleConnectionUpdated(const QString &path)
{
KLOG_DEBUG() << "Connection updated:" << path;
Connection::Ptr updateConnection = findConnection(path);
- if (updateConnection->settings()->connectionType() == ConnectionSettings::Wired)
+ if (updateConnection->settings()->connectionType() != ConnectionSettings::Wired)
{
- //移除后再加载进来以更新信息
- ui->connectionShowPage->removeConnectionFromList(path);
- ui->connectionShowPage->addConnection(updateConnection, "");
- if (ui->stackedWidget->currentIndex() != PAGE_SETTING)
- handleReturnPreviousPage();
-
- QString updateConnectionPath = updateConnection->path();
- ActiveConnection::List activeConnectionLists = activeConnections();
- //已连接的网络的配置被修改后,点击保存 ,应该重新连接网络,以使配置生效
- for (auto activeConn : activeConnectionLists)
- {
- if (activeConn->connection()->path() == updateConnectionPath)
- {
- auto deviceLists = activeConn->devices();
- if (deviceLists.contains(m_devicePath))
- {
- QDBusPendingReply<> reply = NetworkManager::deactivateConnection(activeConn->connection()->path());
- handleActivateSelectedConnection(updateConnectionPath, "");
- }
- }
- }
+ return;
+ }
+
+ //移除后再加载进来以更新信息
+ ui->connectionShowPage->removeConnectionFromList(path);
+ ui->connectionShowPage->addConnection(updateConnection, "");
+ if (ui->stackedWidget->currentIndex() != PAGE_SETTING)
+ {
+ handleReturnPreviousPage();
}
}
--
2.33.0

View File

@ -1,63 +0,0 @@
From 8468d6df5794ede71a39905e2d31f4cadda244b7 Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Wed, 23 Aug 2023 11:11:09 +0800
Subject: [PATCH 2/5] feature(display):When switching resolutions, refresh rate
preferentially selects the recommended refresh rate
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 切换分辨率时,刷新率优先选择推荐的刷新率
Related #13283
---
plugins/display/src/display-page.cpp | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/plugins/display/src/display-page.cpp b/plugins/display/src/display-page.cpp
index a885b8b..23b5e8e 100644
--- a/plugins/display/src/display-page.cpp
+++ b/plugins/display/src/display-page.cpp
@@ -263,22 +263,35 @@ void DisplayPage::initExtraComboBoxRefreshRate(QComboBox *comboBox, const QList<
{
comboBox->clear();
- QString recommend;
QList<DisplayModesStu> list = m_displayConfig->listPreferredModes(m_curMonitorPath);
+ double recommendRefreshRate;
if (!list.isEmpty())
{
- double refreshRate = list.first().refreshRate;
- recommend = QString("%1HZ").arg(QString::asprintf("%.2f", refreshRate));
+ recommendRefreshRate = list.first().refreshRate;
}
+ QString strPostfix = tr(" (recommended)");
QList<double> t_refreshRateList = refreshRateList;
std::sort(t_refreshRateList.begin(), t_refreshRateList.end(), std::greater<double>());
foreach (double r, t_refreshRateList)
{
QString text = QString("%1HZ").arg(QString::asprintf("%.2f", r));
- if (text == recommend) text += tr(" (recommended)");
+ if (QString::asprintf("%.2f", r) == QString::asprintf("%.2f", recommendRefreshRate))
+ {
+ text.append(strPostfix);
+ }
comboBox->addItem(text, r);
}
+
+ for (size_t i = 0; i < comboBox->count(); i++)
+ {
+ double refreshRate = comboBox->itemData(i).toDouble();
+ if(QString::asprintf("%.2f", refreshRate) == QString::asprintf("%.2f", recommendRefreshRate))
+ {
+ comboBox->setCurrentIndex(i);
+ break;
+ }
+ }
}
void DisplayPage::selectResolutionComboboxItem(QComboBox *comboBox, const int &w, const int &h)
--
2.33.0

View File

@ -0,0 +1,93 @@
From 18e6891a56f471168cbe964c61c134f6d2aeb90d Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Fri, 15 Dec 2023 21:06:06 +0800
Subject: [PATCH] fix(plugins): Fix runtime plugin loading errors
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复运行时插件加载错误,补全相关依赖
---
CMakeLists.txt | 2 +-
common/plugin-subitem.h | 4 ++--
plugins/account/CMakeLists.txt | 12 +++++++++---
3 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 4fe9765..07a668d 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -102,4 +102,4 @@ add_subdirectory(lib)
add_subdirectory(libexec)
add_subdirectory(launcher)
add_subdirectory(plugins)
-add_subdirectory(data)
\ No newline at end of file
+add_subdirectory(data)
diff --git a/common/plugin-subitem.h b/common/plugin-subitem.h
index f6f6287..1315fda 100644
--- a/common/plugin-subitem.h
+++ b/common/plugin-subitem.h
@@ -32,7 +32,7 @@ public:
m_pCreateWidget(func)
{
}
- ~PluginSubItem();
+ ~PluginSubItem(){};
public:
// 功能项ID,用于区分功能项,应确保其唯一
@@ -72,4 +72,4 @@ private:
QString m_icon;
int m_weight;
CreateWidgetFunc m_pCreateWidget = nullptr;
-};
\ No newline at end of file
+};
diff --git a/plugins/account/CMakeLists.txt b/plugins/account/CMakeLists.txt
index 98c5383..586c6c8 100644
--- a/plugins/account/CMakeLists.txt
+++ b/plugins/account/CMakeLists.txt
@@ -5,6 +5,8 @@ if (PASSWD_EXPIRATION_POLICY_VISIBLE)
endif ()
pkg_search_module(CRYPTOPP REQUIRED cryptopp)
+pkg_search_module(PAM REQUIRED pam)
+pkg_search_module(LIBCRYPT REQUIRED libcrypt)
file(GLOB_RECURSE ACCOUNT_SRC
${CMAKE_CURRENT_SOURCE_DIR}/*.cpp
@@ -22,11 +24,13 @@ target_include_directories(${TARGET_NAME} PRIVATE
${CMAKE_BINARY_DIR}
${CMAKE_CURRENT_SOURCE_DIR}/pages
${CMAKE_CURRENT_SOURCE_DIR}/utils
+ ${PAM_INCLUDE_DIRS}
${KIRAN_WIDGETS_INCLUDE_DIRS}
${KIRAN_CC_DAEMON_INCLUDE_DIRS}
${KLOG_INCLUDE_DIRS}
${KIRAN_STYLE_INCLUDE_DIRS}
- ${CRYPTOPP_INCLUDE_DIRS})
+ ${CRYPTOPP_INCLUDE_DIRS}
+ ${LIBCRYPT_INCLUDE_DIRS})
target_link_libraries(${TARGET_NAME}
common-widgets
@@ -34,10 +38,12 @@ target_link_libraries(${TARGET_NAME}
Qt5::Widgets
Qt5::DBus
Qt5::Svg
+ ${PAM_LIBRARIES}
${KIRAN_WIDGETS_LIBRARIES}
${KIRAN_CC_DAEMON_LIBRARIES}
${KLOG_LIBRARIES}
${KIRAN_STYLE_LIBRARIES}
- ${CRYPTOPP_LIBRARIES})
+ ${CRYPTOPP_LIBRARIES}
+ ${LIBCRYPT_LIBRARIES})
-install(TARGETS ${TARGET_NAME} DESTINATION ${PLUGIN_LIBS_DIR}/)
\ No newline at end of file
+install(TARGETS ${TARGET_NAME} DESTINATION ${PLUGIN_LIBS_DIR}/)
--
2.27.0

View File

@ -1,29 +0,0 @@
From 22d4318174acee6af3008fe648f7b8fdf96404cb Mon Sep 17 00:00:00 2001
From: yuanxing <yuanxing@kylinsec.com.cn>
Date: Fri, 25 Aug 2023 10:49:36 +0800
Subject: [PATCH 3/5] fix(wallpaper):change system wallpaper xml path to kiran
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修改获取的系统壁纸xml文件路径为kiran
---
plugins/appearance/src/pages/wallpaper/wallpaper-def.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/plugins/appearance/src/pages/wallpaper/wallpaper-def.h b/plugins/appearance/src/pages/wallpaper/wallpaper-def.h
index d27c921..adefaf9 100644
--- a/plugins/appearance/src/pages/wallpaper/wallpaper-def.h
+++ b/plugins/appearance/src/pages/wallpaper/wallpaper-def.h
@@ -30,7 +30,7 @@ enum WallpaperType
#define SYSTEM_BACKGROUND_PATH "/usr/share/backgrounds/kiran/"
#define LOCAL_WALLPAPER_FILE ".config/kylinsec/kiran-cpanel-appearance/wallpaper.xml"
-#define SYSTEM_WALLPAPER_FILE "/usr/share/mate-background-properties/kiran_background.xml"
+#define SYSTEM_WALLPAPER_FILE "/usr/share/kiran-background-properties/kiran_background.xml"
#define CACHE_IMAGE_DIR ".config/kylinsec/kiran-cpanel-appearance/"
#define FILENAME "filename"
--
2.33.0

View File

@ -1,44 +0,0 @@
From ae26631a045b39aeb760ada4c1cfd98783599fda Mon Sep 17 00:00:00 2001
From: yuanxing <yuanxing@kylinsec.com.cn>
Date: Fri, 25 Aug 2023 13:47:13 +0800
Subject: [PATCH 4/5] fix(wallpaper):don't call xmlWriter if system background
xml not exists to solve segmentation fault
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 当系统系统壁纸xml文件不存在时不调用xmlWriter函数防止段错误
---
.../wallpaper/widget/xml-management/xml-management.cpp | 9 +++++++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/plugins/appearance/src/pages/wallpaper/widget/xml-management/xml-management.cpp b/plugins/appearance/src/pages/wallpaper/widget/xml-management/xml-management.cpp
index 8d174ab..385eb9e 100644
--- a/plugins/appearance/src/pages/wallpaper/widget/xml-management/xml-management.cpp
+++ b/plugins/appearance/src/pages/wallpaper/widget/xml-management/xml-management.cpp
@@ -38,8 +38,8 @@ void XmlManagement::loadXmlFiles()
if (!file.exists())
{
KLOG_DEBUG() << "local xml file no exist";
- xmlReader(SYSTEM_WALLPAPER_FILE);
- xmlWriter();
+ if (xmlReader(SYSTEM_WALLPAPER_FILE))
+ xmlWriter();
}
xmlReader(localFile);
}
@@ -209,6 +209,11 @@ void XmlManagement::xmlUpdate(QList<QMap<QString, QString>> updateList)
{
QString localFile = QString("%1/%2").arg(QDir::homePath()).arg(LOCAL_WALLPAPER_FILE);
QFile file(localFile);
+ if (!file.exists())
+ {
+ KLOG_DEBUG() << localFile << " doesn't exists!";
+ return;
+ }
if (!file.open(QFile::WriteOnly | QFile::Text))
{
KLOG_DEBUG() << "open " << localFile << " failed!";
--
2.33.0

View File

@ -1,129 +0,0 @@
From 766a1ac3345852e3f95a005bd6ef2469ab9f1dd9 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Mon, 28 Aug 2023 19:17:41 +0800
Subject: [PATCH 5/5] fix(account): Fixed issues related to creating and
deleting users in account management
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复账户管理创建删除用户中出现的相关问题
Closes #13994, #13990
---
plugins/account/src/kiran-account-manager.cpp | 15 ++++++---------
.../account/src/widgets/animation-push-button.cpp | 11 +++++++++++
.../account/src/widgets/animation-push-button.h | 1 +
.../account/src/widgets/avatar-item-button.cpp | 2 +-
plugins/account/src/widgets/mask-widget.cpp | 2 +-
5 files changed, 20 insertions(+), 11 deletions(-)
diff --git a/plugins/account/src/kiran-account-manager.cpp b/plugins/account/src/kiran-account-manager.cpp
index 01b4fbf..15653d9 100644
--- a/plugins/account/src/kiran-account-manager.cpp
+++ b/plugins/account/src/kiran-account-manager.cpp
@@ -109,14 +109,11 @@ void KiranAccountManager::appendSiderbarItem(const QString &userPath)
void KiranAccountManager::setDefaultSiderbarItem()
{
//设置默认侧边栏项
- if (m_tabList->count() > 1)
+ auto items = m_tabList->findItems(AccountsGlobalInfo::instance()->getCurrentUser(), Qt::MatchCaseSensitive);
+ if ( items.size() >= 1 )
{
- auto items = m_tabList->findItems(AccountsGlobalInfo::instance()->getCurrentUser(), Qt::MatchCaseSensitive);
- if (items.size() == 1)
- {
- auto item = items.at(0);
- m_tabList->setCurrentRow(m_tabList->row(item));
- }
+ auto item = items.at(0);
+ m_tabList->setCurrentRow(m_tabList->row(item));
}
else
{
@@ -128,7 +125,7 @@ void KiranAccountManager::initUI()
{
/* 遮罩,用于繁忙时屏蔽用户操作 */
m_maskWidget = new MaskWidget(this);
- m_maskWidget->setVisible(false);
+ m_maskWidget->setVisible(true);
/* 初始化界面主布局 */
auto contentLayout = new QHBoxLayout(this);
@@ -444,7 +441,7 @@ void KiranAccountManager::setMaskVisible(bool visible)
{
if (visible)
{
- this->stackUnder(m_maskWidget);
+ m_maskWidget->raise();
m_maskWidget->show();
}
else
diff --git a/plugins/account/src/widgets/animation-push-button.cpp b/plugins/account/src/widgets/animation-push-button.cpp
index 65791f0..d65b348 100644
--- a/plugins/account/src/widgets/animation-push-button.cpp
+++ b/plugins/account/src/widgets/animation-push-button.cpp
@@ -16,6 +16,7 @@
#include <QPropertyAnimation>
#include <QStyleOption>
#include <qt5-log-i.h>
+#include <QMouseEvent>
#include "animation-push-button.h"
@@ -85,6 +86,16 @@ void AnimationPushButton::paintEvent(QPaintEvent *event)
}
}
+void AnimationPushButton::mousePressEvent(QMouseEvent *e)
+{
+ if( m_isBusy )
+ {
+ e->ignore();
+ return;
+ }
+ QPushButton::mousePressEvent(e);
+}
+
void AnimationPushButton::initTimeLine()
{
m_timeLine.setCurrentTime(0);
diff --git a/plugins/account/src/widgets/animation-push-button.h b/plugins/account/src/widgets/animation-push-button.h
index 9a172e2..f39e9a4 100644
--- a/plugins/account/src/widgets/animation-push-button.h
+++ b/plugins/account/src/widgets/animation-push-button.h
@@ -38,6 +38,7 @@ private:
protected:
virtual void paintEvent(QPaintEvent *event) override;
+ virtual void mousePressEvent(QMouseEvent *e) override;
private:
bool m_isBusy = false;
diff --git a/plugins/account/src/widgets/avatar-item-button.cpp b/plugins/account/src/widgets/avatar-item-button.cpp
index a078974..a9e5a4b 100644
--- a/plugins/account/src/widgets/avatar-item-button.cpp
+++ b/plugins/account/src/widgets/avatar-item-button.cpp
@@ -106,7 +106,7 @@ void AvatarItemButton::paintEvent(QPaintEvent *event)
QPoint checkedIconLeftop((this->width() - checkedIconSize.width()) / 2,
(this->height() - checkedIconSize.height()) / 2);
QRect checkedIconRect(checkedIconLeftop, checkedIconSize);
- QSvgRenderer svgRenderer(QString(":/kcp-account/images/success-indicator.svg"));
+ QSvgRenderer svgRenderer(QString(":/kiran-control-panel/images/success-indicator.svg"));
svgRenderer.render(&painter, checkedIconRect);
}
}
diff --git a/plugins/account/src/widgets/mask-widget.cpp b/plugins/account/src/widgets/mask-widget.cpp
index 088fd48..476cbb3 100644
--- a/plugins/account/src/widgets/mask-widget.cpp
+++ b/plugins/account/src/widgets/mask-widget.cpp
@@ -41,5 +41,5 @@ bool MaskWidget::eventFilter(QObject *watched, QEvent *event)
break;
}
}
- return QObject::eventFilter(watched, event);
+ return QWidget::eventFilter(watched, event);
}
--
2.33.0

View File

@ -1,39 +0,0 @@
From 51ade1eede326506f4814081ac4141a97082ff53 Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Fri, 25 Aug 2023 14:15:36 +0800
Subject: [PATCH 1/2] feature(network):When the gateway setting item is
0.0.0.0, the gateway setting item is null
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 当网关设置项为“0.0.0.0”时,网关设置项置空
Related #13150
---
.../network/src/plugin/setting-widget/ipv4-widget.cpp | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
diff --git a/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp b/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp
index 63d029c..8c39794 100644
--- a/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp
+++ b/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp
@@ -162,7 +162,14 @@ void Ipv4Widget::showSettings()
ui->ipv4Address->setText(address);
ui->ipv4Netmask->setText(netmask);
- ui->ipv4Gateway->setText(gateway);
+ if(gateway != "0.0.0.0")
+ {
+ ui->ipv4Gateway->setText(gateway);
+ }
+ else
+ {
+ ui->ipv4Gateway->clear();
+ }
}
QString preferredDNS = "";
QString alternateDNS = "";
--
2.33.0

View File

@ -1,46 +0,0 @@
From 6e8923c8712ce9875863408d3bd695375d8e8973 Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Tue, 29 Aug 2023 15:21:50 +0800
Subject: [PATCH 2/2] fix(audio):Fix parsing error when json contains Chinese
characters
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复json中包含中文字符时的解析错误
Related #13261
---
plugins/audio/src/plugin/input-page.cpp | 2 +-
plugins/audio/src/plugin/output-page.cpp | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/plugins/audio/src/plugin/input-page.cpp b/plugins/audio/src/plugin/input-page.cpp
index 00826b4..8b0ecaa 100644
--- a/plugins/audio/src/plugin/input-page.cpp
+++ b/plugins/audio/src/plugin/input-page.cpp
@@ -202,7 +202,7 @@ void InputPage::initActivedPort()
KLOG_DEBUG() << "getPorts:" << getPorts;
//解析默认source的端口信息
QJsonParseError jsonParseError;
- QJsonDocument doc = QJsonDocument::fromJson(getPorts.value().toLatin1(), &jsonParseError);
+ QJsonDocument doc = QJsonDocument::fromJson(getPorts.value().toUtf8(), &jsonParseError);
if (!doc.isNull() && jsonParseError.error == QJsonParseError::NoError)
{
if (doc.isArray() && jsonParseError.error == QJsonParseError::NoError)
diff --git a/plugins/audio/src/plugin/output-page.cpp b/plugins/audio/src/plugin/output-page.cpp
index ef52165..420cf98 100644
--- a/plugins/audio/src/plugin/output-page.cpp
+++ b/plugins/audio/src/plugin/output-page.cpp
@@ -98,7 +98,7 @@ void OutputPage::initActivedPort()
//解析默认sink的端口信息
QJsonParseError jsonParseError;
- QJsonDocument doc = QJsonDocument::fromJson(getPorts.value().toLatin1(), &jsonParseError);
+ QJsonDocument doc = QJsonDocument::fromJson(getPorts.value().toUtf8(), &jsonParseError);
if (!doc.isNull() && jsonParseError.error == QJsonParseError::NoError)
{
if (doc.isArray() && jsonParseError.error == QJsonParseError::NoError)
--
2.33.0

View File

@ -1,153 +0,0 @@
From 2c6ae961ff33c45c9d9d7758715af3b52d2db052 Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Thu, 7 Sep 2023 19:21:39 +0800
Subject: [PATCH] fix(audio-tray):Fixed an issue where the volume tray icon did
not change with the volume after the default Sink was changed
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复默认Sink变更后音量托盘图标不随音量大小改变的问题
Closed #14124
---
.../src/system-tray/audio-system-tray.cpp | 27 +++++++++++--------
.../audio/src/system-tray/audio-system-tray.h | 1 -
.../src/system-tray/volume-setting-page.cpp | 2 ++
.../src/system-tray/volume-setting-page.h | 22 ++++++++-------
4 files changed, 30 insertions(+), 22 deletions(-)
diff --git a/plugins/audio/src/system-tray/audio-system-tray.cpp b/plugins/audio/src/system-tray/audio-system-tray.cpp
index 00e90f7..0c6aca6 100644
--- a/plugins/audio/src/system-tray/audio-system-tray.cpp
+++ b/plugins/audio/src/system-tray/audio-system-tray.cpp
@@ -41,7 +41,6 @@ AudioSystemTray::AudioSystemTray(QWidget *parent) : QWidget(parent)
initVolumeSettingPage(defaultSinkPath);
initMixedSettingPage();
- m_sink = new AudioDeviceInterface(AUDIO_DBUS_NAME, defaultSinkPath, QDBusConnection::sessionBus());
m_statusNotifierManager = new StatusNotifierManagerInterface(STATUS_NOTIFIER_MANAGER, STATUS_NOTIFIER_MANAGER_OBJECT_NAME, QDBusConnection::sessionBus(), this);
m_systemTray = new QSystemTrayIcon();
@@ -82,8 +81,11 @@ void AudioSystemTray::initMixedSettingPage()
void AudioSystemTray::initTrayIcon()
{
getTrayIconStyle();
- double currentVolumeDouble = m_sink->volume() * 100;
- KLOG_INFO() << "currentVolumeDouble" << round(currentVolumeDouble);
+
+ QDBusPendingReply<QString> defaultSinkPath = m_audioInterface->GetDefaultSink();
+ AudioDeviceInterface defaultSink (AUDIO_DBUS_NAME, defaultSinkPath, QDBusConnection::sessionBus());
+ double currentVolumeDouble = defaultSink.volume() * 100;
+ KLOG_INFO() << "current Volume Double" << round(currentVolumeDouble);
setTrayIcon(round(currentVolumeDouble));
}
@@ -117,11 +119,12 @@ void AudioSystemTray::initConnect()
{
connect(m_systemTray, &QSystemTrayIcon::activated, this, &AudioSystemTray::handleAudioTrayClicked);
- connect(m_sink, &AudioDeviceInterface::volumeChanged, [=](double value)
- {
- int currentVolume = round(value * 100); //表示数值的时候向上取整
- KLOG_DEBUG() << "m_sink volumeChanged :" << currentVolume;
- setTrayIcon(currentVolume); });
+ connect(m_volumeSettingPage,&VolumeSettingPage::volumeChanged,[=](double value)
+ {
+ int currentVolume = round(value * 100); //表示数值的时候向上取整
+ KLOG_DEBUG() << "m_sink volumeChanged :" << currentVolume;
+ setTrayIcon(currentVolume);
+ });
connect(m_statusNotifierManager, &StatusNotifierManagerInterface::StyleChanged, [=](const QString &style)
{
@@ -129,9 +132,11 @@ void AudioSystemTray::initConnect()
//重新获取style
getTrayIconStyle();
//获取当前音量值重新设置TrayIcon
- m_sink->volume();
- double currentVolumeDouble = m_sink->volume() * 100;
- setTrayIcon(round(currentVolumeDouble)); });
+ QDBusPendingReply<QString> defaultSinkPath = m_audioInterface->GetDefaultSink();
+ AudioDeviceInterface defaultSink (AUDIO_DBUS_NAME, defaultSinkPath, QDBusConnection::sessionBus());
+ double currentVolumeDouble = defaultSink.volume() * 100;
+ setTrayIcon(round(currentVolumeDouble));
+ });
}
void AudioSystemTray::handleAudioTrayClicked(QSystemTrayIcon::ActivationReason reason)
diff --git a/plugins/audio/src/system-tray/audio-system-tray.h b/plugins/audio/src/system-tray/audio-system-tray.h
index 16846e6..a61284e 100644
--- a/plugins/audio/src/system-tray/audio-system-tray.h
+++ b/plugins/audio/src/system-tray/audio-system-tray.h
@@ -68,7 +68,6 @@ private:
StatusNotifierManagerInterface* m_statusNotifierManager;
AudioInterface* m_audioInterface;
- AudioDeviceInterface* m_sink;
QString m_colorTheme;
int xTray, yTray, heightTray, widthTray;
diff --git a/plugins/audio/src/system-tray/volume-setting-page.cpp b/plugins/audio/src/system-tray/volume-setting-page.cpp
index fac69a6..54b8f10 100644
--- a/plugins/audio/src/system-tray/volume-setting-page.cpp
+++ b/plugins/audio/src/system-tray/volume-setting-page.cpp
@@ -132,6 +132,7 @@ void VolumeSettingPage::handleVolumeChanged(double value)
setVolumeIcon(currentVolume);
ui->volumeSetting->setValue(currentVolume);
ui->volumeSetting->blockSignals(false);
+ emit volumeChanged(value);
}
void VolumeSettingPage::handleMuteButtonClicked()
@@ -144,6 +145,7 @@ void VolumeSettingPage::handleMuteButtonClicked()
void VolumeSettingPage::handleDefaultSinkChanged(int index)
{
+ KLOG_DEBUG() << "Default Sink Changed";
// delete and restart init defaultSink
if (m_sink != nullptr)
{
diff --git a/plugins/audio/src/system-tray/volume-setting-page.h b/plugins/audio/src/system-tray/volume-setting-page.h
index 4719021..80f0098 100644
--- a/plugins/audio/src/system-tray/volume-setting-page.h
+++ b/plugins/audio/src/system-tray/volume-setting-page.h
@@ -40,16 +40,6 @@ public:
QPixmap trayIconColorSwitch(const QString &iconPath);
void disableSettings();
-private:
- void initDbusServiceWatcher();
- void initAudioDevice();
- void initAudioStream();
- template <class Audio>
- void initSettings(Audio *audio);
- template <class Audio>
- void clickMuteButton(Audio *audio);
-
-
public slots:
void handleVolumeChanged(double value);
void handleMuteButtonClicked();
@@ -60,6 +50,18 @@ public slots:
void setVolumeIcon(int value);
void hideLine();
+private:
+ void initDbusServiceWatcher();
+ void initAudioDevice();
+ void initAudioStream();
+ template <class Audio>
+ void initSettings(Audio *audio);
+ template <class Audio>
+ void clickMuteButton(Audio *audio);
+
+signals:
+ void volumeChanged(double value);
+
private:
Ui::VolumeSettingPage *ui;
AudioInterface *m_audioInterface;
--
2.33.0

View File

@ -1,306 +0,0 @@
From 091bc92282fd07e989747ca23157f7af5113c723 Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Fri, 8 Sep 2023 15:53:56 +0800
Subject: [PATCH] fix(audio):The Sink/Source device list displays only active
ports. The port selection function is temporarily disabled
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 输入输出设备列表只显示目前已激活的端口,暂时禁用选择端口的功能
Related #13261
---
.../audio/src/dbus/audio-device-interface.cpp | 33 +++++++++
.../audio/src/dbus/audio-device-interface.h | 9 +++
plugins/audio/src/plugin/input-page.cpp | 69 +++++++------------
plugins/audio/src/plugin/input-page.h | 1 -
plugins/audio/src/plugin/output-page.cpp | 62 ++++++-----------
plugins/audio/src/plugin/output-page.h | 1 -
6 files changed, 89 insertions(+), 86 deletions(-)
diff --git a/plugins/audio/src/dbus/audio-device-interface.cpp b/plugins/audio/src/dbus/audio-device-interface.cpp
index a3a750f..7ec201d 100644
--- a/plugins/audio/src/dbus/audio-device-interface.cpp
+++ b/plugins/audio/src/dbus/audio-device-interface.cpp
@@ -13,6 +13,7 @@
*/
#include "audio-device-interface.h"
+#include <qt5-log-i.h>
/*
* Implementation of interface class AudioDeviceInterface
@@ -28,6 +29,38 @@ AudioDeviceInterface::~AudioDeviceInterface()
{
}
+QList<AudioPortInfo> AudioDeviceInterface::getPortsInfo()
+{
+ QDBusPendingReply<QString> getPorts = GetPorts();
+ KLOG_DEBUG() << "getPorts:" << getPorts;
+
+ //解析默认sink的端口信息
+ QJsonParseError jsonParseError;
+ QJsonDocument doc = QJsonDocument::fromJson(getPorts.value().toUtf8(), &jsonParseError);
+
+ if((doc.isNull()) || (jsonParseError.error != QJsonParseError::NoError))
+ {
+ return QList<AudioPortInfo>();
+ }
+
+ QList<AudioPortInfo> portInfoList;
+ if (doc.isArray() && jsonParseError.error == QJsonParseError::NoError)
+ {
+ QJsonArray array = doc.array();
+ for (int i = 0; i < array.count(); ++i)
+ {
+ QJsonObject object = array.at(i).toObject();
+ AudioPortInfo portInfo;
+ portInfo.description = object.value("description").toString();
+ portInfo.name = object.value("name").toString();
+ portInfo.priority = object.value("priority").toDouble();
+ portInfoList << portInfo;
+ }
+ }
+
+ return portInfoList;
+}
+
void sendPropertyChangedDetailSignal(AudioDeviceInterface *ptr, const QString &propertyName, QVariant value)
{
if (propertyName == QStringLiteral("active_port"))
diff --git a/plugins/audio/src/dbus/audio-device-interface.h b/plugins/audio/src/dbus/audio-device-interface.h
index 29fbe6d..8bea01a 100644
--- a/plugins/audio/src/dbus/audio-device-interface.h
+++ b/plugins/audio/src/dbus/audio-device-interface.h
@@ -26,6 +26,13 @@
#include <QtDBus/QtDBus>
#include "audio-device-interface.h"
+struct AudioPortInfo
+{
+ QString description;
+ QString name;
+ double priority;
+};
+
/*
* Proxy class for interface com.kylinsec.Kiran.SessionDaemon.Audio.Device
*/
@@ -103,6 +110,8 @@ public:
return qvariant_cast<double>(property("volume"));
}
+ QList<AudioPortInfo> getPortsInfo();
+
public Q_SLOTS: // METHODS
inline QDBusPendingReply<QString> GetPorts()
{
diff --git a/plugins/audio/src/plugin/input-page.cpp b/plugins/audio/src/plugin/input-page.cpp
index 8b0ecaa..11275ec 100644
--- a/plugins/audio/src/plugin/input-page.cpp
+++ b/plugins/audio/src/plugin/input-page.cpp
@@ -198,48 +198,28 @@ void InputPage::initInputDevice()
void InputPage::initActivedPort()
{
- QDBusPendingReply<QString> getPorts = m_defaultSource->GetPorts();
- KLOG_DEBUG() << "getPorts:" << getPorts;
- //解析默认source的端口信息
- QJsonParseError jsonParseError;
- QJsonDocument doc = QJsonDocument::fromJson(getPorts.value().toUtf8(), &jsonParseError);
- if (!doc.isNull() && jsonParseError.error == QJsonParseError::NoError)
- {
- if (doc.isArray() && jsonParseError.error == QJsonParseError::NoError)
- {
- QJsonArray array = doc.array();
- for (int i = 0; i < array.count(); ++i)
- {
- KLOG_DEBUG() << "array.at(i)" << array.at(i);
- QJsonObject object = array.at(i).toObject();
- QString description = object.value("description").toString();
- QString name = object.value("name").toString();
- double priority = object.value("priority").toDouble();
- KLOG_DEBUG() << "description" << description;
- KLOG_DEBUG() << "name" << name;
- KLOG_DEBUG() << "priority" << priority;
-
- ui->inputDevices->insertItem(i, description);
- ui->inputDevices->setItemData(i, name, Qt::UserRole); //激活端口所需信息
- //获取已激活的端口在comobox中的index
- if (m_defaultSource->active_port() == name)
- {
- m_defaultDeviceIndex = i;
- KLOG_DEBUG() << "m_defaultDeviceIndex" << m_defaultDeviceIndex;
- }
- }
- }
- //默认选中已激活的端口
- m_isValidPort = true;
- ui->inputDevices->setCurrentIndex(m_defaultDeviceIndex);
- ui->inputDevices->setEnabled(true);
- ui->volumeSetting->setEnabled(true);
- }
- else
+ QList<AudioPortInfo> portsInfo = m_defaultSource->getPortsInfo();
+
+ if(portsInfo.isEmpty())
{
KLOG_DEBUG() << "ports is null";
disableSettings();
+ return;
}
+
+ Q_FOREACH (auto portInfo, portsInfo)
+ {
+ if(m_defaultSource->active_port() == portInfo.name)
+ {
+ ui->inputDevices->addItem(portInfo.description,portInfo.name);
+ break;
+ }
+ }
+
+ //默认选中已激活的端口
+ m_isValidPort = true;
+ ui->inputDevices->setEnabled(true);
+ ui->volumeSetting->setEnabled(true);
}
void InputPage::initInputSettins()
@@ -304,13 +284,16 @@ void InputPage::disableSettings()
void InputPage::handleActivePortChanged(const QString &value)
{
KLOG_DEBUG() << "handleActivePortChanged :" << value;
- for (int i = 0; i < ui->inputDevices->count(); ++i)
+
+ QList<AudioPortInfo> portsInfo = m_defaultSource->getPortsInfo();
+
+ Q_FOREACH (auto portInfo, portsInfo)
{
- QString name = ui->inputDevices->itemData(i, Qt::UserRole).toString();
- if (name == value)
+ if(m_defaultSource->active_port() == portInfo.name)
{
- ui->inputDevices->setCurrentIndex(i);
- KLOG_DEBUG() << "handleActivePortChanged setCurrentIndex " << i;
+ ui->inputDevices->clear();
+ ui->inputDevices->addItem(portInfo.description,portInfo.name);
+ break;
}
}
}
diff --git a/plugins/audio/src/plugin/input-page.h b/plugins/audio/src/plugin/input-page.h
index 3b57daf..e9f6909 100644
--- a/plugins/audio/src/plugin/input-page.h
+++ b/plugins/audio/src/plugin/input-page.h
@@ -91,7 +91,6 @@ private:
AudioDeviceInterface *m_activedSource;
QMap<int, AudioDeviceInterface *> m_inputDevicesMap;
int m_defaultSourceIndex;
- int m_defaultDeviceIndex;
bool m_isValidPort = false;
QAudioInput *m_audioInput = nullptr;
diff --git a/plugins/audio/src/plugin/output-page.cpp b/plugins/audio/src/plugin/output-page.cpp
index 420cf98..1242b8a 100644
--- a/plugins/audio/src/plugin/output-page.cpp
+++ b/plugins/audio/src/plugin/output-page.cpp
@@ -93,47 +93,25 @@ void OutputPage::initOutputDevice()
void OutputPage::initActivedPort()
{
- QDBusPendingReply<QString> getPorts = m_defaultSink->GetPorts();
- KLOG_DEBUG() << "getPorts:" << getPorts;
-
- //解析默认sink的端口信息
- QJsonParseError jsonParseError;
- QJsonDocument doc = QJsonDocument::fromJson(getPorts.value().toUtf8(), &jsonParseError);
- if (!doc.isNull() && jsonParseError.error == QJsonParseError::NoError)
- {
- if (doc.isArray() && jsonParseError.error == QJsonParseError::NoError)
- {
- QJsonArray array = doc.array();
- for (int i = 0; i < array.count(); ++i)
- {
- KLOG_DEBUG() << "array.at(i)" << array.at(i);
- QJsonObject object = array.at(i).toObject();
- QString description = object.value("description").toString();
- QString name = object.value("name").toString();
- double priority = object.value("priority").toDouble();
- KLOG_DEBUG() << "description" << description;
- KLOG_DEBUG() << "name" << name;
- KLOG_DEBUG() << "priority" << priority;
- ui->outputDevices->insertItem(i, description);
- ui->outputDevices->setItemData(i, name, Qt::UserRole); //激活端口所需信息
-
- //获取已激活的端口在comobox中的index
- if (m_defaultSink->active_port() == name)
- {
- m_defaultDeviceIndex = i;
- }
- }
- }
- //默认选中已激活的端口
- ui->outputDevices->setCurrentIndex(m_defaultDeviceIndex);
- initOutputSettins();
- }
- else
+ QList<AudioPortInfo> portsInfo = m_defaultSink->getPortsInfo();
+ if(portsInfo.isEmpty())
{
//无激活端口则禁用音量设置和平衡
KLOG_DEBUG() << "default sink ports is null";
disableSettings();
+ return;
}
+
+ Q_FOREACH (auto portInfo, portsInfo)
+ {
+ if(m_defaultSink->active_port() == portInfo.name)
+ {
+ ui->outputDevices->addItem(portInfo.description,portInfo.name);
+ break;
+ }
+ }
+
+ initOutputSettins();
}
void OutputPage::initOutputSettins()
@@ -202,13 +180,15 @@ void OutputPage::initConnect()
void OutputPage::handleActivePortChanged(const QString &value)
{
KLOG_DEBUG() << "handleActivePortChanged :" << value;
- for (int i = 0; i < ui->outputDevices->count(); ++i)
+ QList<AudioPortInfo> portsInfo = m_defaultSink->getPortsInfo();
+
+ Q_FOREACH (auto portInfo, portsInfo)
{
- QString name = ui->outputDevices->itemData(i, Qt::UserRole).toString();
- if (name == value)
+ if(m_defaultSink->active_port() == portInfo.name)
{
- ui->outputDevices->setCurrentIndex(i);
- KLOG_DEBUG() << "handleActivePortChanged setCurrentIndex " << i;
+ ui->outputDevices->clear();
+ ui->outputDevices->addItem(portInfo.description,portInfo.name);
+ break;
}
}
}
diff --git a/plugins/audio/src/plugin/output-page.h b/plugins/audio/src/plugin/output-page.h
index abaf9a1..dea45e7 100644
--- a/plugins/audio/src/plugin/output-page.h
+++ b/plugins/audio/src/plugin/output-page.h
@@ -61,7 +61,6 @@ private:
AudioInterface *m_audioInterface;
QMap<int, AudioDeviceInterface *> m_outputDevicesMap;
AudioDeviceInterface *m_defaultSink;
- int m_defaultDeviceIndex;
QDBusServiceWatcher *m_dbusServiceWatcher;
};
--
2.33.0

View File

@ -1,332 +0,0 @@
From 7c62cbc143a47fa47b432b5f8a57a5dda0d536eb Mon Sep 17 00:00:00 2001
From: niko_yhc <yinhongchang@kylinsec.com.cn>
Date: Tue, 12 Sep 2023 16:04:09 +0800
Subject: [PATCH] fix(kiran-control-panel):fits the Qt5.9.7 interface
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 适配Qt5.9.7接口,修复编译报错
Closes:#15019
---
lib/common-widgets/kiran-tips/kiran-tips.cpp | 4 +++
.../src/pages/face/face-page.cpp | 1 -
.../src/pages/finger/finger-page.cpp | 11 ++++----
.../src/pages/iris/iris-page.cpp | 1 -
.../src/pages/prefs/prefs-page.cpp | 16 ++++++------
.../src/pages/ukey/ukey-page.cpp | 1 -
.../src/widgets/general-bio-page.cpp | 8 ++++++
.../network/src/tray/wired-tray-widget.cpp | 10 ++++----
.../network/src/tray/wireless-tray-widget.cpp | 14 +++++------
plugins/power/src/upower-interface.cpp | 4 +++
.../hardware-information.cpp | 6 ++---
.../change-host-name-widget.cpp | 5 ----
.../system-information/system-information.cpp | 2 +-
src/main.cpp | 25 +++++++++++++++++++
14 files changed, 70 insertions(+), 38 deletions(-)
diff --git a/lib/common-widgets/kiran-tips/kiran-tips.cpp b/lib/common-widgets/kiran-tips/kiran-tips.cpp
index 7a8dcab..34f0fa2 100644
--- a/lib/common-widgets/kiran-tips/kiran-tips.cpp
+++ b/lib/common-widgets/kiran-tips/kiran-tips.cpp
@@ -279,7 +279,11 @@ QSize KiranTips::getRightSize() const
QFontMetrics fontMetrics(font);
QMargins layoutContentMargins = this->layout()->contentsMargins();
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 11, 0))
ui->label->setFixedWidth(fontMetrics.horizontalAdvance(ui->label->text()) + 10);
+#else
+ ui->label->setFixedWidth(fontMetrics.width(ui->label->text()) + 10);
+#endif
ui->label->setFixedHeight(fontMetrics.height());
QSize size;
diff --git a/plugins/authentication/src/pages/face/face-page.cpp b/plugins/authentication/src/pages/face/face-page.cpp
index 5e0a0db..4412631 100644
--- a/plugins/authentication/src/pages/face/face-page.cpp
+++ b/plugins/authentication/src/pages/face/face-page.cpp
@@ -23,7 +23,6 @@
#include <QBoxLayout>
#include <QLabel>
#include <QPushButton>
-#include <QRandomGenerator>
#include <QSpacerItem>
#include <QStackedWidget>
diff --git a/plugins/authentication/src/pages/finger/finger-page.cpp b/plugins/authentication/src/pages/finger/finger-page.cpp
index 86513a6..069ab94 100644
--- a/plugins/authentication/src/pages/finger/finger-page.cpp
+++ b/plugins/authentication/src/pages/finger/finger-page.cpp
@@ -29,7 +29,6 @@
#include <QComboBox>
#include <QLabel>
#include <QPushButton>
-#include <QRandomGenerator>
#include <QStackedWidget>
#include <QUuid>
@@ -43,11 +42,11 @@ enum FingerPageIndexEnum
};
const std::list<std::tuple<uint, QString>> FingerProgressRangePixmapList = {
- {0, ":/kcp-authentication/images/finger-0.svg"},
- {25, ":/kcp-authentication/images/finger-25.svg"},
- {50, ":/kcp-authentication/images/finger-50.svg"},
- {75, ":/kcp-authentication/images/finger-75.svg"},
- {100, ":/kcp-authentication/images/finger-100.svg"}};
+ std::make_tuple(0, ":/kcp-authentication/images/finger-0.svg"),
+ std::make_tuple(25, ":/kcp-authentication/images/finger-25.svg"),
+ std::make_tuple(50, ":/kcp-authentication/images/finger-50.svg"),
+ std::make_tuple(75, ":/kcp-authentication/images/finger-75.svg"),
+ std::make_tuple(100, ":/kcp-authentication/images/finger-100.svg")};
FingerPage::FingerPage(KiranAuthDBusProxy* proxy, FingerAuthType type, QWidget* parent)
: QWidget(parent),
diff --git a/plugins/authentication/src/pages/iris/iris-page.cpp b/plugins/authentication/src/pages/iris/iris-page.cpp
index 714c9c0..cacc801 100644
--- a/plugins/authentication/src/pages/iris/iris-page.cpp
+++ b/plugins/authentication/src/pages/iris/iris-page.cpp
@@ -23,7 +23,6 @@
#include <QBoxLayout>
#include <QLabel>
#include <QPushButton>
-#include <QRandomGenerator>
#include <QSpacerItem>
#include <QStackedWidget>
diff --git a/plugins/authentication/src/pages/prefs/prefs-page.cpp b/plugins/authentication/src/pages/prefs/prefs-page.cpp
index 8bad280..a50cc15 100644
--- a/plugins/authentication/src/pages/prefs/prefs-page.cpp
+++ b/plugins/authentication/src/pages/prefs/prefs-page.cpp
@@ -71,11 +71,11 @@ QWidget* PrefsPage::initAuthTypePage()
authTypeLayout->addStretch();
std::list<std::tuple<KADAuthType, QString>> authTypes = {
- {KAD_AUTH_TYPE_FINGERPRINT, tr("fingerprint")},
- {KAD_AUTH_TYPE_FINGERVEIN, tr("fingervein")},
- {KAD_AUTH_TYPE_UKEY, tr("ukey")},
- {KAD_AUTH_TYPE_IRIS, tr("iris")},
- {KAD_AUTH_TYPE_FACE, tr("face")}};
+ std::make_tuple(KAD_AUTH_TYPE_FINGERPRINT, tr("fingerprint")),
+ std::make_tuple(KAD_AUTH_TYPE_FINGERVEIN, tr("fingervein")),
+ std::make_tuple(KAD_AUTH_TYPE_UKEY, tr("ukey")),
+ std::make_tuple(KAD_AUTH_TYPE_IRIS, tr("iris")),
+ std::make_tuple(KAD_AUTH_TYPE_FACE, tr("face"))};
// fill auth types
for (auto iter : authTypes)
@@ -134,9 +134,9 @@ QWidget* PrefsPage::initAuthApplicationPage()
authAppLayout->addLayout(buttonLayout);
std::list<std::tuple<KADAuthApplication, QString>> authTypes = {
- {KAD_AUTH_APPLICATION_LOGIN, tr("login")},
- {KAD_AUTH_APPLICATION_UNLOCK, tr("unlock")},
- {KAD_AUTH_APPLICATION_EMPOWERMENT, tr("empowerment")}};
+ std::make_tuple(KAD_AUTH_APPLICATION_LOGIN, tr("login")),
+ std::make_tuple(KAD_AUTH_APPLICATION_UNLOCK, tr("unlock")),
+ std::make_tuple(KAD_AUTH_APPLICATION_EMPOWERMENT, tr("empowerment"))};
// fill auth applications
for (auto iter : authTypes)
diff --git a/plugins/authentication/src/pages/ukey/ukey-page.cpp b/plugins/authentication/src/pages/ukey/ukey-page.cpp
index 38051ca..bdf4033 100644
--- a/plugins/authentication/src/pages/ukey/ukey-page.cpp
+++ b/plugins/authentication/src/pages/ukey/ukey-page.cpp
@@ -27,7 +27,6 @@
#include <QJsonValue>
#include <QLabel>
#include <QPushButton>
-#include <QRandomGenerator>
#include <QSpacerItem>
UKeyPage::UKeyPage(KiranAuthDBusProxy* proxy, QWidget* parent)
diff --git a/plugins/authentication/src/widgets/general-bio-page.cpp b/plugins/authentication/src/widgets/general-bio-page.cpp
index 36d0ef9..1047c3e 100644
--- a/plugins/authentication/src/widgets/general-bio-page.cpp
+++ b/plugins/authentication/src/widgets/general-bio-page.cpp
@@ -12,7 +12,10 @@
#include <QComboBox>
#include <QLabel>
#include <QPushButton>
+#include <QTime>
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
#include <QRandomGenerator>
+#endif
#define MAX_FEATURE_NUMBER 1000
@@ -45,7 +48,12 @@ QString GeneralBioPage::autoGenerateFeatureName()
for (int i = 0; i <= 10; ++i)
{
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
auto featureNumber = QRandomGenerator::global()->bounded(1, MAX_FEATURE_NUMBER);
+#else
+ qsrand(QTime(0, 0, 0).secsTo(QTime::currentTime()));
+ auto featureNumber = qrand() % MAX_FEATURE_NUMBER + 1;
+#endif
auto temp = QString("%1 %2").arg(m_featureNamePrefix).arg(featureNumber);
if (!m_featureNameSet.contains(temp))
diff --git a/plugins/network/src/tray/wired-tray-widget.cpp b/plugins/network/src/tray/wired-tray-widget.cpp
index 02fac75..67b2224 100644
--- a/plugins/network/src/tray/wired-tray-widget.cpp
+++ b/plugins/network/src/tray/wired-tray-widget.cpp
@@ -59,11 +59,11 @@ void WiredTrayWidget::initUI()
void WiredTrayWidget::initConnection()
{
- connect(m_connectionList, &TrayConnectionList::connectionUpdated, this, &WiredTrayWidget::handleConnectionUpdated, Qt::UniqueConnection);
- connect(m_connectionList, &TrayConnectionList::activateSelectedConnection, this, &WiredTrayWidget::handleActivateSelectedConnection, Qt::UniqueConnection);
- connect(m_connectionList, &TrayConnectionList::disconnect, this, &WiredTrayWidget::handleDisconnect, Qt::UniqueConnection);
- connect(m_connectionList, &TrayConnectionList::cancelConnection, this, &WiredTrayWidget::handleCancelConnection, Qt::UniqueConnection);
- connect(m_connectionList, &TrayConnectionList::sizeChanged, this, &WiredTrayWidget::sizeChanged, Qt::UniqueConnection);
+ connect(m_connectionList.data(), &TrayConnectionList::connectionUpdated, this, &WiredTrayWidget::handleConnectionUpdated, Qt::UniqueConnection);
+ connect(m_connectionList.data(), &TrayConnectionList::activateSelectedConnection, this, &WiredTrayWidget::handleActivateSelectedConnection, Qt::UniqueConnection);
+ connect(m_connectionList.data(), &TrayConnectionList::disconnect, this, &WiredTrayWidget::handleDisconnect, Qt::UniqueConnection);
+ connect(m_connectionList.data(), &TrayConnectionList::cancelConnection, this, &WiredTrayWidget::handleCancelConnection, Qt::UniqueConnection);
+ connect(m_connectionList.data(), &TrayConnectionList::sizeChanged, this, &WiredTrayWidget::sizeChanged, Qt::UniqueConnection);
connect(m_wiredDevice.data(), &WiredDevice::carrierChanged, this, &WiredTrayWidget::handleCarrierChanged, Qt::UniqueConnection);
connect(m_wiredDevice.data(), &Device::stateChanged, this, &WiredTrayWidget::handleStateChanged, Qt::UniqueConnection);
diff --git a/plugins/network/src/tray/wireless-tray-widget.cpp b/plugins/network/src/tray/wireless-tray-widget.cpp
index 2054d99..7680376 100644
--- a/plugins/network/src/tray/wireless-tray-widget.cpp
+++ b/plugins/network/src/tray/wireless-tray-widget.cpp
@@ -55,19 +55,19 @@ void WirelessTrayWidget::initUI()
void WirelessTrayWidget::initConnection()
{
- connect(m_connectionList, &TrayConnectionList::activateSelectedWirelessNetwork, this, &WirelessTrayWidget::handleActivateSelectedWirelessNetwork);
- connect(m_connectionList, &TrayConnectionList::disconnect, this, &WirelessTrayWidget::handleDisconnect);
- connect(m_connectionList, &TrayConnectionList::cancelConnection, this, &WirelessTrayWidget::handleCancelConnection);
- connect(m_connectionList, &TrayConnectionList::ignoreConnection, this, &WirelessTrayWidget::handleIgnoreConnection);
+ connect(m_connectionList.data(), &TrayConnectionList::activateSelectedWirelessNetwork, this, &WirelessTrayWidget::handleActivateSelectedWirelessNetwork);
+ connect(m_connectionList.data(), &TrayConnectionList::disconnect, this, &WirelessTrayWidget::handleDisconnect);
+ connect(m_connectionList.data(), &TrayConnectionList::cancelConnection, this, &WirelessTrayWidget::handleCancelConnection);
+ connect(m_connectionList.data(), &TrayConnectionList::ignoreConnection, this, &WirelessTrayWidget::handleIgnoreConnection);
connect(m_wirelessDevice.data(), &WirelessDevice::networkDisappeared, this, &WirelessTrayWidget::handleNetworkDisappeared);
connect(m_wirelessDevice.data(), &WirelessDevice::networkAppeared, this, &WirelessTrayWidget::handleNetworkAppeared);
- connect(m_connectionList, &TrayConnectionList::sendPasswordToWirelessSetting, this, &WirelessTrayWidget::setSecurityPskAndActivateWirelessConnection);
- connect(m_connectionList, &TrayConnectionList::sendSsidToWireless, this, &WirelessTrayWidget::handleActivateHiddenNetwork);
+ connect(m_connectionList.data(), &TrayConnectionList::sendPasswordToWirelessSetting, this, &WirelessTrayWidget::setSecurityPskAndActivateWirelessConnection);
+ connect(m_connectionList.data(), &TrayConnectionList::sendSsidToWireless, this, &WirelessTrayWidget::handleActivateHiddenNetwork);
connect(m_devicePtr.data(), &Device::stateChanged, this, &WirelessTrayWidget::handleDeviceStateChanged, Qt::UniqueConnection);
- connect(m_connectionList, &TrayConnectionList::sizeChanged, this, &WirelessTrayWidget::sizeChanged);
+ connect(m_connectionList.data(), &TrayConnectionList::sizeChanged, this, &WirelessTrayWidget::sizeChanged);
connect(SignalForward::instance(), &SignalForward::wirelessConnectionAdded, this, &WirelessTrayWidget::handleNotifierConnectionAdded);
connect(SignalForward::instance(), &SignalForward::connectionRemoved, this, &WirelessTrayWidget::handleNotifierConnectionRemoved);
diff --git a/plugins/power/src/upower-interface.cpp b/plugins/power/src/upower-interface.cpp
index f929fbd..aa7960b 100644
--- a/plugins/power/src/upower-interface.cpp
+++ b/plugins/power/src/upower-interface.cpp
@@ -32,7 +32,11 @@ bool UPowerInterface::haveBattery()
}
#endif
+#if UP_CHECK_VERSION(0, 99, 8)
auto devices = up_client_get_devices2(upClient);
+#else
+ auto devices = up_client_get_devices(upClient);
+#endif
void *device = nullptr;
UpDeviceKind kind;
for (int i = 0; i < devices->len; i++)
diff --git a/plugins/system/src/pages/hardware-information/hardware-information.cpp b/plugins/system/src/pages/hardware-information/hardware-information.cpp
index 9e4ae2e..5232390 100644
--- a/plugins/system/src/pages/hardware-information/hardware-information.cpp
+++ b/plugins/system/src/pages/hardware-information/hardware-information.cpp
@@ -88,9 +88,9 @@ void HardwareInformation::initUI(void)
ui->label_CPU_info->setToolTip(cpu);
QList<std::tuple<QStringList, QGridLayout *> > hardwareMap = {
- {disks, ui->gridLayout_hard_disk},
- {graphics, ui->gridLayout_graphics_card},
- {eths, ui->gridLayout_network_card}};
+ std::make_tuple(disks, ui->gridLayout_hard_disk),
+ std::make_tuple(graphics, ui->gridLayout_graphics_card),
+ std::make_tuple(eths, ui->gridLayout_network_card)};
for (auto hardwareInitTuple : hardwareMap)
{
QStringList infos = std::get<0>(hardwareInitTuple);
diff --git a/plugins/system/src/pages/system-information/change-host-name-widget.cpp b/plugins/system/src/pages/system-information/change-host-name-widget.cpp
index c8ea9f6..7cad825 100644
--- a/plugins/system/src/pages/system-information/change-host-name-widget.cpp
+++ b/plugins/system/src/pages/system-information/change-host-name-widget.cpp
@@ -61,11 +61,6 @@ void ChangeHostNameWidget::initUI()
setIcon(QIcon(":/images/kylin-about.png"));
ui->btn_save->setEnabled(false);
-
- auto screen = QApplication::screenAt(QCursor::pos());
- auto screenGeometry = screen->geometry();
- this->move(screenGeometry.x() + (screenGeometry.width() - this->width()) / 2,
- screenGeometry.y() + (screenGeometry.height() - this->height()) / 2);
}
void ChangeHostNameWidget::setNewHostName()
diff --git a/plugins/system/src/pages/system-information/system-information.cpp b/plugins/system/src/pages/system-information/system-information.cpp
index c249b69..9866d01 100644
--- a/plugins/system/src/pages/system-information/system-information.cpp
+++ b/plugins/system/src/pages/system-information/system-information.cpp
@@ -268,7 +268,7 @@ void SystemInformation::handleChangeHostName()
{
if (hostNameWidget == nullptr)
{
- hostNameWidget = new ChangeHostNameWidget;
+ hostNameWidget = new ChangeHostNameWidget(this);
}
hostNameWidget->setAttribute(Qt::WA_QuitOnClose, false);
hostNameWidget->installEventFilter(this);
diff --git a/src/main.cpp b/src/main.cpp
index 2e75c10..2ff2737 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -123,6 +123,27 @@ void dumpPluginManagerInfo()
#endif
}
+#if (QT_VERSION < QT_VERSION_CHECK(5, 10, 0))
+static QScreen *screenAt(const QPoint &point)
+{
+ QVarLengthArray<const QScreen *, 8> visitedScreens;
+ for (const QScreen *screen : QGuiApplication::screens()) {
+ if (visitedScreens.contains(screen))
+ continue;
+
+ // The virtual siblings include the screen itself, so iterate directly
+ for (QScreen *sibling : screen->virtualSiblings()) {
+ if (sibling->geometry().contains(point))
+ return sibling;
+
+ visitedScreens.append(sibling);
+ }
+ }
+
+ return nullptr;
+}
+#endif
+
int main(int argc, char *argv[])
{
KiranSingleApplication app(argc,
@@ -165,7 +186,11 @@ int main(int argc, char *argv[])
PanelWindow w;
w.jump(defaultCategory,defaultSubItem);
+#if (QT_VERSION >= QT_VERSION_CHECK(5, 10, 0))
auto screen = QApplication::screenAt(QCursor::pos());
+#else
+ auto screen = screenAt(QCursor::pos());
+#endif
QRect screenGeometry = screen->geometry();
w.resize(1031, 742);
w.move(screenGeometry.x() + (screenGeometry.width() - w.width()) / 2,
--
2.27.0

View File

@ -1,214 +0,0 @@
From 5160a4eab524c2208ef3f4743331a762f7f50ca7 Mon Sep 17 00:00:00 2001
From: liuxinhao <liuxinhao@kylinsec.com.cn>
Date: Fri, 15 Sep 2023 11:18:58 +0800
Subject: [PATCH] fix(tray icon): Fixed an issue where the tray icon was not
displayed due to late registration of DBus tray service
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复了由于DBus托盘服务注册晚导致托盘图标不显示的问题
Closes #14006,#11856
---
plugins/audio/src/system-tray/main.cpp | 63 ++++++++----------------
plugins/network/src/tray/main.cpp | 67 ++++++++++----------------
2 files changed, 47 insertions(+), 83 deletions(-)
diff --git a/plugins/audio/src/system-tray/main.cpp b/plugins/audio/src/system-tray/main.cpp
index 169eb4d..431e6c9 100644
--- a/plugins/audio/src/system-tray/main.cpp
+++ b/plugins/audio/src/system-tray/main.cpp
@@ -20,13 +20,13 @@
#include <QApplication>
#include <QDBusConnection>
#include <QDBusConnectionInterface>
+#include <QDBusServiceWatcher>
#include <QDBusReply>
#include <QDateTime>
#include <QFile>
-#include <QTimer>
#include <QTranslator>
-#define MAX_WAIT_COUNTS 10
+#define DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER "org.kde.StatusNotifierWatcher"
int main(int argc, char *argv[])
{
@@ -39,56 +39,35 @@ int main(int argc, char *argv[])
if (translator.load(QLocale(), "kiran-cpanel-audio", ".", TRANSLATE_PREFIX, ".qm"))
{
a.installTranslator(&translator);
- KLOG_INFO() << "installTranslator load:" << a.installTranslator(&translator);
+ KLOG_DEBUG() << "installTranslator load:" << a.installTranslator(&translator);
}
else
- KLOG_INFO() << "installTranslator failed";
+ {
+ KLOG_WARNING() << "installTranslator failed";
+ }
AudioSystemTray *audioSystemTray = nullptr;
- QTimer timer;
- timer.setInterval(1000);
- int waitCounts = 0;
- QObject::connect(&timer, &QTimer::timeout, [&]()
- {
- if (QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.StatusNotifierWatcher"))
- {
- KLOG_INFO() << "org.kde.StatusNotifierWatcher isServiceRegistered" << QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.StatusNotifierWatcher");
- KLOG_INFO() << "SessionDaemon.Audio isServiceRegistered " << QDBusConnection::sessionBus().interface()->isServiceRegistered("com.kylinsec.Kiran.SessionDaemon.Audio");
- KLOG_INFO() << "QSystemTrayIcon::isSystemTrayAvailable():" << QSystemTrayIcon::isSystemTrayAvailable();
-
- KLOG_INFO() << "init AudioSystemTray";
- audioSystemTray = new AudioSystemTray;
- KLOG_INFO() << "wait loop : new AudioSystemTray sucess ";
- KLOG_INFO() << "currentDateTime:"<<QDateTime::currentDateTime();
- timer.stop();
- }
- else
- {
- waitCounts++;
- KLOG_INFO() << "waitCounts:" << waitCounts;
- if (waitCounts > MAX_WAIT_COUNTS)
- {
- KLOG_INFO() << "超过等待次数,程序退出";
- return QApplication::quit();
- }
- } });
-
- if (QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.StatusNotifierWatcher"))
+ if (QDBusConnection::sessionBus().interface()->isServiceRegistered(DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER))
{
- KLOG_INFO() << "org.kde.StatusNotifierWatcher isServiceRegistered" << QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.StatusNotifierWatcher");
- KLOG_INFO() << "SessionDaemon.Audio isServiceRegistered " << QDBusConnection::sessionBus().interface()->isServiceRegistered("com.kylinsec.Kiran.SessionDaemon.Audio");
- KLOG_INFO() << "QSystemTrayIcon::isSystemTrayAvailable():" << QSystemTrayIcon::isSystemTrayAvailable();
-
- KLOG_INFO() << "init AudioSystemTray";
+ KLOG_DEBUG() << DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER << "is registered,create audio tray icon";
audioSystemTray = new AudioSystemTray;
- KLOG_INFO() << "new AudioSystemTray sucess ";
}
else
{
- timer.start();
- KLOG_INFO() << "start wait loop";
- KLOG_INFO() << "currentDateTime:" << QDateTime::currentDateTime();
+ KLOG_WARNING() << DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER << "is not registered,wait";
+ QDBusServiceWatcher* dbusServiceWatcher = new QDBusServiceWatcher;
+ dbusServiceWatcher->setConnection(QDBusConnection::sessionBus());
+ dbusServiceWatcher->addWatchedService(DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER);
+ QObject::connect(dbusServiceWatcher, &QDBusServiceWatcher::serviceRegistered,
+ [&dbusServiceWatcher, &audioSystemTray](const QString& service)
+ {
+ if (service != DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER)
+ return;
+ KLOG_INFO() << DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER << "is registered,create audio tray icon";
+ audioSystemTray = new AudioSystemTray;
+ dbusServiceWatcher->removeWatchedService(DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER);
+ });
}
return QApplication::exec();
}
diff --git a/plugins/network/src/tray/main.cpp b/plugins/network/src/tray/main.cpp
index 26b04c7..2a62bf1 100644
--- a/plugins/network/src/tray/main.cpp
+++ b/plugins/network/src/tray/main.cpp
@@ -17,67 +17,52 @@
#include <QApplication>
#include <QDBusConnection>
#include <QDBusConnectionInterface>
-#include <QTimer>
+#include <QDBusServiceWatcher>
#include <QTranslator>
#include "config.h"
#include "network-tray.h"
-#define MAX_WAIT_COUNTS 10
-int main(int argc, char *argv[]) {
+#define DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER "org.kde.StatusNotifierWatcher"
+
+int main(int argc, char* argv[])
+{
KiranApplication a(argc, argv);
klog_qt5_init("", "kylinsec-session", "kiran-cpanel-network", "kiran-cpanel-network");
KLOG_INFO() << "autostart!";
+
QTranslator translator;
if (translator.load(QLocale(), "kiran-cpanel-network", ".", TRANSLATE_PREFIX, ".qm"))
{
a.installTranslator(&translator);
- KLOG_INFO() << "installTranslator load:" << a.installTranslator(&translator);
+ KLOG_DEBUG() << "installTranslator load:" << a.installTranslator(&translator);
}
else
- KLOG_INFO() << "installTranslator failed";
-
- NetworkTray *tray = nullptr;
- QTimer timer;
- timer.setInterval(1000);
- int waitCounts = 0;
- QObject::connect(&timer, &QTimer::timeout, [&]() {
- if (QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.StatusNotifierWatcher"))
- {
- KLOG_INFO() << "org.kde.StatusNotifierWatcher isServiceRegistered" << QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.StatusNotifierWatcher");
- KLOG_INFO() << "QSystemTrayIcon::isSystemTrayAvailable():" << QSystemTrayIcon::isSystemTrayAvailable();
-
- KLOG_INFO() << "init NetworkTray";
- tray = new NetworkTray;
- KLOG_INFO() << "wait loop : new NetworkTray sucess ";
- KLOG_INFO() << "currentDateTime:"<<QDateTime::currentDateTime();
- timer.stop();
- }
- else
- {
- waitCounts++;
- KLOG_INFO() << "waitCounts:" << waitCounts;
- if (waitCounts > MAX_WAIT_COUNTS)
- {
- KLOG_INFO() << "超过等待次数,程序退出";
- return QApplication::quit();
- }
- }
- });
+ {
+ KLOG_WARNING() << "installTranslator failed";
+ }
- if (QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.StatusNotifierWatcher"))
+ NetworkTray* tray = nullptr;
+ if (QDBusConnection::sessionBus().interface()->isServiceRegistered(DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER))
{
- KLOG_INFO() << "org.kde.StatusNotifierWatcher isServiceRegistered" << QDBusConnection::sessionBus().interface()->isServiceRegistered("org.kde.StatusNotifierWatcher");
- KLOG_INFO() << "QSystemTrayIcon::isSystemTrayAvailable():" << QSystemTrayIcon::isSystemTrayAvailable();
- KLOG_INFO() << "init NetworkTray";
+ KLOG_DEBUG() << DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER << "is registered,create network tray icon";
tray = new NetworkTray;
- KLOG_INFO() << "new NetworkTray sucess ";
}
else
{
- timer.start();
- KLOG_INFO() << "start wait loop";
- KLOG_INFO() << "currentDateTime:" << QDateTime::currentDateTime();
+ KLOG_WARNING() << DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER << "is not registered,wait";
+ QDBusServiceWatcher* dbusServiceWatcher = new QDBusServiceWatcher;
+ dbusServiceWatcher->setConnection(QDBusConnection::sessionBus());
+ dbusServiceWatcher->addWatchedService(DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER);
+ QObject::connect(dbusServiceWatcher, &QDBusServiceWatcher::serviceRegistered,
+ [&dbusServiceWatcher, &tray](const QString& service)
+ {
+ if (service != DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER)
+ return;
+ KLOG_INFO() << DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER << "is registered,create network tray icon";
+ tray = new NetworkTray;
+ dbusServiceWatcher->removeWatchedService(DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER);
+ });
}
return QApplication::exec();
--
2.33.0

View File

@ -1,48 +0,0 @@
From 5628b4b31eeb7493abe41bb9a6935955f0ca090a Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Fri, 15 Sep 2023 16:19:15 +0800
Subject: [PATCH] fix(network-tray):Improved the notification logic. "Wired
NIC: xxx is unavailable" and "Network is Unavailable" are no longer displayed
during sleep recovery.
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 完善通知弹窗逻辑从休眠中恢复过程中不再提示“有线网卡xxx不可用”和“网络不可用”。
Close #15619
---
plugins/network/src/tray/network-tray.cpp | 16 ++++++++++++++--
1 file changed, 14 insertions(+), 2 deletions(-)
diff --git a/plugins/network/src/tray/network-tray.cpp b/plugins/network/src/tray/network-tray.cpp
index 7397e28..dd5ff12 100644
--- a/plugins/network/src/tray/network-tray.cpp
+++ b/plugins/network/src/tray/network-tray.cpp
@@ -473,9 +473,21 @@ void NetworkTray::handleDeviceStateChanged(NetworkManager::Device::State newstat
}
}
- // 设备变为不可用时,如果无线和有线均不可用则显示网络不可用的提示
- if (newstate == Device::Unavailable || newstate == Device::Unmanaged || newstate == Device::UnknownState)
+ QSet<Device::State> unavailableStates = {
+ Device::Unavailable,
+ Device::Unmanaged,
+ Device::UnknownState
+ };
+
+ // 非休眠的情况下,从可用状态到不可用状态通知
+ if (!unavailableStates.contains(oldstate)
+ &&
+ unavailableStates.contains(newstate)
+ &&
+ reason != Device::SleepingReason
+ )
{
+ // 设备变为不可用时,如果无线和有线均不可用则显示网络不可用的提示
KLOG_DEBUG() << "device is unavailable";
if ((NetworkUtils::getAvailableDeviceList(Device::Ethernet).count() == 0) &&
(NetworkUtils::getAvailableDeviceList(Device::Wifi).count() == 0))
--
2.33.0

View File

@ -1,370 +0,0 @@
From 2fcd30a538df01ae8505cf5c1baf26d18b1d2cef Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Mon, 18 Sep 2023 10:39:58 +0800
Subject: [PATCH] fix(network):Modify DNS Settings and display DNS details
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 自动获取IPDNS网络详情显示自动获取到的DNS
手动配置DNS网络详情中DNS服务器仅显示手动配置的DNS
Close #14000
---
.../connection-details-widget.cpp | 51 +++++--
.../details-page/connection-details-widget.ui | 6 +-
.../src/plugin/setting-widget/ipv4-widget.cpp | 135 +++++++++---------
.../src/plugin/setting-widget/ipv4-widget.ui | 8 +-
4 files changed, 116 insertions(+), 84 deletions(-)
diff --git a/plugins/network/src/plugin/details-page/connection-details-widget.cpp b/plugins/network/src/plugin/details-page/connection-details-widget.cpp
index d94b1bd..235c48d 100644
--- a/plugins/network/src/plugin/details-page/connection-details-widget.cpp
+++ b/plugins/network/src/plugin/details-page/connection-details-widget.cpp
@@ -67,7 +67,7 @@ void ConnectionDetailsWidget::init()
void ConnectionDetailsWidget::initUI()
{
QList<KiranFrame *> widgets = {ui->securityTypeWidget, ui->frequencyBandWidget, ui->channelWidget, ui->InterfaceWidget,
- ui->macWidget, ui->ipv4Widget, ui->gatewayWidget, ui->preferredDNSWidget, ui->subnetMaskWidget,
+ ui->macWidget, ui->ipv4Widget, ui->gatewayWidget, ui->DNSWidget, ui->subnetMaskWidget,
ui->ipv6Widget, ui->ipv6GatewayWidget, ui->prefixWidget, ui->rateWidget};
for (auto widget : widgets)
@@ -76,7 +76,7 @@ void ConnectionDetailsWidget::initUI()
}
QList<QLabel *> labels = {ui->securityType, ui->frequencyBand, ui->channel, ui->networkInterface,
- ui->mac, ui->ipv4, ui->ipv4Gateway, ui->preferredDNS, ui->subnetMask,
+ ui->mac, ui->ipv4, ui->ipv4Gateway, ui->DNS, ui->subnetMask,
ui->ipv6, ui->ipv6Gateway, ui->prefix, ui->rate};
for (auto label : labels)
@@ -151,25 +151,54 @@ void ConnectionDetailsWidget::setIpDetails()
ui->subnetMask->setText(netmask);
ui->ipv4Gateway->setText(gateway);
- QString preferredDNS = "-";
Dhcp4Config::Ptr dhcp = m_activeConnection->dhcp4Config();
auto dhcpOptions = dhcp->options();
+
+ QStringList tmpDNS;
+
+ QStringList dhcpDns;
if (!dhcpOptions.isEmpty())
{
QVariant domainNameServers = dhcpOptions.value("domain_name_servers");
- // 以空格为分隔
- QStringList dns = domainNameServers.toString().split(" ");
- preferredDNS = dns.value(0);
+ dhcpDns = domainNameServers.toString().split(" ");
}
- else
+
+ Ipv4Setting::Ptr ipv4Setting = m_connection->settings()->setting(Setting::Ipv4).dynamicCast<Ipv4Setting>();
+ QList<QHostAddress> ipv4SettingDNS = ipv4Setting->dns();
+
+ QStringList manualDNS;
+
+ for(auto &address : ipv4SettingDNS)
+ {
+ manualDNS << address.toString();
+ }
+ /**
+ * NOTE:
+ * 1、自动获取IPDNS网络详情显示自动获取到的DNS
+ * 2、手动配置DNS网络详情中DNS服务器仅显示手动配置的DNS
+ */
+
+ QString detailsDNS;
+ manualDNS.isEmpty() ? tmpDNS = dhcpDns : tmpDNS = manualDNS;
+ if(!tmpDNS.isEmpty())
{
- Ipv4Setting::Ptr ipv4Setting = m_connection->settings()->setting(Setting::Ipv4).dynamicCast<Ipv4Setting>();
- if (!ipv4Setting->dns().isEmpty())
+ // 以空格为分隔,删除最后一个;
+ for(auto &dns : tmpDNS)
{
- preferredDNS = ipv4Setting->dns().value(0).toString();
+ detailsDNS.append(dns);
+ detailsDNS.append(";");
}
+ if(detailsDNS.endsWith(";"))
+ {
+ detailsDNS.remove(detailsDNS.size() - 1,1);
+ }
+ }
+ else
+ {
+ detailsDNS = "-";
}
- ui->preferredDNS->setText(preferredDNS);
+
+ ui->DNS->setText(detailsDNS);
IpConfig ipV6Config = m_activeConnection->ipV6Config();
IpAddress ipv6Address = ipV6Config.addresses().value(0);
diff --git a/plugins/network/src/plugin/details-page/connection-details-widget.ui b/plugins/network/src/plugin/details-page/connection-details-widget.ui
index c83af72..b781390 100644
--- a/plugins/network/src/plugin/details-page/connection-details-widget.ui
+++ b/plugins/network/src/plugin/details-page/connection-details-widget.ui
@@ -518,7 +518,7 @@
</widget>
</item>
<item>
- <widget class="KiranFrame" name="preferredDNSWidget" native="true">
+ <widget class="KiranFrame" name="DNSWidget" native="true">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -556,7 +556,7 @@
<item>
<widget class="QLabel" name="label_15">
<property name="text">
- <string>Preferred DNS</string>
+ <string>DNS</string>
</property>
</widget>
</item>
@@ -574,7 +574,7 @@
</spacer>
</item>
<item>
- <widget class="QLabel" name="preferredDNS">
+ <widget class="QLabel" name="DNS">
<property name="text">
<string>TextLabel</string>
</property>
diff --git a/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp b/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp
index 8c39794..8dc420f 100644
--- a/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp
+++ b/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp
@@ -74,65 +74,68 @@ void Ipv4Widget::setErrorTips(KiranTips *errorTips)
void Ipv4Widget::saveSettings()
{
- if (m_ipv4Setting != nullptr)
+ if (m_ipv4Setting == nullptr)
{
- IpAddress ipv4Address;
- Ipv4Setting::ConfigMethod method = ui->ipv4Method->currentData().value<NetworkManager::Ipv4Setting::ConfigMethod>();
- if (method == Ipv4Setting::ConfigMethod::Automatic)
- {
- m_ipv4Setting->setMethod(method);
- ipv4Address.setIp(QHostAddress(""));
- ipv4Address.setNetmask(QHostAddress(""));
- ipv4Address.setGateway(QHostAddress(""));
- m_ipv4Setting->setAddresses(QList<NetworkManager::IpAddress>() << ipv4Address);
- }
- else if (method == Ipv4Setting::ConfigMethod::Manual)
- {
- m_ipv4Setting->setMethod(method);
+ return;
+ }
+
+ IpAddress ipv4Address;
+ Ipv4Setting::ConfigMethod method = ui->ipv4Method->currentData().value<NetworkManager::Ipv4Setting::ConfigMethod>();
+ if (method == Ipv4Setting::ConfigMethod::Automatic)
+ {
+ m_ipv4Setting->setMethod(method);
+ ipv4Address.setIp(QHostAddress(""));
+ ipv4Address.setNetmask(QHostAddress(""));
+ ipv4Address.setGateway(QHostAddress(""));
+ m_ipv4Setting->setAddresses(QList<NetworkManager::IpAddress>() << ipv4Address);
+ }
+ else if (method == Ipv4Setting::ConfigMethod::Manual)
+ {
+ m_ipv4Setting->setMethod(method);
- ipv4Address.setIp(QHostAddress(ui->ipv4Address->text()));
- QString netMask = ui->ipv4Netmask->text();
- if (!netMask.contains("."))
+ ipv4Address.setIp(QHostAddress(ui->ipv4Address->text()));
+ QString netMask = ui->ipv4Netmask->text();
+ if (!netMask.contains("."))
+ {
+ int netPrefix = netMask.toInt();
+ KLOG_DEBUG() << "netMask.toInt():" << netMask.toInt();
+ if ((netPrefix > 0) & (netPrefix < 33))
{
- int netPrefix = netMask.toInt();
- KLOG_DEBUG() << "netMask.toInt():" << netMask.toInt();
- if ((netPrefix > 0) & (netPrefix < 33))
- {
- ipv4Address.setPrefixLength(netPrefix);
- }
- else
- {
- KLOG_DEBUG() << "Net prefix length error";
- }
+ ipv4Address.setPrefixLength(netPrefix);
}
else
{
- ipv4Address.setNetmask(QHostAddress(netMask));
+ KLOG_DEBUG() << "Net prefix length error";
}
-
- ipv4Address.setGateway(QHostAddress(ui->ipv4Gateway->text()));
- KLOG_DEBUG() << "ipv4Address.ip():" << ipv4Address.ip();
- KLOG_DEBUG() << "ipv4Address.netmask():" << ipv4Address.netmask();
- KLOG_DEBUG() << "ipv4Address.prefixLength():" << ipv4Address.prefixLength();
- KLOG_DEBUG() << "ipv4Address.gateway():" << ipv4Address.gateway();
-
- QList<IpAddress> ipv4AddresseList;
- ipv4AddresseList << ipv4Address;
- m_ipv4Setting->setAddresses(ipv4AddresseList);
- }
-
- QList<QHostAddress> ipv4DNS;
- if (!ui->ipv4PreferredDNS->text().isEmpty())
- {
- ipv4DNS << QHostAddress(ui->ipv4PreferredDNS->text());
}
- if (!ui->ipv4AlternateDNS->text().isEmpty())
+ else
{
- ipv4DNS << QHostAddress(ui->ipv4AlternateDNS->text());
+ ipv4Address.setNetmask(QHostAddress(netMask));
}
- KLOG_DEBUG() << "ipv4DNS:" << ipv4DNS;
- m_ipv4Setting->setDns(ipv4DNS);
+
+ ipv4Address.setGateway(QHostAddress(ui->ipv4Gateway->text()));
+ KLOG_DEBUG() << "ipv4Address.ip():" << ipv4Address.ip();
+ KLOG_DEBUG() << "ipv4Address.netmask():" << ipv4Address.netmask();
+ KLOG_DEBUG() << "ipv4Address.prefixLength():" << ipv4Address.prefixLength();
+ KLOG_DEBUG() << "ipv4Address.gateway():" << ipv4Address.gateway();
+
+ QList<IpAddress> ipv4AddresseList;
+ ipv4AddresseList << ipv4Address;
+ m_ipv4Setting->setAddresses(ipv4AddresseList);
+ }
+
+ QList<QHostAddress> ipv4DNS;
+ if (!ui->ipv4FirstDNS->text().isEmpty())
+ {
+ ipv4DNS << QHostAddress(ui->ipv4FirstDNS->text());
+ }
+ if (!ui->ipv4SecondDNS->text().isEmpty())
+ {
+ ipv4DNS << QHostAddress(ui->ipv4SecondDNS->text());
}
+ KLOG_DEBUG() << "ipv4DNS:" << ipv4DNS;
+ m_ipv4Setting->setDns(ipv4DNS);
+
}
void Ipv4Widget::showSettings()
@@ -171,20 +174,20 @@ void Ipv4Widget::showSettings()
ui->ipv4Gateway->clear();
}
}
- QString preferredDNS = "";
- QString alternateDNS = "";
+ QString firstDNS = "";
+ QString secondDNS = "";
if (!m_ipv4Setting->dns().isEmpty())
{
- preferredDNS = m_ipv4Setting->dns().at(0).toString();
+ firstDNS = m_ipv4Setting->dns().at(0).toString();
if (m_ipv4Setting->dns().count() >= 2)
{
- alternateDNS = m_ipv4Setting->dns().at(1).toString();
+ secondDNS = m_ipv4Setting->dns().at(1).toString();
}
}
- KLOG_DEBUG() << "preferredDNS:" << preferredDNS;
- KLOG_DEBUG() << "alternateDNS:" << alternateDNS;
- ui->ipv4PreferredDNS->setText(preferredDNS);
- ui->ipv4AlternateDNS->setText(alternateDNS);
+ KLOG_DEBUG() << "firstDNS:" << firstDNS;
+ KLOG_DEBUG() << "secondDNS:" << secondDNS;
+ ui->ipv4FirstDNS->setText(firstDNS);
+ ui->ipv4SecondDNS->setText(secondDNS);
}
else
resetSettings();
@@ -197,8 +200,8 @@ void Ipv4Widget::resetSettings()
ui->ipv4Address->clear();
ui->ipv4Netmask->clear();
ui->ipv4Gateway->clear();
- ui->ipv4PreferredDNS->clear();
- ui->ipv4AlternateDNS->clear();
+ ui->ipv4FirstDNS->clear();
+ ui->ipv4SecondDNS->clear();
}
void Ipv4Widget::clearPtr()
@@ -271,27 +274,27 @@ bool Ipv4Widget::isInputValid()
}
}
- QString preferredDNS = ui->ipv4PreferredDNS->text();
- if (!preferredDNS.isEmpty())
+ QString firstDNS = ui->ipv4FirstDNS->text();
+ if (!firstDNS.isEmpty())
{
- if (!isIpv4AddressValid(preferredDNS))
+ if (!isIpv4AddressValid(firstDNS))
{
QString error = QString(tr("Ipv4 Preferred DNS invalid"));
m_errorTip->setText(error);
- m_errorTip->showTipAroundWidget(ui->ipv4PreferredDNS);
+ m_errorTip->showTipAroundWidget(ui->ipv4FirstDNS);
KLOG_DEBUG() << "Ipv4 Preferred DNS invalid";
return false;
}
}
- QString alternateDNS = ui->ipv4AlternateDNS->text();
- if (!alternateDNS.isEmpty())
+ QString secondDNS = ui->ipv4SecondDNS->text();
+ if (!secondDNS.isEmpty())
{
- if (!isIpv4AddressValid(alternateDNS))
+ if (!isIpv4AddressValid(secondDNS))
{
QString error = QString(tr("Ipv4 Alternate DNS invalid"));
m_errorTip->setText(error);
- m_errorTip->showTipAroundWidget(ui->ipv4AlternateDNS);
+ m_errorTip->showTipAroundWidget(ui->ipv4SecondDNS);
KLOG_DEBUG() << "Ipv4 Alternate DNS invalid";
return false;
}
diff --git a/plugins/network/src/plugin/setting-widget/ipv4-widget.ui b/plugins/network/src/plugin/setting-widget/ipv4-widget.ui
index 026e26d..93b2355 100644
--- a/plugins/network/src/plugin/setting-widget/ipv4-widget.ui
+++ b/plugins/network/src/plugin/setting-widget/ipv4-widget.ui
@@ -187,12 +187,12 @@
<item>
<widget class="QLabel" name="label_16">
<property name="text">
- <string>Preferred DNS</string>
+ <string>DNS 1</string>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="ipv4PreferredDNS">
+ <widget class="QLineEdit" name="ipv4FirstDNS">
<property name="minimumSize">
<size>
<width>0</width>
@@ -220,12 +220,12 @@
<item>
<widget class="QLabel" name="label_14">
<property name="text">
- <string>Alternate DNS</string>
+ <string>DNS 2</string>
</property>
</widget>
</item>
<item>
- <widget class="QLineEdit" name="ipv4AlternateDNS">
+ <widget class="QLineEdit" name="ipv4SecondDNS">
<property name="minimumSize">
<size>
<width>0</width>
--
2.33.0

View File

@ -1,288 +0,0 @@
From 60cfb83ae452e20c1d974eb431b2be551db3432e Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Thu, 21 Sep 2023 10:21:23 +0800
Subject: [PATCH 1/2] fix(tray):Fixed the tray menu using the X11 platform,
which caused the missing voice and network icon in the lower right corner,
and the network icon in the taskbar was formatted incorrectly
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复托盘菜单使用X11平台从而导致的右下角缺少声音和网络图标以及任务栏网络图标格式不对的问题
Closes #13353,#11856,#14006
---
CMakeLists.txt | 1 +
include/dbus-tray-monitor.h | 111 +++++++++++++++++++++++++
plugins/audio/CMakeLists.txt | 3 +-
plugins/audio/src/system-tray/main.cpp | 28 +++----
plugins/network/CMakeLists.txt | 1 +
plugins/network/src/tray/main.cpp | 29 +++----
6 files changed, 141 insertions(+), 32 deletions(-)
create mode 100644 include/dbus-tray-monitor.h
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bdffa50..210c938 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -77,6 +77,7 @@ target_link_libraries(${PROJECT_NAME}
${KIRAN_STYLE_LIBRARIES}
${GLIB_2_LIBRARIES})
+list(FILTER INCLUDE_SRC EXCLUDE REGEX ".*bus-tray-monitor.h$")
install(FILES "${CMAKE_SOURCE_DIR}/data/kiran-control-panel.svg" DESTINATION ${INSTALL_DATADIR}/icons/hicolor/)
install(FILES ${INCLUDE_SRC} DESTINATION ${KCP_INSTALL_INCLUDE}/)
install(FILES "${CMAKE_BINARY_DIR}/${PROJECT_NAME}.desktop" DESTINATION "${INSTALL_DATADIR}/applications/")
diff --git a/include/dbus-tray-monitor.h b/include/dbus-tray-monitor.h
new file mode 100644
index 0000000..652e7b1
--- /dev/null
+++ b/include/dbus-tray-monitor.h
@@ -0,0 +1,111 @@
+/**
+ * Copyright (c) 2022 KylinSec Co., Ltd.
+ * kiran-control-panel is licensed under Mulan PSL v2.
+ * You can use this software according to the terms and conditions of the Mulan PSL v2.
+ * You may obtain a copy of Mulan PSL v2 at:
+ * http://license.coscl.org.cn/MulanPSL2
+ * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND,
+ * EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT,
+ * MERCHANTABILITY OR FIT FOR A PARTICULAR PURPOSE.
+ * See the Mulan PSL v2 for more details.
+ *
+ * Author: luoqing <luoqing@kylinsec.com.cn>
+ */
+
+#pragma once
+#include <qt5-log-i.h>
+#include <QDBusConnection>
+#include <QDBusInterface>
+#include <QDBusServiceWatcher>
+#include <QDBusArgument>
+#include <QMap>
+#include <QObject>
+
+#define KDE_STATUS_NOTIFIER_WATCHER_SERVICE "org.kde.StatusNotifierWatcher"
+#define KDE_STATUS_NOTIFIER_WATCHER_PATH "/StatusNotifierWatcher"
+#define FREEDESKTOP_DBUS_PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties"
+#define FREEDESKTOP_DBUS_PROPERTIES_CHANGED_METHOD "PropertiesChanged"
+
+#define KDE_STATUS_NOTIFIER_HOST "org.kde.StatusNotifierHost"
+
+namespace KiranControlPanel
+{
+class DBusTrayMonitor : public QObject
+{
+ Q_OBJECT
+public:
+ DBusTrayMonitor(QObject *parent = nullptr)
+ : QObject(parent),
+ m_connection(QDBusConnection::sessionBus()),
+ m_statusNotifierHostRegistered(false)
+ {
+
+ QDBusInterface trayWatcherInterface(KDE_STATUS_NOTIFIER_WATCHER_SERVICE, KDE_STATUS_NOTIFIER_WATCHER_PATH,
+ KDE_STATUS_NOTIFIER_WATCHER_SERVICE, QDBusConnection::sessionBus());
+
+ // 确认托盘服务Watcher是否存在检测Watcher IsStatusNotifierHostRegistered是否为true(满足QDBusTray可用的条件具体可参考Qt代码)
+ if (trayWatcherInterface.isValid() && trayWatcherInterface.property("IsStatusNotifierHostRegistered").toBool())
+ {
+ m_statusNotifierHostRegistered = true;
+ }
+ else
+ {
+ // 托盘服务Watcher不存在/Host未注册/IsStatusNotifierHostRegistered属性未更新
+ // 连接到DBus Daemon,处理Watcher属性变化信号
+ m_connection.connect(KDE_STATUS_NOTIFIER_WATCHER_SERVICE,
+ KDE_STATUS_NOTIFIER_WATCHER_PATH,
+ FREEDESKTOP_DBUS_PROPERTIES_INTERFACE,
+ FREEDESKTOP_DBUS_PROPERTIES_CHANGED_METHOD,
+ this, SLOT(onWatcherServicePropertyChanged(QDBusMessage)));
+ }
+ }
+
+ ~DBusTrayMonitor() {}
+
+ bool isStatusNotifierHostRegistered() const { return m_statusNotifierHostRegistered; }
+
+private slots:
+ void onWatcherServicePropertyChanged(QDBusMessage msg)
+ {
+ // 若Host已注册过无需判断
+ if (m_statusNotifierHostRegistered)
+ return;
+
+ QList<QVariant> args = msg.arguments();
+ QVariantMap changedProps = qdbus_cast<QVariantMap>(args.at(1).value<QDBusArgument>());
+ for (auto iter = changedProps.begin(); iter != changedProps.end(); iter++)
+ {
+ if (iter.key() != "IsStatusNotifierHostRegistered")
+ continue;
+
+ // IsStatusNotifierHostRegistered,属性变为true
+ // 发出DBus托盘服务可用信号(只在托盘初始化时发出)
+ // 后续属性变化不关注
+ if (iter.value().toBool())
+ {
+ m_statusNotifierHostRegistered = true;
+ KLOG_DEBUG() << "notifier host registered,dbus tray available!";
+ emit dbusTrayAvailable();
+ }
+ break;
+ }
+ }
+
+signals:
+ void dbusTrayAvailable();
+
+private:
+ QDBusConnection m_connection;
+ bool m_statusNotifierHostRegistered;
+};
+
+static bool isDBusTrayAvailable()
+{
+ bool dbusTrayAvailable = false;
+ DBusTrayMonitor conn;
+ if (conn.isStatusNotifierHostRegistered())
+ dbusTrayAvailable = true;
+ return dbusTrayAvailable;
+}
+
+} // namespace KiranControlPanel
diff --git a/plugins/audio/CMakeLists.txt b/plugins/audio/CMakeLists.txt
index ea568f1..55b07b2 100644
--- a/plugins/audio/CMakeLists.txt
+++ b/plugins/audio/CMakeLists.txt
@@ -44,7 +44,8 @@ add_executable(${TRAY_PROCESS}
${DBUS_SRC}
${SYSTEM_TRAY_SRC}
${AUDIO_QM_FILES}
- ${QRC})
+ ${QRC}
+ ${PROJECT_SOURCE_DIR}/include/dbus-tray-monitor.h)
target_include_directories(${TRAY_PROCESS} PRIVATE
${CMAKE_BINARY_DIR}
diff --git a/plugins/audio/src/system-tray/main.cpp b/plugins/audio/src/system-tray/main.cpp
index 431e6c9..8c36383 100644
--- a/plugins/audio/src/system-tray/main.cpp
+++ b/plugins/audio/src/system-tray/main.cpp
@@ -25,6 +25,7 @@
#include <QDateTime>
#include <QFile>
#include <QTranslator>
+#include "dbus-tray-monitor.h"
#define DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER "org.kde.StatusNotifierWatcher"
@@ -47,27 +48,24 @@ int main(int argc, char *argv[])
}
AudioSystemTray *audioSystemTray = nullptr;
-
- if (QDBusConnection::sessionBus().interface()->isServiceRegistered(DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER))
+ if (KiranControlPanel::isDBusTrayAvailable())
{
- KLOG_DEBUG() << DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER << "is registered,create audio tray icon";
+ KLOG_DEBUG() << KDE_STATUS_NOTIFIER_HOST << "is registered,create network tray icon";
audioSystemTray = new AudioSystemTray;
}
else
{
- KLOG_WARNING() << DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER << "is not registered,wait";
- QDBusServiceWatcher* dbusServiceWatcher = new QDBusServiceWatcher;
- dbusServiceWatcher->setConnection(QDBusConnection::sessionBus());
- dbusServiceWatcher->addWatchedService(DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER);
- QObject::connect(dbusServiceWatcher, &QDBusServiceWatcher::serviceRegistered,
- [&dbusServiceWatcher, &audioSystemTray](const QString& service)
+ KLOG_WARNING() << KDE_STATUS_NOTIFIER_HOST << "is not registered,wait";
+
+ auto dBusTrayMonitor = new KiranControlPanel::DBusTrayMonitor();
+ QObject::connect(dBusTrayMonitor, &KiranControlPanel::DBusTrayMonitor::dbusTrayAvailable, [&audioSystemTray]()
{
- if (service != DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER)
- return;
- KLOG_INFO() << DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER << "is registered,create audio tray icon";
- audioSystemTray = new AudioSystemTray;
- dbusServiceWatcher->removeWatchedService(DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER);
- });
+ if(audioSystemTray == nullptr)
+ {
+ KLOG_DEBUG() << KDE_STATUS_NOTIFIER_HOST << "is registered,create network tray icon";
+ audioSystemTray = new AudioSystemTray;
+ }
+ });
}
return QApplication::exec();
}
diff --git a/plugins/network/CMakeLists.txt b/plugins/network/CMakeLists.txt
index 7ea6479..94de67a 100644
--- a/plugins/network/CMakeLists.txt
+++ b/plugins/network/CMakeLists.txt
@@ -55,6 +55,7 @@ add_executable(${TRAY_PROCESS}
${COMMON_SRC}
${QRC}
${NETWORK_QM_FILES}
+ ${PROJECT_SOURCE_DIR}/include/dbus-tray-monitor.h
)
target_include_directories(${TRAY_PROCESS} PRIVATE
diff --git a/plugins/network/src/tray/main.cpp b/plugins/network/src/tray/main.cpp
index 2a62bf1..5c4bb65 100644
--- a/plugins/network/src/tray/main.cpp
+++ b/plugins/network/src/tray/main.cpp
@@ -20,10 +20,9 @@
#include <QDBusServiceWatcher>
#include <QTranslator>
#include "config.h"
+#include "dbus-tray-monitor.h"
#include "network-tray.h"
-#define DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER "org.kde.StatusNotifierWatcher"
-
int main(int argc, char* argv[])
{
KiranApplication a(argc, argv);
@@ -43,26 +42,24 @@ int main(int argc, char* argv[])
}
NetworkTray* tray = nullptr;
- if (QDBusConnection::sessionBus().interface()->isServiceRegistered(DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER))
+ if (KiranControlPanel::isDBusTrayAvailable())
{
- KLOG_DEBUG() << DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER << "is registered,create network tray icon";
+ KLOG_DEBUG() << KDE_STATUS_NOTIFIER_HOST << "is registered,create network tray icon";
tray = new NetworkTray;
}
else
{
- KLOG_WARNING() << DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER << "is not registered,wait";
- QDBusServiceWatcher* dbusServiceWatcher = new QDBusServiceWatcher;
- dbusServiceWatcher->setConnection(QDBusConnection::sessionBus());
- dbusServiceWatcher->addWatchedService(DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER);
- QObject::connect(dbusServiceWatcher, &QDBusServiceWatcher::serviceRegistered,
- [&dbusServiceWatcher, &tray](const QString& service)
+ KLOG_WARNING() << KDE_STATUS_NOTIFIER_HOST << "is not registered,wait";
+
+ auto dBusTrayMonitor = new KiranControlPanel::DBusTrayMonitor();
+ QObject::connect(dBusTrayMonitor, &KiranControlPanel::DBusTrayMonitor::dbusTrayAvailable, [&tray]()
{
- if (service != DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER)
- return;
- KLOG_INFO() << DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER << "is registered,create network tray icon";
- tray = new NetworkTray;
- dbusServiceWatcher->removeWatchedService(DBUS_SERVICE_KDE_STATUS_NOTIFIER_WATCHER);
- });
+ if(tray == nullptr)
+ {
+ KLOG_DEBUG() << KDE_STATUS_NOTIFIER_HOST << "is registered,create network tray icon";
+ tray = new NetworkTray;
+ }
+ });
}
return QApplication::exec();
--
2.33.0

View File

@ -1,81 +0,0 @@
From c385edb7f7babef4d46ca77f1a979dd9f139b16e Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Thu, 21 Sep 2023 10:33:42 +0800
Subject: [PATCH 2/2] fix(network-tray):Fixed an issue where the size Settings
of widgets that are not currently displaying pages in the stackwidget did not
take effect when multiple nics were present during tray initialization
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复在托盘初始化时存在多个网卡时stackwidget中当前未显示页面的widget的设置大小未生效的问题
Close #13862
---
plugins/network/src/tray/tray-page.cpp | 35 ++++++++++++++++++++++++++
plugins/network/src/tray/tray-page.h | 3 +++
2 files changed, 38 insertions(+)
diff --git a/plugins/network/src/tray/tray-page.cpp b/plugins/network/src/tray/tray-page.cpp
index 753abc4..2e50f22 100644
--- a/plugins/network/src/tray/tray-page.cpp
+++ b/plugins/network/src/tray/tray-page.cpp
@@ -53,6 +53,41 @@ void TrayPage::initUI()
{
setSingleDeviceWidget();
}
+
+ /**
+ * NOTE:
+ * 此处是修复当存在多个网卡时stackwidget中当前未显示页面的widget的大小有问题
+ * 推测原因在于在初始化时在页面未show的状态下设置widget的尺寸不生效存在问题。
+ */
+ repolish(this);
+}
+
+void TrayPage::repolish(QWidget *w)
+{
+ QList<const QObject *> children;
+ children.reserve(w->children().size() + 1);
+ for (auto child: qAsConst(w->children()))
+ children.append(child);
+ children.append(w);
+ updateObjects(children);
+}
+
+void TrayPage::updateObjects(const QList<const QObject *>& objects)
+{
+ QEvent event(QEvent::StyleChange);
+ for (const QObject *object : objects)
+ {
+ if (auto widget = qobject_cast<QWidget*>(const_cast<QObject*>(object)))
+ {
+ widget->style()->polish(widget);
+ QCoreApplication::sendEvent(widget, &event);
+ QList<const QObject *> children;
+ children.reserve(widget->children().size() + 1);
+ for (auto child: qAsConst(widget->children()))
+ children.append(child);
+ updateObjects(children);
+ }
+ }
}
void TrayPage::initConnection()
diff --git a/plugins/network/src/tray/tray-page.h b/plugins/network/src/tray/tray-page.h
index 28948a4..66a84f2 100644
--- a/plugins/network/src/tray/tray-page.h
+++ b/plugins/network/src/tray/tray-page.h
@@ -44,6 +44,9 @@ public:
QSize trayPageSize();
+ void repolish(QWidget *w);
+ void updateObjects(const QList<const QObject *>& objects);
+
public slots:
void handleDeviceComboBoxChanged(int index);
void handleAdjustedTraySize(QSize sizeHint);
--
2.33.0

View File

@ -1,125 +0,0 @@
From 74f15f8c5e6bf30a990ebf71def1c29581e67c85 Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Tue, 17 Oct 2023 09:33:24 +0800
Subject: [PATCH] fix(tray):Fixed an issue where the popup was in the wrong
position when the tray was at the top of the screen
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复托盘在屏幕顶部时,弹窗位置不对的问题
Related #17279
---
.../src/system-tray/audio-system-tray.cpp | 32 +++++++++++++------
.../audio/src/system-tray/audio-system-tray.h | 2 +-
plugins/network/src/tray/network-tray.cpp | 16 +++++++---
3 files changed, 35 insertions(+), 15 deletions(-)
diff --git a/plugins/audio/src/system-tray/audio-system-tray.cpp b/plugins/audio/src/system-tray/audio-system-tray.cpp
index 0c6aca6..cc4015d 100644
--- a/plugins/audio/src/system-tray/audio-system-tray.cpp
+++ b/plugins/audio/src/system-tray/audio-system-tray.cpp
@@ -162,7 +162,19 @@ void AudioSystemTray::setVolumeSettingPos()
int pageWidth = 300;
int pageHeight = 66;
- m_volumenPopup->setGeometry(xTray - pageWidth / 2, yTray - pageHeight - offset, pageWidth, pageHeight);
+ int showPosY;
+ // 托盘程序在顶端
+ if(m_yTray == 0)
+ {
+ showPosY = m_heightTray - offset;
+ }
+ else
+ {
+ //托盘程序在底部
+ showPosY = m_yTray - pageHeight - offset;
+ }
+
+ m_volumenPopup->setGeometry(m_xTray - pageWidth / 2, showPosY, pageWidth, pageHeight);
}
void AudioSystemTray::handleMixedSettingClicked()
@@ -180,7 +192,7 @@ void AudioSystemTray::setMixedSettingPos()
int width = m_mixedPopup->sizeHint().width();
m_mixedPopup->setFixedHeight(height + offset * 2);
- m_mixedPopup->move(xTray - width / 2, yTray - height - offset);
+ m_mixedPopup->move(m_xTray - width / 2, m_yTray - height - offset);
}
void AudioSystemTray::handleAdjustedMixedSettingPageSize()
@@ -228,15 +240,15 @@ void AudioSystemTray::getTrayGeometry()
}
}
}
- heightTray = static_cast<int>(height);
- widthTray = static_cast<int>(width);
- xTray = static_cast<int>(x);
- yTray = static_cast<int>(y);
+ m_heightTray = static_cast<int>(height);
+ m_widthTray = static_cast<int>(width);
+ m_xTray = static_cast<int>(x);
+ m_yTray = static_cast<int>(y);
KLOG_DEBUG() << "getTrayGeometry ";
- KLOG_DEBUG() << "heightTray" << heightTray;
- KLOG_DEBUG() << "widthTray" << widthTray;
- KLOG_DEBUG() << "xTray" << xTray;
- KLOG_DEBUG() << "yTray" << yTray;
+ KLOG_DEBUG() << "heightTray" << m_heightTray;
+ KLOG_DEBUG() << "widthTray" << m_widthTray;
+ KLOG_DEBUG() << "xTray" << m_xTray;
+ KLOG_DEBUG() << "yTray" << m_yTray;
}
// XXX:频繁调用函数,需要优化
diff --git a/plugins/audio/src/system-tray/audio-system-tray.h b/plugins/audio/src/system-tray/audio-system-tray.h
index a61284e..fd5f150 100644
--- a/plugins/audio/src/system-tray/audio-system-tray.h
+++ b/plugins/audio/src/system-tray/audio-system-tray.h
@@ -70,7 +70,7 @@ private:
AudioInterface* m_audioInterface;
QString m_colorTheme;
- int xTray, yTray, heightTray, widthTray;
+ int m_xTray, m_yTray, m_heightTray, m_widthTray;
QDBusServiceWatcher *m_dbusServiceWatcher;
};
diff --git a/plugins/network/src/tray/network-tray.cpp b/plugins/network/src/tray/network-tray.cpp
index dd5ff12..c43d8ff 100644
--- a/plugins/network/src/tray/network-tray.cpp
+++ b/plugins/network/src/tray/network-tray.cpp
@@ -305,16 +305,24 @@ void NetworkTray::showOrHideTrayPage()
void NetworkTray::setTrayPagePos()
{
- // KLOG_DEBUG() << "this->sizeHint():" << this->sizeHint();
- // KLOG_DEBUG() << "this->size():" << this->size();
-
int pageHeight = this->size().height();
int pageWidth = this->size().width();
getTrayGeometry();
// 抵消KiranRoundedTrayPopup的margin
int offset = 8;
- this->move(m_xTray - pageWidth / 2, m_yTray - pageHeight + offset);
+ int showPosY;
+ // 托盘程序在顶端
+ if(m_yTray == 0)
+ {
+ showPosY = m_heightTray - offset;
+ }
+ else
+ {
+ //托盘程序在底部
+ showPosY = m_yTray - pageHeight + offset;
+ }
+ this->move(m_xTray - pageWidth / 2, showPosY);
}
void NetworkTray::getTrayGeometry()
--
2.33.0

View File

@ -1,30 +0,0 @@
From e21e0b228328722ded74ffa92668338544d9c0cd Mon Sep 17 00:00:00 2001
From: luoqing <luoqing@kylinsec.com.cn>
Date: Thu, 19 Oct 2023 13:59:27 +0800
Subject: [PATCH 2/2] fix(network-tray):Fixed a flash issue when the tray
position changed from bottom to top, the first time to click the tray, the
page display position is not correct, resulting in a flash issue
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
- 修复托盘位置由底部变为顶部时,第一次点击托盘,页面显示位置不对,导致的闪现问题
---
plugins/network/src/tray/network-tray.cpp | 1 +
1 file changed, 1 insertion(+)
diff --git a/plugins/network/src/tray/network-tray.cpp b/plugins/network/src/tray/network-tray.cpp
index c43d8ff..9834a0e 100644
--- a/plugins/network/src/tray/network-tray.cpp
+++ b/plugins/network/src/tray/network-tray.cpp
@@ -282,6 +282,7 @@ void NetworkTray::showOrHideTrayPage()
this->hide();
else
{
+ setTrayPagePos();
// XXX:托盘界面在不可见的情况不方便去修改size和位置暂时先显示后在调整大小和位置
// this->setFixedSize(258, 258);
this->show();
--
2.33.0

View File

@ -1,29 +1,15 @@
Name: kiran-control-panel
Version: 2.5.5
Release: 13%{?dist}
Version: 2.6.0
Release: 4%{?dist}.kb1
Summary: Kiran Control Panel
Summary(zh_CN): Kiran桌面控制面板
License: MulanPSL-2.0
Source0: %{name}-%{version}.tar.gz
Patch0001: 0001-fix-network-After-receiving-the-Connection-Update-si.patch
Patch0002: 0002-feature-display-When-switching-resolutions-refresh-r.patch
Patch0003: 0003-fix-wallpaper-change-system-wallpaper-xml-path-to-ki.patch
Patch0004: 0004-fix-wallpaper-don-t-call-xmlWriter-if-system-backgro.patch
Patch0005: 0005-fix-account-Fixed-issues-related-to-creating-and-del.patch
Patch0006: 0006-feature-network-When-the-gateway-setting-item-is-0.0.patch
Patch0007: 0007-fix-audio-Fix-parsing-error-when-json-contains-Chine.patch
Patch0008: 0008-fix-audio-tray-Fixed-an-issue-where-the-volume-tray-.patch
Patch0009: 0009-fix-audio-The-Sink-Source-device-list-displays-only-.patch
Patch0010: 0010-fix-kiran-control-panel-fits-the-Qt5.9.7-interface.patch
Patch0011: 0011-fix-tray-icon-Fixed-an-issue-where-the-tray-icon-was.patch
Patch0012: 0012-fix-network-tray-Improved-the-notification-logic.-Wi.patch
Patch0013: 0013-fix-network-Modify-DNS-Settings-and-display-DNS-deta.patch
Patch0014: 0014-fix-tray-Fixed-the-tray-menu-using-the-X11-platform-.patch
Patch0015: 0015-fix-network-tray-Fixed-an-issue-where-the-size-Setti.patch
Patch0016: 0016-fix-tray-Fixed-an-issue-where-the-popup-was-in-the-w.patch
Patch0017: 0017-fix-network-tray-Fixed-a-flash-issue-when-the-tray-p.patch
Patch0000: 0000-fix-pkgconfig-Fix-the-issue-of-incorrect-content-in-.patch
Patch0001: 0001-fix-appearance-remove-the-Kiran-and-Adwaita-icon-the.patch
Patch0002: 0002-fix-plugins-Fix-runtime-plugin-loading-errors.patch
BuildRequires: gcc-c++
BuildRequires: cmake >= 3.2
@ -49,6 +35,8 @@ BuildRequires: kiran-qt5-integration-devel
BuildRequires: kiran-qdbusxml2cpp
BuildRequires: kiran-cc-daemon-devel
BuildRequires: kiran-authentication-service-devel >= 2.5
BuildRequires: libqtxdg-devel
BuildRequires: kf5-kconfig-devel
Requires: qt5-qtbase
Requires: qt5-qtbase-gui
@ -63,7 +51,6 @@ Requires: kiran-qt5-integration >= 2.4
Requires: kiran-system-daemon >= 2.4
Requires: kiran-session-daemon >= 2.4
Requires: kiran-authentication-service >= 2.5
Requires: kiran-wallpapers >= 2.3.0-6
Requires: glib2
Requires: upower
@ -71,6 +58,8 @@ Requires: zeromq
Requires: libnotify
Requires: pam
Requires: cryptopp
Requires: libqtxdg
Requires: kf5-kconfig
Requires: NetworkManager-l2tp
#Requires: NetworkManager-pptp
@ -129,15 +118,7 @@ Summary: Development files for kiran control panel plugin
%build
%{__mkdir} -p %{buildroot}
%if "%{ks_custom_name}" == "GC"
%cmake -DENABLE_USER_GROUP:BOOL=ON \
-DENABLE_NETWORK:BOOL=OFF \
-DENABLE_AUDIO:BOOL=OFF \
-DMOUSE_WHEEL_TEST_VISIBLE:BOOL=ON \
-DMODIFIER_LOCK_TIPS_VISIBLE:BOOL=ON
%else
%cmake
%endif
%cmake
make %{?_smp_mflags}
@ -151,22 +132,18 @@ make %{?_smp_mflags}
%{_datadir}/kiran-control-panel/*
%{_datadir}/icons/hicolor/*
%exclude %{_datadir}/applications/kiran-control-panel.desktop
#account
%{_sysconfdir}/kiran-cpanel-account/
%{_libexecdir}/kiran-avatar-editor
%{_datadir}/kiran-cpanel-account/*
%if "%{ks_custom_name}" != "GC"
#audio
%{_sysconfdir}/xdg/autostart/kiran-audio-status-icon.desktop
%{_bindir}/kiran-audio-status-icon
#network
%{_sysconfdir}/xdg/autostart/kiran-network-status-icon.desktop
%{_bindir}/kiran-network-status-icon
/etc/NetworkManager/conf.d/00-server.conf
%endif
#audio
%{_sysconfdir}/xdg/autostart/kiran-audio-status-icon.desktop
%{_bindir}/kiran-audio-status-icon
#network
%{_sysconfdir}/xdg/autostart/kiran-network-status-icon.desktop
%{_bindir}/kiran-network-status-icon
/etc/NetworkManager/conf.d/00-server.conf
%files -n kiran-cpanel-launcher
%{_bindir}/kiran-cpanel-launcher
@ -180,65 +157,79 @@ make %{?_smp_mflags}
rm -rf %{buildroot}
%changelog
* Mon Oct 23 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.5-13
- KYOS-F: Fixed a flash issue when the tray position changed from bottom to top, the first time to click the tray, the page display position is not correct, resulting in a flash issue
* Fri Dec 15 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.6.0-4.kb1
- KYOS-B: Fix runtime plugin loading errors
* Tue Oct 17 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.5-12
- KYOS-F: Fixed an issue where the popup was in the wrong position when the tray was at the top of the screen (#17279)
* Wed Dec 13 2023 yuanxing <yuanxing@kylinsec.com.cn> - 2.6.0-3.kb1
- KYOS-F: remove the Kiran and Adwaita icon theme in ui and translate the icon name for show
* Thu Sep 21 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.5-11
- KYOS-F: Fixed an issue where the size Settings of widgets that are not currently displaying pages in the stackwidget did not take effect when multiple nics were present during tray initialization(#13862)
- KYOS-F: Fixed the tray menu using the X11 platform, which caused the missing voice and network icon in the lower right corner, and the network icon in the taskbar was formatted incorrectly(#13353,#11856,#14006)
* Wed Dec 13 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.6.0-2.kb1
- KYOS-B: Fix the issue of incorrect content in the PC file provided by pkgconfig
* Mon Sep 18 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.5-10
- KYOS-F: Modify DNS Settings and display DNS details(#14000)
- KYOS-F: Improved the notification logic. "Wired NIC: xxx is unavailable" and "Network is Unavailable" are no longer displayed during sleep recovery.(#15619)
*Tue Dec 12 2023 luoqing <luoqing@kylinsec.com.cn> - 2.6.0-1.kb1
- KYOS-F: Add AutoBoot application Settings to kiran-control-panel (#11367,#11368,#11369)
- KYOS-F: Adjust directory structure and optimize plugin implementation
- KYOS-F: add new common-widget KiranCollapse
- KYOS-F: add Spring and Summer icon theme and fix the build error of variable Names
- KYOS-F: add expand/collapse interface
- KYOS-F: add privacy policy in system information (#23443)
- KYOS-F: fix plugin-application run failed and fix some warnings.
- KYOS-F: Modify button and text spacing (#21567)
- KYOS-F: Optimize font size settings and reduce font types
- KYOS-F: The DNS configuration is optimized. Multiple DNS names are separated by semicolons (#20293)
- KYOS-F: Add the Internet connectivity check; Add the case that the network is connected but cannot access the Internet (#20294)
- KYOS-F: Volume tray icon optimization (#20296)
- KYOS-F: supports sound card selection (#20196)
- KYOS-F: After the volume back-end is set to mute, the volume value is no longer set to zero. Therefore, after clicking the mute button, the volume is set to 0
- KYOS-F: Merge the volume translation file into kiran-control-panel.zh_CN.ts
- KYOS-F: Fixed incomplete display of network details and added logs (#22716)
- KYOS-F: The cable network configuration mode is adjusted;Wireless network interface adjustment (#20295,#22263)
- KYOS-F: Modify the audio and network code according to the review
- KYOS-F: fix some build problems
* Fri Sep 15 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.5-9
- KYOS-F: Fixed an issue where the tray icon was not displayed due to late registration of DBus tray service(#14006,#11856)
* Tue Sep 12 2023 yinhongchang <yinhongchang@kylinsec.com.cn> - 2.5.5-8
* Wed Dec 06 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.5-9.kb1
- rebuild for KiranUI-2.6-next
- KYOS-B: Fixed a flash issue when the tray position changed from bottom to top
- KYOS-B: Fixed an issue where the popup was in the wrong position
- KYOS-B: Fixed an issue where the size Settings of widgets that are not currently displaying pages in the stackwidget did not take effect when multiple nics were present during tray initialization
- KYOS-B: Fixed the tray menu missing voice and network icon in the lower right corner
- KYOS-B: Modify DNS Settings and display DNS details
- KYOS-B: Improved the network notification logic
- KYOS-B: Fixed an issue where the tray icon was not displayed
* Tue Sep 13 2023 yinhongchang <yinhongchang@kylinsec.com.cn> - 2.5.5-8.kb1
- KYOS-F: fits the Qt5.9.7 interface(#15019)
* Fri Sep 08 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.5-7
* Tue Sep 13 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.5-7.kb1
- KYOS-F: The Sink/Source device list displays only active ports. The port selection function is temporarily disabled(#13261)
* Fri Sep 08 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.5-6
* Tue Sep 13 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.5-6.kb1
- KYOS-F: Fixed an issue where the volume tray icon did not change with the volume after the default Sink was changed(#14124)
* Wed Aug 30 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.5-5
* Tue Sep 13 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.5-5.kb1
- KYOS-F: Fix parsing error when json contains Chinese character(#13261)
- KYOS-F: When the gateway setting item is 0.0.0.0, the gateway setting item is null(#13150)
* Mon Aug 28 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.5-4
* Tue Sep 13 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.5-4.kb1
- KYOS-F: Fixed issues related to creating and deleting users in account management(#13994,#13990)
* Fri Aug 25 2023 yuanxing <yuanxing@kylinsec.com.cn> - 2.5.5-3
* Tue Sep 13 2023 yuanxing <yuanxing@kylinsec.com.cn> - 2.5.5-3.kb1
- KYOS-F: search system wallpaper xml path from kiran-background-properties
- KYOS-F: don't call xmlWriter if system background xml not exists to solve segmentation fault
* Wed Aug 23 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.5-2
* Tue Sep 13 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.5-2.kb1
- KYOS-F: After receiving the Connection::Update signal from an active connection, the connection is no longer automatically reactivated (#13231)
- KYOS-F: When switching resolutions, refresh rate preferentially selects the recommended refresh rate (#13283)
* Tue Aug 15 2023 luoqing <luoqing@kylinsec.com.cn> - 2.5.5-1
- KYOS-F: Added pop-up prompt when inserting or removing a network cable (#11814)
- KYOS-F: Change the name "Wired Network 1" in the left column to the name of the network card, corresponding to the network tray(10429)
* Tue Sep 12 2023 yinhongchang <yinhongchang.kylinsec.com.cn> - 2.5.5-1.kb1
- update version to 2.5.5
* Fri Jul 14 2023 yuanxing <yuanxing@kylinsec.com.cn> - 2.5.4-2.gc
- KYOS-F: add mouse wheel direction test with MOUSE_WHEEL_TEST_VISIBLE=ON (#9124)
- KYOS-F: add modifier lock tips with MODIFIER_LOCK_TIPS_VISIBLE=ON (#9379)
* Fri Jun 16 2023 kpkg <kpkg.kylinsec.com.cn> - 2.5.3-2.kb2
- rebuild for KiranUI-2.5-next
* Sun Jul 09 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.4-1.gc
- KYOS-F: KYOS-F: Add specific screensaver settings to the GC version(#9381)
- KYOS-F: using kiran-cc-daemon backend to set computer mode for GC version
* Mon Aug 14 2023 yuanxing <yuanxing@kylinsec.com.cn> - 2.5.3-4
- KYOS-F: chang the keyborad test describtion to enter repeat char to test (#7581)
* Thu Jul 13 2023 yuanxing <yuanxing@kylinsec.com.cn> - 2.5.3-3
- KYOS-F: add mouse wheel direction test with MOUSE_WHEEL_TEST_VISIBLE=ON (#9124)
- KYOS-F: add modifier lock tips with MODIFIER_LOCK_TIPS_VISIBLE=ON (#9379)
* Fri Jun 16 2023 kpkg <kpkg.kylinsec.com.cn> - 2.5.3-2.kb1
- rebuild for KiranUI-2.5-next
* Wed May 31 2023 liuxinhao <liuxinhao@kylinsec.com.cn> - 2.5.3-2
- KYOS-B: Fix problem rename group name input box display incomplete(#67654)
@ -444,3 +435,4 @@ rm -rf %{buildroot}
* Mon Jun 07 2021 liuxinhao <liuxinhao@kylinos.com.cn> - 1.0.0-1.kb1
- Package init