-rw-r--r-- | core/settings/light-and-power/light.cpp | 7 | ||||
-rw-r--r-- | core/settings/light-and-power/lightsettingsbase.ui | 55 |
2 files changed, 58 insertions, 4 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index 0193a7b..04d2249 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp | |||
@@ -106,35 +106,36 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags fl ) | |||
106 | int maxbright = ODevice::inst ( )-> displayBrightnessResolution ( ); | 106 | int maxbright = ODevice::inst ( )-> displayBrightnessResolution ( ); |
107 | initbright = config.readNumEntry("Brightness",255); | 107 | initbright = config.readNumEntry("Brightness",255); |
108 | brightness->setMaxValue( maxbright ); | 108 | brightness->setMaxValue( maxbright ); |
109 | brightness->setTickInterval( QMAX(1,maxbright/16) ); | 109 | brightness->setTickInterval( QMAX(1,maxbright/16) ); |
110 | brightness->setLineStep( QMAX(1,maxbright/16) ); | 110 | brightness->setLineStep( QMAX(1,maxbright/16) ); |
111 | brightness->setPageStep( QMAX(1,maxbright/16) ); | 111 | brightness->setPageStep( QMAX(1,maxbright/16) ); |
112 | brightness->setValue( (maxbright*255 - initbright*maxbright)/255 ); | 112 | brightness->setValue( (maxbright*255 - initbright*maxbright)/255 ); |
113 | 113 | ||
114 | // ac check and slider | 114 | // ac check and slider |
115 | screensaver_dim_ac_3->setChecked( config.readNumEntry("DimAC",1) != 0 ); | 115 | screensaver_dim_ac_3->setChecked( config.readNumEntry("DimAC",1) != 0 ); |
116 | screensaver_lightoff_ac_3->setChecked( config.readNumEntry("LightOffAC",1) != 0 ); | 116 | screensaver_lightoff_ac_3->setChecked( config.readNumEntry("LightOffAC",1) != 0 ); |
117 | LcdOffOnly_2_3->setChecked( config.readNumEntry("LcdOffOnlyAC",0) != 0 ); | 117 | LcdOffOnly_2_3->setChecked( config.readNumEntry("LcdOffOnlyAC",0) != 0 ); |
118 | noApmAC->setChecked( config.readNumEntry("NoApmAC",0) != 0 ); | ||
118 | int maxbright_ac = ODevice::inst ( )-> displayBrightnessResolution ( ); | 119 | int maxbright_ac = ODevice::inst ( )-> displayBrightnessResolution ( ); |
119 | initbright_ac = config.readNumEntry("BrightnessAC",255); | 120 | initbright_ac = config.readNumEntry("BrightnessAC",255); |
120 | brightness_ac_3->setMaxValue( maxbright_ac ); | 121 | brightness_ac_3->setMaxValue( maxbright_ac ); |
121 | brightness_ac_3->setTickInterval( QMAX(1,maxbright_ac/16) ); | 122 | brightness_ac_3->setTickInterval( QMAX(1,maxbright_ac/16) ); |
122 | brightness_ac_3->setLineStep( QMAX(1,maxbright_ac/16) ); | 123 | brightness_ac_3->setLineStep( QMAX(1,maxbright_ac/16) ); |
123 | brightness_ac_3->setPageStep( QMAX(1,maxbright_ac/16) ); | 124 | brightness_ac_3->setPageStep( QMAX(1,maxbright_ac/16) ); |
124 | brightness_ac_3->setValue( (maxbright_ac*255 - initbright_ac*maxbright_ac)/255 ); | 125 | brightness_ac_3->setValue( (maxbright_ac*255 - initbright_ac*maxbright_ac)/255 ); |
125 | 126 | ||
126 | 127 | ||
127 | // ipaq sensor | 128 | // ipaq sensor |
128 | config.setGroup( "Ipaq_light_sensor" ); | 129 | config.setGroup( "Ipaqlightsensor" ); |
129 | auto_brightness->setChecked( config.readNumEntry("LightSensor",1) != 0 ); | 130 | auto_brightness->setChecked( config.readNumEntry("LightSensor",1) != 0 ); |
130 | auto_brightness_ac_3->setChecked( config.readNumEntry("LightSensorAC",1) != 0 ); | 131 | auto_brightness_ac_3->setChecked( config.readNumEntry("LightSensorAC",1) != 0 ); |
131 | LightStepSpin->setValue( config.readNumEntry("Steps", 10 ) ); | 132 | LightStepSpin->setValue( config.readNumEntry("Steps", 10 ) ); |
132 | LightMinValueSlider->setValue( config.readNumEntry("MinValue", 70 ) ); | 133 | LightMinValueSlider->setValue( config.readNumEntry("MinValue", 70 ) ); |
133 | connect( LightStepSpin, SIGNAL( valueChanged( int ) ), this, SLOT( slotSliderTicks( int ) ) ) ; | 134 | connect( LightStepSpin, SIGNAL( valueChanged( int ) ), this, SLOT( slotSliderTicks( int ) ) ) ; |
134 | LightShiftSpin->setValue( config.readNumEntry("Shift", 0 ) ); | 135 | LightShiftSpin->setValue( config.readNumEntry("Shift", 0 ) ); |
135 | 136 | ||
136 | // advanced settings | 137 | // advanced settings |
137 | Config conf("apm"); | 138 | Config conf("apm"); |
138 | conf.setGroup( "warnings" ); | 139 | conf.setGroup( "warnings" ); |
139 | warnintervalBox->setValue( conf.readNumEntry("checkinterval", 10000)/1000 ); | 140 | warnintervalBox->setValue( conf.readNumEntry("checkinterval", 10000)/1000 ); |
140 | lowSpinBox->setValue( conf.readNumEntry("powerverylow", 10 ) ); | 141 | lowSpinBox->setValue( conf.readNumEntry("powerverylow", 10 ) ); |
@@ -197,59 +198,59 @@ void LightSettings::accept() | |||
197 | config.writeEntry( "LightOff", (int)screensaver_lightoff->isChecked() ); | 198 | config.writeEntry( "LightOff", (int)screensaver_lightoff->isChecked() ); |
198 | config.writeEntry( "LcdOffOnly", (int)LcdOffOnly->isChecked() ); | 199 | config.writeEntry( "LcdOffOnly", (int)LcdOffOnly->isChecked() ); |
199 | config.writeEntry( "Interval_Dim", interval_dim->value() ); | 200 | config.writeEntry( "Interval_Dim", interval_dim->value() ); |
200 | config.writeEntry( "Interval_LightOff", interval_lightoff->value() ); | 201 | config.writeEntry( "Interval_LightOff", interval_lightoff->value() ); |
201 | config.writeEntry( "Interval", interval_suspend->value() ); | 202 | config.writeEntry( "Interval", interval_suspend->value() ); |
202 | config.writeEntry( "Brightness", | 203 | config.writeEntry( "Brightness", |
203 | ( brightness->value() ) * 255 / brightness->maxValue() ); | 204 | ( brightness->value() ) * 255 / brightness->maxValue() ); |
204 | 205 | ||
205 | // ac | 206 | // ac |
206 | config.writeEntry( "DimAC", (int)screensaver_dim_ac_3->isChecked() ); | 207 | config.writeEntry( "DimAC", (int)screensaver_dim_ac_3->isChecked() ); |
207 | config.writeEntry( "LightOffAC", (int)screensaver_lightoff_ac_3->isChecked() ); | 208 | config.writeEntry( "LightOffAC", (int)screensaver_lightoff_ac_3->isChecked() ); |
208 | config.writeEntry( "LcdOffOnlyAC", (int)LcdOffOnly_2_3->isChecked() ); | 209 | config.writeEntry( "LcdOffOnlyAC", (int)LcdOffOnly_2_3->isChecked() ); |
210 | config.writeEntry( "NoAPmAC", (int)noApmAC->isChecked() ); | ||
209 | config.writeEntry( "Interval_DimAC", interval_dim_ac_3->value() ); | 211 | config.writeEntry( "Interval_DimAC", interval_dim_ac_3->value() ); |
210 | config.writeEntry( "Interval_LightOffAC", interval_lightoff_ac_3->value() ); | 212 | config.writeEntry( "Interval_LightOffAC", interval_lightoff_ac_3->value() ); |
211 | config.writeEntry( "IntervalAC", interval_suspend_ac_3->value() ); | 213 | config.writeEntry( "IntervalAC", interval_suspend_ac_3->value() ); |
212 | config.writeEntry( "BrightnessAC", | 214 | config.writeEntry( "BrightnessAC", |
213 | ( brightness_ac_3->value()) * 255 / brightness_ac_3->maxValue() ); | 215 | ( brightness_ac_3->value()) * 255 / brightness_ac_3->maxValue() ); |
214 | 216 | ||
215 | 217 | ||
216 | // only make ipaq light sensor entries in config file if on an ipaq | 218 | // only make ipaq light sensor entries in config file if on an ipaq |
217 | if ( ODevice::inst()->model() == Model_iPAQ_H31xx || | 219 | if ( ODevice::inst()->model() == Model_iPAQ_H31xx || |
218 | ODevice::inst()->model() == Model_iPAQ_H36xx || | 220 | ODevice::inst()->model() == Model_iPAQ_H36xx || |
219 | ODevice::inst()->model() == Model_iPAQ_H37xx || | 221 | ODevice::inst()->model() == Model_iPAQ_H37xx || |
220 | ODevice::inst()->model() == Model_iPAQ_H38xx ) { | 222 | ODevice::inst()->model() == Model_iPAQ_H38xx ) { |
221 | 223 | ||
222 | // ipaq sensor | 224 | // ipaq sensor |
223 | config.setGroup( "Ipaq_light_sensor" ); | 225 | config.setGroup( "Ipaqlightsensor" ); |
224 | 226 | ||
225 | config.writeEntry( "LightSensor", (int)auto_brightness->isChecked() ); | 227 | config.writeEntry( "LightSensor", (int)auto_brightness->isChecked() ); |
226 | config.writeEntry( "LightSensorAC", (int)auto_brightness_ac_3->isChecked() ); | 228 | config.writeEntry( "LightSensorAC", (int)auto_brightness_ac_3->isChecked() ); |
227 | config.writeEntry( "Steps", LightStepSpin->value() ); | 229 | config.writeEntry( "Steps", LightStepSpin->value() ); |
228 | config.writeEntry( "MinValue", LightMinValueSlider->value() ); | 230 | config.writeEntry( "MinValue", LightMinValueSlider->value() ); |
229 | config.writeEntry( "Shift", LightShiftSpin->value() ); | 231 | config.writeEntry( "Shift", LightShiftSpin->value() ); |
230 | } | 232 | } |
231 | 233 | ||
232 | config.write(); | 234 | config.write(); |
233 | 235 | ||
234 | // advanced | 236 | // advanced |
235 | Config conf("apm"); | 237 | Config conf("apm"); |
236 | conf.setGroup( "Warnings" ); | 238 | conf.setGroup( "Warnings" ); |
237 | conf.writeEntry( "check_interval", warnintervalBox->value()*1000 ); | 239 | conf.writeEntry( "check_interval", warnintervalBox->value()*1000 ); |
238 | conf.writeEntry( "power_verylow", lowSpinBox->value() ); | 240 | conf.writeEntry( "power_verylow", lowSpinBox->value() ); |
239 | conf.writeEntry( "power_critical", criticalSpinBox->value() ); | 241 | conf.writeEntry( "power_critical", criticalSpinBox->value() ); |
240 | QCopEnvelope e_warn("QPE/System", "reloadPowerWarnSettings()"); | 242 | QCopEnvelope e_warn("QPE/System", "reloadPowerWarnSettings()"); |
241 | conf.write(); | 243 | conf.write(); |
242 | 244 | ||
243 | |||
244 | QDialog::accept(); | 245 | QDialog::accept(); |
245 | } | 246 | } |
246 | 247 | ||
247 | void LightSettings::applyBrightness() | 248 | void LightSettings::applyBrightness() |
248 | { | 249 | { |
249 | if ( PowerStatusManager::readStatus().acStatus() != PowerStatus::Online ) { | 250 | if ( PowerStatusManager::readStatus().acStatus() != PowerStatus::Online ) { |
250 | int bright = ( brightness->value() ) * 255 / brightness->maxValue(); | 251 | int bright = ( brightness->value() ) * 255 / brightness->maxValue(); |
251 | set_fl(bright); | 252 | set_fl(bright); |
252 | } | 253 | } |
253 | } | 254 | } |
254 | 255 | ||
255 | void LightSettings::applyBrightnessAC() | 256 | void LightSettings::applyBrightnessAC() |
diff --git a/core/settings/light-and-power/lightsettingsbase.ui b/core/settings/light-and-power/lightsettingsbase.ui index be096ac..2d0457f 100644 --- a/core/settings/light-and-power/lightsettingsbase.ui +++ b/core/settings/light-and-power/lightsettingsbase.ui | |||
@@ -2,25 +2,25 @@ | |||
2 | <class>LightSettingsBase</class> | 2 | <class>LightSettingsBase</class> |
3 | <widget> | 3 | <widget> |
4 | <class>QDialog</class> | 4 | <class>QDialog</class> |
5 | <property stdset="1"> | 5 | <property stdset="1"> |
6 | <name>name</name> | 6 | <name>name</name> |
7 | <cstring>LightSettingsBase</cstring> | 7 | <cstring>LightSettingsBase</cstring> |
8 | </property> | 8 | </property> |
9 | <property stdset="1"> | 9 | <property stdset="1"> |
10 | <name>geometry</name> | 10 | <name>geometry</name> |
11 | <rect> | 11 | <rect> |
12 | <x>0</x> | 12 | <x>0</x> |
13 | <y>0</y> | 13 | <y>0</y> |
14 | <width>415</width> | 14 | <width>411</width> |
15 | <height>532</height> | 15 | <height>532</height> |
16 | </rect> | 16 | </rect> |
17 | </property> | 17 | </property> |
18 | <property stdset="1"> | 18 | <property stdset="1"> |
19 | <name>caption</name> | 19 | <name>caption</name> |
20 | <string>Light and Power Settings</string> | 20 | <string>Light and Power Settings</string> |
21 | </property> | 21 | </property> |
22 | <property stdset="1"> | 22 | <property stdset="1"> |
23 | <name>sizeGripEnabled</name> | 23 | <name>sizeGripEnabled</name> |
24 | <bool>false</bool> | 24 | <bool>false</bool> |
25 | </property> | 25 | </property> |
26 | <property> | 26 | <property> |
@@ -684,24 +684,35 @@ | |||
684 | </widget> | 684 | </widget> |
685 | <widget> | 685 | <widget> |
686 | <class>QCheckBox</class> | 686 | <class>QCheckBox</class> |
687 | <property stdset="1"> | 687 | <property stdset="1"> |
688 | <name>name</name> | 688 | <name>name</name> |
689 | <cstring>LcdOffOnly_2_3</cstring> | 689 | <cstring>LcdOffOnly_2_3</cstring> |
690 | </property> | 690 | </property> |
691 | <property stdset="1"> | 691 | <property stdset="1"> |
692 | <name>text</name> | 692 | <name>text</name> |
693 | <string>Deactivate LCD only (does not suspend)</string> | 693 | <string>Deactivate LCD only (does not suspend)</string> |
694 | </property> | 694 | </property> |
695 | </widget> | 695 | </widget> |
696 | <widget> | ||
697 | <class>QCheckBox</class> | ||
698 | <property stdset="1"> | ||
699 | <name>name</name> | ||
700 | <cstring>noApmAC</cstring> | ||
701 | </property> | ||
702 | <property stdset="1"> | ||
703 | <name>text</name> | ||
704 | <string>No power saving features</string> | ||
705 | </property> | ||
706 | </widget> | ||
696 | </vbox> | 707 | </vbox> |
697 | </widget> | 708 | </widget> |
698 | <widget> | 709 | <widget> |
699 | <class>QGroupBox</class> | 710 | <class>QGroupBox</class> |
700 | <property stdset="1"> | 711 | <property stdset="1"> |
701 | <name>name</name> | 712 | <name>name</name> |
702 | <cstring>GroupBox8</cstring> | 713 | <cstring>GroupBox8</cstring> |
703 | </property> | 714 | </property> |
704 | <property stdset="1"> | 715 | <property stdset="1"> |
705 | <name>title</name> | 716 | <name>title</name> |
706 | <string>Backlight</string> | 717 | <string>Backlight</string> |
707 | </property> | 718 | </property> |
@@ -1333,23 +1344,65 @@ warning at</string> | |||
1333 | <connection> | 1344 | <connection> |
1334 | <sender>screensaver_dim</sender> | 1345 | <sender>screensaver_dim</sender> |
1335 | <signal>toggled(bool)</signal> | 1346 | <signal>toggled(bool)</signal> |
1336 | <receiver>interval_dim</receiver> | 1347 | <receiver>interval_dim</receiver> |
1337 | <slot>setEnabled(bool)</slot> | 1348 | <slot>setEnabled(bool)</slot> |
1338 | </connection> | 1349 | </connection> |
1339 | <connection> | 1350 | <connection> |
1340 | <sender>screensaver_lightoff</sender> | 1351 | <sender>screensaver_lightoff</sender> |
1341 | <signal>toggled(bool)</signal> | 1352 | <signal>toggled(bool)</signal> |
1342 | <receiver>interval_lightoff</receiver> | 1353 | <receiver>interval_lightoff</receiver> |
1343 | <slot>setEnabled(bool)</slot> | 1354 | <slot>setEnabled(bool)</slot> |
1344 | </connection> | 1355 | </connection> |
1356 | <connection> | ||
1357 | <sender>noApmAC</sender> | ||
1358 | <signal>toggled(bool)</signal> | ||
1359 | <receiver>screensaver_dim_ac_3</receiver> | ||
1360 | <slot>setDisabled(bool)</slot> | ||
1361 | </connection> | ||
1362 | <connection> | ||
1363 | <sender>noApmAC</sender> | ||
1364 | <signal>toggled(bool)</signal> | ||
1365 | <receiver>interval_dim_ac_3</receiver> | ||
1366 | <slot>setDisabled(bool)</slot> | ||
1367 | </connection> | ||
1368 | <connection> | ||
1369 | <sender>noApmAC</sender> | ||
1370 | <signal>toggled(bool)</signal> | ||
1371 | <receiver>screensaver_lightoff_ac_3</receiver> | ||
1372 | <slot>setDisabled(bool)</slot> | ||
1373 | </connection> | ||
1374 | <connection> | ||
1375 | <sender>noApmAC</sender> | ||
1376 | <signal>toggled(bool)</signal> | ||
1377 | <receiver>interval_lightoff_ac_3</receiver> | ||
1378 | <slot>setDisabled(bool)</slot> | ||
1379 | </connection> | ||
1380 | <connection> | ||
1381 | <sender>noApmAC</sender> | ||
1382 | <signal>toggled(bool)</signal> | ||
1383 | <receiver>interval_suspend_ac_3</receiver> | ||
1384 | <slot>setDisabled(bool)</slot> | ||
1385 | </connection> | ||
1386 | <connection> | ||
1387 | <sender>noApmAC</sender> | ||
1388 | <signal>toggled(bool)</signal> | ||
1389 | <receiver>LcdOffOnly_2_3</receiver> | ||
1390 | <slot>setDisabled(bool)</slot> | ||
1391 | </connection> | ||
1392 | <connection> | ||
1393 | <sender>noApmAC</sender> | ||
1394 | <signal>toggled(bool)</signal> | ||
1395 | <receiver>TextLabel1_2_2_3</receiver> | ||
1396 | <slot>setDisabled(bool)</slot> | ||
1397 | </connection> | ||
1345 | </connections> | 1398 | </connections> |
1346 | <tabstops> | 1399 | <tabstops> |
1347 | <tabstop>auto_brightness</tabstop> | 1400 | <tabstop>auto_brightness</tabstop> |
1348 | <tabstop>screensaver_dim</tabstop> | 1401 | <tabstop>screensaver_dim</tabstop> |
1349 | <tabstop>interval_dim</tabstop> | 1402 | <tabstop>interval_dim</tabstop> |
1350 | <tabstop>screensaver_lightoff</tabstop> | 1403 | <tabstop>screensaver_lightoff</tabstop> |
1351 | <tabstop>interval_lightoff</tabstop> | 1404 | <tabstop>interval_lightoff</tabstop> |
1352 | <tabstop>interval_suspend</tabstop> | 1405 | <tabstop>interval_suspend</tabstop> |
1353 | <tabstop>brightness</tabstop> | 1406 | <tabstop>brightness</tabstop> |
1354 | </tabstops> | 1407 | </tabstops> |
1355 | </UI> | 1408 | </UI> |