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.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/core/settings/light-and-power/light.cpp b/core/settings/light-and-power/light.cpp index 4baff8e..ce45836 100644 --- a/core/settings/light-and-power/light.cpp +++ b/core/settings/light-and-power/light.cpp | |||
@@ -151,85 +151,85 @@ LightSettings::LightSettings( QWidget* parent, const char* name, WFlags ) | |||
151 | brightness_ac-> setTickInterval ( QMAX( 16, 256 / m_bres )); | 151 | brightness_ac-> setTickInterval ( QMAX( 16, 256 / m_bres )); |
152 | brightness_ac-> setLineStep ( QMAX( 1, 256 / m_bres )); | 152 | brightness_ac-> setLineStep ( QMAX( 1, 256 / m_bres )); |
153 | brightness_ac-> setPageStep ( QMAX( 1, 256 / m_bres )); | 153 | brightness_ac-> setPageStep ( QMAX( 1, 256 / m_bres )); |
154 | brightness_ac-> setValue ( bright ); | 154 | brightness_ac-> setValue ( bright ); |
155 | 155 | ||
156 | if (m_cres) { | 156 | if (m_cres) { |
157 | contr = config. readNumEntry ( "Contrast", 127); | 157 | contr = config. readNumEntry ( "Contrast", 127); |
158 | contrast_ac-> setTickInterval ( QMAX( 16, 256 / m_cres )); | 158 | contrast_ac-> setTickInterval ( QMAX( 16, 256 / m_cres )); |
159 | contrast_ac-> setLineStep ( QMAX( 1, 256 / m_cres )); | 159 | contrast_ac-> setLineStep ( QMAX( 1, 256 / m_cres )); |
160 | contrast_ac-> setPageStep ( QMAX( 1, 256 / m_cres )); | 160 | contrast_ac-> setPageStep ( QMAX( 1, 256 / m_cres )); |
161 | contrast_ac-> setValue ( contr ); | 161 | contrast_ac-> setValue ( contr ); |
162 | } | 162 | } |
163 | 163 | ||
164 | // light sensor | 164 | // light sensor |
165 | auto_brightness_ac-> setChecked ( config. readBoolEntry ( "LightSensor", false )); | 165 | auto_brightness_ac-> setChecked ( config. readBoolEntry ( "LightSensor", false )); |
166 | m_sensordata_ac = config. readListEntry ( "LightSensorData", ';' ); | 166 | m_sensordata_ac = config. readListEntry ( "LightSensorData", ';' ); |
167 | 167 | ||
168 | // warnings | 168 | // warnings |
169 | config. setGroup ( "Warnings" ); | 169 | config. setGroup ( "Warnings" ); |
170 | warnintervalBox-> setValue ( config. readNumEntry ( "checkinterval", 10000 ) / 1000 ); | 170 | warnintervalBox-> setValue ( config. readNumEntry ( "checkinterval", 10000 ) / 1000 ); |
171 | lowSpinBox-> setValue ( config. readNumEntry ( "powerverylow", 10 ) ); | 171 | lowSpinBox-> setValue ( config. readNumEntry ( "powerverylow", 10 ) ); |
172 | criticalSpinBox-> setValue ( config. readNumEntry ( "powercritical", 5 ) ); | 172 | criticalSpinBox-> setValue ( config. readNumEntry ( "powercritical", 5 ) ); |
173 | 173 | ||
174 | m_resettimer = new QTimer ( this ); | 174 | m_resettimer = new QTimer ( this ); |
175 | connect ( m_resettimer, SIGNAL( timeout ( )), this, SLOT( resetBacklight ( ))); | 175 | connect ( m_resettimer, SIGNAL( timeout()), this, SLOT( resetBacklight())); |
176 | 176 | ||
177 | if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online ) { | 177 | if ( PowerStatusManager::readStatus ( ). acStatus ( ) != PowerStatus::Online ) { |
178 | tabs-> setCurrentPage ( 0 ); | 178 | tabs-> setCurrentPage ( 0 ); |
179 | } | 179 | } |
180 | else { | 180 | else { |
181 | tabs-> setCurrentPage ( 1 ); | 181 | tabs-> setCurrentPage ( 1 ); |
182 | } | 182 | } |
183 | 183 | ||
184 | connect ( brightness, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); | 184 | connect ( brightness, SIGNAL( valueChanged(int)), this, SLOT( setBacklight(int))); |
185 | connect ( brightness_ac, SIGNAL( valueChanged ( int )), this, SLOT( setBacklight ( int ))); | 185 | connect ( brightness_ac, SIGNAL( valueChanged(int)), this, SLOT( setBacklight(int))); |
186 | if (m_cres) { | 186 | if (m_cres) { |
187 | connect ( contrast, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int ))); | 187 | connect ( contrast, SIGNAL( valueChanged(int)), this, SLOT( setContrast(int))); |
188 | connect ( contrast_ac, SIGNAL( valueChanged ( int )), this, SLOT( setContrast ( int ))); | 188 | connect ( contrast_ac, SIGNAL( valueChanged(int)), this, SLOT( setContrast(int))); |
189 | } | 189 | } |
190 | connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); | 190 | connect( frequency, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); |
191 | connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); | 191 | connect( frequency_ac, SIGNAL( activated(int) ), this, SLOT( setFrequency(int) ) ); |
192 | connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); | 192 | connect( closeHingeAction, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); |
193 | connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); | 193 | connect( closeHingeAction_ac, SIGNAL( activated(int) ), this, SLOT( setCloseHingeAction(int) ) ); |
194 | } | 194 | } |
195 | 195 | ||
196 | LightSettings::~LightSettings ( ) | 196 | LightSettings::~LightSettings ( ) |
197 | { | 197 | { |
198 | } | 198 | } |
199 | 199 | ||
200 | void LightSettings::calibrateSensor ( ) | 200 | void LightSettings::calibrateSensor ( ) |
201 | { | 201 | { |
202 | Sensor *s = new Sensor ( m_sensordata, this ); | 202 | Sensor *s = new Sensor ( m_sensordata, this ); |
203 | connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int ))); | 203 | connect ( s, SIGNAL( viewBacklight(int)), this, SLOT( setBacklight(int))); |
204 | QPEApplication::execDialog( s ); | 204 | QPEApplication::execDialog( s ); |
205 | delete s; | 205 | delete s; |
206 | } | 206 | } |
207 | 207 | ||
208 | void LightSettings::calibrateSensorAC ( ) | 208 | void LightSettings::calibrateSensorAC ( ) |
209 | { | 209 | { |
210 | Sensor *s = new Sensor ( m_sensordata_ac, this ); | 210 | Sensor *s = new Sensor ( m_sensordata_ac, this ); |
211 | connect ( s, SIGNAL( viewBacklight ( int )), this, SLOT( setBacklight ( int ))); | 211 | connect ( s, SIGNAL( viewBacklight(int)), this, SLOT( setBacklight(int))); |
212 | QPEApplication::execDialog ( s ); | 212 | QPEApplication::execDialog ( s ); |
213 | delete s; | 213 | delete s; |
214 | } | 214 | } |
215 | 215 | ||
216 | void LightSettings::setBacklight ( int bright ) | 216 | void LightSettings::setBacklight ( int bright ) |
217 | { | 217 | { |
218 | QCopEnvelope e ( "QPE/System", "setBacklight(int)" ); | 218 | QCopEnvelope e ( "QPE/System", "setBacklight(int)" ); |
219 | e << bright; | 219 | e << bright; |
220 | 220 | ||
221 | if ( bright != -1 ) { | 221 | if ( bright != -1 ) { |
222 | m_resettimer-> stop ( ); | 222 | m_resettimer-> stop ( ); |
223 | m_resettimer-> start ( 4000, true ); | 223 | m_resettimer-> start ( 4000, true ); |
224 | } | 224 | } |
225 | } | 225 | } |
226 | 226 | ||
227 | void LightSettings::setContrast ( int contr ) | 227 | void LightSettings::setContrast ( int contr ) |
228 | { | 228 | { |
229 | if (contr == -1) contr = m_oldcontrast; | 229 | if (contr == -1) contr = m_oldcontrast; |
230 | ODevice::inst ( )-> setDisplayContrast(contr); | 230 | ODevice::inst ( )-> setDisplayContrast(contr); |
231 | } | 231 | } |
232 | 232 | ||
233 | void LightSettings::setFrequency ( int index ) | 233 | void LightSettings::setFrequency ( int index ) |
234 | { | 234 | { |
235 | qWarning("LightSettings::setFrequency(%d)", index); | 235 | qWarning("LightSettings::setFrequency(%d)", index); |