!20 bug fix : I726MV、I726LY

Merge pull request !20 from hyter/openkylin/yangtze
This commit is contained in:
江川朗月 2023-06-21 03:21:18 +00:00 committed by Gitee
commit 8d1ce4152f
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
9 changed files with 36 additions and 6 deletions

13
debian/changelog vendored
View File

@ -1,3 +1,16 @@
ukui-power-manager (4.0.0.0-ok1.3) yangtze; urgency=medium
* 解决编译问题
-- hanhongliang <hanhongliang@kylinos.cn> Wed, 21 Jun 2023 09:25:44 +0800
ukui-power-manager (4.0.0.0-ok1.2) yangtze; urgency=medium
* close-cd #I726MV 【主要】【电源管理】睡眠前十秒,没有降低屏幕亮度
* close-cd #I726LY 【主要】【电源管理】关闭显示器前十秒,没有降低屏幕亮度
-- hanhongliang <hanhongliang@kylinos.cn> Tue, 20 Jun 2023 17:12:46 +0800
ukui-power-manager (4.0.0.0-ok1.1) yangtze; urgency=medium
* close-cd #I79LPB 电源计划,节能模式 性能模式 ,前台和后台对应异常

1
debian/source/options vendored Normal file
View File

@ -0,0 +1 @@
include-binaries

Binary file not shown.

View File

@ -31,11 +31,12 @@ CompatibleInterface::CompatibleInterface(QObject *parent) : QObject(parent)
"org.ukui.powermanagement.interface",
QDBusConnection::systemBus());
m_brightnes = brightnesssettings->get(BRIGHTNESS).toInt();
connect(brightnesssettings, &QGSettings::changed, [=](QString key) {
if (BRIGHTNESS == key) {
brightnes=brightnesssettings->get(BRIGHTNESS).toInt();
interface->call("RegulateBrightness",brightnes);
qDebug()<<"brightness"<<brightnes;
m_brightnes = brightnesssettings->get(BRIGHTNESS).toInt();
interface->call("RegulateBrightness", m_brightnes);
qDebug() << "brightness"<< m_brightnes;
}
});
}
@ -45,3 +46,16 @@ CompatibleInterface::~CompatibleInterface()
delete iface;
delete interface;
}
void CompatibleInterface::reduceBrightness()
{
int brightness = m_brightnes * 0.7;
interface->call("RegulateBrightness", brightness);
qDebug() << "reduce brightness";
}
void CompatibleInterface::restoreBrightness()
{
interface->call("RegulateBrightness", m_brightnes);
qDebug() << "restore brightness";
}

View File

@ -32,10 +32,12 @@ public:
explicit CompatibleInterface(QObject *parent = nullptr);
~CompatibleInterface();
void reduceBrightness();
void restoreBrightness();
private:
QGSettings *brightnesssettings;
int brightnes;
int m_brightnes;
QDBusInterface *iface;
QDBusInterface *interface;

View File

@ -144,13 +144,13 @@ void PowerManagerCenter::dealIdleEvent(const QString &type)
} else if (SLEEP_DISPLAY == type) {
m_control->dealControlAction(TURN_OFF_DISPLAY, true);
} else if (REDUCE_BRIGHTNESS == type) {
m_brightness->reduceBrightness();
m_compatibleInterface->reduceBrightness();
m_isIdleBrightness = true;
} else if (ENTER_IDLE_STATE == type) {
setIdleTime(machineType);
} else if (EXIT_IDLE_STATE == type) {
if (Laptop == machineType && m_isIdleBrightness) {
m_brightness->restoreBrightness();
m_compatibleInterface->restoreBrightness();
m_isIdleBrightness = false;
}
}