summaryrefslogtreecommitdiff
path: root/core/launcher/taskbar.cpp
Unidiff
Diffstat (limited to 'core/launcher/taskbar.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/taskbar.cpp17
1 files changed, 1 insertions, 16 deletions
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp
index 8af568d..8158128 100644
--- a/core/launcher/taskbar.cpp
+++ b/core/launcher/taskbar.cpp
@@ -1,49 +1,48 @@
1/********************************************************************** 1/**********************************************************************
2** Copyright (C) 2000 Trolltech AS. All rights reserved. 2** Copyright (C) 2000 Trolltech AS. All rights reserved.
3** 3**
4** This file is part of Qtopia Environment. 4** This file is part of Qtopia Environment.
5** 5**
6** This file may be distributed and/or modified under the terms of the 6** This file may be distributed and/or modified under the terms of the
7** GNU General Public License version 2 as published by the Free Software 7** GNU General Public License version 2 as published by the Free Software
8** Foundation and appearing in the file LICENSE.GPL included in the 8** Foundation and appearing in the file LICENSE.GPL included in the
9** packaging of this file. 9** packaging of this file.
10** 10**
11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE 11** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. 12** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
13** 13**
14** See http://www.trolltech.com/gpl/ for GPL licensing information. 14** See http://www.trolltech.com/gpl/ for GPL licensing information.
15** 15**
16** Contact info@trolltech.com if any conditions of this licensing are 16** Contact info@trolltech.com if any conditions of this licensing are
17** not clear to you. 17** not clear to you.
18** 18**
19*********************************************************************/ 19*********************************************************************/
20 20
21#include "startmenu.h" 21#include "startmenu.h"
22#include "inputmethods.h" 22#include "inputmethods.h"
23#include "runningappbar.h" 23#include "runningappbar.h"
24#include "systray.h" 24#include "systray.h"
25#include "calibrate.h"
26#include "wait.h" 25#include "wait.h"
27#include "appicons.h" 26#include "appicons.h"
28 27
29#include "taskbar.h" 28#include "taskbar.h"
30#include "desktop.h" 29#include "desktop.h"
31 30
32#include <qpe/qpeapplication.h> 31#include <qpe/qpeapplication.h>
33#include <qpe/qcopenvelope_qws.h> 32#include <qpe/qcopenvelope_qws.h>
34#include <qpe/global.h> 33#include <qpe/global.h>
35 34
36#if defined( QT_QWS_SL5XXX ) || defined( QT_QWS_IPAQ ) 35#if defined( QT_QWS_SL5XXX ) || defined( QT_QWS_IPAQ )
37#include <qpe/custom.h> 36#include <qpe/custom.h>
38#endif 37#endif
39 38
40#include <opie/odevice.h> 39#include <opie/odevice.h>
41 40
42#include <qlabel.h> 41#include <qlabel.h>
43#include <qlayout.h> 42#include <qlayout.h>
44#include <qtimer.h> 43#include <qtimer.h>
45#include <qwindowsystem_qws.h> 44#include <qwindowsystem_qws.h>
46#include <qwidgetstack.h> 45#include <qwidgetstack.h>
47 46
48#if defined( Q_WS_QWS ) 47#if defined( Q_WS_QWS )
49#include <qwsdisplay_qws.h> 48#include <qwsdisplay_qws.h>
@@ -61,57 +60,54 @@ using namespace Opie;
61 w->showMaximized(); \ 60 w->showMaximized(); \
62 } else { \ 61 } else { \
63 w->resize( QSize( 300, 300 ) ); \ 62 w->resize( QSize( 300, 300 ) ); \
64 } \ 63 } \
65 } \ 64 } \
66 w->show(); \ 65 w->show(); \
67 return w; \ 66 return w; \
68 } 67 }
69 68
70 69
71#ifdef SINGLE_APP 70#ifdef SINGLE_APP
72#define APP(a,b,c,d) FACTORY(b) 71#define APP(a,b,c,d) FACTORY(b)
73#include "../launcher/apps.h" 72#include "../launcher/apps.h"
74#undef APP 73#undef APP
75#endif // SINGLE_APP 74#endif // SINGLE_APP
76 75
77static Global::Command builtins[] = { 76static Global::Command builtins[] = {
78 77
79#ifdef SINGLE_APP 78#ifdef SINGLE_APP
80#define APP(a,b,c,d) { a, new##b, c }, 79#define APP(a,b,c,d) { a, new##b, c },
81#include "../launcher/apps.h" 80#include "../launcher/apps.h"
82#undef APP 81#undef APP
83#endif 82#endif
84 83
85#if defined(QT_QWS_IPAQ) || defined(QT_QWS_CASSIOPEIA) || defined(QT_QWS_SL5XXX)
86 { "calibrate", TaskBar::calibrate, 1, 0 },
87#endif
88#if !defined(QT_QWS_CASSIOPEIA) 84#if !defined(QT_QWS_CASSIOPEIA)
89 { "shutdown", Global::shutdown, 1, 0 }, 85 { "shutdown", Global::shutdown, 1, 0 },
90// { "run", run, 1, 0 }, 86// { "run", run, 1, 0 },
91#endif 87#endif
92 88
93 { 0, TaskBar::calibrate, 0, 0 }, 89 { 0, 0, 0, 0 },
94}; 90};
95 91
96static bool initNumLock() 92static bool initNumLock()
97{ 93{
98#ifdef QPE_INITIAL_NUMLOCK_STATE 94#ifdef QPE_INITIAL_NUMLOCK_STATE
99 QPE_INITIAL_NUMLOCK_STATE 95 QPE_INITIAL_NUMLOCK_STATE
100#endif 96#endif
101 return FALSE; 97 return FALSE;
102} 98}
103 99
104class LockKeyState : public QWidget 100class LockKeyState : public QWidget
105{ 101{
106public: 102public:
107 LockKeyState( QWidget *parent ) : 103 LockKeyState( QWidget *parent ) :
108 QWidget(parent), 104 QWidget(parent),
109 nl(initNumLock()), cl(FALSE) 105 nl(initNumLock()), cl(FALSE)
110 { 106 {
111 nl_pm = Resource::loadPixmap("numlock"); 107 nl_pm = Resource::loadPixmap("numlock");
112 cl_pm = Resource::loadPixmap("capslock"); 108 cl_pm = Resource::loadPixmap("capslock");
113 } 109 }
114 QSize sizeHint() const 110 QSize sizeHint() const
115 { 111 {
116 return QSize(nl_pm.width()+2,nl_pm.width()+nl_pm.height()+1); 112 return QSize(nl_pm.width()+2,nl_pm.width()+nl_pm.height()+1);
117 } 113 }
@@ -285,59 +281,48 @@ void TaskBar::receive( const QCString &msg, const QByteArray &data )
285 else if ( msg == "setLed(int,bool)" ) { 281 else if ( msg == "setLed(int,bool)" ) {
286 int led, status; 282 int led, status;
287 stream >> led >> status; 283 stream >> led >> status;
288 284
289 QValueList <OLed> ll = ODevice::inst ( )-> ledList ( ); 285 QValueList <OLed> ll = ODevice::inst ( )-> ledList ( );
290 if ( ll. count ( )){ 286 if ( ll. count ( )){
291 OLed l = ll. contains ( Led_Mail ) ? Led_Mail : ll [0]; 287 OLed l = ll. contains ( Led_Mail ) ? Led_Mail : ll [0];
292 bool canblink = ODevice::inst ( )-> ledStateList ( l ). contains ( Led_BlinkSlow ); 288 bool canblink = ODevice::inst ( )-> ledStateList ( l ). contains ( Led_BlinkSlow );
293 289
294 ODevice::inst ( )-> setLedState ( l, status ? ( canblink ? Led_BlinkSlow : Led_On ) : Led_Off ); 290 ODevice::inst ( )-> setLedState ( l, status ? ( canblink ? Led_BlinkSlow : Led_On ) : Led_Off );
295 } 291 }
296 } 292 }
297 else if ( msg == "toggleMenu()" ) { 293 else if ( msg == "toggleMenu()" ) {
298 if ( sm-> launchMenu-> isVisible ( )) 294 if ( sm-> launchMenu-> isVisible ( ))
299 sm-> launch ( ); 295 sm-> launch ( );
300 else { 296 else {
301 QCopEnvelope e ( "QPE/System", "toggleApplicationMenu()" ); 297 QCopEnvelope e ( "QPE/System", "toggleApplicationMenu()" );
302 } 298 }
303 } 299 }
304 else if ( msg == "toggleStartMenu()" ) { 300 else if ( msg == "toggleStartMenu()" ) {
305 sm-> launch ( ); 301 sm-> launch ( );
306 } 302 }
307} 303}
308 304
309QWidget *TaskBar::calibrate(bool)
310{
311#ifdef Q_WS_QWS
312 Calibrate *c = new Calibrate;
313 c->show();
314 return c;
315#else
316 return 0;
317#endif
318}
319
320void TaskBar::toggleNumLockState() 305void TaskBar::toggleNumLockState()
321{ 306{
322 if ( lockState ) lockState->toggleNumLockState(); 307 if ( lockState ) lockState->toggleNumLockState();
323} 308}
324 309
325void TaskBar::toggleCapsLockState() 310void TaskBar::toggleCapsLockState()
326{ 311{
327 if ( lockState ) lockState->toggleCapsLockState(); 312 if ( lockState ) lockState->toggleCapsLockState();
328} 313}
329 314
330void TaskBar::toggleSymbolInput() 315void TaskBar::toggleSymbolInput()
331{ 316{
332 if ( inputMethods->currentShown() == "Unicode" ) { 317 if ( inputMethods->currentShown() == "Unicode" ) {
333 inputMethods->hideInputMethod(); 318 inputMethods->hideInputMethod();
334 } else { 319 } else {
335 inputMethods->showInputMethod("Unicode"); 320 inputMethods->showInputMethod("Unicode");
336 } 321 }
337} 322}
338 323
339bool TaskBar::recoverMemory() 324bool TaskBar::recoverMemory()
340{ 325{
341 //eturn mru->quitOldApps(); 326 //eturn mru->quitOldApps();
342 return true; 327 return true;
343} 328}