-rw-r--r-- | core/launcher/taskbar.cpp | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp index 63361fe..7cbfe13 100644 --- a/core/launcher/taskbar.cpp +++ b/core/launcher/taskbar.cpp | |||
@@ -225,130 +225,128 @@ TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOn | |||
225 | QObject::connect(clearer, SIGNAL(timeout()), SLOT(clearStatusBar())); | 225 | QObject::connect(clearer, SIGNAL(timeout()), SLOT(clearStatusBar())); |
226 | 226 | ||
227 | connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) ); | 227 | connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) ); |
228 | connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) ); | 228 | connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) ); |
229 | connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) ); | 229 | connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) ); |
230 | } | 230 | } |
231 | 231 | ||
232 | void TaskBar::setStatusMessage( const QString &text ) | 232 | void TaskBar::setStatusMessage( const QString &text ) |
233 | { | 233 | { |
234 | if ( !text.isEmpty() ) { | 234 | if ( !text.isEmpty() ) { |
235 | label->setText( text ); | 235 | label->setText( text ); |
236 | stack->raiseWidget( label ); | 236 | stack->raiseWidget( label ); |
237 | if ( sysTray && ( label->fontMetrics().width( text ) > label->width() ) ) | 237 | if ( sysTray && ( label->fontMetrics().width( text ) > label->width() ) ) |
238 | sysTray->hide(); | 238 | sysTray->hide(); |
239 | clearer->start( 3000, TRUE ); | 239 | clearer->start( 3000, TRUE ); |
240 | } else { | 240 | } else { |
241 | clearStatusBar(); | 241 | clearStatusBar(); |
242 | } | 242 | } |
243 | } | 243 | } |
244 | 244 | ||
245 | void TaskBar::clearStatusBar() | 245 | void TaskBar::clearStatusBar() |
246 | { | 246 | { |
247 | label->clear(); | 247 | label->clear(); |
248 | stack->raiseWidget(runningAppBar); | 248 | stack->raiseWidget(runningAppBar); |
249 | if ( sysTray ) | 249 | if ( sysTray ) |
250 | sysTray->show(); | 250 | sysTray->show(); |
251 | // stack->raiseWidget( mru ); | 251 | // stack->raiseWidget( mru ); |
252 | } | 252 | } |
253 | 253 | ||
254 | void TaskBar::startWait() | 254 | void TaskBar::startWait() |
255 | { | 255 | { |
256 | waitIcon->setWaiting( true ); | 256 | waitIcon->setWaiting( true ); |
257 | // a catchall stop after 10 seconds... | 257 | // a catchall stop after 10 seconds... |
258 | waitTimer->start( 10 * 1000, true ); | 258 | waitTimer->start( 10 * 1000, true ); |
259 | } | 259 | } |
260 | 260 | ||
261 | void TaskBar::stopWait(const QString&) | 261 | void TaskBar::stopWait(const QString&) |
262 | { | 262 | { |
263 | waitTimer->stop(); | 263 | waitTimer->stop(); |
264 | waitIcon->setWaiting( false ); | 264 | waitIcon->setWaiting( false ); |
265 | } | 265 | } |
266 | 266 | ||
267 | void TaskBar::stopWait() | 267 | void TaskBar::stopWait() |
268 | { | 268 | { |
269 | waitTimer->stop(); | 269 | waitTimer->stop(); |
270 | waitIcon->setWaiting( false ); | 270 | waitIcon->setWaiting( false ); |
271 | } | 271 | } |
272 | 272 | ||
273 | /* | 273 | /* |
274 | * This resizeEvent will be captured by | 274 | * This resizeEvent will be captured by |
275 | * the ServerInterface and it'll layout | 275 | * the ServerInterface and it'll layout |
276 | * and calc rect. Now if we go from bigger | 276 | * and calc rect. Now if we go from bigger |
277 | * to smaller screen the SysTray is out of | 277 | * to smaller screen the SysTray is out of |
278 | * bounds and repaint() won't trigger an Event | 278 | * bounds and repaint() won't trigger an Event |
279 | */ | 279 | */ |
280 | void TaskBar::resizeEvent( QResizeEvent *e ) | 280 | void TaskBar::resizeEvent( QResizeEvent *e ) |
281 | { | 281 | { |
282 | if ( sysTray ) | 282 | if ( sysTray ) |
283 | sysTray->hide(); | 283 | sysTray->hide(); |
284 | 284 | ||
285 | QHBox::resizeEvent( e ); | 285 | QHBox::resizeEvent( e ); |
286 | 286 | ||
287 | if ( sysTray ) | 287 | if ( sysTray ) |
288 | sysTray->show(); | 288 | sysTray->show(); |
289 | |||
290 | owarn << "TaskBar::resize event" << oendl; | ||
291 | } | 289 | } |
292 | 290 | ||
293 | void TaskBar::styleChange( QStyle &s ) | 291 | void TaskBar::styleChange( QStyle &s ) |
294 | { | 292 | { |
295 | QHBox::styleChange( s ); | 293 | QHBox::styleChange( s ); |
296 | calcMaxWindowRect(); | 294 | calcMaxWindowRect(); |
297 | } | 295 | } |
298 | 296 | ||
299 | void TaskBar::calcMaxWindowRect() | 297 | void TaskBar::calcMaxWindowRect() |
300 | { | 298 | { |
301 | if ( resizeRunningApp ) | 299 | if ( resizeRunningApp ) |
302 | { | 300 | { |
303 | #if defined(Q_WS_QWS) | 301 | #if defined(Q_WS_QWS) |
304 | QRect wr; | 302 | QRect wr; |
305 | int displayWidth = qApp->desktop()->width(); | 303 | int displayWidth = qApp->desktop()->width(); |
306 | QRect ir = inputMethods->inputRect(); | 304 | QRect ir = inputMethods->inputRect(); |
307 | if ( ir.isValid() ) { | 305 | if ( ir.isValid() ) { |
308 | wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 ); | 306 | wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 ); |
309 | } else { | 307 | } else { |
310 | wr.setCoords( 0, 0, displayWidth-1, y()-1 ); | 308 | wr.setCoords( 0, 0, displayWidth-1, y()-1 ); |
311 | } | 309 | } |
312 | #if QT_VERSION < 0x030000 | 310 | #if QT_VERSION < 0x030000 |
313 | QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr,QSize(qt_screen->width(),qt_screen->height())) ); | 311 | QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr,QSize(qt_screen->width(),qt_screen->height())) ); |
314 | #else | 312 | #else |
315 | QWSServer::setMaxWindowRect( wr ); | 313 | QWSServer::setMaxWindowRect( wr ); |
316 | #endif | 314 | #endif |
317 | #endif | 315 | #endif |
318 | } | 316 | } |
319 | } | 317 | } |
320 | 318 | ||
321 | void TaskBar::receive( const QCString &msg, const QByteArray &data ) | 319 | void TaskBar::receive( const QCString &msg, const QByteArray &data ) |
322 | { | 320 | { |
323 | QDataStream stream( data, IO_ReadOnly ); | 321 | QDataStream stream( data, IO_ReadOnly ); |
324 | if ( msg == "message(QString)" ) { | 322 | if ( msg == "message(QString)" ) { |
325 | QString text; | 323 | QString text; |
326 | stream >> text; | 324 | stream >> text; |
327 | setStatusMessage( text ); | 325 | setStatusMessage( text ); |
328 | } else if ( msg == "hideInputMethod()" ) { | 326 | } else if ( msg == "hideInputMethod()" ) { |
329 | inputMethods->hideInputMethod(); | 327 | inputMethods->hideInputMethod(); |
330 | } else if ( msg == "showInputMethod()" ) { | 328 | } else if ( msg == "showInputMethod()" ) { |
331 | inputMethods->showInputMethod(); | 329 | inputMethods->showInputMethod(); |
332 | } else if ( msg == "showInputMethod(QString)" ) { | 330 | } else if ( msg == "showInputMethod(QString)" ) { |
333 | QString name; | 331 | QString name; |
334 | stream >> name; | 332 | stream >> name; |
335 | inputMethods->showInputMethod(name); | 333 | inputMethods->showInputMethod(name); |
336 | } else if ( msg == "reloadInputMethods()" ) { | 334 | } else if ( msg == "reloadInputMethods()" ) { |
337 | readConfig(); | 335 | readConfig(); |
338 | inputMethods->readConfig(); | 336 | inputMethods->readConfig(); |
339 | inputMethods->loadInputMethods(); | 337 | inputMethods->loadInputMethods(); |
340 | } else if ( msg == "reloadApplets()" ) { | 338 | } else if ( msg == "reloadApplets()" ) { |
341 | sysTray->clearApplets(); | 339 | sysTray->clearApplets(); |
342 | sm->createMenu(); | 340 | sm->createMenu(); |
343 | sysTray->addApplets(); | 341 | sysTray->addApplets(); |
344 | }else if ( msg == "toggleMenu()" ) { | 342 | }else if ( msg == "toggleMenu()" ) { |
345 | if ( sm-> launchMenu-> isVisible() ) | 343 | if ( sm-> launchMenu-> isVisible() ) |
346 | sm-> launch(); | 344 | sm-> launch(); |
347 | else | 345 | else |
348 | QCopEnvelope e( "QPE/System", "toggleApplicationMenu()" ); | 346 | QCopEnvelope e( "QPE/System", "toggleApplicationMenu()" ); |
349 | }else if ( msg == "toggleStartMenu()" ) | 347 | }else if ( msg == "toggleStartMenu()" ) |
350 | sm->launch(); | 348 | sm->launch(); |
351 | } | 349 | } |
352 | 350 | ||
353 | void TaskBar::setApplicationState( const QString &name, ServerInterface::ApplicationState state ) | 351 | void TaskBar::setApplicationState( const QString &name, ServerInterface::ApplicationState state ) |
354 | { | 352 | { |