-rw-r--r-- | core/launcher/taskbar.cpp | 35 |
1 files changed, 3 insertions, 32 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 | |||
@@ -50,41 +50,14 @@ | |||
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 }, |
@@ -148,21 +121,17 @@ TaskBar::TaskBar() : QHBox(0, 0, WStyle_Customize | WStyle_Tool | WStyle_StaysOn | |||
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 | ||
@@ -270,12 +239,14 @@ void TaskBar::receive( const QCString &msg, const QByteArray &data ) | |||
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(); |
@@ -335,10 +306,10 @@ void TaskBar::toggleSymbolInput() | |||
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 | ||