author | sandman <sandman> | 2002-10-28 02:33:02 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-10-28 02:33:02 (UTC) |
commit | 37397a824a807195ba440117a6bac0043ea788a1 (patch) (unidiff) | |
tree | 0fc3ae6178d46b7c1fa834c1e43a8248369970d9 | |
parent | c1f70789d18145743fd71464c091612788cc5e3f (diff) | |
download | opie-37397a824a807195ba440117a6bac0043ea788a1.zip opie-37397a824a807195ba440117a6bac0043ea788a1.tar.gz opie-37397a824a807195ba440117a6bac0043ea788a1.tar.bz2 |
some minor adjustments in the l&p <-> launcher interface routine
-rw-r--r-- | core/settings/light-and-power/light.cpp | 31 |
1 files changed, 18 insertions, 13 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index c021ad4..aa36e06 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp | |||
@@ -148,86 +148,91 @@ void LightSettings::reject() | |||
148 | set_fl(initbright); | 148 | set_fl(initbright); |
149 | QDialog::reject(); | 149 | QDialog::reject(); |
150 | } | 150 | } |
151 | 151 | ||
152 | void LightSettings::accept() | 152 | void LightSettings::accept() |
153 | { | 153 | { |
154 | if ( qApp->focusWidget() ) { | 154 | if ( qApp->focusWidget() ) { |
155 | qApp->focusWidget()->clearFocus(); | 155 | qApp->focusWidget()->clearFocus(); |
156 | } | 156 | } |
157 | 157 | ||
158 | applyBrightness(); | 158 | applyBrightness(); |
159 | 159 | ||
160 | // bat | 160 | // bat |
161 | int i_dim = interval_dim->value(); | 161 | int i_dim = interval_dim->value(); |
162 | int i_lightoff = interval_lightoff->value(); | 162 | int i_lightoff = interval_lightoff->value(); |
163 | int i_suspend = interval_suspend->value(); | 163 | int i_suspend = interval_suspend->value(); |
164 | QCopEnvelope e("QPE/System", "setScreenSaverIntervals(int,int,int)" ); | ||
165 | e << i_dim << i_lightoff << i_suspend; | ||
166 | 164 | ||
167 | // ac | 165 | // ac |
168 | int i_dim_ac = interval_dim_ac_3->value(); | 166 | int i_dim_ac = interval_dim_ac_3->value(); |
169 | int i_lightoff_ac = interval_lightoff_ac_3->value(); | 167 | int i_lightoff_ac = interval_lightoff_ac_3->value(); |
170 | int i_suspend_ac = interval_suspend_ac_3->value(); | 168 | int i_suspend_ac = interval_suspend_ac_3->value(); |
171 | QCopEnvelope e_ac("QPE/System", "setScreenSaverIntervalsAC(int,int,int)" ); | ||
172 | e << i_dim_ac << i_lightoff_ac << i_suspend_ac; | ||
173 | 169 | ||
174 | Config config( "apm" ); | 170 | Config config( "apm" ); |
175 | 171 | ||
176 | config.setGroup( "Battery" ); | 172 | config.setGroup( "Battery" ); |
177 | 173 | ||
178 | // bat | 174 | // bat |
179 | config.writeEntry( "LcdOffOnly", LcdOffOnly->isChecked() ); | 175 | config.writeEntry( "LcdOffOnly", LcdOffOnly->isChecked() ); |
180 | config.writeEntry( "Dim", interval_dim->value() ); | 176 | config.writeEntry( "Dim", i_dim ); |
181 | config.writeEntry( "LightOff", interval_lightoff->value() ); | 177 | config.writeEntry( "LightOff", i_lightoff ); |
182 | config.writeEntry( "Suspend", interval_suspend->value() ); | 178 | config.writeEntry( "Suspend", i_suspend ); |
183 | config.writeEntry( "Brightness", | 179 | config.writeEntry( "Brightness", |
184 | ( brightness->value() ) * 255 / brightness->maxValue() ); | 180 | ( brightness->value() ) * 255 / brightness->maxValue() ); |
185 | 181 | ||
186 | // ac | 182 | // ac |
187 | config.setGroup( "AC" ); | 183 | config.setGroup( "AC" ); |
188 | config.writeEntry( "LcdOffOnly", LcdOffOnly_2_3->isChecked() ); | 184 | config.writeEntry( "LcdOffOnly", LcdOffOnly_2_3->isChecked() ); |
189 | config.writeEntry( "Dim", interval_dim_ac_3->value() ); | 185 | config.writeEntry( "Dim", i_dim_ac ); |
190 | config.writeEntry( "LightOff", interval_lightoff_ac_3->value() ); | 186 | config.writeEntry( "LightOff", i_lightoff_ac ); |
191 | config.writeEntry( "Suspend", interval_suspend_ac_3->value() ); | 187 | config.writeEntry( "Suspend", i_suspend_ac ); |
192 | config.writeEntry( "Brightness", | 188 | config.writeEntry( "Brightness", |
193 | ( brightness_ac_3->value()) * 255 / brightness_ac_3->maxValue() ); | 189 | ( brightness_ac_3->value()) * 255 / brightness_ac_3->maxValue() ); |
194 | 190 | ||
195 | 191 | ||
196 | // only make light sensor stuff appear if the unit has a sensor | 192 | // only make light sensor stuff appear if the unit has a sensor |
197 | if ( ODevice::inst()->hasLightSensor() ) { | 193 | if ( ODevice::inst()->hasLightSensor() ) { |
198 | config.setGroup( "lightsensor" ); | ||
199 | config.setGroup( "Battery" ); | 194 | config.setGroup( "Battery" ); |
200 | config.writeEntry( "LightSensor", (int)auto_brightness->isChecked() ); | 195 | config.writeEntry( "LightSensor", (int)auto_brightness->isChecked() ); |
201 | config.setGroup( "AC" ); | 196 | config.setGroup( "AC" ); |
202 | config.writeEntry( "LightSensor", (int)auto_brightness_ac_3->isChecked() ); | 197 | config.writeEntry( "LightSensor", (int)auto_brightness_ac_3->isChecked() ); |
203 | //config.writeEntry( "Steps", LightStepSpin->value() ); | 198 | //config.writeEntry( "Steps", LightStepSpin->value() ); |
204 | //onfig.writeEntry( "MinValue", LightMinValueSlider->value() ); | 199 | //onfig.writeEntry( "MinValue", LightMinValueSlider->value() ); |
205 | //config.writeEntry( "Shift", LightShiftSpin->value() ); | 200 | //config.writeEntry( "Shift", LightShiftSpin->value() ); |
206 | } | 201 | } |
207 | 202 | ||
208 | 203 | ||
209 | // advanced | 204 | // advanced |
210 | config.setGroup( "Warnings" ); | 205 | config.setGroup( "Warnings" ); |
211 | config.writeEntry( "check_interval", warnintervalBox->value()*1000 ); | 206 | config.writeEntry( "check_interval", warnintervalBox->value()*1000 ); |
212 | config.writeEntry( "power_verylow", lowSpinBox->value() ); | 207 | config.writeEntry( "power_verylow", lowSpinBox->value() ); |
213 | config.writeEntry( "power_critical", criticalSpinBox->value() ); | 208 | config.writeEntry( "power_critical", criticalSpinBox->value() ); |
214 | QCopEnvelope e_warn("QPE/System", "reloadPowerWarnSettings()"); | ||
215 | |||
216 | config.write(); | 209 | config.write(); |
217 | 210 | ||
211 | { | ||
212 | QCopEnvelope e ( "QPE/System", "reloadPowerWarnSettings()" ); | ||
213 | } | ||
214 | { | ||
215 | QCopEnvelope e ( "QPE/System", "setScreenSaverInterval(int)" ); | ||
216 | e << -1; | ||
217 | } | ||
218 | { | ||
219 | QCopEnvelope e ( "QPE/System", "setBacklight(int)" ); | ||
220 | e << -1; | ||
221 | } | ||
222 | |||
218 | QDialog::accept(); | 223 | QDialog::accept(); |
219 | } | 224 | } |
220 | 225 | ||
221 | void LightSettings::applyBrightness() | 226 | void LightSettings::applyBrightness() |
222 | { | 227 | { |
223 | if ( PowerStatusManager::readStatus().acStatus() != PowerStatus::Online ) { | 228 | if ( PowerStatusManager::readStatus().acStatus() != PowerStatus::Online ) { |
224 | int bright = ( brightness->value() ) * 255 / brightness->maxValue(); | 229 | int bright = ( brightness->value() ) * 255 / brightness->maxValue(); |
225 | set_fl(bright); | 230 | set_fl(bright); |
226 | } | 231 | } |
227 | } | 232 | } |
228 | 233 | ||
229 | void LightSettings::applyBrightnessAC() | 234 | void LightSettings::applyBrightnessAC() |
230 | { | 235 | { |
231 | // if ac is attached, set directly that sliders setting, else the "on battery" sliders setting | 236 | // if ac is attached, set directly that sliders setting, else the "on battery" sliders setting |
232 | if ( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ) { | 237 | if ( PowerStatusManager::readStatus().acStatus() == PowerStatus::Online ) { |
233 | int bright = ( brightness_ac_3->value() ) * 255 / brightness_ac_3->maxValue(); | 238 | int bright = ( brightness_ac_3->value() ) * 255 / brightness_ac_3->maxValue(); |