-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 @@ -193,194 +193,192 @@ TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOn runningAppBar = new RunningAppBar(stack); stack->raiseWidget(runningAppBar); waitIcon = new Wait( this ); (void) new AppIcons( this ); sysTray = new SysTray( this ); /* ### FIXME plugin loader and safe mode */ #if 0 if (PluginLoader::inSafeMode()) (void)new SafeMode( this ); #endif // ## make customizable in some way? #ifdef OPIE_TASKBAR_LOCK_KEY_STATE lockState = new LockKeyState( this ); #else lockState = 0; #endif #if defined(Q_WS_QWS) #if !defined(QT_NO_COP) QCopChannel *channel = new QCopChannel( "QPE/TaskBar", this ); connect( channel, SIGNAL(received(const QCString&,const QByteArray&)), this, SLOT(receive(const QCString&,const QByteArray&)) ); #endif #endif waitTimer = new QTimer( this ); connect( waitTimer, SIGNAL( timeout() ), this, SLOT( stopWait() ) ); clearer = new QTimer( this ); QObject::connect(clearer, SIGNAL(timeout()), SLOT(clearStatusBar())); connect( qApp, SIGNAL(symbol()), this, SLOT(toggleSymbolInput()) ); connect( qApp, SIGNAL(numLockStateToggle()), this, SLOT(toggleNumLockState()) ); connect( qApp, SIGNAL(capsLockStateToggle()), this, SLOT(toggleCapsLockState()) ); } void TaskBar::setStatusMessage( const QString &text ) { if ( !text.isEmpty() ) { label->setText( text ); stack->raiseWidget( label ); if ( sysTray && ( label->fontMetrics().width( text ) > label->width() ) ) sysTray->hide(); clearer->start( 3000, TRUE ); } else { clearStatusBar(); } } void TaskBar::clearStatusBar() { label->clear(); stack->raiseWidget(runningAppBar); if ( sysTray ) sysTray->show(); // stack->raiseWidget( mru ); } void TaskBar::startWait() { waitIcon->setWaiting( true ); // a catchall stop after 10 seconds... waitTimer->start( 10 * 1000, true ); } void TaskBar::stopWait(const QString&) { waitTimer->stop(); waitIcon->setWaiting( false ); } void TaskBar::stopWait() { waitTimer->stop(); waitIcon->setWaiting( false ); } /* * This resizeEvent will be captured by * the ServerInterface and it'll layout * and calc rect. Now if we go from bigger * to smaller screen the SysTray is out of * bounds and repaint() won't trigger an Event */ void TaskBar::resizeEvent( QResizeEvent *e ) { if ( sysTray ) sysTray->hide(); QHBox::resizeEvent( e ); if ( sysTray ) sysTray->show(); - - owarn << "TaskBar::resize event" << oendl; } void TaskBar::styleChange( QStyle &s ) { QHBox::styleChange( s ); calcMaxWindowRect(); } void TaskBar::calcMaxWindowRect() { if ( resizeRunningApp ) { #if defined(Q_WS_QWS) QRect wr; int displayWidth = qApp->desktop()->width(); QRect ir = inputMethods->inputRect(); if ( ir.isValid() ) { wr.setCoords( 0, 0, displayWidth-1, ir.top()-1 ); } else { wr.setCoords( 0, 0, displayWidth-1, y()-1 ); } #if QT_VERSION < 0x030000 QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr,QSize(qt_screen->width(),qt_screen->height())) ); #else QWSServer::setMaxWindowRect( wr ); #endif #endif } } void TaskBar::receive( const QCString &msg, const QByteArray &data ) { QDataStream stream( data, IO_ReadOnly ); if ( msg == "message(QString)" ) { QString text; stream >> text; setStatusMessage( text ); } else if ( msg == "hideInputMethod()" ) { inputMethods->hideInputMethod(); } else if ( msg == "showInputMethod()" ) { inputMethods->showInputMethod(); } else if ( msg == "showInputMethod(QString)" ) { QString name; stream >> name; inputMethods->showInputMethod(name); } else if ( msg == "reloadInputMethods()" ) { readConfig(); inputMethods->readConfig(); inputMethods->loadInputMethods(); } else if ( msg == "reloadApplets()" ) { sysTray->clearApplets(); sm->createMenu(); sysTray->addApplets(); }else if ( msg == "toggleMenu()" ) { if ( sm-> launchMenu-> isVisible() ) sm-> launch(); else QCopEnvelope e( "QPE/System", "toggleApplicationMenu()" ); }else if ( msg == "toggleStartMenu()" ) sm->launch(); } void TaskBar::setApplicationState( const QString &name, ServerInterface::ApplicationState state ) { if ( state == ServerInterface::Launching ) runningAppBar->applicationLaunched( name ); else if ( state == ServerInterface::Terminated ) runningAppBar->applicationTerminated( name ); } void TaskBar::toggleNumLockState() { if ( lockState ) lockState->toggleNumLockState(); } void TaskBar::toggleCapsLockState() { if ( lockState ) lockState->toggleCapsLockState(); } void TaskBar::toggleSymbolInput() { QString unicodeInput = qApp->translate( "InputMethods", "Unicode" ); if ( inputMethods->currentShown() == unicodeInput ) { inputMethods->hideInputMethod(); } else { inputMethods->showInputMethod( unicodeInput ); } } void TaskBar::readConfig() { Config cfg( "Launcher" ); cfg.setGroup( "InputMethods" ); resizeRunningApp = cfg.readBoolEntry( "Resize", true ); } |