summaryrefslogtreecommitdiffstats
path: root/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.cpp')
-rw-r--r--kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.cpp104
1 files changed, 52 insertions, 52 deletions
diff --git a/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.cpp b/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.cpp
index ff2f93d0..0c95cb0e 100644
--- a/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.cpp
+++ b/kexi/plugins/scripting/kexiscripting/kexiscriptdesignview.cpp
@@ -28,12 +28,12 @@
#include <kross/main/scriptaction.h>
#include <kross/api/interpreter.h>
-#include <qlayout.h>
-#include <qsplitter.h>
-#include <qtimer.h>
-#include <qdatetime.h>
-#include <qdom.h>
-#include <qstylesheet.h>
+#include <tqlayout.h>
+#include <tqsplitter.h>
+#include <tqtimer.h>
+#include <tqdatetime.h>
+#include <tqdom.h>
+#include <tqstylesheet.h>
#include <ktextbrowser.h>
#include <kdebug.h>
@@ -64,17 +64,17 @@ class KexiScriptDesignViewPrivate
KTextBrowser* statusbrowser;
};
-KexiScriptDesignView::KexiScriptDesignView(KexiMainWindow *mainWin, QWidget *parent, Kross::Api::ScriptAction* scriptaction)
- : KexiViewBase(mainWin, parent, "KexiScriptDesignView")
+KexiScriptDesignView::KexiScriptDesignView(KexiMainWindow *mainWin, TQWidget *tqparent, Kross::Api::ScriptAction* scriptaction)
+ : KexiViewBase(mainWin, tqparent, "KexiScriptDesignView")
, d( new KexiScriptDesignViewPrivate() )
{
d->scriptaction = scriptaction;
d->updatesProperties = false;
- QSplitter* splitter = new QSplitter(this);
- splitter->setOrientation(Vertical);
- QHBoxLayout* layout = new QHBoxLayout(this);
- layout->addWidget(splitter);
+ TQSplitter* splitter = new TQSplitter(this);
+ splitter->setOrientation(Qt::Vertical);
+ TQHBoxLayout* tqlayout = new TQHBoxLayout(this);
+ tqlayout->addWidget(splitter);
d->editor = new KexiScriptEditor(mainWin, splitter, "ScriptEditor");
splitter->setFocusProxy(d->editor);
@@ -83,23 +83,23 @@ KexiScriptDesignView::KexiScriptDesignView(KexiMainWindow *mainWin, QWidget *par
d->statusbrowser = new KTextBrowser(splitter, "ScriptStatusBrowser");
d->statusbrowser->setReadOnly(true);
- d->statusbrowser->setTextFormat(QTextBrowser::RichText);
- //d->browser->setWordWrap(QTextEdit::WidgetWidth);
+ d->statusbrowser->setTextFormat(TQTextBrowser::RichText);
+ //d->browser->setWordWrap(TQTextEdit::WidgetWidth);
d->statusbrowser->installEventFilter(this);
- splitter->setResizeMode(d->statusbrowser, QSplitter::KeepSize);
+ splitter->setResizeMode(d->statusbrowser, TQSplitter::KeepSize);
- plugSharedAction( "data_execute", this, SLOT(execute()) );
+ plugSharedAction( "data_execute", TQT_TQOBJECT(this), TQT_SLOT(execute()) );
if(KexiEditor::isAdvancedEditor()) // the configeditor is only in advanced mode avaiable.
- plugSharedAction( "script_config_editor", d->editor, SLOT(slotConfigureEditor()) );
+ plugSharedAction( "script_config_editor", TQT_TQOBJECT(d->editor), TQT_SLOT(slotConfigureEditor()) );
loadData();
- d->properties = new KoProperty::Set(this, "KexiScripting");
- connect(d->properties, SIGNAL( propertyChanged(KoProperty::Set&, KoProperty::Property&) ),
- this, SLOT( slotPropertyChanged(KoProperty::Set&, KoProperty::Property&) ));
+ d->properties = new KoProperty::Set(TQT_TQOBJECT(this), "KexiScripting");
+ connect(d->properties, TQT_SIGNAL( propertyChanged(KoProperty::Set&, KoProperty::Property&) ),
+ this, TQT_SLOT( slotPropertyChanged(KoProperty::Set&, KoProperty::Property&) ));
// To schedule the initialize fixes a crasher in Kate.
- QTimer::singleShot(50, this, SLOT( initialize() ));
+ TQTimer::singleShot(50, this, TQT_SLOT( initialize() ));
}
KexiScriptDesignView::~KexiScriptDesignView()
@@ -127,14 +127,14 @@ void KexiScriptDesignView::updateProperties()
Kross::Api::Manager* manager = Kross::Api::Manager::scriptManager();
- QString interpretername = d->scriptaction->getInterpreterName();
+ TQString interpretername = d->scriptaction->getInterpreterName();
Kross::Api::InterpreterInfo* info = interpretername.isEmpty() ? 0 : manager->getInterpreterInfo(interpretername);
{
// if interpreter isn't defined or invalid, try to fallback.
- QStringList list;
+ TQStringList list;
list << "python" << "ruby";
- QStringList::ConstIterator it( list.constBegin() ), end( list.constEnd() );
+ TQStringList::ConstIterator it( list.constBegin() ), end( list.constEnd() );
while( (! info) && (it != end) ) {
interpretername = (*it);
info = manager->getInterpreterInfo(interpretername);
@@ -147,7 +147,7 @@ void KexiScriptDesignView::updateProperties()
if(info) {
d->properties->clear();
- QStringList interpreters = manager->getInterpreters();
+ TQStringList interpreters = manager->getInterpreters();
KoProperty::Property::ListData* proplist = new KoProperty::Property::ListData(interpreters, interpreters);
KoProperty::Property* prop = new KoProperty::Property(
"language", // name
@@ -190,8 +190,8 @@ void KexiScriptDesignView::slotPropertyChanged(KoProperty::Set& /*set*/, KoPrope
return;
if(property.name() == "language") {
- QString language = property.value().toString();
- kdDebug() << QString("KexiScriptDesignView::slotPropertyChanged() language=%1").arg(language) << endl;
+ TQString language = property.value().toString();
+ kdDebug() << TQString("KexiScriptDesignView::slotPropertyChanged() language=%1").tqarg(language) << endl;
d->scriptaction->setInterpreterName( language );
// We assume Kross and the HighlightingInterface are using same
// names for the support languages...
@@ -201,7 +201,7 @@ void KexiScriptDesignView::slotPropertyChanged(KoProperty::Set& /*set*/, KoPrope
else {
bool ok = d->scriptaction->setOption( property.name(), property.value() );
if(! ok) {
- kdWarning() << QString("KexiScriptDesignView::slotPropertyChanged() unknown property '%1'.").arg(property.name()) << endl;
+ kdWarning() << TQString("KexiScriptDesignView::slotPropertyChanged() unknown property '%1'.").tqarg(TQString(property.name())) << endl;
return;
}
}
@@ -212,40 +212,40 @@ void KexiScriptDesignView::slotPropertyChanged(KoProperty::Set& /*set*/, KoPrope
void KexiScriptDesignView::execute()
{
d->statusbrowser->clear();
- QTime time;
+ TQTime time;
time.start();
- d->statusbrowser->append( i18n("Execution of the script \"%1\" started.").arg(d->scriptaction->name()) );
+ d->statusbrowser->append( i18n("Execution of the script \"%1\" started.").tqarg(d->scriptaction->name()) );
d->scriptaction->activate();
if( d->scriptaction->hadException() ) {
- QString errormessage = d->scriptaction->getException()->getError();
- d->statusbrowser->append(QString("<b>%2</b><br>").arg(QStyleSheet::escape(errormessage)) );
+ TQString errormessage = d->scriptaction->getException()->getError();
+ d->statusbrowser->append(TQString("<b>%2</b><br>").tqarg(TQStyleSheet::escape(errormessage)) );
- QString tracedetails = d->scriptaction->getException()->getTrace();
- d->statusbrowser->append( QStyleSheet::escape(tracedetails) );
+ TQString tracedetails = d->scriptaction->getException()->getTrace();
+ d->statusbrowser->append( TQStyleSheet::escape(tracedetails) );
long lineno = d->scriptaction->getException()->getLineNo();
if(lineno >= 0)
d->editor->setLineNo(lineno);
}
else {
- d->statusbrowser->append( i18n("Successfully executed. Time elapsed: %1ms").arg(time.elapsed()) );
+ d->statusbrowser->append( i18n("Successfully executed. Time elapsed: %1ms").tqarg(time.elapsed()) );
}
}
bool KexiScriptDesignView::loadData()
{
- QString data;
+ TQString data;
if(! loadDataBlock(data)) {
kexipluginsdbg << "KexiScriptDesignView::loadData(): no DataBlock" << endl;
return false;
}
- QString errMsg;
+ TQString errMsg;
int errLine;
int errCol;
- QDomDocument domdoc;
+ TQDomDocument domdoc;
bool parsed = domdoc.setContent(data, false, &errMsg, &errLine, &errCol);
if(! parsed) {
@@ -253,13 +253,13 @@ bool KexiScriptDesignView::loadData()
return false;
}
- QDomElement scriptelem = domdoc.namedItem("script").toElement();
+ TQDomElement scriptelem = domdoc.namedItem("script").toElement();
if(scriptelem.isNull()) {
kexipluginsdbg << "KexiScriptDesignView::loadData(): script domelement is null" << endl;
return false;
}
- QString interpretername = scriptelem.attribute("language");
+ TQString interpretername = scriptelem.attribute("language");
Kross::Api::Manager* manager = Kross::Api::Manager::scriptManager();
Kross::Api::InterpreterInfo* info = interpretername.isEmpty() ? 0 : manager->getInterpreterInfo(interpretername);
if(info) {
@@ -268,10 +268,10 @@ bool KexiScriptDesignView::loadData()
Kross::Api::InterpreterInfo::Option::Map options = info->getOptions();
Kross::Api::InterpreterInfo::Option::Map::ConstIterator it, end = options.constEnd();
for( it = options.constBegin(); it != end; ++it) {
- QString value = scriptelem.attribute( it.data()->name );
+ TQString value = scriptelem.attribute( it.data()->name );
if(! value.isNull()) {
- QVariant v(value);
- if( v.cast( it.data()->value.type() ) ) // preserve the QVariant's type
+ TQVariant v(value);
+ if( v.cast( it.data()->value.type() ) ) // preserve the TQVariant's type
d->scriptaction->setOption(it.data()->name, v);
}
}
@@ -295,7 +295,7 @@ KexiDB::SchemaData* KexiScriptDesignView::storeNewData(const KexiDB::SchemaData&
if(! storeData()) {
kdWarning() << "KexiScriptDesignView::storeNewData Failed to store the data." << endl;
//failure: remove object's schema data to avoid garbage
- KexiDB::Connection *conn = parentDialog()->mainWin()->project()->dbConnection();
+ KexiDB::Connection *conn = tqparentDialog()->mainWin()->project()->dbConnection();
conn->removeObject( s->id() );
delete s;
return 0;
@@ -306,28 +306,28 @@ KexiDB::SchemaData* KexiScriptDesignView::storeNewData(const KexiDB::SchemaData&
tristate KexiScriptDesignView::storeData(bool /*dontAsk*/)
{
- kexipluginsdbg << "KexiScriptDesignView::storeData(): " << parentDialog()->partItem()->name() << " [" << parentDialog()->id() << "]" << endl;
+ kexipluginsdbg << "KexiScriptDesignView::storeData(): " << tqparentDialog()->partItem()->name() << " [" << tqparentDialog()->id() << "]" << endl;
- QDomDocument domdoc("script");
- QDomElement scriptelem = domdoc.createElement("script");
+ TQDomDocument domdoc("script");
+ TQDomElement scriptelem = domdoc.createElement("script");
domdoc.appendChild(scriptelem);
- QString language = d->scriptaction->getInterpreterName();
+ TQString language = d->scriptaction->getInterpreterName();
scriptelem.setAttribute("language", language);
Kross::Api::InterpreterInfo* info = Kross::Api::Manager::scriptManager()->getInterpreterInfo(language);
if(info) {
Kross::Api::InterpreterInfo::Option::Map defoptions = info->getOptions();
- QMap<QString, QVariant>& options = d->scriptaction->getOptions();
- QMap<QString, QVariant>::ConstIterator it, end( options.constEnd() );
+ TQMap<TQString, TQVariant>& options = d->scriptaction->getOptions();
+ TQMap<TQString, TQVariant>::ConstIterator it, end( options.constEnd() );
for( it = options.constBegin(); it != end; ++it) {
- if( defoptions.contains(it.key()) ) { // only remember options which the InterpreterInfo knows about...
+ if( defoptions.tqcontains(it.key()) ) { // only remember options which the InterpreterInfo knows about...
scriptelem.setAttribute(it.key(), it.data().toString());
}
}
}
- QDomText scriptcode = domdoc.createTextNode(d->scriptaction->getCode());
+ TQDomText scriptcode = domdoc.createTextNode(d->scriptaction->getCode());
scriptelem.appendChild(scriptcode);
return storeDataBlock( domdoc.toString() );