-rw-r--r-- | core/launcher/startmenu.cpp | 48 |
1 files changed, 24 insertions, 24 deletions
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp index 39e07c8..2871233 100644 --- a/core/launcher/startmenu.cpp +++ b/core/launcher/startmenu.cpp | |||
@@ -19,7 +19,7 @@ | |||
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #define INCLUDE_MENUITEM_DEF | 21 | #define INCLUDE_MENUITEM_DEF |
22 | 22 | ||
23 | #include "startmenu.h" | 23 | #include "startmenu.h" |
24 | #include "sidething.h" | 24 | #include "sidething.h" |
25 | //#include "mrulist.h" | 25 | //#include "mrulist.h" |
@@ -56,7 +56,7 @@ StartMenu::StartMenu(QWidget *parent) : QLabel( parent ) | |||
56 | launchMenu = 0; | 56 | launchMenu = 0; |
57 | applets. setAutoDelete ( true ); | 57 | applets. setAutoDelete ( true ); |
58 | sepId = 0; | 58 | sepId = 0; |
59 | 59 | ||
60 | reloadApps ( ); | 60 | reloadApps ( ); |
61 | reloadApplets ( ); | 61 | reloadApplets ( ); |
62 | } | 62 | } |
@@ -88,13 +88,13 @@ void StartMenu::loadOptions() | |||
88 | startButtonIsFlat = ( tmpBoolString2 == "TRUE" ) ? TRUE : FALSE; | 88 | startButtonIsFlat = ( tmpBoolString2 == "TRUE" ) ? TRUE : FALSE; |
89 | QString tmpBoolString3 = config.readEntry( "UseMRUList", "TRUE" ); | 89 | QString tmpBoolString3 = config.readEntry( "UseMRUList", "TRUE" ); |
90 | popupMenuSidePixmap = config.readEntry( "PopupMenuSidePixmap", "launcher/sidebar" ); | 90 | popupMenuSidePixmap = config.readEntry( "PopupMenuSidePixmap", "launcher/sidebar" ); |
91 | startButtonPixmap = config.readEntry( "StartButtonPixmap", "launcher/start_button" ); | 91 | startButtonPixmap = config.readEntry( "StartButtonPixmap", "go" ); |
92 | #else | 92 | #else |
93 | // Basically just #include the .qpe_menu.conf file settings | 93 | // Basically just #include the .qpe_menu.conf file settings |
94 | useWidePopupMenu = FALSE; | 94 | useWidePopupMenu = FALSE; |
95 | popupMenuSidePixmap = "launcher/sidebar"; | 95 | popupMenuSidePixmap = "launcher/sidebar"; |
96 | startButtonIsFlat = TRUE; | 96 | startButtonIsFlat = TRUE; |
97 | startButtonPixmap = "launcher/start_button"; // No tr | 97 | startButtonPixmap = "go"; // No tr |
98 | #endif | 98 | #endif |
99 | } | 99 | } |
100 | 100 | ||
@@ -109,7 +109,7 @@ void StartMenu::createMenu() | |||
109 | 109 | ||
110 | loadMenu ( apps, launchMenu ); | 110 | loadMenu ( apps, launchMenu ); |
111 | loadApplets ( ); | 111 | loadApplets ( ); |
112 | 112 | ||
113 | connect( launchMenu, SIGNAL(activated(int)), SLOT(itemSelected(int)) ); | 113 | connect( launchMenu, SIGNAL(activated(int)), SLOT(itemSelected(int)) ); |
114 | } | 114 | } |
115 | 115 | ||
@@ -129,7 +129,7 @@ void StartMenu::reloadApps() | |||
129 | } | 129 | } |
130 | if ( launchMenu ) { | 130 | if ( launchMenu ) { |
131 | launchMenu-> hide ( ); | 131 | launchMenu-> hide ( ); |
132 | 132 | ||
133 | for ( QIntDictIterator<QPopupMenu> it ( tabdict ); it. current ( ); ++it ) { | 133 | for ( QIntDictIterator<QPopupMenu> it ( tabdict ); it. current ( ); ++it ) { |
134 | launchMenu-> removeItem ( it. currentKey ( )); | 134 | launchMenu-> removeItem ( it. currentKey ( )); |
135 | delete it.current ( ); | 135 | delete it.current ( ); |
@@ -158,10 +158,10 @@ void StartMenu::itemSelected( int id ) | |||
158 | app->execute(); | 158 | app->execute(); |
159 | else { | 159 | else { |
160 | MenuApplet *applet = applets. find ( id ); | 160 | MenuApplet *applet = applets. find ( id ); |
161 | 161 | ||
162 | if ( applet ) | 162 | if ( applet ) |
163 | applet-> iface-> activated ( ); | 163 | applet-> iface-> activated ( ); |
164 | } | 164 | } |
165 | } | 165 | } |
166 | 166 | ||
167 | bool StartMenu::loadMenu( AppLnkSet *folder, QPopupMenu *menu ) | 167 | bool StartMenu::loadMenu( AppLnkSet *folder, QPopupMenu *menu ) |
@@ -173,9 +173,9 @@ bool StartMenu::loadMenu( AppLnkSet *folder, QPopupMenu *menu ) | |||
173 | 173 | ||
174 | bool ltabs = cfg.readBoolEntry("LauncherTabs",TRUE); | 174 | bool ltabs = cfg.readBoolEntry("LauncherTabs",TRUE); |
175 | bool lot = cfg.readBoolEntry("LauncherOther",TRUE); | 175 | bool lot = cfg.readBoolEntry("LauncherOther",TRUE); |
176 | 176 | ||
177 | tabdict. clear ( ); | 177 | tabdict. clear ( ); |
178 | 178 | ||
179 | if ( sepId ) | 179 | if ( sepId ) |
180 | menu-> removeItem ( sepId ); | 180 | menu-> removeItem ( sepId ); |
181 | sepId = ( menu-> count ( )) ? menu-> insertSeparator ( 0 ) : 0; | 181 | sepId = ( menu-> count ( )) ? menu-> insertSeparator ( 0 ) : 0; |
@@ -230,13 +230,13 @@ bool StartMenu::loadMenu( AppLnkSet *folder, QPopupMenu *menu ) | |||
230 | } | 230 | } |
231 | } | 231 | } |
232 | 232 | ||
233 | if ( sepId && ( menu-> idAt ( 0 ) == sepId )) { // no tabs entries | 233 | if ( sepId && ( menu-> idAt ( 0 ) == sepId )) { // no tabs entries |
234 | menu-> removeItem ( sepId ); | 234 | menu-> removeItem ( sepId ); |
235 | sepId = 0; | 235 | sepId = 0; |
236 | } | 236 | } |
237 | if ( !menu-> count ( )) // if we don't do this QPopupMenu will insert a dummy Separator, which won't go away later | 237 | if ( !menu-> count ( )) // if we don't do this QPopupMenu will insert a dummy Separator, which won't go away later |
238 | sepId = menu-> insertSeparator ( ); | 238 | sepId = menu-> insertSeparator ( ); |
239 | 239 | ||
240 | return result; | 240 | return result; |
241 | } | 241 | } |
242 | 242 | ||
@@ -252,7 +252,7 @@ void StartMenu::launch ( ) | |||
252 | QWidget *active = qApp-> activeWindow ( ); | 252 | QWidget *active = qApp-> activeWindow ( ); |
253 | if ( active && active-> isPopup ( )) | 253 | if ( active && active-> isPopup ( )) |
254 | active-> close ( ); | 254 | active-> close ( ); |
255 | 255 | ||
256 | launchMenu-> popup ( QPoint ( 1, y )); | 256 | launchMenu-> popup ( QPoint ( 1, y )); |
257 | } | 257 | } |
258 | } | 258 | } |
@@ -293,7 +293,7 @@ void StartMenu::clearApplets() | |||
293 | launchMenu-> removeItem ( applet-> id ); | 293 | launchMenu-> removeItem ( applet-> id ); |
294 | delete applet-> popup; | 294 | delete applet-> popup; |
295 | } | 295 | } |
296 | 296 | ||
297 | applet-> iface-> release(); | 297 | applet-> iface-> release(); |
298 | applet-> library-> unload(); | 298 | applet-> library-> unload(); |
299 | delete applet-> library; | 299 | delete applet-> library; |
@@ -307,10 +307,10 @@ void StartMenu::loadApplets() | |||
307 | { | 307 | { |
308 | Config cfg( "StartMenu" ); | 308 | Config cfg( "StartMenu" ); |
309 | cfg.setGroup( "Applets" ); | 309 | cfg.setGroup( "Applets" ); |
310 | 310 | ||
311 | // SafeMode causes too much problems, so we disable it for now -- | 311 | // SafeMode causes too much problems, so we disable it for now -- |
312 | // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02 | 312 | // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02 |
313 | 313 | ||
314 | bool safe = false; //cfg.readBoolEntry("SafeMode",FALSE); | 314 | bool safe = false; //cfg.readBoolEntry("SafeMode",FALSE); |
315 | if ( safe && !safety_tid ) | 315 | if ( safe && !safety_tid ) |
316 | return; | 316 | return; |
@@ -335,14 +335,14 @@ void StartMenu::loadApplets() | |||
335 | xapplets[napplets++] = applet; | 335 | xapplets[napplets++] = applet; |
336 | applet->library = lib; | 336 | applet->library = lib; |
337 | applet->iface = iface; | 337 | applet->iface = iface; |
338 | 338 | ||
339 | QTranslator *trans = new QTranslator(qApp); | 339 | QTranslator *trans = new QTranslator(qApp); |
340 | QString type = (*it).left( (*it).find(".") ); | 340 | QString type = (*it).left( (*it).find(".") ); |
341 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; | 341 | QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; |
342 | if ( trans->load( tfn )) | 342 | if ( trans->load( tfn )) |
343 | qApp->installTranslator( trans ); | 343 | qApp->installTranslator( trans ); |
344 | else | 344 | else |
345 | delete trans; | 345 | delete trans; |
346 | } else { | 346 | } else { |
347 | exclude += *it; | 347 | exclude += *it; |
348 | delete lib; | 348 | delete lib; |
@@ -354,27 +354,27 @@ void StartMenu::loadApplets() | |||
354 | if ( sepId ) | 354 | if ( sepId ) |
355 | launchMenu-> removeItem ( sepId ); | 355 | launchMenu-> removeItem ( sepId ); |
356 | sepId = ( launchMenu-> count ( )) ? launchMenu-> insertSeparator ( ) : 0; | 356 | sepId = ( launchMenu-> count ( )) ? launchMenu-> insertSeparator ( ) : 0; |
357 | 357 | ||
358 | while (napplets--) { | 358 | while (napplets--) { |
359 | MenuApplet *applet = xapplets[napplets]; | 359 | MenuApplet *applet = xapplets[napplets]; |
360 | 360 | ||
361 | applet-> popup = applet-> iface-> popup ( this ); | 361 | applet-> popup = applet-> iface-> popup ( this ); |
362 | 362 | ||
363 | if ( applet-> popup ) | 363 | if ( applet-> popup ) |
364 | applet-> id = launchMenu-> insertItem ( applet-> iface-> icon ( ), applet-> iface-> text ( ), applet-> popup ); | 364 | applet-> id = launchMenu-> insertItem ( applet-> iface-> icon ( ), applet-> iface-> text ( ), applet-> popup ); |
365 | else | 365 | else |
366 | applet-> id = launchMenu-> insertItem ( applet-> iface-> icon ( ), applet-> iface-> text ( ) ); | 366 | applet-> id = launchMenu-> insertItem ( applet-> iface-> icon ( ), applet-> iface-> text ( ) ); |
367 | applets.insert ( applet-> id, new MenuApplet(*applet)); | 367 | applets.insert ( applet-> id, new MenuApplet(*applet)); |
368 | } | 368 | } |
369 | delete [] xapplets; | 369 | delete [] xapplets; |
370 | 370 | ||
371 | if ( sepId && ( launchMenu-> idAt ( launchMenu-> count ( ) - 1 ) == sepId )) { // no applets | 371 | if ( sepId && ( launchMenu-> idAt ( launchMenu-> count ( ) - 1 ) == sepId )) { // no applets |
372 | launchMenu-> removeItem ( sepId ); | 372 | launchMenu-> removeItem ( sepId ); |
373 | sepId = 0; | 373 | sepId = 0; |
374 | } | 374 | } |
375 | if ( !launchMenu-> count ( )) // if we don't do this QPopupMenu will insert a dummy Separator, which won't go away later | 375 | if ( !launchMenu-> count ( )) // if we don't do this QPopupMenu will insert a dummy Separator, which won't go away later |
376 | sepId = launchMenu-> insertSeparator ( ); | 376 | sepId = launchMenu-> insertSeparator ( ); |
377 | 377 | ||
378 | if ( !safety_tid ) | 378 | if ( !safety_tid ) |
379 | safety_tid = startTimer(2000); // TT has 5000, but this is a PITA for a developer ;) (sandman) | 379 | safety_tid = startTimer(2000); // TT has 5000, but this is a PITA for a developer ;) (sandman) |
380 | } | 380 | } |