summaryrefslogtreecommitdiffstats
path: root/lib/kross/main
diff options
context:
space:
mode:
Diffstat (limited to 'lib/kross/main')
-rw-r--r--lib/kross/main/krossconfig.cpp4
-rw-r--r--lib/kross/main/krossconfig.h8
-rw-r--r--lib/kross/main/mainmodule.cpp22
-rw-r--r--lib/kross/main/mainmodule.h46
-rw-r--r--lib/kross/main/manager.cpp94
-rw-r--r--lib/kross/main/manager.h28
-rw-r--r--lib/kross/main/scriptaction.cpp66
-rw-r--r--lib/kross/main/scriptaction.h49
-rw-r--r--lib/kross/main/scriptcontainer.cpp74
-rw-r--r--lib/kross/main/scriptcontainer.h40
-rw-r--r--lib/kross/main/scriptguiclient.cpp156
-rw-r--r--lib/kross/main/scriptguiclient.h45
-rw-r--r--lib/kross/main/wdgscriptsmanager.cpp110
-rw-r--r--lib/kross/main/wdgscriptsmanager.h7
-rw-r--r--lib/kross/main/wdgscriptsmanagerbase.ui22
15 files changed, 387 insertions, 384 deletions
diff --git a/lib/kross/main/krossconfig.cpp b/lib/kross/main/krossconfig.cpp
index 61984532..edc8d0f1 100644
--- a/lib/kross/main/krossconfig.cpp
+++ b/lib/kross/main/krossconfig.cpp
@@ -23,12 +23,12 @@
#include <kdebug.h>
-void Kross::krossdebug(const QString &s)
+void Kross::krossdebug(const TQString &s)
{
kdDebug() << "Kross: " << s << endl;
}
-void Kross::krosswarning(const QString &s)
+void Kross::krosswarning(const TQString &s)
{
kdWarning() << "Kross: " << s << endl;
}
diff --git a/lib/kross/main/krossconfig.h b/lib/kross/main/krossconfig.h
index 6b8bb25d..b99dc35f 100644
--- a/lib/kross/main/krossconfig.h
+++ b/lib/kross/main/krossconfig.h
@@ -20,7 +20,7 @@
#ifndef KROSS_MAIN_KROSSCONFIG_H
#define KROSS_MAIN_KROSSCONFIG_H
-#include <qstring.h>
+#include <tqstring.h>
/**
* The Kross scripting bridge to embed scripting functionality
@@ -39,7 +39,7 @@
* \a Kross::KexiDB together with interpreters like \a Kross::Python.
* - Introspection where needed to be able to manipulate
* behaviours and functionality on runtime.
- * - Qt/KDE based, so use the extended techs both spends.
+ * - TQt/KDE based, so use the extended techs both spends.
* - integrate nicly as powerfull scripting system into the
* Kexi application.
*
@@ -57,12 +57,12 @@ namespace Kross {
/**
* Debugging function.
*/
- void krossdebug(const QString &s);
+ void krossdebug(const TQString &s);
/**
* Warning function.
*/
- void krosswarning(const QString &s);
+ void krosswarning(const TQString &s);
#else
// Define these to an empty statement if debugging is disabled.
diff --git a/lib/kross/main/mainmodule.cpp b/lib/kross/main/mainmodule.cpp
index 0630e81a..dde74502 100644
--- a/lib/kross/main/mainmodule.cpp
+++ b/lib/kross/main/mainmodule.cpp
@@ -36,7 +36,7 @@ namespace Kross { namespace Api {
}}
-MainModule::MainModule(const QString& name)
+MainModule::MainModule(const TQString& name)
: Module(name)
, d(new MainModulePrivate())
{
@@ -48,7 +48,7 @@ MainModule::~MainModule()
delete d;
}
-const QString MainModule::getClassName() const
+const TQString MainModule::getClassName() const
{
return "Kross::Api::MainModule";
}
@@ -69,47 +69,47 @@ void MainModule::setException(Exception::Ptr exception)
}
#if 0
-bool MainModule::hasChild(const QString& name) const
+bool MainModule::hasChild(const TQString& name) const
{
return Callable::hasChild(name);
}
#endif
-EventSignal::Ptr MainModule::addSignal(const QString& name, QObject* sender, QCString signal)
+EventSignal::Ptr MainModule::addSignal(const TQString& name, TQObject* sender, TQCString signal)
{
EventSignal* event = new EventSignal(name, sender, signal);
if(! addChild(name, event)) {
- krosswarning( QString("Failed to add signal name='%1' signature='%2'").arg(name).arg(signal) );
+ krosswarning( TQString("Failed to add signal name='%1' signature='%2'").tqarg(name).tqarg(signal.data()) );
return 0;
}
return event;
}
-EventSlot::Ptr MainModule::addSlot(const QString& name, QObject* receiver, QCString slot)
+EventSlot::Ptr MainModule::addSlot(const TQString& name, TQObject* receiver, TQCString slot)
{
EventSlot* event = new EventSlot(name, receiver, slot);
if(! addChild(name, event)) {
- krosswarning( QString("Failed to add slot name='%1' signature='%2'").arg(name).arg(slot) );
+ krosswarning( TQString("Failed to add slot name='%1' signature='%2'").tqarg(name).tqarg(slot.data()) );
return 0;
}
return event;
}
-QtObject::Ptr MainModule::addQObject(QObject* object, const QString& name)
+QtObject::Ptr MainModule::addTQObject(TQObject* object, const TQString& name)
{
QtObject* qtobject = new QtObject(object, name);
if(! addChild(name, qtobject)) {
- krosswarning( QString("Failed to add QObject name='%1'").arg(object->name()) );
+ krosswarning( TQString("Failed to add TQObject name='%1'").tqarg(object->name()) );
return 0;
}
return qtobject;
}
-EventAction::Ptr MainModule::addKAction(KAction* action, const QString& name)
+EventAction::Ptr MainModule::addKAction(KAction* action, const TQString& name)
{
EventAction* event = new EventAction(name, action);
if(! addChild(name, event)) {
- krosswarning( QString("Failed to add KAction name='%1'").arg(action->name()) );
+ krosswarning( TQString("Failed to add KAction name='%1'").tqarg(action->name()) );
return 0;
}
return event;
diff --git a/lib/kross/main/mainmodule.h b/lib/kross/main/mainmodule.h
index 116e098d..bc7efc45 100644
--- a/lib/kross/main/mainmodule.h
+++ b/lib/kross/main/mainmodule.h
@@ -29,9 +29,9 @@
#include "../api/qtobject.h"
#include "../api/eventaction.h"
-#include <qstring.h>
-#include <qvariant.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqvariant.h>
+#include <tqobject.h>
#include <ksharedptr.h>
#include <kaction.h>
@@ -65,7 +65,7 @@ namespace Kross { namespace Api {
* the \a ScriptContainer instances are accessible
* by there \a ScriptContainer::getName() name.
*/
- explicit MainModule(const QString& name);
+ explicit MainModule(const TQString& name);
/**
* Destructor.
@@ -73,7 +73,7 @@ namespace Kross { namespace Api {
virtual ~MainModule();
/// \see Kross::Api::Object::getClassName()
- virtual const QString getClassName() const;
+ virtual const TQString getClassName() const;
/**
* \return true if the script throwed an exception
@@ -101,54 +101,54 @@ namespace Kross { namespace Api {
*
* \return true if child exists else false.
*/
- bool hasChild(const QString& name) const;
+ bool hasChild(const TQString& name) const;
#endif
/**
- * Add a Qt signal to the \a Module by creating
+ * Add a TQt signal to the \a Module by creating
* an \a EventSignal for it.
*
* \param name the name the \a EventSignal is
* reachable as
- * \param sender the QObject instance which
+ * \param sender the TQObject instance which
* is the sender of the \p signal
- * \param signal the Qt signal macro the \p sender
+ * \param signal the TQt signal macro the \p sender
* emits to call the \a EventSignal
* \return the newly added \a EventSignal instance
* which is now a child of this \a MainModule
*/
- EventSignal::Ptr addSignal(const QString& name, QObject* sender, QCString signal);
+ EventSignal::Ptr addSignal(const TQString& name, TQObject* sender, TQCString signal);
/**
- * Add a Qt slot to the \a Module by creating
+ * Add a TQt slot to the \a Module by creating
* an \a EventSlot for it.
*
* \param name the name the \a EventSlot is
* reachable as
- * \param receiver the QObject instance which
+ * \param receiver the TQObject instance which
* is the receiver of the \p signal
- * \param slot the Qt slot macro of the \p receiver
+ * \param slot the TQt slot macro of the \p receiver
* to invoke if the \a EventSlot got called.
* \return the newly added \a EventSlot instance
* which is now a child of this \a MainModule
*/
- EventSlot::Ptr addSlot(const QString& name, QObject* receiver, QCString slot);
+ EventSlot::Ptr addSlot(const TQString& name, TQObject* receiver, TQCString slot);
/**
- * Add a \a QObject to the eventcollection. All
- * signals and slots the QObject has will be
+ * Add a \a TQObject to the eventcollection. All
+ * signals and slots the TQObject has will be
* added to a new \a EventCollection instance
* which is child of this \a EventCollection
* instance.
*
- * \param object the QObject instance that should
+ * \param object the TQObject instance that should
* be added to this \a MainModule
- * \param name the name under which this QObject instance
+ * \param name the name under which this TQObject instance
* should be registered as
* \return the newly added \a QtObject instance
* which is now a child of this \a MainModule
*/
- QtObject::Ptr addQObject(QObject* object, const QString& name = QString::null);
+ QtObject::Ptr addTQObject(TQObject* object, const TQString& name = TQString());
/**
* Add a \a KAction to the eventcollection. The
@@ -163,12 +163,12 @@ namespace Kross { namespace Api {
*
* \todo check \a name dox.
*/
- EventAction::Ptr addKAction(KAction* action, const QString& name = QString::null);
+ EventAction::Ptr addKAction(KAction* action, const TQString& name = TQString());
- //typedef QValueList<Callable::Ptr> EventList;
+ //typedef TQValueList<Callable::Ptr> EventList;
//EventList getEvents();
- //const QString& serializeToXML();
- //void unserializeFromXML(const QString& xml);
+ //const TQString& serializeToXML();
+ //void unserializeFromXML(const TQString& xml);
private:
/// Private d-pointer class.
diff --git a/lib/kross/main/manager.cpp b/lib/kross/main/manager.cpp
index cdb4d363..b966a1cc 100644
--- a/lib/kross/main/manager.cpp
+++ b/lib/kross/main/manager.cpp
@@ -20,7 +20,7 @@
#include "manager.h"
#include "../api/interpreter.h"
-//#include "../api/qtobject.h"
+//#include "../api/tqtobject.h"
#include "../api/eventslot.h"
#include "../api/eventsignal.h"
//#include "../api/script.h"
@@ -28,9 +28,9 @@
#include "krossconfig.h"
#include "scriptcontainer.h"
-#include <qobject.h>
-#include <qfile.h>
-#include <qregexp.h>
+#include <tqobject.h>
+#include <tqfile.h>
+#include <tqregexp.h>
#include <klibloader.h>
#include <klocale.h>
@@ -50,10 +50,10 @@ namespace Kross { namespace Api {
{
public:
/// List of \a InterpreterInfo instances.
- QMap<QString, InterpreterInfo*> interpreterinfos;
+ TQMap<TQString, InterpreterInfo*> interpreterinfos;
/// Loaded modules.
- QMap<QString, Module::Ptr> modules;
+ TQMap<TQString, Module::Ptr> modules;
};
/**
@@ -80,34 +80,34 @@ Manager::Manager()
, d( new ManagerPrivate() )
{
#ifdef KROSS_PYTHON_LIBRARY
- QString pythonlib = QFile::encodeName( KLibLoader::self()->findLibrary(KROSS_PYTHON_LIBRARY) );
+ TQString pythonlib = TQFile::encodeName( KLibLoader::self()->findLibrary(KROSS_PYTHON_LIBRARY) );
if(! pythonlib.isEmpty()) { // If the Kross Python plugin exists we offer it as supported scripting language.
InterpreterInfo::Option::Map pythonoptions;
- pythonoptions.replace("restricted",
- new InterpreterInfo::Option("Restricted", "Restricted Python interpreter", QVariant(false,0))
+ pythonoptions.tqreplace("restricted",
+ new InterpreterInfo::Option("Restricted", "Restricted Python interpreter", TQVariant(false,0))
);
- d->interpreterinfos.replace("python",
+ d->interpreterinfos.tqreplace("python",
new InterpreterInfo("python",
pythonlib, // library
"*.py", // file filter-wildcard
- QStringList() << /* "text/x-python" << */ "application/x-python", // mimetypes
+ TQStringList() << /* "text/x-python" << */ "application/x-python", // mimetypes
pythonoptions // options
)
);
}
#endif
#ifdef KROSS_RUBY_LIBRARY
- QString rubylib = QFile::encodeName( KLibLoader::self()->findLibrary(KROSS_RUBY_LIBRARY) );
+ TQString rubylib = TQFile::encodeName( KLibLoader::self()->findLibrary(KROSS_RUBY_LIBRARY) );
if(! rubylib.isEmpty()) { // If the Kross Ruby plugin exists we offer it as supported scripting language.
InterpreterInfo::Option::Map rubyoptions;
- rubyoptions.replace("safelevel",
- new InterpreterInfo::Option("safelevel", "Level of safety of the Ruby interpreter", QVariant(0)) // 0 -> unsafe, 4 -> very safe
+ rubyoptions.tqreplace("safelevel",
+ new InterpreterInfo::Option("safelevel", "Level of safety of the Ruby interpreter", TQVariant(0)) // 0 -> unsafe, 4 -> very safe
);
- d->interpreterinfos.replace("ruby",
+ d->interpreterinfos.tqreplace("ruby",
new InterpreterInfo("ruby",
rubylib, // library
"*.rb", // file filter-wildcard
- QStringList() << /* "text/x-ruby" << */ "application/x-ruby", // mimetypes
+ TQStringList() << /* "text/x-ruby" << */ "application/x-ruby", // mimetypes
rubyoptions // options
)
);
@@ -119,68 +119,68 @@ Manager::Manager()
Manager::~Manager()
{
- for(QMap<QString, InterpreterInfo*>::Iterator it = d->interpreterinfos.begin(); it != d->interpreterinfos.end(); ++it)
+ for(TQMap<TQString, InterpreterInfo*>::Iterator it = d->interpreterinfos.begin(); it != d->interpreterinfos.end(); ++it)
delete it.data();
delete d;
}
-QMap<QString, InterpreterInfo*> Manager::getInterpreterInfos()
+TQMap<TQString, InterpreterInfo*> Manager::getInterpreterInfos()
{
return d->interpreterinfos;
}
-bool Manager::hasInterpreterInfo(const QString& interpretername) const
+bool Manager::hasInterpreterInfo(const TQString& interpretername) const
{
- return d->interpreterinfos.contains(interpretername);
+ return d->interpreterinfos.tqcontains(interpretername);
}
-InterpreterInfo* Manager::getInterpreterInfo(const QString& interpretername)
+InterpreterInfo* Manager::getInterpreterInfo(const TQString& interpretername)
{
return d->interpreterinfos[interpretername];
}
-const QString Manager::getInterpreternameForFile(const QString& file)
+const TQString Manager::getInterpreternameForFile(const TQString& file)
{
- QRegExp rx;
+ TQRegExp rx;
rx.setWildcard(true);
- for(QMap<QString, InterpreterInfo*>::Iterator it = d->interpreterinfos.begin(); it != d->interpreterinfos.end(); ++it) {
+ for(TQMap<TQString, InterpreterInfo*>::Iterator it = d->interpreterinfos.begin(); it != d->interpreterinfos.end(); ++it) {
rx.setPattern((*it)->getWildcard());
- if( file.find(rx) >= 0 )
+ if( file.tqfind(rx) >= 0 )
return (*it)->getInterpretername();
}
- return QString::null;
+ return TQString();
}
-ScriptContainer::Ptr Manager::getScriptContainer(const QString& scriptname)
+ScriptContainer::Ptr Manager::getScriptContainer(const TQString& scriptname)
{
//TODO at the moment we don't share ScriptContainer instances.
- //if(d->m_scriptcontainers.contains(scriptname))
+ //if(d->m_scriptcontainers.tqcontains(scriptname))
// return d->m_scriptcontainers[scriptname];
ScriptContainer* scriptcontainer = new ScriptContainer(scriptname);
//ScriptContainer script(this, scriptname);
- //d->m_scriptcontainers.replace(scriptname, scriptcontainer);
+ //d->m_scriptcontainers.tqreplace(scriptname, scriptcontainer);
return scriptcontainer;
}
-Interpreter* Manager::getInterpreter(const QString& interpretername)
+Interpreter* Manager::getInterpreter(const TQString& interpretername)
{
setException(0); // clear previous exceptions
- if(! d->interpreterinfos.contains(interpretername)) {
- setException( new Exception(i18n("No such interpreter '%1'").arg(interpretername)) );
+ if(! d->interpreterinfos.tqcontains(interpretername)) {
+ setException( new Exception(i18n("No such interpreter '%1'").tqarg(interpretername)) );
return 0;
}
return d->interpreterinfos[interpretername]->getInterpreter();
}
-const QStringList Manager::getInterpreters()
+const TQStringList Manager::getInterpreters()
{
- QStringList list;
+ TQStringList list;
- QMap<QString, InterpreterInfo*>::Iterator it( d->interpreterinfos.begin() );
+ TQMap<TQString, InterpreterInfo*>::Iterator it( d->interpreterinfos.begin() );
for(; it != d->interpreterinfos.end(); ++it)
list << it.key();
@@ -191,37 +191,37 @@ const QStringList Manager::getInterpreters()
bool Manager::addModule(Module::Ptr module)
{
- QString name = module->getName();
- //if( d->modules.contains(name) ) return false;
- d->modules.replace(name, module);
+ TQString name = module->getName();
+ //if( d->modules.tqcontains(name) ) return false;
+ d->modules.tqreplace(name, module);
return true;
}
-Module::Ptr Manager::loadModule(const QString& modulename)
+Module::Ptr Manager::loadModule(const TQString& modulename)
{
Module::Ptr module = 0;
- if(d->modules.contains(modulename)) {
+ if(d->modules.tqcontains(modulename)) {
module = d->modules[modulename];
if(module)
return module;
else
- krossdebug( QString("Manager::loadModule(%1) =======> Modulename registered, but module is invalid!").arg(modulename) );
+ krossdebug( TQString("Manager::loadModule(%1) =======> Modulename registered, but module is invalid!").tqarg(modulename) );
}
KLibLoader* loader = KLibLoader::self();
KLibrary* lib = loader->globalLibrary( modulename.latin1() );
if(! lib) {
- krosswarning( QString("Failed to load module '%1': %2").arg(modulename).arg(loader->lastErrorMessage()) );
+ krosswarning( TQString("Failed to load module '%1': %2").tqarg(modulename).tqarg(loader->lastErrorMessage()) );
return 0;
}
- krossdebug( QString("Successfully loaded module '%1'").arg(modulename) );
+ krossdebug( TQString("Successfully loaded module '%1'").tqarg(modulename) );
def_module_func func;
func = (def_module_func) lib->symbol("init_module");
if(! func) {
- krosswarning( QString("Failed to determinate init function in module '%1'").arg(modulename) );
+ krosswarning( TQString("Failed to determinate init function in module '%1'").tqarg(modulename) );
return 0;
}
@@ -235,14 +235,14 @@ Module::Ptr Manager::loadModule(const QString& modulename)
lib->unload();
if(! module) {
- krosswarning( QString("Failed to load module '%1'").arg(modulename) );
+ krosswarning( TQString("Failed to load module '%1'").tqarg(modulename) );
return 0;
}
// Don't remember module cause we like to have freeing it handled by the caller.
- //d->modules.replace(modulename, module);
+ //d->modules.tqreplace(modulename, module);
- //krossdebug( QString("Kross::Api::Manager::loadModule modulename='%1' module='%2'").arg(modulename).arg(module->toString()) );
+ //krossdebug( TQString("Kross::Api::Manager::loadModule modulename='%1' module='%2'").tqarg(modulename).tqarg(module->toString()) );
return module;
}
diff --git a/lib/kross/main/manager.h b/lib/kross/main/manager.h
index 0de5833f..fe815e7c 100644
--- a/lib/kross/main/manager.h
+++ b/lib/kross/main/manager.h
@@ -20,13 +20,13 @@
#ifndef KROSS_API_MANAGER_H
#define KROSS_API_MANAGER_H
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qmap.h>
-//#include <qvariant.h>
+#include <tqstring.h>
+#include <tqstringlist.h>
+#include <tqmap.h>
+//#include <tqvariant.h>
#include <ksharedptr.h>
-class QObject;
+class TQObject;
#include "../api/object.h"
#include "mainmodule.h"
@@ -78,20 +78,20 @@ namespace Kross { namespace Api {
* \return a map with \a InterpreterInfo* instances
* used to describe interpreters.
*/
- QMap<QString, InterpreterInfo*> getInterpreterInfos();
+ TQMap<TQString, InterpreterInfo*> getInterpreterInfos();
/**
* \return true if there exists an interpreter with the
* name \p interpretername else false.
*/
- bool hasInterpreterInfo(const QString& interpretername) const;
+ bool hasInterpreterInfo(const TQString& interpretername) const;
/**
* \return the \a InterpreterInfo* matching to the defined
* \p interpretername or NULL if there does not exists such
* a interpreter.
*/
- InterpreterInfo* getInterpreterInfo(const QString& interpretername);
+ InterpreterInfo* getInterpreterInfo(const TQString& interpretername);
/**
* \return the name of the \a Interpreter that feels responsible
@@ -100,10 +100,10 @@ namespace Kross { namespace Api {
* \param file The filename we should try to determinate the
* interpretername for.
* \return The name of the \a Interpreter which will be used
- * to execute the file or QString::null if we failed
+ * to execute the file or TQString() if we failed
* to determinate a matching interpreter for the file.
*/
- const QString getInterpreternameForFile(const QString& file);
+ const TQString getInterpreternameForFile(const TQString& file);
/**
* Return the existing \a ScriptContainer with scriptname
@@ -116,7 +116,7 @@ namespace Kross { namespace Api {
* \return The \a ScriptContainer instance matching to
* scriptname.
*/
- KSharedPtr<ScriptContainer> getScriptContainer(const QString& scriptname);
+ KSharedPtr<ScriptContainer> getScriptContainer(const TQString& scriptname);
/**
* Return the \a Interpreter instance defined by
@@ -128,13 +128,13 @@ namespace Kross { namespace Api {
* does not exists an interpreter with such
* an interpretername.
*/
- Interpreter* getInterpreter(const QString& interpretername);
+ Interpreter* getInterpreter(const TQString& interpretername);
/**
* \return a list of names of the at the backend
* supported interpreters.
*/
- const QStringList getInterpreters();
+ const TQStringList getInterpreters();
/**
* Add the an external module to the global shared list of
@@ -155,7 +155,7 @@ namespace Kross { namespace Api {
* failed. The loaded Module isn't added to the global
* shared list of modules.
*/
- Module::Ptr loadModule(const QString& modulename);
+ Module::Ptr loadModule(const TQString& modulename);
private:
/// Private d-pointer class.
diff --git a/lib/kross/main/scriptaction.cpp b/lib/kross/main/scriptaction.cpp
index 06ee9dd7..b658a0b1 100644
--- a/lib/kross/main/scriptaction.cpp
+++ b/lib/kross/main/scriptaction.cpp
@@ -20,10 +20,10 @@
#include "scriptaction.h"
#include "manager.h"
-#include <qstylesheet.h>
-#include <qdir.h>
-#include <qfile.h>
-#include <qfileinfo.h>
+#include <tqstylesheet.h>
+#include <tqdir.h>
+#include <tqfile.h>
+#include <tqfileinfo.h>
#include <kurl.h>
#include <kstandarddirs.h>
#include <kmimetype.h>
@@ -42,7 +42,7 @@ namespace Kross { namespace Api {
* to a scriptfile the packagepath will be the directory
* the scriptfile is located in.
*/
- QString packagepath;
+ TQString packagepath;
/**
* List of logs this \a ScriptAction has. Initialization,
@@ -51,7 +51,7 @@ namespace Kross { namespace Api {
* more detailed visual information to the user what
* our \a ScriptAction did so far.
*/
- QStringList logs;
+ TQStringList logs;
/**
* The versionnumber this \a ScriptAction has. We are using
@@ -66,13 +66,13 @@ namespace Kross { namespace Api {
* The description used to provide a way to the user to describe
* the \a ScriptAction with a longer string.
*/
- QString description;
+ TQString description;
/**
* List of \a ScriptActionCollection instances this \a ScriptAction
* is attached to.
*/
- QValueList<ScriptActionCollection*> collections;
+ TQValueList<ScriptActionCollection*> collections;
/**
* Constructor.
@@ -82,7 +82,7 @@ namespace Kross { namespace Api {
}}
-ScriptAction::ScriptAction(const QString& file)
+ScriptAction::ScriptAction(const TQString& file)
: KAction(0, file.latin1())
, Kross::Api::ScriptContainer(file)
, d( new ScriptActionPrivate() ) // initialize d-pointer class
@@ -101,18 +101,18 @@ ScriptAction::ScriptAction(const QString& file)
setEnabled(false);
}
-ScriptAction::ScriptAction(const QString& scriptconfigfile, const QDomElement& element)
+ScriptAction::ScriptAction(const TQString& scriptconfigfile, const TQDomElement& element)
: KAction()
, Kross::Api::ScriptContainer()
, d( new ScriptActionPrivate() ) // initialize d-pointer class
{
- QString name = element.attribute("name");
- QString text = element.attribute("text");
- QString description = element.attribute("description");
- QString file = element.attribute("file");
- QString icon = element.attribute("icon");
+ TQString name = element.attribute("name");
+ TQString text = element.attribute("text");
+ TQString description = element.attribute("description");
+ TQString file = element.attribute("file");
+ TQString icon = element.attribute("icon");
- QString version = element.attribute("version");
+ TQString version = element.attribute("version");
bool ok;
int v = version.toInt(&ok);
if(ok) d->version = v;
@@ -130,7 +130,7 @@ ScriptAction::ScriptAction(const QString& scriptconfigfile, const QDomElement& e
//d->scriptcontainer = Manager::scriptManager()->getScriptContainer(name);
- QString interpreter = element.attribute("interpreter");
+ TQString interpreter = element.attribute("interpreter");
if(interpreter.isNull())
setEnabled(false);
else
@@ -143,18 +143,18 @@ ScriptAction::ScriptAction(const QString& scriptconfigfile, const QDomElement& e
ScriptContainer::setName(name);
}
else {
- QDir dir = QFileInfo(scriptconfigfile).dir(true);
+ TQDir dir = TQFileInfo(scriptconfigfile).dir(true);
d->packagepath = dir.absPath();
- QFileInfo fi(dir, file);
+ TQFileInfo fi(dir, file);
file = fi.absFilePath();
setEnabled(fi.exists());
setFile(file);
if(icon.isNull())
icon = KMimeType::iconForURL( KURL(file) );
if(description.isEmpty())
- description = QString("%1<br>%2").arg(text.isEmpty() ? name : text).arg(file);
+ description = TQString("%1<br>%2").tqarg(text.isEmpty() ? name : text).tqarg(file);
else
- description += QString("<br>%1").arg(file);
+ description += TQString("<br>%1").tqarg(file);
ScriptContainer::setName(file);
}
@@ -164,7 +164,7 @@ ScriptAction::ScriptAction(const QString& scriptconfigfile, const QDomElement& e
KAction::setIcon(icon);
// connect signal
- connect(this, SIGNAL(activated()), this, SLOT(activate()));
+ connect(this, TQT_SIGNAL(activated()), this, TQT_SLOT(activate()));
}
ScriptAction::~ScriptAction()
@@ -178,30 +178,30 @@ int ScriptAction::version() const
return d->version;
}
-const QString ScriptAction::getDescription() const
+const TQString ScriptAction::getDescription() const
{
return d->description;
}
-void ScriptAction::setDescription(const QString& description)
+void ScriptAction::setDescription(const TQString& description)
{
d->description = description;
setToolTip( description );
setWhatsThis( description );
}
-void ScriptAction::setInterpreterName(const QString& name)
+void ScriptAction::setInterpreterName(const TQString& name)
{
setEnabled( Manager::scriptManager()->hasInterpreterInfo(name) );
Kross::Api::ScriptContainer::setInterpreterName(name);
}
-const QString ScriptAction::getPackagePath() const
+const TQString ScriptAction::getPackagePath() const
{
return d->packagepath;
}
-const QStringList& ScriptAction::getLogs() const
+const TQStringList& ScriptAction::getLogs() const
{
return d->logs;
}
@@ -218,7 +218,7 @@ void ScriptAction::detach(ScriptActionCollection* collection)
void ScriptAction::detachAll()
{
- for(QValueList<ScriptActionCollection*>::Iterator it = d->collections.begin(); it != d->collections.end(); ++it)
+ for(TQValueList<ScriptActionCollection*>::Iterator it = d->collections.begin(); it != d->collections.end(); ++it)
(*it)->detach( this );
}
@@ -227,11 +227,11 @@ void ScriptAction::activate()
emit activated(this);
Kross::Api::ScriptContainer::execute();
if( Kross::Api::ScriptContainer::hadException() ) {
- QString errormessage = Kross::Api::ScriptContainer::getException()->getError();
- QString tracedetails = Kross::Api::ScriptContainer::getException()->getTrace();
- d->logs << QString("<b>%1</b><br>%2")
- .arg( QStyleSheet::escape(errormessage) )
- .arg( QStyleSheet::escape(tracedetails) );
+ TQString errormessage = Kross::Api::ScriptContainer::getException()->getError();
+ TQString tracedetails = Kross::Api::ScriptContainer::getException()->getTrace();
+ d->logs << TQString("<b>%1</b><br>%2")
+ .tqarg( TQStyleSheet::escape(errormessage) )
+ .tqarg( TQStyleSheet::escape(tracedetails) );
emit failed(errormessage, tracedetails);
}
else {
diff --git a/lib/kross/main/scriptaction.h b/lib/kross/main/scriptaction.h
index 22bb37ec..27f910d0 100644
--- a/lib/kross/main/scriptaction.h
+++ b/lib/kross/main/scriptaction.h
@@ -20,7 +20,7 @@
#ifndef KROSS_API_SCRIPTACTION_H
#define KROSS_API_SCRIPTACTION_H
-#include <qdom.h>
+#include <tqdom.h>
#include <kaction.h>
#include "scriptcontainer.h"
@@ -41,18 +41,19 @@ namespace Kross { namespace Api {
, public Kross::Api::ScriptContainer
{
Q_OBJECT
+ TQ_OBJECT
/// The name of the interpreter used to execute the scripting code.
- //Q_PROPERTY(QString interpretername READ getInterpreterName WRITE setInterpreterName)
+ //TQ_PROPERTY(TQString interpretername READ getInterpreterName WRITE setInterpreterName)
/// The scripting code which should be executed.
- //Q_PROPERTY(QString code READ getCode WRITE setCode)
+ //TQ_PROPERTY(TQString code READ getCode WRITE setCode)
/// The scriptfile which should be executed.
- //Q_PROPERTY(QString file READ getFile WRITE setFile)
+ //TQ_PROPERTY(TQString file READ getFile WRITE setFile)
/// The description for this \a ScriptAction .
- Q_PROPERTY(QString description READ getDescription WRITE setDescription)
+ TQ_PROPERTY(TQString description READ getDescription WRITE setDescription)
public:
@@ -60,7 +61,7 @@ namespace Kross { namespace Api {
typedef KSharedPtr<ScriptAction> Ptr;
/// A list of \a ScriptAction instances.
- //typedef QValueList<ScriptAction::Ptr> List;
+ //typedef TQValueList<ScriptAction::Ptr> List;
/**
* Constructor.
@@ -68,17 +69,17 @@ namespace Kross { namespace Api {
* \param file The KURL scriptfile this \a ScriptAction
* points to.
*/
- explicit ScriptAction(const QString& file);
+ explicit ScriptAction(const TQString& file);
/**
* Constructor.
*
* \param scriptconfigfile The XML-configurationfile
* the DOM-element was readed from.
- * \param element The QDomElement which will be used
+ * \param element The TQDomElement which will be used
* to setup the \a ScriptAction attributes.
*/
- explicit ScriptAction(const QString& scriptconfigfile, const QDomElement& element);
+ explicit ScriptAction(const TQString& scriptconfigfile, const TQDomElement& element);
/**
* Destructor.
@@ -96,12 +97,12 @@ namespace Kross { namespace Api {
/**
* \return the description for this \a ScriptAction has.
*/
- const QString getDescription() const;
+ const TQString getDescription() const;
/**
* Set the description \p description for this \a ScriptAction .
*/
- void setDescription(const QString& description);
+ void setDescription(const TQString& description);
/**
* Set the name of the interpreter which will be used
@@ -110,20 +111,20 @@ namespace Kross { namespace Api {
* \param name The name of the \a Interpreter . This
* could be e.g. "python".
*/
- void setInterpreterName(const QString& name);
+ void setInterpreterName(const TQString& name);
/**
* \return the path of the package this \a ScriptAction
- * belongs to or QString::null if it doesn't belong to
+ * belongs to or TQString() if it doesn't belong to
* any package.
*/
- const QString getPackagePath() const;
+ const TQString getPackagePath() const;
/**
* \return a list of all kind of logs this \a ScriptAction
* does remember.
*/
- const QStringList& getLogs() const;
+ const TQStringList& getLogs() const;
/**
* Attach this \a ScriptAction to the \a ScriptActionCollection
@@ -173,10 +174,10 @@ namespace Kross { namespace Api {
/**
* This signal got emitted after the try to execute this
- * \a ScriptAction failed. The \p errormessage contains
+ * \a ScriptAction failed. The \p errormessage tqcontains
* the error message.
*/
- void failed(const QString& errormessage, const QString& tracedetails);
+ void failed(const TQString& errormessage, const TQString& tracedetails);
private:
/// Internaly used private d-pointer.
@@ -196,13 +197,13 @@ namespace Kross { namespace Api {
/**
* The list of \a ScriptAction shared pointers.
*/
- QValueList<ScriptAction::Ptr> m_list;
+ TQValueList<ScriptAction::Ptr> m_list;
/**
* A map of \a ScriptAction shared pointers used to access
* the actions with there name.
*/
- QMap<QCString, ScriptAction::Ptr> m_actions;
+ TQMap<TQCString, ScriptAction::Ptr> m_actions;
/**
* A KActionMenu which could be used to display the
@@ -237,7 +238,7 @@ namespace Kross { namespace Api {
* initial content for the KActionMenu \a m_actionmenu .
* \param name The internal name.
*/
- ScriptActionCollection(const QString& text, KActionCollection* ac, const char* name)
+ ScriptActionCollection(const TQString& text, KActionCollection* ac, const char* name)
: m_actionmenu( new KActionMenu(text, ac, name) )
, m_dirty(true) {}
@@ -246,7 +247,7 @@ namespace Kross { namespace Api {
* Destructor.
*/
~ScriptActionCollection() {
- for(QValueList<ScriptAction::Ptr>::Iterator it = m_list.begin(); it != m_list.end(); ++it)
+ for(TQValueList<ScriptAction::Ptr>::Iterator it = m_list.begin(); it != m_list.end(); ++it)
(*it)->detach(this);
}
@@ -254,12 +255,12 @@ namespace Kross { namespace Api {
* \return the \a ScriptAction instance which has the name \p name
* or NULL if there exists no such action.
*/
- ScriptAction::Ptr action(const QCString& name) { return m_actions[name]; }
+ ScriptAction::Ptr action(const TQCString& name) { return m_actions[name]; }
/**
* \return a list of actions.
*/
- QValueList<ScriptAction::Ptr> actions() { return m_list; }
+ TQValueList<ScriptAction::Ptr> actions() { return m_list; }
/**
* \return the KActionMenu \a m_actionmenu .
@@ -293,7 +294,7 @@ namespace Kross { namespace Api {
* will be empty and there are no actions attach any longer.
*/
void clear() {
- for(QValueList<ScriptAction::Ptr>::Iterator it = m_list.begin(); it != m_list.end(); ++it) {
+ for(TQValueList<ScriptAction::Ptr>::Iterator it = m_list.begin(); it != m_list.end(); ++it) {
m_actionmenu->remove(*it);
(*it)->detach(this);
}
diff --git a/lib/kross/main/scriptcontainer.cpp b/lib/kross/main/scriptcontainer.cpp
index 56c9bb8e..5acde9db 100644
--- a/lib/kross/main/scriptcontainer.cpp
+++ b/lib/kross/main/scriptcontainer.cpp
@@ -25,7 +25,7 @@
#include "../main/manager.h"
#include "mainmodule.h"
-#include <qfile.h>
+#include <tqfile.h>
#include <klocale.h>
@@ -50,19 +50,19 @@ namespace Kross { namespace Api {
* The unique name the \a ScriptContainer is
* reachable as.
*/
- QString name;
+ TQString name;
/**
* The scripting code.
*/
- QString code;
+ TQString code;
/**
* The name of the interpreter. This could be
* something like "python" for the python
* binding.
*/
- QString interpretername;
+ TQString interpretername;
/**
* The name of the scriptfile that should be
@@ -71,23 +71,23 @@ namespace Kross { namespace Api {
* scripting code and, if not defined, the
* used interpreter.
*/
- QString scriptfile;
+ TQString scriptfile;
/**
* Map of options that overwritte the \a InterpreterInfo::Option::Map
* standard options.
*/
- QMap<QString, QVariant> options;
+ TQMap<TQString, TQVariant> options;
};
}}
-ScriptContainer::ScriptContainer(const QString& name)
+ScriptContainer::ScriptContainer(const TQString& name)
: MainModule(name)
, d( new ScriptContainerPrivate() ) // initialize d-pointer class
{
- //krossdebug( QString("ScriptContainer::ScriptContainer() Ctor name='%1'").arg(name) );
+ //krossdebug( TQString("ScriptContainer::ScriptContainer() Ctor name='%1'").tqarg(name) );
d->script = 0;
d->name = name;
@@ -95,77 +95,77 @@ ScriptContainer::ScriptContainer(const QString& name)
ScriptContainer::~ScriptContainer()
{
- //krossdebug( QString("ScriptContainer::~ScriptContainer() Dtor name='%1'").arg(d->name) );
+ //krossdebug( TQString("ScriptContainer::~ScriptContainer() Dtor name='%1'").tqarg(d->name) );
finalize();
delete d;
}
-const QString ScriptContainer::getName() const
+const TQString ScriptContainer::getName() const
{
return d->name;
}
-void ScriptContainer::setName(const QString& name)
+void ScriptContainer::setName(const TQString& name)
{
d->name = name;
}
-QString ScriptContainer::getCode() const
+TQString ScriptContainer::getCode() const
{
return d->code;
}
-void ScriptContainer::setCode(const QString& code)
+void ScriptContainer::setCode(const TQString& code)
{
finalize();
d->code = code;
}
-QString ScriptContainer::getInterpreterName() const
+TQString ScriptContainer::getInterpreterName() const
{
return d->interpretername;
}
-void ScriptContainer::setInterpreterName(const QString& interpretername)
+void ScriptContainer::setInterpreterName(const TQString& interpretername)
{
finalize();
d->interpretername = interpretername;
}
-QString ScriptContainer::getFile() const
+TQString ScriptContainer::getFile() const
{
return d->scriptfile;
}
-void ScriptContainer::setFile(const QString& scriptfile)
+void ScriptContainer::setFile(const TQString& scriptfile)
{
finalize();
d->scriptfile = scriptfile;
}
-QMap<QString, QVariant>& ScriptContainer::getOptions()
+TQMap<TQString, TQVariant>& ScriptContainer::getOptions()
{
return d->options;
}
-QVariant ScriptContainer::getOption(const QString name, QVariant defaultvalue, bool /*recursive*/)
+TQVariant ScriptContainer::getOption(const TQString name, TQVariant defaultvalue, bool /*recursive*/)
{
- if(d->options.contains(name))
+ if(d->options.tqcontains(name))
return d->options[name];
Kross::Api::InterpreterInfo* info = Kross::Api::Manager::scriptManager()->getInterpreterInfo( d->interpretername );
return info ? info->getOptionValue(name, defaultvalue) : defaultvalue;
}
-bool ScriptContainer::setOption(const QString name, const QVariant& value)
+bool ScriptContainer::setOption(const TQString name, const TQVariant& value)
{
Kross::Api::InterpreterInfo* info = Kross::Api::Manager::scriptManager()->getInterpreterInfo( d->interpretername );
if(info) {
if(info->hasOption(name)) {
- d->options.replace(name, value);
+ d->options.tqreplace(name, value);
return true;
- } else krosswarning( QString("Kross::Api::ScriptContainer::setOption(%1, %2): No such option").arg(name).arg(value.toString()) );
- } else krosswarning( QString("Kross::Api::ScriptContainer::setOption(%1, %2): No such interpreterinfo").arg(name).arg(value.toString()) );
+ } else krosswarning( TQString("Kross::Api::ScriptContainer::setOption(%1, %2): No such option").tqarg(name).tqarg(value.toString()) );
+ } else krosswarning( TQString("Kross::Api::ScriptContainer::setOption(%1, %2): No such interpreterinfo").tqarg(name).tqarg(value.toString()) );
return false;
}
@@ -187,12 +187,12 @@ Object::Ptr ScriptContainer::execute()
return r;
}
-const QStringList ScriptContainer::getFunctionNames()
+const TQStringList ScriptContainer::getFunctionNames()
{
- return d->script ? d->script->getFunctionNames() : QStringList(); //FIXME init before if needed?
+ return d->script ? d->script->getFunctionNames() : TQStringList(); //FIXME init before if needed?
}
-Object::Ptr ScriptContainer::callFunction(const QString& functionname, List::Ptr arguments)
+Object::Ptr ScriptContainer::callFunction(const TQString& functionname, List::Ptr arguments)
{
if(! d->script)
if(! initialize())
@@ -216,12 +216,12 @@ Object::Ptr ScriptContainer::callFunction(const QString& functionname, List::Ptr
return r;
}
-QStringList ScriptContainer::getClassNames()
+TQStringList ScriptContainer::getClassNames()
{
- return d->script ? d->script->getClassNames() : QStringList(); //FIXME init before if needed?
+ return d->script ? d->script->getClassNames() : TQStringList(); //FIXME init before if needed?
}
-Object::Ptr ScriptContainer::classInstance(const QString& classname)
+Object::Ptr ScriptContainer::classInstance(const TQString& classname)
{
if(! d->script)
if(! initialize())
@@ -244,34 +244,34 @@ bool ScriptContainer::initialize()
finalize();
if(! d->scriptfile.isNull()) {
- krossdebug( QString("Kross::Api::ScriptContainer::initialize() file=%1").arg(d->scriptfile) );
+ krossdebug( TQString("Kross::Api::ScriptContainer::initialize() file=%1").tqarg(d->scriptfile) );
if(d->interpretername.isNull()) {
d->interpretername = Manager::scriptManager()->getInterpreternameForFile( d->scriptfile );
if(d->interpretername.isNull()) {
- setException( new Exception(i18n("Failed to determinate interpreter for scriptfile '%1'").arg(d->scriptfile)) );
+ setException( new Exception(i18n("Failed to determinate interpreter for scriptfile '%1'").tqarg(d->scriptfile)) );
return false;
}
}
- QFile f( d->scriptfile );
+ TQFile f( d->scriptfile );
if(! f.open(IO_ReadOnly)) {
- setException( new Exception(i18n("Failed to open scriptfile '%1'").arg(d->scriptfile)) );
+ setException( new Exception(i18n("Failed to open scriptfile '%1'").tqarg(d->scriptfile)) );
return false;
}
- d->code = QString( f.readAll() );
+ d->code = TQString( f.readAll() );
f.close();
}
Interpreter* interpreter = Manager::scriptManager()->getInterpreter(d->interpretername);
if(! interpreter) {
- setException( new Exception(i18n("Unknown interpreter '%1'").arg(d->interpretername)) );
+ setException( new Exception(i18n("Unknown interpreter '%1'").tqarg(d->interpretername)) );
return false;
}
d->script = interpreter->createScript(this);
if(! d->script) {
- setException( new Exception(i18n("Failed to create script for interpreter '%1'").arg(d->interpretername)) );
+ setException( new Exception(i18n("Failed to create script for interpreter '%1'").tqarg(d->interpretername)) );
return false;
}
if(d->script->hadException()) {
diff --git a/lib/kross/main/scriptcontainer.h b/lib/kross/main/scriptcontainer.h
index a66293a2..5d2b38d0 100644
--- a/lib/kross/main/scriptcontainer.h
+++ b/lib/kross/main/scriptcontainer.h
@@ -22,9 +22,9 @@
#include "mainmodule.h"
-#include <qstring.h>
-#include <qvariant.h>
-#include <qobject.h>
+#include <tqstring.h>
+#include <tqvariant.h>
+#include <tqobject.h>
#include <ksharedptr.h>
namespace Kross { namespace Api {
@@ -67,7 +67,7 @@ namespace Kross { namespace Api {
* has. It's used e.g. at the \a Manager to
* identify the ScriptContainer.
*/
- explicit ScriptContainer(const QString& name = QString::null);
+ explicit ScriptContainer(const TQString& name = TQString());
public:
@@ -83,56 +83,56 @@ namespace Kross { namespace Api {
* \return the unique name this ScriptContainer is
* reachable as.
*/
- const QString getName() const;
+ const TQString getName() const;
/**
* Set the name this ScriptContainer is reachable as.
*/
- void setName(const QString& name);
+ void setName(const TQString& name);
/**
* Return the scriptcode this ScriptContainer holds.
*/
- QString getCode() const;
+ TQString getCode() const;
/**
* Set the scriptcode this ScriptContainer holds.
*/
- void setCode(const QString& code);
+ void setCode(const TQString& code);
/**
* \return the name of the interpreter used
* on \a execute.
*/
- QString getInterpreterName() const;
+ TQString getInterpreterName() const;
/**
* Set the name of the interpreter used
* on \a execute.
*/
- void setInterpreterName(const QString& interpretername);
+ void setInterpreterName(const TQString& interpretername);
/**
* \return the filename which will be executed
* on \a execute.
*/
- QString getFile() const;
+ TQString getFile() const;
/**
* Set the filename which will be executed
* on \a execute. The \p scriptfile needs to
- * be a valid local file or QString::null if
+ * be a valid local file or TQString() if
* you don't like to use a file rather then
* the with \a setCode() defined scripting code.
*/
- void setFile(const QString& scriptfile);
+ void setFile(const TQString& scriptfile);
/**
* \return a map of options this \a ScriptContainer defines.
* The options are returned call-by-ref, so you are able to
* manipulate them.
*/
- QMap<QString, QVariant>& getOptions();
+ TQMap<TQString, TQVariant>& getOptions();
/**
* \return the value of the option defined with \p name .
@@ -143,12 +143,12 @@ namespace Kross { namespace Api {
* the \a Manager options are seeked for the \p name and
* if not found either the \p defaultvalue is returned.
*/
- QVariant getOption(const QString name, QVariant defaultvalue = QVariant(), bool recursive = false);
+ TQVariant getOption(const TQString name, TQVariant defaultvalue = TQVariant(), bool recursive = false);
/**
* Set the \a Interpreter::Option value.
*/
- bool setOption(const QString name, const QVariant& value);
+ bool setOption(const TQString name, const TQVariant& value);
/**
* Execute the script container.
@@ -159,7 +159,7 @@ namespace Kross { namespace Api {
* Return a list of functionnames the with
* \a setCode defined scriptcode spends.
*/
- const QStringList getFunctionNames();
+ const TQStringList getFunctionNames();
/**
* Call a function in the script container.
@@ -171,17 +171,17 @@ namespace Kross { namespace Api {
* \return \a Object instance representing
* the functioncall returnvalue.
*/
- KSharedPtr<Object> callFunction(const QString& functionname, KSharedPtr<List> arguments = 0);
+ KSharedPtr<Object> callFunction(const TQString& functionname, KSharedPtr<List> arguments = 0);
/**
* Return a list of classes.
*/
- QStringList getClassNames();
+ TQStringList getClassNames();
/**
* Create and return a new class instance.
*/
- KSharedPtr<Object> classInstance(const QString& classname);
+ KSharedPtr<Object> classInstance(const TQString& classname);
/**
* Initialize the \a Script instance.
diff --git a/lib/kross/main/scriptguiclient.cpp b/lib/kross/main/scriptguiclient.cpp
index 28a89015..36d81151 100644
--- a/lib/kross/main/scriptguiclient.cpp
+++ b/lib/kross/main/scriptguiclient.cpp
@@ -44,49 +44,49 @@ namespace Kross { namespace Api {
{
public:
/**
- * The \a KXMLGUIClient that is parent of the \a ScriptGUIClient
+ * The \a KXMLGUIClient that is tqparent of the \a ScriptGUIClient
* instance.
*/
KXMLGUIClient* guiclient;
/**
- * The optional parent QWidget widget.
+ * The optional tqparent TQWidget widget.
*/
- QWidget* parent;
+ TQWidget* tqparent;
/**
* Map of \a ScriptActionCollection instances the \a ScriptGUIClient
* is attached to.
*/
- QMap<QString, ScriptActionCollection*> collections;
+ TQMap<TQString, ScriptActionCollection*> collections;
};
}}
-ScriptGUIClient::ScriptGUIClient(KXMLGUIClient* guiclient, QWidget* parent)
- : QObject( parent )
+ScriptGUIClient::ScriptGUIClient(KXMLGUIClient* guiclient, TQWidget* tqparent)
+ : TQObject( tqparent )
, KXMLGUIClient( guiclient )
, d( new ScriptGUIClientPrivate() ) // initialize d-pointer class
{
- krossdebug( QString("ScriptGUIClient::ScriptGUIClient() Ctor") );
+ krossdebug( TQString("ScriptGUIClient::ScriptGUIClient() Ctor") );
d->guiclient = guiclient;
- d->parent = parent;
+ d->tqparent = tqparent;
setInstance( ScriptGUIClient::instance() );
// action to execute a scriptfile.
- new KAction(i18n("Execute Script File..."), 0, 0, this, SLOT(executeScriptFile()), actionCollection(), "executescriptfile");
+ new KAction(i18n("Execute Script File..."), 0, 0, this, TQT_SLOT(executeScriptFile()), actionCollection(), "executescriptfile");
// acion to show the ScriptManagerGUI dialog.
- new KAction(i18n("Scripts Manager..."), 0, 0, this, SLOT(showScriptManager()), actionCollection(), "configurescripts");
+ new KAction(i18n("Scripts Manager..."), 0, 0, this, TQT_SLOT(showScriptManager()), actionCollection(), "configurescripts");
// The predefined ScriptActionCollection's this ScriptGUIClient provides.
- d->collections.replace("installedscripts",
+ d->collections.tqreplace("installedscripts",
new ScriptActionCollection(i18n("Scripts"), actionCollection(), "installedscripts") );
- d->collections.replace("loadedscripts",
+ d->collections.tqreplace("loadedscripts",
new ScriptActionCollection(i18n("Loaded"), actionCollection(), "loadedscripts") );
- d->collections.replace("executedscripts",
+ d->collections.tqreplace("executedscripts",
new ScriptActionCollection(i18n("History"), actionCollection(), "executedscripts") );
reloadInstalledScripts();
@@ -94,36 +94,36 @@ ScriptGUIClient::ScriptGUIClient(KXMLGUIClient* guiclient, QWidget* parent)
ScriptGUIClient::~ScriptGUIClient()
{
- krossdebug( QString("ScriptGUIClient::~ScriptGUIClient() Dtor") );
- for(QMap<QString, ScriptActionCollection*>::Iterator it = d->collections.begin(); it != d->collections.end(); ++it)
+ krossdebug( TQString("ScriptGUIClient::~ScriptGUIClient() Dtor") );
+ for(TQMap<TQString, ScriptActionCollection*>::Iterator it = d->collections.begin(); it != d->collections.end(); ++it)
delete it.data();
delete d;
}
-bool ScriptGUIClient::hasActionCollection(const QString& name)
+bool ScriptGUIClient::hasActionCollection(const TQString& name)
{
- return d->collections.contains(name);
+ return d->collections.tqcontains(name);
}
-ScriptActionCollection* ScriptGUIClient::getActionCollection(const QString& name)
+ScriptActionCollection* ScriptGUIClient::getActionCollection(const TQString& name)
{
return d->collections[name];
}
-QMap<QString, ScriptActionCollection*> ScriptGUIClient::getActionCollections()
+TQMap<TQString, ScriptActionCollection*> ScriptGUIClient::getActionCollections()
{
return d->collections;
}
-void ScriptGUIClient::addActionCollection(const QString& name, ScriptActionCollection* collection)
+void ScriptGUIClient::addActionCollection(const TQString& name, ScriptActionCollection* collection)
{
removeActionCollection(name);
- d->collections.replace(name, collection);
+ d->collections.tqreplace(name, collection);
}
-bool ScriptGUIClient::removeActionCollection(const QString& name)
+bool ScriptGUIClient::removeActionCollection(const TQString& name)
{
- if(d->collections.contains(name)) {
+ if(d->collections.tqcontains(name)) {
ScriptActionCollection* c = d->collections[name];
d->collections.remove(name);
delete c;
@@ -138,46 +138,46 @@ void ScriptGUIClient::reloadInstalledScripts()
if(installedcollection)
installedcollection->clear();
- QCString partname = d->guiclient->instance()->instanceName();
- QStringList files = KGlobal::dirs()->findAllResources("data", partname + "/scripts/*/*.rc");
+ TQCString partname = d->guiclient->instance()->instanceName();
+ TQStringList files = KGlobal::dirs()->findAllResources("data", partname + "/scripts/*/*.rc");
//files.sort();
- for(QStringList::iterator it = files.begin(); it != files.end(); ++it)
+ for(TQStringList::iterator it = files.begin(); it != files.end(); ++it)
loadScriptConfigFile(*it);
}
-bool ScriptGUIClient::installScriptPackage(const QString& scriptpackagefile)
+bool ScriptGUIClient::installScriptPackage(const TQString& scriptpackagefile)
{
- krossdebug( QString("Install script package: %1").arg(scriptpackagefile) );
+ krossdebug( TQString("Install script package: %1").tqarg(scriptpackagefile) );
KTar archive( scriptpackagefile );
if(! archive.open(IO_ReadOnly)) {
- KMessageBox::sorry(0, i18n("Could not read the package \"%1\".").arg(scriptpackagefile));
+ KMessageBox::sorry(0, i18n("Could not read the package \"%1\".").tqarg(scriptpackagefile));
return false;
}
- QCString partname = d->guiclient->instance()->instanceName();
- QString destination = KGlobal::dirs()->saveLocation("data", partname + "/scripts/", true);
- //QString destination = KGlobal::dirs()->saveLocation("appdata", "scripts", true);
+ TQCString partname = d->guiclient->instance()->instanceName();
+ TQString destination = KGlobal::dirs()->saveLocation("data", partname + "/scripts/", true);
+ //TQString destination = KGlobal::dirs()->saveLocation("appdata", "scripts", true);
if(destination.isNull()) {
krosswarning("ScriptGUIClient::installScriptPackage() Failed to determinate location where the scriptpackage should be installed to!");
return false;
}
- QString packagename = QFileInfo(scriptpackagefile).baseName();
+ TQString packagename = TQFileInfo(scriptpackagefile).baseName();
destination += packagename; // add the packagename to the name of the destination-directory.
- if( QDir(destination).exists() ) {
+ if( TQDir(destination).exists() ) {
if( KMessageBox::warningContinueCancel(0,
- i18n("A script package with the name \"%1\" already exists. Replace this package?" ).arg(packagename),
+ i18n("A script package with the name \"%1\" already exists. Replace this package?" ).tqarg(packagename),
i18n("Replace")) != KMessageBox::Continue )
return false;
if(! KIO::NetAccess::del(destination, 0) ) {
- KMessageBox::sorry(0, i18n("Could not uninstall this script package. You may not have sufficient permissions to delete the folder \"%1\".").arg(destination));
+ KMessageBox::sorry(0, i18n("Could not uninstall this script package. You may not have sufficient permissions to delete the folder \"%1\".").tqarg(destination));
return false;
}
}
- krossdebug( QString("Copy script-package to destination directory: %1").arg(destination) );
+ krossdebug( TQString("Copy script-package to destination directory: %1").tqarg(destination) );
const KArchiveDirectory* archivedir = archive.directory();
archivedir->copyTo(destination, true);
@@ -185,40 +185,40 @@ bool ScriptGUIClient::installScriptPackage(const QString& scriptpackagefile)
return true;
}
-bool ScriptGUIClient::uninstallScriptPackage(const QString& scriptpackagepath)
+bool ScriptGUIClient::uninstallScriptPackage(const TQString& scriptpackagepath)
{
if(! KIO::NetAccess::del(scriptpackagepath, 0) ) {
- KMessageBox::sorry(0, i18n("Could not uninstall this script package. You may not have sufficient permissions to delete the folder \"%1\".").arg(scriptpackagepath));
+ KMessageBox::sorry(0, i18n("Could not uninstall this script package. You may not have sufficient permissions to delete the folder \"%1\".").tqarg(scriptpackagepath));
return false;
}
reloadInstalledScripts();
return true;
}
-bool ScriptGUIClient::loadScriptConfigFile(const QString& scriptconfigfile)
+bool ScriptGUIClient::loadScriptConfigFile(const TQString& scriptconfigfile)
{
- krossdebug( QString("ScriptGUIClient::loadScriptConfig file=%1").arg(scriptconfigfile) );
+ krossdebug( TQString("ScriptGUIClient::loadScriptConfig file=%1").tqarg(scriptconfigfile) );
- QDomDocument domdoc;
- QFile file(scriptconfigfile);
+ TQDomDocument domdoc;
+ TQFile file(scriptconfigfile);
if(! file.open(IO_ReadOnly)) {
- krosswarning( QString("ScriptGUIClient::loadScriptConfig(): Failed to read scriptconfigfile: %1").arg(scriptconfigfile) );
+ krosswarning( TQString("ScriptGUIClient::loadScriptConfig(): Failed to read scriptconfigfile: %1").tqarg(scriptconfigfile) );
return false;
}
bool ok = domdoc.setContent(&file);
file.close();
if(! ok) {
- krosswarning( QString("ScriptGUIClient::loadScriptConfig(): Failed to parse scriptconfigfile: %1").arg(scriptconfigfile) );
+ krosswarning( TQString("ScriptGUIClient::loadScriptConfig(): Failed to parse scriptconfigfile: %1").tqarg(scriptconfigfile) );
return false;
}
return loadScriptConfigDocument(scriptconfigfile, domdoc);
}
-bool ScriptGUIClient::loadScriptConfigDocument(const QString& scriptconfigfile, const QDomDocument &document)
+bool ScriptGUIClient::loadScriptConfigDocument(const TQString& scriptconfigfile, const TQDomDocument &document)
{
ScriptActionCollection* installedcollection = d->collections["installedscripts"];
- QDomNodeList nodelist = document.elementsByTagName("ScriptAction");
+ TQDomNodeList nodelist = document.elementsByTagName("ScriptAction");
uint nodelistcount = nodelist.count();
for(uint i = 0; i < nodelistcount; i++) {
ScriptAction::Ptr action = new ScriptAction(scriptconfigfile, nodelist.item(i).toElement());
@@ -244,28 +244,28 @@ bool ScriptGUIClient::loadScriptConfigDocument(const QString& scriptconfigfile,
else {
// else just print a warning and fall through (so, install the action
// and don't care any longer of the duplicated name)...
- krosswarning( QString("Kross::Api::ScriptGUIClient::loadScriptConfigDocument: There exists already a scriptaction with name \"%1\". Added anyway...").arg(action->name()) );
+ krosswarning( TQString("Kross::Api::ScriptGUIClient::loadScriptConfigDocument: There exists already a scriptaction with name \"%1\". Added anyway...").tqarg(action->name()) );
}
}
installedcollection->attach( action );
}
- connect(action.data(), SIGNAL( failed(const QString&, const QString&) ),
- this, SLOT( executionFailed(const QString&, const QString&) ));
- connect(action.data(), SIGNAL( success() ),
- this, SLOT( successfullyExecuted() ));
- connect(action.data(), SIGNAL( activated(const Kross::Api::ScriptAction*) ), SIGNAL( executionStarted(const Kross::Api::ScriptAction*)));
+ connect(action.data(), TQT_SIGNAL( failed(const TQString&, const TQString&) ),
+ this, TQT_SLOT( executionFailed(const TQString&, const TQString&) ));
+ connect(action.data(), TQT_SIGNAL( success() ),
+ this, TQT_SLOT( successfullyExecuted() ));
+ connect(action.data(), TQT_SIGNAL( activated(const Kross::Api::ScriptAction*) ), TQT_SIGNAL( executionStarted(const Kross::Api::ScriptAction*)));
}
emit collectionChanged(installedcollection);
return true;
}
-void ScriptGUIClient::setXMLFile(const QString& file, bool merge, bool setXMLDoc)
+void ScriptGUIClient::setXMLFile(const TQString& file, bool merge, bool setXMLDoc)
{
KXMLGUIClient::setXMLFile(file, merge, setXMLDoc);
}
-void ScriptGUIClient::setDOMDocument(const QDomDocument &document, bool merge)
+void ScriptGUIClient::setDOMDocument(const TQDomDocument &document, bool merge)
{
ScriptActionCollection* installedcollection = d->collections["installedscripts"];
if(! merge && installedcollection)
@@ -277,7 +277,7 @@ void ScriptGUIClient::setDOMDocument(const QDomDocument &document, bool merge)
void ScriptGUIClient::successfullyExecuted()
{
- const ScriptAction* action = dynamic_cast< const ScriptAction* >( QObject::sender() );
+ const ScriptAction* action = dynamic_cast< const ScriptAction* >( TQObject::sender() );
if(action) {
emit executionFinished(action);
ScriptActionCollection* executedcollection = d->collections["executedscripts"];
@@ -290,9 +290,9 @@ void ScriptGUIClient::successfullyExecuted()
}
}
-void ScriptGUIClient::executionFailed(const QString& errormessage, const QString& tracedetails)
+void ScriptGUIClient::executionFailed(const TQString& errormessage, const TQString& tracedetails)
{
- const ScriptAction* action = dynamic_cast< const ScriptAction* >( QObject::sender() );
+ const ScriptAction* action = dynamic_cast< const ScriptAction* >( TQObject::sender() );
if(action)
emit executionFinished(action);
if(tracedetails.isEmpty())
@@ -301,17 +301,17 @@ void ScriptGUIClient::executionFailed(const QString& errormessage, const QString
KMessageBox::detailedError(0, errormessage, tracedetails);
}
-KURL ScriptGUIClient::openScriptFile(const QString& caption)
+KURL ScriptGUIClient::openScriptFile(const TQString& caption)
{
- QStringList mimetypes;
- QMap<QString, InterpreterInfo*> infos = Manager::scriptManager()->getInterpreterInfos();
- for(QMap<QString, InterpreterInfo*>::Iterator it = infos.begin(); it != infos.end(); ++it)
+ TQStringList mimetypes;
+ TQMap<TQString, InterpreterInfo*> infos = Manager::scriptManager()->getInterpreterInfos();
+ for(TQMap<TQString, InterpreterInfo*>::Iterator it = infos.begin(); it != infos.end(); ++it)
mimetypes.append( it.data()->getMimeTypes().join(" ").stripWhiteSpace() );
KFileDialog* filedialog = new KFileDialog(
- QString::null, // startdir
+ TQString(), // startdir
mimetypes.join(" "), // filter
- 0, // parent widget
+ 0, // tqparent widget
"ScriptGUIClientFileDialog", // name
true // modal
);
@@ -329,11 +329,11 @@ bool ScriptGUIClient::loadScriptFile()
ScriptActionCollection* loadedcollection = d->collections["loadedscripts"];
if(loadedcollection) {
ScriptAction::Ptr action = new ScriptAction( url.path() );
- connect(action.data(), SIGNAL( failed(const QString&, const QString&) ),
- this, SLOT( executionFailed(const QString&, const QString&) ));
- connect(action.data(), SIGNAL( success() ),
- this, SLOT( successfullyExecuted() ));
- connect(action.data(), SIGNAL( activated(const Kross::Api::ScriptAction*) ), SIGNAL( executionStarted(const Kross::Api::ScriptAction*)));
+ connect(action.data(), TQT_SIGNAL( failed(const TQString&, const TQString&) ),
+ this, TQT_SLOT( executionFailed(const TQString&, const TQString&) ));
+ connect(action.data(), TQT_SIGNAL( success() ),
+ this, TQT_SLOT( successfullyExecuted() ));
+ connect(action.data(), TQT_SIGNAL( activated(const Kross::Api::ScriptAction*) ), TQT_SIGNAL( executionStarted(const Kross::Api::ScriptAction*)));
loadedcollection->detach(action);
loadedcollection->attach(action);
@@ -351,9 +351,9 @@ bool ScriptGUIClient::executeScriptFile()
return false;
}
-bool ScriptGUIClient::executeScriptFile(const QString& file)
+bool ScriptGUIClient::executeScriptFile(const TQString& file)
{
- krossdebug( QString("Kross::Api::ScriptGUIClient::executeScriptFile() file='%1'").arg(file) );
+ krossdebug( TQString("Kross::Api::ScriptGUIClient::executeScriptFile() file='%1'").tqarg(file) );
ScriptAction::Ptr action = new ScriptAction(file);
return executeScriptAction(action);
@@ -361,11 +361,11 @@ bool ScriptGUIClient::executeScriptFile(const QString& file)
bool ScriptGUIClient::executeScriptAction(ScriptAction::Ptr action)
{
- connect(action.data(), SIGNAL( failed(const QString&, const QString&) ),
- this, SLOT( executionFailed(const QString&, const QString&) ));
- connect(action.data(), SIGNAL( success() ),
- this, SLOT( successfullyExecuted() ));
- connect(action.data(), SIGNAL( activated(const Kross::Api::ScriptAction*) ), SIGNAL( executionStarted(const Kross::Api::ScriptAction*)));
+ connect(action.data(), TQT_SIGNAL( failed(const TQString&, const TQString&) ),
+ this, TQT_SLOT( executionFailed(const TQString&, const TQString&) ));
+ connect(action.data(), TQT_SIGNAL( success() ),
+ this, TQT_SLOT( successfullyExecuted() ));
+ connect(action.data(), TQT_SIGNAL( activated(const Kross::Api::ScriptAction*) ), TQT_SIGNAL( executionStarted(const Kross::Api::ScriptAction*)));
action->activate();
bool ok = action->hadException();
action->finalize(); // execution is done.
@@ -374,10 +374,10 @@ bool ScriptGUIClient::executeScriptAction(ScriptAction::Ptr action)
void ScriptGUIClient::showScriptManager()
{
- KDialogBase* dialog = new KDialogBase(d->parent, "", true, i18n("Scripts Manager"), KDialogBase::Close);
+ KDialogBase* dialog = new KDialogBase(d->tqparent, "", true, i18n("Scripts Manager"), KDialogBase::Close);
WdgScriptsManager* wsm = new WdgScriptsManager(this, dialog);
dialog->setMainWidget(wsm);
- dialog->resize( QSize(360, 320).expandedTo(dialog->minimumSizeHint()) );
+ dialog->resize( TQSize(360, 320).expandedTo(dialog->tqminimumSizeHint()) );
dialog->show();
}
diff --git a/lib/kross/main/scriptguiclient.h b/lib/kross/main/scriptguiclient.h
index 955b55d9..af762720 100644
--- a/lib/kross/main/scriptguiclient.h
+++ b/lib/kross/main/scriptguiclient.h
@@ -23,12 +23,12 @@
#include "scriptcontainer.h"
#include "scriptaction.h"
-#include <qobject.h>
-#include <qdom.h>
+#include <tqobject.h>
+#include <tqdom.h>
#include <kurl.h>
#include <kxmlguiclient.h>
-class QWdiget;
+class TQWdiget;
namespace Kross { namespace Api {
@@ -41,28 +41,29 @@ namespace Kross { namespace Api {
* scripting code used to extend an applications functionality.
*/
class KDE_EXPORT ScriptGUIClient
- : public QObject
+ : public TQObject
, public KXMLGUIClient
{
Q_OBJECT
- //Q_PROPERTY(QString configfile READ getConfigFile WRITE setConfigFile)
+ TQ_OBJECT
+ //TQ_PROPERTY(TQString configfile READ getConfigFile WRITE setConfigFile)
public:
/// List of KAction instances.
- typedef QPtrList<KAction> List;
+ typedef TQPtrList<KAction> List;
/**
* Constructor.
*
* \param guiclient The KXMLGUIClient this \a ScriptGUIClient
* is a child of.
- * \param parent The parent QWidget. If defined Qt will handle
+ * \param tqparent The tqparent TQWidget. If defined TQt will handle
* freeing this \a ScriptGUIClient instance else the
* caller has to take care of freeing this instance
* if not needed any longer.
*/
- explicit ScriptGUIClient(KXMLGUIClient* guiclient, QWidget* parent = 0);
+ explicit ScriptGUIClient(KXMLGUIClient* guiclient, TQWidget* tqparent = 0);
/**
* Destructor.
@@ -73,13 +74,13 @@ namespace Kross { namespace Api {
* \return true if this \a ScriptGUIClient has a \a ScriptActionCollection
* with the name \p name else false is returned.
*/
- bool hasActionCollection(const QString& name);
+ bool hasActionCollection(const TQString& name);
/**
* \return the \a ScriptActionCollection which has the name \p name
* or NULL if there exists no such \a ScriptActionCollection .
*/
- ScriptActionCollection* getActionCollection(const QString& name);
+ ScriptActionCollection* getActionCollection(const TQString& name);
/**
* \return a map of all avaiable \a ScriptActionCollection instances
@@ -88,18 +89,18 @@ namespace Kross { namespace Api {
* 1. "installedscripts" The installed collection of scripts.
* 2. "loadedscripts" The loaded scripts.
*/
- QMap<QString, ScriptActionCollection*> getActionCollections();
+ TQMap<TQString, ScriptActionCollection*> getActionCollections();
/**
* Add a new \a ScriptActionCollection with the name \p name to
* our map of actioncollections.
*/
- void addActionCollection(const QString& name, ScriptActionCollection* collection);
+ void addActionCollection(const TQString& name, ScriptActionCollection* collection);
/**
* Remove the \a ScriptActionCollection defined with name \p name.
*/
- bool removeActionCollection(const QString& name);
+ bool removeActionCollection(const TQString& name);
/**
* Reload the list of installed scripts.
@@ -111,33 +112,33 @@ namespace Kross { namespace Api {
* packagefile should be a tar.gz-archive which will be
* extracted and to the users script-directory.
*/
- bool installScriptPackage(const QString& scriptpackagefile);
+ bool installScriptPackage(const TQString& scriptpackagefile);
/**
* Uninstall the scriptpackage located in the path
* \p scriptpackagepath . This just deletes the whole
* directory.
*/
- bool uninstallScriptPackage(const QString& scriptpackagepath);
+ bool uninstallScriptPackage(const TQString& scriptpackagepath);
/**
* Load the scriptpackage's configurationfile
* \p scriptconfigfile and add the defined \a ScriptAction
* instances to the list of installed scripts.
*/
- bool loadScriptConfigFile(const QString& scriptconfigfile);
+ bool loadScriptConfigFile(const TQString& scriptconfigfile);
/**
* Load the \p document DOM-document from the scriptpackage's
* XML-configfile \p scriptconfigfile and add the defined
* \a ScriptAction instances to the list of installed scripts.
*/
- bool loadScriptConfigDocument(const QString& scriptconfigfile, const QDomDocument &document);
+ bool loadScriptConfigDocument(const TQString& scriptconfigfile, const TQDomDocument &document);
/// KXMLGUIClient overloaded method to set the XML file.
- virtual void setXMLFile(const QString& file, bool merge = false, bool setXMLDoc = true);
+ virtual void setXMLFile(const TQString& file, bool merge = false, bool setXMLDoc = true);
/// KXMLGUIClient overloaded method to set the XML DOM-document.
- virtual void setDOMDocument(const QDomDocument &document, bool merge = false);
+ virtual void setDOMDocument(const TQDomDocument &document, bool merge = false);
public slots:
@@ -145,7 +146,7 @@ namespace Kross { namespace Api {
* A KFileDialog will be displayed to let the user choose
* a scriptfile. The choosen file will be returned as KURL.
*/
- KURL openScriptFile(const QString& caption = QString::null);
+ KURL openScriptFile(const TQString& caption = TQString());
/**
* A KFileDialog will be displayed to let the user choose
@@ -168,7 +169,7 @@ namespace Kross { namespace Api {
* the defined filename to auto-detect the \a Interpreter which
* should be used for the execution.
*/
- bool executeScriptFile(const QString& file);
+ bool executeScriptFile(const TQString& file);
/**
* This method executes the \a ScriptAction \p action .
@@ -189,7 +190,7 @@ namespace Kross { namespace Api {
* Called if execution of this \a ScriptAction failed and
* displays an errormessage-dialog.
*/
- void executionFailed(const QString& errormessage, const QString& tracedetails);
+ void executionFailed(const TQString& errormessage, const TQString& tracedetails);
/**
* Called if execution of this \a ScriptAction was
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");
}
}}
diff --git a/lib/kross/main/wdgscriptsmanager.h b/lib/kross/main/wdgscriptsmanager.h
index 031d5b3c..b953f862 100644
--- a/lib/kross/main/wdgscriptsmanager.h
+++ b/lib/kross/main/wdgscriptsmanager.h
@@ -35,8 +35,9 @@ class WdgScriptsManagerPrivate;
class WdgScriptsManager : public WdgScriptsManagerBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- WdgScriptsManager(ScriptGUIClient* scr, QWidget* parent = 0, const char* name = 0, WFlags fl = 0);
+ WdgScriptsManager(ScriptGUIClient* scr, TQWidget* tqparent = 0, const char* name = 0, WFlags fl = 0);
~WdgScriptsManager();
public slots:
void slotLoadScript();
@@ -45,14 +46,14 @@ class WdgScriptsManager : public WdgScriptsManagerBase
void slotExecuteScript();
void slotUnloadScript();
void slotGetNewScript();
- void slotSelectionChanged(QListViewItem*);
+ void slotSelectionChanged(TQListViewItem*);
private slots:
void slotFillScriptsList();
void slotResourceInstalled();
private:
WdgScriptsManagerPrivate* d;
void addItem(ScriptActionCollection* collection);
- QListViewItem* addItem(ScriptAction::Ptr, QListViewItem* parentitem, QListViewItem* afteritem);
+ TQListViewItem* addItem(ScriptAction::Ptr, TQListViewItem* tqparentitem, TQListViewItem* afteritem);
};
}}
diff --git a/lib/kross/main/wdgscriptsmanagerbase.ui b/lib/kross/main/wdgscriptsmanagerbase.ui
index 18ab2b23..22ad3867 100644
--- a/lib/kross/main/wdgscriptsmanagerbase.ui
+++ b/lib/kross/main/wdgscriptsmanagerbase.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>WdgScriptsManagerBase</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>WdgScriptsManagerBase</cstring>
</property>
@@ -20,7 +20,7 @@
<verstretch>0</verstretch>
</sizepolicy>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>0</width>
<height>0</height>
@@ -54,9 +54,9 @@
<cstring>toolBar</cstring>
</property>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout1</cstring>
+ <cstring>tqlayout1</cstring>
</property>
<hbox>
<property name="name">
@@ -66,7 +66,7 @@
<property name="name">
<cstring>btnExec</cstring>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>20</width>
<height>0</height>
@@ -97,7 +97,7 @@
<property name="name">
<cstring>btnLoad</cstring>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>20</width>
<height>0</height>
@@ -114,7 +114,7 @@
<property name="name">
<cstring>btnUnload</cstring>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>20</width>
<height>0</height>
@@ -145,7 +145,7 @@
<property name="name">
<cstring>btnInstall</cstring>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>20</width>
<height>0</height>
@@ -162,7 +162,7 @@
<property name="name">
<cstring>btnUninstall</cstring>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>20</width>
<height>0</height>
@@ -193,7 +193,7 @@
<property name="name">
<cstring>btnNewStuff</cstring>
</property>
- <property name="minimumSize">
+ <property name="tqminimumSize">
<size>
<width>20</width>
<height>0</height>
@@ -233,7 +233,7 @@
<data format="XBM.GZ" length="79">789c534e494dcbcc4b554829cdcdad8c2fcf4c29c95030e0524611cd48cd4ccf28010a1797249664262b2467241641a592324b8aa363156c15aab914146aadb90067111b1f</data>
</image>
</images>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>klistview.h</includehint>
<includehint>ktoolbar.h</includehint>