From 7fdc8b30e85418cca031b45ad02f723373b73433 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sl=C3=A1vek=20Banko?= Date: Sun, 10 Apr 2016 10:42:00 +0200 Subject: [PATCH] Initial TQt conversion MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Slávek Banko --- src/appearance.ui | 78 +++++----- src/appearance.ui.h | 4 +- src/behaviour.ui | 24 ++-- src/dmctl.cpp | 64 ++++----- src/dmctl.h | 18 +-- src/menu.ui | 24 ++-- src/menuhandler.cpp | 296 +++++++++++++++++++------------------- src/menuhandler.h | 64 ++++----- src/misc.cpp | 14 +- src/misc.h | 2 +- src/tastybutton.cpp | 32 ++--- src/tastybutton.h | 14 +- src/tastylistview.cpp | 122 ++++++++-------- src/tastylistview.h | 90 ++++++------ src/tastymenu.cpp | 50 +++---- src/tastymenu.h | 28 ++-- src/tastytooltip.cpp | 34 ++--- src/tastytooltip.h | 24 ++-- src/tastytooltipwidget.ui | 14 +- 19 files changed, 498 insertions(+), 498 deletions(-) diff --git a/src/appearance.ui b/src/appearance.ui index 6e8c409..973952f 100644 --- a/src/appearance.ui +++ b/src/appearance.ui @@ -1,6 +1,6 @@ Appearance - + Appearance @@ -19,7 +19,7 @@ unnamed - + Icons @@ -35,7 +35,7 @@ AlignBottom - + kcfg_ShowExpander @@ -46,7 +46,7 @@ Alt+X - + kcfg_AlwaysCollapsed @@ -60,7 +60,7 @@ Alt+Y - + textLabel2 @@ -74,7 +74,7 @@ kcfg_MenuHeight - + textLabel1_4 @@ -102,7 +102,7 @@ - + kcfg_ToolTipTitle @@ -111,7 +111,7 @@ Empty means default. - + textLabel1_2 @@ -125,7 +125,7 @@ Empty means default. kcfg_MenuWidth - + textLabel5 @@ -136,7 +136,7 @@ Empty means default. AlignVCenter|AlignRight - + ApplicationsList @@ -152,7 +152,7 @@ Empty means default. AlignBottom - + textLabel3 @@ -160,7 +160,7 @@ Empty means default. of the screen width - + MenuButton @@ -176,7 +176,7 @@ Empty means default. AlignBottom - + textLabel4 @@ -184,7 +184,7 @@ Empty means default. of the screen height - + kcfg_MenuButtonIconType @@ -212,7 +212,7 @@ Empty means default. 0 - + kcfg_Icon @@ -246,7 +246,7 @@ Empty means default. Empty means default. - + kcfg_MenuButtonIcon @@ -254,7 +254,7 @@ Empty means default. false - + kcfg_IconNone @@ -267,7 +267,7 @@ Empty means default. - + menuSize @@ -283,7 +283,7 @@ Empty means default. AlignBottom - + textLabel1_3 @@ -297,7 +297,7 @@ Empty means default. kcfg_ActionIconSize - + kcfg_DisplaySubText @@ -308,7 +308,7 @@ Empty means default. Alt+D - + kcfg_MenuButtonLabelType @@ -336,7 +336,7 @@ Empty means default. 0 - + kcfg_MenuButtonText @@ -350,7 +350,7 @@ Empty means default. true - + kcfg_MenuButtonLabel @@ -362,7 +362,7 @@ Empty means default. Empty means default. - + kcfg_MenuButtonNone @@ -375,7 +375,7 @@ Empty means default. - + kcfg_MenuWidth @@ -392,7 +392,7 @@ Empty means default. 70 - + kcfg_MenuHeight @@ -409,7 +409,7 @@ Empty means default. 70 - + textLabel2_2 @@ -437,7 +437,7 @@ Empty means default. - + layout1 @@ -445,7 +445,7 @@ Empty means default. unnamed - + textLabel1_5_3 @@ -453,7 +453,7 @@ Empty means default. third column: - + textLabel1_5_2 @@ -461,7 +461,7 @@ Empty means default. second column: - + kcfg_IconSize1 @@ -478,7 +478,7 @@ Empty means default. 22 - + kcfg_IconSize3 @@ -495,7 +495,7 @@ Empty means default. 22 - + kcfg_IconSize2 @@ -512,7 +512,7 @@ Empty means default. 22 - + textLabel1_5 @@ -522,7 +522,7 @@ Empty means default. - + textLabel1 @@ -544,7 +544,7 @@ Empty means default. kcfg_IconSize - + kcfg_ActionIconSize @@ -589,9 +589,9 @@ Empty means default. MenuButtonIcon - iconChanged(QString) + iconChanged(TQString) Appearance - iconChanged(QString) + iconChanged(TQString) @@ -599,7 +599,7 @@ Empty means default. kcfg_ShowExpander_toggled( bool status ) - iconChanged( QString icon ) + iconChanged( TQString icon ) diff --git a/src/appearance.ui.h b/src/appearance.ui.h index 938c41a..92eefc7 100644 --- a/src/appearance.ui.h +++ b/src/appearance.ui.h @@ -2,7 +2,7 @@ ** ui.h extension file, included from the uic-generated form implementation. ** ** If you want to add, delete, or rename functions or slots, use -** Qt Designer to update this file, preserving your code. +** TQt Designer to update this file, preserving your code. ** ** You should not define a constructor or destructor in this file. ** Instead, write your code in functions called init() and destroy(). @@ -17,7 +17,7 @@ void Appearance::kcfg_ShowExpander_toggled( bool status ) } -void Appearance::iconChanged( QString icon ) +void Appearance::iconChanged( TQString icon ) { kcfg_MenuButtonIcon->setText(icon); } diff --git a/src/behaviour.ui b/src/behaviour.ui index b65cd3c..eaf4554 100644 --- a/src/behaviour.ui +++ b/src/behaviour.ui @@ -1,6 +1,6 @@ Behaviour - + Behaviour @@ -19,7 +19,7 @@ unnamed - + GeneralBehaviour @@ -52,7 +52,7 @@ - + kcfg_OverrideAltF1 @@ -83,7 +83,7 @@ - + kcfg_ShowSaveSession @@ -98,7 +98,7 @@ It saves the current session informations like open applications and windows position. In order to use it you must set "Restore manually saved session" in the Session Manager Kcontrol module. - + kcfg_HideOneChild @@ -112,7 +112,7 @@ It saves the current session informations like open applications and windows pos true - + kcfg_Alphabetical @@ -123,7 +123,7 @@ It saves the current session informations like open applications and windows pos Alt+B - + SearchFieldBehaviour @@ -139,7 +139,7 @@ It saves the current session informations like open applications and windows pos AlignBottom - + buttonGroup1 @@ -156,7 +156,7 @@ It saves the current session informations like open applications and windows pos 0 - + simpleSearch @@ -176,7 +176,7 @@ It saves the current session informations like open applications and windows pos It displays in the first column all the applications whose name or description matches with the query you entered - + kcfg_KerryIntegration @@ -194,7 +194,7 @@ It saves the current session informations like open applications and windows pos It needs Kerry Beagle up and running. - + kcfg_StrigiIntegration @@ -214,7 +214,7 @@ It needs the Strigi Daemon up and running - + kcfg_NewAppsNotification diff --git a/src/dmctl.cpp b/src/dmctl.cpp index 9f24a52..65c255c 100644 --- a/src/dmctl.cpp +++ b/src/dmctl.cpp @@ -24,7 +24,7 @@ #include #include -#include +#include #include #include @@ -83,7 +83,7 @@ DM::DM() : fd( -1 ) break; case OldKDM: { - QString tf( ctl ); + TQString tf( ctl ); tf.truncate( tf.find( ',' ) ); fd = ::open( tf.latin1(), O_WRONLY ); } @@ -100,7 +100,7 @@ DM::~DM() bool DM::exec( const char *cmd ) { - QCString buf; + TQCString buf; return exec( cmd, buf ); } @@ -118,7 +118,7 @@ DM::exec( const char *cmd ) * from KDM. */ bool -DM::exec( const char *cmd, QCString &buf ) +DM::exec( const char *cmd, TQCString &buf ) { bool ret = false; int tl; @@ -167,7 +167,7 @@ DM::canShutdown() if (DMType == OldKDM) return strstr( ctl, ",maysd" ) != 0; - QCString re; + TQCString re; if (DMType == GDM) return exec( "QUERY_LOGOUT_ACTION\n", re ) && re.find("HALT") >= 0; @@ -178,14 +178,14 @@ DM::canShutdown() void DM::shutdown( KApplication::ShutdownType shutdownType, KApplication::ShutdownMode shutdownMode, /* NOT Default */ - const QString &bootOption ) + const TQString &bootOption ) { if (shutdownType == KApplication::ShutdownTypeNone) return; bool cap_ask; if (DMType == NewKDM) { - QCString re; + TQCString re; cap_ask = exec( "caps\n", re ) && re.find( "\tshutdown ask" ) >= 0; } else { if (!bootOption.isEmpty()) @@ -195,7 +195,7 @@ DM::shutdown( KApplication::ShutdownType shutdownType, if (!cap_ask && shutdownMode == KApplication::ShutdownModeInteractive) shutdownMode = KApplication::ShutdownModeForceNow; - QCString cmd; + TQCString cmd; if (DMType == GDM) { cmd.append( shutdownMode == KApplication::ShutdownModeForceNow ? "SET_LOGOUT_ACTION " : "SET_SAFE_LOGOUT_ACTION " ); @@ -218,16 +218,16 @@ DM::shutdown( KApplication::ShutdownType shutdownType, } bool -DM::bootOptions( QStringList &opts, int &defopt, int ¤t ) +DM::bootOptions( TQStringList &opts, int &defopt, int ¤t ) { if (DMType != NewKDM) return false; - QCString re; + TQCString re; if (!exec( "listbootoptions\n", re )) return false; - opts = QStringList::split( '\t', QString::fromLocal8Bit( re.data() ) ); + opts = TQStringList::split( '\t', TQString::fromLocal8Bit( re.data() ) ); if (opts.size() < 4) return false; @@ -239,8 +239,8 @@ DM::bootOptions( QStringList &opts, int &defopt, int ¤t ) if (!ok) return false; - opts = QStringList::split( ' ', opts[1] ); - for (QStringList::Iterator it = opts.begin(); it != opts.end(); ++it) + opts = TQStringList::split( ' ', opts[1] ); + for (TQStringList::Iterator it = opts.begin(); it != opts.end(); ++it) (*it).replace( "\\s", " " ); return true; @@ -262,7 +262,7 @@ DM::isSwitchable() if (DMType == GDM) return exec( "QUERY_VT\n" ); - QCString re; + TQCString re; return exec( "caps\n", re ) && re.find( "\tlocal" ) >= 0; } @@ -276,7 +276,7 @@ DM::numReserve() if (DMType == OldKDM) return strstr( ctl, ",rsvd" ) ? 1 : -1; - QCString re; + TQCString re; int p; if (!(exec( "caps\n", re ) && (p = re.find( "\treserve " )) >= 0)) @@ -299,14 +299,14 @@ DM::localSessions( SessList &list ) if (DMType == OldKDM) return false; - QCString re; + TQCString re; if (DMType == GDM) { if (!exec( "CONSOLE_SERVERS\n", re )) return false; - QStringList sess = QStringList::split( QChar(';'), re.data() + 3 ); - for (QStringList::ConstIterator it = sess.begin(); it != sess.end(); ++it) { - QStringList ts = QStringList::split( QChar(','), *it, true ); + TQStringList sess = TQStringList::split( TQChar(';'), re.data() + 3 ); + for (TQStringList::ConstIterator it = sess.begin(); it != sess.end(); ++it) { + TQStringList ts = TQStringList::split( TQChar(','), *it, true ); SessEnt se; se.display = ts[0]; se.user = ts[1]; @@ -319,9 +319,9 @@ DM::localSessions( SessList &list ) } else { if (!exec( "list\talllocal\n", re )) return false; - QStringList sess = QStringList::split( QChar('\t'), re.data() + 3 ); - for (QStringList::ConstIterator it = sess.begin(); it != sess.end(); ++it) { - QStringList ts = QStringList::split( QChar(','), *it, true ); + TQStringList sess = TQStringList::split( TQChar('\t'), re.data() + 3 ); + for (TQStringList::ConstIterator it = sess.begin(); it != sess.end(); ++it) { + TQStringList ts = TQStringList::split( TQChar(','), *it, true ); SessEnt se; se.display = ts[0]; if (ts[1][0] == '@') @@ -339,11 +339,11 @@ DM::localSessions( SessList &list ) } void -DM::sess2Str2( const SessEnt &se, QString &user, QString &loc ) +DM::sess2Str2( const SessEnt &se, TQString &user, TQString &loc ) { if (se.tty) { user = i18n("user: ...", "%1: TTY login").arg( se.user ); - loc = se.vt ? QString("vt%1").arg( se.vt ) : se.display ; + loc = se.vt ? TQString("vt%1").arg( se.vt ) : se.display ; } else { user = se.user.isEmpty() ? @@ -358,15 +358,15 @@ DM::sess2Str2( const SessEnt &se, QString &user, QString &loc ) .arg( se.user ).arg( se.session ); loc = se.vt ? - QString("%1, vt%2").arg( se.display ).arg( se.vt ) : + TQString("%1, vt%2").arg( se.display ).arg( se.vt ) : se.display; } } -QString +TQString DM::sess2Str( const SessEnt &se ) { - QString user, loc; + TQString user, loc; sess2Str2( se, user, loc ); return i18n("session (location)", "%1 (%2)").arg( user ).arg( loc ); @@ -376,9 +376,9 @@ bool DM::switchVT( int vt ) { if (DMType == GDM) - return exec( QString("SET_VT %1\n").arg(vt).latin1() ); + return exec( TQString("SET_VT %1\n").arg(vt).latin1() ); - return exec( QString("activate\tvt%1\n").arg(vt).latin1() ); + return exec( TQString("activate\tvt%1\n").arg(vt).latin1() ); } void @@ -396,7 +396,7 @@ DM::GDMAuthenticate() int dnl; Xauth *xau; - dpy = DisplayString( QPaintDevice::x11AppDisplay() ); + dpy = DisplayString( TQPaintDevice::x11AppDisplay() ); if (!dpy) { dpy = ::getenv( "DISPLAY" ); if (!dpy) @@ -416,9 +416,9 @@ DM::GDMAuthenticate() xau->data_length == 16 && xau->name_length == 18 && !memcmp( xau->name, "MIT-MAGIC-COOKIE-1", 18 )) { - QString cmd( "AUTH_LOCAL " ); + TQString cmd( "AUTH_LOCAL " ); for (int i = 0; i < 16; i++) - cmd += QString::number( (uchar)xau->data[i], 16 ).rightJustify( 2, '0'); + cmd += TQString::number( (uchar)xau->data[i], 16 ).rightJustify( 2, '0'); cmd += "\n"; if (exec( cmd.latin1() )) { XauDisposeAuth( xau ); diff --git a/src/dmctl.h b/src/dmctl.h index aadc89b..da5aa2b 100644 --- a/src/dmctl.h +++ b/src/dmctl.h @@ -24,12 +24,12 @@ #include struct SessEnt { - QString display, from, user, session; + TQString display, from, user, session; int vt; bool self:1, tty:1; }; -typedef QValueList SessList; +typedef TQValueList SessList; class DM { @@ -42,7 +42,7 @@ public: bool canShutdown(); void shutdown( KApplication::ShutdownType shutdownType, KApplication::ShutdownMode shutdownMode, - const QString &bootOption = QString::null ); + const TQString &bootOption = TQString::null ); void setLock( bool on ); @@ -53,15 +53,15 @@ public: bool switchVT( int vt ); void lockSwitchVT( int vt ); - bool bootOptions( QStringList &opts, int &dflt, int &curr ); + bool bootOptions( TQStringList &opts, int &dflt, int &curr ); - static QString sess2Str( const SessEnt &se ); - static void sess2Str2( const SessEnt &se, QString &user, QString &loc ); + static TQString sess2Str( const SessEnt &se ); + static void sess2Str2( const SessEnt &se, TQString &user, TQString &loc ); private: int fd; - bool exec( const char *cmd, QCString &ret ); + bool exec( const char *cmd, TQCString &ret ); bool exec( const char *cmd ); void GDMAuthenticate(); @@ -74,7 +74,7 @@ public: bool canShutdown() { return false; } void shutdown( KApplication::ShutdownType shutdownType, KApplication::ShutdownMode shutdownMode, - const QString &bootOption = QString::null ) {} + const TQString &bootOption = TQString::null ) {} void setLock( bool ) {} @@ -84,7 +84,7 @@ public: bool localSessions( SessList &list ) { return false; } void switchVT( int vt ) {} - bool bootOptions( QStringList &opts, int &dflt, int &curr ); + bool bootOptions( TQStringList &opts, int &dflt, int &curr ); #endif // Q_WS_X11 diff --git a/src/menu.ui b/src/menu.ui index f666fd2..556d079 100644 --- a/src/menu.ui +++ b/src/menu.ui @@ -1,6 +1,6 @@ Menu - + Menu @@ -25,7 +25,7 @@ 0 - + frame9 @@ -39,7 +39,7 @@ unnamed - + leftFrame @@ -76,7 +76,7 @@ dynamicList - + clearRecentButton @@ -87,7 +87,7 @@ Alt+C - + searchLabel @@ -101,7 +101,7 @@ searchLine - + Favourite applications @@ -153,7 +153,7 @@ - + clearButton @@ -161,7 +161,7 @@ ... - + showLabel @@ -196,7 +196,7 @@ - + allAppsFrame @@ -221,7 +221,7 @@ 2 - + textLabel1 @@ -237,7 +237,7 @@ AlignCenter - + detachButton @@ -261,7 +261,7 @@ - + layout6 diff --git a/src/menuhandler.cpp b/src/menuhandler.cpp index 06ca863..82b12bf 100644 --- a/src/menuhandler.cpp +++ b/src/menuhandler.cpp @@ -25,10 +25,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -36,8 +36,8 @@ #include "menuhandler.h" #include "buttons.h" -MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl) - :QFrame(parent, name, fl ), searchMode(false) +MenuHandler::MenuHandler( TQWidget *parent, Prefs *prefs, char *name, WFlags fl) + :TQFrame(parent, name, fl ), searchMode(false) { prefSkel = prefs; @@ -46,14 +46,14 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl) KServiceGroup::Ptr service = KServiceGroup::root(); //Kicker config - QString kickerConfPath = locate("config", "kickerrc"); + TQString kickerConfPath = locate("config", "kickerrc"); kickerConf = new KConfig(kickerConfPath); kickerConfWatch = new KDirWatch( this ); kickerConfWatch->addFile(kickerConfPath); - connect( kickerConfWatch, SIGNAL(dirty(const QString&)), this, + connect( kickerConfWatch, SIGNAL(dirty(const TQString&)), this, SLOT(slotModKickerConf()) ); - connect( kickerConfWatch, SIGNAL(dirty(const QString&)), this, + connect( kickerConfWatch, SIGNAL(dirty(const TQString&)), this, SIGNAL(kickerConfChanged()) ); if( _newAppsNotification = prefSkel->newAppsNotification() ) @@ -76,7 +76,7 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl) //Main widget initialization menu = new Menu(this, "tastyMenu"); - MenuHandlerLayout = new QVBoxLayout( this, 0, 0, "MenuHandlerLayout"); + MenuHandlerLayout = new TQVBoxLayout( this, 0, 0, "MenuHandlerLayout"); MenuHandlerLayout->addWidget(menu); readConfig(); @@ -84,8 +84,8 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl) //Searchline... iconLoader = KGlobal::iconLoader(); - QPixmap icon; - if( QApplication::reverseLayout() ) + TQPixmap icon; + if( TQApplication::reverseLayout() ) icon = iconLoader->loadIcon("locationbar_erase", KIcon::Small); else icon = iconLoader->loadIcon("clear_left", KIcon::Small); @@ -93,7 +93,7 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl) connect(menu->clearButton, SIGNAL(clicked()), menu->searchLine, SLOT (clear()) ); - menu->detachButton->setIconSet(QPixmap(uic_findImage("detach.png"))); + menu->detachButton->setIconSet(TQPixmap(uic_findImage("detach.png"))); connect(menu->detachButton, SIGNAL(clicked()), this, SLOT (switchWindowMode()) ); menu->searchLine->setContextMenuEnabled(false); @@ -125,17 +125,17 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl) //user icon and login KUser *user = new KUser (); - QString loginName (user->loginName ()); - QImage + TQString loginName (user->loginName ()); + TQImage userImage (locate ("data", "/home/" + loginName + "/.face.icon")); if( !userImage.isNull() ) { userImage = userImage.smoothScale (KIcon::SizeSmallMedium, KIcon::SizeSmallMedium); - menu->switchButton->setIconSet(QPixmap(userImage)); + menu->switchButton->setIconSet(TQPixmap(userImage)); } menu->switchButton->setText(loginName); - sessionsMenu = new QPopupMenu(); + sessionsMenu = new TQPopupMenu(); menu->switchButton->setPopup(sessionsMenu); @@ -145,25 +145,25 @@ MenuHandler::MenuHandler( QWidget *parent, Prefs *prefs, char *name, WFlags fl) //left/middle mouse button connect (menu->dynamicList, - SIGNAL (activated(QListViewItem *, const QPoint & , int )), this, - SLOT (dynListClicked(QListViewItem *, const QPoint &, int))); + SIGNAL (activated(TQListViewItem *, const TQPoint & , int )), this, + SLOT (dynListClicked(TQListViewItem *, const TQPoint &, int))); connect (menu->rootList, - SIGNAL (activated(QListViewItem *, const QPoint & , int )), this, - SLOT (rootListClicked(QListViewItem *, const QPoint &, int))); + SIGNAL (activated(TQListViewItem *, const TQPoint & , int )), this, + SLOT (rootListClicked(TQListViewItem *, const TQPoint &, int))); connect (menu->childList, - SIGNAL (activated(QListViewItem *, const QPoint & , int )), this, - SLOT (childListClicked(QListViewItem *, const QPoint &, int))); + SIGNAL (activated(TQListViewItem *, const TQPoint & , int )), this, + SLOT (childListClicked(TQListViewItem *, const TQPoint &, int))); //right mouse button connect (menu->dynamicList, - SIGNAL (contextMenuRequested(QListViewItem *, const QPoint & , int )), this, - SLOT (slotContextMenu(QListViewItem *, const QPoint &, int))); + SIGNAL (contextMenuRequested(TQListViewItem *, const TQPoint & , int )), this, + SLOT (slotContextMenu(TQListViewItem *, const TQPoint &, int))); connect (menu->rootList, - SIGNAL (contextMenuRequested(QListViewItem *, const QPoint & , int )), this, - SLOT (slotContextMenu(QListViewItem *, const QPoint &, int))); + SIGNAL (contextMenuRequested(TQListViewItem *, const TQPoint & , int )), this, + SLOT (slotContextMenu(TQListViewItem *, const TQPoint &, int))); connect (menu->childList, - SIGNAL (contextMenuRequested(QListViewItem *, const QPoint & , int )), this, - SLOT (slotContextMenu(QListViewItem *, const QPoint &, int))); + SIGNAL (contextMenuRequested(TQListViewItem *, const TQPoint & , int )), this, + SLOT (slotContextMenu(TQListViewItem *, const TQPoint &, int))); //don't open categories on mouseover on childlist //menu->childList->setEasyOpen( true ); @@ -191,15 +191,15 @@ void MenuHandler::loadNewInstalledApps() //Notification for newly installed apps xdgMenuLister = new KDirLister( ); KStandardDirs *standardDir=new KStandardDirs(); - QStringList appDirs = standardDir->findDirs("xdgdata-apps", "."); + TQStringList appDirs = standardDir->findDirs("xdgdata-apps", "."); firstListing = 0; - for(QStringList::Iterator it = appDirs.begin(); it != appDirs.end(); ++it) + 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/"*/ - QString appDirWithKde = (*it)+"kde/"; - if( QFile::exists(appDirWithKde) ) + TQString appDirWithKde = (*it)+"kde/"; + if( TQFile::exists(appDirWithKde) ) { xdgMenuLister->openURL(appDirWithKde, true); firstListing++; @@ -215,7 +215,7 @@ void MenuHandler::loadNewInstalledApps() xdgMenuWatch = new KDirWatch(this); xdgMenuWatch->addFile(locateLocal("xdgconf-menu", "applications-kmenuedit.menu")); //connect with slotApplicationRemoved() because we need to wait a while... - connect( xdgMenuWatch, SIGNAL(dirty(const QString&)), this, + connect( xdgMenuWatch, SIGNAL(dirty(const TQString&)), this, SLOT(slotApplicationRemoved()) ); newInstalledList = prefSkel->newInstalledApps(); @@ -236,12 +236,12 @@ void MenuHandler::loadNewInstalledApps() void MenuHandler::setupColumns() { menu->dynamicList->header()->hide(); - menu->dynamicList->setResizeMode(QListView::AllColumns); + menu->dynamicList->setResizeMode(TQListView::AllColumns); menu->dynamicList->addColumn("name"); menu->dynamicList->setShowToolTips(true); menu->dynamicList->setSortColumn(-1); menu->dynamicList->header()->setResizeEnabled(false); - menu->dynamicList->setHScrollBarMode(QScrollView::AlwaysOff); + menu->dynamicList->setHScrollBarMode(TQScrollView::AlwaysOff); menu->dynamicList->setActionIconSize( _actionIconSize ); menu->dynamicList->setRootIsDecorated( _showExpander ); //manage drag'n drop @@ -251,21 +251,21 @@ void MenuHandler::setupColumns() this, SLOT(dynListElemMoved()) ); menu->rootList->header()->hide(); - menu->rootList->setResizeMode(QListView::AllColumns); + menu->rootList->setResizeMode(TQListView::AllColumns); menu->rootList->addColumn("name"); menu->rootList->setSortColumn(-1); menu->rootList->header()->setResizeEnabled(false); - menu->rootList->setHScrollBarMode(QScrollView::AlwaysOff); + menu->rootList->setHScrollBarMode(TQScrollView::AlwaysOff); menu->rootList->setHighLightGroups( false ); menu->rootList->setActionIconSize( _actionIconSize ); menu->rootList->setDragEnabled(true); menu->childList->header()->hide(); - menu->childList->setResizeMode(QListView::AllColumns); + menu->childList->setResizeMode(TQListView::AllColumns); menu->childList->addColumn("name"); menu->childList->setSortColumn(_alphabetical?0:-1); menu->childList->header()->setResizeEnabled(false); - menu->childList->setHScrollBarMode(QScrollView::AlwaysOff); + menu->childList->setHScrollBarMode(TQScrollView::AlwaysOff); menu->childList->setActionIconSize( _actionIconSize ); menu->childList->setRootIsDecorated( _showExpander ); menu->childList->setDragEnabled(true); @@ -276,7 +276,7 @@ void MenuHandler::dynListElemMoved( ) { //very stupid: iterate the entire list and rewrite the favouriteList favouriteList.clear(); - QListViewItemIterator it( menu->dynamicList ); + TQListViewItemIterator it( menu->dynamicList ); while ( it.current() ) { @@ -294,31 +294,31 @@ void MenuHandler::dynListElemMoved( ) } -bool MenuHandler::eventFilter( QObject *o, QEvent * e ) +bool MenuHandler::eventFilter( TQObject *o, TQEvent * e ) { - if ( e->type() == QEvent::KeyPress ) + if ( e->type() == TQEvent::KeyPress ) { - QKeyEvent *keyEvent = (QKeyEvent *)e; - QFocusData *fData = focusData(); + TQKeyEvent *keyEvent = (TQKeyEvent *)e; + TQFocusData *fData = focusData(); fData->home(); switch( keyEvent->key() ) { - case Qt::Key_Up: - if( dynamic_cast(o) ) + case TQt::Key_Up: + if( dynamic_cast(o) ) return false; fData->prev()->setFocus(); break; - case Qt::Key_Down: + case TQt::Key_Down: { - if( dynamic_cast(o) ) + if( dynamic_cast(o) ) return false; //this is a workaround in order to set the focus on the //right widget when the combobox is disabled - QWidget *nextWidget = fData->next(); + TQWidget *nextWidget = fData->next(); if( nextWidget->isEnabled() ) nextWidget->setFocus(); else @@ -326,29 +326,29 @@ bool MenuHandler::eventFilter( QObject *o, QEvent * e ) } break; - case Qt::Key_Right: + case TQt::Key_Right: if( dynamic_cast(o) ) return false; fData->next()->setFocus(); break; - case Qt::Key_Left: + case TQt::Key_Left: if( dynamic_cast(o) ) return false; fData->prev()->setFocus(); break; - case Qt::Key_Enter: - case Qt::Key_Return: + case TQt::Key_Enter: + case TQt::Key_Return: { //only filter enter on search line if( o != menu->searchLine ) return false; - QListViewItem *listItem = NULL; + TQListViewItem *listItem = NULL; //execute the only list item when there is exactly one - QListViewItemIterator it( menu->dynamicList, - QListViewItemIterator::Visible); + TQListViewItemIterator it( menu->dynamicList, + TQListViewItemIterator::Visible); //listItem = it.current(); int count = 0; //ensure the first level have only one result @@ -367,7 +367,7 @@ bool MenuHandler::eventFilter( QObject *o, QEvent * e ) if( listItem ) { - dynListClicked(listItem, QPoint(0,0), 0); + dynListClicked(listItem, TQPoint(0,0), 0); menu->searchLine->clear(); } @@ -381,11 +381,11 @@ bool MenuHandler::eventFilter( QObject *o, QEvent * e ) return true; } //for some reasons clicking with the right mouse button on the searchline everything crashes... -/* else if( e->type() == QEvent::MouseButtonPress && o == menu->searchLine ) +/* else if( e->type() == TQEvent::MouseButtonPress && o == menu->searchLine ) {return true; - QMouseEvent *mouseEvent = (QMouseEvent *)e; + TQMouseEvent *mouseEvent = (TQMouseEvent *)e; - if( mouseEvent->button() != QMouseEvent::RightButton ) + if( mouseEvent->button() != TQMouseEvent::RightButton ) return true; if( menu->searchLine->text().length() < 4 ) @@ -443,7 +443,7 @@ void MenuHandler::readConfig() //menu size _menuWidth = 100.0/prefSkel->menuWidth(); _menuHeight = 100.0/prefSkel->menuHeight(); - QRect r = QDesktopWidget().screenGeometry(this); + TQRect r = TQDesktopWidget().screenGeometry(this); int w = (int)(r.width()/_menuWidth); int h = (int)(r.height()/_menuHeight); resize(w,h); @@ -454,48 +454,48 @@ void MenuHandler::readConfig() _isNormalWindow = prefSkel->isNormalWindow(); if( _isNormalWindow ) { - menu->detachButton->setIconSet(QPixmap(uic_findImage("attach.png"))); - QToolTip::add( menu->detachButton, tr2i18n( "Make this window a popup menu" ) ); + menu->detachButton->setIconSet(TQPixmap(uic_findImage("attach.png"))); + TQToolTip::add( menu->detachButton, tr2i18n( "Make this window a popup menu" ) ); } else { - menu->detachButton->setIconSet(QPixmap(uic_findImage("detach.png"))); - QToolTip::add( menu->detachButton, tr2i18n( "Make this menu a normal window" ) ); + menu->detachButton->setIconSet(TQPixmap(uic_findImage("detach.png"))); + TQToolTip::add( menu->detachButton, tr2i18n( "Make this menu a normal window" ) ); } // disconnect(menu->searchLine, 0, 0, 0); if( !_kerryIntegration && !_strigiIntegration ) { //menu->searchLine->setListView((KListView *)(menu->dynamicList)); - disconnect(menu->searchLine, SIGNAL(returnPressed( const QString &)), - this, SLOT (kerrySearch( const QString &)) ); - disconnect(menu->searchLine, SIGNAL(returnPressed( const QString &)), - this, SLOT (strigiSearch( const QString &)) ); - connect(menu->searchLine, SIGNAL(textChanged( const QString &)), - this, SLOT (initializeSearch( const QString &)) ); + disconnect(menu->searchLine, SIGNAL(returnPressed( const TQString &)), + this, SLOT (kerrySearch( const TQString &)) ); + disconnect(menu->searchLine, SIGNAL(returnPressed( const TQString &)), + this, SLOT (strigiSearch( const TQString &)) ); + connect(menu->searchLine, SIGNAL(textChanged( const TQString &)), + this, SLOT (initializeSearch( const TQString &)) ); } else if( _kerryIntegration ) { menu->searchLine->setListView(NULL); menu->searchLine->setEnabled(true); - disconnect(menu->searchLine, SIGNAL(textChanged( const QString &)), - this, SLOT (initializeSearch( const QString &)) ); - disconnect(menu->searchLine, SIGNAL(returnPressed( const QString &)), - this, SLOT (strigiSearch( const QString &)) ); - connect(menu->searchLine, SIGNAL(returnPressed( const QString &)), - this, SLOT (kerrySearch( const QString &)) ); + disconnect(menu->searchLine, SIGNAL(textChanged( const TQString &)), + this, SLOT (initializeSearch( const TQString &)) ); + disconnect(menu->searchLine, SIGNAL(returnPressed( const TQString &)), + this, SLOT (strigiSearch( const TQString &)) ); + connect(menu->searchLine, SIGNAL(returnPressed( const TQString &)), + this, SLOT (kerrySearch( const TQString &)) ); menu->searchLine->setContextMenuEnabled(false); } else //strigi { menu->searchLine->setListView(NULL); menu->searchLine->setEnabled(true); - disconnect(menu->searchLine, SIGNAL(textChanged( const QString &)), - this, SLOT (initializeSearch( const QString &)) ); - disconnect(menu->searchLine, SIGNAL(returnPressed( const QString &)), - this, SLOT (kerrySearch( const QString &)) ); - connect(menu->searchLine, SIGNAL(returnPressed( const QString &)), - this, SLOT (strigiSearch( const QString &)) ); + disconnect(menu->searchLine, SIGNAL(textChanged( const TQString &)), + this, SLOT (initializeSearch( const TQString &)) ); + disconnect(menu->searchLine, SIGNAL(returnPressed( const TQString &)), + this, SLOT (kerrySearch( const TQString &)) ); + connect(menu->searchLine, SIGNAL(returnPressed( const TQString &)), + this, SLOT (strigiSearch( const TQString &)) ); menu->searchLine->setContextMenuEnabled(false); } } @@ -518,20 +518,20 @@ void MenuHandler::updateConfig() } -void MenuHandler::mousePressEvent( QMouseEvent *e) +void MenuHandler::mousePressEvent( TQMouseEvent *e) { - if(static_cast(parent())->hasMouse()) + if(static_cast(parent())->hasMouse()) { close(); } else if(!_isNormalWindow && !(rect().contains(e->pos())) ) { hide(); - QTimer::singleShot(200, this,SLOT(close())); + TQTimer::singleShot(200, this,SLOT(close())); } } -void MenuHandler::closeEvent ( QCloseEvent *e) +void MenuHandler::closeEvent ( TQCloseEvent *e) { e=e; @@ -546,11 +546,11 @@ void MenuHandler::closeEvent ( QCloseEvent *e) //HACK: I wait a little bit to permit closing the menu // when user clicks on the menu button again - QTimer::singleShot(50, this, SLOT(hide())); + TQTimer::singleShot(50, this, SLOT(hide())); emit(hidden()); } -void MenuHandler::popup(QPoint pos) +void MenuHandler::popup(TQPoint pos) { if(isVisible()) { @@ -564,7 +564,7 @@ void MenuHandler::popup(QPoint pos) int h; if( !_isNormalWindow ) { - QRect r = QDesktopWidget().screenGeometry(this); + TQRect r = TQDesktopWidget().screenGeometry(this); w = (int)(r.width()/_menuWidth); h = (int)(r.height()/_menuHeight); } @@ -642,7 +642,7 @@ void MenuHandler::initNewInstalledApps(KServiceGroup::Ptr group) KService *s = static_cast < KService * > ( p ); - QString path(s->desktopEntryPath()); + TQString path(s->desktopEntryPath()); if( oldInstalledList.findIndex(path) == -1 && newInstalledList.findIndex(path) == -1 ) { @@ -695,7 +695,7 @@ bool MenuHandler::searchNewItems(KServiceGroup::Ptr group) /*KServiceGroup::List MenuHandler::getServiceGroupList( KServiceGroup *serviceGroup ) { - QString key(serviceGroup->directoryEntryPath()); + TQString key(serviceGroup->directoryEntryPath()); if( sListMap.contains(key) ) return sListMap[key]; @@ -709,7 +709,7 @@ bool MenuHandler::searchNewItems(KServiceGroup::Ptr group) void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *listView, TastyListViewItem *listItemFather, - bool recursive, const QString & query ) + bool recursive, const TQString & query ) { if( !serviceGroup || !serviceGroup->isValid() ) return; @@ -749,15 +749,15 @@ void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *list if(numChilds == 0) continue; - QPixmap iconPix = iconLoader->loadIcon(g->icon(), KIcon::Toolbar,iconSize); + TQPixmap iconPix = iconLoader->loadIcon(g->icon(), KIcon::Toolbar,iconSize); if ( iconPix.height () != iconSize) { - QImage img = iconPix.convertToImage(); + TQImage img = iconPix.convertToImage(); if( !img.isNull() ) { img = img.smoothScale ( iconSize, iconSize); - iconPix = QPixmap (img); + iconPix = TQPixmap (img); } } @@ -792,8 +792,8 @@ void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *list if( _currentCategory == listItem->text(0) && listView == menu->rootList ) { listView->setCurrentItem(listItem); - listView->setOpenItem(static_cast(listItem)); - rootListClicked(listItem, QPoint(0,0), 0); + listView->setOpenItem(static_cast(listItem)); + rootListClicked(listItem, TQPoint(0,0), 0); } if(searchNewItems(g)) listItem->setHighLight(true); @@ -841,8 +841,8 @@ void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *list //Name and comment - QString itemName = s->name(); - QString subText= QString(); + TQString itemName = s->name(); + TQString subText= TQString(); if( !isSeparator ) { if( s->comment() != NULL && !s->comment().isEmpty() ) @@ -899,14 +899,14 @@ void MenuHandler::populateList( KServiceGroup *serviceGroup, TastyListView *list prevListItem = listItem; - QPixmap iconPix = s->pixmap( KIcon::Toolbar, iconSize ); + TQPixmap iconPix = s->pixmap( KIcon::Toolbar, iconSize ); if ( iconPix.height () != iconSize) { - QImage img = iconPix.convertToImage(); + TQImage img = iconPix.convertToImage(); if( !img.isNull() ) { img = img.smoothScale ( iconSize, iconSize); - iconPix = QPixmap (img); + iconPix = TQPixmap (img); } } listItem->setPixmap(0, iconPix); @@ -936,15 +936,15 @@ void MenuHandler::initializeRecentlyUsed( ) kickerConf->reparseConfiguration(); kickerConf->setGroup("menus"); - QStringList recentUsedList = QStringList::split(',',kickerConf->readEntry("RecentAppsStat")); + TQStringList recentUsedList = TQStringList::split(',',kickerConf->readEntry("RecentAppsStat")); - for (QStringList::ConstIterator it = recentUsedList.begin(); + for (TQStringList::ConstIterator it = recentUsedList.begin(); it != recentUsedList.end(); ++it ) { - QString item = (*it); + TQString item = (*it); - QString desktopPath = item.section(' ',2,2); - if(desktopPath.isEmpty() || !QFile::exists(desktopPath)) + TQString desktopPath = item.section(' ',2,2); + if(desktopPath.isEmpty() || !TQFile::exists(desktopPath)) continue; recentlyUsedMap[-item.section(' ',1,1).toULong()] = desktopPath; @@ -973,14 +973,14 @@ void MenuHandler::fillRecentDocuments( ) menu->dynamicList->clear(); setupDynList( RecentDocuments ); - QStringList recentDocsList = KRecentDocument::recentDocuments(); + TQStringList recentDocsList = KRecentDocument::recentDocuments(); TastyListViewItem *listItem = NULL; if( recentDocsList.isEmpty() ) return; - for (QStringList::Iterator it = recentDocsList.begin(); + for (TQStringList::Iterator it = recentDocsList.begin(); it != recentDocsList.end(); ++it ) { KDesktopFile *f= new KDesktopFile(*it, true /* read only */); @@ -994,14 +994,14 @@ void MenuHandler::fillRecentDocuments( ) listItem->setDeskopEntryPath(*it); listItem->setType( TastyListViewItem::DesktopFile ); - QPixmap iconPix = iconLoader->loadIcon(f->readIcon(), KIcon::Panel, _iconSize1); + TQPixmap iconPix = iconLoader->loadIcon(f->readIcon(), KIcon::Panel, _iconSize1); if ( iconPix.height () > _iconSize1) { - QImage img = iconPix.convertToImage(); + TQImage img = iconPix.convertToImage(); if( !img.isNull() ) { img = img.smoothScale ( _iconSize1, _iconSize1); - iconPix = QPixmap (img); + iconPix = TQPixmap (img); } } listItem->setPixmap(0, iconPix); @@ -1021,7 +1021,7 @@ void MenuHandler::fillMoreUsed( ) TastyListViewItem *listItem = NULL; - for (QStringList::Iterator it = moreUsedList.begin(); + for (TQStringList::Iterator it = moreUsedList.begin(); it != moreUsedList.end(); ++it ) { //FIXME: yeah, I know, this is U G L Y :-) @@ -1041,16 +1041,16 @@ void MenuHandler::fillMoreUsed( ) listItem->setDisplaySubText(_displaySubText); - QPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); + TQPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); if( !iconPix.isNull() ) { if ( iconPix.height () != _iconSize1) { - QImage img = iconPix.convertToImage(); + TQImage img = iconPix.convertToImage(); if( !img.isNull() ) { img = img.smoothScale ( _iconSize1, _iconSize1); - iconPix = QPixmap (img); + iconPix = TQPixmap (img); } } listItem->setPixmap(0, iconPix); @@ -1090,16 +1090,16 @@ void MenuHandler::fillRecentlyUsed( ) listItem->setDisplaySubText(_displaySubText); - QPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); + TQPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); if( !iconPix.isNull() ) { if ( iconPix.height () != _iconSize1) { - QImage img = iconPix.convertToImage(); + TQImage img = iconPix.convertToImage(); if( !img.isNull() ) { img = img.smoothScale ( _iconSize1, _iconSize1); - iconPix = QPixmap (img); + iconPix = TQPixmap (img); } } listItem->setPixmap(0, iconPix); @@ -1119,7 +1119,7 @@ void MenuHandler::fillFavourites( ) TastyListViewItem *listItem = NULL; - for (QStringList::Iterator it = favouriteList.begin(); + for (TQStringList::Iterator it = favouriteList.begin(); it != favouriteList.end(); ++it ) { @@ -1135,14 +1135,14 @@ void MenuHandler::fillFavourites( ) listItem->setDisplaySubText(_displaySubText); - QPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); + TQPixmap iconPix = s->pixmap( KIcon::Toolbar, _iconSize1 ); if ( iconPix.height () > _iconSize1) { - QImage img = iconPix.convertToImage(); + TQImage img = iconPix.convertToImage(); if( !img.isNull() ) { img = img.smoothScale ( _iconSize1, _iconSize1); - iconPix = QPixmap (img); + iconPix = TQPixmap (img); } } listItem->setPixmap(0, iconPix); @@ -1181,7 +1181,7 @@ void MenuHandler::slotApplicationsAdded(const KFileItemList & newItems) for(KFileItemListIterator it(newItems); it.current(); ++it) { KFileItem *item = (*it); - QString path(item->url().path()); + TQString path(item->url().path()); kdDebug() << "new item: " << item->name() << endl; //ignore items already here @@ -1202,13 +1202,13 @@ void MenuHandler::slotApplicationsAdded(const KFileItemList & newItems) //It's necessary to wait some seconds, otherwise apps won't be listed //I do it two times for being sure, because I still haven't the clear idea //where the right files to watch are... - QTimer::singleShot(15000, this, SLOT(slotUpdateApplications())); + TQTimer::singleShot(15000, this, SLOT(slotUpdateApplications())); } void MenuHandler::slotApplicationRemoved() { - QTimer::singleShot(15000, this, SLOT(slotUpdateApplications())); + TQTimer::singleShot(15000, this, SLOT(slotUpdateApplications())); slotUpdateApplications(); } @@ -1222,7 +1222,7 @@ void MenuHandler::slotUpdateApplications() populateList( service, menu->rootList, NULL, false ); } -void MenuHandler::listClicked( TastyListViewItem * listItem, const QPoint & coord ) +void MenuHandler::listClicked( TastyListViewItem * listItem, const TQPoint & coord ) { if( !listItem ) return; @@ -1234,7 +1234,7 @@ void MenuHandler::listClicked( TastyListViewItem * listItem, const QPoint & coor int x = coord.x(); - QString servicePath = listItem->getDeskopEntryPath(); + TQString servicePath = listItem->getDeskopEntryPath(); switch( listItem->getType() ) { @@ -1291,7 +1291,7 @@ void MenuHandler::listClicked( TastyListViewItem * listItem, const QPoint & coor { DCOPRef kickerKMenuIface ("kicker", "KMenu"); - kickerKMenuIface.call("slotServiceStartedByStorageId(QString,QString)", "tastymenu", servicePath); + kickerKMenuIface.call("slotServiceStartedByStorageId(TQString,TQString)", "tastymenu", servicePath); if( (currentMenuMode == MoreUsed || currentMenuMode == RecentlyUsed) && !searchMode) @@ -1349,7 +1349,7 @@ void MenuHandler::listClicked( TastyListViewItem * listItem, const QPoint & coor } -void MenuHandler::dynListClicked( QListViewItem * listItem, const QPoint & coord, int c ) +void MenuHandler::dynListClicked( TQListViewItem * listItem, const TQPoint & coord, int c ) { c=c; if( !listItem ) @@ -1362,7 +1362,7 @@ void MenuHandler::dynListClicked( QListViewItem * listItem, const QPoint & coord listClicked( static_cast(listItem), coord ); } -void MenuHandler::childListClicked( QListViewItem * listItem, const QPoint & coord, int c ) +void MenuHandler::childListClicked( TQListViewItem * listItem, const TQPoint & coord, int c ) { c=c; if( !listItem ) @@ -1382,7 +1382,7 @@ void MenuHandler::childListClicked( QListViewItem * listItem, const QPoint & coo listClicked( static_cast(listItem), coord ); } -void MenuHandler::rootListClicked( QListViewItem * listItem, const QPoint & coord, int c ) +void MenuHandler::rootListClicked( TQListViewItem * listItem, const TQPoint & coord, int c ) { c=c; if( !listItem ) @@ -1408,7 +1408,7 @@ void MenuHandler::rootListClicked( QListViewItem * listItem, const QPoint & coor menu->childList->setSorting(0); } -void MenuHandler::slotContextMenu(QListViewItem *listItem, const QPoint &coord, int c) +void MenuHandler::slotContextMenu(TQListViewItem *listItem, const TQPoint &coord, int c) { if( !listItem ) @@ -1454,7 +1454,7 @@ void MenuHandler::slotContextMenu(QListViewItem *listItem, const QPoint &coord, break; case 2: - listClicked( tastyListItem, QPoint(tastyListItem->listView()->width(), 0) ); + listClicked( tastyListItem, TQPoint(tastyListItem->listView()->width(), 0) ); break; case 3: @@ -1590,7 +1590,7 @@ void MenuHandler::doNewSession( bool lock ) } -void MenuHandler::initializeSearch( const QString & query ) +void MenuHandler::initializeSearch( const TQString & query ) { if( !searchMode && query.length() > 2 ) { @@ -1600,9 +1600,9 @@ void MenuHandler::initializeSearch( const QString & query ) menu->menuModes->setEnabled(false); KServiceGroup::Ptr service = KServiceGroup::root(); menu->dynamicList->clear(); - setCursor(QCursor(Qt::BusyCursor)); + setCursor(TQCursor(TQt::BusyCursor)); populateList( service, menu->dynamicList, NULL, true, query ); - setCursor(QCursor(Qt::ArrowCursor)); + setCursor(TQCursor(TQt::ArrowCursor)); } else if( query.length() < 3 ) { @@ -1620,14 +1620,14 @@ void MenuHandler::initializeSearch( const QString & query ) } } -void MenuHandler::kerrySearch( const QString & query ) +void MenuHandler::kerrySearch( const TQString & query ) { close(); DCOPRef kdesktopKScreensaverIface ("kerry", "search"); - kdesktopKScreensaverIface.call ("search(QString)", query); + kdesktopKScreensaverIface.call ("search(TQString)", query); } -void MenuHandler::strigiSearch( const QString & query ) +void MenuHandler::strigiSearch( const TQString & query ) { close(); KRun::runCommand ("konqueror strigi:/?q="+query); @@ -1685,23 +1685,23 @@ void MenuHandler::menuModeChanged( int index ) void MenuHandler::switchWindowMode() { - if( !_isNormalWindow /*testWFlags(Qt::WType_Popup)*/ ) + if( !_isNormalWindow /*testWFlags(TQt::WType_Popup)*/ ) { _isNormalWindow = true; hide(); - reparent(static_cast(parent()),Qt::WType_Dialog, pos(), true); + reparent(static_cast(parent()),TQt::WType_Dialog, pos(), true); - menu->detachButton->setIconSet(QPixmap(uic_findImage("attach.png"))); + menu->detachButton->setIconSet(TQPixmap(uic_findImage("attach.png"))); prefSkel->setIsNormalWindow(true); } else { hide(); - reparent(static_cast(parent()), - Qt::WType_Popup|Qt::WNoAutoErase, + reparent(static_cast(parent()), + TQt::WType_Popup|TQt::WNoAutoErase, pos(), true); - menu->detachButton->setIconSet(QPixmap(uic_findImage("detach.png"))); + menu->detachButton->setIconSet(TQPixmap(uic_findImage("detach.png"))); prefSkel->setIsNormalWindow(false); _isNormalWindow = false; } diff --git a/src/menuhandler.h b/src/menuhandler.h index 9fdf33f..8a31e2f 100644 --- a/src/menuhandler.h +++ b/src/menuhandler.h @@ -32,14 +32,14 @@ #include #include #include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include #include #include -#include +#include #include #include "dmctl.h" @@ -50,16 +50,16 @@ /** @author Marco Martin */ -class MenuHandler : public QFrame{ +class MenuHandler : public TQFrame{ Q_OBJECT public: - MenuHandler( QWidget *parent, Prefs *prefs, char *name=0, WFlags fl=WType_TopLevel ); + MenuHandler( TQWidget *parent, Prefs *prefs, char *name=0, WFlags fl=WType_TopLevel ); ~MenuHandler(); void readConfig(); - void popup(QPoint pos); + void popup(TQPoint pos); void updateConfig(); void focusNextChild(){focusNextPrevChild(true);} void focusPrevChild(){focusNextPrevChild(false);} @@ -74,15 +74,15 @@ signals: void hidden(); protected: - virtual bool eventFilter( QObject *o, QEvent * e ); + virtual bool eventFilter( TQObject *o, TQEvent * e ); - virtual void closeEvent ( QCloseEvent *e); - virtual void resizeEvent ( QResizeEvent *e) - { QWidget::resizeEvent(e); menu->leftFrame->setMaximumWidth( (int)((width()-24)/3) ); } - virtual void mousePressEvent( QMouseEvent *e); + virtual void closeEvent ( TQCloseEvent *e); + virtual void resizeEvent ( TQResizeEvent *e) + { TQWidget::resizeEvent(e); menu->leftFrame->setMaximumWidth( (int)((width()-24)/3) ); } + virtual void mousePressEvent( TQMouseEvent *e); private: - typedef QMap RecentlyUsedMap; + typedef TQMap RecentlyUsedMap; typedef enum { Favourites = 0, @@ -93,12 +93,12 @@ private: RecentlyUsedMap recentlyUsedMap; - QStringList moreUsedList, favouriteList; + TQStringList moreUsedList, favouriteList; Menu * menu; MenuMode currentMenuMode; KIconLoader *iconLoader; - QPopupMenu *sessionsMenu; + TQPopupMenu *sessionsMenu; bool searchMode; Prefs *prefSkel; KConfig *kickerConf; @@ -107,15 +107,15 @@ private: KDirWatch *xdgMenuWatch; KDirLister *xdgMenuLister; int firstListing; - QStringList oldInstalledList, newInstalledList; - QValueList newInstalledTimeStamps; + TQStringList oldInstalledList, newInstalledList; + TQValueList newInstalledTimeStamps; - QPixmap bookMarkPix; - QVBoxLayout * MenuHandlerLayout; + TQPixmap bookMarkPix; + TQVBoxLayout * MenuHandlerLayout; //configuration items int _menuMode; - QString _currentCategory; + TQString _currentCategory; int _numRecentEntries; int _iconSize1; int _iconSize2; @@ -133,7 +133,7 @@ private: bool _hideOneChild; bool _alphabetical; - typedef QMap SListMap; + typedef TQMap SListMap; SListMap sListMap; //KServiceGroup::List getServiceGroupList( KServiceGroup *serviceGroup ); void setupColumns(); @@ -143,9 +143,9 @@ private: void populateList( KServiceGroup *serviceGroup, TastyListView *listView, TastyListViewItem *listItemFather, - bool recursive, const QString & query = NULL ); + bool recursive, const TQString & query = NULL ); - void listClicked( TastyListViewItem * listItem, const QPoint & coord ); + void listClicked( TastyListViewItem * listItem, const TQPoint & coord ); void fillRecentDocuments( ); void fillMoreUsed( ); void fillRecentlyUsed( ); @@ -159,23 +159,23 @@ public slots: private slots: void dynListElemMoved( ); - void dynListClicked( QListViewItem * listItem, const QPoint & coord, int c ); - void slotContextMenu(QListViewItem *listItem, const QPoint &coord, int c ); + void dynListClicked( TQListViewItem * listItem, const TQPoint & coord, int c ); + void slotContextMenu(TQListViewItem *listItem, const TQPoint &coord, int c ); void initializeRecentlyUsed( ); void slotModKickerConf(); void slotApplicationsAdded(const KFileItemList & newItems); void slotApplicationRemoved(); - void childListClicked( QListViewItem * listItem, const QPoint & coord, int c ); - void rootListClicked( QListViewItem * listItem, const QPoint & coord, int c ); + void childListClicked( TQListViewItem * listItem, const TQPoint & coord, int c ); + void rootListClicked( TQListViewItem * listItem, const TQPoint & coord, int c ); void doLogout(); void doLock(); void slotPopulateSessions(); void slotSessionActivated( int ent ); void doNewSession( bool lock ); void runDialog(); - void initializeSearch( const QString & query ); - void kerrySearch( const QString & query ); - void strigiSearch( const QString & query ); + void initializeSearch( const TQString & query ); + void kerrySearch( const TQString & query ); + void strigiSearch( const TQString & query ); void clearDynList(); void menuModeChanged( int index ); void switchWindowMode(); diff --git a/src/misc.cpp b/src/misc.cpp index 2f1d30c..15fe755 100644 --- a/src/misc.cpp +++ b/src/misc.cpp @@ -16,23 +16,23 @@ * Boston, MA 02111-1307, USA. */ -#include +#include #include "misc.h" -QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int a) +TQColor alphaBlendColors(const TQColor &bgColor, const TQColor &fgColor, const int a) { // normal button... - QRgb rgb = bgColor.rgb(); - QRgb rgb_b = fgColor.rgb(); + TQRgb rgb = bgColor.rgb(); + TQRgb rgb_b = fgColor.rgb(); int alpha = a; if(alpha>255) alpha = 255; if(alpha<0) alpha = 0; int inv_alpha = 255 - alpha; - QColor result = QColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255, - qGreen(rgb_b)*inv_alpha/255 + qGreen(rgb)*alpha/255, - qBlue(rgb_b)*inv_alpha/255 + qBlue(rgb)*alpha/255) ); + TQColor result = TQColor( tqRgb(tqRed(rgb_b)*inv_alpha/255 + tqRed(rgb)*alpha/255, + tqGreen(rgb_b)*inv_alpha/255 + tqGreen(rgb)*alpha/255, + tqBlue(rgb_b)*inv_alpha/255 + tqBlue(rgb)*alpha/255) ); return result; } diff --git a/src/misc.h b/src/misc.h index 835c277..364c0d3 100644 --- a/src/misc.h +++ b/src/misc.h @@ -19,6 +19,6 @@ #ifndef __MISC_H #define __MISC_H -QColor alphaBlendColors(const QColor &backgroundColor, const QColor &foregroundColor, const int alpha); +TQColor alphaBlendColors(const TQColor &backgroundColor, const TQColor &foregroundColor, const int alpha); #endif // __MISC_H diff --git a/src/tastybutton.cpp b/src/tastybutton.cpp index 9f89c05..fb4eb9a 100644 --- a/src/tastybutton.cpp +++ b/src/tastybutton.cpp @@ -19,14 +19,14 @@ ***************************************************************************/ #include "tastybutton.h" -#include -#include -#include -#include +#include +#include +#include +#include #include -TastyButton::TastyButton(QWidget *parent) - : QToolButton(parent) +TastyButton::TastyButton(TQWidget *parent) + : TQToolButton(parent) { iconEffect = new KIconEffect(); iconEffect->init(); @@ -37,17 +37,17 @@ TastyButton::~TastyButton() { } -void TastyButton::drawButton( QPainter * p ) +void TastyButton::drawButton( TQPainter * p ) { //background image or pseudo transparency if( parentWidget()->erasePixmap() ) { - const QPixmap erasePix(size()); - QPainter buffPainter(&erasePix); - buffPainter.drawPixmap(QPoint(0, 0), *parentWidget()->erasePixmap(), geometry()); + const TQPixmap erasePix(size()); + TQPainter buffPainter(&erasePix); + buffPainter.drawPixmap(TQPoint(0, 0), *parentWidget()->erasePixmap(), geometry()); buffPainter.end(); - QImage eraseImg = erasePix.convertToImage(); + TQImage eraseImg = erasePix.convertToImage(); if( isDown() ) { KImageEffect::fade(eraseImg, 0.25, black); @@ -73,7 +73,7 @@ void TastyButton::drawButton( QPainter * p ) x=++y; //deciding the text color to use int h,s,v; - QColor(eraseImg.pixel(x,y)).getHsv( h, s, v ); + TQColor(eraseImg.pixel(x,y)).getHsv( h, s, v ); // is purely empirical :) if( v > 140) lightScore++; else lightScore--; @@ -103,14 +103,14 @@ void TastyButton::drawButton( QPainter * p ) drawButtonLabel(p); } -void TastyButton::setIconSet( QIconSet is ) +void TastyButton::setIconSet( TQIconSet is ) { is.setPixmap(iconEffect->apply(is.pixmap(), (int)KIcon::Panel, (int)KIcon::ActiveState), - QIconSet::Automatic, - QIconSet::Active); + TQIconSet::Automatic, + TQIconSet::Active); - QToolButton::setIconSet( is ); + TQToolButton::setIconSet( is ); } diff --git a/src/tastybutton.h b/src/tastybutton.h index 4fa0d89..7df7f0f 100644 --- a/src/tastybutton.h +++ b/src/tastybutton.h @@ -22,26 +22,26 @@ #include #include -#include -#include +#include +#include /** @author Marco Martin */ -class TastyButton : public QToolButton +class TastyButton : public TQToolButton { public: - TastyButton(QWidget *parent); + TastyButton(TQWidget *parent); ~TastyButton(); - void setIconSet( QIconSet is ); + void setIconSet( TQIconSet is ); protected: - void drawButton( QPainter * p ); + void drawButton( TQPainter * p ); private: - QPixmap highLightedIcon; + TQPixmap highLightedIcon; KIconEffect *iconEffect; }; diff --git a/src/tastylistview.cpp b/src/tastylistview.cpp index ed5e2a7..30d98a8 100644 --- a/src/tastylistview.cpp +++ b/src/tastylistview.cpp @@ -24,19 +24,19 @@ #include #include -#include -#include -#include +#include +#include +#include #include #include -#include +#include -TastyListView::TastyListView( QWidget * parent, const char * name) +TastyListView::TastyListView( TQWidget * parent, const char * name) : KListView(parent, name), highLightGroups(true), easyOpen(true) { - onItemTimer = new QTimer(this, "onItemTimer"); + onItemTimer = new TQTimer(this, "onItemTimer"); underCursorItem = openItem = NULL; mouseDown = false; actionIconSize = 16; @@ -44,7 +44,7 @@ TastyListView::TastyListView( QWidget * parent, const char * name) listItemTip = new TastyListViewToolTip(viewport(), this); - connect(this, SIGNAL(onItem(QListViewItem *) ), SLOT(slotOnItem(QListViewItem *) ) ); + connect(this, SIGNAL(onItem(TQListViewItem *) ), SLOT(slotOnItem(TQListViewItem *) ) ); connect(onItemTimer, SIGNAL(timeout()), this, SLOT(slotTimeout()) ); } @@ -61,7 +61,7 @@ void TastyListView::startDrag() if( !item ) return; - QDragObject *d = new KURLDrag( KURL(item->getDeskopEntryPath()) , viewport() ); + TQDragObject *d = new KURLDrag( KURL(item->getDeskopEntryPath()) , viewport() ); if(!d) return; @@ -69,7 +69,7 @@ void TastyListView::startDrag() emit moved(); } -void TastyListView::contentsMouseReleaseEvent( QMouseEvent * e ) +void TastyListView::contentsMouseReleaseEvent( TQMouseEvent * e ) { int x = e->x(); if( x > width() || x < 0) @@ -84,7 +84,7 @@ void TastyListView::contentsMouseReleaseEvent( QMouseEvent * e ) if( e->button() == RightButton ) emit(contextMenuRequested( currentItem(), e->globalPos(), 0) ); else - emit(activated( currentItem(), QPoint(x, e->y()), 0) ); + emit(activated( currentItem(), TQPoint(x, e->y()), 0) ); if(item && (item->getType() == TastyListViewItem::ServiceGroup)) { @@ -104,16 +104,16 @@ void TastyListView::contentsMouseReleaseEvent( QMouseEvent * e ) KListView::contentsMouseReleaseEvent(e); } -void TastyListView::contentsMouseMoveEvent( QMouseEvent * e ) +void TastyListView::contentsMouseMoveEvent( TQMouseEvent * e ) { KListView::contentsMouseMoveEvent(e); - mouseDown = (e->state() & Qt::LeftButton); + mouseDown = (e->state() & TQt::LeftButton); - if( itemAt( contentsToViewport(QPoint(e->x(), e->y()))) == 0 ) + if( itemAt( contentsToViewport(TQPoint(e->x(), e->y()))) == 0 ) underCursorItem = NULL; } -void TastyListView::leaveEvent( QEvent * e ) +void TastyListView::leaveEvent( TQEvent * e ) { KListView::leaveEvent( e ); onItemTimer->stop(); @@ -122,16 +122,16 @@ void TastyListView::leaveEvent( QEvent * e ) } -void TastyListView::keyPressEvent( QKeyEvent * e ) +void TastyListView::keyPressEvent( TQKeyEvent * e ) { switch(e->key()) { - case Qt::Key_Enter: - case Qt::Key_Return: - case Qt::Key_Space: + case TQt::Key_Enter: + case TQt::Key_Return: + case TQt::Key_Space: { - emit(activated(currentItem(), QPoint(0,0), 0)); + emit(activated(currentItem(), TQPoint(0,0), 0)); if(!currentItem()) return; TastyListViewItem *item = dynamic_cast(currentItem()); @@ -152,19 +152,19 @@ void TastyListView::keyPressEvent( QKeyEvent * e ) } break; - case Qt::Key_Up: - case Qt::Key_Down: + case TQt::Key_Up: + case TQt::Key_Down: KListView::keyPressEvent( e ); break; - case Qt::Key_Right: + case TQt::Key_Right: { if(!currentItem()) return; TastyListViewItem *item = dynamic_cast(currentItem()); - if(item && easyOpen && !QApplication::reverseLayout() && item->getType() == TastyListViewItem::ServiceGroup) + if(item && easyOpen && !TQApplication::reverseLayout() && item->getType() == TastyListViewItem::ServiceGroup) { - emit( activated( currentItem(), QPoint(0,0), 0)); + emit( activated( currentItem(), TQPoint(0,0), 0)); if( !openItem ) { openItem = currentItem(); @@ -177,17 +177,17 @@ void TastyListView::keyPressEvent( QKeyEvent * e ) oldOpenItem->repaint(); } - focusNextPrevChild(!QApplication::reverseLayout()); + focusNextPrevChild(!TQApplication::reverseLayout()); break; } - case Qt::Key_Left: + case TQt::Key_Left: { if( !currentItem() ) return; TastyListViewItem *item = dynamic_cast(currentItem()); - if(item && easyOpen && QApplication::reverseLayout() && item->getType() == TastyListViewItem::ServiceGroup) + if(item && easyOpen && TQApplication::reverseLayout() && item->getType() == TastyListViewItem::ServiceGroup) { - emit( activated( currentItem(), QPoint(0,0), 0)); + emit( activated( currentItem(), TQPoint(0,0), 0)); if( !openItem ) { openItem = currentItem(); @@ -200,10 +200,10 @@ void TastyListView::keyPressEvent( QKeyEvent * e ) oldOpenItem->repaint(); } - focusNextPrevChild(QApplication::reverseLayout()); + focusNextPrevChild(TQApplication::reverseLayout()); break; } - case Qt::Key_Tab: + case TQt::Key_Tab: KListView::keyPressEvent( e ); break; @@ -213,7 +213,7 @@ void TastyListView::keyPressEvent( QKeyEvent * e ) } -void TastyListView::slotOnItem( QListViewItem * listItem ) +void TastyListView::slotOnItem( TQListViewItem * listItem ) { if( !listItem || listItem->listView() != this ) return; @@ -239,7 +239,7 @@ void TastyListView::slotTimeout( ) if( easyOpen && tastyUnderCursorItem && tastyUnderCursorItem->getType() == TastyListViewItem::ServiceGroup ) { - emit(activated(underCursorItem, QPoint(underCursorItem->listView()->width()/2,1), 0)); + emit(activated(underCursorItem, TQPoint(underCursorItem->listView()->width()/2,1), 0)); TastyListViewItem *oldOpenItem = dynamic_cast(openItem); openItem = currentItem(); if( !oldOpenItem || !oldOpenItem->listView() ) @@ -250,18 +250,18 @@ void TastyListView::slotTimeout( ) } ///////////TASTYLISTVIEWTOOLTIP -TastyListViewToolTip::TastyListViewToolTip( QWidget *parent, TastyListView *tListView ) - : QToolTip( parent ), listView( tListView ) +TastyListViewToolTip::TastyListViewToolTip( TQWidget *parent, TastyListView *tListView ) + : TQToolTip( parent ), listView( tListView ) { } -void TastyListViewToolTip::maybeTip( const QPoint &pos ) +void TastyListViewToolTip::maybeTip( const TQPoint &pos ) { if( !parentWidget() || !listView || !listView->showToolTips() ) return; TastyListViewItem *item = static_cast(listView->itemAt( pos )); - QPoint contentsPos = listView->viewportToContents( pos ); + TQPoint contentsPos = listView->viewportToContents( pos ); if( !item || !listView->columns() ) return; @@ -273,7 +273,7 @@ void TastyListViewToolTip::maybeTip( const QPoint &pos ) int column = listView->header()->sectionAt( contentsPos.x() ); - QRect r = listView->itemRect( item ); + TQRect r = listView->itemRect( item ); int headerPos = listView->header()->sectionPos( column ); r.setLeft( headerPos ); r.setRight( headerPos + listView->header()->sectionSize( column ) ); @@ -330,19 +330,19 @@ TastyListViewItem::TastyListViewItem( TastyListViewItem * parent ) : KListViewItem(parent) {commonConstructor();} -TastyListViewItem::TastyListViewItem( TastyListView * parent, TastyListViewItem * after, QString label1 ) +TastyListViewItem::TastyListViewItem( TastyListView * parent, TastyListViewItem * after, TQString label1 ) : KListViewItem(parent, after, label1) {commonConstructor();cellText = label1;} -TastyListViewItem::TastyListViewItem( TastyListViewItem * parent, TastyListViewItem * after, QString label1 ) +TastyListViewItem::TastyListViewItem( TastyListViewItem * parent, TastyListViewItem * after, TQString label1 ) : KListViewItem(parent, after, label1) {commonConstructor();cellText = label1;} -TastyListViewItem::TastyListViewItem( TastyListView * parent, QString label1 ) +TastyListViewItem::TastyListViewItem( TastyListView * parent, TQString label1 ) : KListViewItem(parent, label1) {commonConstructor();cellText = label1;} -TastyListViewItem::TastyListViewItem( TastyListViewItem * parent, QString label1 ) +TastyListViewItem::TastyListViewItem( TastyListViewItem * parent, TQString label1 ) : KListViewItem(parent, label1) {commonConstructor();cellText = label1;} @@ -357,11 +357,11 @@ void TastyListViewItem::commonConstructor() actionType = NoAction; - actionPix = QPixmap(); + actionPix = TQPixmap(); - menuId = QString(); - desktopEntryPath = QString(); - path = QString(); + menuId = TQString(); + desktopEntryPath = TQString(); + path = TQString(); ellipsis = false; highLight = false; @@ -371,7 +371,7 @@ void TastyListViewItem::commonConstructor() void TastyListViewItem::loadPixmap() { - QString iconFile = ""; + TQString iconFile = ""; iconLoader = KGlobal::iconLoader(); if( !listView() ) @@ -392,7 +392,7 @@ void TastyListViewItem::loadPixmap() break; case OpenGroup: - if( QApplication::reverseLayout() ) + if( TQApplication::reverseLayout() ) actionPix = iconLoader->loadIcon("1leftarrow", KIcon::Small, lv->getActionIconSize()); else actionPix = iconLoader->loadIcon("1rightarrow", KIcon::Small, lv->getActionIconSize()); @@ -413,19 +413,19 @@ void TastyListViewItem::loadPixmap() if ( actionPix.height () > lv->getActionIconSize()) { - QImage img = actionPix.convertToImage(); + TQImage img = actionPix.convertToImage(); if( !img.isNull() ) { img = img.smoothScale ( lv->getActionIconSize(), lv->getActionIconSize()); - actionPix = QPixmap (img); + actionPix = TQPixmap (img); } } } -QString TastyListViewItem::key( int column, bool ascending ) const +TQString TastyListViewItem::key( int column, bool ascending ) const { ascending = ascending; - QString prefix; + TQString prefix; //ensure all the categories are before the leaf items if( itemType == ServiceGroup ) @@ -440,7 +440,7 @@ void TastyListViewItem::setup ( ) //KListViewItem::setup(); //calculate listitem height - QFontMetrics fm( listView()->font() ); + TQFontMetrics fm( listView()->font() ); int pixmapHeight = 5; if( pixmap(0) ) @@ -457,14 +457,14 @@ void TastyListViewItem::setup ( ) /*Adapted from Amarok's Statistic listView Copyright (c) 2006 Seb Ruiz*/ -void TastyListViewItem::paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ) +void TastyListViewItem::paintCell ( TQPainter * p, const TQColorGroup & cg, int column, int width, int align ) { int textHeight = height(); - QString name = cellText; + TQString name = cellText; int textX = 0; - QColor fillColor, textColor; + TQColor fillColor, textColor; # if KDE_VERSION < KDE_MAKE_VERSION(3,3,91) # define BackgroundColor backgroundColor() @@ -483,7 +483,7 @@ void TastyListViewItem::paintCell ( QPainter * p, const QColorGroup & cg, int co if( !lv ) return; - QFont font( lv->font() ); + TQFont font( lv->font() ); if( !isSelected() && (lv->getOpenItem() == this|| (lv->getHighLightGroups() && itemType == ServiceGroup)) ) @@ -500,17 +500,17 @@ void TastyListViewItem::paintCell ( QPainter * p, const QColorGroup & cg, int co else if( isSelected() && !lv->hasFocus() ) fillColor = alphaBlendColors( fillColor, BackgroundColor, 150); - QFontMetrics fm( font ); + TQFontMetrics fm( font ); widthChanged(column); - QPixmap buffer(width*2, textHeight); + TQPixmap buffer(width*2, textHeight); if( buffer.isNull() ) return; buffer.fill( fillColor ); - QPainter pBuf(&buffer); + TQPainter pBuf(&buffer); if( pixmap( column ) ) @@ -557,8 +557,8 @@ void TastyListViewItem::paintCell ( QPainter * p, const QColorGroup & cg, int co font.setPointSize( max((int)(font.pointSize()/1.2), 7) ); pBuf.setFont( font ); - QString subTextCopy = subText; - QFontMetrics sfm( font ); + TQString subTextCopy = subText; + TQFontMetrics sfm( font ); //Calculate the ellipsis for the subtext int extraSpace = fm.width("...") + textX + lv->getActionIconSpace(); diff --git a/src/tastylistview.h b/src/tastylistview.h index fae9d02..47917d7 100644 --- a/src/tastylistview.h +++ b/src/tastylistview.h @@ -27,10 +27,10 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include class TastyListView; @@ -39,12 +39,12 @@ class TastyListView; /** @author Marco Martin */ -class TastyListViewToolTip: public QToolTip +class TastyListViewToolTip: public TQToolTip { public: - TastyListViewToolTip( QWidget *parent, TastyListView *tListView ); + TastyListViewToolTip( TQWidget *parent, TastyListView *tListView ); - void maybeTip( const QPoint &pos ); + void maybeTip( const TQPoint &pos ); private: TastyListView *listView; @@ -58,9 +58,9 @@ class TastyListView : public KListView Q_OBJECT private: bool highLightGroups; - QTimer *onItemTimer; - QListViewItem *underCursorItem; - QListViewItem *openItem; + TQTimer *onItemTimer; + TQListViewItem *underCursorItem; + TQListViewItem *openItem; bool mouseDown; bool easyOpen; int actionIconSize; @@ -69,7 +69,7 @@ private: TastyListViewToolTip *listItemTip; public: - TastyListView( QWidget * parent = 0, const char * name = 0); + TastyListView( TQWidget * parent = 0, const char * name = 0); ~TastyListView(); @@ -84,27 +84,27 @@ public: int getActionIconSize(){return actionIconSize;} int getActionIconSpace(){return actionIconSpace;} - QListViewItem * getOpenItem(){ return openItem;} - void setOpenItem( QListViewItem * listItem ){openItem = listItem;} + TQListViewItem * getOpenItem(){ return openItem;} + void setOpenItem( TQListViewItem * listItem ){openItem = listItem;} public slots: virtual void clear(){openItem = underCursorItem = NULL; KListView::clear();} protected: - virtual void leaveEvent( QEvent * e ); - virtual void contentsMouseMoveEvent( QMouseEvent * e ); - virtual void contentsMouseReleaseEvent( QMouseEvent * e ); - virtual void keyPressEvent( QKeyEvent * e ); + virtual void leaveEvent( TQEvent * e ); + virtual void contentsMouseMoveEvent( TQMouseEvent * e ); + virtual void contentsMouseReleaseEvent( TQMouseEvent * e ); + virtual void keyPressEvent( TQKeyEvent * e ); private slots: - void slotOnItem( QListViewItem * listItem ); + void slotOnItem( TQListViewItem * listItem ); void slotTimeout(); signals: //Using own signal instead of clicked() in order to avoid launching two times the same app :-) - void activated(QListViewItem *, const QPoint &, int ); + void activated(TQListViewItem *, const TQPoint &, int ); }; @@ -137,20 +137,20 @@ friend class TastyListView; TastyListViewItem( TastyListView * parent ); TastyListViewItem( TastyListViewItem * parent ); - TastyListViewItem( TastyListView * parent, TastyListViewItem * after, QString label1 ); - TastyListViewItem( TastyListViewItem * parent, TastyListViewItem * after, QString label1 ); + TastyListViewItem( TastyListView * parent, TastyListViewItem * after, TQString label1 ); + TastyListViewItem( TastyListViewItem * parent, TastyListViewItem * after, TQString label1 ); TastyListViewItem( TastyListView * parent, TastyListViewItem * after ); TastyListViewItem( TastyListViewItem * parent, TastyListViewItem * after ); - TastyListViewItem( TastyListView * parent, QString label1 ); - TastyListViewItem( TastyListViewItem * parent, QString label1 ); + TastyListViewItem( TastyListView * parent, TQString label1 ); + TastyListViewItem( TastyListViewItem * parent, TQString label1 ); ~TastyListViewItem(); - //QString text(int column) const {return cellText;} - QString getCellText(int column) const {return cellText;} + //TQString text(int column) const {return cellText;} + TQString getCellText(int column) const {return cellText;} //TastyListViewItem *parent(); - void paintCell ( QPainter * p, const QColorGroup & cg, int column, int width, int align ); + void paintCell ( TQPainter * p, const TQColorGroup & cg, int column, int width, int align ); Type getType(){return itemType;} void setType( Type newItemType ){itemType = newItemType;} @@ -159,24 +159,24 @@ friend class TastyListView; void setActionType( ActionType newActionType ){ actionType = newActionType;loadPixmap();} void loadPixmap(); - void setPath( QString newPath){ path = newPath;} - QString getPath(){return path;} + void setPath( TQString newPath){ path = newPath;} + TQString getPath(){return path;} - void setDeskopEntryPath( QString newPath){ desktopEntryPath = newPath;} - QString getDeskopEntryPath(){return desktopEntryPath;} + void setDeskopEntryPath( TQString newPath){ desktopEntryPath = newPath;} + TQString getDeskopEntryPath(){return desktopEntryPath;} - QString getSubText(){return subText;} + TQString getSubText(){return subText;} bool xOnDecoration( int x ) - { QListView *lv = listView(); + { TQListView *lv = listView(); if( !lv ) return false; return !( x > lv->header()->sectionPos( lv->header()->mapToIndex( 0 ) ) + lv->treeStepSize() * ( depth() + ( lv->rootIsDecorated() ? 1 : 0) ) + lv->itemMargin() || x < lv->header()->sectionPos( lv->header()->mapToIndex( 0 ) ) );} - void setSubText(QString text) //FIXME: add the column + void setSubText(TQString text) //FIXME: add the column {if(cellText.isEmpty())cellText=KListViewItem::text(0); - KListViewItem::setText(0,cellText+text);subText = QString(text);} - void setText(int column, const QString & text ) + KListViewItem::setText(0,cellText+text);subText = TQString(text);} + void setText(int column, const TQString & text ) {KListViewItem::setText(column, cellText+text); cellText = text;} void setDisplaySubText( bool display ){ displaySubText = display; } @@ -184,12 +184,12 @@ friend class TastyListView; void setHighLight( bool newHighLight ){highLight=newHighLight;} bool isHighLight(){return highLight;} - void setMenuId( QString newMenuId ){ menuId = newMenuId;} - QString getMenuId(){ return menuId; } + void setMenuId( TQString newMenuId ){ menuId = newMenuId;} + TQString getMenuId(){ return menuId; } - QString key( int column, bool ascending ) const; + TQString key( int column, bool ascending ) const; - int width( const QFontMetrics & fm, const QListView * lv, int c ) + int width( const TQFontMetrics & fm, const TQListView * lv, int c ) { TastyListView *tlv = dynamic_cast( listView() ); if( tlv ) return KListViewItem::width(fm, lv, c) + tlv->getActionIconSpace(); @@ -204,16 +204,16 @@ private: Type itemType; ActionType actionType; - QString path; - QString desktopEntryPath; - QString cellText; - QString subText; - QString menuId; + TQString path; + TQString desktopEntryPath; + TQString cellText; + TQString subText; + TQString menuId; bool ellipsis; bool highLight; bool displaySubText; - QPixmap actionPix; + TQPixmap actionPix; KIconLoader *iconLoader; void commonConstructor(); diff --git a/src/tastymenu.cpp b/src/tastymenu.cpp index 1ec371e..3dc3e7e 100644 --- a/src/tastymenu.cpp +++ b/src/tastymenu.cpp @@ -33,7 +33,7 @@ #include #include #include -#include +#include #include "tastymenu.h" @@ -42,7 +42,7 @@ -TastyMenu::TastyMenu(const QString& configFile, Type type, int actions, QWidget *parent, const char *name) +TastyMenu::TastyMenu(const TQString& configFile, Type type, int actions, TQWidget *parent, const char *name) : KPanelApplet(configFile, type, actions, parent, name), numNewApplications(0) { @@ -59,8 +59,8 @@ TastyMenu::TastyMenu(const QString& configFile, Type type, int actions, QWidget menuHandler = new MenuHandler(this, prefSkel, "MenuHandler", prefSkel->isNormalWindow() ? - Qt::WType_Dialog : - Qt::WType_Popup|Qt::WNoAutoErase); + TQt::WType_Dialog : + TQt::WType_Popup|TQt::WNoAutoErase); connect (button, SIGNAL (pressed()), this, SLOT (clickSlot ())); connect (menuHandler, SIGNAL(hidden()), this, SLOT(setButtonUp())); @@ -72,7 +72,7 @@ TastyMenu::TastyMenu(const QString& configFile, Type type, int actions, QWidget button -> setUsesTextLabel(prefSkel->menuButtonLabelType() != Prefs::EnumMenuButtonLabelType::MenuButtonNone); - button -> setTextPosition(QToolButton::BesideIcon); + button -> setTextPosition(TQToolButton::BesideIcon); menuTip = new TastyToolTip(button); _toolTipTitle = prefSkel->toolTipTitle(); @@ -120,7 +120,7 @@ void TastyMenu::loadMenuButtonIcon() if( prefSkel->menuButtonIconType() == Prefs::EnumMenuButtonIconType::IconNone ) { - button->setIconSet(QIconSet()); + button->setIconSet(TQIconSet()); return; } @@ -129,7 +129,7 @@ void TastyMenu::loadMenuButtonIcon() else if(position() == pLeft || position() == pRight) _iconsize = width(); - QPixmap btnPixmap(iconLoader->loadIcon(_menuButtonIcon, KIcon::Panel, _iconsize)); + TQPixmap btnPixmap(iconLoader->loadIcon(_menuButtonIcon, KIcon::Panel, _iconsize)); if( !btnPixmap.isNull() ) button->setIconSet(btnPixmap); else @@ -139,31 +139,31 @@ void TastyMenu::loadMenuButtonIcon() } } -QPoint TastyMenu::menupos(QWidget *widget) +TQPoint TastyMenu::menupos(TQWidget *widget) { //now should look decent on all positions switch( position() ) { case pLeft: { - return QPoint( this->mapToGlobal( this->geometry().topRight() )); + return TQPoint( this->mapToGlobal( this->geometry().topRight() )); break; } case pRight: { - QPoint buttonCoord = this->mapToGlobal(this->geometry().topLeft()); - return QPoint( buttonCoord.x()-widget->width(), buttonCoord.y() ); + TQPoint buttonCoord = this->mapToGlobal(this->geometry().topLeft()); + return TQPoint( buttonCoord.x()-widget->width(), buttonCoord.y() ); break; } case pTop: { - return QPoint( this->mapToGlobal( this->geometry().bottomLeft() )); + return TQPoint( this->mapToGlobal( this->geometry().bottomLeft() )); break; } default: //pBottom or floating { - QPoint buttonCoord = this->mapToGlobal(this->geometry().topLeft()); - return QPoint( buttonCoord.x(), buttonCoord.y()-widget->height() ); + TQPoint buttonCoord = this->mapToGlobal(this->geometry().topLeft()); + return TQPoint( buttonCoord.x(), buttonCoord.y()-widget->height() ); break; } } @@ -175,7 +175,7 @@ void TastyMenu::clickSlot() menuHandler->popup(menupos(menuHandler)); - //QTimer::singleShot( 10000, this, SLOT(setButtonUp()) ); + //TQTimer::singleShot( 10000, this, SLOT(setButtonUp()) ); } void TastyMenu::about() @@ -287,10 +287,10 @@ void TastyMenu::setGlobalAccel( bool global ) kickerConf = KGlobal::config(); kickerConf->setGroup("Global Shortcuts"); - QString kmenuShortcut = kickerConf->readEntry("Popup Launch Menu", "default(Alt+F1)"); + TQString kmenuShortcut = kickerConf->readEntry("Popup Launch Menu", "default(Alt+F1)"); if( kmenuShortcut=="none" ) return; - QString tastyMenuShortcut = kickerConf->readEntry("Toggle Tasty Menu", ""); + TQString tastyMenuShortcut = kickerConf->readEntry("Toggle Tasty Menu", ""); KShortcut shortCutKey(tastyMenuShortcut); kickerConf->writeEntry("Popup Launch Menu", "none"); kickerConf->writeEntry("Toggle Tasty Menu", kmenuShortcut); @@ -347,7 +347,7 @@ void TastyMenu::setNewApplicationsMessage( int number ) /*else if( number == 1) menuTip ->setMessage(i18n("There is one new installed application")); else - menuTip ->setMessage(i18n("There are")+" " + QString().setNum(number) +" "+ i18n("new installed applications"));*/ + menuTip ->setMessage(i18n("There are")+" " + TQString().setNum(number) +" "+ i18n("new installed applications"));*/ if( _showBigToolTip && number > numNewApplications ) menuTip->notify( menupos( menuTip ) ); @@ -361,7 +361,7 @@ int TastyMenu::widthForHeight(int height) const int buttonWidth = width(); if( position() == pTop || position() == pBottom ) { - button -> setTextPosition(QToolButton::BesideIcon); + button -> setTextPosition(TQToolButton::BesideIcon); if( prefSkel->menuButtonLabelType() != Prefs::EnumMenuButtonLabelType::MenuButtonNone ) return ((button->fontMetrics()).width(button->textLabel())) + _iconsize + 10; @@ -380,7 +380,7 @@ int TastyMenu::heightForWidth(int width) const if( prefSkel->menuButtonLabelType() != Prefs::EnumMenuButtonLabelType::MenuButtonNone ) { - button -> setTextPosition(QToolButton::BelowIcon); + button -> setTextPosition(TQToolButton::BelowIcon); return ((button->fontMetrics()).height()) + _iconsize + 10; } else @@ -390,7 +390,7 @@ int TastyMenu::heightForWidth(int width) const return buttonHeight; } -void TastyMenu::resizeEvent(QResizeEvent *e) +void TastyMenu::resizeEvent(TQResizeEvent *e) { int newHeight = e->size().height(); button->setFixedHeight(newHeight); @@ -405,7 +405,7 @@ void TastyMenu::resizeEvent(QResizeEvent *e) loadMenuButtonIcon(); } -void TastyMenu::mousePressEvent(QMouseEvent *e) +void TastyMenu::mousePressEvent(TQMouseEvent *e) { menuTip->hideTip(); @@ -463,7 +463,7 @@ void TastyMenu::mousePressEvent(QMouseEvent *e) } } -void TastyMenu::enterEvent( QEvent * e ) +void TastyMenu::enterEvent( TQEvent * e ) { e=e; if( _showBigToolTip && !menuHandler->isVisible() ) @@ -472,7 +472,7 @@ void TastyMenu::enterEvent( QEvent * e ) KPanelApplet::enterEvent(e); } -void TastyMenu::leaveEvent( QEvent * e ) +void TastyMenu::leaveEvent( TQEvent * e ) { e=e; menuTip->hideTip(); @@ -482,7 +482,7 @@ void TastyMenu::leaveEvent( QEvent * e ) extern "C" { - KPanelApplet* init( QWidget *parent, const QString& configFile) + KPanelApplet* init( TQWidget *parent, const TQString& configFile) { KGlobal::locale()->insertCatalogue("tastymenu"); return new TastyMenu(configFile, KPanelApplet::Normal, diff --git a/src/tastymenu.h b/src/tastymenu.h index 66900fe..b1fa491 100644 --- a/src/tastymenu.h +++ b/src/tastymenu.h @@ -29,12 +29,12 @@ #include #include -#include +#include #include -#include +#include #include #include -#include +#include #include "menuhandler.h" #include "prefs.h" @@ -53,10 +53,10 @@ public: * @param Type The applet @ref type(). * @param actions Standard RMB menu actions supported by the applet (see @ref action() ). * @param parent The pointer to the parent widget handed over in the factory function. - * @param name A Qt object name for your applet. + * @param name A TQt object name for your applet. **/ - TastyMenu(const QString& configFile, Type t = Normal, int actions = 0, - QWidget *parent = 0, const char *name = 0); + TastyMenu(const TQString& configFile, Type t = Normal, int actions = 0, + TQWidget *parent = 0, const char *name = 0); /** destructor */ ~TastyMenu(); @@ -126,10 +126,10 @@ public: virtual void preferences(); protected: - virtual void resizeEvent(QResizeEvent *); - virtual void mousePressEvent(QMouseEvent *e); - virtual void enterEvent( QEvent * e ); - virtual void leaveEvent( QEvent * e ); + virtual void resizeEvent(TQResizeEvent *); + virtual void mousePressEvent(TQMouseEvent *e); + virtual void enterEvent( TQEvent * e ); + virtual void leaveEvent( TQEvent * e ); private: KSharedConfig *kConfig; @@ -138,15 +138,15 @@ private: MenuHandler *menuHandler; TastyButton *button; TastyToolTip *menuTip; - QPoint menupos(QWidget *widget); + TQPoint menupos(TQWidget *widget); KGlobalAccel *globalAccel; KIconLoader *iconLoader; int numNewApplications; - QString _menuButtonLabel; - QString _menuButtonIcon; - QString _toolTipTitle; + TQString _menuButtonLabel; + TQString _menuButtonIcon; + TQString _toolTipTitle; bool _newAppsNotification; int _iconsize; bool _showBigToolTip; diff --git a/src/tastytooltip.cpp b/src/tastytooltip.cpp index 27f6a12..1d324cc 100644 --- a/src/tastytooltip.cpp +++ b/src/tastytooltip.cpp @@ -19,28 +19,28 @@ ***************************************************************************/ #include "tastytooltip.h" -#include -#include +#include +#include #include #include -#include +#include -TastyToolTip::TastyToolTip( QWidget * parent,const char * name, WFlags fl) - : QWidget(parent, name, fl|WX11BypassWM ) +TastyToolTip::TastyToolTip( TQWidget * parent,const char * name, WFlags fl) + : TQWidget(parent, name, fl|WX11BypassWM ) { iconName = "kmenu"; - tastyToolTipLayout = new QVBoxLayout( this, 0, 0, "tastyToolTipLayout"); + tastyToolTipLayout = new TQVBoxLayout( this, 0, 0, "tastyToolTipLayout"); toolTipWidget = new TastyToolTipWidget(this); tastyToolTipLayout->addWidget(toolTipWidget); } -void TastyToolTip::loadIcon( QString icon ) +void TastyToolTip::loadIcon( TQString icon ) { iconName = icon; KIconLoader *iconLoader = KGlobal::iconLoader(); - QPixmap btnPixmap(iconLoader->loadIcon(icon, KIcon::Panel, KIcon::SizeHuge)); + TQPixmap btnPixmap(iconLoader->loadIcon(icon, KIcon::Panel, KIcon::SizeHuge)); if( !btnPixmap.isNull() ) toolTipWidget->iconPixmap->setPixmap(btnPixmap); @@ -56,32 +56,32 @@ TastyToolTip::~TastyToolTip() } -void TastyToolTip::showTip(const QPoint & point) +void TastyToolTip::showTip(const TQPoint & point) { move(point); - QTimer::singleShot(250, this, SLOT(show())); + TQTimer::singleShot(250, this, SLOT(show())); } void TastyToolTip::show() { - QButton *button = dynamic_cast(parent()); + TQButton *button = dynamic_cast(parent()); if(button && button->hasMouse() && !button->isDown()) - QWidget::show(); + TQWidget::show(); } void TastyToolTip::hideTip( ) { - QTimer::singleShot(250, this, SLOT(hide())); + TQTimer::singleShot(250, this, SLOT(hide())); } -void TastyToolTip::notify(const QPoint & point ) +void TastyToolTip::notify(const TQPoint & point ) { move(point); show(); - QTimer::singleShot(5000, this, SLOT(hide())); + TQTimer::singleShot(5000, this, SLOT(hide())); } -void TastyToolTip::setMessage( QString message ) +void TastyToolTip::setMessage( TQString message ) { KIconLoader *iconLoader = KGlobal::iconLoader(); toolTipWidget->MessageLabel->setText(message); @@ -92,7 +92,7 @@ void TastyToolTip::setMessage( QString message ) loadIcon(iconName); } -void TastyToolTip::setTitle( QString title ) +void TastyToolTip::setTitle( TQString title ) { if( !title.isEmpty() ) toolTipWidget->appNameLabel->setText( title ); diff --git a/src/tastytooltip.h b/src/tastytooltip.h index aea0838..3b78a03 100644 --- a/src/tastytooltip.h +++ b/src/tastytooltip.h @@ -20,36 +20,36 @@ #ifndef TASTYTOOLTIP_H #define TASTYTOOLTIP_H -#include -#include +#include +#include #include "tastytooltipwidget.h" /** @author Marco Martin */ -class TastyToolTip : public QWidget +class TastyToolTip : public TQWidget { public: - TastyToolTip( QWidget * parent=0,const char * name=0, WFlags fl=WType_TopLevel); + TastyToolTip( TQWidget * parent=0,const char * name=0, WFlags fl=WType_TopLevel); ~TastyToolTip(); - void showTip(const QPoint & point); + void showTip(const TQPoint & point); void hideTip( ); - void loadIcon( QString iconName ); - void notify(const QPoint & point ); - void setMessage( QString message ); - void setTitle( QString title ); + void loadIcon( TQString iconName ); + void notify(const TQPoint & point ); + void setMessage( TQString message ); + void setTitle( TQString title ); protected: - virtual void mousePressEvent( QMouseEvent * e ){e=e;hide();} + virtual void mousePressEvent( TQMouseEvent * e ){e=e;hide();} private: - QString iconName; + TQString iconName; TastyToolTipWidget * toolTipWidget; - QVBoxLayout *tastyToolTipLayout; + TQVBoxLayout *tastyToolTipLayout; public slots: virtual void show(); diff --git a/src/tastytooltipwidget.ui b/src/tastytooltipwidget.ui index faacb2e..ad1913f 100644 --- a/src/tastytooltipwidget.ui +++ b/src/tastytooltipwidget.ui @@ -1,6 +1,6 @@ TastyToolTipWidget - + TastyToolTipWidget @@ -25,7 +25,7 @@ 0 - + frame5 @@ -39,7 +39,7 @@ unnamed - + iconPixmap @@ -61,7 +61,7 @@ true - + layout2 @@ -69,7 +69,7 @@ unnamed - + appNameLabel @@ -83,7 +83,7 @@ <b>Tasty Menu</b> - + DescLabel @@ -91,7 +91,7 @@ Applications, tasks and desktop sessions - + MessageLabel