fix: kwin
Description: add dbus of openkylin Log: 【控制面板】【需求16039】显示器色温未增加跟随日出日落的自动色温方案 Bug: https://gitee.com/openkylin/ukui-control-center/issues/I5XA15
This commit is contained in:
parent
c255de1b4d
commit
90ee404a44
|
@ -2145,13 +2145,19 @@ void Widget::hideComponent()
|
|||
|
||||
void Widget::initNightStatus()
|
||||
{
|
||||
QDBusInterface colorIft("org.ukui.KWin",
|
||||
QString service = "org.ukui.KWin";
|
||||
QString property = "org.ukui.kwin.ColorCorrect";
|
||||
if (UkccCommon::isOpenkylin()) {
|
||||
service = "org.kde.KWin";
|
||||
property = "org.ukui.kde.ColorCorrect";
|
||||
}
|
||||
QDBusInterface colorIft(service,
|
||||
"/ColorCorrect",
|
||||
"org.freedesktop.DBus.Properties",
|
||||
QDBusConnection::sessionBus());
|
||||
if (colorIft.isValid() && !UkccCommon::isOpenkylin() && !UkccCommon::isWayland()) {
|
||||
this->mRedshiftIsValid = true;
|
||||
QDBusReply<QVariant> reply = colorIft.call("Get", "org.ukui.kwin.ColorCorrect", "available");
|
||||
QDBusReply<QVariant> reply = colorIft.call("Get", property, "available");
|
||||
if (!reply.value().toBool()) {
|
||||
mNightModeWidget->setChecked(false);
|
||||
mNightModeWidget->setEnabled(false);
|
||||
|
@ -2229,8 +2235,7 @@ void Widget::setNightModeSetting()
|
|||
mTimeModeWidget->comboBox()->blockSignals(true);
|
||||
if (m_colorSettings->get(NIGHT_ENABLE_KEY).toBool()) {
|
||||
mNightModeWidget->setChecked(true);
|
||||
if(m_colorSettings->get(AllDAY_KEY).toBool())
|
||||
{
|
||||
if(m_colorSettings->get(AllDAY_KEY).toBool()) {
|
||||
mTimeModeWidget->comboBox()->setCurrentIndex(0);
|
||||
} else if(m_colorSettings->get(AUTO_KEY).toBool()) {
|
||||
mTimeModeWidget->comboBox()->setCurrentIndex(1);
|
||||
|
@ -2277,6 +2282,7 @@ QString Widget::getSunTime()
|
|||
QVector<QString> timevector;
|
||||
QVector<int> res;
|
||||
res << ophour << opmin << clhour << clmin;
|
||||
qDebug() << Q_FUNC_INFO << ophour << opmin << clhour << clmin;
|
||||
for (int i : res)
|
||||
timevector.append(QString("%1%2").arg(i < 10 ? "0" : "").arg(QString::number(i)));
|
||||
|
||||
|
|
Loading…
Reference in New Issue