diff --git a/0000-feat-power-Supports-dimming-the-monitor-during-idle-.patch b/0000-feat-power-Supports-dimming-the-monitor-during-idle-.patch new file mode 100644 index 0000000000000000000000000000000000000000..7e76d46a5af24e64a08cacfae4c05c5c192fb499 --- /dev/null +++ b/0000-feat-power-Supports-dimming-the-monitor-during-idle-.patch @@ -0,0 +1,156 @@ +From a19514bfd81ee2302b7b436f78dc6faea1886452 Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Thu, 27 Mar 2025 14:38:52 +0800 +Subject: [PATCH 0/1] feat(power): Supports dimming the monitor during idle + time +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 支持空闲时调暗显示器 + +Related #76040 +--- + plugins/power/pages/general-settings-page.cpp | 18 +++++++ + plugins/power/pages/general-settings-page.h | 2 + + plugins/power/pages/general-settings-page.ui | 54 +++++++++++++++++++ + 3 files changed, 74 insertions(+) + +diff --git a/plugins/power/pages/general-settings-page.cpp b/plugins/power/pages/general-settings-page.cpp +index 430d103e..07e3a00e 100644 +--- a/plugins/power/pages/general-settings-page.cpp ++++ b/plugins/power/pages/general-settings-page.cpp +@@ -194,6 +194,10 @@ void GeneralSettingsPage::initUI() + m_switchIdlelockScreen->setAccessibleName("SwitchIdleLockScreen"); + ui->layout_idleLock->addWidget(m_switchIdlelockScreen); + ++ // 空闲时变暗显示器 ++ m_switchDisplayIdleDimmed = new KiranSwitchButton(this); ++ ui->layout_displayIdleDimmed->addWidget(m_switchDisplayIdleDimmed); ++ + // 待机唤醒是否需要输入密码 + m_switchSuspendLockScreen = new KiranSwitchButton(this); + m_switchSuspendLockScreen->setAccessibleName("SwitchSuspendLockScreen"); +@@ -234,6 +238,8 @@ void GeneralSettingsPage::initConnection() + + connect(m_switchIdlelockScreen, &QAbstractButton::toggled, + this, &GeneralSettingsPage::updateIdleLockEnable); ++ connect(m_switchDisplayIdleDimmed, &QAbstractButton::toggled, ++ this, &GeneralSettingsPage::updateDisplayIdleDimmedEnable); + connect(m_switchSuspendLockScreen, &QAbstractButton::toggled, + this, &GeneralSettingsPage::updateSuspendLockEnable); + } +@@ -350,6 +356,12 @@ void GeneralSettingsPage::load() + m_switchIdlelockScreen->setCheckable(false); + } + ++ // 空闲时变暗显示器 ++ QSignalBlocker displayDimmedIdleBlocker(m_switchDisplayIdleDimmed); ++ auto displayDimmedIdle = m_powerInterface->displayIdleDimmedEnabled(); ++ m_switchDisplayIdleDimmed->setChecked(displayDimmedIdle); ++ m_switchDisplayIdleDimmed->setCheckable(true); ++ + // 待机唤醒时需要输入密码 + QSignalBlocker suspendLockScreenBlocker(m_switchSuspendLockScreen); + auto lockwhenSuspend = m_powerInterface->screenLockedWhenSuspend(); +@@ -465,6 +477,12 @@ void GeneralSettingsPage::updateIdleLockEnable(bool enable) + KLOG_INFO(qLcPower) << "update idle lock enable" << enable; + } + ++void GeneralSettingsPage::updateDisplayIdleDimmedEnable(bool enable) ++{ ++ m_powerInterface->EnableDisplayIdleDimmed(enable); ++ KLOG_INFO(qLcPower) << "update display idle dimmed enable" << enable; ++} ++ + void GeneralSettingsPage::updateSuspendLockEnable(bool checked) + { + m_powerInterface->LockScreenWhenSuspend(checked); +diff --git a/plugins/power/pages/general-settings-page.h b/plugins/power/pages/general-settings-page.h +index e2702538..e0c145e2 100644 +--- a/plugins/power/pages/general-settings-page.h ++++ b/plugins/power/pages/general-settings-page.h +@@ -57,6 +57,7 @@ private slots: + void onSliderIdleTimeChanged(int value); + void updateIdleTime(); + void updateIdleLockEnable(bool enable); ++ void updateDisplayIdleDimmedEnable(bool enable); + void updateSuspendLockEnable(bool enable); + void onSwitchAutoColorTempToggoled(bool checked); + void updateColorTempatureValue(); +@@ -75,6 +76,7 @@ private: + QGSettings* m_screensaverSettings = nullptr; + KiranSwitchButton* m_switchAutoColorTemp = nullptr; + KiranSwitchButton* m_switchIdlelockScreen = nullptr; ++ KiranSwitchButton* m_switchDisplayIdleDimmed = nullptr; + KiranSwitchButton* m_switchSuspendLockScreen = nullptr; + }; + +diff --git a/plugins/power/pages/general-settings-page.ui b/plugins/power/pages/general-settings-page.ui +index 75706f4b..b66d37f8 100644 +--- a/plugins/power/pages/general-settings-page.ui ++++ b/plugins/power/pages/general-settings-page.ui +@@ -796,6 +796,60 @@ + + + ++ ++ ++ ++ Qt::Vertical ++ ++ ++ QSizePolicy::Fixed ++ ++ ++ ++ 20 ++ 16 ++ ++ ++ ++ ++ ++ ++ ++ ++ 0 ++ ++ ++ 0 ++ ++ ++ 0 ++ ++ ++ 0 ++ ++ ++ ++ ++ Display dimmed when idle ++ ++ ++ ++ ++ ++ ++ Qt::Horizontal ++ ++ ++ ++ 40 ++ 20 ++ ++ ++ ++ ++ ++ ++ + + + +-- +2.27.0 + diff --git a/0000-fix-audio-when-the-tray-is-initialized-determine-whe.patch b/0000-fix-audio-when-the-tray-is-initialized-determine-whe.patch deleted file mode 100644 index 4d8f643dee04b5debfbc1ed503a305f08eaf4a2b..0000000000000000000000000000000000000000 --- a/0000-fix-audio-when-the-tray-is-initialized-determine-whe.patch +++ /dev/null @@ -1,53 +0,0 @@ -From 278237ebcb646037d6c77ebbbf3a9629d2b086c0 Mon Sep 17 00:00:00 2001 -From: luoqing -Date: Fri, 23 Feb 2024 14:27:17 +0800 -Subject: [PATCH 0/1] fix(audio):when the tray is initialized, determine - whether there is asound card,if not, the volume icon is disabled -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 托盘初始化时,判断是否存在声卡,若不存在则音量图标显示禁用 - -Related #22865 ---- - plugins/audio/src/system-tray/audio-system-tray.cpp | 10 +++++++--- - plugins/audio/src/system-tray/volume-setting-page.cpp | 1 + - 2 files changed, 8 insertions(+), 3 deletions(-) - -diff --git a/plugins/audio/src/system-tray/audio-system-tray.cpp b/plugins/audio/src/system-tray/audio-system-tray.cpp -index 5b2522f..c4b726c 100644 ---- a/plugins/audio/src/system-tray/audio-system-tray.cpp -+++ b/plugins/audio/src/system-tray/audio-system-tray.cpp -@@ -83,9 +83,13 @@ void AudioSystemTray::initMixedSettingPage() - - void AudioSystemTray::initTrayIcon() - { -- QDBusPendingReply defaultSinkPath = m_audioInterface->GetDefaultSink(); -- AudioDeviceInterface defaultSink (AUDIO_DBUS_NAME, defaultSinkPath, QDBusConnection::sessionBus()); -- double currentVolumeDouble = defaultSink.volume() * 100; -+ double currentVolumeDouble = 0; -+ if(!m_audioInterface->getCards().isEmpty()) -+ { -+ QDBusPendingReply defaultSinkPath = m_audioInterface->GetDefaultSink(); -+ AudioDeviceInterface defaultSink (AUDIO_DBUS_NAME, defaultSinkPath, QDBusConnection::sessionBus()); -+ currentVolumeDouble = defaultSink.volume() * 100; -+ } - setTrayIcon(round(currentVolumeDouble)); - } - -diff --git a/plugins/audio/src/system-tray/volume-setting-page.cpp b/plugins/audio/src/system-tray/volume-setting-page.cpp -index b2dcb62..1925c8d 100644 ---- a/plugins/audio/src/system-tray/volume-setting-page.cpp -+++ b/plugins/audio/src/system-tray/volume-setting-page.cpp -@@ -296,6 +296,7 @@ void VolumeSettingPage::disableSettings() - ui->volume->setText(QString::number(0) + "%"); - ui->volumeSetting->setEnabled(false); - setVolumeIcon(0); -+ emit volumeChanged(0); - } - - void VolumeSettingPage::hideLine() --- -2.27.0 - diff --git a/0001-fix-keybinding-don-t-convert-normal-key-if-use-shift.patch b/0001-fix-keybinding-don-t-convert-normal-key-if-use-shift.patch deleted file mode 100644 index 80877527147be036224b3350e120f21413e7acbd..0000000000000000000000000000000000000000 --- a/0001-fix-keybinding-don-t-convert-normal-key-if-use-shift.patch +++ /dev/null @@ -1,387 +0,0 @@ -From 879b452cc80dccb6581fea70a671a86994fb3a45 Mon Sep 17 00:00:00 2001 -From: yuan_xing -Date: Thu, 29 Feb 2024 17:28:42 +0800 -Subject: [PATCH 1/1] fix(keybinding):don't convert normal key if use shift - modifier in keybinding -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 如果在快捷键中使用了shift修饰键,则不转换其普通按键,直接使用普通按键的Qt::Key - -Relates #30978 ---- - README.md | 4 +- - plugins/keybinding/CMakeLists.txt | 7 ++- - plugins/keybinding/utils/custom-line-edit.cpp | 25 +++++++---- - plugins/keybinding/utils/keycode-helper.cpp | 42 ++++++++++++++++++ - plugins/keybinding/utils/keycode-helper.h | 23 ++++++++++ - .../keybinding/utils/keycode-translator.cpp | 44 +++++++++++-------- - plugins/keybinding/utils/keycode-translator.h | 6 +-- - 7 files changed, 119 insertions(+), 32 deletions(-) - create mode 100644 plugins/keybinding/utils/keycode-helper.cpp - create mode 100644 plugins/keybinding/utils/keycode-helper.h - -diff --git a/README.md b/README.md -index 83d25b9..ad47094 100644 ---- a/README.md -+++ b/README.md -@@ -7,7 +7,7 @@ - 1. 安装编译依赖 - - ```bash -- $ sudo yum install gcc-c++ qt5-qtbase qt5-qtbase-devel qt5-qtbase-gui qt5-qtx11extras qt5-qtx11extras-devel qt5-qtsvg glibc glibc-devel libX11 libX11-devel kiranwidgets-qt5 kiran-widgets-qt5-devel -+ $ sudo yum install gcc-c++ qt5-qtbase qt5-qtbase-devel qt5-qtbase-gui qt5-qtx11extras qt5-qtx11extras-devel qt5-qtsvg glibc glibc-devel libX11 libX11-devel kiranwidgets-qt5 kiran-widgets-qt5-devel qt5-qtbase-static qt5-qtbase-private-devel - ``` - - 2. **源码根目录下创建**build**目录`mkdir build` -@@ -302,4 +302,4 @@ $ kiran-control-panel - - ```bash - $ kiran-cpanel-launcher --cpanel-plugin 插件安装的desktop文件名 --``` -\ No newline at end of file -+``` -diff --git a/plugins/keybinding/CMakeLists.txt b/plugins/keybinding/CMakeLists.txt -index bc94de2..d9dc8d1 100644 ---- a/plugins/keybinding/CMakeLists.txt -+++ b/plugins/keybinding/CMakeLists.txt -@@ -1,5 +1,7 @@ - set(TARGET_NAME kiran-cpanel-keybinding) - -+find_package(Qt5 COMPONENTS XkbCommonSupport) -+ - kiran_qt5_add_dbus_interface_ex(KEYBINDING_PROXY - data/com.kylinsec.Kiran.SessionDaemon.Keybinding.xml - keybinding_backEnd_proxy -@@ -16,6 +18,7 @@ target_include_directories(${TARGET_NAME} PRIVATE - ${CMAKE_CURRENT_BINARY_DIR} - ${CMAKE_CURRENT_SOURCE_DIR} - ${CMAKE_CURRENT_SOURCE_DIR}/utils -+ ${Qt5XkbCommonSupport_PRIVATE_INCLUDE_DIRS} - ${KLOG_INCLUDE_DIRS} - ${KIRAN_WIDGETS_INCLUDE_DIRS} - ${KIRAN_CC_DAEMON_INCLUDE_DIRS}) -@@ -27,8 +30,10 @@ target_link_libraries(${TARGET_NAME} - Qt5::Svg - Qt5::Core - Qt5::Concurrent -+ X11 -+ Qt5::XkbCommonSupport - ${KIRANWIDGETS_LIBRARIES} - ${KLOG_LIBRARIES}) - - install(TARGETS ${TARGET_NAME} -- DESTINATION ${PLUGIN_LIBS_DIR}/) -\ No newline at end of file -+ DESTINATION ${PLUGIN_LIBS_DIR}/) -diff --git a/plugins/keybinding/utils/custom-line-edit.cpp b/plugins/keybinding/utils/custom-line-edit.cpp -index 36250da..6defb3b 100644 ---- a/plugins/keybinding/utils/custom-line-edit.cpp -+++ b/plugins/keybinding/utils/custom-line-edit.cpp -@@ -17,6 +17,8 @@ - #include - #include - #include -+#include "keycode-translator.h" -+#include "logging-category.h" - - CustomLineEdit::CustomLineEdit(QWidget *parent) : QLineEdit(parent) - { -@@ -33,18 +35,27 @@ void CustomLineEdit::initUI() - setFocusPolicy(Qt::ClickFocus); - setReadOnly(true); - setObjectName("CustomLineEdit"); --// setStyleSheet("#CustomLineEdit{border:1px solid #393939;border-radius:6px;padding-left:10px;padding-right:10px;}" --// "#CustomLineEdit:focus{border:1px solid #2eb3ff;}"); -+ // setStyleSheet("#CustomLineEdit{border:1px solid #393939;border-radius:6px;padding-left:10px;padding-right:10px;}" -+ // "#CustomLineEdit:focus{border:1px solid #2eb3ff;}"); - } - - void CustomLineEdit::keyReleaseEvent(QKeyEvent *event) - { - QList keycodes; -+ int qtkey = 0; - - if (event->key() == Qt::Key_Backspace && event->modifiers() == Qt::NoModifier) - { - return; - } -+ -+ //处理shift修饰的快捷键组合,按键不经过shift转化,将原始按键keycode转化为对应的Qt::Key -+ if (event->key() != 0 && (event->modifiers() & Qt::ShiftModifier)) -+ { -+ qtkey = KeycodeTranslator::keycode2QtKey(event->nativeScanCode()); -+ KLOG_INFO(qLcKeybinding) << "convert KeyCode:" << event->nativeScanCode() << "to Qt::Key:" << qtkey; -+ } -+ - // no modifier - if (event->key() != 0 && event->modifiers() == Qt::NoModifier) - { -@@ -56,14 +67,12 @@ void CustomLineEdit::keyReleaseEvent(QKeyEvent *event) - else if (event->key() != 0 && event->modifiers() == Qt::ShiftModifier) - { - keycodes.append(Qt::Key_Shift); -- keycodes.append(event->key()); -- //KLOG_INFO() << "shift :" << event->key() << event->modifiers(); -+ keycodes.append(qtkey ? qtkey : event->key()); - } - else if (event->key() != 0 && event->modifiers() == Qt::ControlModifier) - { - keycodes.append(Qt::Key_Control); - keycodes.append(event->key()); -- //KLOG_INFO() << "ctrl :" << event->key() << event->text(); - } - else if (event->key() != 0 && event->modifiers() == Qt::AltModifier) - { -@@ -76,7 +85,7 @@ void CustomLineEdit::keyReleaseEvent(QKeyEvent *event) - { - keycodes.append(Qt::Key_Control); - keycodes.append(Qt::Key_Shift); -- keycodes.append(event->key()); -+ keycodes.append(qtkey ? qtkey : event->key()); - } - else if (event->key() != 0 && event->modifiers() == (Qt::ControlModifier | Qt::AltModifier)) - { -@@ -88,7 +97,7 @@ void CustomLineEdit::keyReleaseEvent(QKeyEvent *event) - { - keycodes.append(Qt::Key_Shift); - keycodes.append(Qt::Key_Alt); -- keycodes.append(event->key()); -+ keycodes.append(qtkey ? qtkey : event->key()); - } - //three modifier - else if (event->key() != 0 && event->modifiers() == (Qt::AltModifier | Qt::ShiftModifier | Qt::ControlModifier)) -@@ -96,7 +105,7 @@ void CustomLineEdit::keyReleaseEvent(QKeyEvent *event) - keycodes.append(Qt::Key_Shift); - keycodes.append(Qt::Key_Control); - keycodes.append(Qt::Key_Alt); -- keycodes.append(event->key()); -+ keycodes.append(qtkey ? qtkey : event->key()); - } - if (keycodes.size() > 0) - { -diff --git a/plugins/keybinding/utils/keycode-helper.cpp b/plugins/keybinding/utils/keycode-helper.cpp -new file mode 100644 -index 0000000..67cb698 ---- /dev/null -+++ b/plugins/keybinding/utils/keycode-helper.cpp -@@ -0,0 +1,42 @@ -+/** -+ * Copyright (c) 2020 ~ 2021 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: yuanxing -+ */ -+ -+#include "keycode-helper.h" -+ -+#include -+ -+namespace KeycodeHelper -+{ -+unsigned long keycode2Keysym(unsigned long keycode) -+{ -+ KeySym keysym = NoSymbol; -+ Display *display = QX11Info::display(); -+ if (display == nullptr) -+ { -+ KLOG_WARNING(qLcKeybinding) << "can't open display!"; -+ return keysym; -+ } -+ -+ keysym = XKeycodeToKeysym(display, keycode, 0); -+ if (keysym != NoSymbol) -+ { -+ KLOG_INFO(qLcKeybinding) << "convert KeyCode:" << keycode << "to KeySym:" << keysym; -+ } -+ else -+ { -+ KLOG_INFO(qLcKeybinding) << "no corresponding" << keycode << "KeySym found."; -+ } -+ return keysym; -+} -+} // namespace KeycodeHelper -diff --git a/plugins/keybinding/utils/keycode-helper.h b/plugins/keybinding/utils/keycode-helper.h -new file mode 100644 -index 0000000..849abe0 ---- /dev/null -+++ b/plugins/keybinding/utils/keycode-helper.h -@@ -0,0 +1,23 @@ -+/** -+ * Copyright (c) 2020 ~ 2021 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: yuanxing -+ */ -+ -+#pragma once -+ -+#include -+#include "logging-category.h" -+ -+namespace KeycodeHelper -+{ -+unsigned long keycode2Keysym(unsigned long keycode); -+} // namespace KeycodeHelper -diff --git a/plugins/keybinding/utils/keycode-translator.cpp b/plugins/keybinding/utils/keycode-translator.cpp -index a8dea85..5b7f40c 100644 ---- a/plugins/keybinding/utils/keycode-translator.cpp -+++ b/plugins/keybinding/utils/keycode-translator.cpp -@@ -15,9 +15,11 @@ - #include "keycode-translator.h" - #include "logging-category.h" - -+#include - #include --#include - #include -+#include -+#include "keycode-helper.h" - - static QMetaEnum keyMetaEnum = QMetaEnum::fromType(); - -@@ -89,23 +91,22 @@ static const QMap MediaKeyMap = { - KeycodeTranslator::KeycodeTranslator(QObject *parent) - : QObject(parent) - { -- - } - - QString KeycodeTranslator::keycode2ReadableString(const QList &keycodes) - { - QStringList keyStrings; - -- for( int key : keycodes ) -+ for (int key : keycodes) - { -- if( (key >= Qt::Key_0) && (key <= Qt::Key_9) ) -+ if ((key >= Qt::Key_0) && (key <= Qt::Key_9)) - { -- keyStrings.append(QString::number(key-Qt::Key_0)); -+ keyStrings.append(QString::number(key - Qt::Key_0)); - continue; - } - -- const char* keyValue = keyMetaEnum.valueToKey(key); -- if( keyValue == nullptr ) -+ const char *keyValue = keyMetaEnum.valueToKey(key); -+ if (keyValue == nullptr) - { - KLOG_WARNING(qLcKeybinding) << "can't convert key:" << key; - continue; -@@ -113,12 +114,12 @@ QString KeycodeTranslator::keycode2ReadableString(const QList &keycodes) - - QString keyStr(keyValue); - //特殊按键经QMetaEnum翻译之后再经过SpecialKeyMap翻译 -- if( SpecialKeyMap.contains(keyStr.toLower()) ) -+ if (SpecialKeyMap.contains(keyStr.toLower())) - { - keyStrings.append(SpecialKeyMap.value(keyStr.toLower())); - } - //特殊按键 "_" 转换成 " " -- else if( (key >= Audio_Lower_Volume) && (key <= Audio_Mic_Mute) ) -+ else if ((key >= Audio_Lower_Volume) && (key <= Audio_Mic_Mute)) - { - keyStrings.append(keyStr.split("_").join(" ")); - } -@@ -131,33 +132,40 @@ QString KeycodeTranslator::keycode2ReadableString(const QList &keycodes) - return keyStrings.join('+'); - } - -+int KeycodeTranslator::keycode2QtKey(unsigned long keycode) -+{ -+ auto keysym = KeycodeHelper::keycode2Keysym(keycode); -+ auto qtkey = QXkbCommon::keysymToQtKey(keysym, Qt::KeyboardModifier::NoModifier); -+ return qtkey; -+} -+ - QString KeycodeTranslator::backendKeyString2Readable(const QString &keyString) - { - QString readableString; - -- if( keyString.isEmpty() ) -+ if (keyString.isEmpty()) - { - readableString = tr("None"); - } -- else if( keyString.contains("disable",Qt::CaseInsensitive) ) -+ else if (keyString.contains("disable", Qt::CaseInsensitive)) - { - readableString = tr("disabled"); - } - else - { - QString temp = keyString; -- temp = temp.replace("<",""); -- temp = temp.replace(">","-"); -+ temp = temp.replace("<", ""); -+ temp = temp.replace(">", "-"); - #if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0)) - QStringList keyList = temp.split("-", QString::SkipEmptyParts); - #else -- QStringList keyList = temp.split("-",Qt::SkipEmptyParts); -+ QStringList keyList = temp.split("-", Qt::SkipEmptyParts); - #endif -- for(int i=0;i - --class KeycodeTranslator : public QObject -+class KeycodeTranslator : public QObject - { - Q_OBJECT - public: -@@ -174,9 +174,9 @@ private: - - public: - static QString keycode2ReadableString(const QList& keycodes); -+ static int keycode2QtKey(unsigned long keycode); - static QString backendKeyString2Readable(const QString& keyString); - static QString readableKeyString2Backend(const QString& keyString); - }; - -- --#endif //KIRAN_CONTROL_PANEL_KEYCODE_TRANSLATOR_H -+#endif //KIRAN_CONTROL_PANEL_KEYCODE_TRANSLATOR_H --- -2.27.0 - diff --git a/0001-fix-network-Fix-crash-when-ipv6-address-can-t-be-ret.patch b/0001-fix-network-Fix-crash-when-ipv6-address-can-t-be-ret.patch new file mode 100644 index 0000000000000000000000000000000000000000..9faa713c509c3992ccbb6b0c6e7e619907367813 --- /dev/null +++ b/0001-fix-network-Fix-crash-when-ipv6-address-can-t-be-ret.patch @@ -0,0 +1,46 @@ +From bf1cbe0d66ac7c71b2e6351267c076feac61409f Mon Sep 17 00:00:00 2001 +From: liuxinhao +Date: Fri, 28 Mar 2025 14:01:48 +0800 +Subject: [PATCH 1/1] fix(network): Fix crash when ipv6 address can't be + retrieved +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +- 修复ipv6地址拿不到时出现的崩溃 + +Related #75993 +--- + .../src/plugin/setting-widget/ipv6-widget.cpp | 16 +++++++++++----- + 1 file changed, 11 insertions(+), 5 deletions(-) + +diff --git a/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp b/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp +index d19a5e01..567b8f4b 100644 +--- a/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp ++++ b/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp +@@ -162,11 +162,17 @@ void Ipv6Widget::showSettings() + int ipv6MethodIndex = ui->ipv6Method->findData(m_ipv6Setting->method()); + ui->ipv6Method->setCurrentIndex(ipv6MethodIndex); + +- // xxx:取addresses的方式有待改进 +- IpAddress ipv6Address = m_ipv6Setting->addresses().at(0); +- QString ip = ipv6Address.ip().toString(); +- int prefix = ipv6Address.prefixLength(); +- QString gateway = ipv6Address.gateway().toString(); ++ QString ip,gateway; ++ int prefix=64; ++ ++ const auto addresses = m_ipv6Setting->addresses(); ++ if ( addresses.size() > 0 ) ++ { ++ IpAddress ipv6Address = addresses.at(0); ++ ip = ipv6Address.ip().toString(); ++ prefix = ipv6Address.prefixLength(); ++ gateway = ipv6Address.gateway().toString(); ++ } + + ui->ipv6Address->setText(ip); + ui->ipv6Prefix->setValue(prefix); +-- +2.27.0 + diff --git a/0002-fix-audio-network-Compatible-for-versions-below-5.15.patch b/0002-fix-audio-network-Compatible-for-versions-below-5.15.patch deleted file mode 100644 index afc33e25997476dbfc0648e2a66a8e5e831691fc..0000000000000000000000000000000000000000 --- a/0002-fix-audio-network-Compatible-for-versions-below-5.15.patch +++ /dev/null @@ -1,50 +0,0 @@ -From e59ea47e98c22618f260a724938c0a55d62a91ed Mon Sep 17 00:00:00 2001 -From: luoqing -Date: Fri, 29 Mar 2024 16:11:36 +0800 -Subject: [PATCH] fix(audio&network):Compatible for versions below 5.15 -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 兼容qt5.15以下版本 ---- - plugins/network/src/plugin/connection-itemwidget.cpp | 4 ++++ - plugins/network/src/tray/network-tray.cpp | 4 ++++ - 2 files changed, 8 insertions(+) - -diff --git a/plugins/network/src/plugin/connection-itemwidget.cpp b/plugins/network/src/plugin/connection-itemwidget.cpp -index d1abea1..db4e708 100644 ---- a/plugins/network/src/plugin/connection-itemwidget.cpp -+++ b/plugins/network/src/plugin/connection-itemwidget.cpp -@@ -523,8 +523,12 @@ void ConnectionItemWidget::activateWirelessNetwork() - - void ConnectionItemWidget::handleThemeChanged(Kiran::PaletteType paletteType) - { -+#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) - QPixmap pixmap = m_connectionTypeIcon->pixmap(Qt::ReturnByValue); - QImage image = pixmap.toImage(); -+#else -+ QImage image = m_connectionTypeIcon->pixmap()->toImage(); -+#endif - image.invertPixels(QImage::InvertRgb); - m_connectionTypeIcon->setPixmap(QPixmap::fromImage(image)); - m_editButton->setIcon(NetworkUtils::trayIconColorSwitch(":/kcp-network-images/details-info.svg")); -diff --git a/plugins/network/src/tray/network-tray.cpp b/plugins/network/src/tray/network-tray.cpp -index 015a157..e6d6831 100644 ---- a/plugins/network/src/tray/network-tray.cpp -+++ b/plugins/network/src/tray/network-tray.cpp -@@ -757,7 +757,11 @@ void NetworkTray::initTcpSocket() - { - m_tcpClient = new QTcpSocket(this); - connect(m_tcpClient, &QTcpSocket::connected, this, &NetworkTray::internetConnected); -+#if (QT_VERSION >= QT_VERSION_CHECK(5, 15, 0)) - connect(m_tcpClient, &QAbstractSocket::errorOccurred, this, &NetworkTray::internetError); -+#else -+ connect(m_tcpClient, QOverload::of(&QAbstractSocket::error),this, &NetworkTray::internetError); -+#endif - } - - void NetworkTray::checkInternetConnectivity() --- -2.27.0 - diff --git a/0003-fix-power-Fix-has-really-battery-while-it-is-present.patch b/0003-fix-power-Fix-has-really-battery-while-it-is-present.patch deleted file mode 100644 index fd68f68b7860fd044ff92439bfd62bfc7bf7191b..0000000000000000000000000000000000000000 --- a/0003-fix-power-Fix-has-really-battery-while-it-is-present.patch +++ /dev/null @@ -1,56 +0,0 @@ -From 25384cbcc740634b4c3ee80026728a11603111cf Mon Sep 17 00:00:00 2001 -From: meizhigang -Date: Mon, 8 Apr 2024 16:13:17 +0800 -Subject: [PATCH 3/3] fix(power):Fix has really battery while it is present -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - - - 适配真实电池存在场景 - - Related #31917 ---- - plugins/power/upower-interface.cpp | 11 ++++++++--- - 1 file changed, 8 insertions(+), 3 deletions(-) - -diff --git a/plugins/power/upower-interface.cpp b/plugins/power/upower-interface.cpp -index 4c964a6..4c04130 100644 ---- a/plugins/power/upower-interface.cpp -+++ b/plugins/power/upower-interface.cpp -@@ -14,8 +14,8 @@ - - #include "upower-interface.h" - #include --#include - #include -+#include - - // 由于Glib定义与Qt内部相关定义冲突,将该函数单独封装起来 - bool UPowerInterface::haveBattery() -@@ -43,16 +43,21 @@ bool UPowerInterface::haveBattery() - #endif - void *device = nullptr; - UpDeviceKind kind; -+ gboolean is_present = FALSE; - for (unsigned int i = 0; i < devices->len; i++) - { - device = g_ptr_array_index(devices, i); - g_object_get(device, - "kind", &kind, - NULL); -- if (kind == UP_DEVICE_KIND_BATTERY) -+ -+ g_object_get(device, -+ "is-present", &is_present, -+ NULL); -+ if (kind == UP_DEVICE_KIND_BATTERY && is_present) - hasBattery = true; - } -- g_ptr_array_unref (devices); -+ g_ptr_array_unref(devices); - g_object_unref(upClient); - return hasBattery; - } --- -2.27.0 - diff --git a/0004-fix-network-Fix-network-configuration-filtering-for-.patch b/0004-fix-network-Fix-network-configuration-filtering-for-.patch deleted file mode 100644 index c02ab3f333996794c96e93afe80af92037ab9fb4..0000000000000000000000000000000000000000 --- a/0004-fix-network-Fix-network-configuration-filtering-for-.patch +++ /dev/null @@ -1,63 +0,0 @@ -From 78d35063db8778f001849c81c436c68d8771e06e Mon Sep 17 00:00:00 2001 -From: liuxinhao -Date: Tue, 16 Apr 2024 16:40:48 +0800 -Subject: [PATCH] fix(network): Fix network configuration filtering for device - binding and settings update issue -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 修复提取设备绑定配置时内部过滤时加入设备名过滤,以及配置更新绑定设备信息时界面显示问题 - -Closes #32685 ---- - .../network/src/plugin/connection-itemwidget.cpp | 2 +- - plugins/network/src/utils.cpp | 15 +++++++++++++-- - 2 files changed, 14 insertions(+), 3 deletions(-) - -diff --git a/plugins/network/src/plugin/connection-itemwidget.cpp b/plugins/network/src/plugin/connection-itemwidget.cpp -index db4e708..df5dbc3 100644 ---- a/plugins/network/src/plugin/connection-itemwidget.cpp -+++ b/plugins/network/src/plugin/connection-itemwidget.cpp -@@ -363,7 +363,7 @@ void ConnectionItemWidget::updateConnection() - (mac != hardwareAddress)) - { - KLOG_INFO(qLcNetwork) << "the binding device MAC has changed"; -- SignalForward::instance()->connectionMacChanged(connectionPath(), hardwareAddress); -+ SignalForward::instance()->connectionMacChanged(connectionPath(), mac); - return; - } - } -diff --git a/plugins/network/src/utils.cpp b/plugins/network/src/utils.cpp -index 215a342..d325a38 100644 ---- a/plugins/network/src/utils.cpp -+++ b/plugins/network/src/utils.cpp -@@ -240,12 +240,23 @@ NetworkManager::Connection::List NetworkUtils::getAvailableWiredConnections(cons - { - continue; - } -+ -+ // 匹配配置以及设备中的Mac地址是否匹配 - WiredSetting::Ptr wiredSetting = settings->setting(Setting::SettingType::Wired).dynamicCast(); - QString mac = wiredSetting->macAddress().toHex(':').toUpper(); -- if (mac == permanentHardwareAddress || mac.isEmpty()) -+ if ( !mac.isEmpty() && mac != permanentHardwareAddress ) - { -- availableConnections << connection; -+ continue; - } -+ -+ // 匹配配置中指定的DEVICE是否和设备名匹配 -+ QString settingSpecifyDevice = settings->interfaceName(); -+ if ( !settingSpecifyDevice.isEmpty() && settingSpecifyDevice != device->interfaceName() ) -+ { -+ continue; -+ } -+ -+ availableConnections << connection; - } - } - return availableConnections; --- -2.33.0 - diff --git a/0005-fix-touchpad-Fix-touchpad-display-with-the-type-psmo.patch b/0005-fix-touchpad-Fix-touchpad-display-with-the-type-psmo.patch deleted file mode 100644 index f46dfee97fa7a58f168a83d3199d738636fc077d..0000000000000000000000000000000000000000 --- a/0005-fix-touchpad-Fix-touchpad-display-with-the-type-psmo.patch +++ /dev/null @@ -1,140 +0,0 @@ -From dec1b2e8501c3f20c83efa6c8d9f5124fccaf316 Mon Sep 17 00:00:00 2001 -From: meizhigang -Date: Tue, 16 Apr 2024 14:52:46 +0800 -Subject: [PATCH] fix(touchpad):Fix touchpad display with the type psmouse -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - - -适配psmouse类型触摸板设备 - - Related #34878 ---- - ....kylinsec.Kiran.SessionDaemon.TouchPad.xml | 15 ++++ - plugins/mouse/pages/touchpad-page.cpp | 72 +++++++++++-------- - 2 files changed, 58 insertions(+), 29 deletions(-) - -diff --git a/plugins/mouse/data/com.kylinsec.Kiran.SessionDaemon.TouchPad.xml b/plugins/mouse/data/com.kylinsec.Kiran.SessionDaemon.TouchPad.xml -index 8087b87..f5527ad 100644 ---- a/plugins/mouse/data/com.kylinsec.Kiran.SessionDaemon.TouchPad.xml -+++ b/plugins/mouse/data/com.kylinsec.Kiran.SessionDaemon.TouchPad.xml -@@ -36,6 +36,21 @@ - Click methods are usually only available on clickpads. - - -+ -+ -+ The support of disable while typing.> -+ -+ -+ -+ -+ The support of tap to click. -+ -+ -+ -+ -+ The support of click method. -+ -+ - - - Enables a scroll method. Permitted methods are twofinger, edge and button. -diff --git a/plugins/mouse/pages/touchpad-page.cpp b/plugins/mouse/pages/touchpad-page.cpp -index 21062be..63bacc1 100644 ---- a/plugins/mouse/pages/touchpad-page.cpp -+++ b/plugins/mouse/pages/touchpad-page.cpp -@@ -13,11 +13,11 @@ - */ - - #include "touchpad-page.h" --#include "kcm-manager.h" - #include - #include - #include - #include -+#include "kcm-manager.h" - #include "touchPad_backEnd_proxy.h" - #include "ui_touchpad-page.h" - -@@ -204,35 +204,49 @@ void TouchPadPage::initComponent() - }, - Qt::QueuedConnection); - -- //打字时触摸板禁用 -- m_disabelWhileTyping = m_touchPadInterface->disable_while_typing(); -- ui->checkBox_disable_while_typing->setChecked(m_disabelWhileTyping); -- connect(ui->checkBox_disable_while_typing, &KiranSwitchButton::toggled, -- [this](bool disabelWhileTyping) { -- m_disabelWhileTyping = disabelWhileTyping; -- m_touchPadInterface->setDisable_while_typing(m_disabelWhileTyping); -- }); -- connect( -- m_touchPadInterface.data(), &TouchPadBackEndProxy::disable_while_typingChanged, this, -- [this](bool value) { -- setValue(ui->checkBox_disable_while_typing, m_disabelWhileTyping, value); -- }, -- Qt::QueuedConnection); -+ if (m_touchPadInterface->disable_while_typing_support()) -+ { -+ //打字时触摸板禁用 -+ m_disabelWhileTyping = m_touchPadInterface->disable_while_typing(); -+ ui->checkBox_disable_while_typing->setChecked(m_disabelWhileTyping); -+ connect(ui->checkBox_disable_while_typing, &KiranSwitchButton::toggled, -+ [this](bool disabelWhileTyping) { -+ m_disabelWhileTyping = disabelWhileTyping; -+ m_touchPadInterface->setDisable_while_typing(m_disabelWhileTyping); -+ }); -+ connect( -+ m_touchPadInterface.data(), &TouchPadBackEndProxy::disable_while_typingChanged, this, -+ [this](bool value) { -+ setValue(ui->checkBox_disable_while_typing, m_disabelWhileTyping, value); -+ }, -+ Qt::QueuedConnection); -+ } -+ else -+ { -+ ui->widget_disable_while_typing->hide(); -+ } - -- //轻击(不按下)触摸板功能是否生效 -- m_tapToClick = m_touchPadInterface->tap_to_click(); -- ui->checkBox_tap_to_click->setChecked(m_tapToClick); -- connect(ui->checkBox_tap_to_click, &KiranSwitchButton::toggled, -- [this](bool isTapToClick) { -- m_tapToClick = isTapToClick; -- m_touchPadInterface->setTap_to_click(m_tapToClick); -- }); -- connect( -- m_touchPadInterface.data(), &TouchPadBackEndProxy::tap_to_clickChanged, this, -- [this](bool value) { -- setValue(ui->checkBox_tap_to_click, m_tapToClick, value); -- }, -- Qt::QueuedConnection); -+ if (m_touchPadInterface->tap_to_click_support()) -+ { -+ //轻击(不按下)触摸板功能是否生效 -+ m_tapToClick = m_touchPadInterface->tap_to_click(); -+ ui->checkBox_tap_to_click->setChecked(m_tapToClick); -+ connect(ui->checkBox_tap_to_click, &KiranSwitchButton::toggled, -+ [this](bool isTapToClick) { -+ m_tapToClick = isTapToClick; -+ m_touchPadInterface->setTap_to_click(m_tapToClick); -+ }); -+ connect( -+ m_touchPadInterface.data(), &TouchPadBackEndProxy::tap_to_clickChanged, this, -+ [this](bool value) { -+ setValue(ui->checkBox_tap_to_click, m_tapToClick, value); -+ }, -+ Qt::QueuedConnection); -+ } -+ else -+ { -+ ui->widget_tap_to_click->hide(); -+ } - } - - void TouchPadPage::setValue(KiranSwitchButton *receiveWidget, bool &origVal, bool newVal) --- -2.27.0 - diff --git a/0006-fix-search-Adjusting-the-display-style-of-manually-r.patch b/0006-fix-search-Adjusting-the-display-style-of-manually-r.patch deleted file mode 100644 index 76c0313da44aed42537628543fd22e57faf9a423..0000000000000000000000000000000000000000 --- a/0006-fix-search-Adjusting-the-display-style-of-manually-r.patch +++ /dev/null @@ -1,69 +0,0 @@ -From f6d26e5eae0bdc8f3e37b83caea40c750d5166a2 Mon Sep 17 00:00:00 2001 -From: liuxinhao -Date: Thu, 18 Apr 2024 16:57:29 +0800 -Subject: [PATCH 6/7] fix(search): Adjusting the display style of manually - registered search keywords and subfunctional keywords -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 调整手动注册搜索关键字和子功能关键字显示样式 - -Closes #35340,#35278 ---- - src/search-edit/search-model.cpp | 22 +++++++++++++++------- - 1 file changed, 15 insertions(+), 7 deletions(-) - -diff --git a/src/search-edit/search-model.cpp b/src/search-edit/search-model.cpp -index 7c5a6f0..6afcffe 100644 ---- a/src/search-edit/search-model.cpp -+++ b/src/search-edit/search-model.cpp -@@ -51,6 +51,16 @@ void SearchModel::loadSearchModel() - - auto subitems = category->getSubItems(); - -+ if(subitems.size() > 0) -+ { -+ // 添加分类搜索项 -+ appendItem(categoryName, categoryID, subitems.at(0)->getID()); -+ } -+ -+ /** -+ * NOTE: 分类下单个子功能项应不添加搜索项 -+ * 避免 显示设置分类下显示设置子功能项,构成"显示设置->显示设置"这种搜索项 -+ */ - bool addSubItemNamePrefix = true; - if (subitems.size() == 1) - { -@@ -65,15 +75,13 @@ void SearchModel::loadSearchModel() - QString subItemPrefix; - if (addSubItemNamePrefix) - { -- QString searchText = QString("%1 -> %2").arg(categoryName).arg(subitemName); -- appendItem(searchText, categoryID, subitemID); -- subItemPrefix = searchText; -+ QString subItemSearchKey = QString("%1 -> %2").arg(categoryName).arg(subitemName); -+ appendItem(subItemSearchKey, categoryID, subitemID); -+ subItemPrefix = subItemSearchKey; - } - else - { -- QString searchText = categoryName; -- appendItem(searchText, categoryID, subitemID); -- subItemPrefix = searchText; -+ subItemPrefix = categoryName; - } - - auto searchItems = subitem->getSearchKeys(); -@@ -81,7 +89,7 @@ void SearchModel::loadSearchModel() - { - QString searchName = searchItem.first; - QString searchKey = searchItem.second; -- QString searchText = QString("%1 : %2").arg(subItemPrefix).arg(searchName); -+ QString searchText = QString("%1 -> %2").arg(subItemPrefix).arg(searchName); - appendItem(searchText, categoryID, subitemID, searchKey); - } - } --- -2.33.0 - diff --git a/0007-fix-network-Crash-caused-by-mismatch-between-registe.patch b/0007-fix-network-Crash-caused-by-mismatch-between-registe.patch deleted file mode 100644 index 826c5ef8c0e3103a163b4af5908edb0428683a1c..0000000000000000000000000000000000000000 --- a/0007-fix-network-Crash-caused-by-mismatch-between-registe.patch +++ /dev/null @@ -1,148 +0,0 @@ -From 71520f1092cf973bbb63306b141b2d5c3f141d98 Mon Sep 17 00:00:00 2001 -From: liuxinhao -Date: Fri, 19 Apr 2024 10:44:44 +0800 -Subject: [PATCH 7/7] fix(network): Crash caused by mismatch between registered - search terms and actual content -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 修复网络插件注册的搜索项和实际内容对应不上导致的崩溃 - -Closes #35252 ---- - lib/plugin-framework/category-manager.cpp | 8 +++++ - .../network/src/plugin/network-subitem.cpp | 33 +++++++------------ - src/search-edit/search-model.cpp | 11 ++++--- - 3 files changed, 26 insertions(+), 26 deletions(-) - -diff --git a/lib/plugin-framework/category-manager.cpp b/lib/plugin-framework/category-manager.cpp -index 96eb696..a01a2ac 100644 ---- a/lib/plugin-framework/category-manager.cpp -+++ b/lib/plugin-framework/category-manager.cpp -@@ -288,6 +288,9 @@ void CategoryManager::removeSubItem(const QString& categoryID, Plugin* plugin, c - } - } - -+/** -+ * NOTE: 该方法为插件调用触发,主面板处理子功能项目信息发生变化 -+*/ - void CategoryManager::handlePluginSubItemInfoChanged(const QString& subiemID) - { - Plugin* plugin = qobject_cast(sender()); -@@ -301,11 +304,16 @@ void CategoryManager::handlePluginSubItemInfoChanged(const QString& subiemID) - { - QString categoryID = cacheItem.categoryID; - Category* category = m_categorysMap[categoryID]; -+ // 发出主分类子功能项信息变化信号,感兴趣类通过该方法 -+ // 重新加载该主分类下子功能项的信息,例如搜索项 - emit category->subItemInfoChanged(subiemID); - } - } - } - -+/** -+ * NOTE: 该方法为插件调用触发,主面板处理子功能变更,更新二级分类 -+*/ - void CategoryManager::handlePluginSubItemChanged() - { - Plugin* plugin = qobject_cast(sender()); -diff --git a/plugins/network/src/plugin/network-subitem.cpp b/plugins/network/src/plugin/network-subitem.cpp -index 03456d8..b896ba4 100644 ---- a/plugins/network/src/plugin/network-subitem.cpp -+++ b/plugins/network/src/plugin/network-subitem.cpp -@@ -116,40 +116,29 @@ void NetworkSubItem::handleSubItemsChanged() - m_interface->handlePluginSubItemInfoChanged(getID()); - } - -+//TODO: -+//1.用翻译文本做Key后续得改 -+//2.这些文本存在多次拷贝,后续改到一处,避免后续改动不全出问题 - QStringList NetworkSubItem::subItemsList() - { - QStringList subItemsList; - auto wiredList = NetworkUtils::getManagedDeviceList(NetworkManager::Device::Ethernet); - auto wirelessList = NetworkUtils::getManagedDeviceList(NetworkManager::Device::Wifi); -- for (int i = 0; i < wiredList.count(); i++) -+ -+ if (!wiredList.isEmpty()) - { -- QString subItemName = tr("Wired Network %1"); -- QString subItemNameStr = subItemName.arg(i + 1); -- if (wiredList.count() == 1) -- { -- QString name = tr("Wired Network"); -- subItemsList << name; -- } -- else -- subItemsList << subItemNameStr; -+ QString name = tr("Wired Network"); -+ subItemsList << name; - } - -- for (int i = 0; i < wirelessList.count(); i++) -+ if( !wirelessList.isEmpty() ) - { -- QString subItemName = tr("Wireless Network %1"); -- QString subItemNameStr = subItemName.arg(i + 1); -- -- if (wirelessList.count() == 1) -- { -- QString name = tr("Wireless Network"); -- subItemsList << name; -- } -- else -- subItemsList << subItemNameStr; -+ QString name = tr("Wireless Network"); -+ subItemsList << name; - } - - subItemsList << tr("VPN"); - subItemsList << tr("Network Details"); - - return subItemsList; --} -+} -\ No newline at end of file -diff --git a/src/search-edit/search-model.cpp b/src/search-edit/search-model.cpp -index 6afcffe..618342b 100644 ---- a/src/search-edit/search-model.cpp -+++ b/src/search-edit/search-model.cpp -@@ -50,13 +50,14 @@ void SearchModel::loadSearchModel() - QString categoryID = category->getID(); - - auto subitems = category->getSubItems(); -- -- if(subitems.size() > 0) -+ if( subitems.size() == 0 ) - { -- // 添加分类搜索项 -- appendItem(categoryName, categoryID, subitems.at(0)->getID()); -+ continue; - } - -+ // 添加分类搜索项 -+ appendItem(categoryName, categoryID, subitems.at(0)->getID()); -+ - /** - * NOTE: 分类下单个子功能项应不添加搜索项 - * 避免 显示设置分类下显示设置子功能项,构成"显示设置->显示设置"这种搜索项 -@@ -77,6 +78,7 @@ void SearchModel::loadSearchModel() - { - QString subItemSearchKey = QString("%1 -> %2").arg(categoryName).arg(subitemName); - appendItem(subItemSearchKey, categoryID, subitemID); -+ - subItemPrefix = subItemSearchKey; - } - else -@@ -89,6 +91,7 @@ void SearchModel::loadSearchModel() - { - QString searchName = searchItem.first; - QString searchKey = searchItem.second; -+ - QString searchText = QString("%1 -> %2").arg(subItemPrefix).arg(searchName); - appendItem(searchText, categoryID, subitemID, searchKey); - } --- -2.33.0 - diff --git a/0008-fix-appearance-compatible-with-different-versions-of.patch b/0008-fix-appearance-compatible-with-different-versions-of.patch deleted file mode 100644 index 349ed7175f7fc7f5d898b9e58fccd3efe63dbfc9..0000000000000000000000000000000000000000 --- a/0008-fix-appearance-compatible-with-different-versions-of.patch +++ /dev/null @@ -1,135 +0,0 @@ -From 37683287a2b2e068cee02fa87b334fe3ca3f5e06 Mon Sep 17 00:00:00 2001 -From: yuanxing -Date: Fri, 21 Mar 2025 15:15:13 +0800 -Subject: [PATCH] fix(appearance):compatible with different versions of - open-source cursor to prevent program crashes -MIME-Version: 1.0 -Content-Type: text/plain; charset=UTF-8 -Content-Transfer-Encoding: 8bit - -- 兼容不同版本的开源光标,防止程序崩溃 - -Fixes #IBV1XG ---- - .../pages/theme/cursor/cursor-theme-page.cpp | 32 +++++++++++++------ - .../pages/theme/cursor/cursor-theme-page.h | 3 +- - .../appearance/utils/cursor-image-loader.cpp | 6 +++- - 3 files changed, 29 insertions(+), 12 deletions(-) - -diff --git a/plugins/appearance/pages/theme/cursor/cursor-theme-page.cpp b/plugins/appearance/pages/theme/cursor/cursor-theme-page.cpp -index b573d19..0cdcf74 100644 ---- a/plugins/appearance/pages/theme/cursor/cursor-theme-page.cpp -+++ b/plugins/appearance/pages/theme/cursor/cursor-theme-page.cpp -@@ -28,7 +28,14 @@ - #include "exclusion-group.h" - #include "theme-preview-widget.h" - --QStringList CursorThemePage::m_previewCursors = {"left_ptr", "right_ptr", "top_left_corner", "top_right_corner", "size_hor", "pointer"}; -+// 兼容不同开源版本光标名称,若光标名不存在,则使用默认光标 -+static const std::vector cursorNames[] = { -+ {"left_ptr", "default", "top_left_arrow", "left_arrow"}, -+ {"pointing_hand", "pointer", "hand1", "e29285e634086352946a0e7090d73106", "default"}, -+ {"size_ver", "ns-resize", "v_double_arrow", "00008160000006810000408080010102", "default"}, -+ {"size_hor", "ew-resize", "h_double_arrow", "028006030e0e7ebffc7f7070c0600140", "default"}, -+ {"size_bdiag", "nesw-resize", "50585d75b494802d0151028115016902", "fcf1c3c7cd4491d801f1e1c78f100000", "default"}, -+ {"size_fdiag", "nwse-resize", "38c5dff7c7b8962045400281044508d2", "c7088f0f3e6c8088236ef8e1e3e70000", "default"}}; - - CursorThemePage::CursorThemePage(QWidget* parent) : QWidget(parent) - { -@@ -56,7 +63,7 @@ void CursorThemePage::initUI() - layout->addWidget(label_text); - - m_exclusionGroup = new ExclusionGroup(this); -- connect(m_exclusionGroup,&ExclusionGroup::currentItemChanged,this,&CursorThemePage::onCurrentItemChanged); -+ connect(m_exclusionGroup, &ExclusionGroup::currentItemChanged, this, &CursorThemePage::onCurrentItemChanged); - - QWidget* cursorsContainer = new QWidget(this); - m_cursorVlayout = new QVBoxLayout(cursorsContainer); -@@ -81,14 +88,22 @@ void CursorThemePage::loadCurosrThemes() - const QString& themeBaseName = cursorThemeDir.dirName(); - - QList themeCursors; -- for (auto cursorName : m_previewCursors) -+ for (auto cursors : cursorNames) - { -- auto cursorImg = CursorImageLoader::getCursorImage(themeBaseName, cursorName, 22); -- auto curosrPixmap = QPixmap::fromImage(cursorImg); -- themeCursors << curosrPixmap; -+ for (auto cursorName : cursors) -+ { -+ QFileInfo file(cursorThemePath + "/cursors/" + cursorName); -+ if (file.exists()) -+ { -+ auto cursorImg = CursorImageLoader::getCursorImage(themeBaseName, cursorName, 22); -+ auto curosrPixmap = QPixmap::fromImage(cursorImg); -+ themeCursors << curosrPixmap; -+ break; -+ } -+ } - } - -- auto previewWidget = createPreviewWidget(theme.name,themeCursors,theme.name==currentCursorTheme); -+ auto previewWidget = createPreviewWidget(theme.name, themeCursors, theme.name == currentCursorTheme); - m_exclusionGroup->addExclusionItem(previewWidget); - m_cursorVlayout->addWidget(previewWidget); - } -@@ -118,7 +133,7 @@ void CursorThemePage::onCurrentItemChanged() - auto id = current->getID(); - - KLOG_INFO(qLcAppearance) << "cursor theme ui current changed:" << id; -- if( !AppearanceGlobalInfo::instance()->setTheme(APPEARANCE_THEME_TYPE_CURSOR,id) ) -+ if (!AppearanceGlobalInfo::instance()->setTheme(APPEARANCE_THEME_TYPE_CURSOR, id)) - { - KLOG_WARNING(qLcAppearance) << "set current cursor theme" << id << "failed!"; - } -@@ -126,7 +141,6 @@ void CursorThemePage::onCurrentItemChanged() - { - KLOG_INFO(qLcAppearance) << "cursor theme updated:" << id; - } -- - } - - void CursorThemePage::updateCurrentTheme(QString newCursorTheme) -diff --git a/plugins/appearance/pages/theme/cursor/cursor-theme-page.h b/plugins/appearance/pages/theme/cursor/cursor-theme-page.h -index f159fbb..5450a64 100644 ---- a/plugins/appearance/pages/theme/cursor/cursor-theme-page.h -+++ b/plugins/appearance/pages/theme/cursor/cursor-theme-page.h -@@ -13,8 +13,8 @@ - */ - #pragma once - --#include - #include -+#include - - class ExclusionGroup; - class QVBoxLayout; -@@ -42,7 +42,6 @@ private slots: - void onCurrentItemChanged(); - - private: -- static QStringList m_previewCursors; - ExclusionGroup* m_exclusionGroup; - QVBoxLayout* m_cursorVlayout; - QString m_currentCursorTheme; -diff --git a/plugins/appearance/utils/cursor-image-loader.cpp b/plugins/appearance/utils/cursor-image-loader.cpp -index f86115d..71e5036 100644 ---- a/plugins/appearance/utils/cursor-image-loader.cpp -+++ b/plugins/appearance/utils/cursor-image-loader.cpp -@@ -40,8 +40,12 @@ QImage CursorImageLoader::getCursorImage(const QString& cursorTheme, const QStri - XcursorImage* xCursorImage = XcursorLibraryLoadImage(cursorName.toStdString().c_str(), - cursorTheme.toStdString().c_str(), - size); -+ if (!xCursorImage) -+ { -+ return QImage(); -+ } - -- QImage img(reinterpret_cast (xCursorImage->pixels), -+ QImage img(reinterpret_cast(xCursorImage->pixels), - xCursorImage->width, xCursorImage->height, - QImage::Format_ARGB32_Premultiplied); - --- -2.33.0 - diff --git a/kiran-control-panel-2.6.1.tar.gz b/kiran-control-panel-2.6.4.tar.gz similarity index 66% rename from kiran-control-panel-2.6.1.tar.gz rename to kiran-control-panel-2.6.4.tar.gz index 1a2832faaf16e22f99bf94a133aee28cd4b850d7..f2c91b02bbfcf7d5a954755b40157a8b76a53f70 100644 Binary files a/kiran-control-panel-2.6.1.tar.gz and b/kiran-control-panel-2.6.4.tar.gz differ diff --git a/kiran-control-panel.spec b/kiran-control-panel.spec index c336e41ed1b15a8fc91425f3140b092d9d0febe9..e607810df81a3ed36d557f91d210201d1d088c1e 100644 --- a/kiran-control-panel.spec +++ b/kiran-control-panel.spec @@ -1,24 +1,33 @@ +%if ("%{?kylin}" != "") || ("%{?kylinsec}" != "") + %define kiran_for_openeuler 0 + %define kylinsec_server 0 + %if %{defined ks_installclass} && "%{ks_installclass}" == "Server" + %define kylinsec_server 1 + %endif + %if "%{?ks_custom_name}" == "PG" || "%{?kylin_custom_name}" == "PG" + %define kylinsec_server 1 + %endif +%else + %define kiran_for_openeuler 1 +%endif + +%if ("%{?ks_installclass}" == "Desktop") && ("%{?ks_major_version}" == "6") + %define enable_group_plugin 1 +%endif + Name: kiran-control-panel -Version: 2.6.1 -Release: 9%{?dist} +Version: 2.6.4 +Release: 2%{?dist} Summary: Kiran Control Panel Summary(zh_CN): Kiran桌面控制面板 License: MulanPSL-2.0 Source0: %{name}-%{version}.tar.gz - -Patch000: 0000-fix-audio-when-the-tray-is-initialized-determine-whe.patch -Patch001: 0001-fix-keybinding-don-t-convert-normal-key-if-use-shift.patch -Patch002: 0002-fix-audio-network-Compatible-for-versions-below-5.15.patch -Patch003: 0003-fix-power-Fix-has-really-battery-while-it-is-present.patch -Patch004: 0004-fix-network-Fix-network-configuration-filtering-for-.patch -Patch005: 0005-fix-touchpad-Fix-touchpad-display-with-the-type-psmo.patch -Patch006: 0006-fix-search-Adjusting-the-display-style-of-manually-r.patch -Patch007: 0007-fix-network-Crash-caused-by-mismatch-between-registe.patch -Patch008: 0008-fix-appearance-compatible-with-different-versions-of.patch +Patch0000: 0000-feat-power-Supports-dimming-the-monitor-during-idle-.patch +Patch0001: 0001-fix-network-Fix-crash-when-ipv6-address-can-t-be-ret.patch BuildRequires: gcc-c++ -BuildRequires: cmake >= 3.2 +BuildRequires: cmake >= 3.2 BuildRequires: glib2-devel BuildRequires: upower-devel @@ -28,9 +37,10 @@ BuildRequires: pam-devel BuildRequires: cryptopp-devel BuildRequires: libXrandr-devel BuildRequires: libXcursor-devel +BuildRequires: marco-devel BuildRequires: qt5-qtbase-devel -BuildRequires: qt5-qtbase-static +BuildRequires: qt5-qtbase-static BuildRequires: qt5-qtbase-private-devel BuildRequires: qt5-qtx11extras-devel BuildRequires: qt5-qtsvg-devel @@ -57,8 +67,8 @@ Requires: kf5-networkmanager-qt Requires: kiran-log-qt5 Requires: kiran-widgets-qt5 >= 2.4 Requires: kiran-qt5-integration >= 2.4 -Requires: kiran-system-daemon >= 2.4 -Requires: kiran-session-daemon >= 2.4 +Requires: kiran-system-daemon >= 2.6.1-25 +Requires: kiran-session-daemon >= 2.6.1-25 Requires: kiran-authentication-service >= 2.5 Requires: glib2 @@ -70,10 +80,11 @@ Requires: cryptopp Requires: libqtxdg Requires: kf5-kconfig -Requires: NetworkManager-l2tp +#Recommends +#Requires: NetworkManager-l2tp #Requires: NetworkManager-pptp -%if "%{ks_custom_name}" == "GC" +%if "%{?enable_group_plugin}" == "1" Requires: group-service %endif @@ -86,6 +97,7 @@ Obsoletes: kiran-cpanel-mouse < 2.3 Obsoletes: kiran-cpanel-power < 2.3 Obsoletes: kiran-cpanel-system < 2.3 Obsoletes: kiran-cpanel-timedate < 2.3 +Obsoletes: kiran-timedate-manager %description Kiran Control Panel @@ -125,8 +137,15 @@ Summary: Development files for kiran control panel plugin %autosetup -p 1 %build -%cmake - +%{__mkdir} -p %{buildroot} +%cmake \ +%if "%{?kylinsec_server}" == "1" +-DSERVER_MODE=on \ +%endif +%if "%{?enable_group_plugin}" == "1" +-DENABLE_USER_GROUP=on \ +%endif + %cmake_build %install @@ -140,7 +159,7 @@ Summary: Development files for kiran control panel plugin %{_datadir}/icons/hicolor/* %exclude %{_datadir}/applications/kiran-control-panel.desktop %{_libexecdir}/kiran-avatar-editor - +%{_libexecdir}/wm-theme-thumbnailer #audio %{_sysconfdir}/xdg/autostart/kiran-audio-status-icon.desktop @@ -151,7 +170,6 @@ Summary: Development files for kiran control panel plugin %{_bindir}/kiran-network-status-icon /etc/NetworkManager/conf.d/00-server.conf - %files -n kiran-cpanel-launcher %{_bindir}/kiran-cpanel-launcher @@ -160,16 +178,51 @@ Summary: Development files for kiran control panel plugin %{_includedir}/kiran-control-panel/* %{_libdir}/pkgconfig/kiran-control-panel.pc +%clean +rm -rf %{buildroot} + %changelog -* Fri Mar 21 2025 yuanxing - 2.6.1-9 -- KYOS-F: Compatible with different versions of open-source cursors to prevent program crashes.(#IBV1XG) +* Thu Apr 03 2025 liuxinhao - 2.6.4-2 +- KYOS-B: Fix crash when ipv6 address can't be retrieved(#75993) +- KYOS-F: Supports dimming the monitor during idle time(#76040) +- KYOS-F: Supports Meta and Window theme settings(#73665) +- KYOS-F: Support for sound testing(#73668) +- KYOS-B: compatible with different versions of open-source cursor to prevent program crashes(#IBV1XG) +- KYOS-F: Split Screensaver and locking concepts, add support for embedded xscreensaver(#73664) +- KYOS-F:Fix the problem of web details supporting large layouts.(#72894) +- KYOS-F:improve code in group plugin.(#73623) +- KYOS-F: Fix the problem of getting the return value of a device via NetworkManager DBus interface under stress test(#70121) +- KYOS-B: Fix password input limit of 20(#57392) +- KYOS-B: power management front-end server version determination to runtime configuration(#52885) +- KYOS-B: Fixes an issue with determining connection and NIC Mac configuration matches when a connection configuration change is active(#51089) +- KYOS-B: Fix the message that the tray service is not registered when the tray is registered.(#50967) +- KYOS-B: shared Networks Add Configuration Invisible (#51089) +- KYOS-B: shared Networks Add Configuration Invisible(#51089) +- KYOS-B: Fix the message that the tray service is not registered when the tray is registered.(#50967) +- KYOS-F: hide privacy_policy(#35818) +- KYOS-F: adjusting the default configuration of the PG version to the server configuration(#51253) +- KYOS-B: Fix Control Center NIC duplication when restarting NetworkManager(#50967) +- KYOS-B: Add DISPLAY as one of the conditions for determining a user process singleton.(#48260) +- KYOS-B: remove NetworkManager-l2tp Requires +- KYOS-F: network details page supports multiple IP masks(#46740) +- KYOS-B: Fix DBusServiceWatcher lifecycle not bound to slot object(#46755) +- KYOS-B: Fix that the maximum height of KiranCollapse will not be adjusted under the list of available connections in the network plugin(#47197) +- KYOS-F: network plugin support wired carrier check(#36646) +- KYOS-F: netowrk plugin support single configuration multiple IP addresses(#46740) +- KYOS-B: add Obsoletes kiran-timedate-manager +- KYOS-F: fix build in 339 +- KYOS-B: Adapt to Qt5.9.7 NativeScanCode to QtKey +- KYOS-F: new network card Carrier status check as tray connection condition judgment(#36646) +- KYOS-F: Reserved idle lock screen related configurations for server versions(#31787) +- KYOS-B: fix gateway display not configured tray icon show disconnection(#36646) +- KYOS-B: Fix the issue where the initial letters of certain categories are not capitalized.(#36266) * Wed Nov 20 2024 Funda Wang - 2.6.1-8 - adopt to new cmake macro * Fri Apr 19 2024 liuxinhao - 2.6.1-7 - KYOS-B: Fix Crash caused by mismatch between registered search terms and actual content(#35252) -- KYOS-B: Adjusting the display style of manually registered search keywords and subfunctional keywords(#35340,#35278) +- KYOS-B: Adjusting the display style of manually registered search keywords and subfunctional keywords(#35340,#35278) * Wed Apr 17 2024 meizhigang - 2.6.1-6 - KYOS-B: Fix touchpad display with the type psmouse (#34878) @@ -329,7 +382,7 @@ Summary: Development files for kiran control panel plugin - KYOS-T: add some translation * Wed Apr 05 2023 liuxinhao - 2.5.0-1 -- KYOS-F: add authentication manager and user group plugin +- KYOS-F: add authentication manager and user group plugin * Mon Mar 27 2023 luoqing - 2.4.1-4 - KYOS-F: Fix an error where the sound output left/right balance function fails @@ -421,7 +474,7 @@ Summary: Development files for kiran control panel plugin - KYOS-B: fix some bugs of network and audio plugins * Tue Jul 12 2022 liuxinhao - 2.3.1-4 -- KYOS-B: fix kiran control panel translator +- KYOS-B: fix kiran control panel translator * Mon Jul 11 2022 liuxinhao - 2.3.1-3 - KYOS-B: fix system infomation plugin build require @@ -477,7 +530,7 @@ Summary: Development files for kiran control panel plugin - KYOS-F: launcher set LC_TIME to UTF-8 (#43747) * Wed Jun 30 2021 liuxinhao - 2.1.0-3.kb1 -- KYOS-B: desktop file lacks keywords key allow loading +- KYOS-B: desktop file lacks keywords key allow loading * Wed Jun 16 2021 liuxinhao - 2.1.0-2.kb1 - KYOS-B: update the sub function list display