kiran-control-panel/0015-fix-power-profile-mode-using-kiran-cc-daemon-power-i.patch

670 lines
26 KiB
Diff
Raw Normal View History

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&lt;QVariantMap&gt;"/>
- </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&lt;QVariantMap&gt;"/>
- </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