author | sandman <sandman> | 2002-12-29 18:41:55 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-12-29 18:41:55 (UTC) |
commit | 7c3dceb16d9007e2c36b2b83e2a499cda3411138 (patch) (unidiff) | |
tree | 78a0945be9233099ca7e5e4e01d8b78364f009cb | |
parent | f8673391881545af514054babe47fdc162770a72 (diff) | |
download | opie-7c3dceb16d9007e2c36b2b83e2a499cda3411138.zip opie-7c3dceb16d9007e2c36b2b83e2a499cda3411138.tar.gz opie-7c3dceb16d9007e2c36b2b83e2a499cda3411138.tar.bz2 |
Power warning changes:
- interval can now be in the range (0 [Never] ... 300 [5min] )
- some code cleanup in the launcher
-rw-r--r-- | core/launcher/desktop.cpp | 34 | ||||
-rw-r--r-- | core/launcher/desktop.h | 2 | ||||
-rw-r--r-- | core/settings/light-and-power/lightsettingsbase.ui | 20 |
3 files changed, 35 insertions, 21 deletions
diff --git a/core/launcher/desktop.cpp b/core/launcher/desktop.cpp index fa9736f..03a23dc 100644 --- a/core/launcher/desktop.cpp +++ b/core/launcher/desktop.cpp | |||
@@ -146,116 +146,109 @@ void DesktopPowerAlerter::alert( const QString &text, int priority ) | |||
146 | } | 146 | } |
147 | 147 | ||
148 | 148 | ||
149 | void DesktopPowerAlerter::hideEvent( QHideEvent *e ) | 149 | void DesktopPowerAlerter::hideEvent( QHideEvent *e ) |
150 | { | 150 | { |
151 | QMessageBox::hideEvent( e ); | 151 | QMessageBox::hideEvent( e ); |
152 | alertCount = 0; | 152 | alertCount = 0; |
153 | currentPriority = INT_MAX; | 153 | currentPriority = INT_MAX; |
154 | } | 154 | } |
155 | 155 | ||
156 | 156 | ||
157 | void DesktopApplication::switchLCD ( bool on ) | 157 | void DesktopApplication::switchLCD ( bool on ) |
158 | { | 158 | { |
159 | if ( qApp ) { | 159 | if ( qApp ) { |
160 | DesktopApplication *dapp = (DesktopApplication *) qApp; | 160 | DesktopApplication *dapp = (DesktopApplication *) qApp; |
161 | 161 | ||
162 | if ( dapp-> m_screensaver ) { | 162 | if ( dapp-> m_screensaver ) { |
163 | if ( on ) { | 163 | if ( on ) { |
164 | dapp-> m_screensaver-> setDisplayState ( true ); | 164 | dapp-> m_screensaver-> setDisplayState ( true ); |
165 | dapp-> m_screensaver-> setBacklight ( -3 ); | 165 | dapp-> m_screensaver-> setBacklight ( -3 ); |
166 | } | 166 | } |
167 | else { | 167 | else { |
168 | dapp-> m_screensaver-> setDisplayState ( false ); | 168 | dapp-> m_screensaver-> setDisplayState ( false ); |
169 | } | 169 | } |
170 | } | 170 | } |
171 | } | 171 | } |
172 | } | 172 | } |
173 | 173 | ||
174 | 174 | ||
175 | DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) | 175 | DesktopApplication::DesktopApplication( int& argc, char **argv, Type appType ) |
176 | : QPEApplication( argc, argv, appType ) | 176 | : QPEApplication( argc, argv, appType ) |
177 | { | 177 | { |
178 | |||
179 | Config cfg( "apm" ); | ||
180 | cfg.setGroup( "Warnings" ); | ||
181 | //cfg.readNumEntry( "checkinterval", 10000 ) | ||
182 | m_powerVeryLow = cfg.readNumEntry( "powerverylow", 10 ); | ||
183 | m_powerCritical = cfg.readNumEntry( "powercritical", 5 ); | ||
184 | |||
185 | m_ps = new PowerStatus; | 178 | m_ps = new PowerStatus; |
186 | m_ps_last = new PowerStatus; | 179 | m_ps_last = new PowerStatus; |
187 | pa = new DesktopPowerAlerter( 0 ); | 180 | pa = new DesktopPowerAlerter( 0 ); |
188 | 181 | ||
189 | m_timer = new QTimer( this ); | 182 | m_apm_timer = new QTimer ( this ); |
190 | connect( m_timer, SIGNAL( timeout() ), this, SLOT( apmTimeout() ) ); | 183 | connect ( m_apm_timer, SIGNAL( timeout ( )), this, SLOT( apmTimeout ( ))); |
191 | m_timer->start( 5000 ); | 184 | reloadPowerWarnSettings ( ); |
192 | 185 | ||
193 | m_last_button = 0; | 186 | m_last_button = 0; |
194 | m_button_timer = new QTimer ( ); | 187 | m_button_timer = new QTimer ( ); |
195 | connect ( m_button_timer, SIGNAL( timeout ( )), this, SLOT( sendHeldAction ( ))); | 188 | connect ( m_button_timer, SIGNAL( timeout ( )), this, SLOT( sendHeldAction ( ))); |
196 | 189 | ||
197 | channel = new QCopChannel( "QPE/System", this ); | 190 | channel = new QCopChannel( "QPE/System", this ); |
198 | connect( channel, SIGNAL( received( const QCString&, const QByteArray& ) ), | 191 | connect( channel, SIGNAL( received( const QCString&, const QByteArray& ) ), |
199 | this, SLOT( systemMessage( const QCString&, const QByteArray& ) ) ); | 192 | this, SLOT( systemMessage( const QCString&, const QByteArray& ) ) ); |
200 | 193 | ||
201 | channel = new QCopChannel( "QPE/Launcher", this ); | 194 | channel = new QCopChannel( "QPE/Launcher", this ); |
202 | connect( channel, SIGNAL( received( const QCString&, const QByteArray& ) ), | 195 | connect( channel, SIGNAL( received( const QCString&, const QByteArray& ) ), |
203 | this, SLOT( launcherMessage( const QCString&, const QByteArray& ) ) ); | 196 | this, SLOT( launcherMessage( const QCString&, const QByteArray& ) ) ); |
204 | 197 | ||
205 | m_screensaver = new OpieScreenSaver ( ); | 198 | m_screensaver = new OpieScreenSaver ( ); |
206 | m_screensaver-> setInterval ( -1 ); | 199 | m_screensaver-> setInterval ( -1 ); |
207 | QWSServer::setScreenSaver( m_screensaver ); | 200 | QWSServer::setScreenSaver( m_screensaver ); |
208 | 201 | ||
209 | rereadVolumes(); | 202 | rereadVolumes(); |
210 | connect( qApp, SIGNAL( volumeChanged( bool ) ), this, SLOT( rereadVolumes() ) ); | 203 | connect( qApp, SIGNAL( volumeChanged( bool ) ), this, SLOT( rereadVolumes() ) ); |
211 | 204 | ||
212 | apmTimeout ( ); | 205 | apmTimeout ( ); |
213 | 206 | ||
214 | grabKeyboard ( ); | 207 | grabKeyboard ( ); |
215 | } | 208 | } |
216 | 209 | ||
217 | 210 | ||
218 | DesktopApplication::~DesktopApplication() | 211 | DesktopApplication::~DesktopApplication() |
219 | { | 212 | { |
220 | ungrabKeyboard ( ); | 213 | ungrabKeyboard ( ); |
221 | 214 | ||
222 | delete m_ps; | 215 | delete m_ps; |
223 | delete m_ps_last; | 216 | delete m_ps_last; |
224 | delete pa; | 217 | delete pa; |
225 | } | 218 | } |
226 | 219 | ||
227 | void DesktopApplication::apmTimeout() | 220 | void DesktopApplication::apmTimeout() |
228 | { | 221 | { |
229 | qpedesktop->checkMemory(); // in case no events are being generated | 222 | qpedesktop-> checkMemory ( ); // in case no events are being generated |
230 | 223 | ||
231 | *m_ps_last = *m_ps; | 224 | *m_ps_last = *m_ps; |
232 | *m_ps = PowerStatusManager::readStatus(); | 225 | *m_ps = PowerStatusManager::readStatus(); |
233 | 226 | ||
234 | if ( m_ps-> acStatus ( ) != m_ps_last-> acStatus ( )) | 227 | if ( m_ps-> acStatus ( ) != m_ps_last-> acStatus ( )) |
235 | m_screensaver-> powerStatusChanged ( *m_ps ); | 228 | m_screensaver-> powerStatusChanged ( *m_ps ); |
236 | 229 | ||
237 | if ( m_ps-> acStatus ( ) != PowerStatus::Online ) { | 230 | if ( m_ps-> acStatus ( ) != PowerStatus::Online ) { |
238 | int bat = m_ps-> batteryPercentRemaining ( ); | 231 | int bat = m_ps-> batteryPercentRemaining ( ); |
239 | 232 | ||
240 | if ( bat < m_ps_last-> batteryPercentRemaining ( )) { | 233 | if ( bat < m_ps_last-> batteryPercentRemaining ( )) { |
241 | if ( bat <= m_powerCritical ) | 234 | if ( bat <= m_powerCritical ) |
242 | pa->alert( tr( "Battery level is critical!\nKeep power off until power restored!" ), 1 ); | 235 | pa->alert( tr( "Battery level is critical!\nKeep power off until power restored!" ), 1 ); |
243 | else if ( bat <= m_powerVeryLow ) | 236 | else if ( bat <= m_powerVeryLow ) |
244 | pa->alert( tr( "Battery is running very low." ), 2 ); | 237 | pa->alert( tr( "Battery is running very low." ), 2 ); |
245 | } | 238 | } |
246 | if ( m_ps-> backupBatteryStatus ( ) == PowerStatus::VeryLow ) | 239 | if ( m_ps-> backupBatteryStatus ( ) == PowerStatus::VeryLow ) |
247 | pa->alert( tr( "The Back-up battery is very low.\nPlease charge the back-up battery." ), 2 ); | 240 | pa->alert( tr( "The Back-up battery is very low.\nPlease charge the back-up battery." ), 2 ); |
248 | } | 241 | } |
249 | } | 242 | } |
250 | 243 | ||
251 | 244 | ||
252 | void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & data ) | 245 | void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & data ) |
253 | { | 246 | { |
254 | QDataStream stream ( data, IO_ReadOnly ); | 247 | QDataStream stream ( data, IO_ReadOnly ); |
255 | 248 | ||
256 | if ( msg == "setScreenSaverInterval(int)" ) { | 249 | if ( msg == "setScreenSaverInterval(int)" ) { |
257 | int time; | 250 | int time; |
258 | stream >> time; | 251 | stream >> time; |
259 | m_screensaver-> setInterval( time ); | 252 | m_screensaver-> setInterval( time ); |
260 | } | 253 | } |
261 | else if ( msg == "setScreenSaverIntervals(int,int,int)" ) { | 254 | else if ( msg == "setScreenSaverIntervals(int,int,int)" ) { |
@@ -267,111 +260,116 @@ void DesktopApplication::systemMessage( const QCString & msg, const QByteArray & | |||
267 | int bright; | 260 | int bright; |
268 | stream >> bright; | 261 | stream >> bright; |
269 | m_screensaver-> setBacklight( bright ); | 262 | m_screensaver-> setBacklight( bright ); |
270 | } | 263 | } |
271 | else if ( msg == "setScreenSaverMode(int)" ) { | 264 | else if ( msg == "setScreenSaverMode(int)" ) { |
272 | int mode; | 265 | int mode; |
273 | stream >> mode; | 266 | stream >> mode; |
274 | m_screensaver-> setMode ( mode ); | 267 | m_screensaver-> setMode ( mode ); |
275 | } | 268 | } |
276 | else if ( msg == "reloadPowerWarnSettings()" ) { | 269 | else if ( msg == "reloadPowerWarnSettings()" ) { |
277 | reloadPowerWarnSettings(); | 270 | reloadPowerWarnSettings(); |
278 | } | 271 | } |
279 | else if ( msg == "setDisplayState(int)" ) { | 272 | else if ( msg == "setDisplayState(int)" ) { |
280 | int state; | 273 | int state; |
281 | stream >> state; | 274 | stream >> state; |
282 | m_screensaver-> setDisplayState ( state != 0 ); | 275 | m_screensaver-> setDisplayState ( state != 0 ); |
283 | } | 276 | } |
284 | else if ( msg == "suspend()" ) { | 277 | else if ( msg == "suspend()" ) { |
285 | emit power(); | 278 | emit power(); |
286 | } | 279 | } |
287 | else if ( msg == "sendBusinessCard()" ) { | 280 | else if ( msg == "sendBusinessCard()" ) { |
288 | QString card = ::getenv ( "HOME" ); | 281 | QString card = ::getenv ( "HOME" ); |
289 | card += "/Applications/addressbook/businesscard.vcf"; | 282 | card += "/Applications/addressbook/businesscard.vcf"; |
290 | 283 | ||
291 | if ( QFile::exists( card ) ) { | 284 | if ( QFile::exists( card ) ) { |
292 | QCopEnvelope e ( "QPE/Obex", "send(QString,QString,QString)" ); | 285 | QCopEnvelope e ( "QPE/Obex", "send(QString,QString,QString)" ); |
293 | QString mimetype = "text/x-vCard"; | 286 | QString mimetype = "text/x-vCard"; |
294 | e << tr( "business card" ) << card << mimetype; | 287 | e << tr( "business card" ) << card << mimetype; |
295 | } | 288 | } |
296 | } | 289 | } |
297 | } | 290 | } |
298 | 291 | ||
299 | void DesktopApplication::reloadPowerWarnSettings() | 292 | void DesktopApplication::reloadPowerWarnSettings ( ) |
300 | { | 293 | { |
301 | Config cfg( "apm" ); | 294 | Config cfg ( "apm" ); |
302 | cfg.setGroup( "Warnings" ); | 295 | cfg. setGroup ( "Warnings" ); |
303 | 296 | ||
304 | // m_timer->changeInterval( cfg.readNumEntry( "checkinterval", 10000 ) ); | 297 | int iv = cfg. readNumEntry ( "checkinterval", 10000 ); |
305 | m_powerVeryLow = cfg.readNumEntry( "powerverylow", 10 ); | 298 | |
306 | m_powerCritical = cfg.readNumEntry( "powervcritical", 5 ); | 299 | m_apm_timer-> stop ( ); |
300 | if ( iv ) | ||
301 | m_apm_timer-> start ( iv ); | ||
302 | |||
303 | m_powerVeryLow = cfg. readNumEntry ( "powerverylow", 10 ); | ||
304 | m_powerCritical = cfg. readNumEntry ( "powervcritical", 5 ); | ||
307 | } | 305 | } |
308 | 306 | ||
309 | 307 | ||
310 | enum MemState { Unknown, VeryLow, Low, Normal } memstate = Unknown; | 308 | enum MemState { Unknown, VeryLow, Low, Normal } memstate = Unknown; |
311 | 309 | ||
312 | 310 | ||
313 | void DesktopApplication::launcherMessage( const QCString & msg, const QByteArray & data ) | 311 | void DesktopApplication::launcherMessage( const QCString & msg, const QByteArray & data ) |
314 | { | 312 | { |
315 | QDataStream stream ( data, IO_ReadOnly ); | 313 | QDataStream stream ( data, IO_ReadOnly ); |
316 | 314 | ||
317 | if ( msg == "deviceButton(int,int,int)" ) { | 315 | if ( msg == "deviceButton(int,int,int)" ) { |
318 | int keycode, press, autoRepeat; | 316 | int keycode, press, autoRepeat; |
319 | stream >> keycode >> press >> autoRepeat; | 317 | stream >> keycode >> press >> autoRepeat; |
320 | 318 | ||
321 | const ODeviceButton *db = ODevice::inst ( )-> buttonForKeycode ( keycode ); | 319 | const ODeviceButton *db = ODevice::inst ( )-> buttonForKeycode ( keycode ); |
322 | 320 | ||
323 | if ( db ) | 321 | if ( db ) |
324 | checkButtonAction ( db, keycode, press, autoRepeat ); | 322 | checkButtonAction ( db, keycode, press, autoRepeat ); |
325 | } | 323 | } |
326 | else if ( msg == "keyRegister(int,QCString,QCString)" ) { | 324 | else if ( msg == "keyRegister(int,QCString,QCString)" ) { |
327 | int k; | 325 | int k; |
328 | QCString c, m; | 326 | QCString c, m; |
329 | stream >> k >> c >> m; | 327 | stream >> k >> c >> m; |
330 | 328 | ||
331 | keyRegisterList.append ( QCopKeyRegister ( k, c, m )); | 329 | keyRegisterList.append ( QCopKeyRegister ( k, c, m )); |
332 | } | 330 | } |
333 | } | 331 | } |
334 | 332 | ||
335 | void DesktopApplication::sendHeldAction ( ) | 333 | void DesktopApplication::sendHeldAction ( ) |
336 | { | 334 | { |
337 | if ( m_last_button ) { | 335 | if ( m_last_button ) { |
338 | m_last_button-> heldAction ( ). send ( ); | 336 | m_last_button-> heldAction ( ). send ( ); |
339 | m_last_button = 0; | 337 | m_last_button = 0; |
340 | } | 338 | } |
341 | } | 339 | } |
342 | 340 | ||
343 | 341 | ||
344 | 342 | ||
345 | void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int keycode, bool press, bool autoRepeat ) | 343 | void DesktopApplication::checkButtonAction ( const ODeviceButton *db, int /*keycode*/, bool press, bool autoRepeat ) |
346 | { | 344 | { |
347 | if ( db ) { | 345 | if ( db ) { |
348 | if ( !press && !autoRepeat && m_button_timer-> isActive ( )) { | 346 | if ( !press && !autoRepeat && m_button_timer-> isActive ( )) { |
349 | m_button_timer-> stop ( ); | 347 | m_button_timer-> stop ( ); |
350 | if ( !db-> pressedAction ( ). channel ( ). isEmpty ( )) { | 348 | if ( !db-> pressedAction ( ). channel ( ). isEmpty ( )) { |
351 | db-> pressedAction ( ). send ( ); | 349 | db-> pressedAction ( ). send ( ); |
352 | } | 350 | } |
353 | } | 351 | } |
354 | else if ( press && !autoRepeat ) { | 352 | else if ( press && !autoRepeat ) { |
355 | m_button_timer-> stop ( ); | 353 | m_button_timer-> stop ( ); |
356 | 354 | ||
357 | if ( !db-> heldAction ( ). channel ( ). isEmpty ( )) { | 355 | if ( !db-> heldAction ( ). channel ( ). isEmpty ( )) { |
358 | m_last_button = db; | 356 | m_last_button = db; |
359 | m_button_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true ); | 357 | m_button_timer-> start ( ODevice::inst ( )-> buttonHoldTime ( ), true ); |
360 | } | 358 | } |
361 | } | 359 | } |
362 | } | 360 | } |
363 | } | 361 | } |
364 | 362 | ||
365 | bool DesktopApplication::eventFilter ( QObject *o, QEvent *e ) | 363 | bool DesktopApplication::eventFilter ( QObject *o, QEvent *e ) |
366 | { | 364 | { |
367 | if ( e-> type ( ) == QEvent::KeyPress || e-> type ( ) == QEvent::KeyRelease ) { | 365 | if ( e-> type ( ) == QEvent::KeyPress || e-> type ( ) == QEvent::KeyRelease ) { |
368 | QKeyEvent *ke = (QKeyEvent *) e; | 366 | QKeyEvent *ke = (QKeyEvent *) e; |
369 | 367 | ||
370 | const ODeviceButton *db = ODevice::inst ( )-> buttonForKeycode ( ke-> key ( )); | 368 | const ODeviceButton *db = ODevice::inst ( )-> buttonForKeycode ( ke-> key ( )); |
371 | 369 | ||
372 | if ( db ) { | 370 | if ( db ) { |
373 | checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( )); | 371 | checkButtonAction ( db, ke-> key ( ), e-> type ( ) == QEvent::KeyPress, ke-> isAutoRepeat ( )); |
374 | return true; | 372 | return true; |
375 | } | 373 | } |
376 | } | 374 | } |
377 | return QPEApplication::eventFilter ( o, e ); | 375 | return QPEApplication::eventFilter ( o, e ); |
diff --git a/core/launcher/desktop.h b/core/launcher/desktop.h index 6cb7ab2..db0173e 100644 --- a/core/launcher/desktop.h +++ b/core/launcher/desktop.h | |||
@@ -66,65 +66,65 @@ protected: | |||
66 | #ifdef Q_WS_QWS | 66 | #ifdef Q_WS_QWS |
67 | 67 | ||
68 | bool qwsEventFilter( QWSEvent * ); | 68 | bool qwsEventFilter( QWSEvent * ); |
69 | #endif | 69 | #endif |
70 | 70 | ||
71 | void shutdown(); | 71 | void shutdown(); |
72 | void restart(); | 72 | void restart(); |
73 | 73 | ||
74 | public slots: | 74 | public slots: |
75 | virtual void systemMessage ( const QCString &msg, const QByteArray &data ); | 75 | virtual void systemMessage ( const QCString &msg, const QByteArray &data ); |
76 | virtual void launcherMessage ( const QCString &msg, const QByteArray &data ); | 76 | virtual void launcherMessage ( const QCString &msg, const QByteArray &data ); |
77 | void rereadVolumes(); | 77 | void rereadVolumes(); |
78 | 78 | ||
79 | protected slots: | 79 | protected slots: |
80 | void shutdown ( ShutdownImpl::Type ); | 80 | void shutdown ( ShutdownImpl::Type ); |
81 | void apmTimeout ( ); | 81 | void apmTimeout ( ); |
82 | void sendHeldAction ( ); | 82 | void sendHeldAction ( ); |
83 | 83 | ||
84 | protected: | 84 | protected: |
85 | virtual bool eventFilter ( QObject *o, QEvent *e ); | 85 | virtual bool eventFilter ( QObject *o, QEvent *e ); |
86 | void checkButtonAction ( const Opie::ODeviceButton *db, int keycode, bool press, bool autoRepeat ); | 86 | void checkButtonAction ( const Opie::ODeviceButton *db, int keycode, bool press, bool autoRepeat ); |
87 | 87 | ||
88 | private: | 88 | private: |
89 | static DesktopApplication *me ( ); | 89 | static DesktopApplication *me ( ); |
90 | 90 | ||
91 | private: | 91 | private: |
92 | void reloadPowerWarnSettings(); | 92 | void reloadPowerWarnSettings(); |
93 | DesktopPowerAlerter *pa; | 93 | DesktopPowerAlerter *pa; |
94 | PowerStatus *m_ps, *m_ps_last; | 94 | PowerStatus *m_ps, *m_ps_last; |
95 | QTimer *cardSendTimer; | 95 | QTimer *cardSendTimer; |
96 | QCopChannel *channel; | 96 | QCopChannel *channel; |
97 | OpieScreenSaver *m_screensaver; | 97 | OpieScreenSaver *m_screensaver; |
98 | QTimer * m_timer; | 98 | QTimer * m_apm_timer; |
99 | int m_powerVeryLow; | 99 | int m_powerVeryLow; |
100 | int m_powerCritical; | 100 | int m_powerCritical; |
101 | int m_currentPowerLevel; | 101 | int m_currentPowerLevel; |
102 | 102 | ||
103 | const Opie::ODeviceButton *m_last_button; | 103 | const Opie::ODeviceButton *m_last_button; |
104 | QTimer *m_button_timer; | 104 | QTimer *m_button_timer; |
105 | 105 | ||
106 | bool m_keyclick_sound : 1; | 106 | bool m_keyclick_sound : 1; |
107 | bool m_screentap_sound : 1; | 107 | bool m_screentap_sound : 1; |
108 | bool m_alarm_sound : 1; | 108 | bool m_alarm_sound : 1; |
109 | }; | 109 | }; |
110 | 110 | ||
111 | 111 | ||
112 | class Desktop : public QWidget | 112 | class Desktop : public QWidget |
113 | { | 113 | { |
114 | Q_OBJECT | 114 | Q_OBJECT |
115 | public: | 115 | public: |
116 | Desktop(); | 116 | Desktop(); |
117 | ~Desktop(); | 117 | ~Desktop(); |
118 | 118 | ||
119 | static bool screenLocked(); | 119 | static bool screenLocked(); |
120 | 120 | ||
121 | void show(); | 121 | void show(); |
122 | void checkMemory(); | 122 | void checkMemory(); |
123 | 123 | ||
124 | public slots: | 124 | public slots: |
125 | void execAutoStart(); | 125 | void execAutoStart(); |
126 | void togglePower(); | 126 | void togglePower(); |
127 | void toggleLight(); | 127 | void toggleLight(); |
128 | void toggleNumLockState(); | 128 | void toggleNumLockState(); |
129 | void toggleCapsLockState(); | 129 | void toggleCapsLockState(); |
130 | void toggleSymbolInput(); | 130 | void toggleSymbolInput(); |
diff --git a/core/settings/light-and-power/lightsettingsbase.ui b/core/settings/light-and-power/lightsettingsbase.ui index 309b95d..b583b5c 100644 --- a/core/settings/light-and-power/lightsettingsbase.ui +++ b/core/settings/light-and-power/lightsettingsbase.ui | |||
@@ -1,46 +1,46 @@ | |||
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>371</width> | 14 | <width>367</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> |
39 | <vbox> | 39 | <vbox> |
40 | <property stdset="1"> | 40 | <property stdset="1"> |
41 | <name>margin</name> | 41 | <name>margin</name> |
42 | <number>3</number> | 42 | <number>3</number> |
43 | </property> | 43 | </property> |
44 | <property stdset="1"> | 44 | <property stdset="1"> |
45 | <name>spacing</name> | 45 | <name>spacing</name> |
46 | <number>3</number> | 46 | <number>3</number> |
@@ -1033,73 +1033,89 @@ | |||
1033 | <property stdset="1"> | 1033 | <property stdset="1"> |
1034 | <name>suffix</name> | 1034 | <name>suffix</name> |
1035 | <string> %</string> | 1035 | <string> %</string> |
1036 | </property> | 1036 | </property> |
1037 | <property stdset="1"> | 1037 | <property stdset="1"> |
1038 | <name>buttonSymbols</name> | 1038 | <name>buttonSymbols</name> |
1039 | <enum>PlusMinus</enum> | 1039 | <enum>PlusMinus</enum> |
1040 | </property> | 1040 | </property> |
1041 | <property stdset="1"> | 1041 | <property stdset="1"> |
1042 | <name>maxValue</name> | 1042 | <name>maxValue</name> |
1043 | <number>80</number> | 1043 | <number>80</number> |
1044 | </property> | 1044 | </property> |
1045 | <property stdset="1"> | 1045 | <property stdset="1"> |
1046 | <name>minValue</name> | 1046 | <name>minValue</name> |
1047 | <number>2</number> | 1047 | <number>2</number> |
1048 | </property> | 1048 | </property> |
1049 | <property> | 1049 | <property> |
1050 | <name>whatsThis</name> | 1050 | <name>whatsThis</name> |
1051 | <string>At what battery level should the low power warning pop up</string> | 1051 | <string>At what battery level should the low power warning pop up</string> |
1052 | </property> | 1052 | </property> |
1053 | </widget> | 1053 | </widget> |
1054 | <widget row="0" column="1" > | 1054 | <widget row="0" column="1" > |
1055 | <class>QSpinBox</class> | 1055 | <class>QSpinBox</class> |
1056 | <property stdset="1"> | 1056 | <property stdset="1"> |
1057 | <name>name</name> | 1057 | <name>name</name> |
1058 | <cstring>warnintervalBox</cstring> | 1058 | <cstring>warnintervalBox</cstring> |
1059 | </property> | 1059 | </property> |
1060 | <property stdset="1"> | 1060 | <property stdset="1"> |
1061 | <name>suffix</name> | 1061 | <name>suffix</name> |
1062 | <string> sec</string> | 1062 | <string> sec</string> |
1063 | </property> | 1063 | </property> |
1064 | <property stdset="1"> | 1064 | <property stdset="1"> |
1065 | <name>specialValueText</name> | ||
1066 | <string>never</string> | ||
1067 | </property> | ||
1068 | <property stdset="1"> | ||
1069 | <name>wrapping</name> | ||
1070 | <bool>true</bool> | ||
1071 | </property> | ||
1072 | <property stdset="1"> | ||
1065 | <name>buttonSymbols</name> | 1073 | <name>buttonSymbols</name> |
1066 | <enum>PlusMinus</enum> | 1074 | <enum>PlusMinus</enum> |
1067 | </property> | 1075 | </property> |
1068 | <property stdset="1"> | 1076 | <property stdset="1"> |
1069 | <name>maxValue</name> | 1077 | <name>maxValue</name> |
1070 | <number>60</number> | 1078 | <number>300</number> |
1071 | </property> | 1079 | </property> |
1072 | <property stdset="1"> | 1080 | <property stdset="1"> |
1073 | <name>minValue</name> | 1081 | <name>minValue</name> |
1082 | <number>0</number> | ||
1083 | </property> | ||
1084 | <property stdset="1"> | ||
1085 | <name>lineStep</name> | ||
1086 | <number>5</number> | ||
1087 | </property> | ||
1088 | <property stdset="1"> | ||
1089 | <name>value</name> | ||
1074 | <number>5</number> | 1090 | <number>5</number> |
1075 | </property> | 1091 | </property> |
1076 | <property> | 1092 | <property> |
1077 | <name>whatsThis</name> | 1093 | <name>whatsThis</name> |
1078 | <string>how often should be checked for low power. This determines the rate popups occure in low power situations</string> | 1094 | <string>how often should be checked for low power. This determines the rate popups occure in low power situations</string> |
1079 | </property> | 1095 | </property> |
1080 | </widget> | 1096 | </widget> |
1081 | <widget row="2" column="1" > | 1097 | <widget row="2" column="1" > |
1082 | <class>QSpinBox</class> | 1098 | <class>QSpinBox</class> |
1083 | <property stdset="1"> | 1099 | <property stdset="1"> |
1084 | <name>name</name> | 1100 | <name>name</name> |
1085 | <cstring>criticalSpinBox</cstring> | 1101 | <cstring>criticalSpinBox</cstring> |
1086 | </property> | 1102 | </property> |
1087 | <property stdset="1"> | 1103 | <property stdset="1"> |
1088 | <name>prefix</name> | 1104 | <name>prefix</name> |
1089 | <string></string> | 1105 | <string></string> |
1090 | </property> | 1106 | </property> |
1091 | <property stdset="1"> | 1107 | <property stdset="1"> |
1092 | <name>suffix</name> | 1108 | <name>suffix</name> |
1093 | <string> %</string> | 1109 | <string> %</string> |
1094 | </property> | 1110 | </property> |
1095 | <property stdset="1"> | 1111 | <property stdset="1"> |
1096 | <name>buttonSymbols</name> | 1112 | <name>buttonSymbols</name> |
1097 | <enum>PlusMinus</enum> | 1113 | <enum>PlusMinus</enum> |
1098 | </property> | 1114 | </property> |
1099 | <property stdset="1"> | 1115 | <property stdset="1"> |
1100 | <name>maxValue</name> | 1116 | <name>maxValue</name> |
1101 | <number>80</number> | 1117 | <number>80</number> |
1102 | </property> | 1118 | </property> |
1103 | <property stdset="1"> | 1119 | <property stdset="1"> |
1104 | <name>minValue</name> | 1120 | <name>minValue</name> |
1105 | <number>2</number> | 1121 | <number>2</number> |