summaryrefslogtreecommitdiffstats
path: root/kturtle/src
diff options
context:
space:
mode:
Diffstat (limited to 'kturtle/src')
-rw-r--r--kturtle/src/canvas.cpp16
-rw-r--r--kturtle/src/canvas.h5
-rw-r--r--kturtle/src/dialogs.cpp58
-rw-r--r--kturtle/src/dialogs.h15
-rw-r--r--kturtle/src/executer.cpp30
-rw-r--r--kturtle/src/executer.h3
-rw-r--r--kturtle/src/kturtle.cpp174
-rw-r--r--kturtle/src/kturtle.h1
-rw-r--r--kturtle/src/kturtle.kcfg18
-rw-r--r--kturtle/src/parser.cpp24
-rw-r--r--kturtle/src/parser.h3
-rw-r--r--kturtle/src/translate.cpp2
-rw-r--r--kturtle/src/treenode.cpp26
-rw-r--r--kturtle/src/treenode.h12
14 files changed, 197 insertions, 190 deletions
diff --git a/kturtle/src/canvas.cpp b/kturtle/src/canvas.cpp
index 38281956..e21ad4ea 100644
--- a/kturtle/src/canvas.cpp
+++ b/kturtle/src/canvas.cpp
@@ -18,7 +18,7 @@
// Note on this file:
-// It contains 200 lines of code just to make sure very long line are drawn correctly
+// It tqcontains 200 lines of code just to make sure very long line are drawn correctly
// till a certain extent... Beyond that extent the code just cuts the crap, since use user
// it then probably not doing anything usefull anymore; so he she will not notice the code
// is cheating a bit in order to prevent CPU hogging.
@@ -75,10 +75,10 @@ const double DEG2RAD = 3.14159265358979323846/180;
// BEGIN public methods
-Canvas::Canvas(TQWidget *parent, const char *name) : TQCanvasView(0, parent, name)
+Canvas::Canvas(TQWidget *tqparent, const char *name) : TQCanvasView(0, tqparent, name)
{
// Create a new canvas for this view
- canvas = new TQCanvas(parent);
+ canvas = new TQCanvas(TQT_TQOBJECT(tqparent));
canvas->setAdvancePeriod(250); // refresh-rate in [ms]
// set initial values
@@ -297,11 +297,11 @@ void Canvas::slotPrint(TQString text)
void Canvas::slotFontType(TQString family, TQString extra)
{
font.setFamily(family);
- font.setBold( extra.contains("bold") > 0 );
- font.setItalic( extra.contains("italic") > 0 );
- font.setUnderline( extra.contains("underline") > 0 );
- font.setOverline( extra.contains("overline") > 0 );
- font.setStrikeOut( extra.contains("strikeout") > 0 );
+ font.setBold( extra.tqcontains("bold") > 0 );
+ font.setItalic( extra.tqcontains("italic") > 0 );
+ font.setUnderline( extra.tqcontains("underline") > 0 );
+ font.setOverline( extra.tqcontains("overline") > 0 );
+ font.setStrikeOut( extra.tqcontains("strikeout") > 0 );
}
void Canvas::slotFontSize(int px)
diff --git a/kturtle/src/canvas.h b/kturtle/src/canvas.h
index 0dd5bb13..edda5f9d 100644
--- a/kturtle/src/canvas.h
+++ b/kturtle/src/canvas.h
@@ -22,12 +22,13 @@
#include <tqcanvas.h>
-class Canvas : public QCanvasView
+class Canvas : public TQCanvasView
{
Q_OBJECT
+ TQ_OBJECT
public:
- Canvas(TQWidget *parent = 0, const char *name = 0);
+ Canvas(TQWidget *tqparent = 0, const char *name = 0);
~Canvas();
TQPixmap* canvas2Pixmap();
diff --git a/kturtle/src/dialogs.cpp b/kturtle/src/dialogs.cpp
index fcc6322d..9b693c1d 100644
--- a/kturtle/src/dialogs.cpp
+++ b/kturtle/src/dialogs.cpp
@@ -25,8 +25,8 @@
// BEGIN class ErrorMessage dialog
-ErrorMessage::ErrorMessage (TQWidget *parent)
- : KDialogBase (parent, "errorDialog", false, 0, KDialogBase::Close | KDialogBase::Help | KDialogBase::User1, KDialogBase::Close, true, i18n("Help on &Error") )
+ErrorMessage::ErrorMessage (TQWidget *tqparent)
+ : KDialogBase (tqparent, "errorDialog", false, 0, KDialogBase::Close | KDialogBase::Help | KDialogBase::User1, KDialogBase::Close, true, i18n("Help on &Error") )
{
connect( this, TQT_SIGNAL( user1Clicked() ), this, TQT_SLOT( showHelpOnError() ) );
connect( this, TQT_SIGNAL( helpClicked() ), this, TQT_SLOT( errorMessageHelp() ) );
@@ -140,8 +140,8 @@ void ErrorMessage::errorMessageHelp()
// BEGIN class ColorPicker dialog
-ColorPicker::ColorPicker(TQWidget *parent)
- : KDialogBase(parent, "colorpicker", false, i18n("Color Picker"), KDialogBase::Close | KDialogBase::Help | KDialogBase::User1, KDialogBase::Close, true )
+ColorPicker::ColorPicker(TQWidget *tqparent)
+ : KDialogBase(tqparent, "colorpicker", false, i18n("Color Picker"), KDialogBase::Close | KDialogBase::Help | KDialogBase::User1, KDialogBase::Close, true )
{
// connect to help
connect( this, TQT_SIGNAL( helpClicked() ), TQT_SLOT( slotColorPickerHelp() ) );
@@ -149,7 +149,7 @@ ColorPicker::ColorPicker(TQWidget *parent)
// for toggling convenience
connect( this, TQT_SIGNAL( finished() ), TQT_SLOT( slotEmitVisibility() ) );
- // Create the top level page and its layout
+ // Create the top level page and its tqlayout
BaseWidget = new TQWidget(this);
setMainWidget(BaseWidget);
@@ -157,57 +157,57 @@ ColorPicker::ColorPicker(TQWidget *parent)
setButtonText( KDialogBase::User1, i18n("Insert Color Code at Cursor") );
connect( this, TQT_SIGNAL( user1Clicked() ), TQT_SLOT( slotEmitColorCode() ) );
- TQVBoxLayout *vlayout = new TQVBoxLayout(BaseWidget);
+ TQVBoxLayout *vtqlayout = new TQVBoxLayout(BaseWidget);
- vlayout->addSpacing(5); // spacing on top
+ vtqlayout->addSpacing(5); // spacing on top
// the palette and value selector go into a H-box
- TQHBoxLayout *h1layout = new TQHBoxLayout(BaseWidget);
- vlayout->addLayout(h1layout);
+ TQHBoxLayout *h1tqlayout = new TQHBoxLayout(BaseWidget);
+ vtqlayout->addLayout(h1tqlayout);
- h1layout->addSpacing(10); // space on the left border
+ h1tqlayout->addSpacing(10); // space on the left border
hsSelector = new KHSSelector(BaseWidget); // the color (SH) selector
hsSelector->setMinimumSize(300, 150);
- h1layout->addWidget(hsSelector);
+ h1tqlayout->addWidget(hsSelector);
connect( hsSelector, TQT_SIGNAL( valueChanged(int, int) ), TQT_SLOT( slotSelectorChanged(int, int) ) );
- h1layout->addSpacing(5); // space in between
+ h1tqlayout->addSpacing(5); // space in between
valuePal = new KValueSelector(BaseWidget); // the darkness (V) pal
valuePal->setFixedWidth(30);
- h1layout->addWidget(valuePal);
+ h1tqlayout->addWidget(valuePal);
connect( valuePal, TQT_SIGNAL( valueChanged(int) ), TQT_SLOT( slotPalChanged(int) ) );
- vlayout->addSpacing(15); // space in between the top and the bottom widgets
+ vtqlayout->addSpacing(15); // space in between the top and the bottom widgets
// the patch and the codegenerator also go into a H-box
- TQHBoxLayout *h2layout = new TQHBoxLayout(BaseWidget);
- vlayout->addLayout(h2layout);
+ TQHBoxLayout *h2tqlayout = new TQHBoxLayout(BaseWidget);
+ vtqlayout->addLayout(h2tqlayout);
- h2layout->addSpacing(10); // space on the left border
+ h2tqlayout->addSpacing(10); // space on the left border
patch = new KColorPatch(BaseWidget); // the patch (color previewer)
patch->setFixedSize(50, 50);
- h2layout->addWidget(patch);
+ h2tqlayout->addWidget(patch);
- h2layout->addSpacing(10); // space in between
+ h2tqlayout->addSpacing(10); // space in between
// the label and the codegenerator go in a V-box
- TQVBoxLayout *v2layout = new TQVBoxLayout(BaseWidget);
- h2layout->addLayout(v2layout);
+ TQVBoxLayout *v2tqlayout = new TQVBoxLayout(BaseWidget);
+ h2tqlayout->addLayout(v2tqlayout);
copyable = new TQLabel(i18n("Color code:"), BaseWidget); // tha label
- v2layout->addWidget(copyable);
+ v2tqlayout->addWidget(copyable);
colorcode = new TQLineEdit(BaseWidget); // the code generator
colorcode->setReadOnly(true);
- v2layout->addWidget(colorcode);
+ v2tqlayout->addWidget(colorcode);
connect( colorcode, TQT_SIGNAL( selectionChanged() ), TQT_SLOT( slotReselect() ) );
- h2layout->addSpacing(5); // spacing on the right border
+ h2tqlayout->addSpacing(5); // spacing on the right border
- vlayout->addSpacing(10); // spacing on the bottom
+ vtqlayout->addSpacing(10); // spacing on the bottom
h = g = b = 0; // start with red
s = v = r = 255;
@@ -228,7 +228,7 @@ void ColorPicker::updatePal()
valuePal->setSaturation(s);
valuePal->setValue(v);
valuePal->updateContents();
- valuePal->repaint(false);
+ valuePal->tqrepaint(false);
}
void ColorPicker::updatePatch()
@@ -239,7 +239,7 @@ void ColorPicker::updatePatch()
void ColorPicker::updateColorCode()
{
color.getRgb(&r, &g, &b);
- colorcode->setText( TQString("%1, %2, %3").arg(r).arg(g).arg(b) );
+ colorcode->setText( TQString("%1, %2, %3").tqarg(r).tqarg(g).tqarg(b) );
colorcode->selectAll();
}
@@ -297,8 +297,8 @@ void ColorPicker::slotColorPickerHelp()
// BEGIN class RestartOrBack dialog
-RestartOrBack::RestartOrBack (TQWidget *parent)
- : KDialogBase (parent, "rbDialog", true, 0, KDialogBase::User1 | KDialogBase::User2, KDialogBase::User2, false, i18n("&Restart"), i18n("&Back") )
+RestartOrBack::RestartOrBack (TQWidget *tqparent)
+ : KDialogBase (tqparent, "rbDialog", true, 0, KDialogBase::User1 | KDialogBase::User2, KDialogBase::User2, false, i18n("&Restart"), i18n("&Back") )
{
setPlainCaption( i18n("Finished Execution") );
setButtonWhatsThis( KDialogBase::User1, i18n("Click here to restart the current logo program.") );
diff --git a/kturtle/src/dialogs.h b/kturtle/src/dialogs.h
index 0a421d49..f1b99a98 100644
--- a/kturtle/src/dialogs.h
+++ b/kturtle/src/dialogs.h
@@ -53,9 +53,10 @@ struct errorData
class ErrorMessage : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- ErrorMessage(TQWidget *parent);
+ ErrorMessage(TQWidget *tqparent);
~ErrorMessage() {}
bool containsErrors();
@@ -97,9 +98,10 @@ class ErrorMessage : public KDialogBase
class ColorPicker : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- ColorPicker(TQWidget *parent);
+ ColorPicker(TQWidget *tqparent);
virtual ~ColorPicker() {}
@@ -117,9 +119,9 @@ class ColorPicker : public KDialogBase
TQWidget *BaseWidget;
KHSSelector *hsSelector;
KValueSelector *valuePal;
- TQVBoxLayout *vlayout;
- TQHBoxLayout *h1layout;
- TQHBoxLayout *h2layout;
+ TQVBoxLayout *vtqlayout;
+ TQHBoxLayout *h1tqlayout;
+ TQHBoxLayout *h2tqlayout;
KColorPatch *patch;
TQLabel *copyable;
TQLineEdit *colorcode;
@@ -149,9 +151,10 @@ class ColorPicker : public KDialogBase
class RestartOrBack : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
public:
- RestartOrBack (TQWidget *parent);
+ RestartOrBack (TQWidget *tqparent);
~RestartOrBack() {}
protected:
diff --git a/kturtle/src/executer.cpp b/kturtle/src/executer.cpp
index e50c64a5..e71204b4 100644
--- a/kturtle/src/executer.cpp
+++ b/kturtle/src/executer.cpp
@@ -220,7 +220,7 @@ void Executer::execFunction(TreeNode* node)
functable::iterator p = functionTable.find(funcname);
if ( p == functionTable.end() )
{
- emit ErrorMsg(node->getToken(), i18n("Call to undefined function: %1.").arg(funcname), 5010);
+ emit ErrorMsg(node->getToken(), i18n("Call to undefined function: %1.").tqarg(funcname), 5010);
return;
}
@@ -231,7 +231,7 @@ void Executer::execFunction(TreeNode* node)
// check if number of parameters match
if ( callparams->size() != funcIds->size() )
{
- emit ErrorMsg(node->getToken(), i18n("Call to function '%1' with wrong number of parameters.").arg(funcname), 5020);
+ emit ErrorMsg(node->getToken(), i18n("Call to function '%1' with wrong number of parameters.").tqarg(funcname), 5020);
return;
}
@@ -274,7 +274,7 @@ void Executer::execRetFunction(TreeNode* node)
execFunction(node);
if (runStack.size() == 0)
{
- emit ErrorMsg(node->getToken(), i18n("Function %1 did not return a value.").arg( node->getLook() ), 5030);
+ emit ErrorMsg(node->getToken(), i18n("Function %1 did not return a value.").tqarg( node->getLook() ), 5030);
return;
}
node->setValue( runStack.top() ); // set return val
@@ -329,7 +329,7 @@ void Executer::execForEach(TreeNode* node)
bBreak = false;
- int i = expStr2.contains(expStr1, false);
+ int i = expStr2.tqcontains(expStr1, false);
for ( ; i > 0; i-- )
{
if (bAbort) return;
@@ -839,7 +839,7 @@ void Executer::execFontSize(TreeNode* node)
{
int x = ROUND2INT( param1->getValue().Number() ); // pull the number value & round it to int
if ( x < 0 || x > 350 )
- emit ErrorMsg(node->getToken(), i18n("The parameters of function %1 must be within range: 0 to 350.").arg( node->getLook() ), 5065);
+ emit ErrorMsg(node->getToken(), i18n("The parameters of function %1 must be within range: 0 to 350.").tqarg( node->getLook() ), 5065);
else
emit FontSize(x);
}
@@ -877,7 +877,7 @@ void Executer::execResizeCanvas(TreeNode* node)
int x = ROUND2INT( nodeX->getValue().Number() ); // converting & rounding to int
int y = ROUND2INT( nodeY->getValue().Number() );
if ( ( x < 1 || y < 1 ) || ( x > 10000 || y > 10000 ) )
- emit ErrorMsg(node->getToken(), i18n("The parameters of the %1 command must be numbers in the range: 1 to 10000.").arg( node->getLook() ), 7030);
+ emit ErrorMsg(node->getToken(), i18n("The parameters of the %1 command must be numbers in the range: 1 to 10000.").tqarg( node->getLook() ), 7030);
else
emit ResizeCanvas(x, y);
}
@@ -917,7 +917,7 @@ void Executer::execSetFgColor(TreeNode* node)
int g = ROUND2INT( nodeG->getValue().Number() );
int b = ROUND2INT( nodeB->getValue().Number() );
if ( ( r < 0 || g < 0 || b < 0 ) || ( r > 255 || g > 255 || b > 255 ) )
- emit ErrorMsg(node->getToken(), i18n("The parameters of the %1 command must be numbers in the range: 0 to 255.").arg( node->getLook() ), 6090);
+ emit ErrorMsg(node->getToken(), i18n("The parameters of the %1 command must be numbers in the range: 0 to 255.").tqarg( node->getLook() ), 6090);
else
emit SetFgColor(r, g, b);
}
@@ -938,7 +938,7 @@ void Executer::execSetBgColor(TreeNode* node)
int g = ROUND2INT( nodeG->getValue().Number() );
int b = ROUND2INT( nodeB->getValue().Number() );
if ( ( r < 0 || g < 0 || b < 0 ) || ( r > 255 || g > 255 || b > 255 ) )
- emit ErrorMsg(node->getToken(), i18n("The parameters of the %1 command must be numbers in the range: 0 to 255.").arg( node->getLook() ), 6090);
+ emit ErrorMsg(node->getToken(), i18n("The parameters of the %1 command must be numbers in the range: 0 to 255.").tqarg( node->getLook() ), 6090);
else
emit SetBgColor(r, g, b);
}
@@ -1056,7 +1056,7 @@ bool Executer::checkParameterQuantity(TreeNode* node, uint quantity, int errorCo
if (quantity == 0)
{
if (node->size() == 0) return true; // thats easy!
- emit ErrorMsg(node->getToken(), i18n("The %1 command accepts no parameters.").arg( node->getLook() ), errorCode);
+ emit ErrorMsg(node->getToken(), i18n("The %1 command accepts no parameters.").tqarg( node->getLook() ), errorCode);
return false;
}
@@ -1068,11 +1068,11 @@ bool Executer::checkParameterQuantity(TreeNode* node, uint quantity, int errorCo
{
if (nodeSize < quantity)
{
- emit ErrorMsg(node->getToken(), i18n("The %1 command was called with %2 but needs 1 parameter.", "The %1 command was called with %2 but needs %n parameters.", quantity).arg( node->getLook() ).arg(nodeSize), errorCode);
+ emit ErrorMsg(node->getToken(), i18n("The %1 command was called with %2 but needs 1 parameter.", "The %1 command was called with %2 but needs %n parameters.", quantity).tqarg( node->getLook() ).tqarg(nodeSize), errorCode);
}
else
{
- emit ErrorMsg(node->getToken(), i18n("The %1 command was called with %2 but only accepts 1 parameter.", "The %1 command was called with %2 but only accepts %n parameters.", quantity).arg( node->getLook() ).arg(nodeSize), errorCode);
+ emit ErrorMsg(node->getToken(), i18n("The %1 command was called with %2 but only accepts 1 parameter.", "The %1 command was called with %2 but only accepts %n parameters.", quantity).tqarg( node->getLook() ).tqarg(nodeSize), errorCode);
}
return false;
}
@@ -1093,16 +1093,16 @@ bool Executer::checkParameterType(TreeNode* node, int valueType, int errorCode)
{
case stringValue:
if (quantity == 1)
- emit ErrorMsg(node->getToken(), i18n("The %1 command only accepts a string as its parameter.").arg( node->getLook() ), errorCode);
+ emit ErrorMsg(node->getToken(), i18n("The %1 command only accepts a string as its parameter.").tqarg( node->getLook() ), errorCode);
else
- emit ErrorMsg(node->getToken(), i18n("The %1 command only accepts strings as its parameters.").arg( node->getLook() ), errorCode);
+ emit ErrorMsg(node->getToken(), i18n("The %1 command only accepts strings as its parameters.").tqarg( node->getLook() ), errorCode);
break;
case numberValue:
if (quantity == 1)
- emit ErrorMsg(node->getToken(), i18n("The %1 command only accepts a number as its parameter.").arg( node->getLook() ), errorCode);
+ emit ErrorMsg(node->getToken(), i18n("The %1 command only accepts a number as its parameter.").tqarg( node->getLook() ), errorCode);
else
- emit ErrorMsg(node->getToken(), i18n("The %1 command only accepts numbers as its parameters.").arg( node->getLook() ), errorCode);
+ emit ErrorMsg(node->getToken(), i18n("The %1 command only accepts numbers as its parameters.").tqarg( node->getLook() ), errorCode);
break;
}
return false;
diff --git a/kturtle/src/executer.h b/kturtle/src/executer.h
index d4ecdb77..ee410c0a 100644
--- a/kturtle/src/executer.h
+++ b/kturtle/src/executer.h
@@ -32,9 +32,10 @@ typedef map<TQString,TreeNode*> functable;
typedef stack<Value> runstack;
-class Executer : public QObject
+class Executer : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
Executer(TreeNode*);
diff --git a/kturtle/src/kturtle.cpp b/kturtle/src/kturtle.cpp
index d90228a6..49f47d11 100644
--- a/kturtle/src/kturtle.cpp
+++ b/kturtle/src/kturtle.cpp
@@ -123,59 +123,59 @@ void MainWindow::setupActions()
KActionCollection *ac = actionCollection(); // abbreviation
// File actions
- KStdAction::openNew(this, TQT_SLOT(slotNewFile()), ac);
- openExAction = new KAction(i18n("Open Exa&mples..."), "bookmark_folder", CTRL+Key_E, this, TQT_SLOT(slotOpenExample()), ac, "open_examples");
- KStdAction::open(this, TQT_SLOT(slotOpenFile()), ac);
- m_recentFiles = KStdAction::openRecent(this, TQT_SLOT(slotOpenFile(const KURL&)), ac);
- KStdAction::save(this, TQT_SLOT(slotSaveFile()), ac);
- KStdAction::saveAs(this, TQT_SLOT(slotSaveAs()), ac);
- new KAction(i18n("Save &Canvas..."), 0, 0, this, TQT_SLOT(slotSaveCanvas()), ac, "save_canvas");
- speed = new KSelectAction(i18n("Execution Speed"), 0, ALT+Key_S, this, TQT_SLOT( slotChangeSpeed() ), ac, "speed");
+ KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT(slotNewFile()), ac);
+ openExAction = new KAction(i18n("Open Exa&mples..."), "bookmark_folder", CTRL+Key_E, TQT_TQOBJECT(this), TQT_SLOT(slotOpenExample()), ac, "open_examples");
+ KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(slotOpenFile()), ac);
+ m_recentFiles = KStdAction::openRecent(TQT_TQOBJECT(this), TQT_SLOT(slotOpenFile(const KURL&)), ac);
+ KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(slotSaveFile()), ac);
+ KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(slotSaveAs()), ac);
+ new KAction(i18n("Save &Canvas..."), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotSaveCanvas()), ac, "save_canvas");
+ speed = new KSelectAction(i18n("Execution Speed"), 0, ALT+Key_S, TQT_TQOBJECT(this), TQT_SLOT( slotChangeSpeed() ), ac, "speed");
TQStringList speeds; speeds << i18n("Full Speed") << i18n("Slow") << i18n("Slower") << i18n("Slowest");
speed->setItems(speeds);
speed->setCurrentItem(0);
- run = new KAction(i18n("&Execute Commands"), "gear", ALT+Key_Return, this, TQT_SLOT( slotExecute() ), ac, "run");
- pause = new KToggleAction(i18n("Pause E&xecution"), "player_pause", Key_Pause, this, TQT_SLOT( slotPauseExecution() ), ac, "pause");
+ run = new KAction(i18n("&Execute Commands"), "gear", ALT+Key_Return, TQT_TQOBJECT(this), TQT_SLOT( slotExecute() ), ac, "run");
+ pause = new KToggleAction(i18n("Pause E&xecution"), "player_pause", Key_Pause, TQT_TQOBJECT(this), TQT_SLOT( slotPauseExecution() ), ac, "pause");
pause->setChecked(false);
pause->setEnabled(false);
- stop = new KAction(i18n("Stop E&xecution"), "stop", Key_Escape, this, TQT_SLOT( slotAbortExecution() ), ac, "stop");
+ stop = new KAction(i18n("Stop E&xecution"), "stop", Key_Escape, TQT_TQOBJECT(this), TQT_SLOT( slotAbortExecution() ), ac, "stop");
stop->setEnabled(false);
- KStdAction::print(this, TQT_SLOT(slotPrint()), ac);
- KStdAction::quit(this, TQT_SLOT(close()), ac);
+ KStdAction::print(TQT_TQOBJECT(this), TQT_SLOT(slotPrint()), ac);
+ KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(close()), ac);
// Edit actions
- KStdAction::undo(this, TQT_SLOT(slotUndo()), ac);
- KStdAction::redo(this, TQT_SLOT(slotRedo()), ac);
- KStdAction::cut(this, TQT_SLOT(slotCut()), ac);
- KStdAction::copy(this, TQT_SLOT(slotCopy()), ac);
- KStdAction::paste(this, TQT_SLOT(slotPaste()), ac);
- KStdAction::selectAll(this, TQT_SLOT(slotSelectAll()), ac);
- KStdAction::deselect(this, TQT_SLOT(slotClearSelection()), ac);
- new KToggleAction(i18n("Toggle Insert"), Key_Insert, this, TQT_SLOT(slotToggleInsert()), ac, "set_insert");
- KStdAction::find(this, TQT_SLOT(slotFind()), ac);
- KStdAction::findNext(this, TQT_SLOT(slotFindNext()), ac);
- KStdAction::findPrev(this, TQT_SLOT(slotFindPrevious()), ac);
- KStdAction::replace(this, TQT_SLOT(slotReplace()), ac);
+ KStdAction::undo(TQT_TQOBJECT(this), TQT_SLOT(slotUndo()), ac);
+ KStdAction::redo(TQT_TQOBJECT(this), TQT_SLOT(slotRedo()), ac);
+ KStdAction::cut(TQT_TQOBJECT(this), TQT_SLOT(slotCut()), ac);
+ KStdAction::copy(TQT_TQOBJECT(this), TQT_SLOT(slotCopy()), ac);
+ KStdAction::paste(TQT_TQOBJECT(this), TQT_SLOT(slotPaste()), ac);
+ KStdAction::selectAll(TQT_TQOBJECT(this), TQT_SLOT(slotSelectAll()), ac);
+ KStdAction::deselect(TQT_TQOBJECT(this), TQT_SLOT(slotClearSelection()), ac);
+ new KToggleAction(i18n("Toggle Insert"), Key_Insert, TQT_TQOBJECT(this), TQT_SLOT(slotToggleInsert()), ac, "set_insert");
+ KStdAction::find(TQT_TQOBJECT(this), TQT_SLOT(slotFind()), ac);
+ KStdAction::findNext(TQT_TQOBJECT(this), TQT_SLOT(slotFindNext()), ac);
+ KStdAction::findPrev(TQT_TQOBJECT(this), TQT_SLOT(slotFindPrevious()), ac);
+ KStdAction::replace(TQT_TQOBJECT(this), TQT_SLOT(slotReplace()), ac);
// View actions
- new KToggleAction(i18n("Show &Line Numbers"), 0, Key_F11, this, TQT_SLOT(slotToggleLineNumbers()), ac, "line_numbers");
- m_fullscreen = KStdAction::fullScreen(this, TQT_SLOT(slotToggleFullscreen()), ac, this, "full_screen");
+ new KToggleAction(i18n("Show &Line Numbers"), 0, Key_F11, TQT_TQOBJECT(this), TQT_SLOT(slotToggleLineNumbers()), ac, "line_numbers");
+ m_fullscreen = KStdAction::fullScreen(TQT_TQOBJECT(this), TQT_SLOT(slotToggleFullscreen()), ac, this, "full_screen");
m_fullscreen->setChecked(b_fullscreen);
// Tools actions
- colorpicker = new KToggleAction(i18n("&Color Picker"), "colorize", ALT+Key_C, this, TQT_SLOT(slotColorPicker()), ac, "color_picker");
- new KAction(i18n("&Indent"), "indent", CTRL+Key_I, this, TQT_SLOT(slotIndent()), ac, "edit_indent");
- new KAction(i18n("&Unindent"), "unindent", CTRL+SHIFT+Key_I, this, TQT_SLOT(slotUnIndent()), ac, "edit_unindent");
- new KAction(i18n("Cl&ean Indentation"), 0, 0, this, TQT_SLOT(slotCleanIndent()), ac, "edit_cleanIndent");
- new KAction(i18n("Co&mment"), 0, CTRL+Key_D, this, TQT_SLOT(slotComment()), ac, "edit_comment");
- new KAction(i18n("Unc&omment"), 0, CTRL+SHIFT+Key_D, this, TQT_SLOT(slotUnComment()), ac, "edit_uncomment");
+ colorpicker = new KToggleAction(i18n("&Color Picker"), "colorize", ALT+Key_C, TQT_TQOBJECT(this), TQT_SLOT(slotColorPicker()), ac, "color_picker");
+ new KAction(i18n("&Indent"), "indent", CTRL+Key_I, TQT_TQOBJECT(this), TQT_SLOT(slotIndent()), ac, "edit_indent");
+ new KAction(i18n("&Unindent"), "unindent", CTRL+SHIFT+Key_I, TQT_TQOBJECT(this), TQT_SLOT(slotUnIndent()), ac, "edit_unindent");
+ new KAction(i18n("Cl&ean Indentation"), 0, 0, TQT_TQOBJECT(this), TQT_SLOT(slotCleanIndent()), ac, "edit_cleanIndent");
+ new KAction(i18n("Co&mment"), 0, CTRL+Key_D, TQT_TQOBJECT(this), TQT_SLOT(slotComment()), ac, "edit_comment");
+ new KAction(i18n("Unc&omment"), 0, CTRL+SHIFT+Key_D, TQT_TQOBJECT(this), TQT_SLOT(slotUnComment()), ac, "edit_uncomment");
// Settings actions
- KStdAction::preferences( this, TQT_SLOT(slotSettings()), ac );
- new KAction(i18n("&Configure Editor..."), "configure", 0, this, TQT_SLOT(slotEditor()), ac, "set_confdlg");
+ KStdAction::preferences( TQT_TQOBJECT(this), TQT_SLOT(slotSettings()), ac );
+ new KAction(i18n("&Configure Editor..."), "configure", 0, TQT_TQOBJECT(this), TQT_SLOT(slotEditor()), ac, "set_confdlg");
// Help actions
- ContextHelp = new KAction(0, 0, Key_F2, this, TQT_SLOT(slotContextHelp()), ac, "context_help");
+ ContextHelp = new KAction(0, 0, Key_F2, TQT_TQOBJECT(this), TQT_SLOT(slotContextHelp()), ac, "context_help");
slotContextHelpUpdate(); // this sets the label of this action
// other
@@ -192,7 +192,7 @@ void MainWindow::setupEditor()
editorDock->setResizeEnabled(true);
editorDock->setFrameShape(TQFrame::ToolBarPanel);
TQWhatsThis::add( editorDock, i18n( "This is the code editor, here you type the Logo commands to instruct the turtle. You can also open an existing Logo program with File->Open Examples... or File->Open." ) );
- moveDockWindow(editorDock, Qt::DockLeft);
+ moveDockWindow(editorDock, TQt::DockLeft);
editor = doc->createView (editorDock, 0L);
// editorInterface is the editor interface which allows us to access the text in the part
editorInterface = dynamic_cast<KTextEditor::EditInterface*>(doc);
@@ -221,7 +221,7 @@ void MainWindow::setupStatusBar()
// fill the statusbar
slotStatusBar(i18n("Welcome to KTurtle..."), IDS_STATUS); // the message part
- slotStatusBar(i18n("Line: %1 Column: %2").arg(1).arg(1), IDS_LINECOLUMN);
+ slotStatusBar(i18n("Line: %1 Column: %2").tqarg(1).tqarg(1), IDS_LINECOLUMN);
slotStatusBar(i18n("INS"), IDS_INS);
}
@@ -247,7 +247,7 @@ void MainWindow::setupCanvas()
void MainWindow::slotStatusBar(TQString text, int id)
{
- text = " " + text + " "; // help the layout
+ text = " " + text + " "; // help the tqlayout
statusBar()->changeItem(text, id);
}
@@ -256,7 +256,7 @@ void MainWindow::slotCursorStatusBar()
uint cursorLine;
uint cursorCol;
dynamic_cast<KTextEditor::ViewCursorInterface*>(editor)->cursorPositionReal(&cursorLine, &cursorCol);
- TQString linenumber = i18n(" Line: %1 Column: %2 ").arg(cursorLine + 1).arg(cursorCol + 1);
+ TQString linenumber = i18n(" Line: %1 Column: %2 ").tqarg(cursorLine + 1).tqarg(cursorCol + 1);
statusBar()->changeItem(linenumber, IDS_LINECOLUMN);
}
@@ -330,7 +330,7 @@ void MainWindow::loadFile(const KURL &url)
file.close();
m_recentFiles->addURL(url);
setCaption( url.fileName() );
- slotStatusBar(i18n("Opened file: %1").arg( url.fileName() ), IDS_STATUS);
+ slotStatusBar(i18n("Opened file: %1").tqarg( url.fileName() ), IDS_STATUS);
editor->document()->setModified(false);
CurrentFile = url;
return;
@@ -338,7 +338,7 @@ void MainWindow::loadFile(const KURL &url)
else
{
KMessageBox::error( this,
- i18n("KTurtle was unable to open: \n%1.").arg( url.prettyURL() ),
+ i18n("KTurtle was unable to open: \n%1.").tqarg( url.prettyURL() ),
i18n("Open Error") );
slotStatusBar(i18n("Opening aborted because of error."), IDS_STATUS);
return;
@@ -367,7 +367,7 @@ void MainWindow::slotSaveAs()
{
int result = KMessageBox::warningContinueCancel ( this,
i18n("A program named \"%1\" already exists in this folder. "
- "Do you want to overwrite it?").arg( url.fileName() ),
+ "Do you want to overwrite it?").tqarg( url.fileName() ),
i18n("Overwrite?"), i18n("&Overwrite") );
if (result != KMessageBox::Continue) return;
}
@@ -384,7 +384,7 @@ void MainWindow::writeFile(const KURL &url)
editor->document()->saveAs(url); // use the KateParts method for saving
loadFile(url); // reload the file as utf8 otherwise display weird chars
setCaption( url.fileName() );
- slotStatusBar(i18n("Saved to: %1").arg( url.fileName() ), IDS_STATUS);
+ slotStatusBar(i18n("Saved to: %1").tqarg( url.fileName() ), IDS_STATUS);
m_recentFiles->addURL(url);
editor->document()->setModified(false);
CurrentFile = url;
@@ -405,7 +405,7 @@ void MainWindow::slotSaveCanvas()
{
int result = KMessageBox::warningContinueCancel( this,
i18n("A picture named \"%1\" already in this folder. "
- "Do you want to overwrite it?").arg( url.fileName() ),
+ "Do you want to overwrite it?").tqarg( url.fileName() ),
i18n("Overwrite?"), i18n("&Overwrite") );
if (result != KMessageBox::Continue) return;
}
@@ -428,12 +428,12 @@ void MainWindow::slotSaveCanvas()
{
kdWarning() << "KTurtle was unable to save the canvas drawing" << endl;
KMessageBox::error(this,
- i18n("KTurtle was unable to save the image to: \n%1.").arg( url.prettyURL() ),
+ i18n("KTurtle was unable to save the image to: \n%1.").tqarg( url.prettyURL() ),
i18n("Unable to Save Image") );
slotStatusBar(i18n("Could not save image."), IDS_STATUS);
return;
}
- slotStatusBar(i18n("Saved canvas to: %1").arg( url.fileName() ), IDS_STATUS);
+ slotStatusBar(i18n("Saved canvas to: %1").tqarg( url.fileName() ), IDS_STATUS);
}
@@ -650,7 +650,7 @@ void MainWindow::slotMessageDialog(TQString text)
-// BEGIN editor connections (undo, redo, cut, copy, paste, cursor, selections, find, replace, linenumbers etc.)
+// BEGIN editor connections (undo, redo, cut, copy, paste, cursor, selections, tqfind, tqreplace, linenumbers etc.)
void MainWindow::slotEditor()
{
@@ -716,7 +716,7 @@ void MainWindow::slotClearSelection()
void MainWindow::slotFind()
{
- KAction *a = editor->actionCollection()->action("edit_find");
+ KAction *a = editor->actionCollection()->action("edit_tqfind");
a->activate();
}
@@ -734,7 +734,7 @@ void MainWindow::slotFindPrevious()
void MainWindow::slotReplace()
{
- KAction* a = editor->actionCollection()->action("edit_replace");
+ KAction* a = editor->actionCollection()->action("edit_tqreplace");
a->activate();
}
@@ -877,39 +877,39 @@ void MainWindow::slotSettings()
TQGridLayout *generalLayout = new TQGridLayout( general, 1, 1, 11, 6, "generalLayout");
WidthHeightBox = new TQGroupBox( i18n("Initial Canvas Size"), general );
WidthHeightBox->setColumnLayout(0, Qt::Vertical );
- WidthHeightBox->layout()->setSpacing( 6 );
- WidthHeightBox->layout()->setMargin( 11 );
- TQVBoxLayout *WidthHeightBoxLayout = new TQVBoxLayout( WidthHeightBox->layout() );
- WidthHeightBoxLayout->setAlignment( Qt::AlignTop );
- TQHBoxLayout *layout3 = new TQHBoxLayout( 0, 0, 6, "layout3");
- TQVBoxLayout *layout2 = new TQVBoxLayout( 0, 0, 6, "layout2");
+ WidthHeightBox->tqlayout()->setSpacing( 6 );
+ WidthHeightBox->tqlayout()->setMargin( 11 );
+ TQVBoxLayout *WidthHeightBoxLayout = new TQVBoxLayout( WidthHeightBox->tqlayout() );
+ WidthHeightBoxLayout->tqsetAlignment( TQt::AlignTop );
+ TQHBoxLayout *tqlayout3 = new TQHBoxLayout( 0, 0, 6, "tqlayout3");
+ TQVBoxLayout *tqlayout2 = new TQVBoxLayout( 0, 0, 6, "tqlayout2");
- TQVBoxLayout *layout1 = new TQVBoxLayout( 0, 0, 6, "layout1");
+ TQVBoxLayout *tqlayout1 = new TQVBoxLayout( 0, 0, 6, "tqlayout1");
kcfg_CanvasWidth = new KIntNumInput( WidthHeightBox, "kcfg_CanvasWidth" );
kcfg_CanvasWidth->setValue( 400 );
kcfg_CanvasWidth->setMinValue( 1 );
kcfg_CanvasWidth->setReferencePoint( 1 );
- layout1->addWidget( kcfg_CanvasWidth );
+ tqlayout1->addWidget( kcfg_CanvasWidth );
kcfg_CanvasHeight = new KIntNumInput( WidthHeightBox, "kcfg_CanvasHeight" );
kcfg_CanvasHeight->setValue( 300 );
kcfg_CanvasHeight->setMinValue( 1 );
kcfg_CanvasHeight->setReferencePoint( 1 );
- layout1->addWidget( kcfg_CanvasHeight );
+ tqlayout1->addWidget( kcfg_CanvasHeight );
WidthLabel = new TQLabel( kcfg_CanvasWidth, i18n("Canvas &width:"), WidthHeightBox );
- layout2->addWidget( WidthLabel );
+ tqlayout2->addWidget( WidthLabel );
HeightLabel = new TQLabel( kcfg_CanvasHeight, i18n("Ca&nvas height:"), WidthHeightBox );
- layout2->addWidget( HeightLabel );
- layout3->addLayout( layout2 );
+ tqlayout2->addWidget( HeightLabel );
+ tqlayout3->addLayout( tqlayout2 );
- layout3->addLayout( layout1 );
- WidthHeightBoxLayout->addLayout( layout3 );
+ tqlayout3->addLayout( tqlayout1 );
+ WidthHeightBoxLayout->addLayout( tqlayout3 );
TQLabel* WidthHeightLabel = new TQLabel(i18n("You need to restart before these settings have effect"), WidthHeightBox);
WidthHeightBoxLayout->addWidget( WidthHeightLabel );
generalLayout->addWidget( WidthHeightBox, 0, 0 );
- general->resize( TQSize(234, 109).expandedTo(minimumSizeHint()) );
+ general->resize( TQSize(234, 109).expandedTo(tqminimumSizeHint()) );
dialog->addPage( general, i18n("General"), "package_settings", i18n("General Settings") );
@@ -918,12 +918,12 @@ void MainWindow::slotSettings()
TQGridLayout *languageLayout = new TQGridLayout( language, 1, 1, 11, 6, "Form1Layout");
TQGroupBox *groupBox1 = new TQGroupBox( language, "groupBox1" );
groupBox1->setColumnLayout(0, Qt::Vertical );
- groupBox1->layout()->setSpacing( 6 );
- groupBox1->layout()->setMargin( 11 );
- TQGridLayout *groupBox1Layout = new TQGridLayout( groupBox1->layout() );
- groupBox1Layout->setAlignment( Qt::AlignTop );
+ groupBox1->tqlayout()->setSpacing( 6 );
+ groupBox1->tqlayout()->setMargin( 11 );
+ TQGridLayout *groupBox1Layout = new TQGridLayout( groupBox1->tqlayout() );
+ groupBox1Layout->tqsetAlignment( TQt::AlignTop );
- TQVBoxLayout *layout4 = new TQVBoxLayout( 0, 0, 6, "layout4");
+ TQVBoxLayout *tqlayout4 = new TQVBoxLayout( 0, 0, 6, "tqlayout4");
kcfg_LanguageComboBox = new KComboBox(groupBox1, "kcfg_LanguageComboBox");
kcfg_LanguageComboBox->setEditable(false);
@@ -935,13 +935,13 @@ void MainWindow::slotSettings()
kcfg_LanguageComboBox->insertStringList(LogoLanguageList);
LanguageLabel = new TQLabel(kcfg_LanguageComboBox, i18n("&Select the language for the Logo commands:"), groupBox1);
- layout4->addWidget( LanguageLabel );
- layout4->addWidget( kcfg_LanguageComboBox );
+ tqlayout4->addWidget( LanguageLabel );
+ tqlayout4->addWidget( kcfg_LanguageComboBox );
LanguageLabel->setBuddy( kcfg_LanguageComboBox );
- groupBox1Layout->addLayout( layout4, 0, 0 );
+ groupBox1Layout->addLayout( tqlayout4, 0, 0 );
languageLayout->addWidget( groupBox1, 0, 0 );
- language->resize( TQSize(373, 80).expandedTo(minimumSizeHint()) );
+ language->resize( TQSize(373, 80).expandedTo(tqminimumSizeHint()) );
dialog->addPage( language, i18n("Language"), "locale", i18n("Language Settings") );
@@ -967,7 +967,7 @@ void MainWindow::slotUpdateSettings()
// TODO maybe this language name can be more pretty by not using ".left(2)", ie "American English" would than be possible... [if this is possible this should be fixed at more places.]
KConfig entry(locate("locale", "all_languages"));
entry.setGroup(Settings::logoLanguage().left(2));
- slotStatusBar(i18n("Command language: %1").arg( entry.readEntry("Name") ), IDS_LANG);
+ slotStatusBar(i18n("Command language: %1").tqarg( entry.readEntry("Name") ), IDS_LANG);
delete translate; // to update the currently used language
translate = new Translate();
@@ -979,7 +979,7 @@ void MainWindow::readConfig(KConfig *config)
m_recentFiles->loadEntries(config, "Recent Files");
KConfig entry(locate("locale", "all_languages"));
entry.setGroup(Settings::logoLanguage().left(2));
- slotStatusBar(i18n("Command language: %1").arg( entry.readEntry("Name") ), IDS_LANG);
+ slotStatusBar(i18n("Command language: %1").tqarg( entry.readEntry("Name") ), IDS_LANG);
}
void MainWindow::slotSettingsHelp()
@@ -1044,8 +1044,8 @@ void MainWindow::slotContextHelp()
TQString help2statusBar;
if ( helpKeyword.startsWith("<") ) help2statusBar = helpKeyword;
- else help2statusBar = i18n("\"%1\"").arg(helpKeyword);
- slotStatusBar(i18n("Displaying help on %1").arg(help2statusBar), IDS_STATUS);
+ else help2statusBar = i18n("\"%1\"").tqarg(helpKeyword);
+ slotStatusBar(i18n("Displaying help on %1").tqarg(help2statusBar), IDS_STATUS);
}
void MainWindow::slotContextHelpUpdate()
@@ -1058,20 +1058,20 @@ void MainWindow::slotContextHelpUpdate()
if ( line.stripWhiteSpace().startsWith("#") )
{
helpKeyword = i18n("<comment>");
- ContextHelp->setText( i18n("Help on: %1").arg(helpKeyword) );
+ ContextHelp->setText( i18n("Help on: %1").tqarg(helpKeyword) );
return;
}
if ( line.stripWhiteSpace().isEmpty() || line.mid(col-1,2).stripWhiteSpace().isEmpty() )
{
helpKeyword = i18n("<no keyword>");
- ContextHelp->setText( i18n("Help on: %1").arg(helpKeyword) );
+ ContextHelp->setText( i18n("Help on: %1").tqarg(helpKeyword) );
return;
}
int start, length, pos;
pos = 0;
- if ( line.contains('"') )
+ if ( line.tqcontains('"') )
{
TQRegExp delimitedStrings("(\"[^\"\\\\\\r\\n]*(\\\\.[^\"\\\\\\r\\n]*)*\")");
while ( delimitedStrings.search(line, pos) != -1 )
@@ -1082,7 +1082,7 @@ void MainWindow::slotContextHelpUpdate()
if ( col >= (uint)start && col < (uint)(start+length) )
{
helpKeyword = i18n("<string>");
- ContextHelp->setText( i18n("Help on: %1").arg(helpKeyword) );
+ ContextHelp->setText( i18n("Help on: %1").tqarg(helpKeyword) );
return;
}
pos += (length <= 0 ? 1 : length);
@@ -1112,20 +1112,20 @@ void MainWindow::slotContextHelpUpdate()
else if ( !translate->name2key( cursorWord.lower() ).isEmpty() ) helpKeyword = cursorWord;
else if ( !translate->alias2key( cursorWord.lower() ).isEmpty() ) helpKeyword = cursorWord;
- else if ( cursorWord.find( TQRegExp("[\\d.]+") ) == 0 ) helpKeyword = i18n("<number>");
+ else if ( cursorWord.tqfind( TQRegExp("[\\d.]+") ) == 0 ) helpKeyword = i18n("<number>");
- else if ( cursorWord.find( TQRegExp("[+\\-*/\\(\\)]") ) == 0 ) helpKeyword = i18n("<math>");
+ else if ( cursorWord.tqfind( TQRegExp("[+\\-*/\\(\\)]") ) == 0 ) helpKeyword = i18n("<math>");
else if ( cursorWord == TQString("=") ) helpKeyword = i18n("<assignment>");
- else if ( cursorWord.find( TQRegExp("==|<|>|<=|>=|!=") ) == 0 ) helpKeyword = i18n("<question>");
+ else if ( cursorWord.tqfind( TQRegExp("==|<|>|<=|>=|!=") ) == 0 ) helpKeyword = i18n("<question>");
// if we come here we either have an ID of some sort or an error
// all we can do is try to catch some errors (TODO) and then...
else helpKeyword = i18n("<name>");
- ContextHelp->setText( i18n("Help on: %1").arg(helpKeyword) );
+ ContextHelp->setText( i18n("Help on: %1").tqarg(helpKeyword) );
return;
}
pos += (length <= 0 ? 1 : length); // the pos had to be increased with at least one
@@ -1133,7 +1133,7 @@ void MainWindow::slotContextHelpUpdate()
// we allready cached some in the beginning of this method; yet its still needed as fall-through
helpKeyword = i18n("<no keyword>");
- ContextHelp->setText( i18n("Help on: %1").arg(helpKeyword) );
+ ContextHelp->setText( i18n("Help on: %1").tqarg(helpKeyword) );
}
// END
diff --git a/kturtle/src/kturtle.h b/kturtle/src/kturtle.h
index 3e52215e..1282294f 100644
--- a/kturtle/src/kturtle.h
+++ b/kturtle/src/kturtle.h
@@ -46,6 +46,7 @@ class KRecentFilesAction;
class MainWindow : public KParts::MainWindow
{
Q_OBJECT
+ TQ_OBJECT
public:
MainWindow(KTextEditor::Document* = 0L);
diff --git a/kturtle/src/kturtle.kcfg b/kturtle/src/kturtle.kcfg
index 1dba5092..dd57013a 100644
--- a/kturtle/src/kturtle.kcfg
+++ b/kturtle/src/kturtle.kcfg
@@ -26,11 +26,11 @@
// We assume keyword and highlight files come in pairs (if not there will be no highlight style)
- QStringList xmlFiles = KGlobal::dirs()->findAllResources("data", "kturtle/data/*.xml");
- QStringList LogoLanguageList;
- QString xmlTranslationFiles; // for debug purposes
- for ( QStringList::Iterator it = xmlFiles.begin(); it != xmlFiles.end(); ++it ) {
- QString xmlFile(*it);
+ TQStringList xmlFiles = KGlobal::dirs()->findAllResources("data", "kturtle/data/*.xml");
+ TQStringList LogoLanguageList;
+ TQString xmlTranslationFiles; // for debug purposes
+ for ( TQStringList::Iterator it = xmlFiles.begin(); it != xmlFiles.end(); ++it ) {
+ TQString xmlFile(*it);
xmlTranslationFiles += xmlFile.section('.', -2, -2).append(", "); // for debug purposes
// build list of language codes (en_US, nl, etc.)
LogoLanguageList += xmlFile.section('.', -2, -2);
@@ -54,13 +54,13 @@
// Get the desktops language
KConfigBase *globalConf = KGlobal::config();
globalConf->setGroup("Locale");
- QString desktopLanguage = globalConf->readEntry("Language");
+ TQString desktopLanguage = globalConf->readEntry("Language");
kdDebug(0) &lt;&lt; "desktopLanguage: "&lt;&lt; desktopLanguage &lt;&lt;endl;
- QString defaultLanguage = "en_US"; // init to the fall back value
+ TQString defaultLanguage = "en_US"; // init to the fall back value
int itemCount = 0; // for the LanguageComboBox
- for (QStringList::Iterator it = LogoLanguageList.begin(); it != LogoLanguageList.end(); ++it ) {
- QString testLanguage(*it);
+ for (TQStringList::Iterator it = LogoLanguageList.begin(); it != LogoLanguageList.end(); ++it ) {
+ TQString testLanguage(*it);
if (testLanguage == desktopLanguage) { // exact match
defaultLanguage = testLanguage;
break;
diff --git a/kturtle/src/parser.cpp b/kturtle/src/parser.cpp
index 07a33aea..64d83cb0 100644
--- a/kturtle/src/parser.cpp
+++ b/kturtle/src/parser.cpp
@@ -94,7 +94,7 @@ void Parser::matchToken(int expectedToken)
switch (expectedToken)
{
case tokEOL:
- Error(currentToken, i18n("Unexpected intruction after the '%1' command, please use only one instruction per line").arg(preservedToken.look), 1010);
+ Error(currentToken, i18n("Unexpected intruction after the '%1' command, please use only one instruction per line").tqarg(preservedToken.look), 1010);
break;
case tokBegin:
@@ -102,23 +102,23 @@ void Parser::matchToken(int expectedToken)
break;
case tokTo:
- Error(currentToken, i18n("Expected 'to' after the '%1' command").arg(preservedToken.look), 1010);
+ Error(currentToken, i18n("Expected 'to' after the '%1' command").tqarg(preservedToken.look), 1010);
break;
case tokAssign:
- Error(currentToken, i18n("Expected '=' after the '%1' command").arg(preservedToken.look), 1010);
+ Error(currentToken, i18n("Expected '=' after the '%1' command").tqarg(preservedToken.look), 1010);
break;
case tokEnd:
- Error(currentToken, i18n("Expected ']' after the '%1' command").arg(preservedToken.look), 1010);
+ Error(currentToken, i18n("Expected ']' after the '%1' command").tqarg(preservedToken.look), 1010);
break;
case tokUnknown:
- Error(preservedToken, i18n("Expected a name after the '%1' command").arg(preservedToken.look), 1010);
+ Error(preservedToken, i18n("Expected a name after the '%1' command").tqarg(preservedToken.look), 1010);
break;
default:
- Error(currentToken, i18n("UNDEFINED ERROR NR %1: please send this Logo script to the KTurtle developers").arg(expectedToken), 1010);
+ Error(currentToken, i18n("UNDEFINED ERROR NR %1: please send this Logo script to the KTurtle developers").tqarg(expectedToken), 1010);
break;
}
}
@@ -188,7 +188,7 @@ TreeNode* Parser::Factor()
case tokUnknown:
node = getId();
- if (learnedFunctionList.contains(rememberedToken.look) > 0) // is function call
+ if (learnedFunctionList.tqcontains(rememberedToken.look) > 0) // is function call
{
delete node;
node = FunctionCall(rememberedToken);
@@ -241,12 +241,12 @@ TreeNode* Parser::Factor()
TQString s = currentToken.look;
if ( s.isEmpty() || currentToken.type == tokEOF )
{
- Error(currentToken, i18n("INTERNAL ERROR NR %1: please sent this Logo script to KTurtle developers").arg(1), 1020);
+ Error(currentToken, i18n("INTERNAL ERROR NR %1: please sent this Logo script to KTurtle developers").tqarg(1), 1020);
// if this error occurs the see the Parser::Repeat for the good solution using 'preservedToken'
}
else
{
- Error(currentToken, i18n("Cannot understand '%1', expected an expression after the '%2' command").arg(s).arg(preservedToken.look), 1020);
+ Error(currentToken, i18n("Cannot understand '%1', expected an expression after the '%2' command").tqarg(s).tqarg(preservedToken.look), 1020);
}
node = new TreeNode(currentToken, Unknown);
getToken();
@@ -538,7 +538,7 @@ TreeNode* Parser::Statement()
}
if (currentToken.type != tokEnd)
{
- Error(currentToken, i18n("Cannot understand '%1'").arg(currentToken.look), 1060);
+ Error(currentToken, i18n("Cannot understand '%1'").tqarg(currentToken.look), 1060);
}
getToken();
@@ -1057,7 +1057,7 @@ TreeNode* Parser::Other()
matchToken(tokUnknown);
if (currentToken.type == tokAssign) return Assignment(rememberedToken);
- else if (learnedFunctionList.contains(rememberedToken.look) > 0)
+ else if (learnedFunctionList.tqcontains(rememberedToken.look) > 0)
{
TreeNode* node;
node = FunctionCall(rememberedToken);
@@ -1065,7 +1065,7 @@ TreeNode* Parser::Other()
return node;
}
- Error(rememberedToken, i18n("'%1' is neither a Logo command nor a learned command.").arg(rememberedToken.look), 1020);
+ Error(rememberedToken, i18n("'%1' is neither a Logo command nor a learned command.").tqarg(rememberedToken.look), 1020);
TreeNode* errNode = new TreeNode(rememberedToken, Unknown);
// skip the rest of the line
diff --git a/kturtle/src/parser.h b/kturtle/src/parser.h
index 68836221..c6948a7d 100644
--- a/kturtle/src/parser.h
+++ b/kturtle/src/parser.h
@@ -26,9 +26,10 @@
#include "treenode.h"
-class Parser : public QObject
+class Parser : public TQObject
{
Q_OBJECT
+ TQ_OBJECT
public:
Parser(TQTextIStream& in);
diff --git a/kturtle/src/translate.cpp b/kturtle/src/translate.cpp
index 10ad2b07..06e874a5 100644
--- a/kturtle/src/translate.cpp
+++ b/kturtle/src/translate.cpp
@@ -38,7 +38,7 @@ TQString Translate::name2fuzzy(const TQString &name)
{
if ( !aliasMap[name].isEmpty() ) // translate the alias if any
{
- return TQString( i18n("'%1' (%2)").arg(keyMap[name]).arg(reverseAliasMap[name]) );
+ return TQString( i18n("'%1' (%2)").tqarg(keyMap[name]).tqarg(reverseAliasMap[name]) );
}
return TQString( "'" + keyMap[name] + "'");
}
diff --git a/kturtle/src/treenode.cpp b/kturtle/src/treenode.cpp
index 0b5619a5..f294a8a8 100644
--- a/kturtle/src/treenode.cpp
+++ b/kturtle/src/treenode.cpp
@@ -58,7 +58,7 @@ TreeNode::~TreeNode()
void TreeNode::init()
{
clear();
- parent = NULL;
+ tqparent = NULL;
// fTok.look (TQString) and fTok.value (Value) are properly init'ed when constructed
fTok.start.row = 0;
fTok.start.col = 0;
@@ -77,23 +77,23 @@ void TreeNode::appendChild(TreeNode* node)
void TreeNode::appendSibling(TreeNode* node)
{
- node->parent = parent;
- if (parent != NULL) parent->push_back(node);
+ node->tqparent = tqparent;
+ if (tqparent != NULL) tqparent->push_back(node);
}
TreeNode* TreeNode::nextSibling()
{
- if (parent)
+ if (tqparent)
{
TreeNode::iterator i = lookup();
- if ( i != parent->end() )
+ if ( i != tqparent->end() )
{
++i;
// Must check after i has been incremented
// to make sure i isn't at the end before
// returning the contained pointer value.
- if ( i != parent->end() ) return *i;
+ if ( i != tqparent->end() ) return *i;
}
}
return NULL;
@@ -101,13 +101,13 @@ TreeNode* TreeNode::nextSibling()
TreeNode* TreeNode::prevSibling()
{
- if (parent)
+ if (tqparent)
{
TreeNode::iterator i = lookup();
// Must make sure we aren't at beginning as well
// or we can crash when decrementing since we shouldn't
// decrement before the start of the list.
- if ( ( i != parent->end() ) && ( i != parent->begin() ) )
+ if ( ( i != tqparent->end() ) && ( i != tqparent->begin() ) )
{
--i;
return *i;
@@ -184,10 +184,10 @@ TreeNode* TreeNode::lastChild()
TreeNode::iterator TreeNode::lookup()
{
- if (parent != NULL)
+ if (tqparent != NULL)
{
- TreeNode::iterator i = parent->begin();
- while ( (*i != this) && (i != parent->end() ) ) ++i;
+ TreeNode::iterator i = tqparent->begin();
+ while ( (*i != this) && (i != tqparent->end() ) ) ++i;
return i;
}
return end();
@@ -201,7 +201,7 @@ TreeNode& TreeNode::operator= (const TreeNode& t)
{
fType = t.fType;
fTok = t.fTok;
- parent = t.parent;
+ tqparent = t.tqparent;
clear();
for (TreeNode::const_iterator i = t.begin(); i != t.end(); ++i)
@@ -248,7 +248,7 @@ void TreeNode::destroy(TreeNode* node)
for ( TreeNode::iterator i = node->begin(); i != node->end(); ++i )
{
destroy(*i);
- (*i)->clear(); //free children
+ (*i)->clear(); //free tqchildren
//delete ( *i ); //free mem
}
}
diff --git a/kturtle/src/treenode.h b/kturtle/src/treenode.h
index f43260bf..95b15bd8 100644
--- a/kturtle/src/treenode.h
+++ b/kturtle/src/treenode.h
@@ -213,14 +213,14 @@ class TreeNode : public list<TreeNode*> /*, public Value <-- maybe oneday */
{
public:
TreeNode(); // used for creation of the first node called 'tree', in the contructor of the parser
- TreeNode( TreeNode* ); // give parent
+ TreeNode( TreeNode* ); // give tqparent
TreeNode( Token, NodeType = Unknown, TQString = TQString() );
virtual ~TreeNode();
void init();
void appendChild(TreeNode*);
- void appendSibling(TreeNode*); // works only if it has parent set!
+ void appendSibling(TreeNode*); // works only if it has tqparent set!
TreeNode* firstChild();
TreeNode* secondChild();
@@ -232,8 +232,8 @@ class TreeNode : public list<TreeNode*> /*, public Value <-- maybe oneday */
TreeNode* nextSibling();
TreeNode* prevSibling();
- void setParent(TreeNode* p) { parent = p; }
- TreeNode* getParent() const { return parent; }
+ void setParent(TreeNode* p) { tqparent = p; }
+ TreeNode* getParent() const { return tqparent; }
void setToken(Token t) { fTok = t; }
Token& getToken() { return fTok; }
@@ -254,7 +254,7 @@ class TreeNode : public list<TreeNode*> /*, public Value <-- maybe oneday */
uint getCol() const { return fTok.start.col; }
bool hasChildren() const { return size() != 0; }
- TreeNode::iterator lookup(); // gives location in parent list as iterator (used by prevSibling and nextSibling)
+ TreeNode::iterator lookup(); // gives location in tqparent list as iterator (used by prevSibling and nextSibling)
TreeNode& operator=(const TreeNode&);
@@ -270,7 +270,7 @@ class TreeNode : public list<TreeNode*> /*, public Value <-- maybe oneday */
protected:
- TreeNode *parent;
+ TreeNode *tqparent;
};
#endif // _TREENODE_H_