summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/light-and-power/light.cpp3
-rw-r--r--core/settings/light-and-power/lightsettingsbase.ui17
2 files changed, 17 insertions, 3 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp
index 424a64c..1c61787 100644
--- a/core/settings/light-and-power/light.cpp
+++ b/core/settings/light-and-power/light.cpp
@@ -103,48 +103,49 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
103 Config config ( "apm" ); 103 Config config ( "apm" );
104 config. setGroup ( "Battery" ); 104 config. setGroup ( "Battery" );
105 105
106 // battery spinboxes 106 // battery spinboxes
107 interval_dim-> setValue ( config. readNumEntry ( "Dim", 20 )); 107 interval_dim-> setValue ( config. readNumEntry ( "Dim", 20 ));
108 interval_lightoff-> setValue ( config. readNumEntry ( "LightOff", 30 )); 108 interval_lightoff-> setValue ( config. readNumEntry ( "LightOff", 30 ));
109 interval_suspend-> setValue ( config. readNumEntry ( "Suspend", 60 )); 109 interval_suspend-> setValue ( config. readNumEntry ( "Suspend", 60 ));
110 110
111 // battery check and slider 111 // battery check and slider
112 LcdOffOnly->setChecked ( config. readBoolEntry ( "LcdOffOnly", false )); 112 LcdOffOnly->setChecked ( config. readBoolEntry ( "LcdOffOnly", false ));
113 113
114 // CPU frequency 114 // CPU frequency
115 frequency->setCurrentItem( config.readNumEntry("Freq", 0) ); 115 frequency->setCurrentItem( config.readNumEntry("Freq", 0) );
116 116
117 // hinge action 117 // hinge action
118 closeHingeAction->setCurrentItem( config.readNumEntry("CloseHingeAction", 0) ); 118 closeHingeAction->setCurrentItem( config.readNumEntry("CloseHingeAction", 0) );
119 119
120 int bright = config. readNumEntry ( "Brightness", 127 ); 120 int bright = config. readNumEntry ( "Brightness", 127 );
121 int contr = m_oldcontrast = config. readNumEntry ( "Contrast", 127 ); 121 int contr = m_oldcontrast = config. readNumEntry ( "Contrast", 127 );
122 brightness-> setTickInterval ( QMAX( 16, 256 / m_bres )); 122 brightness-> setTickInterval ( QMAX( 16, 256 / m_bres ));
123 brightness-> setLineStep ( QMAX( 1, 256 / m_bres )); 123 brightness-> setLineStep ( QMAX( 1, 256 / m_bres ));
124 brightness-> setPageStep ( QMAX( 1, 256 / m_bres )); 124 brightness-> setPageStep ( QMAX( 1, 256 / m_bres ));
125 brightness-> setValue ( bright ); 125 brightness-> setValue ( bright );
126 126
127//
127 if (m_cres) { 128 if (m_cres) {
128 contrast-> setTickInterval ( QMAX( 16, 256 / m_cres )); 129 contrast-> setTickInterval ( QMAX( 16, 256 / m_cres ));
129 contrast-> setLineStep ( QMAX( 1, 256 / m_cres )); 130 contrast-> setLineStep ( QMAX( 1, 256 / m_cres ));
130 contrast-> setPageStep ( QMAX( 1, 256 / m_cres )); 131 contrast-> setPageStep ( QMAX( 1, 256 / m_cres ));
131 contrast-> setValue ( contr ); 132 contrast-> setValue ( contr );
132 } 133 }
133 134
134 // light sensor 135 // light sensor
135 auto_brightness-> setChecked ( config. readBoolEntry ( "LightSensor", false )); 136 auto_brightness-> setChecked ( config. readBoolEntry ( "LightSensor", false ));
136 m_sensordata = config. readListEntry ( "LightSensorData", ';' ); 137 m_sensordata = config. readListEntry ( "LightSensorData", ';' );
137 138
138 config. setGroup ( "AC" ); 139 config. setGroup ( "AC" );
139 140
140 // ac spinboxes 141 // ac spinboxes
141 interval_dim_ac-> setValue ( config. readNumEntry ( "Dim", 60 )); 142 interval_dim_ac-> setValue ( config. readNumEntry ( "Dim", 60 ));
142 interval_lightoff_ac-> setValue ( config. readNumEntry ( "LightOff", 120 )); 143 interval_lightoff_ac-> setValue ( config. readNumEntry ( "LightOff", 120 ));
143 interval_suspend_ac-> setValue ( config. readNumEntry ( "Suspend", 0 )); 144 interval_suspend_ac-> setValue ( config. readNumEntry ( "Suspend", 0 ));
144 145
145 // ac check and slider 146 // ac check and slider
146 LcdOffOnly_ac-> setChecked ( config. readBoolEntry ( "LcdOffOnly", false )); 147 LcdOffOnly_ac-> setChecked ( config. readBoolEntry ( "LcdOffOnly", false ));
147 148
148 // CPU frequency 149 // CPU frequency
149 frequency_ac->setCurrentItem( config.readNumEntry("Freq", 0) ); 150 frequency_ac->setCurrentItem( config.readNumEntry("Freq", 0) );
150 151
@@ -159,51 +160,53 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
159 160
160 if (m_cres) { 161 if (m_cres) {
161 contr = config. readNumEntry ( "Contrast", 127); 162 contr = config. readNumEntry ( "Contrast", 127);
162 contrast_ac-> setTickInterval ( QMAX( 16, 256 / m_cres )); 163 contrast_ac-> setTickInterval ( QMAX( 16, 256 / m_cres ));
163 contrast_ac-> setLineStep ( QMAX( 1, 256 / m_cres )); 164 contrast_ac-> setLineStep ( QMAX( 1, 256 / m_cres ));
164 contrast_ac-> setPageStep ( QMAX( 1, 256 / m_cres )); 165 contrast_ac-> setPageStep ( QMAX( 1, 256 / m_cres ));
165 contrast_ac-> setValue ( contr ); 166 contrast_ac-> setValue ( contr );
166 } 167 }
167 168
168 // light sensor 169 // light sensor
169 auto_brightness_ac-> setChecked ( config. readBoolEntry ( "LightSensor", false )); 170 auto_brightness_ac-> setChecked ( config. readBoolEntry ( "LightSensor", false ));
170 m_sensordata_ac = config. readListEntry ( "LightSensorData", ';' ); 171 m_sensordata_ac = config. readListEntry ( "LightSensorData", ';' );
171 172
172 // warnings 173 // warnings
173 config. setGroup ( "Warnings" ); 174 config. setGroup ( "Warnings" );
174 warnintervalBox-> setValue ( config. readNumEntry ( "checkinterval", 10000 ) / 1000 ); 175 warnintervalBox-> setValue ( config. readNumEntry ( "checkinterval", 10000 ) / 1000 );
175 lowSpinBox-> setValue ( config. readNumEntry ( "powerverylow", 10 ) ); 176 lowSpinBox-> setValue ( config. readNumEntry ( "powerverylow", 10 ) );
176 criticalSpinBox-> setValue ( config. readNumEntry ( "powercritical", 5 ) ); 177 criticalSpinBox-> setValue ( config. readNumEntry ( "powercritical", 5 ) );
177 178
178 m_resettimer = new QTimer ( this ); 179 m_resettimer = new QTimer ( this );
179 connect ( m_resettimer, SIGNAL( timeout()), this, SLOT( resetBacklight())); 180 connect ( m_resettimer, SIGNAL( timeout()), this, SLOT( resetBacklight()));
180 181
181 if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online ) { 182 if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online ) {
182 tabs-> setCurrentPage ( 0 ); 183 tabs-> setCurrentPage ( 0 );
184 brightness->setFocus();
183 } 185 }
184 else { 186 else {
185 tabs-> setCurrentPage ( 1 ); 187 tabs-> setCurrentPage ( 1 );
188 brightness_ac->setFocus();
186 } 189 }
187 190
188 connect ( brightness, SIGNAL( valueChanged(int)), this, SLOT( setBacklight(int))); 191 connect ( brightness, SIGNAL( valueChanged(int)), this, SLOT( setBacklight(int)));
189 connect ( brightness_ac, SIGNAL( valueChanged(int)), this, SLOT( setBacklight(int))); 192 connect ( brightness_ac, SIGNAL( valueChanged(int)), this, SLOT( setBacklight(int)));
190 if (m_cres) { 193 if (m_cres) {
191 connect ( contrast, SIGNAL( valueChanged(int)), this, SLOT( setContrast(int))); 194 connect ( contrast, SIGNAL( valueChanged(int)), this, SLOT( setContrast(int)));
192 connect ( contrast_ac, SIGNAL( valueChanged(int)), this, SLOT( setContrast(int))); 195 connect ( contrast_ac, SIGNAL( valueChanged(int)), this, SLOT( setContrast(int)));
193 } 196 }
194 connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); 197 connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) );
195 connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); 198 connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) );
196 connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); 199 connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) );
197 connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); 200 connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) );
198} 201}
199 202
200LightSettings::~LightSettings ( ) 203LightSettings::~LightSettings ( )
201{ 204{
202} 205}
203 206
204void LightSettings::calibrateSensor ( ) 207void LightSettings::calibrateSensor ( )
205{ 208{
206 Sensor *s = new Sensor ( m_sensordata, this ); 209 Sensor *s = new Sensor ( m_sensordata, this );
207 connect ( s, SIGNAL( viewBacklight(int)), this, SLOT( setBacklight(int))); 210 connect ( s, SIGNAL( viewBacklight(int)), this, SLOT( setBacklight(int)));
208 QPEApplication::execDialog( s ); 211 QPEApplication::execDialog( s );
209 delete s; 212 delete s;
diff --git a/core/settings/light-and-power/lightsettingsbase.ui b/core/settings/light-and-power/lightsettingsbase.ui
index 2af0331..1f1ff17 100644
--- a/core/settings/light-and-power/lightsettingsbase.ui
+++ b/core/settings/light-and-power/lightsettingsbase.ui
@@ -1,38 +1,38 @@
1<!DOCTYPE UI><UI> 1<!DOCTYPE UI><UI>
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>331</width> 14 <width>327</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>sizePolicy</name> 19 <name>sizePolicy</name>
20 <sizepolicy> 20 <sizepolicy>
21 <hsizetype>7</hsizetype> 21 <hsizetype>7</hsizetype>
22 <vsizetype>5</vsizetype> 22 <vsizetype>5</vsizetype>
23 </sizepolicy> 23 </sizepolicy>
24 </property> 24 </property>
25 <property stdset="1"> 25 <property stdset="1">
26 <name>caption</name> 26 <name>caption</name>
27 <string>Light and Power Settings</string> 27 <string>Light and Power Settings</string>
28 </property> 28 </property>
29 <property stdset="1"> 29 <property stdset="1">
30 <name>sizeGripEnabled</name> 30 <name>sizeGripEnabled</name>
31 <bool>false</bool> 31 <bool>false</bool>
32 </property> 32 </property>
33 <property> 33 <property>
34 <name>layoutMargin</name> 34 <name>layoutMargin</name>
35 </property> 35 </property>
36 <property> 36 <property>
37 <name>layoutSpacing</name> 37 <name>layoutSpacing</name>
38 </property> 38 </property>
@@ -1339,43 +1339,54 @@
1339 </image> 1339 </image>
1340 <image> 1340 <image>
1341 <name>image1</name> 1341 <name>image1</name>
1342 <data format="XPM.GZ" length="1885">789c75d4576fdb301000e077ff0ac17c0b8a8bad49a2e843f61ece4e8a3e481cde198eb3d1ff5eeaeecca675ecb3047cd68922ef282f2f4557c707d1d272e3715a4efb3ad2bd72122d99a7f1f8ede7af1f1f8d663b8ffcb75051dcfcd66876a6918e0eef6e6d0d31f010aaf2a1d1e3da6551077a88c60fdaa14d694b87eea36d692b1c5cf4d88edd45bbaa5525e8516d2f1f685bdb289de7065da28dae8aac36e0f8d69a38add067b55d6cb224470bb6cc52f4153a316582f9c2906d2a255ed7e8d4b882d65791fd7585d79fd199512dac071cb0758cf383db99539a3f8d97d95ca1e1059ddb386ba3713daeb04a61bda0629725adef1a2d6d92517d045b4a346ca295cd12ca3f65e7ec36bbc8b03f60d85a513d24dab74752fd36d0952ddad81f18b0353faf605b89fb037a649756b4fe0cad5dace8f9fb6863754c4ec92e96e4989d48ead7989df2facfd1d66539d5ef929de734bf55b473719bee5f0bc6fec17a30f577979d70bff6d8694ceb599939a1fc437696d2f8c7c1347e2798f28f8269bf3c05d37ed909a67e9fb073beff62e69cfa336517bcdf6f8269be8f6c59d07a5a334baad756308dbf3db3a2fa256c45ef37bcb34b45e3bd06d37cdf662e69fc8799e97d86fb609aff2498ea77174cf5cbd9155d17c0d69aeaa78269ff8e8269bf0e83a91e8e6d2c3dafcbb66c1b2ce9cfee6f8080122ad09f7ffb37070c58703ebad083fe57393080218cfc41e7f17c0edcc21ddcc3034cfcf911a6f004cf73392ff00a6ff0ee8f1558853558878db99c4dd8826d7fecc02eec61eccfe51cc0211cc13174e004a303a7733967700e179fe212aebe58d735dc408be306da0bea1343c2912eac6106b95ffbc49f8b85391294afdf4880108b7244292aa17d186117e638d1153dd1f7315894e3b38662e463fcf9b7ff73be8ae6efef8d3f188ce126</data> 1342 <data format="XPM.GZ" length="1885">789c75d4576fdb301000e077ff0ac17c0b8a8bad49a2e843f61ece4e8a3e481cde198eb3d1ff5eeaeecca675ecb3047cd68922ef282f2f4557c707d1d272e3715a4efb3ad2bd72122d99a7f1f8ede7af1f1f8d663b8ffcb75051dcfcd66876a6918e0eef6e6d0d31f010aaf2a1d1e3da6551077a88c60fdaa14d694b87eea36d692b1c5cf4d88edd45bbaa5525e8516d2f1f685bdb289de7065da28dae8aac36e0f8d69a38add067b55d6cb224470bb6cc52f4153a316582f9c2906d2a255ed7e8d4b882d65791fd7585d79fd199512dac071cb0758cf383db99539a3f8d97d95ca1e1059ddb386ba3713daeb04a61bda0629725adef1a2d6d92517d045b4a346ca295cd12ca3f65e7ec36bbc8b03f60d85a513d24dab74752fd36d0952ddad81f18b0353faf605b89fb037a649756b4fe0cad5dace8f9fb6863754c4ec92e96e4989d48ead7989df2facfd1d66539d5ef929de734bf55b473719bee5f0bc6fec17a30f577979d70bff6d8694ceb599939a1fc437696d2f8c7c1347e2798f28f8269bf3c05d37ed909a67e9fb073beff62e69cfa336517bcdf6f8269be8f6c59d07a5a334baad756308dbf3db3a2fa256c45ef37bcb34b45e3bd06d37cdf662e69fc8799e97d86fb609aff2498ea77174cf5cbd9155d17c0d69aeaa78269ff8e8269bf0e83a91e8e6d2c3dafcbb66c1b2ce9cfee6f8080122ad09f7ffb37070c58703ebad083fe57393080218cfc41e7f17c0edcc21ddcc3034cfcf911a6f004cf73392ff00a6ff0ee8f1558853558878db99c4dd8826d7fecc02eec61eccfe51cc0211cc13174e004a303a7733967700e179fe212aebe58d735dc408be306da0bea1343c2912eac6106b95ffbc49f8b85391294afdf4880108b7244292aa17d186117e638d1153dd1f7315894e3b38662e463fcf9b7ff73be8ae6efef8d3f188ce126</data>
1343 </image> 1343 </image>
1344</images> 1344</images>
1345<connections> 1345<connections>
1346 <connection> 1346 <connection>
1347 <sender>CalibrateLightSensor</sender> 1347 <sender>CalibrateLightSensor</sender>
1348 <signal>clicked()</signal> 1348 <signal>clicked()</signal>
1349 <receiver>LightSettingsBase</receiver> 1349 <receiver>LightSettingsBase</receiver>
1350 <slot>calibrateSensor()</slot> 1350 <slot>calibrateSensor()</slot>
1351 </connection> 1351 </connection>
1352 <connection> 1352 <connection>
1353 <sender>CalibrateLightSensor_ac</sender> 1353 <sender>CalibrateLightSensor_ac</sender>
1354 <signal>clicked()</signal> 1354 <signal>clicked()</signal>
1355 <receiver>LightSettingsBase</receiver> 1355 <receiver>LightSettingsBase</receiver>
1356 <slot>calibrateSensorAC()</slot> 1356 <slot>calibrateSensorAC()</slot>
1357 </connection> 1357 </connection>
1358 <slot access="public">calibrateSensor()</slot> 1358 <slot access="public">calibrateSensor()</slot>
1359 <slot access="public">calibrateSensorAC()</slot> 1359 <slot access="public">calibrateSensorAC()</slot>
1360</connections> 1360</connections>
1361<tabstops> 1361<tabstops>
1362 <tabstop>brightness</tabstop> 1362 <tabstop>brightness</tabstop>
1363 <tabstop>brightness_ac</tabstop>
1364 <tabstop>tabs</tabstop>
1365 <tabstop>LcdOffOnly</tabstop>
1366 <tabstop>closeHingeAction</tabstop>
1363 <tabstop>interval_dim</tabstop> 1367 <tabstop>interval_dim</tabstop>
1364 <tabstop>interval_lightoff</tabstop> 1368 <tabstop>interval_lightoff</tabstop>
1365 <tabstop>interval_suspend</tabstop> 1369 <tabstop>interval_suspend</tabstop>
1366 <tabstop>LcdOffOnly</tabstop>
1367 <tabstop>auto_brightness</tabstop> 1370 <tabstop>auto_brightness</tabstop>
1368 <tabstop>CalibrateLightSensor</tabstop> 1371 <tabstop>CalibrateLightSensor</tabstop>
1369 <tabstop>brightness</tabstop> 1372 <tabstop>brightness</tabstop>
1370 <tabstop>tabs</tabstop>
1371 <tabstop>interval_lightoff</tabstop> 1373 <tabstop>interval_lightoff</tabstop>
1372 <tabstop>interval_suspend</tabstop> 1374 <tabstop>interval_suspend</tabstop>
1373 <tabstop>interval_dim</tabstop> 1375 <tabstop>interval_dim</tabstop>
1374 <tabstop>LcdOffOnly_ac</tabstop> 1376 <tabstop>LcdOffOnly_ac</tabstop>
1375 <tabstop>auto_brightness</tabstop> 1377 <tabstop>auto_brightness</tabstop>
1376 <tabstop>CalibrateLightSensor_ac</tabstop> 1378 <tabstop>CalibrateLightSensor_ac</tabstop>
1377 <tabstop>lowSpinBox</tabstop> 1379 <tabstop>lowSpinBox</tabstop>
1378 <tabstop>warnintervalBox</tabstop> 1380 <tabstop>warnintervalBox</tabstop>
1379 <tabstop>criticalSpinBox</tabstop> 1381 <tabstop>criticalSpinBox</tabstop>
1382 <tabstop>frequency</tabstop>
1383 <tabstop>contrast</tabstop>
1384 <tabstop>interval_lightoff_ac</tabstop>
1385 <tabstop>interval_suspend_ac</tabstop>
1386 <tabstop>interval_dim_ac</tabstop>
1387 <tabstop>frequency_ac</tabstop>
1388 <tabstop>closeHingeAction_ac</tabstop>
1389 <tabstop>contrast_ac</tabstop>
1390 <tabstop>auto_brightness_ac</tabstop>
1380</tabstops> 1391</tabstops>
1381</UI> 1392</UI>