author | zecke <zecke> | 2003-08-28 14:47:24 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-08-28 14:47:24 (UTC) |
commit | e284d63306cd3b00baff8e464a8eaf2eb64ea49a (patch) (unidiff) | |
tree | 2898793040f5571455a3301d761383eed6efaee3 /core/launcher | |
parent | 285e7737f47c508ee816c5a96ebfc4207dc78438 (diff) | |
download | opie-e284d63306cd3b00baff8e464a8eaf2eb64ea49a.zip opie-e284d63306cd3b00baff8e464a8eaf2eb64ea49a.tar.gz opie-e284d63306cd3b00baff8e464a8eaf2eb64ea49a.tar.bz2 |
Use real applets
-rw-r--r-- | core/launcher/startmenu.cpp | 330 | ||||
-rw-r--r-- | core/launcher/startmenu.h | 40 |
2 files changed, 147 insertions, 223 deletions
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp index d75e8be..014418d 100644 --- a/core/launcher/startmenu.cpp +++ b/core/launcher/startmenu.cpp | |||
@@ -23,15 +23,14 @@ | |||
23 | #include "startmenu.h" | 23 | #include "startmenu.h" |
24 | #include "sidething.h" | 24 | |
25 | //#include "mrulist.h" | 25 | #include <qtopia/qpeapplication.h> |
26 | #include "info.h" | 26 | #include <qtopia/config.h> |
27 | 27 | #include <qtopia/applnk.h> | |
28 | #include <qpe/qpeapplication.h> | 28 | #include <qtopia/global.h> |
29 | #include <qpe/config.h> | 29 | #include <qtopia/resource.h> |
30 | #include <qpe/applnk.h> | 30 | #include <qtopia/mimetype.h> |
31 | #include <qpe/global.h> | 31 | #include <qtopia/qlibrary.h> |
32 | #include <qpe/resource.h> | 32 | |
33 | #include <qpe/qlibrary.h> | 33 | #include <qdict.h> |
34 | |||
35 | #include <qintdict.h> | ||
36 | #include <qdir.h> | 34 | #include <qdir.h> |
35 | #include <qpainter.h> | ||
37 | 36 | ||
@@ -40,4 +39,14 @@ | |||
40 | 39 | ||
41 | // #define USE_CONFIG_FILE | 40 | void StartPopupMenu::keyPressEvent( QKeyEvent *e ) |
41 | { | ||
42 | if ( e->key() == Key_F33 || e->key() == Key_Space ) { | ||
43 | // "OK" button, little hacky | ||
44 | QKeyEvent ke(QEvent::KeyPress, Key_Enter, 13, 0); | ||
45 | QPopupMenu::keyPressEvent( &ke ); | ||
46 | } else { | ||
47 | QPopupMenu::keyPressEvent( e ); | ||
48 | } | ||
49 | } | ||
42 | 50 | ||
51 | //--------------------------------------------------------------------------- | ||
43 | 52 | ||
@@ -45,4 +54,3 @@ StartMenu::StartMenu(QWidget *parent) : QLabel( parent ) | |||
45 | { | 54 | { |
46 | loadOptions(); | 55 | startButtonPixmap = "go"; // No tr |
47 | safety_tid = 1; // disable the timer... valgrind said it.. we don't use that option either -zecke | ||
48 | 56 | ||
@@ -53,11 +61,5 @@ StartMenu::StartMenu(QWidget *parent) : QLabel( parent ) | |||
53 | setFocusPolicy( NoFocus ); | 61 | setFocusPolicy( NoFocus ); |
54 | //setFlat( startButtonIsFlat ); | ||
55 | 62 | ||
56 | apps = 0; | ||
57 | launchMenu = 0; | 63 | launchMenu = 0; |
58 | applets. setAutoDelete ( true ); | 64 | refreshMenu(); |
59 | sepId = 0; | ||
60 | |||
61 | reloadApps ( ); | ||
62 | reloadApplets ( ); | ||
63 | } | 65 | } |
@@ -68,4 +70,2 @@ void StartMenu::mousePressEvent( QMouseEvent * ) | |||
68 | launch(); | 70 | launch(); |
69 | if (desktopInfo) | ||
70 | desktopInfo->menuClicked(); | ||
71 | } | 71 | } |
@@ -75,46 +75,23 @@ StartMenu::~StartMenu() | |||
75 | { | 75 | { |
76 | delete apps; | 76 | clearApplets(); |
77 | } | ||
78 | |||
79 | |||
80 | void StartMenu::loadOptions() | ||
81 | { | ||
82 | #ifdef USE_CONFIG_FILE | ||
83 | // Read configuration file | ||
84 | Config config("StartMenu"); | ||
85 | config.setGroup( "StartMenu" ); | ||
86 | QString tmpBoolString1 = config.readEntry( "UseWidePopupMenu", "FALSE" ); | ||
87 | useWidePopupMenu = ( tmpBoolString1 == "TRUE" ) ? TRUE : FALSE; | ||
88 | QString tmpBoolString2 = config.readEntry( "StartButtonIsFlat", "TRUE" ); | ||
89 | startButtonIsFlat = ( tmpBoolString2 == "TRUE" ) ? TRUE : FALSE; | ||
90 | QString tmpBoolString3 = config.readEntry( "UseMRUList", "TRUE" ); | ||
91 | popupMenuSidePixmap = config.readEntry( "PopupMenuSidePixmap", "launcher/sidebar" ); | ||
92 | startButtonPixmap = config.readEntry( "StartButtonPixmap", "go" ); | ||
93 | #else | ||
94 | // Basically just #include the .qpe_menu.conf file settings | ||
95 | useWidePopupMenu = FALSE; | ||
96 | popupMenuSidePixmap = "launcher/sidebar"; | ||
97 | startButtonIsFlat = TRUE; | ||
98 | startButtonPixmap = "go"; // No tr | ||
99 | #endif | ||
100 | } | 77 | } |
101 | 78 | ||
102 | |||
103 | void StartMenu::createMenu() | 79 | void StartMenu::createMenu() |
104 | { | 80 | { |
81 | clearApplets(); | ||
105 | delete launchMenu; | 82 | delete launchMenu; |
106 | if ( useWidePopupMenu ) | ||
107 | launchMenu = new PopupWithLaunchSideThing( this, &popupMenuSidePixmap ); | ||
108 | else | ||
109 | launchMenu = new StartPopupMenu( this ); | ||
110 | 83 | ||
111 | loadMenu ( apps, launchMenu ); | 84 | launchMenu = new StartPopupMenu( this ); |
85 | loadMenu( launchMenu ); | ||
112 | loadApplets ( ); | 86 | loadApplets ( ); |
113 | 87 | ||
88 | bool result = nother || ntabs || m_applets.count(); | ||
89 | if ( result ) | ||
114 | connect( launchMenu, SIGNAL(activated(int)), SLOT(itemSelected(int)) ); | 90 | connect( launchMenu, SIGNAL(activated(int)), SLOT(itemSelected(int)) ); |
91 | |||
115 | } | 92 | } |
116 | 93 | ||
117 | void StartMenu::reloadApps() | 94 | void StartMenu::refreshMenu() |
118 | { | 95 | { |
119 | Config cfg("StartMenu"); | 96 | Config cfg("Taskbar"); |
120 | cfg.setGroup("Menu"); | 97 | cfg.setGroup("Menu"); |
@@ -123,32 +100,27 @@ void StartMenu::reloadApps() | |||
123 | bool lt = ltabs || lot; | 100 | bool lt = ltabs || lot; |
124 | if ( launchMenu && apps && !lt ) | 101 | if ( launchMenu && !lt ) |
125 | return; // nothing to do | 102 | return; // nothing to do |
126 | 103 | ||
127 | if ( lt ) { | ||
128 | delete apps; | ||
129 | apps = new AppLnkSet( QPEApplication::qpeDir() + "apps" ); | ||
130 | } | ||
131 | if ( launchMenu ) { | 104 | if ( launchMenu ) { |
132 | launchMenu-> hide ( ); | 105 | int i; |
133 | 106 | /* find the first entry we want to remove */ | |
134 | for ( QIntDictIterator<QPopupMenu> it ( tabdict ); it. current ( ); ++it ) { | 107 | for (i=0; i<(int)launchMenu->count(); i++) { |
135 | launchMenu-> removeItem ( it. currentKey ( )); | 108 | QMenuItem* item = launchMenu->findItem(launchMenu->idAt(i)); |
136 | delete it.current ( ); | 109 | if ( item && item->id() >= 0 && item->id() < ntabs ) { |
137 | } | 110 | break; |
138 | tabdict. clear ( ); | ||
139 | loadMenu(apps,launchMenu); | ||
140 | } else { | ||
141 | createMenu(); | ||
142 | } | 111 | } |
112 | if ( item && item->isSeparator() ) { | ||
113 | i++; | ||
114 | break; | ||
143 | } | 115 | } |
144 | |||
145 | void StartMenu::reloadApplets() | ||
146 | { | ||
147 | if ( launchMenu ) { | ||
148 | clearApplets ( ); | ||
149 | loadApplets ( ); | ||
150 | } | 116 | } |
151 | else | 117 | /* remove them */ |
118 | while (i<(int)launchMenu->count()) | ||
119 | launchMenu->removeItemAt(i); | ||
120 | loadMenu(launchMenu); | ||
121 | addApplets(launchMenu); | ||
122 | } else { | ||
152 | createMenu ( ); | 123 | createMenu ( ); |
153 | } | 124 | } |
125 | } | ||
154 | 126 | ||
@@ -156,9 +128,10 @@ void StartMenu::itemSelected( int id ) | |||
156 | { | 128 | { |
157 | const AppLnk *app = apps->find( id ); | 129 | if ( id >= 0 && id < ntabs ) { |
158 | if ( app ) | 130 | emit tabSelected(tabs[id]); |
159 | app->execute(); | 131 | } else if ( id >= 20 && id < 20+nother ) { |
160 | else { | 132 | other.at(id-20)->execute(); |
161 | MenuApplet *applet = applets. find ( id ); | 133 | }else { |
162 | 134 | MenuApplet *applet = m_applets.find ( id ); | |
163 | if ( applet ) | 135 | if ( applet ) { |
136 | qWarning("activated"); | ||
164 | applet-> iface-> activated ( ); | 137 | applet-> iface-> activated ( ); |
@@ -166,8 +139,7 @@ void StartMenu::itemSelected( int id ) | |||
166 | } | 139 | } |
140 | } | ||
167 | 141 | ||
168 | bool StartMenu::loadMenu( AppLnkSet *folder, QPopupMenu *menu ) | 142 | bool StartMenu::loadMenu( QPopupMenu *menu ) |
169 | { | 143 | { |
170 | bool result = FALSE; | 144 | Config cfg("Taskbar"); |
171 | |||
172 | Config cfg("StartMenu"); | ||
173 | cfg.setGroup("Menu"); | 145 | cfg.setGroup("Menu"); |
@@ -176,63 +148,40 @@ bool StartMenu::loadMenu( AppLnkSet *folder, QPopupMenu *menu ) | |||
176 | bool lot = cfg.readBoolEntry("LauncherOther",TRUE); | 148 | bool lot = cfg.readBoolEntry("LauncherOther",TRUE); |
149 | bool sepfirst = !ltabs && !lot; | ||
177 | 150 | ||
178 | tabdict. clear ( ); | 151 | tabs.clear(); |
179 | 152 | other.setAutoDelete(TRUE); | |
180 | if ( sepId ) | 153 | other.clear(); |
181 | menu-> removeItem ( sepId ); | 154 | ntabs = 0; |
182 | sepId = ( menu-> count ( )) ? menu-> insertSeparator ( 0 ) : 0; | 155 | nother = 0; |
183 | 156 | ||
184 | if ( ltabs || lot ) { | ||
185 | QDict<QPopupMenu> typpop; | ||
186 | QStringList typs = folder->types(); | ||
187 | for (QStringList::Iterator tit=typs.fromLast(); ; --tit) { | ||
188 | if ( !(*tit).isEmpty() ) { | ||
189 | QPopupMenu *new_menu; | ||
190 | if ( ltabs ) { | ||
191 | new_menu = new StartPopupMenu( menu ); | ||
192 | connect( new_menu, SIGNAL(activated(int)), SLOT(itemSelected(int)) ); | ||
193 | int id = menu->insertItem( folder->typePixmap(*tit), folder->typeName(*tit), new_menu, -1, 0 ); | ||
194 | tabdict. insert ( id, new_menu ); | ||
195 | } else { | ||
196 | new_menu = (QPopupMenu*)1; | ||
197 | } | ||
198 | typpop.insert(*tit, new_menu); | ||
199 | } | ||
200 | if ( tit == typs. begin ( )) | ||
201 | break; | ||
202 | } | ||
203 | QListIterator<AppLnk> it( folder->children() ); | ||
204 | bool f=TRUE; | 157 | bool f=TRUE; |
205 | for ( ; it.current(); ++it ) { | 158 | if ( ltabs || lot ) { |
206 | AppLnk *app = it.current(); | 159 | QDir dir( MimeType::appsFolderName(), QString::null, QDir::Name ); |
207 | if ( app->type() == "Separator" ) { // No tr | 160 | for (int i=0; i<(int)dir.count(); i++) { |
161 | QString d = dir[i]; | ||
162 | Config cfg(dir.path()+"/"+d+"/.directory",Config::File); | ||
163 | if ( cfg.isValid() ) { | ||
164 | QString nm = cfg.readEntry("Name"); | ||
165 | QString ic = cfg.readEntry("Icon"); | ||
166 | if ( !!nm && !!ic ) { | ||
167 | tabs.append(d); | ||
168 | menu->insertItem( Resource::loadIconSet(ic), nm, ntabs++ ); | ||
169 | } | ||
170 | } else if ( lot && d.right(8)==".desktop") { | ||
171 | AppLnk* applnk = new AppLnk(dir.path()+"/"+d); | ||
172 | if ( applnk->isValid() ) { | ||
173 | if ( applnk->type() == "Separator" ) { // No tr | ||
208 | if ( lot ) { | 174 | if ( lot ) { |
209 | menu->insertSeparator(); | 175 | menu->insertSeparator(); |
176 | sepfirst = f && !ltabs; | ||
210 | } | 177 | } |
178 | delete applnk; | ||
211 | } else { | 179 | } else { |
212 | f = FALSE; | 180 | f = FALSE; |
213 | QString t = app->type(); | 181 | other.append(applnk); |
214 | QPopupMenu* pmenu = typpop.find(t); | 182 | menu->insertItem( Resource::loadIconSet(applnk->icon()), |
215 | if ( ltabs ) { | 183 | applnk->name(), 20+nother++ ); |
216 | if ( !pmenu && lot ) | ||
217 | pmenu = menu; | ||
218 | } else { | ||
219 | if ( !pmenu ) | ||
220 | pmenu = menu; | ||
221 | else | ||
222 | pmenu = 0; | ||
223 | } | ||
224 | if ( pmenu ) { | ||
225 | QString t = app->name(); | ||
226 | t.replace(QRegExp("&"),"&&"); // escape shortcut character | ||
227 | |||
228 | int index = -1; | ||
229 | |||
230 | for ( index = 0; index < pmenu-> count ( ); index++ ) { | ||
231 | if ( pmenu-> text ( pmenu-> idAt ( index )). compare ( t ) > 0 ) | ||
232 | break; | ||
233 | } | ||
234 | |||
235 | pmenu->insertItem( app->pixmap(), t, app->id(), index ); | ||
236 | } | 184 | } |
237 | result=TRUE; | 185 | } else { |
186 | delete applnk; | ||
238 | } | 187 | } |
@@ -241,10 +190,9 @@ bool StartMenu::loadMenu( AppLnkSet *folder, QPopupMenu *menu ) | |||
241 | 190 | ||
242 | if ( sepId && ( menu-> idAt ( 0 ) == sepId )) { // no tabs entries | 191 | if ( !menu->count() ) |
243 | menu-> removeItem ( sepId ); | 192 | sepfirst = TRUE; |
244 | sepId = 0; | ||
245 | } | 193 | } |
246 | if ( !menu-> count ( )) // if we don't do this QPopupMenu will insert a dummy Separator, which won't go away later | ||
247 | sepId = menu-> insertSeparator ( ); | ||
248 | 194 | ||
249 | return result; | 195 | launchMenu->setName(sepfirst ? "accessories" : "accessories_need_sep"); // No tr |
196 | |||
197 | return (nother || ntabs ); | ||
250 | } | 198 | } |
@@ -256,30 +204,10 @@ void StartMenu::launch ( ) | |||
256 | 204 | ||
257 | if ( launchMenu-> isVisible ( )) { | 205 | if ( launchMenu->isVisible() ) |
258 | launchMenu-> hide ( ); | 206 | launchMenu-> hide ( ); |
259 | } | 207 | else |
260 | else { | ||
261 | QWidget *active = qApp-> activeWindow ( ); | ||
262 | if ( active && active-> isPopup ( )) | ||
263 | active-> close ( ); | ||
264 | |||
265 | launchMenu-> popup ( QPoint ( 1, y )); | 208 | launchMenu-> popup ( QPoint ( 1, y )); |
266 | } | 209 | } |
267 | } | ||
268 | 210 | ||
269 | const AppLnk* StartMenu::execToLink(const QString& appname) | ||
270 | { | ||
271 | const AppLnk* a = apps->findExec( appname ); | ||
272 | return a; | ||
273 | } | ||
274 | 211 | ||
275 | void StartPopupMenu::keyPressEvent( QKeyEvent *e ) | 212 | |
276 | { | ||
277 | if ( e->key() == Key_F33 || e->key() == Key_Space ) { | ||
278 | // "OK" button, little hacky | ||
279 | QKeyEvent ke(QEvent::KeyPress, Key_Enter, 13, 0); | ||
280 | QPopupMenu::keyPressEvent( &ke ); | ||
281 | } else { | ||
282 | QPopupMenu::keyPressEvent( e ); | ||
283 | } | ||
284 | } | ||
285 | 213 | ||
@@ -296,5 +224,6 @@ void StartMenu::clearApplets() | |||
296 | { | 224 | { |
225 | if (launchMenu ) | ||
297 | launchMenu-> hide(); | 226 | launchMenu-> hide(); |
298 | 227 | ||
299 | for ( QIntDictIterator<MenuApplet> it ( applets ); it. current ( ); ++it ) { | 228 | for ( QIntDictIterator<MenuApplet> it ( m_applets ); it. current ( ); ++it ) { |
300 | MenuApplet *applet = it. current ( ); | 229 | MenuApplet *applet = it. current ( ); |
@@ -309,3 +238,3 @@ void StartMenu::clearApplets() | |||
309 | } | 238 | } |
310 | applets.clear(); | 239 | m_applets.clear(); |
311 | } | 240 | } |
@@ -314,2 +243,3 @@ void StartMenu::clearApplets() | |||
314 | 243 | ||
244 | |||
315 | void StartMenu::loadApplets() | 245 | void StartMenu::loadApplets() |
@@ -321,8 +251,5 @@ void StartMenu::loadApplets() | |||
321 | // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02 | 251 | // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02 |
252 | // removed in the remerge PluginManager could handle it | ||
253 | // we don't currently use it -zecke | ||
322 | 254 | ||
323 | bool safe = false; //cfg.readBoolEntry("SafeMode",FALSE); | ||
324 | if ( safe && !safety_tid ) | ||
325 | return; | ||
326 | cfg.writeEntry("SafeMode",TRUE); | ||
327 | cfg.write(); | ||
328 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); | 255 | QStringList exclude = cfg.readListEntry( "ExcludeApplets", ',' ); |
@@ -360,7 +287,6 @@ void StartMenu::loadApplets() | |||
360 | cfg.writeEntry( "ExcludeApplets", exclude, ',' ); | 287 | cfg.writeEntry( "ExcludeApplets", exclude, ',' ); |
361 | qsort(xapplets,napplets,sizeof(applets[0]),compareAppletPositions); | 288 | qsort(xapplets,napplets,sizeof(m_applets[0]),compareAppletPositions); |
289 | |||
362 | 290 | ||
363 | if ( sepId ) | 291 | int foo = ( launchMenu-> count ( )) ? launchMenu-> insertSeparator ( ) : 0; |
364 | launchMenu-> removeItem ( sepId ); | ||
365 | sepId = ( launchMenu-> count ( )) ? launchMenu-> insertSeparator ( ) : 0; | ||
366 | 292 | ||
@@ -375,3 +301,5 @@ void StartMenu::loadApplets() | |||
375 | applet-> id = launchMenu-> insertItem ( applet-> iface-> icon ( ), applet-> iface-> text ( ) ); | 301 | applet-> id = launchMenu-> insertItem ( applet-> iface-> icon ( ), applet-> iface-> text ( ) ); |
376 | applets.insert ( applet-> id, new MenuApplet(*applet)); | 302 | |
303 | |||
304 | m_applets.insert ( applet-> id, new MenuApplet(*applet)); | ||
377 | } | 305 | } |
@@ -379,23 +307,27 @@ void StartMenu::loadApplets() | |||
379 | 307 | ||
380 | if ( sepId && ( launchMenu-> idAt ( launchMenu-> count ( ) - 1 ) == sepId )) { // no applets | ||
381 | launchMenu-> removeItem ( sepId ); | ||
382 | sepId = 0; | ||
383 | } | 308 | } |
384 | if ( !launchMenu-> count ( )) // if we don't do this QPopupMenu will insert a dummy Separator, which won't go away later | ||
385 | sepId = launchMenu-> insertSeparator ( ); | ||
386 | 309 | ||
387 | if ( !safety_tid ) | ||
388 | safety_tid = startTimer(2000); // TT has 5000, but this is a PITA for a developer ;) (sandman) | ||
389 | } | ||
390 | 310 | ||
391 | void StartMenu::timerEvent(QTimerEvent* e) | 311 | /* |
392 | { | 312 | * Launcher calls loadMenu too often fix that |
393 | if ( e->timerId() == safety_tid ) { | 313 | */ |
394 | Config cfg( "StartMenu" ); | 314 | void StartMenu::addApplets(QPopupMenu* pop) { |
395 | cfg.setGroup( "Applets" ); | 315 | QIntDict<MenuApplet> dict; |
396 | cfg.writeEntry( "SafeMode", FALSE ); | 316 | if( pop-> count ( )) |
397 | killTimer(safety_tid); | 317 | pop-> insertSeparator ( ); |
398 | safety_tid = 0; | 318 | |
319 | for ( QIntDictIterator<MenuApplet> it ( m_applets ); it. current ( ); ++it ) { | ||
320 | MenuApplet *applet = it. current ( ); | ||
321 | if ( applet-> popup ) | ||
322 | applet-> id = pop-> insertItem ( applet-> iface-> icon ( ), applet-> iface-> text ( ), applet-> popup ); | ||
323 | else | ||
324 | applet-> id = pop-> insertItem ( applet-> iface-> icon ( ), applet-> iface-> text ( ) ); | ||
325 | |||
326 | dict.insert( applet->id, new MenuApplet(*applet) ); | ||
399 | } | 327 | } |
328 | /* need to update the key */ | ||
329 | m_applets.setAutoDelete( true ); | ||
330 | m_applets.clear(); | ||
331 | m_applets.setAutoDelete( false ); | ||
332 | m_applets = dict; | ||
400 | } | 333 | } |
401 | |||
diff --git a/core/launcher/startmenu.h b/core/launcher/startmenu.h index 0a91bb8..99df0f0 100644 --- a/core/launcher/startmenu.h +++ b/core/launcher/startmenu.h | |||
@@ -23,5 +23,6 @@ | |||
23 | 23 | ||
24 | #include <qtopia/applnk.h> | ||
25 | #include <qintdict.h> | ||
24 | #include <qstring.h> | 26 | #include <qstring.h> |
25 | #include <qlist.h> | 27 | #include <qlist.h> |
26 | #include <qintdict.h> | ||
27 | #include <qlabel.h> | 28 | #include <qlabel.h> |
@@ -29,6 +30,3 @@ | |||
29 | 30 | ||
30 | #include <qpe/menuappletinterface.h> | 31 | #include <qtopia/menuappletinterface.h> |
31 | |||
32 | class AppLnkSet; | ||
33 | class AppLnk; | ||
34 | 32 | ||
@@ -44,7 +42,5 @@ class QLibrary; | |||
44 | 42 | ||
45 | struct MenuApplet | 43 | |
46 | { | 44 | struct MenuApplet { |
47 | #ifndef QT_NO_COMPONENT | ||
48 | QLibrary *library; | 45 | QLibrary *library; |
49 | #endif | ||
50 | MenuAppletInterface *iface; | 46 | MenuAppletInterface *iface; |
@@ -54,3 +50,2 @@ struct MenuApplet | |||
54 | 50 | ||
55 | |||
56 | class StartMenu : public QLabel { | 51 | class StartMenu : public QLabel { |
@@ -61,3 +56,3 @@ public: | |||
61 | 56 | ||
62 | const AppLnk* execToLink(const QString& appname); | 57 | void refreshMenu(); |
63 | 58 | ||
@@ -66,8 +61,8 @@ public: | |||
66 | 61 | ||
62 | signals: | ||
63 | void tabSelected(const QString&); | ||
64 | |||
67 | public slots: | 65 | public slots: |
68 | void launch( ); | 66 | void launch( ); |
69 | void loadOptions( ); | ||
70 | void createMenu( ); | 67 | void createMenu( ); |
71 | void reloadApps( ); | ||
72 | void reloadApplets( ); | ||
73 | 68 | ||
@@ -78,8 +73,8 @@ protected: | |||
78 | virtual void mousePressEvent( QMouseEvent * ); | 73 | virtual void mousePressEvent( QMouseEvent * ); |
79 | virtual void timerEvent ( QTimerEvent * ); | ||
80 | 74 | ||
81 | private: | 75 | private: |
82 | bool loadMenu( AppLnkSet *folder, QPopupMenu *menu ); | ||
83 | void loadApplets( ); | 76 | void loadApplets( ); |
84 | void clearApplets( ); | 77 | void clearApplets( ); |
78 | void addApplets( QPopupMenu* menu ); | ||
79 | bool loadMenu( QPopupMenu *menu ); | ||
85 | 80 | ||
@@ -92,10 +87,7 @@ private: | |||
92 | 87 | ||
93 | AppLnkSet *apps; | 88 | QStringList tabs; |
94 | 89 | QList<AppLnk> other; | |
95 | QIntDict<MenuApplet> applets; | 90 | QIntDict<MenuApplet> m_applets; |
96 | QIntDict<QPopupMenu> tabdict; | 91 | int ntabs; |
97 | 92 | int nother; | |
98 | // QValueList<MenuApplet> appletList; | ||
99 | int safety_tid; | ||
100 | int sepId; | ||
101 | }; | 93 | }; |