author | mickeyl <mickeyl> | 2003-05-19 13:56:38 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-05-19 13:56:38 (UTC) |
commit | 75d4ec5369e4c5d64e3becaa2a31dd78a5f8f998 (patch) (side-by-side diff) | |
tree | be80eb3ee447deab179dbc6ceb7ecbf04f77f5df | |
parent | 250291019cac863e50ffce981a9c93b627448253 (diff) | |
download | opie-75d4ec5369e4c5d64e3becaa2a31dd78a5f8f998.zip opie-75d4ec5369e4c5d64e3becaa2a31dd78a5f8f998.tar.gz opie-75d4ec5369e4c5d64e3becaa2a31dd78a5f8f998.tar.bz2 |
- remove dangling SINGLE_APP support leftovers
- add new QCOP message toggleInputMethod() which is especially interesting for the use with opie-buttonsettings
-rw-r--r-- | core/launcher/taskbar.cpp | 119 | ||||
-rw-r--r-- | core/launcher/taskbar.h | 2 |
2 files changed, 45 insertions, 76 deletions
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp index 8af568d..feeba79 100644 --- a/core/launcher/taskbar.cpp +++ b/core/launcher/taskbar.cpp @@ -40,61 +40,34 @@ #include <opie/odevice.h> #include <qlabel.h> #include <qlayout.h> #include <qtimer.h> #include <qwindowsystem_qws.h> #include <qwidgetstack.h> #if defined( Q_WS_QWS ) #include <qwsdisplay_qws.h> #include <qgfx_qws.h> #endif using namespace Opie; -#define FACTORY(T) \ - static QWidget *new##T( bool maximized ) { \ - QWidget *w = new T( 0, "test", QWidget::WDestructiveClose | QWidget::WGroupLeader ); \ - if ( maximized ) { \ - if ( qApp->desktop()->width() <= 350 ) { \ - w->showMaximized(); \ - } else { \ - w->resize( QSize( 300, 300 ) ); \ - } \ - } \ - w->show(); \ - return w; \ - } - - -#ifdef SINGLE_APP -#define APP(a,b,c,d) FACTORY(b) -#include "../launcher/apps.h" -#undef APP -#endif // SINGLE_APP - static Global::Command builtins[] = { -#ifdef SINGLE_APP -#define APP(a,b,c,d) { a, new##b, c }, -#include "../launcher/apps.h" -#undef APP -#endif - #if defined(QT_QWS_IPAQ) || defined(QT_QWS_CASSIOPEIA) || defined(QT_QWS_SL5XXX) { "calibrate", TaskBar::calibrate, 1, 0 }, #endif #if !defined(QT_QWS_CASSIOPEIA) { "shutdown", Global::shutdown, 1, 0 }, // { "run", run, 1, 0 }, #endif { 0, TaskBar::calibrate, 0, 0 }, }; static bool initNumLock() { #ifdef QPE_INITIAL_NUMLOCK_STATE QPE_INITIAL_NUMLOCK_STATE #endif @@ -138,41 +111,37 @@ private: }; TaskBar::~TaskBar() { } TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOnTop | WGroupLeader) { Global::setBuiltinCommands(builtins); sm = new StartMenu( this ); inputMethods = new InputMethods( this ); connect( inputMethods, SIGNAL(inputToggled(bool)), this, SLOT(calcMaxWindowRect()) ); - //new QuickLauncher( this ); stack = new QWidgetStack( this ); stack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); label = new QLabel(stack); - //mru = new MRUList( stack ); - //stack->raiseWidget( mru ); - runningAppBar = new RunningAppBar(stack); stack->raiseWidget(runningAppBar); waitIcon = new Wait( this ); (void) new AppIcons( this ); sysTray = new SysTray( this ); // ## make customizable in some way? lockState = new LockKeyState( this ); #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&)) ); @@ -249,74 +218,76 @@ void TaskBar::calcMaxWindowRect() } else { wr.setCoords( 0, 0, displayWidth-1, y()-1 ); } #if QT_VERSION < 300 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 == "reloadInputMethods()" ) { - inputMethods->loadInputMethods(); - } else if ( msg == "reloadApps()" ) { - sm->reloadApps(); - } else if ( msg == "reloadApplets()" ) { - sysTray->clearApplets(); - sysTray->addApplets(); - sm->reloadApplets(); - } else if ( msg == "soundAlarm()" ) { - DesktopApplication::soundAlarm ( ); - } - else if ( msg == "setLed(int,bool)" ) { - int led, status; - stream >> led >> status; - - QValueList <OLed> ll = ODevice::inst ( )-> ledList ( ); - if ( ll. count ( )) { - OLed l = ll. contains ( Led_Mail ) ? Led_Mail : ll [0]; - bool canblink = ODevice::inst ( )-> ledStateList ( l ). contains ( Led_BlinkSlow ); - - ODevice::inst ( )-> setLedState ( l, status ? ( canblink ? Led_BlinkSlow : Led_On ) : Led_Off ); - } - } - else if ( msg == "toggleMenu()" ) { - if ( sm-> launchMenu-> isVisible ( )) - sm-> launch ( ); - else { - QCopEnvelope e ( "QPE/System", "toggleApplicationMenu()" ); - } - } - else if ( msg == "toggleStartMenu()" ) { - sm-> launch ( ); - } + 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 == "reloadInputMethods()" ) { + inputMethods->loadInputMethods(); + } else if ( msg == "toggleInputMethod()" ) { + inputMethods->shown() ? inputMethods->hideInputMethod() : inputMethods->showInputMethod(); + } else if ( msg == "reloadApps()" ) { + sm->reloadApps(); + } else if ( msg == "reloadApplets()" ) { + sysTray->clearApplets(); + sysTray->addApplets(); + sm->reloadApplets(); + } else if ( msg == "soundAlarm()" ) { + DesktopApplication::soundAlarm ( ); + } + else if ( msg == "setLed(int,bool)" ) { + int led, status; + stream >> led >> status; + + QValueList <OLed> ll = ODevice::inst ( )-> ledList ( ); + if ( ll. count ( )) { + OLed l = ll. contains ( Led_Mail ) ? Led_Mail : ll [0]; + bool canblink = ODevice::inst ( )-> ledStateList ( l ). contains ( Led_BlinkSlow ); + + ODevice::inst ( )-> setLedState ( l, status ? ( canblink ? Led_BlinkSlow : Led_On ) : Led_Off ); + } + } + else if ( msg == "toggleMenu()" ) { + if ( sm-> launchMenu-> isVisible ( )) + sm-> launch ( ); + else { + QCopEnvelope e ( "QPE/System", "toggleApplicationMenu()" ); + } + } + else if ( msg == "toggleStartMenu()" ) { + sm-> launch ( ); + } } QWidget *TaskBar::calibrate(bool) { #ifdef Q_WS_QWS Calibrate *c = new Calibrate; c->show(); return c; #else return 0; #endif } void TaskBar::toggleNumLockState() { if ( lockState ) lockState->toggleNumLockState(); @@ -325,20 +296,20 @@ void TaskBar::toggleNumLockState() void TaskBar::toggleCapsLockState() { if ( lockState ) lockState->toggleCapsLockState(); } void TaskBar::toggleSymbolInput() { if ( inputMethods->currentShown() == "Unicode" ) { inputMethods->hideInputMethod(); } else { inputMethods->showInputMethod("Unicode"); } } bool TaskBar::recoverMemory() { - //eturn mru->quitOldApps(); + //mru->quitOldApps() is no longer supported return true; } diff --git a/core/launcher/taskbar.h b/core/launcher/taskbar.h index a0bf395..0cfc123 100644 --- a/core/launcher/taskbar.h +++ b/core/launcher/taskbar.h @@ -15,33 +15,32 @@ ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #ifndef __TASKBAR_H__ #define __TASKBAR_H__ #include <qhbox.h> class QLabel; class QTimer; class InputMethods; class Wait; class SysTray; -//class MRUList; class RunningAppBar; class QWidgetStack; class QTimer; class QLabel; class StartMenu; class LockKeyState; class TaskBar : public QHBox { Q_OBJECT public: TaskBar(); ~TaskBar(); static QWidget *calibrate( bool ); bool recoverMemory(); @@ -59,27 +58,26 @@ public slots: protected: void resizeEvent( QResizeEvent * ); void styleChange( QStyle & ); void setStatusMessage( const QString &text ); public slots: void calcMaxWindowRect(); private slots: void receive( const QCString &msg, const QByteArray &data ); private: QTimer *waitTimer; Wait *waitIcon; InputMethods *inputMethods; SysTray *sysTray; - // MRUList *mru; RunningAppBar* runningAppBar; QWidgetStack *stack; QTimer *clearer; QLabel *label; LockKeyState* lockState; StartMenu *sm; }; #endif // __TASKBAR_H__ |