-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 @@ -18,9 +18,9 @@ ** **********************************************************************/ #define INCLUDE_MENUITEM_DEF - + #include "startmenu.h" #include "sidething.h" //#include "mrulist.h" #include "info.h" @@ -55,9 +55,9 @@ StartMenu::StartMenu(QWidget *parent) : QLabel( parent ) apps = 0; launchMenu = 0; applets. setAutoDelete ( true ); sepId = 0; - + reloadApps ( ); reloadApplets ( ); } @@ -87,15 +87,15 @@ void StartMenu::loadOptions() QString tmpBoolString2 = config.readEntry( "StartButtonIsFlat", "TRUE" ); startButtonIsFlat = ( tmpBoolString2 == "TRUE" ) ? TRUE : FALSE; QString tmpBoolString3 = config.readEntry( "UseMRUList", "TRUE" ); popupMenuSidePixmap = config.readEntry( "PopupMenuSidePixmap", "launcher/sidebar" ); - startButtonPixmap = config.readEntry( "StartButtonPixmap", "launcher/start_button" ); + startButtonPixmap = config.readEntry( "StartButtonPixmap", "go" ); #else // Basically just #include the .qpe_menu.conf file settings useWidePopupMenu = FALSE; popupMenuSidePixmap = "launcher/sidebar"; startButtonIsFlat = TRUE; - startButtonPixmap = "launcher/start_button"; // No tr + startButtonPixmap = "go"; // No tr #endif } @@ -108,9 +108,9 @@ void StartMenu::createMenu() launchMenu = new StartPopupMenu( this ); loadMenu ( apps, launchMenu ); loadApplets ( ); - + connect( launchMenu, SIGNAL(activated(int)), SLOT(itemSelected(int)) ); } void StartMenu::reloadApps() @@ -128,9 +128,9 @@ void StartMenu::reloadApps() apps = new AppLnkSet( QPEApplication::qpeDir() + "apps" ); } if ( launchMenu ) { launchMenu-> hide ( ); - + for ( QIntDictIterator<QPopupMenu> it ( tabdict ); it. current ( ); ++it ) { launchMenu-> removeItem ( it. currentKey ( )); delete it.current ( ); } @@ -157,12 +157,12 @@ void StartMenu::itemSelected( int id ) if ( app ) app->execute(); else { MenuApplet *applet = applets. find ( id ); - + if ( applet ) applet-> iface-> activated ( ); - } + } } bool StartMenu::loadMenu( AppLnkSet *folder, QPopupMenu *menu ) { @@ -172,11 +172,11 @@ bool StartMenu::loadMenu( AppLnkSet *folder, QPopupMenu *menu ) cfg.setGroup("Menu"); bool ltabs = cfg.readBoolEntry("LauncherTabs",TRUE); bool lot = cfg.readBoolEntry("LauncherOther",TRUE); - + tabdict. clear ( ); - + if ( sepId ) menu-> removeItem ( sepId ); sepId = ( menu-> count ( )) ? menu-> insertSeparator ( 0 ) : 0; @@ -229,15 +229,15 @@ bool StartMenu::loadMenu( AppLnkSet *folder, QPopupMenu *menu ) } } } - if ( sepId && ( menu-> idAt ( 0 ) == sepId )) { // no tabs entries + if ( sepId && ( menu-> idAt ( 0 ) == sepId )) { // no tabs entries menu-> removeItem ( sepId ); sepId = 0; } if ( !menu-> count ( )) // if we don't do this QPopupMenu will insert a dummy Separator, which won't go away later sepId = menu-> insertSeparator ( ); - + return result; } @@ -251,9 +251,9 @@ void StartMenu::launch ( ) else { QWidget *active = qApp-> activeWindow ( ); if ( active && active-> isPopup ( )) active-> close ( ); - + launchMenu-> popup ( QPoint ( 1, y )); } } @@ -292,9 +292,9 @@ void StartMenu::clearApplets() if ( launchMenu ) { launchMenu-> removeItem ( applet-> id ); delete applet-> popup; } - + applet-> iface-> release(); applet-> library-> unload(); delete applet-> library; } @@ -306,12 +306,12 @@ void StartMenu::clearApplets() void StartMenu::loadApplets() { Config cfg( "StartMenu" ); cfg.setGroup( "Applets" ); - + // SafeMode causes too much problems, so we disable it for now -- // maybe we should reenable it for OPIE 1.0 - sandman 26.09.02 - + bool safe = false; //cfg.readBoolEntry("SafeMode",FALSE); if ( safe && !safety_tid ) return; cfg.writeEntry("SafeMode",TRUE); @@ -334,16 +334,16 @@ void StartMenu::loadApplets() MenuApplet *applet = new MenuApplet; xapplets[napplets++] = applet; applet->library = lib; applet->iface = iface; - + QTranslator *trans = new QTranslator(qApp); QString type = (*it).left( (*it).find(".") ); QString tfn = QPEApplication::qpeDir()+"/i18n/"+lang+"/"+type+".qm"; if ( trans->load( tfn )) qApp->installTranslator( trans ); else - delete trans; + delete trans; } else { exclude += *it; delete lib; } @@ -353,29 +353,29 @@ void StartMenu::loadApplets() if ( sepId ) launchMenu-> removeItem ( sepId ); sepId = ( launchMenu-> count ( )) ? launchMenu-> insertSeparator ( ) : 0; - + while (napplets--) { MenuApplet *applet = xapplets[napplets]; - + applet-> popup = applet-> iface-> popup ( this ); - + if ( applet-> popup ) applet-> id = launchMenu-> insertItem ( applet-> iface-> icon ( ), applet-> iface-> text ( ), applet-> popup ); - else + else applet-> id = launchMenu-> insertItem ( applet-> iface-> icon ( ), applet-> iface-> text ( ) ); applets.insert ( applet-> id, new MenuApplet(*applet)); } delete [] xapplets; - + if ( sepId && ( launchMenu-> idAt ( launchMenu-> count ( ) - 1 ) == sepId )) { // no applets launchMenu-> removeItem ( sepId ); sepId = 0; } if ( !launchMenu-> count ( )) // if we don't do this QPopupMenu will insert a dummy Separator, which won't go away later sepId = launchMenu-> insertSeparator ( ); - + if ( !safety_tid ) safety_tid = startTimer(2000); // TT has 5000, but this is a PITA for a developer ;) (sandman) } |