同步 2.6.0 到 2.6.1-3
This commit is contained in:
parent
f8a0c39b18
commit
ec4e3e537d
@ -0,0 +1,53 @@
|
||||
From 278237ebcb646037d6c77ebbbf3a9629d2b086c0 Mon Sep 17 00:00:00 2001
|
||||
From: luoqing <luoqing@kylinsec.com.cn>
|
||||
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<QString> 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<QString> 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
|
||||
|
||||
@ -1,32 +0,0 @@
|
||||
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
387
0001-fix-keybinding-don-t-convert-normal-key-if-use-shift.patch
Normal file
387
0001-fix-keybinding-don-t-convert-normal-key-if-use-shift.patch
Normal file
@ -0,0 +1,387 @@
|
||||
From 879b452cc80dccb6581fea70a671a86994fb3a45 Mon Sep 17 00:00:00 2001
|
||||
From: yuan_xing <yuanxing@kylinsec.com.cn>
|
||||
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 <QInputMethodEvent>
|
||||
#include <QPainter>
|
||||
#include <QStyleOption>
|
||||
+#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<int> 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 <yuanxing@kylinsec.com.cn>
|
||||
+ */
|
||||
+
|
||||
+#include "keycode-helper.h"
|
||||
+
|
||||
+#include <X11/Xlib.h>
|
||||
+
|
||||
+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 <yuanxing@kylinsec.com.cn>
|
||||
+ */
|
||||
+
|
||||
+#pragma once
|
||||
+
|
||||
+#include <QX11Info>
|
||||
+#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 <QtXkbCommonSupport/private/qxkbcommon_p.h>
|
||||
#include <qt5-log-i.h>
|
||||
-#include <QMetaEnum>
|
||||
#include <QApplication>
|
||||
+#include <QMetaEnum>
|
||||
+#include "keycode-helper.h"
|
||||
|
||||
static QMetaEnum keyMetaEnum = QMetaEnum::fromType<KeycodeTranslator::Key>();
|
||||
|
||||
@@ -89,23 +91,22 @@ static const QMap<QString, QString> MediaKeyMap = {
|
||||
KeycodeTranslator::KeycodeTranslator(QObject *parent)
|
||||
: QObject(parent)
|
||||
{
|
||||
-
|
||||
}
|
||||
|
||||
QString KeycodeTranslator::keycode2ReadableString(const QList<int> &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<int> &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<int> &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<keyList.size();i++)
|
||||
+ for (int i = 0; i < keyList.size(); i++)
|
||||
{
|
||||
- if( SpecialKeyMap.contains(keyList.at(i).toLower()) )
|
||||
+ if (SpecialKeyMap.contains(keyList.at(i).toLower()))
|
||||
{
|
||||
- keyList.replace(i,SpecialKeyMap.value(keyList.at(i).toLower()));
|
||||
+ keyList.replace(i, SpecialKeyMap.value(keyList.at(i).toLower()));
|
||||
}
|
||||
else if (MediaKeyMap.contains(keyList.at(i)))
|
||||
{
|
||||
@@ -174,7 +182,7 @@ QString KeycodeTranslator::backendKeyString2Readable(const QString &keyString)
|
||||
QString KeycodeTranslator::readableKeyString2Backend(const QString &keyString)
|
||||
{
|
||||
QStringList keystrings = keyString.split('+');
|
||||
- for( int i=0;i<keystrings.count();i++ )
|
||||
+ for (int i = 0; i < keystrings.count(); i++)
|
||||
{
|
||||
QString key = keystrings.at(i);
|
||||
|
||||
diff --git a/plugins/keybinding/utils/keycode-translator.h b/plugins/keybinding/utils/keycode-translator.h
|
||||
index 2697b43..40e91f1 100644
|
||||
--- a/plugins/keybinding/utils/keycode-translator.h
|
||||
+++ b/plugins/keybinding/utils/keycode-translator.h
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#include <QObject>
|
||||
|
||||
-class KeycodeTranslator : public QObject
|
||||
+class KeycodeTranslator : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -174,9 +174,9 @@ private:
|
||||
|
||||
public:
|
||||
static QString keycode2ReadableString(const QList<int>& 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
|
||||
|
||||
@ -0,0 +1,50 @@
|
||||
From e59ea47e98c22618f260a724938c0a55d62a91ed Mon Sep 17 00:00:00 2001
|
||||
From: luoqing <luoqing@kylinsec.com.cn>
|
||||
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<QAbstractSocket::SocketError>::of(&QAbstractSocket::error),this, &NetworkTray::internetError);
|
||||
+#endif
|
||||
}
|
||||
|
||||
void NetworkTray::checkInternetConnectivity()
|
||||
--
|
||||
2.27.0
|
||||
|
||||
@ -1,93 +0,0 @@
|
||||
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
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
From 78e2ba6f38de67917befdabfe9d40a910b02a88c Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Fri, 15 Dec 2023 16:13:08 +0800
|
||||
Subject: [PATCH 03/17] fix(LC_TIME): set LC_TIME to UTF-8
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
根据环境变量重新设置LC_TIME为UTF-8
|
||||
|
||||
Closes #21517,#24064
|
||||
---
|
||||
src/main.cpp | 18 ++++++++++++++++++
|
||||
1 file changed, 18 insertions(+)
|
||||
|
||||
diff --git a/src/main.cpp b/src/main.cpp
|
||||
index 05f7153..981fdbf 100644
|
||||
--- a/src/main.cpp
|
||||
+++ b/src/main.cpp
|
||||
@@ -165,6 +165,24 @@ int main(int argc, char *argv[])
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
|
||||
+ /// NOTE: 由于strftime获取系统locale进行格式化,Qt使用UTF8,若编码设置不为UTF8中文环境下会导致乱码
|
||||
+ /// 所以LANG后面的编码若不为UTF-8,修改成UTF-8,使获取时间都为UTF-8格式
|
||||
+ QString lang = qgetenv("LANG");
|
||||
+ if (lang.contains("."))
|
||||
+ {
|
||||
+#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
+ QStringList splitRes = lang.split(".", QString::SkipEmptyParts);
|
||||
+#else
|
||||
+ QStringList splitRes = lang.split(".", Qt::SkipEmptyParts);
|
||||
+#endif
|
||||
+ if(splitRes.size() == 2 && splitRes.at(1)!="UTF-8" )
|
||||
+ {
|
||||
+ splitRes.replace(1, "UTF-8");
|
||||
+ QString newLocale = splitRes.join(".");
|
||||
+ setlocale(LC_TIME, newLocale.toStdString().c_str());
|
||||
+ }
|
||||
+ }
|
||||
+
|
||||
// 安装翻译
|
||||
installTranslator();
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,50 +0,0 @@
|
||||
From f803d07ba85e579776fb185f4878b6fcd6c17ddf Mon Sep 17 00:00:00 2001
|
||||
From: luoqing <luoqing@kylinsec.com.cn>
|
||||
Date: Thu, 21 Dec 2023 09:25:47 +0800
|
||||
Subject: [PATCH 04/17] fix(network):fix compile issues,QString::SkipEmptyParts
|
||||
is used under Qt 5.14
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修复编译问题,在Qt 5.14 以下使用QString::SkipEmptyParts
|
||||
---
|
||||
plugins/network/src/plugin/setting-widget/ipv4-widget.cpp | 4 ++++
|
||||
plugins/network/src/plugin/setting-widget/ipv6-widget.cpp | 4 ++++
|
||||
2 files changed, 8 insertions(+)
|
||||
|
||||
diff --git a/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp b/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp
|
||||
index da46dab..fa23708 100644
|
||||
--- a/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp
|
||||
+++ b/plugins/network/src/plugin/setting-widget/ipv4-widget.cpp
|
||||
@@ -131,7 +131,11 @@ void Ipv4Widget::saveSettings()
|
||||
{
|
||||
//多个DNS以分号分隔
|
||||
QString dnsString = ui->ipv4DNS->text();
|
||||
+#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
+ QStringList dnsList = dnsString.split(";",QString::SkipEmptyParts);
|
||||
+#else
|
||||
QStringList dnsList = dnsString.split(";",Qt::SkipEmptyParts);
|
||||
+#endif
|
||||
for(auto dns : dnsList)
|
||||
{
|
||||
ipv4DNS << QHostAddress(dns);
|
||||
diff --git a/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp b/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp
|
||||
index feefdcf..d19a5e0 100644
|
||||
--- a/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp
|
||||
+++ b/plugins/network/src/plugin/setting-widget/ipv6-widget.cpp
|
||||
@@ -124,7 +124,11 @@ void Ipv6Widget::saveSettings()
|
||||
{
|
||||
//多个DNS以分号分隔
|
||||
QString dnsString = ui->ipv6DNS->text();
|
||||
+#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||
+ QStringList dnsList = dnsString.split(";",QString::SkipEmptyParts);
|
||||
+#else
|
||||
QStringList dnsList = dnsString.split(";",Qt::SkipEmptyParts);
|
||||
+#endif
|
||||
for(auto dns : dnsList)
|
||||
{
|
||||
ipv6DNS << QHostAddress(dns);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,202 +0,0 @@
|
||||
From b7eb0462cb754bccde3afc53b151a9b6b61e4143 Mon Sep 17 00:00:00 2001
|
||||
From: luoqing <luoqing@kylinsec.com.cn>
|
||||
Date: Wed, 3 Jan 2024 13:49:14 +0800
|
||||
Subject: [PATCH 05/17] fix(audio):listen to mute property change to fix
|
||||
shortcut key mute, volume icon unchanged issue
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 监听mute静音属性变化,以修复快捷键静音,音量图标未变化的问题
|
||||
|
||||
Related #25508
|
||||
---
|
||||
.../src/system-tray/audio-system-tray.cpp | 12 ++++
|
||||
.../src/system-tray/volume-setting-page.cpp | 69 ++++++++++++-------
|
||||
.../src/system-tray/volume-setting-page.h | 5 +-
|
||||
3 files changed, 60 insertions(+), 26 deletions(-)
|
||||
|
||||
diff --git a/plugins/audio/src/system-tray/audio-system-tray.cpp b/plugins/audio/src/system-tray/audio-system-tray.cpp
|
||||
index eb554b2..ed4412f 100644
|
||||
--- a/plugins/audio/src/system-tray/audio-system-tray.cpp
|
||||
+++ b/plugins/audio/src/system-tray/audio-system-tray.cpp
|
||||
@@ -124,6 +124,18 @@ void AudioSystemTray::initConnect()
|
||||
setTrayIcon(currentVolume);
|
||||
});
|
||||
|
||||
+ connect(m_volumeSettingPage,&VolumeSettingPage::sinkMuteChanged,[this](bool mute,double currentVolume)
|
||||
+ {
|
||||
+ if(mute)
|
||||
+ {
|
||||
+ setTrayIcon(0);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ setTrayIcon(currentVolume);
|
||||
+ }
|
||||
+ });
|
||||
+
|
||||
connect(Kiran::StylePalette::instance(), &Kiran::StylePalette::themeChanged, [this](Kiran::PaletteType paletteType)
|
||||
{
|
||||
//获取当前音量值重新设置TrayIcon
|
||||
diff --git a/plugins/audio/src/system-tray/volume-setting-page.cpp b/plugins/audio/src/system-tray/volume-setting-page.cpp
|
||||
index 03116c7..dbb1cd8 100644
|
||||
--- a/plugins/audio/src/system-tray/volume-setting-page.cpp
|
||||
+++ b/plugins/audio/src/system-tray/volume-setting-page.cpp
|
||||
@@ -15,8 +15,8 @@
|
||||
#include "dbus/audio-device-interface.h"
|
||||
#include "dbus/audio-interface.h"
|
||||
#include "dbus/audio-stream-interface.h"
|
||||
-#include "ui_volume-setting-page.h"
|
||||
#include "logging-category.h"
|
||||
+#include "ui_volume-setting-page.h"
|
||||
|
||||
#include <kiran-session-daemon/audio-i.h>
|
||||
#include <qt5-log-i.h>
|
||||
@@ -41,7 +41,9 @@ VolumeSettingPage::VolumeSettingPage(enum AudioNode audio, const QString objectP
|
||||
m_sink = new AudioDeviceInterface(AUDIO_DBUS_NAME, defaultSinkPath, QDBusConnection::sessionBus(), this);
|
||||
initAudioDevice();
|
||||
|
||||
- connect(m_sink, &AudioDeviceInterface::volumeChanged, this, &VolumeSettingPage::handleVolumeChanged);
|
||||
+ connect(m_sink, &AudioDeviceInterface::volumeChanged, this, &VolumeSettingPage::handleVolumeChanged, Qt::UniqueConnection);
|
||||
+ connect(m_sink, &AudioDeviceInterface::muteChanged, this, &VolumeSettingPage::changeSinkMute, Qt::UniqueConnection);
|
||||
+
|
||||
connect(ui->volumeSetting, &QSlider::valueChanged, [this](int value)
|
||||
{
|
||||
double volumeValue = value / 100.0;
|
||||
@@ -101,6 +103,7 @@ void VolumeSettingPage::initAudioStream()
|
||||
initSettings(m_sinkInput);
|
||||
ui->volumeName->setText(m_sinkInput->GetProperty("application.name"));
|
||||
connect(m_sinkInput, &AudioStreamInterface::volumeChanged, this, &VolumeSettingPage::handleVolumeChanged);
|
||||
+ connect(m_sinkInput, &AudioStreamInterface::muteChanged, this, &VolumeSettingPage::changeSinkInputMute);
|
||||
connect(ui->volumeSetting, &QSlider::valueChanged, [this](int value)
|
||||
{
|
||||
double volumeValue = value / 100.0;
|
||||
@@ -123,10 +126,38 @@ void VolumeSettingPage::initSettings(Audio *audio)
|
||||
ui->volume->setText(QString::number(currentVolume) + "%");
|
||||
}
|
||||
|
||||
+void VolumeSettingPage::changeSinkMute(bool value)
|
||||
+{
|
||||
+ KLOG_DEBUG() << "change sink mute:" << value;
|
||||
+ double currentVolume = m_sink->volume() * 100;
|
||||
+ emit sinkMuteChanged(value, currentVolume);
|
||||
+ if (value)
|
||||
+ {
|
||||
+ setVolumeIcon(0);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ setVolumeIcon(currentVolume);
|
||||
+ }
|
||||
+}
|
||||
+void VolumeSettingPage::changeSinkInputMute(bool value)
|
||||
+{
|
||||
+ KLOG_DEBUG() << "change sink input mute:" << value;
|
||||
+ double currentVolume = m_sinkInput->volume() * 100;
|
||||
+ if (value)
|
||||
+ {
|
||||
+ setVolumeIcon(0);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ setVolumeIcon(currentVolume);
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void VolumeSettingPage::handleVolumeChanged(double value)
|
||||
{
|
||||
- QSignalBlocker blocker(ui->volumeSetting); // 为了避免拖动的同时设置位置会出现问题
|
||||
- int currentVolume = round(value * 100); // 表示数值的时候向上取整
|
||||
+ QSignalBlocker blocker(ui->volumeSetting); // 为了避免拖动的同时设置位置会出现问题
|
||||
+ int currentVolume = round(value * 100); // 表示数值的时候向上取整
|
||||
ui->volume->setText(QString::number(currentVolume) + "%");
|
||||
setVolumeIcon(currentVolume);
|
||||
ui->volumeSetting->setValue(currentVolume);
|
||||
@@ -136,9 +167,9 @@ void VolumeSettingPage::handleVolumeChanged(double value)
|
||||
void VolumeSettingPage::handleMuteButtonClicked()
|
||||
{
|
||||
if (m_audioNode == AUDIO_DEVICE)
|
||||
- clickMuteButton(m_sink);
|
||||
+ switchMute(m_sink);
|
||||
else
|
||||
- clickMuteButton(m_sinkInput);
|
||||
+ switchMute(m_sinkInput);
|
||||
}
|
||||
|
||||
void VolumeSettingPage::handleDefaultSinkChanged(int index)
|
||||
@@ -154,7 +185,8 @@ void VolumeSettingPage::handleDefaultSinkChanged(int index)
|
||||
QDBusPendingReply<QString> defaultSinkPath = m_audioInterface->GetDefaultSink();
|
||||
m_sink = new AudioDeviceInterface(AUDIO_DBUS_NAME, defaultSinkPath, QDBusConnection::sessionBus(), this);
|
||||
initAudioDevice();
|
||||
- connect(m_sink, &AudioDeviceInterface::volumeChanged, this, &VolumeSettingPage::handleVolumeChanged);
|
||||
+ connect(m_sink, &AudioDeviceInterface::volumeChanged, this, &VolumeSettingPage::handleVolumeChanged, Qt::UniqueConnection);
|
||||
+ connect(m_sink, &AudioDeviceInterface::muteChanged, this, &VolumeSettingPage::changeSinkMute, Qt::UniqueConnection);
|
||||
}
|
||||
|
||||
void VolumeSettingPage::handleSinkAdded(int index)
|
||||
@@ -187,30 +219,17 @@ void VolumeSettingPage::handleSinkDelete(int index)
|
||||
}
|
||||
|
||||
template <class Audio>
|
||||
-void VolumeSettingPage::clickMuteButton(Audio *audio)
|
||||
+void VolumeSettingPage::switchMute(Audio *audio)
|
||||
{
|
||||
- double currentVolumeDouble = audio->volume() * 100;
|
||||
- int currentVolume = round(currentVolumeDouble);
|
||||
-
|
||||
- if (currentVolume != 0)
|
||||
+ if (!audio->mute())
|
||||
{
|
||||
- m_volumeBeforeMute = currentVolume;
|
||||
- if (!audio->mute())
|
||||
- {
|
||||
- audio->SetMute(true);
|
||||
- }
|
||||
- audio->SetVolume(0);
|
||||
- KLOG_DEBUG(qLcAudio) << "current sink is mute :" << audio->mute();
|
||||
+ audio->SetMute(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
- if (m_volumeBeforeMute != 0)
|
||||
- {
|
||||
- //重新设置音量时,会自动解除静音状态
|
||||
- audio->SetVolume(m_volumeBeforeMute / 100.0);
|
||||
- m_volumeBeforeMute = 0;
|
||||
- }
|
||||
+ audio->SetMute(false);
|
||||
}
|
||||
+ KLOG_DEBUG() << "current defalut sink mute:" << audio->mute();
|
||||
}
|
||||
|
||||
// XXX:频繁调用函数,需要优化
|
||||
diff --git a/plugins/audio/src/system-tray/volume-setting-page.h b/plugins/audio/src/system-tray/volume-setting-page.h
|
||||
index 80f0098..4a556fe 100644
|
||||
--- a/plugins/audio/src/system-tray/volume-setting-page.h
|
||||
+++ b/plugins/audio/src/system-tray/volume-setting-page.h
|
||||
@@ -41,6 +41,8 @@ public:
|
||||
void disableSettings();
|
||||
|
||||
public slots:
|
||||
+ void changeSinkMute(bool value);
|
||||
+ void changeSinkInputMute(bool value);
|
||||
void handleVolumeChanged(double value);
|
||||
void handleMuteButtonClicked();
|
||||
void handleDefaultSinkChanged(int index);
|
||||
@@ -57,10 +59,11 @@ private:
|
||||
template <class Audio>
|
||||
void initSettings(Audio *audio);
|
||||
template <class Audio>
|
||||
- void clickMuteButton(Audio *audio);
|
||||
+ void switchMute(Audio *audio);
|
||||
|
||||
signals:
|
||||
void volumeChanged(double value);
|
||||
+ void sinkMuteChanged(bool mute, double currentVolume);
|
||||
|
||||
private:
|
||||
Ui::VolumeSettingPage *ui;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,183 +0,0 @@
|
||||
From 2bae469f6fdd42c15d574a0d4642d13a2fcf3d8b Mon Sep 17 00:00:00 2001
|
||||
From: luoqing <luoqing@kylinsec.com.cn>
|
||||
Date: Thu, 4 Jan 2024 11:17:57 +0800
|
||||
Subject: [PATCH 06/17] fix(network):fixd an issue where the network tray icon
|
||||
was incorrectly displayed when there was no primary connection
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修复当没有主连接时,网络托盘图标显示不准确的问题
|
||||
|
||||
Closes #25475, #25037, #25032
|
||||
---
|
||||
plugins/network/src/general.h | 1 +
|
||||
plugins/network/src/tray/network-tray.cpp | 90 +++++++++++++++++------
|
||||
2 files changed, 68 insertions(+), 23 deletions(-)
|
||||
|
||||
diff --git a/plugins/network/src/general.h b/plugins/network/src/general.h
|
||||
index 8aa4f67..c65ce78 100644
|
||||
--- a/plugins/network/src/general.h
|
||||
+++ b/plugins/network/src/general.h
|
||||
@@ -24,6 +24,7 @@
|
||||
|
||||
enum NetworkState
|
||||
{
|
||||
+ UNKNOWN,
|
||||
WIRED_CONNECTED,
|
||||
WIRED_CONNECTED_BUT_NOT_ACCESS_INTERNET,
|
||||
WIRELESS_CONNECTED,
|
||||
diff --git a/plugins/network/src/tray/network-tray.cpp b/plugins/network/src/tray/network-tray.cpp
|
||||
index 00b6685..db6e0cd 100644
|
||||
--- a/plugins/network/src/tray/network-tray.cpp
|
||||
+++ b/plugins/network/src/tray/network-tray.cpp
|
||||
@@ -20,17 +20,17 @@
|
||||
#include <QMenu>
|
||||
#include <QPainter>
|
||||
#include <QPainterPath>
|
||||
+#include <QTcpSocket>
|
||||
+#include <QTimer>
|
||||
#include <QVBoxLayout>
|
||||
#include "config.h"
|
||||
+#include "logging-category.h"
|
||||
#include "status-notification.h"
|
||||
#include "status-notifier-manager.h"
|
||||
#include "tray-page.h"
|
||||
#include "utils.h"
|
||||
#include "wired-tray-widget.h"
|
||||
#include "wireless-tray-widget.h"
|
||||
-#include <QTcpSocket>
|
||||
-#include <QTimer>
|
||||
-#include "logging-category.h"
|
||||
|
||||
using namespace NetworkManager;
|
||||
|
||||
@@ -359,42 +359,70 @@ void NetworkTray::getTrayGeometry()
|
||||
void NetworkTray::updateTrayIcon()
|
||||
{
|
||||
auto status = NetworkManager::status();
|
||||
- if (status != NetworkManager::Status::Connected)
|
||||
+ if (status < NetworkManager::Status::ConnectedLinkLocal)
|
||||
{
|
||||
setTrayIcon(DISCONNECTED);
|
||||
return;
|
||||
}
|
||||
|
||||
+#define SET_TRAY_ICON_AND_CHECK_CONNECTIVITY_AND_RETURN(state) \
|
||||
+ if (state != UNKNOWN) \
|
||||
+ { \
|
||||
+ setTrayIcon(state); \
|
||||
+ checkInternetConnectivity(); \
|
||||
+ return; \
|
||||
+ }
|
||||
+
|
||||
+ NetworkState state = UNKNOWN;
|
||||
// 判断主连接类型,托盘网络图标以主连接类型为准
|
||||
// NetworkManager::primaryConnectionType() 更新不及时,暂时不用
|
||||
+ /**
|
||||
+ * NOTE:
|
||||
+ * 注意特殊情况,如果当网络状态为已连接,但是没有主连接,则遍历所有已激活的连接,
|
||||
+ * 按有线优先于无线的原则,如果存在激活的有线连接,则显示有线网络图标;其次显示无线网络图标
|
||||
+ * 如果既不是有线也不是无线,则显示有线网络图标
|
||||
+ */
|
||||
ActiveConnection::Ptr primaryActiveConnection = primaryConnection();
|
||||
- if (primaryActiveConnection.isNull())
|
||||
+ if (!primaryActiveConnection.isNull())
|
||||
{
|
||||
- KLOG_INFO(qLcNetwork) << "update tray icon failed, primary active connection is null";
|
||||
- return;
|
||||
+ if (primaryActiveConnection->type() == ConnectionSettings::Wireless)
|
||||
+ {
|
||||
+ state = WIRELESS_CONNECTED_BUT_NOT_ACCESS_INTERNET;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ state = WIRED_CONNECTED_BUT_NOT_ACCESS_INTERNET;
|
||||
+ }
|
||||
}
|
||||
+ SET_TRAY_ICON_AND_CHECK_CONNECTIVITY_AND_RETURN(state);
|
||||
|
||||
- // NetworkManager::connectivity() 不准确,使用checkConnectivity
|
||||
- QDBusPendingReply<uint> reply = NetworkManager::checkConnectivity();
|
||||
- reply.waitForFinished();
|
||||
- uint result = reply.value();
|
||||
-
|
||||
- if (result == NetworkManager::Connectivity::Full)
|
||||
+ KLOG_INFO(qLcNetwork) << "primary active connection is null";
|
||||
+ ActiveConnection::List list = activeConnections();
|
||||
+ for (auto connection : list)
|
||||
{
|
||||
- checkInternetConnectivity();
|
||||
- return;
|
||||
+ if (connection->type() == ConnectionSettings::ConnectionType::Wired)
|
||||
+ {
|
||||
+ state = WIRED_CONNECTED_BUT_NOT_ACCESS_INTERNET;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
+ SET_TRAY_ICON_AND_CHECK_CONNECTIVITY_AND_RETURN(state);
|
||||
|
||||
- NetworkState state;
|
||||
- if (primaryActiveConnection->type() == ConnectionSettings::Wireless)
|
||||
+ for (auto connection : list)
|
||||
{
|
||||
- state = WIRELESS_CONNECTED_BUT_NOT_ACCESS_INTERNET;
|
||||
+ if (connection->type() == ConnectionSettings::ConnectionType::Wireless)
|
||||
+ {
|
||||
+ state = WIRELESS_CONNECTED_BUT_NOT_ACCESS_INTERNET;
|
||||
+ break;
|
||||
+ }
|
||||
}
|
||||
- else
|
||||
+
|
||||
+ //最后如果既不是有线也不是无线,则显示有线网络图标
|
||||
+ if (state == UNKNOWN)
|
||||
{
|
||||
state = WIRED_CONNECTED_BUT_NOT_ACCESS_INTERNET;
|
||||
}
|
||||
- setTrayIcon(state);
|
||||
+ SET_TRAY_ICON_AND_CHECK_CONNECTIVITY_AND_RETURN(state);
|
||||
}
|
||||
|
||||
void NetworkTray::setTrayIcon(NetworkState state)
|
||||
@@ -712,6 +740,15 @@ void NetworkTray::initTcpSocket()
|
||||
|
||||
void NetworkTray::checkInternetConnectivity()
|
||||
{
|
||||
+ // NetworkManager::connectivity() 不准确,使用checkConnectivity
|
||||
+ QDBusPendingReply<uint> reply = NetworkManager::checkConnectivity();
|
||||
+ reply.waitForFinished();
|
||||
+ uint result = reply.value();
|
||||
+ if (result != NetworkManager::Connectivity::Full)
|
||||
+ {
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
QSettings confSettings(SETTINGS_PATH, QSettings::NativeFormat);
|
||||
QVariant enable = confSettings.value(QString("Network/CheckInternetConnectivity"));
|
||||
KLOG_DEBUG(qLcNetwork) << "check Internet Connectivity : " << enable;
|
||||
@@ -728,11 +765,18 @@ void NetworkTray::checkInternetConnectivity()
|
||||
void NetworkTray::internetConnected()
|
||||
{
|
||||
KLOG_DEBUG(qLcNetwork) << "Connectivity check pass";
|
||||
- ActiveConnection::Ptr primaryActiveConnection = primaryConnection();
|
||||
NetworkState state;
|
||||
- if (primaryActiveConnection->type() == ConnectionSettings::Wireless)
|
||||
+ ActiveConnection::Ptr primaryActiveConnection = primaryConnection();
|
||||
+ if (!primaryActiveConnection.isNull())
|
||||
{
|
||||
- state = WIRELESS_CONNECTED;
|
||||
+ if (primaryActiveConnection->type() == ConnectionSettings::Wireless)
|
||||
+ {
|
||||
+ state = WIRELESS_CONNECTED;
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ state = WIRED_CONNECTED;
|
||||
+ }
|
||||
}
|
||||
else
|
||||
{
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,63 +0,0 @@
|
||||
From 3ccdcfbc6d104f1f691b7feaf6ed58daae21da63 Mon Sep 17 00:00:00 2001
|
||||
From: niko_yhc <yinhongchang@kylinsec.com.cn>
|
||||
Date: Mon, 8 Jan 2024 13:48:50 +0800
|
||||
Subject: [PATCH 07/17] fix(application):add a compilation switch to control
|
||||
whether the application-plugin is turned on
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 添加编译开关控制application-plugin是否打开
|
||||
---
|
||||
cmake/options.cmake | 3 ++-
|
||||
data/CMakeLists.txt | 5 +++++
|
||||
plugins/CMakeLists.txt | 4 +++-
|
||||
3 files changed, 10 insertions(+), 2 deletions(-)
|
||||
|
||||
diff --git a/cmake/options.cmake b/cmake/options.cmake
|
||||
index f21d2b9..bc56591 100644
|
||||
--- a/cmake/options.cmake
|
||||
+++ b/cmake/options.cmake
|
||||
@@ -3,4 +3,5 @@ option(PASSWD_EXPIRATION_POLICY_VISIBLE "Is password expiration policy visible"
|
||||
|
||||
OPTION(ENABLE_USER_GROUP "Enable user group" OFF)
|
||||
OPTION(ENABLE_NETWORK "Enable network plugin" ON)
|
||||
-OPTION(ENABLE_AUDIO "Enable audio plugin" ON)
|
||||
\ No newline at end of file
|
||||
+OPTION(ENABLE_AUDIO "Enable audio plugin" ON)
|
||||
+OPTION(ENABLE_APPLICATION "Enable application plugin" ON)
|
||||
\ No newline at end of file
|
||||
diff --git a/data/CMakeLists.txt b/data/CMakeLists.txt
|
||||
index 9f66d68..8b1ed54 100644
|
||||
--- a/data/CMakeLists.txt
|
||||
+++ b/data/CMakeLists.txt
|
||||
@@ -14,6 +14,11 @@ endif()
|
||||
if(NOT ENABLE_USER_GROUP)
|
||||
list(FILTER CATEGORY_DESKTOP EXCLUDE REGEX "group.desktop")
|
||||
endif()
|
||||
+
|
||||
+if(NOT ENABLE_APPLICATION)
|
||||
+ list(FILTER CATEGORY_DESKTOP EXCLUDE REGEX "application.desktop")
|
||||
+endif()
|
||||
+
|
||||
install(FILES ${CATEGORY_DESKTOP} DESTINATION ${CATEGORY_DESKTOP_DIR})
|
||||
|
||||
# 安装主分类相关图标文件
|
||||
diff --git a/plugins/CMakeLists.txt b/plugins/CMakeLists.txt
|
||||
index 9acb921..ecad7b6 100644
|
||||
--- a/plugins/CMakeLists.txt
|
||||
+++ b/plugins/CMakeLists.txt
|
||||
@@ -8,7 +8,9 @@ add_subdirectory(timedate)
|
||||
add_subdirectory(display)
|
||||
add_subdirectory(keybinding)
|
||||
add_subdirectory(authentication)
|
||||
-add_subdirectory(application)
|
||||
+if (ENABLE_APPLICATION)
|
||||
+ add_subdirectory(application)
|
||||
+endif()
|
||||
if(ENABLE_NETWORK)
|
||||
add_subdirectory(network)
|
||||
endif()
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,137 +0,0 @@
|
||||
From 3a30343a3958caafad6b27e1900c0e7b6b9ab26b Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Mon, 8 Jan 2024 15:04:41 +0800
|
||||
Subject: [PATCH 08/17] refactor(account): Remove useless password encryption
|
||||
interfaces and remove the dependency of libcrypt
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 删除目前无用的密码加密接口,去除libcrypt的依赖
|
||||
---
|
||||
plugins/account/CMakeLists.txt | 7 +--
|
||||
plugins/account/utils/passwd-helper.cpp | 57 -------------------------
|
||||
plugins/account/utils/passwd-helper.h | 1 -
|
||||
3 files changed, 2 insertions(+), 63 deletions(-)
|
||||
|
||||
diff --git a/plugins/account/CMakeLists.txt b/plugins/account/CMakeLists.txt
|
||||
index 586c6c8..e96fa92 100644
|
||||
--- a/plugins/account/CMakeLists.txt
|
||||
+++ b/plugins/account/CMakeLists.txt
|
||||
@@ -6,7 +6,6 @@ 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
|
||||
@@ -29,8 +28,7 @@ target_include_directories(${TARGET_NAME} PRIVATE
|
||||
${KIRAN_CC_DAEMON_INCLUDE_DIRS}
|
||||
${KLOG_INCLUDE_DIRS}
|
||||
${KIRAN_STYLE_INCLUDE_DIRS}
|
||||
- ${CRYPTOPP_INCLUDE_DIRS}
|
||||
- ${LIBCRYPT_INCLUDE_DIRS})
|
||||
+ ${CRYPTOPP_INCLUDE_DIRS})
|
||||
|
||||
target_link_libraries(${TARGET_NAME}
|
||||
common-widgets
|
||||
@@ -43,7 +41,6 @@ target_link_libraries(${TARGET_NAME}
|
||||
${KIRAN_CC_DAEMON_LIBRARIES}
|
||||
${KLOG_LIBRARIES}
|
||||
${KIRAN_STYLE_LIBRARIES}
|
||||
- ${CRYPTOPP_LIBRARIES}
|
||||
- ${LIBCRYPT_LIBRARIES})
|
||||
+ ${CRYPTOPP_LIBRARIES})
|
||||
|
||||
install(TARGETS ${TARGET_NAME} DESTINATION ${PLUGIN_LIBS_DIR}/)
|
||||
diff --git a/plugins/account/utils/passwd-helper.cpp b/plugins/account/utils/passwd-helper.cpp
|
||||
index f6b76f2..a5641c7 100644
|
||||
--- a/plugins/account/utils/passwd-helper.cpp
|
||||
+++ b/plugins/account/utils/passwd-helper.cpp
|
||||
@@ -14,7 +14,6 @@
|
||||
|
||||
#include "passwd-helper.h"
|
||||
|
||||
-#include <crypt.h>
|
||||
#include <cryptopp/base64.h>
|
||||
#include <cryptopp/cryptlib.h>
|
||||
#include <cryptopp/hex.h>
|
||||
@@ -33,62 +32,6 @@
|
||||
|
||||
using namespace CryptoPP;
|
||||
|
||||
-bool PasswdHelper::encryptPassword(const QString &pwd, QString &encrypted)
|
||||
-{
|
||||
- QByteArray byteArray = pwd.toLatin1();
|
||||
- QString saltChar = "ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz./0123456789";
|
||||
-
|
||||
- QString rand16SaltChar;
|
||||
-
|
||||
- std::default_random_engine randomEngine;
|
||||
- std::uniform_int_distribution<int> uniformIntDistribution(0, saltChar.size() - 1);
|
||||
- for (int i = 0; i < 16; i++)
|
||||
- {
|
||||
- char ch = saltChar.at(uniformIntDistribution(randomEngine)).toLatin1();
|
||||
- rand16SaltChar.append(ch);
|
||||
- }
|
||||
-
|
||||
- QString salt = QString("$6$%1$").arg(rand16SaltChar);
|
||||
- QByteArray saltByteArray = salt.toLatin1();
|
||||
-
|
||||
- char *cryptedResult = nullptr;
|
||||
- QByteArray cryptedResultBuffer(100, 0);
|
||||
-
|
||||
- //NOTE:兼容低版本libcrypt(不带有crypt_rn接口的版本)
|
||||
-#if 0
|
||||
- forever
|
||||
- {
|
||||
- cryptedResult = crypt_rn(byteArray.data(),
|
||||
- saltByteArray.data(),
|
||||
- cryptedResultBuffer.data(),
|
||||
- cryptedResultBuffer.size());
|
||||
- if (cryptedResult == nullptr)
|
||||
- {
|
||||
- if (errno == ERANGE)
|
||||
- {
|
||||
- cryptedResultBuffer.resize(cryptedResultBuffer.size() * 2);
|
||||
- continue;
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- KLOG_WARNING() << "encrypt passwd failed," << strerror(errno);
|
||||
- }
|
||||
- }
|
||||
- break;
|
||||
- }
|
||||
-#else
|
||||
- crypt_data cryptData{};
|
||||
- cryptedResult = crypt_r(byteArray.data(),
|
||||
- saltByteArray.data(),
|
||||
- &cryptData);
|
||||
-#endif
|
||||
-
|
||||
- if (cryptedResult)
|
||||
- encrypted = cryptedResult;
|
||||
-
|
||||
- return cryptedResult != nullptr;
|
||||
-}
|
||||
-
|
||||
bool PasswdHelper::encryptPasswordByRsa(const QString &publicKey, const QString &pwd, QString &encrypted)
|
||||
{
|
||||
CryptoPP::RandomPool random_pool;
|
||||
diff --git a/plugins/account/utils/passwd-helper.h b/plugins/account/utils/passwd-helper.h
|
||||
index b09d246..fc98068 100644
|
||||
--- a/plugins/account/utils/passwd-helper.h
|
||||
+++ b/plugins/account/utils/passwd-helper.h
|
||||
@@ -18,7 +18,6 @@
|
||||
class QString;
|
||||
namespace PasswdHelper
|
||||
{
|
||||
-bool encryptPassword(const QString &pwd, QString &encrypted);
|
||||
bool encryptPasswordByRsa(const QString &publicKey, const QString &pwd, QString &encrypted);
|
||||
bool checkUserPassword(const QString &user, const QString &pwd);
|
||||
} // namespace PasswdHelper
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,30 +0,0 @@
|
||||
From 24d7fe811440d3ab46a03db079136309f60519a8 Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Mon, 8 Jan 2024 15:06:03 +0800
|
||||
Subject: [PATCH 09/17] fix(translations): Fix translation errors in battery
|
||||
settings
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修复电池设置中错误的翻译
|
||||
---
|
||||
translations/kiran-control-panel.zh_CN.ts | 2 +-
|
||||
1 file changed, 1 insertion(+), 1 deletion(-)
|
||||
|
||||
diff --git a/translations/kiran-control-panel.zh_CN.ts b/translations/kiran-control-panel.zh_CN.ts
|
||||
index 6fb278f..970c5a0 100644
|
||||
--- a/translations/kiran-control-panel.zh_CN.ts
|
||||
+++ b/translations/kiran-control-panel.zh_CN.ts
|
||||
@@ -533,7 +533,7 @@
|
||||
<message>
|
||||
<location filename="../plugins/power/pages/battery-settings-page.ui" line="182"/>
|
||||
<source>Reduce screen brightness when no power</source>
|
||||
- <translation>低点亮时减少亮度</translation>
|
||||
+ <translation>低电量时减少亮度</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../plugins/power/pages/battery-settings-page.ui" line="212"/>
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,47 +0,0 @@
|
||||
From 2b6125c1a32d3de702a60a10e2baceee481f28c0 Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Tue, 9 Jan 2024 16:59:21 +0800
|
||||
Subject: [PATCH 10/17] fix(account): Fix the issue of setting default
|
||||
selection sidebar errors
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修复设置默认选择侧边栏错误的问题
|
||||
|
||||
Closes #24761
|
||||
---
|
||||
plugins/account/account-widget.cpp | 14 ++++++--------
|
||||
1 file changed, 6 insertions(+), 8 deletions(-)
|
||||
|
||||
diff --git a/plugins/account/account-widget.cpp b/plugins/account/account-widget.cpp
|
||||
index 957b154..59b6cad 100644
|
||||
--- a/plugins/account/account-widget.cpp
|
||||
+++ b/plugins/account/account-widget.cpp
|
||||
@@ -106,17 +106,15 @@ void AccountWidget::appendUser(const QString &userPath)
|
||||
|
||||
void AccountWidget::setDefaultSelectedUser()
|
||||
{
|
||||
- if (m_tabList->count() <= 1)
|
||||
+ auto items = m_tabList->findItems(AccountsGlobalInfo::instance()->getCurrentUser(), Qt::MatchCaseSensitive);
|
||||
+ if (items.size() >= 1)
|
||||
{
|
||||
- m_tabList->setCurrentRow(0);
|
||||
- return;
|
||||
+ auto userItem = items.at(0);
|
||||
+ m_tabList->setCurrentRow(m_tabList->row(userItem));
|
||||
}
|
||||
-
|
||||
- auto items = m_tabList->findItems(AccountsGlobalInfo::instance()->getCurrentUser(), Qt::MatchCaseSensitive);
|
||||
- if (items.size() > 0)
|
||||
+ else
|
||||
{
|
||||
- auto item = items.at(0);
|
||||
- m_tabList->setCurrentRow(m_tabList->row(item));
|
||||
+ m_tabList->setCurrentRow(0);
|
||||
}
|
||||
}
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,56 +0,0 @@
|
||||
From 783eee898cda93ed345a91000834b972c971c327 Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Tue, 9 Jan 2024 20:05:45 +0800
|
||||
Subject: [PATCH 11/17] fix(build): delete useless methods
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 删除无用的方法
|
||||
---
|
||||
plugins/appearance/utils/exclusion-group.cpp | 13 -------------
|
||||
plugins/appearance/utils/exclusion-group.h | 4 ----
|
||||
2 files changed, 17 deletions(-)
|
||||
|
||||
diff --git a/plugins/appearance/utils/exclusion-group.cpp b/plugins/appearance/utils/exclusion-group.cpp
|
||||
index 12fb734..8db48ca 100644
|
||||
--- a/plugins/appearance/utils/exclusion-group.cpp
|
||||
+++ b/plugins/appearance/utils/exclusion-group.cpp
|
||||
@@ -125,19 +125,6 @@ void ExclusionGroup::removeExclusionItem(ExclusionWidget* widget)
|
||||
m_exclusionItems.remove(widget);
|
||||
}
|
||||
|
||||
-template <class T,typename = std::enable_if<std::is_base_of<ExclusionWidget, T>::value>>
|
||||
-QList<T*> ExclusionGroup::getExclusionItems()
|
||||
-{
|
||||
- QList<T*> list;
|
||||
-
|
||||
- for( auto item : m_exclusionItems)
|
||||
- {
|
||||
- list << qobject_cast<T>(item);
|
||||
- }
|
||||
-
|
||||
- return list;
|
||||
-}
|
||||
-
|
||||
void ExclusionGroup::onItemSelectedChanged(bool selected)
|
||||
{
|
||||
auto item = qobject_cast<ExclusionWidget*>(sender());
|
||||
diff --git a/plugins/appearance/utils/exclusion-group.h b/plugins/appearance/utils/exclusion-group.h
|
||||
index 4ca9bd0..7d66a1f 100644
|
||||
--- a/plugins/appearance/utils/exclusion-group.h
|
||||
+++ b/plugins/appearance/utils/exclusion-group.h
|
||||
@@ -65,10 +65,6 @@ public:
|
||||
|
||||
void addExclusionItem(ExclusionWidget* widget);
|
||||
void removeExclusionItem(ExclusionWidget* widget);
|
||||
-
|
||||
- template <class T,typename = std::enable_if<std::is_base_of<ExclusionWidget, T>::value>>
|
||||
- QList<T*> getExclusionItems();
|
||||
-
|
||||
signals:
|
||||
void currentItemChanged();
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,39 +0,0 @@
|
||||
From 4f311e12f5c61c56aece10097d106a980f633c85 Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Tue, 9 Jan 2024 17:09:06 +0800
|
||||
Subject: [PATCH 12/17] fix(font): Fix the issue of ineffective font changes
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修复字体更改后不生效的问题
|
||||
|
||||
Closes #25084
|
||||
---
|
||||
plugins/appearance/pages/font/fonts.cpp | 9 ++-------
|
||||
1 file changed, 2 insertions(+), 7 deletions(-)
|
||||
|
||||
diff --git a/plugins/appearance/pages/font/fonts.cpp b/plugins/appearance/pages/font/fonts.cpp
|
||||
index e722123..c1c6875 100644
|
||||
--- a/plugins/appearance/pages/font/fonts.cpp
|
||||
+++ b/plugins/appearance/pages/font/fonts.cpp
|
||||
@@ -113,14 +113,9 @@ void Fonts::initConnections()
|
||||
connect(AppearanceGlobalInfo::instance(), &AppearanceGlobalInfo::fontChanged,
|
||||
this, &Fonts::onBackendFontChanged);
|
||||
|
||||
- for (auto fontTypeCombos : m_fontTypeComboBoxMap.values())
|
||||
+ for (auto fontTypeCombo : m_comboFontTypesMap.keys())
|
||||
{
|
||||
- auto fontNameComboBox = fontTypeCombos.first;
|
||||
- auto fontSizeComboBox = fontTypeCombos.second;
|
||||
-
|
||||
- connect(fontNameComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
- this, &Fonts::onCurrentFontFamilyChanged);
|
||||
- connect(fontSizeComboBox, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
+ connect(fontTypeCombo, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this, &Fonts::onCurrentFontFamilyChanged);
|
||||
}
|
||||
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,82 +0,0 @@
|
||||
From 0422be13648a36784fcffc5a04ba725c7984b290 Mon Sep 17 00:00:00 2001
|
||||
From: yuanxing <yuanxing@kylinsec.com.cn>
|
||||
Date: Thu, 11 Jan 2024 23:23:37 +0800
|
||||
Subject: [PATCH 13/17] fix(theme):change the light and dark theme name
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修改深浅色主题名为冰晶白、曜岩黑
|
||||
|
||||
Fixes #24747
|
||||
---
|
||||
plugins/appearance/pages/theme/theme-page.cpp | 2 +-
|
||||
plugins/appearance/pages/theme/theme-page.ui | 9 +--------
|
||||
translations/kiran-control-panel.zh_CN.ts | 4 ++--
|
||||
3 files changed, 4 insertions(+), 11 deletions(-)
|
||||
|
||||
diff --git a/plugins/appearance/pages/theme/theme-page.cpp b/plugins/appearance/pages/theme/theme-page.cpp
|
||||
index 7c303b7..24a5c7a 100644
|
||||
--- a/plugins/appearance/pages/theme/theme-page.cpp
|
||||
+++ b/plugins/appearance/pages/theme/theme-page.cpp
|
||||
@@ -27,7 +27,7 @@
|
||||
#include <QPushButton>
|
||||
|
||||
#define DARK_THEME "Kiran-dark"
|
||||
-#define LIGHT_THEME "Kiran"
|
||||
+#define LIGHT_THEME "Kiran-white"
|
||||
#define THEME_AUTO_NAME "Kiran-auto"
|
||||
|
||||
#define SETTING_THEME_NUM 2
|
||||
diff --git a/plugins/appearance/pages/theme/theme-page.ui b/plugins/appearance/pages/theme/theme-page.ui
|
||||
index eecc81e..7c61009 100644
|
||||
--- a/plugins/appearance/pages/theme/theme-page.ui
|
||||
+++ b/plugins/appearance/pages/theme/theme-page.ui
|
||||
@@ -78,7 +78,7 @@
|
||||
<item>
|
||||
<widget class="QLabel" name="label_theme">
|
||||
<property name="text">
|
||||
- <string>Dark and Light Theme</string>
|
||||
+ <string>Themes Settings</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@@ -103,13 +103,6 @@
|
||||
<property name="spacing">
|
||||
<number>10</number>
|
||||
</property>
|
||||
- <item>
|
||||
- <widget class="QLabel" name="label_theme_setting">
|
||||
- <property name="text">
|
||||
- <string>Themes Settings</string>
|
||||
- </property>
|
||||
- </widget>
|
||||
- </item>
|
||||
<item>
|
||||
<layout class="QVBoxLayout" name="verticalLayout_choose_widget">
|
||||
<property name="spacing">
|
||||
diff --git a/translations/kiran-control-panel.zh_CN.ts b/translations/kiran-control-panel.zh_CN.ts
|
||||
index 970c5a0..8e39486 100644
|
||||
--- a/translations/kiran-control-panel.zh_CN.ts
|
||||
+++ b/translations/kiran-control-panel.zh_CN.ts
|
||||
@@ -5303,7 +5303,7 @@ This is line 50 of the test text</source>
|
||||
<message>
|
||||
<location filename="../plugins/appearance/pages/theme/theme-page.cpp" line="151"/>
|
||||
<source>Light Theme</source>
|
||||
- <translation>浅色</translation>
|
||||
+ <translation>冰晶白</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../plugins/appearance/pages/theme/theme-page.cpp" line="152"/>
|
||||
@@ -5313,7 +5313,7 @@ This is line 50 of the test text</source>
|
||||
<message>
|
||||
<location filename="../plugins/appearance/pages/theme/theme-page.cpp" line="153"/>
|
||||
<source>Dark Theme</source>
|
||||
- <translation>深色</translation>
|
||||
+ <translation>曜岩黑</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../plugins/appearance/pages/theme/theme-page.cpp" line="82"/>
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,482 +0,0 @@
|
||||
From 55049f4ee286633b486936c7f4d19d3d426453a0 Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Mon, 15 Jan 2024 16:31:01 +0800
|
||||
Subject: [PATCH 14/17] fix(shortcut): add custom app icon,Error prompt for
|
||||
modifying input shortcut keys
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修改录入快捷键错误提示,新增自定义应用图标显示
|
||||
|
||||
Closes #25199,#25198
|
||||
---
|
||||
plugins/keybinding/shortcut.cpp | 79 ++++++++++++----
|
||||
plugins/keybinding/shortcut.h | 10 +-
|
||||
translations/kiran-control-panel.zh_CN.ts | 106 ++++++++++++----------
|
||||
3 files changed, 127 insertions(+), 68 deletions(-)
|
||||
|
||||
diff --git a/plugins/keybinding/shortcut.cpp b/plugins/keybinding/shortcut.cpp
|
||||
index bab4ad1..84c0cba 100644
|
||||
--- a/plugins/keybinding/shortcut.cpp
|
||||
+++ b/plugins/keybinding/shortcut.cpp
|
||||
@@ -31,12 +31,15 @@
|
||||
#include <QKeyEvent>
|
||||
#include <QtConcurrentRun>
|
||||
|
||||
-Q_DECLARE_METATYPE(QList<ShortcutInfoPtr>)
|
||||
+#define DEFAULT_APP_ICON "application-script-blank"
|
||||
+#define APP_ICON_WIDTH 20
|
||||
|
||||
+Q_DECLARE_METATYPE(QList<ShortcutInfoPtr>)
|
||||
using namespace Kiran;
|
||||
|
||||
-Shortcut::Shortcut(QWidget *parent) : QWidget(parent),
|
||||
- ui(new Ui::Shortcut)
|
||||
+Shortcut::Shortcut(QWidget *parent)
|
||||
+ : QWidget(parent),
|
||||
+ ui(new Ui::Shortcut)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
init();
|
||||
@@ -100,16 +103,24 @@ void Shortcut::initUI()
|
||||
}
|
||||
|
||||
QHBoxLayout *hLayoutCustomApp = new QHBoxLayout(ui->lineEdit_custom_app);
|
||||
+ m_customAppIcon = new QLabel;
|
||||
+ m_customAppIcon->setFixedSize(24, 24);
|
||||
+ m_customAppIcon->setPixmap(QIcon::fromTheme(DEFAULT_APP_ICON).pixmap(20, 20));
|
||||
+ hLayoutCustomApp->addWidget(m_customAppIcon, 0, Qt::AlignVCenter);
|
||||
+
|
||||
+ hLayoutCustomApp->addStretch();
|
||||
+
|
||||
m_btnCustomApp = new QToolButton;
|
||||
m_btnCustomApp->setObjectName("btn_custom_app");
|
||||
m_btnCustomApp->setAccessibleName("ButtonAddCustomApp");
|
||||
m_btnCustomApp->setText(tr("Add"));
|
||||
m_btnCustomApp->setFixedSize(56, 30);
|
||||
m_btnCustomApp->setCursor(Qt::PointingHandCursor);
|
||||
- hLayoutCustomApp->addStretch();
|
||||
hLayoutCustomApp->addWidget(m_btnCustomApp);
|
||||
- ui->lineEdit_custom_app->setTextMargins(0, 0, m_btnCustomApp->width(), 0);
|
||||
+
|
||||
+ ui->lineEdit_custom_app->setTextMargins(25, 0, m_btnCustomApp->width(), 0);
|
||||
connect(m_btnCustomApp, &QToolButton::clicked, this, &Shortcut::openFileSys);
|
||||
+ connect(ui->lineEdit_custom_app,&QLineEdit::textChanged,this,&Shortcut::handleCustomAppTextChanged);
|
||||
|
||||
QHBoxLayout *hLayoutModifyApp = new QHBoxLayout(ui->lineEdit_modify_app);
|
||||
m_btnModifyApp = new QToolButton;
|
||||
@@ -354,7 +365,7 @@ bool Shortcut::isValidKeycode(QList<int> keycodes)
|
||||
return !pureModifier;
|
||||
}
|
||||
|
||||
-bool Shortcut::getExecFromDesktop(QString fileName, QString &exec)
|
||||
+bool Shortcut::extractDesktopInfo(const QString &fileName, QString &exec, QString &icon)
|
||||
{
|
||||
QSettings settings(fileName, QSettings::IniFormat);
|
||||
QString str = settings.value("Desktop Entry/Exec").toString();
|
||||
@@ -368,6 +379,10 @@ bool Shortcut::getExecFromDesktop(QString fileName, QString &exec)
|
||||
str = str.replace("%u", "", Qt::CaseInsensitive);
|
||||
|
||||
exec = str;
|
||||
+
|
||||
+ str = settings.value("Desktop Entry/Icon").toString();
|
||||
+ icon = str.isEmpty() ? DEFAULT_APP_ICON : str;
|
||||
+
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -376,23 +391,38 @@ void Shortcut::openFileSys()
|
||||
QToolButton *senderbtn = qobject_cast<QToolButton *>(sender());
|
||||
QLineEdit *lineEdit = qobject_cast<QLineEdit *>(senderbtn->parent());
|
||||
|
||||
- QString fileName = QFileDialog::getOpenFileName(this, tr("Open File"), "/usr/share/applications");
|
||||
+ QString fileName = QFileDialog::getOpenFileName(this,
|
||||
+ tr("Open File"),
|
||||
+ "/usr/share/applications",
|
||||
+ tr("Desktop entries(*.desktop)"));
|
||||
if (fileName.isNull())
|
||||
return;
|
||||
|
||||
- QString exec = fileName;
|
||||
- if (fileName.endsWith(".desktop"))
|
||||
+ QString cmd;
|
||||
+ QString icon = DEFAULT_APP_ICON;
|
||||
+ if (!extractDesktopInfo(fileName, cmd, icon))
|
||||
{
|
||||
- QString tmp;
|
||||
- if (!getExecFromDesktop(fileName, tmp))
|
||||
- {
|
||||
- KLOG_ERROR(qLcKeybinding) << "cant't get Exec key from " << fileName;
|
||||
- return;
|
||||
- }
|
||||
- exec = tmp;
|
||||
+ KLOG_ERROR(qLcKeybinding) << "cant't get Exec key from " << fileName;
|
||||
+ KiranMessageBox::message(this, tr("Error"),
|
||||
+ "Extracting the program to be executed from the application's desktop file failed",
|
||||
+ KiranMessageBox::Ok);
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ // 缓存该次添加的应用以及图标信息
|
||||
+ // 后续启动命令修改的时候,应复位图标
|
||||
+ m_lastIcon = icon;
|
||||
+ m_lastIconExec = cmd;
|
||||
+
|
||||
+ QIcon appIcon = QIcon::fromTheme(icon);
|
||||
+ if( appIcon.isNull() )
|
||||
+ {
|
||||
+ m_lastIcon = DEFAULT_APP_ICON;
|
||||
+ appIcon = QIcon::fromTheme(DEFAULT_APP_ICON);
|
||||
}
|
||||
|
||||
- lineEdit->setText(exec);
|
||||
+ m_customAppIcon->setPixmap(appIcon.pixmap(QSize(APP_ICON_WIDTH,APP_ICON_WIDTH)));
|
||||
+ lineEdit->setText(cmd);
|
||||
}
|
||||
|
||||
void Shortcut::handleSearchTimerTimeout()
|
||||
@@ -787,6 +817,16 @@ void Shortcut::handleResetClicked()
|
||||
}
|
||||
}
|
||||
|
||||
+void Shortcut::handleCustomAppTextChanged(const QString& text)
|
||||
+{
|
||||
+ // 直接编辑自定义应用输入框,修改命令
|
||||
+ // 导致和desktop读取出来的不一致时清空图标
|
||||
+ if( !text.isEmpty() && text != m_lastIconExec )
|
||||
+ {
|
||||
+ m_customAppIcon->setPixmap(QIcon::fromTheme(DEFAULT_APP_ICON).pixmap(20,20));
|
||||
+ }
|
||||
+}
|
||||
+
|
||||
void Shortcut::handleInputKeycode(QList<int> keycodes)
|
||||
{
|
||||
CustomLineEdit *senderLineEdit = qobject_cast<CustomLineEdit *>(sender());
|
||||
@@ -803,8 +843,9 @@ void Shortcut::handleInputKeycode(QList<int> keycodes)
|
||||
{
|
||||
KiranMessageBox::message(nullptr,
|
||||
tr("Failed"),
|
||||
- QString(tr("Cannot use shortcut \"%1\", Because you cannot enter with this key."
|
||||
- "Please try again using Ctrl, Alt, or Shift at the same time."))
|
||||
+ QString(tr("Cannot use shortcut \"%1\","
|
||||
+ "Please keep pressing the modifier keys such as Ctrl,"
|
||||
+ "Alt, and Shift before pressing the last key of the shortcut key"))
|
||||
.arg(keyStr),
|
||||
KiranMessageBox::Ok);
|
||||
return;
|
||||
diff --git a/plugins/keybinding/shortcut.h b/plugins/keybinding/shortcut.h
|
||||
index fc078fb..3504b1b 100644
|
||||
--- a/plugins/keybinding/shortcut.h
|
||||
+++ b/plugins/keybinding/shortcut.h
|
||||
@@ -35,6 +35,8 @@ class ShortcutItem;
|
||||
class KeyMap;
|
||||
class CustomLineEdit;
|
||||
class KeybindingBackEndProxy;
|
||||
+class QLabel;
|
||||
+
|
||||
class Shortcut : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -59,7 +61,7 @@ private:
|
||||
ShortcutItem *createShortcutItem(QVBoxLayout *parent, ShortcutInfoPtr shortcutInfo, int type);
|
||||
bool isConflict(QString &originName, QString newKeyCombination);
|
||||
bool isValidKeycode(QList<int> keycodes);
|
||||
- bool getExecFromDesktop(QString fileName, QString &exec);
|
||||
+ bool extractDesktopInfo(const QString& fileName, QString &exec, QString &icon);
|
||||
void updateShorcut(ShortcutInfoPtr newShortcut);
|
||||
void insertShortcut(ShortcutInfoPtr shortcutInfo);
|
||||
void clearFilterItems();
|
||||
@@ -72,6 +74,7 @@ public slots:
|
||||
void handledShortcutDeleted(QString result);
|
||||
void handleShortcutChanged(QString result);
|
||||
|
||||
+ void handleCustomAppTextChanged(const QString& text);
|
||||
void handleInputKeycode(QList<int> keycodes);
|
||||
|
||||
void handleItemDeleteClicked(QString uid);
|
||||
@@ -96,8 +99,13 @@ private:
|
||||
QList<ShortcutItem *> m_shortcutItem;
|
||||
QList<ShortcutItem *> m_filterItem;
|
||||
|
||||
+ //记录上次通过应用打开的desktop文件记录的Exec和Icon
|
||||
+ QString m_lastIconExec;
|
||||
+ QString m_lastIcon;
|
||||
+
|
||||
QToolButton *m_btnModifyApp;
|
||||
QToolButton *m_btnCustomApp;
|
||||
+ QLabel *m_customAppIcon;
|
||||
CustomLineEdit *m_lECustomKey;
|
||||
CustomLineEdit *m_lEModifyKey;
|
||||
|
||||
diff --git a/translations/kiran-control-panel.zh_CN.ts b/translations/kiran-control-panel.zh_CN.ts
|
||||
index 970c5a0..31fc01e 100644
|
||||
--- a/translations/kiran-control-panel.zh_CN.ts
|
||||
+++ b/translations/kiran-control-panel.zh_CN.ts
|
||||
@@ -33,18 +33,18 @@
|
||||
<name>AccountWidget</name>
|
||||
<message>
|
||||
<location filename="../plugins/account/account-widget.cpp" line="100"/>
|
||||
- <location filename="../plugins/account/account-widget.cpp" line="420"/>
|
||||
+ <location filename="../plugins/account/account-widget.cpp" line="418"/>
|
||||
<source>disable</source>
|
||||
<translation type="unfinished">禁用</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../plugins/account/account-widget.cpp" line="100"/>
|
||||
- <location filename="../plugins/account/account-widget.cpp" line="420"/>
|
||||
+ <location filename="../plugins/account/account-widget.cpp" line="418"/>
|
||||
<source>enable</source>
|
||||
<translation type="unfinished">启用</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/account/account-widget.cpp" line="225"/>
|
||||
+ <location filename="../plugins/account/account-widget.cpp" line="223"/>
|
||||
<source>Create new user</source>
|
||||
<translation type="unfinished">创建新用户</translation>
|
||||
</message>
|
||||
@@ -2983,22 +2983,22 @@
|
||||
<translation>请用分号分隔多个DNS</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/network/src/plugin/setting-widget/ipv6-widget.cpp" line="234"/>
|
||||
+ <location filename="../plugins/network/src/plugin/setting-widget/ipv6-widget.cpp" line="236"/>
|
||||
<source>Ipv6 DNS invalid</source>
|
||||
<translation>无效的Ipv6 DNS</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/network/src/plugin/setting-widget/ipv6-widget.cpp" line="250"/>
|
||||
+ <location filename="../plugins/network/src/plugin/setting-widget/ipv6-widget.cpp" line="252"/>
|
||||
<source>Ipv6 address can not be empty</source>
|
||||
<translation>Ipv6地址不能为空</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/network/src/plugin/setting-widget/ipv6-widget.cpp" line="261"/>
|
||||
+ <location filename="../plugins/network/src/plugin/setting-widget/ipv6-widget.cpp" line="263"/>
|
||||
<source>Ipv6 address invalid</source>
|
||||
<translation>无效的Ipv6地址</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/network/src/plugin/setting-widget/ipv6-widget.cpp" line="274"/>
|
||||
+ <location filename="../plugins/network/src/plugin/setting-widget/ipv6-widget.cpp" line="276"/>
|
||||
<source>Ipv6 Gateway invalid</source>
|
||||
<translation>无效的Ipv6网关</translation>
|
||||
</message>
|
||||
@@ -4675,8 +4675,8 @@ This is line 50 of the test text</source>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../plugins/keybinding/shortcut.ui" line="210"/>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="163"/>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="550"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="174"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="580"/>
|
||||
<source>Edit</source>
|
||||
<translation>编辑</translation>
|
||||
</message>
|
||||
@@ -4688,8 +4688,8 @@ This is line 50 of the test text</source>
|
||||
<message>
|
||||
<location filename="../plugins/keybinding/shortcut.ui" line="346"/>
|
||||
<location filename="../plugins/keybinding/shortcut.ui" line="551"/>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="106"/>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="118"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="116"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="129"/>
|
||||
<source>Add</source>
|
||||
<translation>添加</translation>
|
||||
</message>
|
||||
@@ -4742,7 +4742,7 @@ This is line 50 of the test text</source>
|
||||
<message>
|
||||
<location filename="../plugins/keybinding/shortcut.ui" line="589"/>
|
||||
<source>Cancel</source>
|
||||
- <translation type="unfinished">取消</translation>
|
||||
+ <translation>取消</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../plugins/keybinding/shortcut.ui" line="635"/>
|
||||
@@ -4772,7 +4772,7 @@ This is line 50 of the test text</source>
|
||||
<message>
|
||||
<location filename="../plugins/keybinding/shortcut.ui" line="770"/>
|
||||
<source>Save</source>
|
||||
- <translation type="unfinished">保存</translation>
|
||||
+ <translation>保存</translation>
|
||||
</message>
|
||||
<message>
|
||||
<location filename="../plugins/keybinding/shortcut.ui" line="805"/>
|
||||
@@ -4782,129 +4782,139 @@ This is line 50 of the test text</source>
|
||||
<message>
|
||||
<location filename="../plugins/keybinding/shortcut.ui" line="808"/>
|
||||
<source>return</source>
|
||||
- <translation type="unfinished">返回</translation>
|
||||
+ <translation>返回</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="87"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="90"/>
|
||||
<source>Please enter a search keyword...</source>
|
||||
<translation>请输入搜索关键字...</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="99"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="102"/>
|
||||
<source>Required</source>
|
||||
<translation>必填</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="127"/>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="134"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="138"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="145"/>
|
||||
<source>Please press the new shortcut key</source>
|
||||
<translation>请输入新快捷键</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="161"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="172"/>
|
||||
<source>Finished</source>
|
||||
<translation>完成</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="215"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="226"/>
|
||||
<source>failed to load shortcut key data!</source>
|
||||
<translation>加载快捷键数据失败!</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="257"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="268"/>
|
||||
<source>List shortcut failed,error:%1</source>
|
||||
<translation>列出快捷键失败,错误:%1</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="300"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="311"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="406"/>
|
||||
<source>Error</source>
|
||||
<translation>错误</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="301"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="312"/>
|
||||
<source>Get shortcut failed,error:</source>
|
||||
<translation>获取快捷键失败,错误:</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="379"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="395"/>
|
||||
<source>Open File</source>
|
||||
<translation>打开文件</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="603"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="397"/>
|
||||
+ <source>Desktop entries(*.desktop)</source>
|
||||
+ <translation>桌面文件(*.desktop)</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="633"/>
|
||||
<source>System</source>
|
||||
<translation>系统</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="605"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="635"/>
|
||||
<source>Sound</source>
|
||||
<translation>声音</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="655"/>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="705"/>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="726"/>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="761"/>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="782"/>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="805"/>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="825"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="685"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="735"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="756"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="791"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="812"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="845"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="866"/>
|
||||
<source>Failed</source>
|
||||
<translation>失败</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="656"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="686"/>
|
||||
<source>Delete shortcut failed,error:</source>
|
||||
<translation>删除快捷键失败,错误:</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="669"/>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="744"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="699"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="774"/>
|
||||
<source>Warning</source>
|
||||
- <translation type="unfinished">警告</translation>
|
||||
+ <translation>警告</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="670"/>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="745"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="700"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="775"/>
|
||||
<source>Please complete the shortcut information!</source>
|
||||
<translation>请完善快捷键信息!</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="679"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="709"/>
|
||||
<source>Set shortcut</source>
|
||||
<translation>设置快捷键</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="680"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="710"/>
|
||||
<source>Are you sure you want to disable this shortcut?</source>
|
||||
<translation>是否确定要禁用此快捷键?</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="706"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="736"/>
|
||||
<source>Modify system shortcut failed,error:</source>
|
||||
<translation>修改系统快捷键失败,错误:</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="727"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="757"/>
|
||||
<source>Modify custom shortcut failed,error:</source>
|
||||
<translation>修改自定义快捷键失败,错误:</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="762"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="792"/>
|
||||
<source>Add custom shortcut failed,error:</source>
|
||||
<translation>添加自定义快捷键失败,错误:</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="783"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="813"/>
|
||||
<source>Reset shortcut failed,error:</source>
|
||||
<translation>重置快捷键失败,错误:</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="806"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="846"/>
|
||||
+ <source>Cannot use shortcut "%1",Please keep pressing the modifier keys such as Ctrl,Alt, and Shift before pressing the last key of the shortcut key</source>
|
||||
+ <translation>无法使用快捷键"%1", 请保持按压Ctrl、Alt、Shift等修饰键后,再按压快捷键的最后一个键</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
<source>Cannot use shortcut "%1", Because you cannot enter with this key.Please try again using Ctrl, Alt, or Shift at the same time.</source>
|
||||
- <translation>无法使用快捷键"%1",因为使用此键将无法输入,请同时使用Ctrl,Alt,Shift再试一次。</translation>
|
||||
+ <translation type="vanished">无法使用快捷键"%1",因为使用此键将无法输入,请同时使用Ctrl,Alt,Shift再试一次。</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/keybinding/shortcut.cpp" line="826"/>
|
||||
+ <location filename="../plugins/keybinding/shortcut.cpp" line="867"/>
|
||||
<source>Shortcut keys %1 are already used in %2,Please try again!</source>
|
||||
<translation>快捷键%1已用于%2,请再试一次!</translation>
|
||||
</message>
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,669 +0,0 @@
|
||||
From 26d4b8d60a30821c398ef4be3b6352f5041a56a3 Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Mon, 15 Jan 2024 17:28:15 +0800
|
||||
Subject: [PATCH 15/17] fix(power): profile mode using kiran-cc-daemon power
|
||||
interface
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 计算机模式接口使用控制中心后端所提供的接口
|
||||
|
||||
Closes #25242
|
||||
---
|
||||
plugins/power/CMakeLists.txt | 9 +-
|
||||
...com.kylinsec.Kiran.SessionDaemon.Power.xml | 16 ++
|
||||
.../power/data/net.hadess.PowerProfiles.xml | 144 ------------------
|
||||
plugins/power/dbus/power-profiles-wrapper.cpp | 124 ---------------
|
||||
plugins/power/dbus/power-profiles-wrapper.h | 50 ------
|
||||
plugins/power/pages/general-settings-page.cpp | 47 ++++--
|
||||
plugins/power/pages/general-settings-page.h | 4 +-
|
||||
translations/kiran-control-panel.zh_CN.ts | 59 ++++---
|
||||
8 files changed, 86 insertions(+), 367 deletions(-)
|
||||
delete mode 100644 plugins/power/data/net.hadess.PowerProfiles.xml
|
||||
delete mode 100644 plugins/power/dbus/power-profiles-wrapper.cpp
|
||||
delete mode 100644 plugins/power/dbus/power-profiles-wrapper.h
|
||||
|
||||
diff --git a/plugins/power/CMakeLists.txt b/plugins/power/CMakeLists.txt
|
||||
index 37d025d..99dc819 100644
|
||||
--- a/plugins/power/CMakeLists.txt
|
||||
+++ b/plugins/power/CMakeLists.txt
|
||||
@@ -7,6 +7,7 @@ set(TARGET_NAME kiran-cpanel-power)
|
||||
pkg_search_module(UPOWER_GLIB REQUIRED upower-glib)
|
||||
|
||||
set(POWER_PLUGIN_DBUS_SRC_LIST "")
|
||||
+
|
||||
# com.kylinsec.Kiran.SessionDaemon.Power
|
||||
set(KSD_POWER_XML data/com.kylinsec.Kiran.SessionDaemon.Power.xml)
|
||||
set_source_files_properties(${KSD_POWER_XML}
|
||||
@@ -17,13 +18,7 @@ kiran_qt5_add_dbus_interface_ex(KSD_POWER_SRC
|
||||
ksd_power_proxy
|
||||
KSDPowerProxy)
|
||||
list(APPEND POWER_PLUGIN_DBUS_SRC_LIST ${KSD_POWER_SRC})
|
||||
-# net.hadess.PowerProfiles
|
||||
-set(POWERPROFILES_XML data/net.hadess.PowerProfiles.xml)
|
||||
-kiran_qt5_add_dbus_interface_ex(POWER_PROFILES_SRC
|
||||
- ${POWERPROFILES_XML}
|
||||
- power_profiles_proxy
|
||||
- PowerProfilesProxy)
|
||||
-list(APPEND POWER_PLUGIN_DBUS_SRC_LIST ${POWER_PROFILES_SRC})
|
||||
+
|
||||
# org.gnome.SessionManager.xml - kiran-session-manager
|
||||
set(GNOME_SESSION_MANAGER_XML data/org.gnome.SessionManager.xml)
|
||||
kiran_qt5_add_dbus_interface_ex(GNOME_SESSION_MANAGER_SOUCE
|
||||
diff --git a/plugins/power/data/com.kylinsec.Kiran.SessionDaemon.Power.xml b/plugins/power/data/com.kylinsec.Kiran.SessionDaemon.Power.xml
|
||||
index 281ffdb..c32bbb5 100644
|
||||
--- a/plugins/power/data/com.kylinsec.Kiran.SessionDaemon.Power.xml
|
||||
+++ b/plugins/power/data/com.kylinsec.Kiran.SessionDaemon.Power.xml
|
||||
@@ -82,6 +82,13 @@
|
||||
<description>Enable cpu save energy when the ups or battery power is low.</description>
|
||||
</method>
|
||||
|
||||
+ <method name="SwitchProfile">
|
||||
+ <arg type="i" name="mode" direction="in">
|
||||
+ <description>The profile mode. Refer to PowerProfileMode in power-i.h</description>
|
||||
+ </arg>
|
||||
+ <description>Switch profile mode.</description>
|
||||
+ </method>
|
||||
+
|
||||
<property name="OnBattery" type="b" access="read">
|
||||
<annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true"/>
|
||||
<description>Indicates whether the system is running on battery power.</description>
|
||||
@@ -107,6 +114,11 @@
|
||||
<description>Whether does the cpu save energy when the ups or battery power is low.</description>
|
||||
</property>
|
||||
|
||||
+ <property name="ActiveProfile" type="i" access="read">
|
||||
+ <annotation name="org.freedesktop.DBus.Property.EmitsChangedSignal" value="true"/>
|
||||
+ <description>The active profile mode.</description>
|
||||
+ </property>
|
||||
+
|
||||
<signal name="IdleActionChanged">
|
||||
<arg name="device" type="i" />
|
||||
<arg name="supply" type="i" />
|
||||
@@ -120,5 +132,9 @@
|
||||
<arg name="device" type="i" />
|
||||
</signal>
|
||||
|
||||
+ <signal name="ActiveProfileChanged">
|
||||
+ <arg name="active_profile" type="i" />
|
||||
+ </signal>
|
||||
+
|
||||
</interface>
|
||||
</node>
|
||||
diff --git a/plugins/power/data/net.hadess.PowerProfiles.xml b/plugins/power/data/net.hadess.PowerProfiles.xml
|
||||
deleted file mode 100644
|
||||
index a3241fb..0000000
|
||||
--- a/plugins/power/data/net.hadess.PowerProfiles.xml
|
||||
+++ /dev/null
|
||||
@@ -1,144 +0,0 @@
|
||||
-<!DOCTYPE node PUBLIC "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
|
||||
-"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd">
|
||||
-
|
||||
-<node>
|
||||
-
|
||||
- <!--
|
||||
- net.hadess.PowerProfiles:
|
||||
- @short_description: Power Profiles daemon
|
||||
-
|
||||
- The power-profiles-daemon API is meant to be used by parts of the OS or
|
||||
- desktop environment to switch system power profiles based on user choice,
|
||||
- or user intent.
|
||||
-
|
||||
- OS components would typically use the "Profiles" property to construct
|
||||
- their UI (2 or 3 profiles available), and monitor the "ActiveProfile"
|
||||
- and the "PerformanceDegraded" properties to update that UI. The UI
|
||||
- would try to set the "ActiveProfile" property if the user selected
|
||||
- a different one.
|
||||
-
|
||||
- Note that the reason why the project exists and how it is different from
|
||||
- existing projects is explained <ulink href=" https://gitlab.freedesktop.org/hadess/power-profiles-daemon/-/blob/master/README.md">
|
||||
- in the project's README file</ulink>.
|
||||
-
|
||||
- The object path will be "/net/hadess/PowerProfiles".
|
||||
- -->
|
||||
- <interface name="net.hadess.PowerProfiles">
|
||||
-
|
||||
- <!--
|
||||
- HoldProfile:
|
||||
-
|
||||
- This forces the passed profile (either 'power-saver' or 'performance')
|
||||
- to be activated until either the caller quits, "ReleaseProfile" is
|
||||
- called, or the "ActiveProfile" is changed by the user.
|
||||
-
|
||||
- This should be used programmatically by OS components when, eg. high-
|
||||
- performance workloads are started with the "performance" profile, or
|
||||
- battery will soon be critically low with the "power-saver" profile.
|
||||
-
|
||||
- When conflicting profiles are requested to be held, the 'power-saver' profile
|
||||
- will be activated in preference to the 'performance' profile.
|
||||
-
|
||||
- Those holds will be automatically cancelled if the user manually switches
|
||||
- to another profile, and the "ProfileReleased" signal will be emitted.
|
||||
- -->
|
||||
- <method name="HoldProfile">
|
||||
- <arg name="profile" type="s" direction="in"/>
|
||||
- <arg name="reason" type="s" direction="in"/>
|
||||
- <arg name="application_id" type="s" direction="in" />
|
||||
- <arg name="cookie" type="u" direction="out"/>
|
||||
- </method>
|
||||
-
|
||||
- <!--
|
||||
- ReleaseProfile:
|
||||
-
|
||||
- This removes the hold that was set on a profile.
|
||||
- -->
|
||||
- <method name="ReleaseProfile">
|
||||
- <arg name="cookie" type="u" direction="in"/>
|
||||
- </method>
|
||||
-
|
||||
- <!--
|
||||
- ProfileReleased:
|
||||
-
|
||||
- This signal will be emitted if the profile is released because the
|
||||
- "ActiveProfile" was manually changed. The signal will only be emitted
|
||||
- to the process that originally called "HoldProfile".
|
||||
- -->
|
||||
- <signal name="ProfileReleased">
|
||||
- <arg name="cookie" type="u" direction="out"/>
|
||||
- </signal>
|
||||
-
|
||||
- <!--
|
||||
- ActiveProfile:
|
||||
-
|
||||
- The type of the currently active profile. It might change automatically
|
||||
- if a profile is held, using the "HoldProfile" function.
|
||||
- -->
|
||||
- <property name="ActiveProfile" type="s" access="readwrite"/>
|
||||
-
|
||||
- <!--
|
||||
- PerformanceInhibited:
|
||||
-
|
||||
- This property is deprecated, and unused since version 0.9.
|
||||
- -->
|
||||
- <property name="PerformanceInhibited" type="s" access="read"/>
|
||||
-
|
||||
- <!--
|
||||
- PerformanceDegraded:
|
||||
-
|
||||
- This will be set if the performance power profile is running in degraded
|
||||
- mode, with the value being used to identify the reason for that degradation.
|
||||
- As new reasons can be added, it is recommended that front-ends show a generic
|
||||
- reason if they do not recognise the value. Possible values are:
|
||||
- - "lap-detected" (the computer is sitting on the user's lap)
|
||||
- - "high-operating-temperature" (the computer is close to overheating)
|
||||
- - "" (the empty string, if not performance is not degraded)
|
||||
- -->
|
||||
- <property name="PerformanceDegraded" type="s" access="read"/>
|
||||
-
|
||||
- <!--
|
||||
- Profiles:
|
||||
-
|
||||
- An array of key-pair values representing each profile. The key named
|
||||
- "Driver" (s) identifies the power-profiles-daemon backend code used to
|
||||
- implement the profile.
|
||||
-
|
||||
- The key named "Profile" (s) will be one of:
|
||||
- - "power-saver" (battery saving profile)
|
||||
- - "balanced" (the default profile)
|
||||
- - "performance" (a profile that does not care about noise or battery consumption)
|
||||
-
|
||||
- Only one of each type of profile will be listed, with the daemon choosing the
|
||||
- more appropriate "driver" for each profile type.
|
||||
-
|
||||
- This list is guaranteed to be sorted in the same order that the profiles
|
||||
- are listed above.
|
||||
- -->
|
||||
- <property name="Profiles" type="aa{sv}" access="read">
|
||||
- <annotation name="org.qtproject.QtDBus.QtTypeName" value="QList<QVariantMap>"/>
|
||||
- </property>
|
||||
-
|
||||
- <!--
|
||||
- Actions:
|
||||
-
|
||||
- An array of strings listing each one of the "actions" implemented in
|
||||
- the running daemon. This is used by API users to figure out whether
|
||||
- particular functionality is available in a version of the daemon.
|
||||
- -->
|
||||
- <property name="Actions" type="as" access="read"/>
|
||||
-
|
||||
- <!--
|
||||
- ActiveProfileHolds:
|
||||
-
|
||||
- A list of dictionaries representing the current profile holds.
|
||||
- The keys in the dict are "ApplicationId", "Profile" and "Reason",
|
||||
- and correspond to the "application_id", "profile" and "reason" arguments
|
||||
- passed to the HoldProfile() method.
|
||||
- -->
|
||||
- <property name="ActiveProfileHolds" type="aa{sv}" access="read">
|
||||
- <annotation name="org.qtproject.QtDBus.QtTypeName" value="QList<QVariantMap>"/>
|
||||
- </property>
|
||||
-
|
||||
- </interface>
|
||||
-</node>
|
||||
diff --git a/plugins/power/dbus/power-profiles-wrapper.cpp b/plugins/power/dbus/power-profiles-wrapper.cpp
|
||||
deleted file mode 100644
|
||||
index 6262fdc..0000000
|
||||
--- a/plugins/power/dbus/power-profiles-wrapper.cpp
|
||||
+++ /dev/null
|
||||
@@ -1,124 +0,0 @@
|
||||
-/**
|
||||
- * Copyright (c) 2020 ~ 2023 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: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
- */
|
||||
-#include "power-profiles-wrapper.h"
|
||||
-#include <qt5-log-i.h>
|
||||
-#include <QDBusConnection>
|
||||
-#include <QDBusConnectionInterface>
|
||||
-#include <QDBusMessage>
|
||||
-#include <QVariantList>
|
||||
-#include "power_profiles_proxy.h"
|
||||
-
|
||||
-#define POWERPROFILES_SERVICE_NAME "net.hadess.PowerProfiles"
|
||||
-#define POWERPROFILES_SERVICE_PATH "/net/hadess/PowerProfiles"
|
||||
-#define POWERPROFILES_SERVICE_PROPERTY_ACTIVE_PROFILE "ActiveProfile"
|
||||
-#define POWERPROFILES_SERVICE_PROPERTY_PROFILES "Profiles"
|
||||
-
|
||||
-#define FREEDESKTOP_PROPERTIES_INTERFACE "org.freedesktop.DBus.Properties"
|
||||
-#define FREEDESKTOP_PROPERTIES_METHOD_GET "Get"
|
||||
-#define FREEDESKTOP_PROPERTIES_METHOD_SET "Set"
|
||||
-#define FREEDESKTOP_PROPERTIES_SIGNAL_PROPERTIES_CHANGED "PropertiesChanged"
|
||||
-
|
||||
-Q_DECLARE_METATYPE(QList<QVariantMap>)
|
||||
-PowerProfilesWrapper::PowerProfilesWrapper(QObject* parent)
|
||||
- : QObject(parent),
|
||||
- m_profileProxy(new PowerProfilesProxy(POWERPROFILES_SERVICE_NAME, POWERPROFILES_SERVICE_PATH, QDBusConnection::systemBus(), this))
|
||||
-{
|
||||
- qDBusRegisterMetaType<QList<QVariantMap>>();
|
||||
- if (QDBusConnection::systemBus().interface()->isServiceRegistered(POWERPROFILES_SERVICE_NAME))
|
||||
- {
|
||||
- m_isValid = true;
|
||||
- auto powerProfiles = m_profileProxy->profiles();
|
||||
- for (auto powerProfile : powerProfiles)
|
||||
- {
|
||||
- KLOG_DEBUG() << powerProfile["Profile"].toString()<< powerProfile["Driver"].toString();
|
||||
- if (powerProfile.contains("Profile"))
|
||||
- {
|
||||
- m_profiles << profileNameTransToLocale(powerProfile["Profile"].toString());
|
||||
- }
|
||||
- }
|
||||
-
|
||||
- auto activeProfile = m_profileProxy->activeProfile();
|
||||
- m_activeProfile = activeProfile;
|
||||
- connect(m_profileProxy, &PowerProfilesProxy::ActiveProfileChanged,
|
||||
- this, &PowerProfilesWrapper::onActiveProfileChanged);
|
||||
- }
|
||||
- else
|
||||
- {
|
||||
- KLOG_WARNING() << "power profiles init failed," << POWERPROFILES_SERVICE_NAME << "isn't registered";
|
||||
- }
|
||||
-}
|
||||
-
|
||||
-PowerProfilesWrapper::~PowerProfilesWrapper()
|
||||
-{
|
||||
-}
|
||||
-
|
||||
-bool PowerProfilesWrapper::isValid()
|
||||
-{
|
||||
- return m_isValid;
|
||||
-}
|
||||
-
|
||||
-QStringList PowerProfilesWrapper::supportedProfiles()
|
||||
-{
|
||||
- return m_profiles;
|
||||
-}
|
||||
-
|
||||
-QString PowerProfilesWrapper::activeProfile()
|
||||
-{
|
||||
- return profileNameTransToLocale(m_activeProfile);
|
||||
-}
|
||||
-
|
||||
-void PowerProfilesWrapper::setActiveProfile(const QString& profileName)
|
||||
-{
|
||||
- QString value = localeTransToProfileName(profileName);
|
||||
- m_profileProxy->setActiveProfile(value);
|
||||
-}
|
||||
-
|
||||
-void PowerProfilesWrapper::onActiveProfileChanged(const QString& profileName)
|
||||
-{
|
||||
- m_activeProfile = profileName;
|
||||
- QString localeProfileName = profileNameTransToLocale(profileName);
|
||||
- emit activeProfileChanged(localeProfileName);
|
||||
-}
|
||||
-
|
||||
-QString PowerProfilesWrapper::profileNameTransToLocale(const QString& profileName)
|
||||
-{
|
||||
- QMap<QString, QString> transMap = {
|
||||
- {"power-saver", tr("power-saver")},
|
||||
- {"balanced", tr("balanced")},
|
||||
- {"performance", tr("performance")}};
|
||||
-
|
||||
- QString localeProfileName = profileName;
|
||||
- if (transMap.contains(profileName))
|
||||
- {
|
||||
- localeProfileName = transMap[profileName];
|
||||
- }
|
||||
-
|
||||
- return localeProfileName;
|
||||
-}
|
||||
-
|
||||
-QString PowerProfilesWrapper::localeTransToProfileName(const QString& locale)
|
||||
-{
|
||||
- QMap<QString, QString> transMap = {
|
||||
- {tr("power-saver"), "power-saver"},
|
||||
- {tr("balanced"), "balanced"},
|
||||
- {tr("performance"), "performance"}};
|
||||
-
|
||||
- QString profileName = locale;
|
||||
- if (transMap.contains(locale))
|
||||
- {
|
||||
- profileName = transMap[locale];
|
||||
- }
|
||||
-
|
||||
- return profileName;
|
||||
-}
|
||||
diff --git a/plugins/power/dbus/power-profiles-wrapper.h b/plugins/power/dbus/power-profiles-wrapper.h
|
||||
deleted file mode 100644
|
||||
index 0e5723c..0000000
|
||||
--- a/plugins/power/dbus/power-profiles-wrapper.h
|
||||
+++ /dev/null
|
||||
@@ -1,50 +0,0 @@
|
||||
-/**
|
||||
- * Copyright (c) 2020 ~ 2023 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: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
- */
|
||||
-#pragma once
|
||||
-
|
||||
-#include <QObject>
|
||||
-#include <QDBusMessage>
|
||||
-
|
||||
-class PowerProfilesProxy;
|
||||
-class PowerProfilesWrapper : public QObject
|
||||
-{
|
||||
- Q_OBJECT
|
||||
-public:
|
||||
- PowerProfilesWrapper(QObject* parent = nullptr);
|
||||
- ~PowerProfilesWrapper();
|
||||
-
|
||||
- bool isValid();
|
||||
-
|
||||
- QStringList supportedProfiles();
|
||||
- QString activeProfile();
|
||||
- void setActiveProfile(const QString& profileName);
|
||||
-
|
||||
-private slots:
|
||||
- void onActiveProfileChanged(const QString& profileName);
|
||||
-
|
||||
-signals:
|
||||
- void activeProfileChanged(const QString& profileName);
|
||||
-
|
||||
-private:
|
||||
- // 由英文的ProfileName装换成本地locale的翻译文本
|
||||
- QString profileNameTransToLocale(const QString& profileName);
|
||||
- // 由于locale的翻译文本,转换成英文的ProfileName
|
||||
- QString localeTransToProfileName(const QString& locale);
|
||||
-
|
||||
-private:
|
||||
- PowerProfilesProxy* m_profileProxy = nullptr;
|
||||
- bool m_isValid = false;
|
||||
- QString m_activeProfile;
|
||||
- QStringList m_profiles;
|
||||
-};
|
||||
\ No newline at end of file
|
||||
diff --git a/plugins/power/pages/general-settings-page.cpp b/plugins/power/pages/general-settings-page.cpp
|
||||
index 9176a00..430d103 100644
|
||||
--- a/plugins/power/pages/general-settings-page.cpp
|
||||
+++ b/plugins/power/pages/general-settings-page.cpp
|
||||
@@ -19,7 +19,6 @@
|
||||
#include <QListView>
|
||||
#include <QSignalBlocker>
|
||||
#include "dbus/kwin-color-correct.h"
|
||||
-#include "dbus/power-profiles-wrapper.h"
|
||||
#include "dbus/power.h"
|
||||
#include "kiran-message-box.h"
|
||||
#include "kiran-session-daemon/power-i.h"
|
||||
@@ -41,8 +40,7 @@ GeneralSettingsPage::GeneralSettingsPage(QWidget* parent)
|
||||
: QWidget(parent),
|
||||
ui(new Ui::GeneralSettingsPage),
|
||||
m_powerInterface(PowerInterface::getInstance()),
|
||||
- m_kwinColorCorrect(new KWinColorCorrect(this)),
|
||||
- m_powerprofiles(new PowerProfilesWrapper(this))
|
||||
+ m_kwinColorCorrect(new KWinColorCorrect(this))
|
||||
{
|
||||
ui->setupUi(this);
|
||||
init();
|
||||
@@ -147,13 +145,18 @@ void GeneralSettingsPage::initUI()
|
||||
}
|
||||
|
||||
// 初始化计算机模式
|
||||
- if (m_powerprofiles->isValid())
|
||||
+ struct PowerProfileInfo
|
||||
{
|
||||
- ui->combo_computerMode->addItems(m_powerprofiles->supportedProfiles());
|
||||
- }
|
||||
- else
|
||||
+ QString name;
|
||||
+ int index;
|
||||
+ };
|
||||
+ QList<PowerProfileInfo> profiles = {
|
||||
+ {tr("Energy-saving mode"), POWER_PROFILE_MODE_SAVER},
|
||||
+ {tr("Balanced mode"), POWER_PROFILE_MODE_BALANCED},
|
||||
+ {tr("High performance mode"), POWER_PROFILE_MODE_PERFORMANCE}};
|
||||
+ for (auto profile : profiles)
|
||||
{
|
||||
- ui->widget_computerMode->setVisible(false);
|
||||
+ ui->combo_computerMode->addItem(profile.name, profile.index);
|
||||
}
|
||||
|
||||
/// 初始化QSlider,和延迟设置的Timer
|
||||
@@ -209,7 +212,7 @@ void GeneralSettingsPage::initConnection()
|
||||
connect(ui->combo_closingLid, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this, &GeneralSettingsPage::updateEventAction);
|
||||
|
||||
- connect(ui->combo_computerMode, &QComboBox::currentTextChanged,
|
||||
+ connect(ui->combo_computerMode, QOverload<int>::of(&QComboBox::currentIndexChanged),
|
||||
this, &GeneralSettingsPage::updateCurrentComputerMode);
|
||||
|
||||
connect(&m_brightnessSettingTimer, &QTimer::timeout,
|
||||
@@ -271,10 +274,15 @@ void GeneralSettingsPage::load()
|
||||
updateEventActionComboCurrent(ui->combo_closingLid, POWER_EVENT_LID_CLOSED);
|
||||
|
||||
// 计算机模式
|
||||
- if (m_powerprofiles->isValid())
|
||||
+ QSignalBlocker blocker(ui->combo_computerMode);
|
||||
+ int activePorfileComboxIdx = ui->combo_computerMode->findData(m_powerInterface->activeProfile());
|
||||
+ if (activePorfileComboxIdx != -1)
|
||||
{
|
||||
- QSignalBlocker blocker(ui->combo_computerMode);
|
||||
- ui->combo_computerMode->setCurrentText(m_powerprofiles->activeProfile());
|
||||
+ ui->combo_computerMode->setCurrentIndex(activePorfileComboxIdx);
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ KLOG_ERROR() << "can not fidn current active computer mode in combobox:" << m_powerInterface->activeProfile();
|
||||
}
|
||||
|
||||
// 显示器亮度调整
|
||||
@@ -496,9 +504,20 @@ void GeneralSettingsPage::onSliderColorTempValueChanged(int value)
|
||||
m_colorTempSettingTimer.start();
|
||||
}
|
||||
|
||||
-void GeneralSettingsPage::updateCurrentComputerMode(const QString& text)
|
||||
+void GeneralSettingsPage::updateCurrentComputerMode(int idx)
|
||||
{
|
||||
- m_powerprofiles->setActiveProfile(text);
|
||||
+ auto computerMode = ui->combo_computerMode->itemData(idx);
|
||||
+ auto reply = m_powerInterface->SwitchProfile(computerMode.toInt());
|
||||
+ reply.waitForFinished();
|
||||
+ if (reply.isError())
|
||||
+ {
|
||||
+ KLOG_ERROR() << "set current computer mode" << computerMode.toInt()
|
||||
+ << "failed," << reply.error();
|
||||
+ }
|
||||
+ else
|
||||
+ {
|
||||
+ KLOG_DEBUG() << "set current computer mode" << computerMode.toInt();
|
||||
+ }
|
||||
}
|
||||
|
||||
void GeneralSettingsPage::setUiBrightnessPercent(int percent)
|
||||
diff --git a/plugins/power/pages/general-settings-page.h b/plugins/power/pages/general-settings-page.h
|
||||
index 63e8591..e270253 100644
|
||||
--- a/plugins/power/pages/general-settings-page.h
|
||||
+++ b/plugins/power/pages/general-settings-page.h
|
||||
@@ -29,7 +29,6 @@ class PowerInterface;
|
||||
class KiranSwitchButton;
|
||||
class QGSettings;
|
||||
class KWinColorCorrect;
|
||||
-class PowerProfilesWrapper;
|
||||
class GeneralSettingsPage : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
@@ -62,13 +61,12 @@ private slots:
|
||||
void onSwitchAutoColorTempToggoled(bool checked);
|
||||
void updateColorTempatureValue();
|
||||
void onSliderColorTempValueChanged(int value);
|
||||
- void updateCurrentComputerMode(const QString& text);
|
||||
+ void updateCurrentComputerMode(int idx);
|
||||
|
||||
private:
|
||||
Ui::GeneralSettingsPage *ui;
|
||||
PowerInterface* m_powerInterface;
|
||||
KWinColorCorrect* m_kwinColorCorrect;
|
||||
- PowerProfilesWrapper* m_powerprofiles;
|
||||
QTimer m_brightnessSettingTimer;
|
||||
QTimer m_idleTimeSettingTimer;
|
||||
QTimer m_colorTempSettingTimer;
|
||||
diff --git a/translations/kiran-control-panel.zh_CN.ts b/translations/kiran-control-panel.zh_CN.ts
|
||||
index 31fc01e..83cac3b 100644
|
||||
--- a/translations/kiran-control-panel.zh_CN.ts
|
||||
+++ b/translations/kiran-control-panel.zh_CN.ts
|
||||
@@ -2297,50 +2297,65 @@
|
||||
<translation>待机时唤醒需要输入密码</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="121"/>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="134"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="119"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="132"/>
|
||||
<source>shutdown</source>
|
||||
<translation>关机</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="122"/>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="128"/>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="133"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="120"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="126"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="131"/>
|
||||
<source>hibernate</source>
|
||||
<translation>休眠</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="123"/>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="127"/>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="132"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="121"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="125"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="130"/>
|
||||
<source>suspend</source>
|
||||
<translation>待机</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="124"/>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="129"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="122"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="127"/>
|
||||
<source>display off</source>
|
||||
<translation>关闭显示器</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="125"/>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="130"/>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="135"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="123"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="128"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="133"/>
|
||||
<source>do nothing</source>
|
||||
<translation>不执行操作</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="414"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="154"/>
|
||||
+ <source>Energy-saving mode</source>
|
||||
+ <translation>节能模式</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="155"/>
|
||||
+ <source>Balanced mode</source>
|
||||
+ <translation>平衡模式</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="156"/>
|
||||
+ <source>High performance mode</source>
|
||||
+ <translation>高性能模式</translation>
|
||||
+ </message>
|
||||
+ <message>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="422"/>
|
||||
<source>ERROR</source>
|
||||
<translation>错误</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="530"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="549"/>
|
||||
<source>%1hour</source>
|
||||
<translation>%1小时</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/power/pages/general-settings-page.cpp" line="534"/>
|
||||
+ <location filename="../plugins/power/pages/general-settings-page.cpp" line="553"/>
|
||||
<source>%1minute</source>
|
||||
<translation>%1分钟</translation>
|
||||
</message>
|
||||
@@ -4329,22 +4344,16 @@ This is line 50 of the test text</source>
|
||||
<context>
|
||||
<name>PowerProfilesWrapper</name>
|
||||
<message>
|
||||
- <location filename="../plugins/power/dbus/power-profiles-wrapper.cpp" line="97"/>
|
||||
- <location filename="../plugins/power/dbus/power-profiles-wrapper.cpp" line="113"/>
|
||||
<source>power-saver</source>
|
||||
- <translation>省电模式</translation>
|
||||
+ <translation type="vanished">省电模式</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/power/dbus/power-profiles-wrapper.cpp" line="98"/>
|
||||
- <location filename="../plugins/power/dbus/power-profiles-wrapper.cpp" line="114"/>
|
||||
<source>balanced</source>
|
||||
- <translation>平衡模式</translation>
|
||||
+ <translation type="vanished">平衡模式</translation>
|
||||
</message>
|
||||
<message>
|
||||
- <location filename="../plugins/power/dbus/power-profiles-wrapper.cpp" line="99"/>
|
||||
- <location filename="../plugins/power/dbus/power-profiles-wrapper.cpp" line="115"/>
|
||||
<source>performance</source>
|
||||
- <translation>性能模式</translation>
|
||||
+ <translation type="vanished">性能模式</translation>
|
||||
</message>
|
||||
</context>
|
||||
<context>
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,35 +0,0 @@
|
||||
From b3ac61f93e733f3ec0d9cea4452d0eee159e8957 Mon Sep 17 00:00:00 2001
|
||||
From: liuxinhao <liuxinhao@kylinsec.com.cn>
|
||||
Date: Mon, 15 Jan 2024 17:52:29 +0800
|
||||
Subject: [PATCH 16/17] fix(launcher): Fix the space before the parameter
|
||||
causing a jump event when the launcher jumps
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修复启动器跳转时参数前的空格导致跳转失败
|
||||
|
||||
Closes #24794
|
||||
---
|
||||
src/main.cpp | 4 ++++
|
||||
1 file changed, 4 insertions(+)
|
||||
|
||||
diff --git a/src/main.cpp b/src/main.cpp
|
||||
index 981fdbf..4258832 100644
|
||||
--- a/src/main.cpp
|
||||
+++ b/src/main.cpp
|
||||
@@ -65,7 +65,11 @@ void processCommandLine()
|
||||
cmdParser.process(*singleApp);
|
||||
|
||||
QString category = cmdParser.value(categoryOption);
|
||||
+ category = category.trimmed();
|
||||
+
|
||||
QString subItem = cmdParser.value(subItemOption);
|
||||
+ subItem = subItem.trimmed();
|
||||
+
|
||||
if( !subItem.isEmpty() && category.isEmpty() )
|
||||
{
|
||||
std::cerr << "failed to set sub item without category" << std::endl;
|
||||
--
|
||||
2.33.0
|
||||
|
||||
@ -1,75 +0,0 @@
|
||||
From 251cff7db6e926b9df02276acf49d80c8e8b958f Mon Sep 17 00:00:00 2001
|
||||
From: luoqing <luoqing@kylinsec.com.cn>
|
||||
Date: Tue, 9 Jan 2024 17:13:10 +0800
|
||||
Subject: [PATCH 17/17] fix(audio):fixed volume tray icon level display not
|
||||
meeting requirements
|
||||
MIME-Version: 1.0
|
||||
Content-Type: text/plain; charset=UTF-8
|
||||
Content-Transfer-Encoding: 8bit
|
||||
|
||||
- 修复音量托盘图标级别显示不符合需求
|
||||
|
||||
Close #25235
|
||||
---
|
||||
plugins/audio/src/system-tray/audio-system-tray.cpp | 4 ++--
|
||||
plugins/audio/src/system-tray/volume-setting-page.cpp | 4 ++--
|
||||
plugins/network/src/signal-forward.cpp | 4 ++--
|
||||
3 files changed, 6 insertions(+), 6 deletions(-)
|
||||
|
||||
diff --git a/plugins/audio/src/system-tray/audio-system-tray.cpp b/plugins/audio/src/system-tray/audio-system-tray.cpp
|
||||
index ed4412f..b20ad15 100644
|
||||
--- a/plugins/audio/src/system-tray/audio-system-tray.cpp
|
||||
+++ b/plugins/audio/src/system-tray/audio-system-tray.cpp
|
||||
@@ -266,12 +266,12 @@ void AudioSystemTray::setTrayIcon(int value)
|
||||
icon.addPixmap(trayIconColorSwitch("kcp-audio-mute"));
|
||||
icon.addPixmap(trayIconColorSwitch("kcp-audio-mute", 64));
|
||||
}
|
||||
- else if (0 < value && value <= 33)
|
||||
+ else if (0 < value && value <= 34)
|
||||
{
|
||||
icon.addPixmap(trayIconColorSwitch("kcp-audio-low"));
|
||||
icon.addPixmap(trayIconColorSwitch("kcp-audio-low", 64));
|
||||
}
|
||||
- else if (33 < value && value <= 66)
|
||||
+ else if (33 < value && value <= 67)
|
||||
{
|
||||
icon.addPixmap(trayIconColorSwitch("kcp-audio-medium"));
|
||||
icon.addPixmap(trayIconColorSwitch("kcp-audio-medium", 64));
|
||||
diff --git a/plugins/audio/src/system-tray/volume-setting-page.cpp b/plugins/audio/src/system-tray/volume-setting-page.cpp
|
||||
index dbb1cd8..d95b039 100644
|
||||
--- a/plugins/audio/src/system-tray/volume-setting-page.cpp
|
||||
+++ b/plugins/audio/src/system-tray/volume-setting-page.cpp
|
||||
@@ -239,11 +239,11 @@ void VolumeSettingPage::setVolumeIcon(int value)
|
||||
{
|
||||
ui->muteButton->setIcon(trayIconColorSwitch("kcp-audio-mute"));
|
||||
}
|
||||
- else if (0 < value && value <= 33)
|
||||
+ else if (0 < value && value <= 34)
|
||||
{
|
||||
ui->muteButton->setIcon(trayIconColorSwitch("kcp-audio-low"));
|
||||
}
|
||||
- else if (33 < value && value <= 66)
|
||||
+ else if (33 < value && value <= 67)
|
||||
{
|
||||
ui->muteButton->setIcon(trayIconColorSwitch("kcp-audio-medium"));
|
||||
}
|
||||
diff --git a/plugins/network/src/signal-forward.cpp b/plugins/network/src/signal-forward.cpp
|
||||
index 82f4de9..de8415d 100644
|
||||
--- a/plugins/network/src/signal-forward.cpp
|
||||
+++ b/plugins/network/src/signal-forward.cpp
|
||||
@@ -172,10 +172,10 @@ void SignalForward::addDevice(const QString &uni)
|
||||
switch (device->type())
|
||||
{
|
||||
case Device::Type::Ethernet:
|
||||
- emit wiredDeviceAdded(uni);;
|
||||
+ emit wiredDeviceAdded(uni);
|
||||
break;
|
||||
case Device::Type::Wifi:
|
||||
- emit wirelessDeviceAdded(uni);;
|
||||
+ emit wirelessDeviceAdded(uni);
|
||||
break;
|
||||
default:
|
||||
emit otherDeviceAdded(uni);
|
||||
--
|
||||
2.33.0
|
||||
|
||||
Binary file not shown.
@ -1,30 +1,15 @@
|
||||
Name: kiran-control-panel
|
||||
Version: 2.6.0
|
||||
Release: 6%{?dist}
|
||||
Version: 2.6.1
|
||||
Release: 3%{?dist}
|
||||
Summary: Kiran Control Panel
|
||||
Summary(zh_CN): Kiran桌面控制面板
|
||||
|
||||
License: MulanPSL-2.0
|
||||
Source0: %{name}-%{version}.tar.gz
|
||||
|
||||
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
|
||||
Patch0003: 0003-fix-LC_TIME-set-LC_TIME-to-UTF-8.patch
|
||||
Patch0004: 0004-fix-network-fix-compile-issues-QString-SkipEmptyPart.patch
|
||||
Patch0005: 0005-fix-audio-listen-to-mute-property-change-to-fix-shor.patch
|
||||
Patch0006: 0006-fix-network-fixd-an-issue-where-the-network-tray-ico.patch
|
||||
Patch0007: 0007-fix-application-add-a-compilation-switch-to-control-.patch
|
||||
Patch0008: 0008-refactor-account-Remove-useless-password-encryption-.patch
|
||||
Patch0009: 0009-fix-translations-Fix-translation-errors-in-battery-s.patch
|
||||
Patch00010: 0010-fix-account-Fix-the-issue-of-setting-default-selecti.patch
|
||||
Patch00011: 0011-fix-build-delete-useless-methods.patch
|
||||
Patch00012: 0012-fix-font-Fix-the-issue-of-ineffective-font-changes.patch
|
||||
Patch00013: 0013-fix-theme-change-the-light-and-dark-theme-name.patch
|
||||
Patch00014: 0014-fix-shortcut-add-custom-app-icon-Error-prompt-for-mo.patch
|
||||
Patch00015: 0015-fix-power-profile-mode-using-kiran-cc-daemon-power-i.patch
|
||||
Patch00016: 0016-fix-launcher-Fix-the-space-before-the-parameter-caus.patch
|
||||
Patch00017: 0017-fix-audio-fixed-volume-tray-icon-level-display-not-m.patch
|
||||
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
|
||||
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: cmake >= 3.2
|
||||
@ -38,6 +23,8 @@ BuildRequires: libXrandr-devel
|
||||
BuildRequires: libXcursor-devel
|
||||
|
||||
BuildRequires: qt5-qtbase-devel
|
||||
BuildRequires: qt5-qtbase-static
|
||||
BuildRequires: qt5-qtbase-private-devel
|
||||
BuildRequires: qt5-qtx11extras-devel
|
||||
BuildRequires: qt5-qtsvg-devel
|
||||
BuildRequires: qt5-qtmultimedia-devel
|
||||
@ -172,6 +159,22 @@ make %{?_smp_mflags}
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%changelog
|
||||
* Tue Apr 9 2024 youzhengcai <youzhengcai@kylinsec.com.cn> - 2.6.1-3
|
||||
- KYOS-F: fix(audio&network):Compatible for versions below 5.15
|
||||
|
||||
* Tue Mar 5 2024 luoqing <luoqing@kylinsec.com.cn> - 2.6.1-2.kb1
|
||||
- KYOS-B: when the tray is initialized, determine whether there is asound card,if not, the volume icon is disabled (#22865)
|
||||
- KYOS-B: fix(keybinding):don't convert normal key if use shift modifier in keybinding (#30978)
|
||||
|
||||
* Thu Feb 2 2024 luoqing <luoqing@kylinsec.com.cn> - 2.6.1-1.kb1
|
||||
- KYOS-B: The network connection icon is displayed only in the fully Connected state.The connection icon is not displayed in the ConnectedLinkLocal state (#27750)
|
||||
- KYOS-B: fixed an issue where tray page expansion size changed incorrectly when multiple network cards were used (#25239)
|
||||
- KYOS-B: fixed incorrect connectivity results when frequent network connectivity checks are triggered (#29475)
|
||||
- KYOS-F: Filter conditions are added to the tray status display,and activation icons are displayed only when there are supported activation devices;The tray icon update is triggered when the device status changes to active or disconnected (#29441)
|
||||
- KYOS-B: Fix translation of shortcut key types Accessibility
|
||||
- KYOS-B: change ci config
|
||||
- KYOS-F: New feature to restore font default settings (#20203)
|
||||
|
||||
* Thu Jan 18 2024 luoqing <luoqing@kylinsec.com.cn> - 2.6.0-6
|
||||
- KYOS-B: Fix the issue of setting default selection sidebar errors (#24761)
|
||||
- KYOS-B: Fix the issue of ineffective font changes (#25084)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user