author | sandman <sandman> | 2002-09-12 01:16:41 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-09-12 01:16:41 (UTC) |
commit | 151987f8e0b7a179cf45032cc2ec5b4360023890 (patch) (unidiff) | |
tree | ea750ecfe96f7a30759d9bee7151602f02dec8cf | |
parent | b89a7559465274c3efb0a8258cecf22a185b123f (diff) | |
download | opie-151987f8e0b7a179cf45032cc2ec5b4360023890.zip opie-151987f8e0b7a179cf45032cc2ec5b4360023890.tar.gz opie-151987f8e0b7a179cf45032cc2ec5b4360023890.tar.bz2 |
- really remove mrulist
- new version of systray, which supports the Exclude list to hide applets
-rw-r--r-- | core/launcher/launcher.pro | 2 | ||||
-rw-r--r-- | core/launcher/main.cpp | 2 | ||||
-rw-r--r-- | core/launcher/systray.cpp | 103 | ||||
-rw-r--r-- | core/launcher/systray.h | 13 | ||||
-rw-r--r-- | core/launcher/taskbar.cpp | 4 |
5 files changed, 83 insertions, 41 deletions
diff --git a/core/launcher/launcher.pro b/core/launcher/launcher.pro index 0e557aa..dbe3820 100644 --- a/core/launcher/launcher.pro +++ b/core/launcher/launcher.pro | |||
@@ -1,78 +1,76 @@ | |||
1 | TEMPLATE= app | 1 | TEMPLATE= app |
2 | CONFIG = qt warn_on release | 2 | CONFIG = qt warn_on release |
3 | DESTDIR = ../../bin | 3 | DESTDIR = ../../bin |
4 | HEADERS = background.h \ | 4 | HEADERS = background.h \ |
5 | desktop.h \ | 5 | desktop.h \ |
6 | qprocess.h \ | 6 | qprocess.h \ |
7 | mediummountgui.h \ | 7 | mediummountgui.h \ |
8 | info.h \ | 8 | info.h \ |
9 | appicons.h \ | 9 | appicons.h \ |
10 | taskbar.h \ | 10 | taskbar.h \ |
11 | sidething.h \ | 11 | sidething.h \ |
12 | mrulist.h \ | ||
13 | runningappbar.h \ | 12 | runningappbar.h \ |
14 | stabmon.h \ | 13 | stabmon.h \ |
15 | inputmethods.h \ | 14 | inputmethods.h \ |
16 | systray.h \ | 15 | systray.h \ |
17 | wait.h \ | 16 | wait.h \ |
18 | shutdownimpl.h \ | 17 | shutdownimpl.h \ |
19 | launcher.h \ | 18 | launcher.h \ |
20 | launcherview.h \ | 19 | launcherview.h \ |
21 | ../../core/apps/calibrate/calibrate.h \ | 20 | ../../core/apps/calibrate/calibrate.h \ |
22 | startmenu.h \ | 21 | startmenu.h \ |
23 | transferserver.h \ | 22 | transferserver.h \ |
24 | qcopbridge.h \ | 23 | qcopbridge.h \ |
25 | packageslave.h \ | 24 | packageslave.h \ |
26 | irserver.h \ | 25 | irserver.h \ |
27 | ../../rsync/buf.h \ | 26 | ../../rsync/buf.h \ |
28 | ../../rsync/checksum.h \ | 27 | ../../rsync/checksum.h \ |
29 | ../../rsync/command.h \ | 28 | ../../rsync/command.h \ |
30 | ../../rsync/emit.h \ | 29 | ../../rsync/emit.h \ |
31 | ../../rsync/job.h \ | 30 | ../../rsync/job.h \ |
32 | ../../rsync/netint.h \ | 31 | ../../rsync/netint.h \ |
33 | ../../rsync/protocol.h \ | 32 | ../../rsync/protocol.h \ |
34 | ../../rsync/prototab.h \ | 33 | ../../rsync/prototab.h \ |
35 | ../../rsync/rsync.h \ | 34 | ../../rsync/rsync.h \ |
36 | ../../rsync/search.h \ | 35 | ../../rsync/search.h \ |
37 | ../../rsync/stream.h \ | 36 | ../../rsync/stream.h \ |
38 | ../../rsync/sumset.h \ | 37 | ../../rsync/sumset.h \ |
39 | ../../rsync/trace.h \ | 38 | ../../rsync/trace.h \ |
40 | ../../rsync/types.h \ | 39 | ../../rsync/types.h \ |
41 | ../../rsync/util.h \ | 40 | ../../rsync/util.h \ |
42 | ../../rsync/whole.h \ | 41 | ../../rsync/whole.h \ |
43 | ../../rsync/config_rsync.h \ | 42 | ../../rsync/config_rsync.h \ |
44 | ../../rsync/qrsync.h | 43 | ../../rsync/qrsync.h |
45 | # quicklauncher.h \ | 44 | # quicklauncher.h \ |
46 | SOURCES = background.cpp \ | 45 | SOURCES = background.cpp \ |
47 | desktop.cpp \ | 46 | desktop.cpp \ |
48 | mediummountgui.cpp \ | 47 | mediummountgui.cpp \ |
49 | qprocess.cpp qprocess_unix.cpp \ | 48 | qprocess.cpp qprocess_unix.cpp \ |
50 | info.cpp \ | 49 | info.cpp \ |
51 | appicons.cpp \ | 50 | appicons.cpp \ |
52 | taskbar.cpp \ | 51 | taskbar.cpp \ |
53 | sidething.cpp \ | 52 | sidething.cpp \ |
54 | mrulist.cpp \ | ||
55 | runningappbar.cpp \ | 53 | runningappbar.cpp \ |
56 | stabmon.cpp \ | 54 | stabmon.cpp \ |
57 | inputmethods.cpp \ | 55 | inputmethods.cpp \ |
58 | systray.cpp \ | 56 | systray.cpp \ |
59 | wait.cpp \ | 57 | wait.cpp \ |
60 | shutdownimpl.cpp \ | 58 | shutdownimpl.cpp \ |
61 | launcher.cpp \ | 59 | launcher.cpp \ |
62 | launcherview.cpp \ | 60 | launcherview.cpp \ |
63 | ../../core/apps/calibrate/calibrate.cpp \ | 61 | ../../core/apps/calibrate/calibrate.cpp \ |
64 | transferserver.cpp \ | 62 | transferserver.cpp \ |
65 | packageslave.cpp \ | 63 | packageslave.cpp \ |
66 | irserver.cpp \ | 64 | irserver.cpp \ |
67 | qcopbridge.cpp \ | 65 | qcopbridge.cpp \ |
68 | startmenu.cpp \ | 66 | startmenu.cpp \ |
69 | main.cpp \ | 67 | main.cpp \ |
70 | ../../rsync/base64.c \ | 68 | ../../rsync/base64.c \ |
71 | ../../rsync/buf.c \ | 69 | ../../rsync/buf.c \ |
72 | ../../rsync/checksum.c \ | 70 | ../../rsync/checksum.c \ |
73 | ../../rsync/command.c \ | 71 | ../../rsync/command.c \ |
74 | ../../rsync/delta.c \ | 72 | ../../rsync/delta.c \ |
75 | ../../rsync/emit.c \ | 73 | ../../rsync/emit.c \ |
76 | ../../rsync/hex.c \ | 74 | ../../rsync/hex.c \ |
77 | ../../rsync/job.c \ | 75 | ../../rsync/job.c \ |
78 | ../../rsync/mdfour.c \ | 76 | ../../rsync/mdfour.c \ |
diff --git a/core/launcher/main.cpp b/core/launcher/main.cpp index ca0bbe4..490af39 100644 --- a/core/launcher/main.cpp +++ b/core/launcher/main.cpp | |||
@@ -221,45 +221,45 @@ static const char *pidfile_path = "/var/run/opie.pid"; | |||
221 | 221 | ||
222 | void create_pidfile ( ) | 222 | void create_pidfile ( ) |
223 | { | 223 | { |
224 | FILE *f; | 224 | FILE *f; |
225 | 225 | ||
226 | if (( f = ::fopen ( pidfile_path, "w" ))) { | 226 | if (( f = ::fopen ( pidfile_path, "w" ))) { |
227 | ::fprintf ( f, "%d", getpid ( )); | 227 | ::fprintf ( f, "%d", getpid ( )); |
228 | ::fclose ( f ); | 228 | ::fclose ( f ); |
229 | } | 229 | } |
230 | } | 230 | } |
231 | 231 | ||
232 | void remove_pidfile ( ) | 232 | void remove_pidfile ( ) |
233 | { | 233 | { |
234 | ::unlink ( pidfile_path ); | 234 | ::unlink ( pidfile_path ); |
235 | } | 235 | } |
236 | 236 | ||
237 | void handle_sigterm ( int /* sig */ ) | 237 | void handle_sigterm ( int /* sig */ ) |
238 | { | 238 | { |
239 | if ( qApp ) | 239 | if ( qApp ) |
240 | qApp-> quit ( ); | 240 | qApp-> quit ( ); |
241 | } | 241 | } |
242 | 242 | ||
243 | int main( int argc, char ** argv ) | 243 | int main( int argc, char ** argv ) |
244 | { | 244 | { |
245 | ::signal( SIGCHLD, SIG_IGN ); | 245 | ::signal ( SIGCHLD, SIG_IGN ); |
246 | 246 | ||
247 | ::signal ( SIGTERM, handle_sigterm ); | 247 | ::signal ( SIGTERM, handle_sigterm ); |
248 | ::signal ( SIGINT, handle_sigterm ); | 248 | ::signal ( SIGINT, handle_sigterm ); |
249 | 249 | ||
250 | ::setsid ( ); | 250 | ::setsid ( ); |
251 | ::setpgid ( 0, 0 ); | 251 | ::setpgid ( 0, 0 ); |
252 | 252 | ||
253 | ::atexit ( remove_pidfile ); | 253 | ::atexit ( remove_pidfile ); |
254 | create_pidfile ( ); | 254 | create_pidfile ( ); |
255 | 255 | ||
256 | int retVal = initApplication ( argc, argv ); | 256 | int retVal = initApplication ( argc, argv ); |
257 | 257 | ||
258 | // Kill them. Kill them all. | 258 | // Kill them. Kill them all. |
259 | ::kill ( 0, SIGTERM ); | 259 | ::kill ( 0, SIGTERM ); |
260 | ::sleep ( 1 ); | 260 | ::sleep ( 1 ); |
261 | ::kill ( 0, SIGKILL ); | 261 | ::kill ( 0, SIGKILL ); |
262 | 262 | ||
263 | return retVal; | 263 | return retVal; |
264 | } | 264 | } |
265 | 265 | ||
diff --git a/core/launcher/systray.cpp b/core/launcher/systray.cpp index ad1553f..4767150 100644 --- a/core/launcher/systray.cpp +++ b/core/launcher/systray.cpp | |||
@@ -1,107 +1,148 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the 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 <qpe/qpeapplication.h> | 21 | #include <qpe/qpeapplication.h> |
22 | #include <qpe/qlibrary.h> | 22 | #include <qpe/qlibrary.h> |
23 | #include <qpe/config.h> | 23 | #include <qpe/config.h> |
24 | 24 | ||
25 | #include <qlayout.h> | 25 | #include <qlayout.h> |
26 | #include <qdir.h> | 26 | #include <qdir.h> |
27 | #include <qtranslator.h> | 27 | #include <qtranslator.h> |
28 | 28 | ||
29 | #include "quicklauncher.h" | 29 | #include "quicklauncher.h" |
30 | #include "systray.h" | 30 | #include "systray.h" |
31 | 31 | ||
32 | #include <stdlib.h> | 32 | #include <stdlib.h> |
33 | 33 | ||
34 | #ifdef SINGLE_APP | 34 | #ifdef SINGLE_APP |
35 | #include "clockappletimpl.h" | 35 | #include "clockappletimpl.h" |
36 | #endif | 36 | #endif |
37 | 37 | ||
38 | SysTray::SysTray( QWidget *parent ) : QFrame( parent ), layout(0) | 38 | SysTray::SysTray( QWidget *parent ) : QFrame( parent ), layout(0) |
39 | { | 39 | { |
40 | safety_tid = 0; | ||
40 | //setFrameStyle( QFrame::Panel | QFrame::Sunken ); | 41 | //setFrameStyle( QFrame::Panel | QFrame::Sunken ); |
41 | loadApplets(); | 42 | loadApplets(); |
42 | } | 43 | } |
43 | 44 | ||
45 | static int compareAppletPositions(const void *a, const void *b) | ||
46 | { | ||
47 | const TaskbarApplet* aa = *(const TaskbarApplet**)a; | ||
48 | const TaskbarApplet* ab = *(const TaskbarApplet**)b; | ||
49 | int d = ab->iface->position() - aa->iface->position(); | ||
50 | if ( d ) return d; | ||
51 | return QString::compare(ab->library->library(),aa->library->library()); | ||
52 | } | ||
53 | |||
44 | void SysTray::loadApplets() | 54 | void SysTray::loadApplets() |
45 | { | 55 | { |
56 | clearApplets(); | ||
57 | addApplets(); | ||
58 | } | ||
59 | |||
60 | void SysTray::clearApplets() | ||
61 | { | ||
62 | hide(); | ||
46 | #ifndef SINGLE_APP | 63 | #ifndef SINGLE_APP |
47 | QValueList<TaskbarApplet>::Iterator mit; | 64 | QValueList<TaskbarApplet>::Iterator mit; |
48 | for ( mit = appletList.begin(); mit != appletList.end(); ++mit ) { | 65 | for ( mit = appletList.begin(); mit != appletList.end(); ++mit ) { |
49 | (*mit).iface->release(); | 66 | (*mit).iface->release(); |
50 | (*mit).library->unload(); | 67 | (*mit).library->unload(); |
51 | delete (*mit).library; | 68 | delete (*mit).library; |
52 | } | 69 | } |
70 | #endif | ||
53 | appletList.clear(); | 71 | appletList.clear(); |
54 | if ( layout ) | 72 | if ( layout ) |
55 | delete layout; | 73 | delete layout; |
56 | layout = new QHBoxLayout( this ); | 74 | layout = new QHBoxLayout( this, 0, 1 ); |
75 | layout->setAutoAdd(TRUE); | ||
76 | } | ||
77 | |||
78 | void SysTray::addApplets() | ||
79 | { | ||
80 | #ifndef SINGLE_APP | ||
81 | Config cfg( "Taskbar" ); | ||
82 | cfg.setGroup( "Applets" ); | ||
83 | bool safe = cfg.readBoolEntry("SafeMode",FALSE); | ||
84 | if ( safe && !safety_tid ) | ||
85 | return; | ||
86 | cfg.writeEntry("SafeMode",TRUE); | ||
87 | cfg.write(); | ||
88 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); | ||
57 | 89 | ||
58 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; | 90 | QString path = QPEApplication::qpeDir() + "/plugins/applets"; |
59 | QDir dir( path, "lib*.so" ); | 91 | QDir dir( path, "lib*.so" ); |
60 | QStringList list = dir.entryList(); | 92 | QStringList list = dir.entryList(); |
61 | QStringList::Iterator it; | 93 | QStringList::Iterator it; |
94 | int napplets=0; | ||
95 | TaskbarApplet* *applets = new TaskbarApplet*[list.count()]; | ||
62 | for ( it = list.begin(); it != list.end(); ++it ) { | 96 | for ( it = list.begin(); it != list.end(); ++it ) { |
97 | if ( exclude.find( *it ) != exclude.end() ) | ||
98 | continue; | ||
63 | TaskbarAppletInterface *iface = 0; | 99 | TaskbarAppletInterface *iface = 0; |
64 | QLibrary *lib = new QLibrary( path + "/" + *it ); | 100 | QLibrary *lib = new QLibrary( path + "/" + *it ); |
65 | if ( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) { | 101 | if ( lib->queryInterface( IID_TaskbarApplet, (QUnknownInterface**)&iface ) == QS_OK ) { |
66 | TaskbarApplet applet; | 102 | TaskbarApplet *applet = new TaskbarApplet; |
67 | applet.library = lib; | 103 | applets[napplets++] = applet; |
68 | applet.iface = iface; | 104 | applet->library = lib; |
69 | applet.applet = applet.iface->applet( this ); | 105 | applet->iface = iface; |
70 | positionApplet( applet ); | ||
71 | QString lang = getenv( "LANG" ); | ||
72 | QTranslator * trans = new QTranslator(qApp); | ||
73 | QString type = (*it).left( (*it).find(".") ); | ||
74 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | ||
75 | qDebug("tr fpr sysapplet: %s", tfn.latin1() ); | ||
76 | if ( trans->load( tfn )) | ||
77 | qApp->installTranslator( trans ); | ||
78 | else | ||
79 | delete trans; | ||
80 | } else { | 106 | } else { |
107 | exclude += *it; | ||
81 | delete lib; | 108 | delete lib; |
82 | } | 109 | } |
83 | } | 110 | } |
111 | cfg.writeEntry( "ExcludeApplets", exclude, ',' ); | ||
112 | qsort(applets,napplets,sizeof(applets[0]),compareAppletPositions); | ||
113 | while (napplets--) { | ||
114 | TaskbarApplet *applet = applets[napplets]; | ||
115 | applet->applet = applet->iface->applet( this ); | ||
116 | appletList.append(*applet); | ||
117 | QString lang = getenv( "LANG" ); | ||
118 | QTranslator * trans = new QTranslator(qApp); | ||
119 | QString type = (*it).left( (*it).find(".") ); | ||
120 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | ||
121 | if ( trans->load( tfn )) | ||
122 | qApp->installTranslator( trans ); | ||
123 | else | ||
124 | delete trans; | ||
125 | } | ||
126 | delete applets; | ||
84 | #else | 127 | #else |
85 | layout = new QHBoxLayout( this ); | ||
86 | TaskbarApplet applet; | 128 | TaskbarApplet applet; |
87 | applet.iface = new ClockAppletImpl(); | 129 | applet.iface = new ClockAppletImpl(); |
88 | applet.applet = applet.iface->applet( this ); | 130 | applet.applet = applet.iface->applet( this ); |
89 | positionApplet( applet ); | 131 | appletList.append( a ); |
90 | #endif | 132 | #endif |
133 | show(); | ||
134 | |||
135 | if ( !safety_tid ) | ||
136 | safety_tid = startTimer(2000); // TT has 5000, but this is a PITA for a developer ;) (sandman) | ||
91 | } | 137 | } |
92 | 138 | ||
93 | void SysTray::positionApplet( const TaskbarApplet &a ) | 139 | void SysTray::timerEvent(QTimerEvent* e) |
94 | { | 140 | { |
95 | int p = 0; | 141 | if ( e->timerId() == safety_tid ) { |
96 | QValueList<TaskbarApplet>::Iterator it; | 142 | Config cfg( "Taskbar" ); |
97 | for ( it = appletList.begin(); it != appletList.end(); ++it ) { | 143 | cfg.setGroup( "Applets" ); |
98 | if ( (*it).iface->position() > a.iface->position() ) | 144 | cfg.writeEntry( "SafeMode", FALSE ); |
99 | break; | 145 | killTimer(safety_tid); |
100 | p += 2; | 146 | safety_tid = 0; |
101 | } | 147 | } |
102 | |||
103 | appletList.insert( it, a ); | ||
104 | layout->insertWidget( p, a.applet ); | ||
105 | layout->insertSpacing( p, 1 ); | ||
106 | } | 148 | } |
107 | |||
diff --git a/core/launcher/systray.h b/core/launcher/systray.h index 0aed348..5a6849a 100644 --- a/core/launcher/systray.h +++ b/core/launcher/systray.h | |||
@@ -1,58 +1,61 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of Qtopia Environment. | 4 | ** This file is part of the 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 | #ifndef __SYSTRAY_H__ | 21 | #ifndef __SYSTRAY_H__ |
22 | #define __SYSTRAY_H__ | 22 | #define __SYSTRAY_H__ |
23 | 23 | ||
24 | #include <qpe/taskbarappletinterface.h> | 24 | #include <qpe/taskbarappletinterface.h> |
25 | 25 | ||
26 | #include <qframe.h> | 26 | #include <qframe.h> |
27 | #include <qvaluelist.h> | 27 | #include <qvaluelist.h> |
28 | 28 | ||
29 | class QHBoxLayout; | 29 | class QHBoxLayout; |
30 | class QLibrary; | 30 | class QLibrary; |
31 | 31 | ||
32 | struct TaskbarApplet | 32 | struct TaskbarApplet |
33 | { | 33 | { |
34 | #ifndef QT_NO_COMPONENT | 34 | #ifndef QT_NO_COMPONENT |
35 | QLibrary *library; | 35 | QLibrary *library; |
36 | #endif | 36 | #endif |
37 | TaskbarAppletInterface *iface; | 37 | TaskbarAppletInterface *iface; |
38 | QWidget *applet; | 38 | QWidget *applet; |
39 | }; | 39 | }; |
40 | 40 | ||
41 | class SysTray : public QFrame { | 41 | class SysTray : public QFrame { |
42 | Q_OBJECT | 42 | Q_OBJECT |
43 | public: | 43 | public: |
44 | SysTray( QWidget *parent ); | 44 | SysTray( QWidget *parent ); |
45 | 45 | ||
46 | void loadApplets(); | 46 | void clearApplets(); |
47 | void addApplets(); | ||
47 | 48 | ||
48 | private: | 49 | protected: |
49 | void positionApplet( const TaskbarApplet &a ); | 50 | void timerEvent(QTimerEvent* e); |
50 | 51 | ||
51 | private: | 52 | private: |
53 | void loadApplets(); | ||
54 | int safety_tid; | ||
52 | QHBoxLayout *layout; | 55 | QHBoxLayout *layout; |
53 | QValueList<TaskbarApplet> appletList; | 56 | QValueList<TaskbarApplet> appletList; |
54 | }; | 57 | }; |
55 | 58 | ||
56 | 59 | ||
57 | #endif // __SYSTRAY_H__ | 60 | #endif // __SYSTRAY_H__ |
58 | 61 | ||
diff --git a/core/launcher/taskbar.cpp b/core/launcher/taskbar.cpp index 988d072..1feae4a 100644 --- a/core/launcher/taskbar.cpp +++ b/core/launcher/taskbar.cpp | |||
@@ -1,47 +1,46 @@ | |||
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 "mrulist.h" | ||
24 | #include "runningappbar.h" | 23 | #include "runningappbar.h" |
25 | #include "systray.h" | 24 | #include "systray.h" |
26 | #include "calibrate.h" | 25 | #include "calibrate.h" |
27 | #include "wait.h" | 26 | #include "wait.h" |
28 | #include "appicons.h" | 27 | #include "appicons.h" |
29 | 28 | ||
30 | #include "taskbar.h" | 29 | #include "taskbar.h" |
31 | #include "desktop.h" | 30 | #include "desktop.h" |
32 | 31 | ||
33 | #include <qpe/qpeapplication.h> | 32 | #include <qpe/qpeapplication.h> |
34 | #include <qpe/qcopenvelope_qws.h> | 33 | #include <qpe/qcopenvelope_qws.h> |
35 | #include <qpe/global.h> | 34 | #include <qpe/global.h> |
36 | 35 | ||
37 | #if defined( QT_QWS_CUSTOM ) || defined( QT_QWS_IPAQ ) | 36 | #if defined( QT_QWS_CUSTOM ) || defined( QT_QWS_IPAQ ) |
38 | #include <qpe/custom.h> | 37 | #include <qpe/custom.h> |
39 | #endif | 38 | #endif |
40 | 39 | ||
41 | #include <opie/odevice.h> | 40 | #include <opie/odevice.h> |
42 | 41 | ||
43 | #include <qlabel.h> | 42 | #include <qlabel.h> |
44 | #include <qlayout.h> | 43 | #include <qlayout.h> |
45 | #include <qtimer.h> | 44 | #include <qtimer.h> |
46 | #include <qwindowsystem_qws.h> | 45 | #include <qwindowsystem_qws.h> |
47 | #include <qwidgetstack.h> | 46 | #include <qwidgetstack.h> |
@@ -252,49 +251,50 @@ void TaskBar::calcMaxWindowRect() | |||
252 | #if QT_VERSION < 300 | 251 | #if QT_VERSION < 300 |
253 | QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr, | 252 | QWSServer::setMaxWindowRect( qt_screen->mapToDevice(wr, |
254 | QSize(qt_screen->width(),qt_screen->height())) | 253 | QSize(qt_screen->width(),qt_screen->height())) |
255 | ); | 254 | ); |
256 | #else | 255 | #else |
257 | QWSServer::setMaxWindowRect( wr ); | 256 | QWSServer::setMaxWindowRect( wr ); |
258 | #endif | 257 | #endif |
259 | #endif | 258 | #endif |
260 | } | 259 | } |
261 | 260 | ||
262 | void TaskBar::receive( const QCString &msg, const QByteArray &data ) | 261 | void TaskBar::receive( const QCString &msg, const QByteArray &data ) |
263 | { | 262 | { |
264 | QDataStream stream( data, IO_ReadOnly ); | 263 | QDataStream stream( data, IO_ReadOnly ); |
265 | if ( msg == "message(QString)" ) { | 264 | if ( msg == "message(QString)" ) { |
266 | QString text; | 265 | QString text; |
267 | stream >> text; | 266 | stream >> text; |
268 | setStatusMessage( text ); | 267 | setStatusMessage( text ); |
269 | } else if ( msg == "hideInputMethod()" ) { | 268 | } else if ( msg == "hideInputMethod()" ) { |
270 | inputMethods->hideInputMethod(); | 269 | inputMethods->hideInputMethod(); |
271 | } else if ( msg == "showInputMethod()" ) { | 270 | } else if ( msg == "showInputMethod()" ) { |
272 | inputMethods->showInputMethod(); | 271 | inputMethods->showInputMethod(); |
273 | } else if ( msg == "reloadInputMethods()" ) { | 272 | } else if ( msg == "reloadInputMethods()" ) { |
274 | inputMethods->loadInputMethods(); | 273 | inputMethods->loadInputMethods(); |
275 | } else if ( msg == "reloadApplets()" ) { | 274 | } else if ( msg == "reloadApplets()" ) { |
276 | sysTray->loadApplets(); | 275 | sysTray->clearApplets(); |
276 | sysTray->addApplets(); | ||
277 | } else if ( msg == "soundAlarm()" ) { | 277 | } else if ( msg == "soundAlarm()" ) { |
278 | Desktop::soundAlarm(); | 278 | Desktop::soundAlarm(); |
279 | } | 279 | } |
280 | else if ( msg == "setLed(int,bool)" ) { | 280 | else if ( msg == "setLed(int,bool)" ) { |
281 | int led, status; | 281 | int led, status; |
282 | stream >> led >> status; | 282 | stream >> led >> status; |
283 | 283 | ||
284 | ODevice::inst ( )-> setLed ( led, status ? OLED_BlinkSlow : OLED_Off ); | 284 | ODevice::inst ( )-> setLed ( led, status ? OLED_BlinkSlow : OLED_Off ); |
285 | } | 285 | } |
286 | } | 286 | } |
287 | 287 | ||
288 | QWidget *TaskBar::calibrate(bool) | 288 | QWidget *TaskBar::calibrate(bool) |
289 | { | 289 | { |
290 | #ifdef Q_WS_QWS | 290 | #ifdef Q_WS_QWS |
291 | Calibrate *c = new Calibrate; | 291 | Calibrate *c = new Calibrate; |
292 | c->show(); | 292 | c->show(); |
293 | return c; | 293 | return c; |
294 | #else | 294 | #else |
295 | return 0; | 295 | return 0; |
296 | #endif | 296 | #endif |
297 | } | 297 | } |
298 | 298 | ||
299 | void TaskBar::toggleNumLockState() | 299 | void TaskBar::toggleNumLockState() |
300 | { | 300 | { |