summaryrefslogtreecommitdiff
path: root/core/settings/light-and-power/light.cpp
authorharlekin <harlekin>2004-06-04 16:08:25 (UTC)
committer harlekin <harlekin>2004-06-04 16:08:25 (UTC)
commite3982ce0959fe630709aeba25f4c6d93df150ff5 (patch) (unidiff)
tree8ed3dce7a96645d25a00f1819f6aa0e37bc0abc2 /core/settings/light-and-power/light.cpp
parent9f12abfa6b60232592aa15feea25bee28908f525 (diff)
downloadopie-e3982ce0959fe630709aeba25f4c6d93df150ff5.zip
opie-e3982ce0959fe630709aeba25f4c6d93df150ff5.tar.gz
opie-e3982ce0959fe630709aeba25f4c6d93df150ff5.tar.bz2
default focus back on the brightness sliders, closes bug 1340
Diffstat (limited to 'core/settings/light-and-power/light.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/light-and-power/light.cpp3
1 files changed, 3 insertions, 0 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
@@ -119,16 +119,17 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
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
@@ -175,19 +176,21 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags )
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 }