-rw-r--r-- | core/launcher/startmenu.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp index 15707b4..5bac874 100644 --- a/core/launcher/startmenu.cpp +++ b/core/launcher/startmenu.cpp @@ -72,97 +72,97 @@ void StartMenu::loadOptions() Config config("StartMenu"); config.setGroup( "StartMenu" ); QString tmpBoolString1 = config.readEntry( "UseWidePopupMenu", "FALSE" ); useWidePopupMenu = ( tmpBoolString1 == "TRUE" ) ? TRUE : FALSE; 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", "go" ); #else // Basically just #include the .qpe_menu.conf file settings useWidePopupMenu = FALSE; popupMenuSidePixmap = "lauchner/sidebar"; startButtonIsFlat = TRUE; startButtonPixmap = "launcher/start_button"; #endif } void StartMenu::createMenu() { if ( useWidePopupMenu ) launchMenu = new PopupWithLaunchSideThing( this, &popupMenuSidePixmap ); else launchMenu = new StartPopupMenu( this ); loadMenu( apps, launchMenu ); } void StartMenu::itemSelected( int id ) { const AppLnk *app = apps->find( id ); if ( app ) app->execute(); } bool StartMenu::loadMenu( AppLnkSet *folder, QPopupMenu *menu ) { bool result = FALSE; QStringList typs = folder->types(); QDict<QPopupMenu> typpop; for (QStringList::Iterator tit=typs.begin(); tit!=typs.end(); ++tit) { if ( !(*tit).isEmpty() ) { QPopupMenu *new_menu = new StartPopupMenu( menu ); typpop.insert(*tit, new_menu); connect( new_menu, SIGNAL(activated(int)), SLOT(itemSelected(int)) ); - menu->insertItem( folder->typePixmap(*tit), *tit, new_menu ); + menu->insertItem( folder->typePixmap(*tit), folder->typeName(*tit), new_menu ); } } QListIterator<AppLnk> it( folder->children() ); for ( ; it.current(); ++it ) { AppLnk *app = it.current(); if ( app->type() == "Separator" ) { menu->insertSeparator(); } else { QString t = app->type(); QPopupMenu* pmenu = typpop.find(t); if ( !pmenu ) pmenu = menu; pmenu->insertItem( app->pixmap(), app->name(), app->id() ); result=TRUE; } } if ( result ) connect( menu, SIGNAL(activated(int)), SLOT(itemSelected(int)) ); return result; } void StartMenu::launch() { int y = mapToGlobal( QPoint() ).y() - launchMenu->sizeHint().height(); if ( launchMenu->isVisible() ) launchMenu->hide(); else launchMenu->popup( QPoint( 1, y ) ); } const AppLnk* StartMenu::execToLink(const QString& appname) { const AppLnk* a = apps->findExec( appname ); return a; } void StartPopupMenu::keyPressEvent( QKeyEvent *e ) { if ( e->key() == Key_F33 || e->key() == Key_Space ) { // "OK" button, little hacky QKeyEvent ke(QEvent::KeyPress, Key_Enter, 13, 0); QPopupMenu::keyPressEvent( &ke ); } else { |