!20 bug fix : I726MV、I726LY
Merge pull request !20 from hyter/openkylin/yangtze
This commit is contained in:
commit
8d1ce4152f
Binary file not shown.
|
@ -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 电源计划,节能模式 性能模式 ,前台和后台对应异常
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
include-binaries
|
Binary file not shown.
Binary file not shown.
|
@ -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";
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
Binary file not shown.
Loading…
Reference in New Issue