From 5e7bdf8cacc30b19979620cd3cb92a3e1b7a7012 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Wed, 23 Aug 2023 23:02:24 +0900 Subject: Extend DCOP interface with new brightnessSet method Signed-off-by: Michele Calgaro (cherry picked from commit 5ae13039bcb5e5d863d59de6d14904977c5ecedb) --- src/tdepowersave.cpp | 12 ++++++++++++ src/tdepowersave.h | 2 ++ 2 files changed, 14 insertions(+) diff --git a/src/tdepowersave.cpp b/src/tdepowersave.cpp index 2cbc837..b5db7a9 100644 --- a/src/tdepowersave.cpp +++ b/src/tdepowersave.cpp @@ -2946,4 +2946,16 @@ int tdepowersave::brightnessGet() { return retval; } +//! dcop funtion to set the brightness level +void tdepowersave::brightnessSet(int percentage) +{ + kdDebugFuncIn(trace); + + if (hwinfo->supportBrightness() && percentage >= 0 && percentage <= 100) + { + hwinfo->setBrightness(-1, percentage); + } + + kdDebugFuncOut(trace); +} #include "tdepowersave.moc" diff --git a/src/tdepowersave.h b/src/tdepowersave.h index e63342c..af4780e 100644 --- a/src/tdepowersave.h +++ b/src/tdepowersave.h @@ -444,6 +444,8 @@ k_dcop: bool currentSchemeManagesDPMS(); //! dcop funtion to get the current brightness level int brightnessGet(); + //! dcop funtion to set the brightness level + void brightnessSet(int percentage); //! dcop function to return the name of the current scheme TQString currentScheme (); -- cgit v1.2.1