summaryrefslogtreecommitdiffstats
path: root/src/tdepowersave.cpp
diff options
context:
space:
mode:
authorMichele Calgaro <[email protected]>2023-08-23 23:02:24 +0900
committerMichele Calgaro <[email protected]>2023-08-23 23:02:24 +0900
commit5ae13039bcb5e5d863d59de6d14904977c5ecedb (patch)
treed2b3155199c2056eaa09d213c682e7eaadf530ab /src/tdepowersave.cpp
parent8d7b59182699760823b0997412039ee3cbdb346f (diff)
downloadtdepowersave-5ae13039bcb5e5d863d59de6d14904977c5ecedb.tar.gz
tdepowersave-5ae13039bcb5e5d863d59de6d14904977c5ecedb.zip
Extend DCOP interface with new brightnessSet method
Signed-off-by: Michele Calgaro <[email protected]>
Diffstat (limited to 'src/tdepowersave.cpp')
-rw-r--r--src/tdepowersave.cpp12
1 files changed, 12 insertions, 0 deletions
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"