diff options
Diffstat (limited to 'lib/kross/main/wdgscriptsmanager.cpp')
-rw-r--r-- | lib/kross/main/wdgscriptsmanager.cpp | 110 |
1 files changed, 55 insertions, 55 deletions
diff --git a/lib/kross/main/wdgscriptsmanager.cpp b/lib/kross/main/wdgscriptsmanager.cpp index 10924519..7b9a927d 100644 --- a/lib/kross/main/wdgscriptsmanager.cpp +++ b/lib/kross/main/wdgscriptsmanager.cpp @@ -18,11 +18,11 @@ */ #include "wdgscriptsmanager.h" -#include <qfile.h> -#include <qfileinfo.h> -#include <qheader.h> -#include <qobjectlist.h> -#include <qtooltip.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqheader.h> +#include <tqobjectlist.h> +#include <tqtooltip.h> #include <kapplication.h> #include <kdeversion.h> @@ -57,8 +57,8 @@ namespace Kross { namespace Api { class ScriptNewStuff : public KNewStuffSecure { public: - ScriptNewStuff(ScriptGUIClient* scripguiclient, const QString& type, QWidget *parentWidget = 0) - : KNewStuffSecure(type, parentWidget) + ScriptNewStuff(ScriptGUIClient* scripguiclient, const TQString& type, TQWidget *tqparentWidget = 0) + : KNewStuffSecure(type, tqparentWidget) , m_scripguiclient(scripguiclient) {} virtual ~ScriptNewStuff() {} private: @@ -67,35 +67,35 @@ class ScriptNewStuff : public KNewStuffSecure }; #endif -class ListItem : public QListViewItem +class ListItem : public TQListViewItem { private: ScriptActionCollection* m_collection; ScriptAction::Ptr m_action; public: - ListItem(QListView* parentview, ScriptActionCollection* collection) - : QListViewItem(parentview), m_collection(collection), m_action(0) {} + ListItem(TQListView* tqparentview, ScriptActionCollection* collection) + : TQListViewItem(tqparentview), m_collection(collection), m_action(0) {} - ListItem(ListItem* parentitem, QListViewItem* afteritem, ScriptAction::Ptr action) - : QListViewItem(parentitem, afteritem), m_collection( parentitem->collection() ), m_action(action) {} + ListItem(ListItem* tqparentitem, TQListViewItem* afteritem, ScriptAction::Ptr action) + : TQListViewItem(tqparentitem, afteritem), m_collection( tqparentitem->collection() ), m_action(action) {} ScriptAction::Ptr action() const { return m_action; } ScriptActionCollection* collection() const { return m_collection; } //ScriptActionMenu* actionMenu() const { return m_menu; } }; -class ToolTip : public QToolTip +class ToolTip : public TQToolTip { public: - ToolTip(KListView* parent) : QToolTip(parent->viewport()), m_parent(parent) {} + ToolTip(KListView* tqparent) : TQToolTip(tqparent->viewport()), m_parent(tqparent) {} virtual ~ToolTip () { remove(m_parent->viewport()); } protected: - virtual void maybeTip(const QPoint& p) { + virtual void maybeTip(const TQPoint& p) { ListItem* item = dynamic_cast<ListItem*>( m_parent->itemAt(p) ); if(item) { - QRect r( m_parent->itemRect(item) ); + TQRect r( m_parent->tqitemRect(item) ); if(r.isValid() && item->action()) { - tip(r, QString("<qt>%1</qt>").arg(item->action()->toolTip())); + tip(r, TQString("<qt>%1</qt>").tqarg(item->action()->toolTip())); } } } @@ -114,8 +114,8 @@ class WdgScriptsManagerPrivate //enum { LoadBtn = 0, UnloadBtn, InstallBtn, UninstallBtn, ExecBtn, NewStuffBtn }; }; -WdgScriptsManager::WdgScriptsManager(ScriptGUIClient* scr, QWidget* parent, const char* name, WFlags fl ) - : WdgScriptsManagerBase(parent, name, fl) +WdgScriptsManager::WdgScriptsManager(ScriptGUIClient* scr, TQWidget* tqparent, const char* name, WFlags fl ) + : WdgScriptsManagerBase(tqparent, name, fl) , d(new WdgScriptsManagerPrivate) { d->m_scripguiclient = scr; @@ -130,50 +130,50 @@ WdgScriptsManager::WdgScriptsManager(ScriptGUIClient* scr, QWidget* parent, cons //scriptsList->setRootIsDecorated(true); scriptsList->setSorting(-1); scriptsList->addColumn("text"); - //scriptsList->setColumnWidthMode(1, QListView::Manual); + //scriptsList->setColumnWidthMode(1, TQListView::Manual); slotFillScriptsList(); slotSelectionChanged(0); - connect(scriptsList, SIGNAL(selectionChanged(QListViewItem*)), this, SLOT(slotSelectionChanged(QListViewItem*))); + connect(scriptsList, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, TQT_SLOT(slotSelectionChanged(TQListViewItem*))); btnExec->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "exec", KIcon::MainToolbar, 16 )); - connect(btnExec, SIGNAL(clicked()), this, SLOT(slotExecuteScript())); + connect(btnExec, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExecuteScript())); btnLoad->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "fileopen", KIcon::MainToolbar, 16 )); - connect(btnLoad, SIGNAL(clicked()), this, SLOT(slotLoadScript())); + connect(btnLoad, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotLoadScript())); btnUnload->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "fileclose", KIcon::MainToolbar, 16 )); - connect(btnUnload, SIGNAL(clicked()), this, SLOT(slotUnloadScript())); + connect(btnUnload, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUnloadScript())); btnInstall->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "fileimport", KIcon::MainToolbar, 16 )); - connect(btnInstall, SIGNAL(clicked()), this, SLOT(slotInstallScript())); + connect(btnInstall, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotInstallScript())); btnUninstall->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "fileclose", KIcon::MainToolbar, 16 )); - connect(btnUninstall, SIGNAL(clicked()), this, SLOT(slotUninstallScript())); + connect(btnUninstall, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUninstallScript())); #ifdef KROSS_SUPPORT_NEWSTUFF btnNewStuff->setIconSet(KGlobal::instance()->iconLoader()->loadIconSet( "knewstuff", KIcon::MainToolbar, 16 )); - connect(btnNewStuff, SIGNAL(clicked()), this, SLOT(slotGetNewScript())); + connect(btnNewStuff, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotGetNewScript())); #endif /* toolBar->setIconText( KToolBar::IconTextRight ); toolBar->insertButton("exec", WdgScriptsManagerPrivate::ExecBtn, false, i18n("Execute")); - toolBar->addConnection(WdgScriptsManagerPrivate::ExecBtn, SIGNAL(clicked()), this, SLOT(slotExecuteScript())); + toolBar->addConnection(WdgScriptsManagerPrivate::ExecBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotExecuteScript())); toolBar->insertLineSeparator(); toolBar->insertButton("fileopen", WdgScriptsManagerPrivate::LoadBtn, true, i18n("Load")); - toolBar->addConnection(WdgScriptsManagerPrivate::LoadBtn, SIGNAL(clicked()), this, SLOT(slotLoadScript())); + toolBar->addConnection(WdgScriptsManagerPrivate::LoadBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotLoadScript())); toolBar->insertButton("fileclose", WdgScriptsManagerPrivate::UnloadBtn, false, i18n("Unload")); - toolBar->addConnection(WdgScriptsManagerPrivate::UnloadBtn, SIGNAL(clicked()), this, SLOT(slotUnloadScript())); + toolBar->addConnection(WdgScriptsManagerPrivate::UnloadBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUnloadScript())); toolBar->insertLineSeparator(); toolBar->insertButton("fileimport", WdgScriptsManagerPrivate::InstallBtn, true, i18n("Install")); - toolBar->addConnection(WdgScriptsManagerPrivate::InstallBtn, SIGNAL(clicked()), this, SLOT(slotInstallScript())); + toolBar->addConnection(WdgScriptsManagerPrivate::InstallBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotInstallScript())); toolBar->insertButton("fileclose", WdgScriptsManagerPrivate::UninstallBtn, false, i18n("Uninstall")); - toolBar->addConnection(WdgScriptsManagerPrivate::UninstallBtn, SIGNAL(clicked()), this, SLOT(slotUninstallScript())); + toolBar->addConnection(WdgScriptsManagerPrivate::UninstallBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUninstallScript())); #ifdef KROSS_SUPPORT_NEWSTUFF toolBar->insertLineSeparator(); toolBar->insertButton("knewstuff", WdgScriptsManagerPrivate::NewStuffBtn, true, i18n("Get More Scripts")); - toolBar->addConnection(WdgScriptsManagerPrivate::NewStuffBtn, SIGNAL(clicked()), this, SLOT(slotGetNewScript())); + toolBar->addConnection(WdgScriptsManagerPrivate::NewStuffBtn, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotGetNewScript())); #endif */ - connect(scr, SIGNAL( collectionChanged(ScriptActionCollection*) ), - this, SLOT( slotFillScriptsList() )); + connect(scr, TQT_SIGNAL( collectionChanged(ScriptActionCollection*) ), + this, TQT_SLOT( slotFillScriptsList() )); } WdgScriptsManager::~WdgScriptsManager() @@ -200,29 +200,29 @@ void WdgScriptsManager::addItem(ScriptActionCollection* collection) i->setText(0, collection->actionMenu()->text()); i->setOpen(true); - QValueList<ScriptAction::Ptr> list = collection->actions(); - QListViewItem* lastitem = 0; - for(QValueList<ScriptAction::Ptr>::Iterator it = list.begin(); it != list.end(); ++it) + TQValueList<ScriptAction::Ptr> list = collection->actions(); + TQListViewItem* lastitem = 0; + for(TQValueList<ScriptAction::Ptr>::Iterator it = list.begin(); it != list.end(); ++it) lastitem = addItem(*it, i, lastitem); } -QListViewItem* WdgScriptsManager::addItem(ScriptAction::Ptr action, QListViewItem* parentitem, QListViewItem* afteritem) +TQListViewItem* WdgScriptsManager::addItem(ScriptAction::Ptr action, TQListViewItem* tqparentitem, TQListViewItem* afteritem) { if(! action) return 0; - ListItem* i = new ListItem(dynamic_cast<ListItem*>(parentitem), afteritem, action); + ListItem* i = new ListItem(dynamic_cast<ListItem*>(tqparentitem), afteritem, action); i->setText(0, action->text()); // FIXME: i18nise it for ko2.0 //i->setText(1, action->getDescription()); // FIXME: i18nise it for ko2.0 //i->setText(2, action->name()); - QPixmap pm; + TQPixmap pm; if(action->hasIcon()) { KIconLoader* icons = KGlobal::iconLoader(); - pm = icons->loadIconSet(action->icon(), KIcon::Small).pixmap(QIconSet::Small, QIconSet::Active); + pm = icons->loadIconSet(action->icon(), KIcon::Small).pixmap(TQIconSet::Small, TQIconSet::Active); } else { - pm = action->iconSet(KIcon::Small, 16).pixmap(QIconSet::Small, QIconSet::Active); + pm = action->iconSet(KIcon::Small, 16).pixmap(TQIconSet::Small, TQIconSet::Active); } if(! pm.isNull()) i->setPixmap(0, pm); // display the icon @@ -230,7 +230,7 @@ QListViewItem* WdgScriptsManager::addItem(ScriptAction::Ptr action, QListViewIte return i; } -void WdgScriptsManager::slotSelectionChanged(QListViewItem* item) +void WdgScriptsManager::slotSelectionChanged(TQListViewItem* item) { ListItem* i = dynamic_cast<ListItem*>(item); Kross::Api::ScriptActionCollection* installedcollection = d->m_scripguiclient->getActionCollection("installedscripts"); @@ -252,9 +252,9 @@ void WdgScriptsManager::slotLoadScript() void WdgScriptsManager::slotInstallScript() { KFileDialog* filedialog = new KFileDialog( - QString::null, // startdir + TQString(), // startdir "*.tar.gz *.tgz *.bz2", // filter - this, // parent widget + this, // tqparent widget "WdgScriptsManagerInstallFileDialog", // name true // modal ); @@ -281,13 +281,13 @@ void WdgScriptsManager::slotUninstallScript() if( !item->collection() || item->collection() != installedcollection) return; - const QString packagepath = item->action()->getPackagePath(); + const TQString packagepath = item->action()->getPackagePath(); if( !packagepath) return; if( KMessageBox::warningContinueCancel(0, i18n("Uninstall the script package \"%1\" and delete the package's folder \"%2\"?") - .arg(item->action()->text()).arg(packagepath), + .tqarg(item->action()->text()).tqarg(packagepath), i18n("Uninstall")) != KMessageBox::Continue ) { return; @@ -320,12 +320,12 @@ void WdgScriptsManager::slotUnloadScript() void WdgScriptsManager::slotGetNewScript() { #ifdef KROSS_SUPPORT_NEWSTUFF - const QString appname = KApplication::kApplication()->name(); - const QString type = QString("%1/script").arg(appname); + const TQString appname = KApplication::kApplication()->name(); + const TQString type = TQString("%1/script").tqarg(appname); if(! d->newstuff) { d->newstuff = new ScriptNewStuff(d->m_scripguiclient, type); - connect(d->newstuff, SIGNAL(installFinished()), this, SLOT(slotResourceInstalled())); + connect(d->newstuff, TQT_SIGNAL(installFinished()), this, TQT_SLOT(slotResourceInstalled())); } KNS::Engine *engine = new KNS::Engine(d->newstuff, type, this); @@ -333,10 +333,10 @@ void WdgScriptsManager::slotGetNewScript() d->setType(type); KNS::ProviderLoader *p = new KNS::ProviderLoader(this); - QObject::connect(p, SIGNAL(providersLoaded(Provider::List*)), - d, SLOT(slotProviders(Provider::List*))); + TQObject::connect(p, TQT_SIGNAL(providersLoaded(Provider::List*)), + d, TQT_SLOT(slotProviders(Provider::List*))); - p->load(type, QString("http://download.kde.org/khotnewstuff/%1scripts-providers.xml").arg(appname)); + p->load(type, TQString("http://download.kde.org/khotnewstuff/%1scripts-providers.xml").tqarg(appname)); d->exec(); #endif } @@ -346,7 +346,7 @@ void WdgScriptsManager::slotResourceInstalled() // Delete KNewStuff's configuration entries. These entries reflect what has // already been installed. As we cannot yet keep them in sync after uninstalling // scripts, we deactivate the check marks entirely. - KGlobal::config()->deleteGroup("KNewStuffStatus"); + KGlobal::config()->deleteGroup("KNewStufftqStatus"); } }} |