author | harlekin <harlekin> | 2002-04-03 08:12:17 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-04-03 08:12:17 (UTC) |
commit | 48f7cbcb23cfd4daff6218d8902e0049af674b9f (patch) (unidiff) | |
tree | 49cbc6aa015290a143ff3c0652de906ad3c8fc71 | |
parent | 14acfe3608e8c57e5cacb08daed8944946e03d42 (diff) | |
download | opie-48f7cbcb23cfd4daff6218d8902e0049af674b9f.zip opie-48f7cbcb23cfd4daff6218d8902e0049af674b9f.tar.gz opie-48f7cbcb23cfd4daff6218d8902e0049af674b9f.tar.bz2 |
changed MRUlist to a taskbar, only running apps are shown
-rw-r--r-- | core/launcher/launcher.cpp | 11 | ||||
-rw-r--r-- | core/launcher/mrulist.cpp | 46 | ||||
-rw-r--r-- | core/launcher/mrulist.h | 1 |
3 files changed, 28 insertions, 30 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp index 17a30e6..1449269 100644 --- a/core/launcher/launcher.cpp +++ b/core/launcher/launcher.cpp | |||
@@ -682,5 +682,10 @@ void Launcher::systemMessage( const QCString &msg, const QByteArray &data) | |||
682 | QDataStream stream( data, IO_ReadOnly ); | 682 | QDataStream stream( data, IO_ReadOnly ); |
683 | if ( msg == "linkChanged(QString)" ) { | 683 | if ( msg == "closing(QString)" ){ |
684 | QString link; | 684 | QString app; |
685 | stream >> link; | 685 | stream >> app; |
686 | qWarning("app closed %s", app.latin1() ); | ||
687 | MRUList::removeTask( app ); | ||
688 | }else if ( msg == "linkChanged(QString)" ) { | ||
689 | QString link; | ||
690 | stream >> link; | ||
686 | if ( in_lnk_props ) { | 691 | if ( in_lnk_props ) { |
diff --git a/core/launcher/mrulist.cpp b/core/launcher/mrulist.cpp index 6066dac..5590d38 100644 --- a/core/launcher/mrulist.cpp +++ b/core/launcher/mrulist.cpp | |||
@@ -65,2 +65,20 @@ QSize MRUList::sizeHint() const | |||
65 | 65 | ||
66 | // thanks to John from Trolltech | ||
67 | void MRUList::removeTask(const QString &appName ) | ||
68 | { | ||
69 | qWarning("MRULList::removeTask( %s)", appName.latin1() ); | ||
70 | if(appName.isEmpty() ) | ||
71 | return; | ||
72 | |||
73 | if(!task ) // at least it should be called once before | ||
74 | return; | ||
75 | unsigned int i= 0; | ||
76 | for ( ; i < task->count(); i++ ) { | ||
77 | AppLnk *t = task->at(i); | ||
78 | if ( t->exec() == appName ) | ||
79 | task->remove(); | ||
80 | } | ||
81 | for (unsigned i = 0; i < MRUListWidgets->count(); i++ ) | ||
82 | MRUListWidgets->at(i)->update(); | ||
83 | } | ||
66 | 84 | ||
@@ -68,2 +86,3 @@ void MRUList::addTask( const AppLnk *appLnk ) | |||
68 | { | 86 | { |
87 | qWarning("Add Task" ); | ||
69 | if ( !appLnk ) | 88 | if ( !appLnk ) |
@@ -74,29 +93,2 @@ void MRUList::addTask( const AppLnk *appLnk ) | |||
74 | return; | 93 | return; |
75 | // ok we wan't to delete old icons from the taskbar | ||
76 | // get the window list and see which windows aren't there any more | ||
77 | QList<AppLnk> cleanUp; | ||
78 | cleanUp.setAutoDelete( TRUE ); | ||
79 | const QList<QWSWindow> &list = qwsServer->clientWindows(); | ||
80 | QWSWindow* w; | ||
81 | bool running = false; // to see what we should do | ||
82 | for ( ; i < task->count(); i++ ) { | ||
83 | AppLnk *t = task->at(i); | ||
84 | running = false; | ||
85 | for (QListIterator<QWSWindow> it(list); (w=it.current()); ++it) { | ||
86 | QString app = w->client()->identity(); | ||
87 | if( app == t->exec( ) ){ | ||
88 | running = true; | ||
89 | break; | ||
90 | } | ||
91 | } | ||
92 | if(!running ) { // gues what we do now | ||
93 | cleanUp.append( t); | ||
94 | } | ||
95 | } | ||
96 | // no do a clean up of these old icons | ||
97 | AppLnk *lnk; | ||
98 | for( lnk = cleanUp.first(); lnk != 0; lnk = cleanUp.next() ){ | ||
99 | task->remove( lnk ); | ||
100 | } | ||
101 | cleanUp.clear(); // should be deleted too | ||
102 | 94 | ||
diff --git a/core/launcher/mrulist.h b/core/launcher/mrulist.h index 141a09b..ff111ce 100644 --- a/core/launcher/mrulist.h +++ b/core/launcher/mrulist.h | |||
@@ -38,2 +38,3 @@ public: | |||
38 | static void addTask( const AppLnk *appLnk ); | 38 | static void addTask( const AppLnk *appLnk ); |
39 | static void removeTask(const QString &appName ); | ||
39 | bool quitOldApps(); | 40 | bool quitOldApps(); |