diff options
author | Slávek Banko <slavek.banko@axis.cz> | 2016-04-10 10:42:13 +0200 |
---|---|---|
committer | Slávek Banko <slavek.banko@axis.cz> | 2016-04-10 10:42:13 +0200 |
commit | ba407974cb68505e03dbf49a9d9cf3843873c8de (patch) | |
tree | c0302b1c937798efa89e1ff50e6a3fca2efc8b56 /src | |
parent | 7fdc8b30e85418cca031b45ad02f723373b73433 (diff) | |
download | tastymenu-ba407974cb68505e03dbf49a9d9cf3843873c8de.tar.gz tastymenu-ba407974cb68505e03dbf49a9d9cf3843873c8de.zip |
Initial TDE conversion
Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/appearance.ui | 4 | ||||
-rw-r--r-- | src/behaviour.ui | 2 | ||||
-rw-r--r-- | src/dmctl.cpp | 30 | ||||
-rw-r--r-- | src/dmctl.h | 10 | ||||
-rw-r--r-- | src/menu.ui | 4 | ||||
-rw-r--r-- | src/menuhandler.cpp | 78 | ||||
-rw-r--r-- | src/menuhandler.h | 16 | ||||
-rw-r--r-- | src/prefs.kcfgc | 2 | ||||
-rw-r--r-- | src/tastybutton.cpp | 6 | ||||
-rw-r--r-- | src/tastybutton.h | 2 | ||||
-rw-r--r-- | src/tastylistview.cpp | 46 | ||||
-rw-r--r-- | src/tastylistview.h | 20 | ||||
-rw-r--r-- | src/tastymenu.cpp | 72 | ||||
-rw-r--r-- | src/tastymenu.desktop | 6 | ||||
-rw-r--r-- | src/tastymenu.h | 12 | ||||
-rw-r--r-- | src/tastymenu.lsm | 4 | ||||
-rw-r--r-- | src/tastytooltip.cpp | 10 |
18 files changed, 163 insertions, 163 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index c19c283..74df63e 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -7,7 +7,7 @@ tastymenu_panelapplet_la_SOURCES = tastymenu.cpp menu.ui menuhandler.cpp \ dmctl.cpp dmctl.h tastylistview.cpp misc.cpp misc.h appearance.ui prefs.kcfgc \ behaviour.ui tastytooltip.cpp tastytooltipwidget.ui tastybutton.cpp tastymenu_panelapplet_la_LDFLAGS = -version-info 0:0:0 -module $(KDE_PLUGIN) $(all_libraries) -tastymenu_panelapplet_la_LIBADD = $(LIB_QT) -lDCOP $(LIB_KDECORE) $(LIB_KDEUI) $(LIB_KIO) -lkdefx -lXau +tastymenu_panelapplet_la_LIBADD = $(LIB_QT) -lDCOP $(LIB_TDECORE) $(LIB_TDEUI) $(LIB_TDEIO) -ltdefx -lXau tastymenu_DATA = tastymenu.desktop tastymenudir = $(kde_datadir)/kicker/applets diff --git a/src/appearance.ui b/src/appearance.ui index 973952f..bacdabd 100644 --- a/src/appearance.ui +++ b/src/appearance.ui @@ -226,7 +226,7 @@ Empty means default.</string> <bool>true</bool> </property> </widget> - <widget class="KIconButton"> + <widget class="TDEIconButton"> <property name="name"> <cstring>MenuButtonIcon</cstring> </property> @@ -242,7 +242,7 @@ Empty means default.</string> <string></string> </property> <property name="whatsThis" stdset="0"> - <string>What icon should be displayed in the kicker button instead of the KMenu one. + <string>What icon should be displayed in the kicker button instead of the TMenu one. Empty means default.</string> </property> </widget> diff --git a/src/behaviour.ui b/src/behaviour.ui index eaf4554..ef434ab 100644 --- a/src/behaviour.ui +++ b/src/behaviour.ui @@ -63,7 +63,7 @@ <string>Alt+O</string> </property> <property name="whatsThis" stdset="0"> - <string>Pops up Tasty Menu instead of KMenu when the shortcut sequence Alt+F1 is pressed</string> + <string>Pops up Tasty Menu instead of TMenu when the shortcut sequence Alt+F1 is pressed</string> </property> </widget> <spacer row="1" column="0"> diff --git a/src/dmctl.cpp b/src/dmctl.cpp index 65c255c..c6d3110 100644 --- a/src/dmctl.cpp +++ b/src/dmctl.cpp @@ -21,7 +21,7 @@ #ifdef Q_WS_X11 -#include <klocale.h> +#include <tdelocale.h> #include <dcopclient.h> #include <tqregexp.h> @@ -106,16 +106,16 @@ DM::exec( const char *cmd ) } /** - * Execute a KDM/GDM remote control command. + * Execute a TDM/GDM remote control command. * @param cmd the command to execute. FIXME: undocumented yet. * @param buf the result buffer. * @return result: * @li If true, the command was successfully executed. * @p ret might contain addional results. * @li If false and @p ret is empty, a communication error occurred - * (most probably KDM is not running). + * (most probably TDM is not running). * @li If false and @p ret is non-empty, it contains the error message - * from KDM. + * from TDM. */ bool DM::exec( const char *cmd, TQCString &buf ) @@ -176,11 +176,11 @@ DM::canShutdown() } void -DM::shutdown( KApplication::ShutdownType shutdownType, - KApplication::ShutdownMode shutdownMode, /* NOT Default */ +DM::shutdown( TDEApplication::ShutdownType shutdownType, + TDEApplication::ShutdownMode shutdownMode, /* NOT Default */ const TQString &bootOption ) { - if (shutdownType == KApplication::ShutdownTypeNone) + if (shutdownType == TDEApplication::ShutdownTypeNone) return; bool cap_ask; @@ -192,26 +192,26 @@ DM::shutdown( KApplication::ShutdownType shutdownType, return; cap_ask = false; } - if (!cap_ask && shutdownMode == KApplication::ShutdownModeInteractive) - shutdownMode = KApplication::ShutdownModeForceNow; + if (!cap_ask && shutdownMode == TDEApplication::ShutdownModeInteractive) + shutdownMode = TDEApplication::ShutdownModeForceNow; TQCString cmd; if (DMType == GDM) { - cmd.append( shutdownMode == KApplication::ShutdownModeForceNow ? + cmd.append( shutdownMode == TDEApplication::ShutdownModeForceNow ? "SET_LOGOUT_ACTION " : "SET_SAFE_LOGOUT_ACTION " ); - cmd.append( shutdownType == KApplication::ShutdownTypeReboot ? + cmd.append( shutdownType == TDEApplication::ShutdownTypeReboot ? "REBOOT\n" : "HALT\n" ); } else { cmd.append( "shutdown\t" ); - cmd.append( shutdownType == KApplication::ShutdownTypeReboot ? + cmd.append( shutdownType == TDEApplication::ShutdownTypeReboot ? "reboot\t" : "halt\t" ); if (!bootOption.isNull()) cmd.append( "=" ).append( bootOption.local8Bit() ).append( "\t" ); - cmd.append( shutdownMode == KApplication::ShutdownModeInteractive ? + cmd.append( shutdownMode == TDEApplication::ShutdownModeInteractive ? "ask\n" : - shutdownMode == KApplication::ShutdownModeForceNow ? + shutdownMode == TDEApplication::ShutdownModeForceNow ? "forcenow\n" : - shutdownMode == KApplication::ShutdownModeTryNow ? + shutdownMode == TDEApplication::ShutdownModeTryNow ? "trynow\n" : "schedule\n" ); } exec( cmd.data() ); diff --git a/src/dmctl.h b/src/dmctl.h index da5aa2b..4fdb8fb 100644 --- a/src/dmctl.h +++ b/src/dmctl.h @@ -21,7 +21,7 @@ #ifndef DMCTL_H #define DMCTL_H -#include <kapplication.h> +#include <tdeapplication.h> struct SessEnt { TQString display, from, user, session; @@ -40,8 +40,8 @@ public: ~DM(); bool canShutdown(); - void shutdown( KApplication::ShutdownType shutdownType, - KApplication::ShutdownMode shutdownMode, + void shutdown( TDEApplication::ShutdownType shutdownType, + TDEApplication::ShutdownMode shutdownMode, const TQString &bootOption = TQString::null ); void setLock( bool on ); @@ -72,8 +72,8 @@ public: DM() {} bool canShutdown() { return false; } - void shutdown( KApplication::ShutdownType shutdownType, - KApplication::ShutdownMode shutdownMode, + void shutdown( TDEApplication::ShutdownType shutdownType, + TDEApplication::ShutdownMode shutdownMode, const TQString &bootOption = TQString::null ) {} void setLock( bool ) {} diff --git a/src/menu.ui b/src/menu.ui index 556d079..a05c1ac 100644 --- a/src/menu.ui +++ b/src/menu.ui @@ -137,7 +137,7 @@ <string>Use this dropdown menu to change the behaviour of the list below</string> </property> </widget> - <widget class="KListViewSearchLine" row="0" column="1"> + <widget class="TDEListViewSearchLine" row="0" column="1"> <property name="name"> <cstring>searchLine</cstring> </property> @@ -368,7 +368,7 @@ <layoutdefaults spacing="6" margin="11"/> <includehints> <includehint>tastylistview.h</includehint> - <includehint>klistviewsearchline.h</includehint> + <includehint>tdelistviewsearchline.h</includehint> <includehint>tastylistview.h</includehint> <includehint>tastylistview.h</includehint> <includehint>kpushbutton.h</includehint> 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; diff --git a/src/menuhandler.h b/src/menuhandler.h index 8a31e2f..35ee3b7 100644 --- a/src/menuhandler.h +++ b/src/menuhandler.h @@ -23,13 +23,13 @@ #include <kservicegroup.h> #include <kservice.h> -#include <klistbox.h> -#include <klistview.h> -#include <klistviewsearchline.h> -#include <kapplication.h> +#include <tdelistbox.h> +#include <tdelistview.h> +#include <tdelistviewsearchline.h> +#include <tdeapplication.h> #include <kiconloader.h> #include <kpushbutton.h> -#include <krecentdocument.h> +#include <tderecentdocument.h> #include <krun.h> #include <dcopref.h> #include <tqheader.h> @@ -40,7 +40,7 @@ #include <kdirwatch.h> #include <kdirlister.h> #include <tqlayout.h> -#include <kfileitem.h> +#include <tdefileitem.h> #include "dmctl.h" #include "menu.h" @@ -97,11 +97,11 @@ private: Menu * menu; MenuMode currentMenuMode; - KIconLoader *iconLoader; + TDEIconLoader *iconLoader; TQPopupMenu *sessionsMenu; bool searchMode; Prefs *prefSkel; - KConfig *kickerConf; + TDEConfig *kickerConf; KDirWatch *kickerConfWatch; //xdgMenuWatch for applications-kmenuedit.menu xdgMenuLister for all the desktop files KDirWatch *xdgMenuWatch; diff --git a/src/prefs.kcfgc b/src/prefs.kcfgc index b996f04..75c3e58 100644 --- a/src/prefs.kcfgc +++ b/src/prefs.kcfgc @@ -1,4 +1,4 @@ -# Code generation options for kconfig_compiler +# Code generation options for tdeconfig_compiler File=tastymenu.kcfg ClassName=Prefs Singleton=false diff --git a/src/tastybutton.cpp b/src/tastybutton.cpp index fb4eb9a..48bdb96 100644 --- a/src/tastybutton.cpp +++ b/src/tastybutton.cpp @@ -28,7 +28,7 @@ TastyButton::TastyButton(TQWidget *parent) : TQToolButton(parent) { - iconEffect = new KIconEffect(); + iconEffect = new TDEIconEffect(); iconEffect->init(); } @@ -106,8 +106,8 @@ void TastyButton::drawButton( TQPainter * p ) void TastyButton::setIconSet( TQIconSet is ) { is.setPixmap(iconEffect->apply(is.pixmap(), - (int)KIcon::Panel, - (int)KIcon::ActiveState), + (int)TDEIcon::Panel, + (int)TDEIcon::ActiveState), TQIconSet::Automatic, TQIconSet::Active); diff --git a/src/tastybutton.h b/src/tastybutton.h index 7df7f0f..126734c 100644 --- a/src/tastybutton.h +++ b/src/tastybutton.h @@ -42,7 +42,7 @@ protected: private: TQPixmap highLightedIcon; - KIconEffect *iconEffect; + TDEIconEffect *iconEffect; }; diff --git a/src/tastylistview.cpp b/src/tastylistview.cpp index 30d98a8..cb6d629 100644 --- a/src/tastylistview.cpp +++ b/src/tastylistview.cpp @@ -22,18 +22,18 @@ #include "tastylistview.h" #include "misc.h" -#include <kdeversion.h> +#include <tdeversion.h> #include <kstringhandler.h> #include <tqimage.h> #include <tqpainter.h> #include <tqheader.h> -#include <klocale.h> +#include <tdelocale.h> #include <kurldrag.h> #include <tqapplication.h> TastyListView::TastyListView( TQWidget * parent, const char * name) - : KListView(parent, name), highLightGroups(true), easyOpen(true) + : TDEListView(parent, name), highLightGroups(true), easyOpen(true) { onItemTimer = new TQTimer(this, "onItemTimer"); @@ -101,12 +101,12 @@ void TastyListView::contentsMouseReleaseEvent( TQMouseEvent * e ) oldOpenItem->repaint(); } - KListView::contentsMouseReleaseEvent(e); + TDEListView::contentsMouseReleaseEvent(e); } void TastyListView::contentsMouseMoveEvent( TQMouseEvent * e ) { - KListView::contentsMouseMoveEvent(e); + TDEListView::contentsMouseMoveEvent(e); mouseDown = (e->state() & TQt::LeftButton); if( itemAt( contentsToViewport(TQPoint(e->x(), e->y()))) == 0 ) @@ -115,7 +115,7 @@ void TastyListView::contentsMouseMoveEvent( TQMouseEvent * e ) void TastyListView::leaveEvent( TQEvent * e ) { - KListView::leaveEvent( e ); + TDEListView::leaveEvent( e ); onItemTimer->stop(); if( openItem ) setCurrentItem( openItem ); @@ -154,7 +154,7 @@ void TastyListView::keyPressEvent( TQKeyEvent * e ) case TQt::Key_Up: case TQt::Key_Down: - KListView::keyPressEvent( e ); + TDEListView::keyPressEvent( e ); break; case TQt::Key_Right: @@ -204,7 +204,7 @@ void TastyListView::keyPressEvent( TQKeyEvent * e ) break; } case TQt::Key_Tab: - KListView::keyPressEvent( e ); + TDEListView::keyPressEvent( e ); break; default: @@ -323,27 +323,27 @@ void TastyListViewToolTip::maybeTip( const TQPoint &pos ) ///////////TASTYLISTVIEWITEM TastyListViewItem::TastyListViewItem( TastyListView * parent ) - : KListViewItem(parent) + : TDEListViewItem(parent) {commonConstructor();} TastyListViewItem::TastyListViewItem( TastyListViewItem * parent ) - : KListViewItem(parent) + : TDEListViewItem(parent) {commonConstructor();} TastyListViewItem::TastyListViewItem( TastyListView * parent, TastyListViewItem * after, TQString label1 ) - : KListViewItem(parent, after, label1) + : TDEListViewItem(parent, after, label1) {commonConstructor();cellText = label1;} TastyListViewItem::TastyListViewItem( TastyListViewItem * parent, TastyListViewItem * after, TQString label1 ) - : KListViewItem(parent, after, label1) + : TDEListViewItem(parent, after, label1) {commonConstructor();cellText = label1;} TastyListViewItem::TastyListViewItem( TastyListView * parent, TQString label1 ) - : KListViewItem(parent, label1) + : TDEListViewItem(parent, label1) {commonConstructor();cellText = label1;} TastyListViewItem::TastyListViewItem( TastyListViewItem * parent, TQString label1 ) - : KListViewItem(parent, label1) + : TDEListViewItem(parent, label1) {commonConstructor();cellText = label1;} TastyListViewItem::~TastyListViewItem() @@ -372,7 +372,7 @@ void TastyListViewItem::commonConstructor() void TastyListViewItem::loadPixmap() { TQString iconFile = ""; - iconLoader = KGlobal::iconLoader(); + iconLoader = TDEGlobal::iconLoader(); if( !listView() ) return; @@ -384,26 +384,26 @@ void TastyListViewItem::loadPixmap() switch( actionType ) { case AddBookMark: - actionPix = iconLoader->loadIcon("bookmark_add", KIcon::Small, lv->getActionIconSize()); + actionPix = iconLoader->loadIcon("bookmark_add", TDEIcon::Small, lv->getActionIconSize()); break; case RemoveBookMark: - actionPix = iconLoader->loadIcon("remove", KIcon::Small, lv->getActionIconSize()); + actionPix = iconLoader->loadIcon("remove", TDEIcon::Small, lv->getActionIconSize()); break; case OpenGroup: if( TQApplication::reverseLayout() ) - actionPix = iconLoader->loadIcon("1leftarrow", KIcon::Small, lv->getActionIconSize()); + actionPix = iconLoader->loadIcon("1leftarrow", TDEIcon::Small, lv->getActionIconSize()); else - actionPix = iconLoader->loadIcon("1rightarrow", KIcon::Small, lv->getActionIconSize()); + actionPix = iconLoader->loadIcon("1rightarrow", TDEIcon::Small, lv->getActionIconSize()); break; case Expand: - actionPix = iconLoader->loadIcon("1downarrow", KIcon::Small, lv->getActionIconSize()); + actionPix = iconLoader->loadIcon("1downarrow", TDEIcon::Small, lv->getActionIconSize()); break; case Collapse: - actionPix = iconLoader->loadIcon("1uparrow", KIcon::Small, lv->getActionIconSize()); + actionPix = iconLoader->loadIcon("1uparrow", TDEIcon::Small, lv->getActionIconSize()); break; default: @@ -437,7 +437,7 @@ TQString TastyListViewItem::key( int column, bool ascending ) const void TastyListViewItem::setup ( ) { - //KListViewItem::setup(); + //TDEListViewItem::setup(); //calculate listitem height TQFontMetrics fm( listView()->font() ); @@ -466,7 +466,7 @@ void TastyListViewItem::paintCell ( TQPainter * p, const TQColorGroup & cg, int TQColor fillColor, textColor; -# if KDE_VERSION < KDE_MAKE_VERSION(3,3,91) +# if TDE_VERSION < TDE_MAKE_VERSION(3,3,91) # define BackgroundColor backgroundColor() # else # define BackgroundColor backgroundColor(0) diff --git a/src/tastylistview.h b/src/tastylistview.h index 47917d7..fcc77b3 100644 --- a/src/tastylistview.h +++ b/src/tastylistview.h @@ -22,7 +22,7 @@ #ifndef TASTYLISTVIEW_H #define TASTYLISTVIEW_H -#include <klistview.h> +#include <tdelistview.h> #include <kiconloader.h> #include <kservice.h> #include <kservicegroup.h> @@ -53,7 +53,7 @@ class TastyListViewToolTip: public TQToolTip /** @author Marco Martin <notmart@gmail.com> */ -class TastyListView : public KListView +class TastyListView : public TDEListView { Q_OBJECT private: @@ -88,7 +88,7 @@ public: void setOpenItem( TQListViewItem * listItem ){openItem = listItem;} public slots: - virtual void clear(){openItem = underCursorItem = NULL; KListView::clear();} + virtual void clear(){openItem = underCursorItem = NULL; TDEListView::clear();} protected: @@ -112,7 +112,7 @@ signals: /** @author Marco Martin <notmart@gmail.com> */ -class TastyListViewItem : public KListViewItem +class TastyListViewItem : public TDEListViewItem { //Q_OBJECT friend class TastyListView; @@ -174,10 +174,10 @@ friend class TastyListView; x < lv->header()->sectionPos( lv->header()->mapToIndex( 0 ) ) );} void setSubText(TQString text) //FIXME: add the column - {if(cellText.isEmpty())cellText=KListViewItem::text(0); - KListViewItem::setText(0,cellText+text);subText = TQString(text);} + {if(cellText.isEmpty())cellText=TDEListViewItem::text(0); + TDEListViewItem::setText(0,cellText+text);subText = TQString(text);} void setText(int column, const TQString & text ) - {KListViewItem::setText(column, cellText+text); cellText = text;} + {TDEListViewItem::setText(column, cellText+text); cellText = text;} void setDisplaySubText( bool display ){ displaySubText = display; } bool hasEllipsis(){return ellipsis;} @@ -192,9 +192,9 @@ friend class TastyListView; int width( const TQFontMetrics & fm, const TQListView * lv, int c ) { TastyListView *tlv = dynamic_cast<TastyListView *>( listView() ); if( tlv ) - return KListViewItem::width(fm, lv, c) + tlv->getActionIconSpace(); + return TDEListViewItem::width(fm, lv, c) + tlv->getActionIconSpace(); else - return KListViewItem::width(fm, lv, c); + return TDEListViewItem::width(fm, lv, c); } protected: @@ -214,7 +214,7 @@ private: bool highLight; bool displaySubText; TQPixmap actionPix; - KIconLoader *iconLoader; + TDEIconLoader *iconLoader; void commonConstructor(); //a tiny reimplementation of max... diff --git a/src/tastymenu.cpp b/src/tastymenu.cpp index 3dc3e7e..a581123 100644 --- a/src/tastymenu.cpp +++ b/src/tastymenu.cpp @@ -20,15 +20,15 @@ ***************************************************************************/ -#include <kglobal.h> -#include <klocale.h> -#include <kconfig.h> -#include <kapplication.h> -#include <kmessagebox.h> -#include <kconfigdialog.h> -#include <kaboutdata.h> -#include <kaboutapplication.h> -#include <kpopupmenu.h> +#include <tdeglobal.h> +#include <tdelocale.h> +#include <tdeconfig.h> +#include <tdeapplication.h> +#include <tdemessagebox.h> +#include <tdeconfigdialog.h> +#include <tdeaboutdata.h> +#include <tdeaboutapplication.h> +#include <tdepopupmenu.h> #include <kkeydialog.h> #include <kuser.h> #include <kstandarddirs.h> @@ -51,7 +51,7 @@ TastyMenu::TastyMenu(const TQString& configFile, Type type, int actions, TQWidge prefSkel = new Prefs(kConfig); prefSkel->readConfig(); - kickerConf = KGlobal::config(); + kickerConf = TDEGlobal::config(); kickerConf->setGroup("buttons"); _showBigToolTip = kickerConf->readBoolEntry("EnableIconZoom", true); @@ -80,12 +80,12 @@ TastyMenu::TastyMenu(const TQString& configFile, Type type, int actions, TQWidge if( !_toolTipTitle.isEmpty() ) menuTip->setTitle(_toolTipTitle); - if( height() >= KIcon::SizeMedium ) + if( height() >= TDEIcon::SizeMedium ) button->setUsesBigPixmap(true); else button->setUsesBigPixmap(false); - iconLoader = KGlobal::iconLoader(); + iconLoader = TDEGlobal::iconLoader(); loadMenuButtonIcon(); @@ -108,7 +108,7 @@ TastyMenu::TastyMenu(const TQString& configFile, Type type, int actions, TQWidge TastyMenu::~TastyMenu() { //delete prefSkel; - KGlobal::locale()->removeCatalogue("tastymenu"); + TDEGlobal::locale()->removeCatalogue("tastymenu"); } void TastyMenu::loadMenuButtonIcon() @@ -129,13 +129,13 @@ void TastyMenu::loadMenuButtonIcon() else if(position() == pLeft || position() == pRight) _iconsize = width(); - TQPixmap btnPixmap(iconLoader->loadIcon(_menuButtonIcon, KIcon::Panel, _iconsize)); + TQPixmap btnPixmap(iconLoader->loadIcon(_menuButtonIcon, TDEIcon::Panel, _iconsize)); if( !btnPixmap.isNull() ) button->setIconSet(btnPixmap); else { kdDebug() << "Failed to load custom icon" << endl; - button->setIconSet(iconLoader->loadIcon("kmenu", KIcon::Panel, height())); + button->setIconSet(iconLoader->loadIcon("kmenu", TDEIcon::Panel, height())); } } @@ -180,11 +180,11 @@ void TastyMenu::clickSlot() void TastyMenu::about() { - KAboutData data("tastymenu", + TDEAboutData data("tastymenu", I18N_NOOP("Tasty Menu"), "1.0.6", - I18N_NOOP("KMenu replacement"), - KAboutData::License_LGPL_V2, + I18N_NOOP("TMenu replacement"), + TDEAboutData::License_LGPL_V2, "(c) 2006-2007, Marco Martin",0,0,"mart@notmart.org"); data.addAuthor("Marco Martin", @@ -225,7 +225,7 @@ void TastyMenu::about() data.addCredit("Oswald Buddenhagen and Stephan Kulow", - I18N_NOOP("For the Switch user code from KDM"), + I18N_NOOP("For the Switch user code from TDM"), "ossi@kde.org and coolo@kde.org"); data.addCredit("The whole KBFX team", @@ -236,34 +236,34 @@ void TastyMenu::about() I18N_NOOP("For some code taken from Amarok's statistics list view"), "me@sebruiz.net"); - KIconLoader *iconLoader = KGlobal::iconLoader(); - data.setProgramLogo(iconLoader->loadIcon("kmenu", KIcon::Panel).convertToImage()); + TDEIconLoader *iconLoader = TDEGlobal::iconLoader(); + data.setProgramLogo(iconLoader->loadIcon("kmenu", TDEIcon::Panel).convertToImage()); - KAboutApplication dialog(&data); + TDEAboutApplication dialog(&data); dialog.exec(); } void TastyMenu::help() { - KApplication::kdeinitExec("khelpcenter", "help:/tastymenu"); + TDEApplication::tdeinitExec("khelpcenter", "help:/tastymenu"); } void TastyMenu::preferences() { - if(KConfigDialog::showDialog("settings")) + if(TDEConfigDialog::showDialog("settings")) return; Appearance *appearanceDialog = new Appearance(0, "appearance" ); Behaviour *behaviourDialog = new Behaviour(0, "behaviour" ); - KConfigDialog *dialog = new KConfigDialog(this, "settings", prefSkel, + TDEConfigDialog *dialog = new TDEConfigDialog(this, "settings", prefSkel, KDialogBase::Tabbed, - KConfigDialog::Default| - KConfigDialog::Ok| - KConfigDialog::Apply| - KConfigDialog::Cancel ); + TDEConfigDialog::Default| + TDEConfigDialog::Ok| + TDEConfigDialog::Apply| + TDEConfigDialog::Cancel ); dialog->addPage(appearanceDialog, i18n("Appearance"), "appearance" ); dialog->addPage(behaviourDialog, i18n("Behaviour"), "behaviour" ); connect( dialog, SIGNAL(settingsChanged()), @@ -273,7 +273,7 @@ void TastyMenu::preferences() void TastyMenu::setGlobalAccel( bool global ) { - globalAccel = new KGlobalAccel(this); + globalAccel = new TDEGlobalAccel(this); globalAccel->insert("Toggle Tasty Menu", i18n("Toggle Tasty Menu"), i18n("Toggle Tasty Menu"), 0, 0, this, SLOT(clickSlot())); @@ -284,14 +284,14 @@ void TastyMenu::setGlobalAccel( bool global ) if( global ) { if( !kickerConf ) - kickerConf = KGlobal::config(); + kickerConf = TDEGlobal::config(); kickerConf->setGroup("Global Shortcuts"); TQString kmenuShortcut = kickerConf->readEntry("Popup Launch Menu", "default(Alt+F1)"); if( kmenuShortcut=="none" ) return; TQString tastyMenuShortcut = kickerConf->readEntry("Toggle Tasty Menu", ""); - KShortcut shortCutKey(tastyMenuShortcut); + TDEShortcut shortCutKey(tastyMenuShortcut); kickerConf->writeEntry("Popup Launch Menu", "none"); kickerConf->writeEntry("Toggle Tasty Menu", kmenuShortcut); kickerConf->sync(); @@ -300,7 +300,7 @@ void TastyMenu::setGlobalAccel( bool global ) else { if( !kickerConf ) - kickerConf = KGlobal::config(); + kickerConf = TDEGlobal::config(); kickerConf->setGroup("Global Shortcuts"); kickerConf->deleteEntry("Popup Launch Menu"); kickerConf->sync(); @@ -396,7 +396,7 @@ void TastyMenu::resizeEvent(TQResizeEvent *e) button->setFixedHeight(newHeight); button->setFixedWidth(e->size().width()); - if( newHeight >= KIcon::SizeMedium ) + if( newHeight >= TDEIcon::SizeMedium ) button->setUsesBigPixmap(true); else button->setUsesBigPixmap(false); @@ -411,7 +411,7 @@ void TastyMenu::mousePressEvent(TQMouseEvent *e) if(e->button()==RightButton) { - KPopupMenu menu(this); + TDEPopupMenu menu(this); menu.insertTitle("Tasty Menu"); menu.insertItem(SmallIcon("kmenu"), i18n("&About"), 1); @@ -484,7 +484,7 @@ extern "C" { KPanelApplet* init( TQWidget *parent, const TQString& configFile) { - KGlobal::locale()->insertCatalogue("tastymenu"); + TDEGlobal::locale()->insertCatalogue("tastymenu"); return new TastyMenu(configFile, KPanelApplet::Normal, KPanelApplet::About | KPanelApplet::Help | KPanelApplet::Preferences, parent, "tastymenu"); diff --git a/src/tastymenu.desktop b/src/tastymenu.desktop index 475d8c0..25fe241 100644 --- a/src/tastymenu.desktop +++ b/src/tastymenu.desktop @@ -1,10 +1,10 @@ [Desktop Entry] Type=Plugin Encoding=UTF-8 -Comment=A KMenu replacement +Comment=A TMenu replacement Name=Tasty Menu Icon=kmenu -X-KDE-Library=tastymenu_panelapplet -X-KDE-UniqueApplet = false +X-TDE-Library=tastymenu_panelapplet +X-TDE-UniqueApplet = false diff --git a/src/tastymenu.h b/src/tastymenu.h index b1fa491..df87839 100644 --- a/src/tastymenu.h +++ b/src/tastymenu.h @@ -30,9 +30,9 @@ #include <kpanelapplet.h> #include <kiconloader.h> #include <tqstring.h> -#include <kconfig.h> +#include <tdeconfig.h> #include <tqpopupmenu.h> -#include <kconfigskeleton.h> +#include <tdeconfigskeleton.h> #include <kglobalaccel.h> #include <tqpainter.h> @@ -132,15 +132,15 @@ protected: virtual void leaveEvent( TQEvent * e ); private: - KSharedConfig *kConfig; + TDESharedConfig *kConfig; Prefs *prefSkel; - KConfig *kickerConf; + TDEConfig *kickerConf; MenuHandler *menuHandler; TastyButton *button; TastyToolTip *menuTip; TQPoint menupos(TQWidget *widget); - KGlobalAccel *globalAccel; - KIconLoader *iconLoader; + TDEGlobalAccel *globalAccel; + TDEIconLoader *iconLoader; int numNewApplications; diff --git a/src/tastymenu.lsm b/src/tastymenu.lsm index 44d525c..6800fe9 100644 --- a/src/tastymenu.lsm +++ b/src/tastymenu.lsm @@ -3,7 +3,7 @@ Title: TastyMenu -- Some description Version: 0.1 Entered-date: Description: -Keywords: KDE Qt +Keywords: TDE TQt Author: Marco Martin <notmart@gmail.com> Maintained-by: Marco Martin <notmart@gmail.com> Home-page: @@ -11,6 +11,6 @@ Alternate-site: Primary-site: ftp://ftp.kde.org/pub/kde/unstable/apps/utils xxxxxx tastymenu-0.1.tar.gz xxx tastymenu-0.1.lsm -Platform: Linux. Needs KDE +Platform: Linux. Needs TDE Copying-policy: GPL End diff --git a/src/tastytooltip.cpp b/src/tastytooltip.cpp index 1d324cc..cacfd71 100644 --- a/src/tastytooltip.cpp +++ b/src/tastytooltip.cpp @@ -39,15 +39,15 @@ TastyToolTip::TastyToolTip( TQWidget * parent,const char * name, WFlags fl) void TastyToolTip::loadIcon( TQString icon ) { iconName = icon; - KIconLoader *iconLoader = KGlobal::iconLoader(); - TQPixmap btnPixmap(iconLoader->loadIcon(icon, KIcon::Panel, KIcon::SizeHuge)); + TDEIconLoader *iconLoader = TDEGlobal::iconLoader(); + TQPixmap btnPixmap(iconLoader->loadIcon(icon, TDEIcon::Panel, TDEIcon::SizeHuge)); if( !btnPixmap.isNull() ) toolTipWidget->iconPixmap->setPixmap(btnPixmap); else { kdDebug() << "Failed to load custom icon" << endl; - toolTipWidget->iconPixmap->setPixmap(iconLoader->loadIcon("kmenu", KIcon::Panel, KIcon::SizeHuge)); + toolTipWidget->iconPixmap->setPixmap(iconLoader->loadIcon("kmenu", TDEIcon::Panel, TDEIcon::SizeHuge)); } } @@ -83,11 +83,11 @@ void TastyToolTip::notify(const TQPoint & point ) void TastyToolTip::setMessage( TQString message ) { - KIconLoader *iconLoader = KGlobal::iconLoader(); + TDEIconLoader *iconLoader = TDEGlobal::iconLoader(); toolTipWidget->MessageLabel->setText(message); if( message.length() > 0 ) - toolTipWidget->iconPixmap->setPixmap(iconLoader->loadIcon("messagebox_info", KIcon::Panel, KIcon::SizeHuge)); + toolTipWidget->iconPixmap->setPixmap(iconLoader->loadIcon("messagebox_info", TDEIcon::Panel, TDEIcon::SizeHuge)); else loadIcon(iconName); } |