diff options
author | Slávek Banko <[email protected]> | 2016-04-10 10:42:13 +0200 |
---|---|---|
committer | Slávek Banko <[email protected]> | 2016-04-10 10:42:13 +0200 |
commit | ba407974cb68505e03dbf49a9d9cf3843873c8de (patch) | |
tree | c0302b1c937798efa89e1ff50e6a3fca2efc8b56 /src/menuhandler.cpp | |
parent | 7fdc8b30e85418cca031b45ad02f723373b73433 (diff) | |
download | tastymenu-ba407974cb68505e03dbf49a9d9cf3843873c8de.tar.gz tastymenu-ba407974cb68505e03dbf49a9d9cf3843873c8de.zip |
Initial TDE conversion
Signed-off-by: Slávek Banko <[email protected]>
Diffstat (limited to 'src/menuhandler.cpp')
-rw-r--r-- | src/menuhandler.cpp | 78 |
1 files changed, 39 insertions, 39 deletions
diff --git a/src/menuhandler.cpp b/src/menuhandler.cpp index 82b12bf..8ee4508 100644 --- a/src/menuhandler.cpp +++ b/src/menuhandler.cpp @@ -20,8 +20,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ -#include <klocale.h> -#include <kmessagebox.h> +#include <tdelocale.h> +#include <tdemessagebox.h> #include <kuser.h> #include <kstandarddirs.h> #include <kmimetype.h> @@ -29,7 +29,7 @@ #include <tqstyle.h> #include <tqfile.h> #include <tqcursor.h> -#include <kpopupmenu.h> +#include <tdepopupmenu.h> #include <kdebug.h> @@ -47,7 +47,7 @@ MenuHandler::MenuHandler( TQWidget *parent, Prefs *prefs, char *name, WFlags fl) //Kicker config TQString kickerConfPath = locate("config", "kickerrc"); - kickerConf = new KConfig(kickerConfPath); + kickerConf = new TDEConfig(kickerConfPath); kickerConfWatch = new KDirWatch( this ); kickerConfWatch->addFile(kickerConfPath); @@ -83,12 +83,12 @@ MenuHandler::MenuHandler( TQWidget *parent, Prefs *prefs, char *name, WFlags fl) setupColumns(); //Searchline... - iconLoader = KGlobal::iconLoader(); + iconLoader = TDEGlobal::iconLoader(); TQPixmap icon; if( TQApplication::reverseLayout() ) - icon = iconLoader->loadIcon("locationbar_erase", KIcon::Small); + icon = iconLoader->loadIcon("locationbar_erase", TDEIcon::Small); else - icon = iconLoader->loadIcon("clear_left", KIcon::Small); + icon = iconLoader->loadIcon("clear_left", TDEIcon::Small); menu->clearButton->setIconSet(icon); connect(menu->clearButton, SIGNAL(clicked()), menu->searchLine, SLOT (clear()) ); @@ -108,20 +108,20 @@ MenuHandler::MenuHandler( TQWidget *parent, Prefs *prefs, char *name, WFlags fl) menu->logoutButton->installEventFilter(this); //action buttons - icon = iconLoader->loadIcon("exit", KIcon::Toolbar); + icon = iconLoader->loadIcon("system-log-out", TDEIcon::Toolbar); menu->logoutButton->setIconSet(icon); - icon = iconLoader->loadIcon("lock", KIcon::Toolbar); + icon = iconLoader->loadIcon("system-lock-screen", TDEIcon::Toolbar); menu->lockButton->setIconSet(icon); - icon = iconLoader->loadIcon("run", KIcon::Toolbar); + icon = iconLoader->loadIcon("system-run", TDEIcon::Toolbar); menu->runButton->setIconSet(icon); - icon = iconLoader->loadIcon("locationbar_erase", KIcon::Toolbar); + icon = iconLoader->loadIcon("locationbar_erase", TDEIcon::Toolbar); menu->clearRecentButton->setIconSet(icon); setCaption("Tasty Menu"); - setIcon(iconLoader->loadIcon("kmenu", KIcon::Panel)); + setIcon(iconLoader->loadIcon("kmenu", TDEIcon::Panel)); //user icon and login KUser *user = new KUser (); @@ -131,7 +131,7 @@ MenuHandler::MenuHandler( TQWidget *parent, Prefs *prefs, char *name, WFlags fl) ("data", "/home/" + loginName + "/.face.icon")); if( !userImage.isNull() ) { - userImage = userImage.smoothScale (KIcon::SizeSmallMedium, KIcon::SizeSmallMedium); + userImage = userImage.smoothScale (TDEIcon::SizeSmallMedium, TDEIcon::SizeSmallMedium); menu->switchButton->setIconSet(TQPixmap(userImage)); } menu->switchButton->setText(loginName); @@ -190,18 +190,18 @@ void MenuHandler::loadNewInstalledApps() { //Notification for newly installed apps xdgMenuLister = new KDirLister( ); - KStandardDirs *standardDir=new KStandardDirs(); + TDEStandardDirs *standardDir=new TDEStandardDirs(); TQStringList appDirs = standardDir->findDirs("xdgdata-apps", "."); firstListing = 0; for(TQStringList::Iterator it = appDirs.begin(); it != appDirs.end(); ++it) { xdgMenuLister->openURL(*it, true); /*HACK: links to kde programs are often installed in a kde subdirectory - of one of these, so i duplicate all the entries with entry+"kde/"*/ - TQString appDirWithKde = (*it)+"kde/"; - if( TQFile::exists(appDirWithKde) ) + of one of these, so i duplicate all the entries with entry+"tde/"*/ + TQString appDirWithTde = (*it)+"tde/"; + if( TQFile::exists(appDirWithTde) ) { - xdgMenuLister->openURL(appDirWithKde, true); + xdgMenuLister->openURL(appDirWithTde, true); firstListing++; } } @@ -327,13 +327,13 @@ bool MenuHandler::eventFilter( TQObject *o, TQEvent * e ) break; case TQt::Key_Right: - if( dynamic_cast<KListViewSearchLine *>(o) ) + if( dynamic_cast<TDEListViewSearchLine *>(o) ) return false; fData->next()->setFocus(); break; case TQt::Key_Left: - if( dynamic_cast<KListViewSearchLine *>(o) ) + if( dynamic_cast<TDEListViewSearchLine *>(o) ) return false; fData->prev()->setFocus(); break; @@ -416,9 +416,9 @@ void MenuHandler::readConfig() favouriteList = prefSkel->favouriteApps(); if( favouriteList.isEmpty() ) { - favouriteList.append(locate("xdgdata-apps","kde/konqbrowser.desktop")); - favouriteList.append(locate("xdgdata-apps","kde/KMail.desktop")); - favouriteList.append(locate("xdgdata-apps","kde/Help.desktop")); + favouriteList.append(locate("xdgdata-apps","tde/konqbrowser.desktop")); + favouriteList.append(locate("xdgdata-apps","tde/KMail.desktop")); + favouriteList.append(locate("xdgdata-apps","tde/Help.desktop")); } _showExpander = prefSkel->showExpander(); @@ -466,7 +466,7 @@ void MenuHandler::readConfig() // disconnect(menu->searchLine, 0, 0, 0); if( !_kerryIntegration && !_strigiIntegration ) { - //menu->searchLine->setListView((KListView *)(menu->dynamicList)); + //menu->searchLine->setListView((TDEListView *)(menu->dynamicList)); disconnect(menu->searchLine, SIGNAL(returnPressed( const TQString &)), this, SLOT (kerrySearch( const TQString &)) ); disconnect(menu->searchLine, SIGNAL(returnPressed( const TQString &)), @@ -749,7 +749,7 @@ void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *list if(numChilds == 0) continue; - TQPixmap iconPix = iconLoader->loadIcon(g->icon(), KIcon::Toolbar,iconSize); + TQPixmap iconPix = iconLoader->loadIcon(g->icon(), TDEIcon::Toolbar,iconSize); if ( iconPix.height () != iconSize) { @@ -899,7 +899,7 @@ void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *list prevListItem = listItem; - TQPixmap iconPix = s->pixmap( KIcon::Toolbar, iconSize ); + TQPixmap iconPix = s->pixmap( TDEIcon::Toolbar, iconSize ); if ( iconPix.height () != iconSize) { TQImage img = iconPix.convertToImage(); @@ -973,7 +973,7 @@ void MenuHandler::fillRecentDocuments( ) menu->dynamicList->clear(); setupDynList( RecentDocuments ); - TQStringList recentDocsList = KRecentDocument::recentDocuments(); + TQStringList recentDocsList = TDERecentDocument::recentDocuments(); TastyListViewItem *listItem = NULL; @@ -994,7 +994,7 @@ void MenuHandler::fillRecentDocuments( ) listItem->setDeskopEntryPath(*it); listItem->setType( TastyListViewItem::DesktopFile ); - TQPixmap iconPix = iconLoader->loadIcon(f->readIcon(), KIcon::Panel, _iconSize1); + TQPixmap iconPix = iconLoader->loadIcon(f->readIcon(), TDEIcon::Panel, _iconSize1); if ( iconPix.height () > _iconSize1) { TQImage img = iconPix.convertToImage(); @@ -1041,7 +1041,7 @@ void MenuHandler::fillMoreUsed( ) listItem->setDisplaySubText(_displaySubText); - TQPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); + TQPixmap iconPix = s->pixmap( TDEIcon::Toolbar, _iconSize1 ); if( !iconPix.isNull() ) { if ( iconPix.height () != _iconSize1) @@ -1090,7 +1090,7 @@ void MenuHandler::fillRecentlyUsed( ) listItem->setDisplaySubText(_displaySubText); - TQPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); + TQPixmap iconPix = s->pixmap( TDEIcon::Toolbar, _iconSize1 ); if( !iconPix.isNull() ) { if ( iconPix.height () != _iconSize1) @@ -1135,7 +1135,7 @@ void MenuHandler::fillFavourites( ) listItem->setDisplaySubText(_displaySubText); - TQPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); + TQPixmap iconPix = s->pixmap( TDEIcon::Toolbar, _iconSize1 ); if ( iconPix.height () > _iconSize1) { TQImage img = iconPix.convertToImage(); @@ -1214,7 +1214,7 @@ void MenuHandler::slotApplicationRemoved() void MenuHandler::slotUpdateApplications() { - KRun::runCommand ("kbuildsycoca"); + KRun::runCommand ("tdebuildsycoca"); prefSkel->writeConfig(); menu->rootList->clear(); KServiceGroup::Ptr service = KServiceGroup::root(); @@ -1286,7 +1286,7 @@ void MenuHandler::listClicked( TastyListViewItem * listItem, const TQPoint & coo slotUpdateApplications(); } - int started = KApplication::startServiceByDesktopPath( servicePath ); + int started = TDEApplication::startServiceByDesktopPath( servicePath ); if( !started ) { DCOPRef kickerKMenuIface ("kicker", "KMenu"); @@ -1417,7 +1417,7 @@ void MenuHandler::slotContextMenu(TQListViewItem *listItem, const TQPoint &coord if( !tastyListItem ) return; - KPopupMenu menu(this); + TDEPopupMenu menu(this); menu.insertTitle(tastyListItem->text(c)); if( tastyListItem->getPath() != "" ) @@ -1489,7 +1489,7 @@ void MenuHandler::runDialog() kdesktopKDesktopIface.call ("popupExecuteCommand()"); } -/*Following functions are from official KDE Kmenu, Copyright 1996-2006 the kicker authors*/ +/*Following functions are from official KDE KMenu, Copyright 1996-2006 the kicker authors*/ void MenuHandler::slotPopulateSessions() { @@ -1498,7 +1498,7 @@ void MenuHandler::slotPopulateSessions() sessionsMenu->clear(); - sessionsMenu->insertItem(SmallIconSet("personal"), i18n("Edit user profile..."), 100 ); + sessionsMenu->insertItem(SmallIconSet("preferences-desktop-personal"), i18n("Edit user profile..."), 100 ); sessionsMenu->insertSeparator(); //optional save/restore session entries @@ -1538,7 +1538,7 @@ void MenuHandler::slotSessionActivated( int ent ) { case 100: close(); - KRun::runCommand ("kcmshell kcm_useraccount"); + KRun::runCommand ("tdecmshell kcm_useraccount"); break; case 101: { @@ -1595,7 +1595,7 @@ void MenuHandler::initializeSearch( const TQString & query ) if( !searchMode && query.length() > 2 ) { if( !menu->searchLine->listView() ) - menu->searchLine->setListView((KListView *)(menu->dynamicList)); + menu->searchLine->setListView((TDEListView *)(menu->dynamicList)); searchMode = true; menu->menuModes->setEnabled(false); KServiceGroup::Ptr service = KServiceGroup::root(); @@ -1647,7 +1647,7 @@ void MenuHandler::clearDynList( ) break; } case RecentDocuments: - KRecentDocument::clear(); + TDERecentDocument::clear(); break; default: break; |