-rw-r--r-- | core/settings/light-and-power/light.cpp | 5 | ||||
-rw-r--r-- | core/settings/light-and-power/settings.h | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index 960a165..b56ae11 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp | |||
@@ -112,24 +112,29 @@ void LightSettings::accept() | |||
112 | 112 | ||
113 | Config config( "qpe" ); | 113 | Config config( "qpe" ); |
114 | config.setGroup( "Screensaver" ); | 114 | config.setGroup( "Screensaver" ); |
115 | config.writeEntry( "Dim", (int)screensaver_dim->isChecked() ); | 115 | config.writeEntry( "Dim", (int)screensaver_dim->isChecked() ); |
116 | config.writeEntry( "LightOff", (int)screensaver_lightoff->isChecked() ); | 116 | config.writeEntry( "LightOff", (int)screensaver_lightoff->isChecked() ); |
117 | config.writeEntry( "LcdOffOnly", (int)LcdOffOnly->isChecked() ); | 117 | config.writeEntry( "LcdOffOnly", (int)LcdOffOnly->isChecked() ); |
118 | config.writeEntry( "Interval_Dim", interval_dim->value() ); | 118 | config.writeEntry( "Interval_Dim", interval_dim->value() ); |
119 | config.writeEntry( "Interval_LightOff", interval_lightoff->value() ); | 119 | config.writeEntry( "Interval_LightOff", interval_lightoff->value() ); |
120 | config.writeEntry( "Interval", interval_suspend->value() ); | 120 | config.writeEntry( "Interval", interval_suspend->value() ); |
121 | config.writeEntry( "Brightness", | 121 | config.writeEntry( "Brightness", |
122 | (brightness->maxValue()-brightness->value())*255/brightness->maxValue() ); | 122 | (brightness->maxValue()-brightness->value())*255/brightness->maxValue() ); |
123 | config.write(); | 123 | config.write(); |
124 | 124 | ||
125 | QDialog::accept(); | 125 | QDialog::accept(); |
126 | } | 126 | } |
127 | 127 | ||
128 | void LightSettings::applyBrightness() | 128 | void LightSettings::applyBrightness() |
129 | { | 129 | { |
130 | int bright = (brightness->maxValue()-brightness->value())*255 | 130 | int bright = (brightness->maxValue()-brightness->value())*255 |
131 | / brightness->maxValue(); | 131 | / brightness->maxValue(); |
132 | set_fl(bright); | 132 | set_fl(bright); |
133 | } | 133 | } |
134 | 134 | ||
135 | 135 | ||
136 | void LightSettings::done(int r) | ||
137 | { | ||
138 | QDialog::done(r); | ||
139 | close ( ); | ||
140 | } | ||
diff --git a/core/settings/light-and-power/settings.h b/core/settings/light-and-power/settings.h index cec08e3..27c09a7 100644 --- a/core/settings/light-and-power/settings.h +++ b/core/settings/light-and-power/settings.h | |||
@@ -16,35 +16,37 @@ | |||
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | #ifndef SETTINGS_H | 20 | #ifndef SETTINGS_H |
21 | #define SETTINGS_H | 21 | #define SETTINGS_H |
22 | 22 | ||
23 | 23 | ||
24 | #include <qstrlist.h> | 24 | #include <qstrlist.h> |
25 | #include <qasciidict.h> | 25 | #include <qasciidict.h> |
26 | #include "lightsettingsbase.h" | 26 | #include "lightsettingsbase.h" |
27 | 27 | ||
28 | 28 | ||
29 | class LightSettings : public LightSettingsBase | 29 | class LightSettings : public LightSettingsBase |
30 | { | 30 | { |
31 | Q_OBJECT | 31 | Q_OBJECT |
32 | 32 | ||
33 | public: | 33 | public: |
34 | LightSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); | 34 | LightSettings( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); |
35 | ~LightSettings(); | 35 | ~LightSettings(); |
36 | 36 | ||
37 | protected: | 37 | protected: |
38 | void accept(); | 38 | void accept(); |
39 | void reject(); | 39 | void reject(); |
40 | |||
41 | void done ( int r ); | ||
40 | 42 | ||
41 | private slots: | 43 | private slots: |
42 | void applyBrightness(); | 44 | void applyBrightness(); |
43 | 45 | ||
44 | private: | 46 | private: |
45 | int initbright; | 47 | int initbright; |
46 | }; | 48 | }; |
47 | 49 | ||
48 | 50 | ||
49 | #endif // SETTINGS_H | 51 | #endif // SETTINGS_H |
50 | 52 | ||