author | mickeyl <mickeyl> | 2003-05-19 13:56:38 (UTC) |
---|---|---|
committer | mickeyl <mickeyl> | 2003-05-19 13:56:38 (UTC) |
commit | 75d4ec5369e4c5d64e3becaa2a31dd78a5f8f998 (patch) (unidiff) | |
tree | be80eb3ee447deab179dbc6ceb7ecbf04f77f5df /core | |
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 | 35 | ||||
-rw-r--r-- | core/launcher/taskbar.h | 2 |
2 files changed, 3 insertions, 34 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 | |||
@@ -44,53 +44,26 @@ | |||
44 | #include <qtimer.h> | 44 | #include <qtimer.h> |
45 | #include <qwindowsystem_qws.h> | 45 | #include <qwindowsystem_qws.h> |
46 | #include <qwidgetstack.h> | 46 | #include <qwidgetstack.h> |
47 | 47 | ||
48 | #if defined( Q_WS_QWS ) | 48 | #if defined( Q_WS_QWS ) |
49 | #include <qwsdisplay_qws.h> | 49 | #include <qwsdisplay_qws.h> |
50 | #include <qgfx_qws.h> | 50 | #include <qgfx_qws.h> |
51 | #endif | 51 | #endif |
52 | 52 | ||
53 | 53 | ||
54 | using namespace Opie; | 54 | using 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 | |||
77 | static Global::Command builtins[] = { | 56 | static 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 |
88 | #if !defined(QT_QWS_CASSIOPEIA) | 61 | #if !defined(QT_QWS_CASSIOPEIA) |
89 | { "shutdown", Global::shutdown, 1, 0 }, | 62 | { "shutdown", Global::shutdown, 1, 0 }, |
90 | // { "run", run, 1, 0 }, | 63 | // { "run", run, 1, 0 }, |
91 | #endif | 64 | #endif |
92 | 65 | ||
93 | { 0, TaskBar::calibrate, 0, 0 }, | 66 | { 0, TaskBar::calibrate, 0, 0 }, |
94 | }; | 67 | }; |
95 | 68 | ||
96 | static bool initNumLock() | 69 | static bool initNumLock() |
@@ -142,33 +115,29 @@ TaskBar::~TaskBar() | |||
142 | } | 115 | } |
143 | 116 | ||
144 | 117 | ||
145 | TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOnTop | WGroupLeader) | 118 | TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOnTop | WGroupLeader) |
146 | { | 119 | { |
147 | Global::setBuiltinCommands(builtins); | 120 | Global::setBuiltinCommands(builtins); |
148 | 121 | ||
149 | sm = new StartMenu( this ); | 122 | sm = new StartMenu( this ); |
150 | 123 | ||
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 | ||
166 | waitIcon = new Wait( this ); | 135 | waitIcon = new Wait( this ); |
167 | (void) new AppIcons( this ); | 136 | (void) new AppIcons( this ); |
168 | 137 | ||
169 | sysTray = new SysTray( this ); | 138 | sysTray = new SysTray( this ); |
170 | 139 | ||
171 | // ## make customizable in some way? | 140 | // ## make customizable in some way? |
172 | lockState = new LockKeyState( this ); | 141 | lockState = new LockKeyState( this ); |
173 | 142 | ||
174 | #if defined(Q_WS_QWS) | 143 | #if defined(Q_WS_QWS) |
@@ -264,24 +233,26 @@ void 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(); |
245 | } else if ( msg == "toggleInputMethod()" ) { | ||
246 | inputMethods->shown() ? inputMethods->hideInputMethod() : inputMethods->showInputMethod(); | ||
276 | } else if ( msg == "reloadApps()" ) { | 247 | } else if ( msg == "reloadApps()" ) { |
277 | sm->reloadApps(); | 248 | sm->reloadApps(); |
278 | } else if ( msg == "reloadApplets()" ) { | 249 | } else if ( msg == "reloadApplets()" ) { |
279 | sysTray->clearApplets(); | 250 | sysTray->clearApplets(); |
280 | sysTray->addApplets(); | 251 | sysTray->addApplets(); |
281 | sm->reloadApplets(); | 252 | sm->reloadApplets(); |
282 | } else if ( msg == "soundAlarm()" ) { | 253 | } else if ( msg == "soundAlarm()" ) { |
283 | DesktopApplication::soundAlarm ( ); | 254 | DesktopApplication::soundAlarm ( ); |
284 | } | 255 | } |
285 | else if ( msg == "setLed(int,bool)" ) { | 256 | else if ( msg == "setLed(int,bool)" ) { |
286 | int led, status; | 257 | int led, status; |
287 | stream >> led >> status; | 258 | stream >> led >> status; |
@@ -329,16 +300,16 @@ void TaskBar::toggleCapsLockState() | |||
329 | 300 | ||
330 | void TaskBar::toggleSymbolInput() | 301 | void TaskBar::toggleSymbolInput() |
331 | { | 302 | { |
332 | if ( inputMethods->currentShown() == "Unicode" ) { | 303 | if ( inputMethods->currentShown() == "Unicode" ) { |
333 | inputMethods->hideInputMethod(); | 304 | inputMethods->hideInputMethod(); |
334 | } else { | 305 | } else { |
335 | inputMethods->showInputMethod("Unicode"); | 306 | inputMethods->showInputMethod("Unicode"); |
336 | } | 307 | } |
337 | } | 308 | } |
338 | 309 | ||
339 | bool TaskBar::recoverMemory() | 310 | bool 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 | |||
@@ -19,25 +19,24 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #ifndef __TASKBAR_H__ | 21 | #ifndef __TASKBAR_H__ |
22 | #define __TASKBAR_H__ | 22 | #define __TASKBAR_H__ |
23 | 23 | ||
24 | #include <qhbox.h> | 24 | #include <qhbox.h> |
25 | 25 | ||
26 | class QLabel; | 26 | class QLabel; |
27 | class QTimer; | 27 | class QTimer; |
28 | class InputMethods; | 28 | class InputMethods; |
29 | class Wait; | 29 | class Wait; |
30 | class SysTray; | 30 | class SysTray; |
31 | //class MRUList; | ||
32 | class RunningAppBar; | 31 | class RunningAppBar; |
33 | class QWidgetStack; | 32 | class QWidgetStack; |
34 | class QTimer; | 33 | class QTimer; |
35 | class QLabel; | 34 | class QLabel; |
36 | class StartMenu; | 35 | class StartMenu; |
37 | class LockKeyState; | 36 | class LockKeyState; |
38 | 37 | ||
39 | class TaskBar : public QHBox { | 38 | class TaskBar : public QHBox { |
40 | Q_OBJECT | 39 | Q_OBJECT |
41 | public: | 40 | public: |
42 | TaskBar(); | 41 | TaskBar(); |
43 | ~TaskBar(); | 42 | ~TaskBar(); |
@@ -63,23 +62,22 @@ protected: | |||
63 | 62 | ||
64 | public slots: | 63 | public slots: |
65 | void calcMaxWindowRect(); | 64 | void calcMaxWindowRect(); |
66 | private slots: | 65 | private slots: |
67 | void receive( const QCString &msg, const QByteArray &data ); | 66 | void receive( const QCString &msg, const QByteArray &data ); |
68 | 67 | ||
69 | private: | 68 | private: |
70 | 69 | ||
71 | QTimer *waitTimer; | 70 | QTimer *waitTimer; |
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; |
79 | QLabel *label; | 77 | QLabel *label; |
80 | LockKeyState* lockState; | 78 | LockKeyState* lockState; |
81 | StartMenu *sm; | 79 | StartMenu *sm; |
82 | }; | 80 | }; |
83 | 81 | ||
84 | 82 | ||
85 | #endif // __TASKBAR_H__ | 83 | #endif // __TASKBAR_H__ |