summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/taskbar.cpp119
-rw-r--r--core/launcher/taskbar.h2
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
@@ -53,35 +53,8 @@
53 53
54using namespace Opie; 54using namespace Opie;
55 55
56#define FACTORY(T) \
57 static QWidget *new##T( bool maximized ) { \
58 QWidget *w = new T( 0, "test", QWidget::WDestructiveClose | QWidget::WGroupLeader ); \
59 if ( maximized ) { \
60 if ( qApp->desktop()->width() <= 350 ) { \
61 w->showMaximized(); \
62 } else { \
63 w->resize( QSize( 300, 300 ) ); \
64 } \
65 } \
66 w->show(); \
67 return w; \
68 }
69
70
71#ifdef SINGLE_APP
72#define APP(a,b,c,d) FACTORY(b)
73#include "../launcher/apps.h"
74#undef APP
75#endif // SINGLE_APP
76
77static Global::Command builtins[] = { 56static Global::Command builtins[] = {
78 57
79#ifdef SINGLE_APP
80#define APP(a,b,c,d) { a, new##b, c },
81#include "../launcher/apps.h"
82#undef APP
83#endif
84
85#if defined(QT_QWS_IPAQ) || defined(QT_QWS_CASSIOPEIA) || defined(QT_QWS_SL5XXX) 58#if defined(QT_QWS_IPAQ) || defined(QT_QWS_CASSIOPEIA) || defined(QT_QWS_SL5XXX)
86 { "calibrate", TaskBar::calibrate, 1, 0 }, 59 { "calibrate", TaskBar::calibrate, 1, 0 },
87#endif 60#endif
@@ -151,15 +124,11 @@ TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOn
151 inputMethods = new InputMethods( this ); 124 inputMethods = new InputMethods( this );
152 connect( inputMethods, SIGNAL(inputToggled(bool)), 125 connect( inputMethods, SIGNAL(inputToggled(bool)),
153 this, SLOT(calcMaxWindowRect()) ); 126 this, SLOT(calcMaxWindowRect()) );
154 //new QuickLauncher( this );
155 127
156 stack = new QWidgetStack( this ); 128 stack = new QWidgetStack( this );
157 stack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) ); 129 stack->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Minimum ) );
158 label = new QLabel(stack); 130 label = new QLabel(stack);
159 131
160 //mru = new MRUList( stack );
161 //stack->raiseWidget( mru );
162
163 runningAppBar = new RunningAppBar(stack); 132 runningAppBar = new RunningAppBar(stack);
164 stack->raiseWidget(runningAppBar); 133 stack->raiseWidget(runningAppBar);
165 134
@@ -262,48 +231,50 @@ void TaskBar::calcMaxWindowRect()
262 231
263void TaskBar::receive( const QCString &msg, const QByteArray &data ) 232void TaskBar::receive( const QCString &msg, const QByteArray &data )
264{ 233{
265 QDataStream stream( data, IO_ReadOnly ); 234 QDataStream stream( data, IO_ReadOnly );
266 if ( msg == "message(QString)" ) { 235 if ( msg == "message(QString)" ) {
267 QString text; 236 QString text;
268 stream >> text; 237 stream >> text;
269 setStatusMessage( text ); 238 setStatusMessage( text );
270 } else if ( msg == "hideInputMethod()" ) { 239 } else if ( msg == "hideInputMethod()" ) {
271 inputMethods->hideInputMethod(); 240 inputMethods->hideInputMethod();
272 } else if ( msg == "showInputMethod()" ) { 241 } else if ( msg == "showInputMethod()" ) {
273 inputMethods->showInputMethod(); 242 inputMethods->showInputMethod();
274 } else if ( msg == "reloadInputMethods()" ) { 243 } else if ( msg == "reloadInputMethods()" ) {
275 inputMethods->loadInputMethods(); 244 inputMethods->loadInputMethods();
276 } else if ( msg == "reloadApps()" ) { 245 } else if ( msg == "toggleInputMethod()" ) {
277 sm->reloadApps(); 246 inputMethods->shown() ? inputMethods->hideInputMethod() : inputMethods->showInputMethod();
278 } else if ( msg == "reloadApplets()" ) { 247 } else if ( msg == "reloadApps()" ) {
279 sysTray->clearApplets(); 248 sm->reloadApps();
280 sysTray->addApplets(); 249 } else if ( msg == "reloadApplets()" ) {
281 sm->reloadApplets(); 250 sysTray->clearApplets();
282 } else if ( msg == "soundAlarm()" ) { 251 sysTray->addApplets();
283 DesktopApplication::soundAlarm ( ); 252 sm->reloadApplets();
284 } 253 } else if ( msg == "soundAlarm()" ) {
285 else if ( msg == "setLed(int,bool)" ) { 254 DesktopApplication::soundAlarm ( );
286 int led, status; 255 }
287 stream >> led >> status; 256 else if ( msg == "setLed(int,bool)" ) {
288 257 int led, status;
289 QValueList <OLed> ll = ODevice::inst ( )-> ledList ( ); 258 stream >> led >> status;
290 if ( ll. count ( )){ 259
291 OLed l = ll. contains ( Led_Mail ) ? Led_Mail : ll [0]; 260 QValueList <OLed> ll = ODevice::inst ( )-> ledList ( );
292 bool canblink = ODevice::inst ( )-> ledStateList ( l ). contains ( Led_BlinkSlow ); 261 if ( ll. count ( )){
293 262 OLed l = ll. contains ( Led_Mail ) ? Led_Mail : ll [0];
294 ODevice::inst ( )-> setLedState ( l, status ? ( canblink ? Led_BlinkSlow : Led_On ) : Led_Off ); 263 bool canblink = ODevice::inst ( )-> ledStateList ( l ). contains ( Led_BlinkSlow );
295 } 264
296 } 265 ODevice::inst ( )-> setLedState ( l, status ? ( canblink ? Led_BlinkSlow : Led_On ) : Led_Off );
297 else if ( msg == "toggleMenu()" ) { 266 }
298 if ( sm-> launchMenu-> isVisible ( )) 267 }
299 sm-> launch ( ); 268 else if ( msg == "toggleMenu()" ) {
300 else { 269 if ( sm-> launchMenu-> isVisible ( ))
301 QCopEnvelope e ( "QPE/System", "toggleApplicationMenu()" ); 270 sm-> launch ( );
302 } 271 else {
303 } 272 QCopEnvelope e ( "QPE/System", "toggleApplicationMenu()" );
304 else if ( msg == "toggleStartMenu()" ) { 273 }
305 sm-> launch ( ); 274 }
306 } 275 else if ( msg == "toggleStartMenu()" ) {
276 sm-> launch ( );
277 }
307} 278}
308 279
309QWidget *TaskBar::calibrate(bool) 280QWidget *TaskBar::calibrate(bool)
@@ -338,7 +309,7 @@ void TaskBar::toggleSymbolInput()
338 309
339bool TaskBar::recoverMemory() 310bool TaskBar::recoverMemory()
340{ 311{
341 //eturn mru->quitOldApps(); 312 //mru->quitOldApps() is no longer supported
342 return true; 313 return true;
343} 314}
344 315
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
@@ -28,7 +28,6 @@ class QTimer;
28class InputMethods; 28class InputMethods;
29class Wait; 29class Wait;
30class SysTray; 30class SysTray;
31//class MRUList;
32class RunningAppBar; 31class RunningAppBar;
33class QWidgetStack; 32class QWidgetStack;
34class QTimer; 33class QTimer;
@@ -72,7 +71,6 @@ private:
72 Wait *waitIcon; 71 Wait *waitIcon;
73 InputMethods *inputMethods; 72 InputMethods *inputMethods;
74 SysTray *sysTray; 73 SysTray *sysTray;
75 // MRUList *mru;
76 RunningAppBar* runningAppBar; 74 RunningAppBar* runningAppBar;
77 QWidgetStack *stack; 75 QWidgetStack *stack;
78 QTimer *clearer; 76 QTimer *clearer;