diff options
Diffstat (limited to 'katapult/katapult/katapult.cpp')
-rw-r--r-- | katapult/katapult/katapult.cpp | 106 |
1 files changed, 53 insertions, 53 deletions
diff --git a/katapult/katapult/katapult.cpp b/katapult/katapult/katapult.cpp index b0d2756..c053d3d 100644 --- a/katapult/katapult/katapult.cpp +++ b/katapult/katapult/katapult.cpp @@ -31,9 +31,9 @@ #include <kaboutapplication.h> #include <dcopclient.h> -#include <qpopupmenu.h> -#include <qmenudata.h> -#include <qcursor.h> +#include <tqpopupmenu.h> +#include <tqmenudata.h> +#include <tqcursor.h> #include "katapult.h" #include "actionregistry.h" @@ -61,14 +61,14 @@ Katapult::Katapult() settings = new KatapultSettings(); - hideTimer = new QTimer(this); - connect(hideTimer, SIGNAL(timeout()), this, SLOT(hideLauncher())); - clearTimer = new QTimer(this); - connect(clearTimer, SIGNAL(timeout()), this, SLOT(clearQuery())); + hideTimer = new TQTimer(this); + connect(hideTimer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(hideLauncher())); + clearTimer = new TQTimer(this); + connect(clearTimer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(clearQuery())); - connect(settings, SIGNAL(catalogsChanged()), this, SLOT(loadCatalogPlugins())); - connect(settings, SIGNAL(displayChanged()), this, SLOT(initDisplay())); - connect(settings, SIGNAL(systrayChanged()), this, SLOT(updateSystray())); + connect(settings, TQT_SIGNAL(catalogsChanged()), TQT_TQOBJECT(this), TQT_SLOT(loadCatalogPlugins())); + connect(settings, TQT_SIGNAL(displayChanged()), TQT_TQOBJECT(this), TQT_SLOT(initDisplay())); + connect(settings, TQT_SIGNAL(systrayChanged()), TQT_TQOBJECT(this), TQT_SLOT(updateSystray())); loadCatalogPlugins(); initDisplay(); @@ -80,8 +80,8 @@ Katapult::Katapult() //show popup (unless we're session restored) if (!settings->hideNotification()) { - QString msg = i18n("Application successfully started !\nPress %1 to use it...") - .arg(globalAccel->shortcut("show_katapult").toString()); + TQString msg = i18n("Application successfully started !\nPress %1 to use it...") + .tqarg(globalAccel->shortcut("show_katapult").toString()); KPassivePopup::message(i18n("Katapult Notification"), msg, kapp->miniIcon(), this, 0, settings->notificationTimeout()); } } @@ -108,42 +108,42 @@ void Katapult::initDisplay() } else { initAccel(display); setQuery(""); - connect(display, SIGNAL(keyReleased(QKeyEvent *)), this, SLOT(keyReleased(QKeyEvent *))); - connect(display, SIGNAL(focusOut()), this, SLOT(hideLauncher())); + connect(display, TQT_SIGNAL(keyReleased(TQKeyEvent *)), TQT_TQOBJECT(this), TQT_SLOT(keyReleased(TQKeyEvent *))); + connect(display, TQT_SIGNAL(focusOut()), TQT_TQOBJECT(this), TQT_SLOT(hideLauncher())); } } -void Katapult::initAccel(QWidget *parent) +void Katapult::initAccel(TQWidget *tqparent) { - globalAccel = new KGlobalAccel(parent); + globalAccel = new KGlobalAccel(TQT_TQOBJECT(tqparent)); globalAccel->insert("show_katapult", i18n("Show Launcher"), i18n("Shows the Katapult launcher"), ALT+Key_Space, ALT+Key_Space, - this, SLOT(showLauncher())); + TQT_TQOBJECT(this), TQT_SLOT(showLauncher())); globalAccel->readSettings(); globalAccel->updateConnections(); - actions = new KActionCollection(parent); + actions = new KActionCollection(tqparent); actionCollection()->clear(); contextMenu()->clear(); - new KAction(i18n("Execute"), "exec", Key_Return, this, SLOT(execute()), actions, "execute"); - new KAction(i18n("Clear"), "editclear", Key_Left, this, SLOT(clearQuery()), actions, "clear"); - new KAction(i18n("Close"), "fileclose", Key_Escape, this, SLOT(hideLauncher()), actions, "close"); - new KAction(i18n("Complete Query"), "next", Key_Right, this, SLOT(completeQuery()), actions, "complete_query"); - new KAction(i18n("Show Context Menu"), "menu", CTRL+Key_C, this, SLOT(showContextMenu()), actions, "show_menu"); + new KAction(i18n("Execute"), "exec", Key_Return, TQT_TQOBJECT(this), TQT_SLOT(execute()), actions, "execute"); + new KAction(i18n("Clear"), "editclear", Key_Left, TQT_TQOBJECT(this), TQT_SLOT(clearQuery()), actions, "clear"); + new KAction(i18n("Close"), "fileclose", Key_Escape, TQT_TQOBJECT(this), TQT_SLOT(hideLauncher()), actions, "close"); + new KAction(i18n("Complete Query"), "next", Key_Right, TQT_TQOBJECT(this), TQT_SLOT(completeQuery()), actions, "complete_query"); + new KAction(i18n("Show Context Menu"), "menu", CTRL+Key_C, TQT_TQOBJECT(this), TQT_SLOT(showContextMenu()), actions, "show_menu"); - KAction *actGlobAccel = KStdAction::keyBindings(this, SLOT(showGlobalShortcutsDialog()), actions); + KAction *actGlobAccel = KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(showGlobalShortcutsDialog()), actions); actGlobAccel->setText(i18n("Configure &Global Shortcuts...")); - actGlobAccel->plug((QWidget *) contextMenu()); + actGlobAccel->plug((TQWidget *) contextMenu()); - KStdAction::keyBindings(this, SLOT(showShortcutsDialog()), actions)->plug((QWidget *) contextMenu()); - KStdAction::preferences(settings, SLOT(configure()), actions)->plug((QWidget *) contextMenu()); + KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(showShortcutsDialog()), actions)->plug((TQWidget *) contextMenu()); + KStdAction::preferences(settings, TQT_SLOT(configure()), actions)->plug((TQWidget *) contextMenu()); contextMenu()->insertSeparator(); - KStdAction::aboutApp(this, SLOT(showAboutDialog()), actions)->plug((QWidget *) contextMenu()); + KStdAction::aboutApp(TQT_TQOBJECT(this), TQT_SLOT(showAboutDialog()), actions)->plug((TQWidget *) contextMenu()); contextMenu()->insertSeparator(); - KStdAction::quit(this, SLOT(close()), actions)->plug((QWidget *) contextMenu()); + KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), actions)->plug((TQWidget *) contextMenu()); actions->readShortcutSettings(); } @@ -151,7 +151,7 @@ void Katapult::initAccel(QWidget *parent) void Katapult::completeQuery() { if(!bestMatch.isNull()) { - QString newQuery = bestMatch.item()->text(); + TQString newQuery = bestMatch.item()->text(); setQuery(""); setQuery(newQuery); } @@ -162,9 +162,9 @@ void Katapult::clearQuery() setQuery(""); } -void Katapult::setQuery(QString _query) +void Katapult::setQuery(TQString _query) { - allStatus=0; + alltqStatus=0; bestMatch = Match(); this->_query = _query; @@ -172,7 +172,7 @@ void Katapult::setQuery(QString _query) display->setQuery(_query); if(_query == "") { - QDictIterator<KatapultCatalog> it(catalogs); + TQDictIterator<KatapultCatalog> it(catalogs); KatapultCatalog *catalog; while((catalog = it.current()) != 0) { @@ -181,14 +181,14 @@ void Katapult::setQuery(QString _query) } display->setItem(0); display->setAction(0); - display->setStatus(0); + display->settqStatus(0); display->setSelected(0); action = 0; } else if(catalogs.count() == 0) { - allStatus = S_Active | S_NoResults; - display->setStatus(allStatus); + alltqStatus = S_Active | S_NoResults; + display->settqStatus(alltqStatus); } else { - QDictIterator<KatapultCatalog> it(catalogs); + TQDictIterator<KatapultCatalog> it(catalogs); KatapultCatalog *catalog; int status; @@ -200,8 +200,8 @@ void Katapult::setQuery(QString _query) status = catalog->status(); if(status & S_HasResults) { - if(allStatus & S_HasResults) - allStatus |= S_Multiple; + if(alltqStatus & S_HasResults) + alltqStatus |= S_Multiple; Match match = catalog->bestMatch(); if(!match.isNull()) { @@ -209,17 +209,17 @@ void Katapult::setQuery(QString _query) bestMatch = match; } } - allStatus |= status; + alltqStatus |= status; } if(bestMatch.isNull() || bestMatch.rank() == 0) bestMatch = Match(); if(!bestMatch.isNull()) { - QPtrList<KatapultAction> itemActions = ActionRegistry::self()->actionsForItem(bestMatch.item()); + TQPtrList<KatapultAction> itemActions = ActionRegistry::self()->actionsForItem(bestMatch.item()); action = itemActions.at(0); - connect(bestMatch.item(), SIGNAL(itemChanged()), this, SLOT(updateDisplay())); + connect(bestMatch.item(), TQT_SIGNAL(itemChanged()), TQT_TQOBJECT(this), TQT_SLOT(updateDisplay())); } } - if(!(allStatus & S_HasResults) && allStatus & S_Active) { + if(!(alltqStatus & S_HasResults) && alltqStatus & S_Active) { // no results switch(settings->noResultsAction()) { case KatapultSettings::NR_HideDisplay: @@ -240,7 +240,7 @@ void Katapult::setQuery(QString _query) clearTimer->stop(); } - if(!executing && settings->isAutoExecute() && allStatus & S_HasResults && !(allStatus & S_Multiple)) { + if(!executing && settings->isAutoExecute() && alltqStatus & S_HasResults && !(alltqStatus & S_Multiple)) { execute(); } @@ -266,7 +266,7 @@ void Katapult::updateDisplay() display->setAction(action); display->setSelected(bestMatch.matched()); } - display->setStatus(allStatus); + display->settqStatus(alltqStatus); display->update(); } } @@ -276,7 +276,7 @@ void Katapult::showLauncher() if(!settings->isConfiguring() && display != 0) { setQuery(""); - display->setStatus(0); + display->settqStatus(0); display->setQuery(""); display->show(); display->update(); @@ -306,7 +306,7 @@ void Katapult::execute() executing = TRUE; if(action == 0) { - display->setStatus(S_Active | S_NoResults); + display->settqStatus(S_Active | S_NoResults); display->update(); hideTimer->start(settings->hideDelay(), TRUE); } else { @@ -328,30 +328,30 @@ void Katapult::updateSystray() void Katapult::showContextMenu() { - contextMenu()->popup(QCursor::pos()); + contextMenu()->popup(TQCursor::pos()); } -void Katapult::keyReleased(QKeyEvent *e) +void Katapult::keyReleased(TQKeyEvent *e) { if(e->key() == Key_BackSpace) { if(hideTimer->isActive()) hideTimer->stop(); if(clearTimer->isActive()) clearTimer->stop(); - QString newQuery = _query.left(_query.length()-1); + TQString newQuery = _query.left(_query.length()-1); setQuery(""); setQuery(newQuery); } else { - QString t = e->text(); + TQString t = e->text(); if ( !t.isEmpty() && (!e->ascii() || e->ascii()>=32) && e->key() != Key_Delete) setQuery(_query + t); } } -void Katapult::mousePressEvent(QMouseEvent *e) +void Katapult::mousePressEvent(TQMouseEvent *e) { - if(e->button() == LeftButton) + if(e->button() == Qt::LeftButton) showLauncher(); else KSystemTray::mousePressEvent(e); |