author | harlekin <harlekin> | 2002-05-15 17:18:38 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2002-05-15 17:18:38 (UTC) |
commit | f67dd09ba006b52a25ec1a0a828f6a72b70291e0 (patch) (side-by-side diff) | |
tree | e82fdc38c6dc32bf1f5a4d28a5a64b7101e254f5 | |
parent | 443c88975417cb4dc080392abd07be7723c38c62 (diff) | |
download | opie-f67dd09ba006b52a25ec1a0a828f6a72b70291e0.zip opie-f67dd09ba006b52a25ec1a0a828f6a72b70291e0.tar.gz opie-f67dd09ba006b52a25ec1a0a828f6a72b70291e0.tar.bz2 |
sidebar is back for testing
-rw-r--r-- | core/launcher/startmenu.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/core/launcher/startmenu.cpp b/core/launcher/startmenu.cpp index 237a2de..15707b4 100644 --- a/core/launcher/startmenu.cpp +++ b/core/launcher/startmenu.cpp @@ -15,134 +15,134 @@ ** ** Contact info@trolltech.com if any conditions of this licensing are ** not clear to you. ** **********************************************************************/ #include "startmenu.h" #include "sidething.h" #include "mrulist.h" #include "info.h" #include <qpe/qpeapplication.h> #include <qpe/config.h> #include <qpe/applnk.h> #include <qpe/global.h> #include <qpe/resource.h> #include <qdict.h> #include <stdlib.h> // #define USE_CONFIG_FILE StartMenu::StartMenu(QWidget *parent) : QLabel( parent ) { loadOptions(); setPixmap( Resource::loadPixmap( startButtonPixmap ) ); setFocusPolicy( NoFocus ); //setFlat( startButtonIsFlat ); apps = new AppLnkSet( QPEApplication::qpeDir() + "apps" ); createMenu(); } void StartMenu::mousePressEvent( QMouseEvent * ) { launch(); if (desktopInfo) desktopInfo->menuClicked(); } StartMenu::~StartMenu() { delete apps; } void StartMenu::loadOptions() { #ifdef USE_CONFIG_FILE // Read configuration file 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", "sidebar" ); + popupMenuSidePixmap = config.readEntry( "PopupMenuSidePixmap", "launcher/sidebar" ); startButtonPixmap = config.readEntry( "StartButtonPixmap", "go" ); #else // Basically just #include the .qpe_menu.conf file settings useWidePopupMenu = FALSE; - popupMenuSidePixmap = "go"; + 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 ); } } 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(); |