author | harlekin <harlekin> | 2004-06-04 16:08:25 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-06-04 16:08:25 (UTC) |
commit | e3982ce0959fe630709aeba25f4c6d93df150ff5 (patch) (unidiff) | |
tree | 8ed3dce7a96645d25a00f1819f6aa0e37bc0abc2 /core/settings | |
parent | 9f12abfa6b60232592aa15feea25bee28908f525 (diff) | |
download | opie-e3982ce0959fe630709aeba25f4c6d93df150ff5.zip opie-e3982ce0959fe630709aeba25f4c6d93df150ff5.tar.gz opie-e3982ce0959fe630709aeba25f4c6d93df150ff5.tar.bz2 |
default focus back on the brightness sliders, closes bug 1340
-rw-r--r-- | core/settings/light-and-power/light.cpp | 3 | ||||
-rw-r--r-- | core/settings/light-and-power/lightsettingsbase.ui | 17 |
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 | |||
@@ -115,24 +115,25 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | |||
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" ); |
@@ -171,27 +172,29 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | |||
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) ) ); |
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 | |||
@@ -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>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> |
@@ -1351,31 +1351,42 @@ | |||
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> |