summaryrefslogtreecommitdiffstats
path: root/kommander/editor/functionsimpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kommander/editor/functionsimpl.cpp')
-rw-r--r--kommander/editor/functionsimpl.cpp106
1 files changed, 53 insertions, 53 deletions
diff --git a/kommander/editor/functionsimpl.cpp b/kommander/editor/functionsimpl.cpp
index ad4924e5..a758ab30 100644
--- a/kommander/editor/functionsimpl.cpp
+++ b/kommander/editor/functionsimpl.cpp
@@ -14,11 +14,11 @@
***************************************************************************/
/* QT INCLUDES */
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qmetaobject.h>
-#include <qstringlist.h>
-#include <qregexp.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqmetaobject.h>
+#include <tqstringlist.h>
+#include <tqregexp.h>
/* KDE INCLUDES */
#include <kcombobox.h>
@@ -41,7 +41,7 @@
const int MaxFunctionArgs = 6;
-FunctionsDialog::FunctionsDialog(QWidget* a_parent, const QDict<QWidget>& a_widgetList, bool useInternalParser, char* a_name,
+FunctionsDialog::FunctionsDialog(TQWidget* a_parent, const TQDict<TQWidget>& a_widgetList, bool useInternalParser, char* a_name,
bool a_modal)
: FunctionsDialogBase(a_parent, a_name, a_modal), m_widgetList(a_widgetList), m_useInternalParser(useInternalParser)
{
@@ -49,21 +49,21 @@ FunctionsDialog::FunctionsDialog(QWidget* a_parent, const QDict<QWidget>& a_widg
copyButton->setPixmap(KGlobal::iconLoader()->loadIcon("1downarrow", KIcon::Toolbar));
groupComboBox->insertStringList(SpecialInformation::groups());
- connect(groupComboBox, SIGNAL(activated(int)), SLOT(groupChanged(int)));
- connect(widgetComboBox, SIGNAL(activated(int)), SLOT(groupChanged(int)));
- connect(functionListBox, SIGNAL(highlighted(int)), SLOT(functionChanged(int)));
- connect(copyButton, SIGNAL(clicked()), SLOT(copyText()));
- connect(clearButton, SIGNAL(clicked()), insertedText, SLOT(clear()));
+ connect(groupComboBox, TQT_SIGNAL(activated(int)), TQT_SLOT(groupChanged(int)));
+ connect(widgetComboBox, TQT_SIGNAL(activated(int)), TQT_SLOT(groupChanged(int)));
+ connect(functionListBox, TQT_SIGNAL(highlighted(int)), TQT_SLOT(functionChanged(int)));
+ connect(copyButton, TQT_SIGNAL(clicked()), TQT_SLOT(copyText()));
+ connect(clearButton, TQT_SIGNAL(clicked()), insertedText, TQT_SLOT(clear()));
// build widget name list
- for (QDictIterator<QWidget> It(m_widgetList); It.current(); ++It)
+ for (TQDictIterator<TQWidget> It(m_widgetList); It.current(); ++It)
m_widgetNames.append(It.currentKey());
m_widgetNames.sort();
widgetComboBox->insertStringList(m_widgetNames);
for (int j = 0; j < WidgetDatabase::count(); j++)
{
- QString group = WidgetDatabase::group(j);
+ TQString group = WidgetDatabase::group(j);
if (group == "Kommander" || group == "Custom")
m_widgetTypes << WidgetDatabase::className(j);
}
@@ -108,16 +108,16 @@ FunctionsDialog::~FunctionsDialog()
{
}
-QString FunctionsDialog::functionText() const
+TQString FunctionsDialog::functionText() const
{
return insertedText->text();
}
-QString FunctionsDialog::currentFunctionText()
+TQString FunctionsDialog::currentFunctionText()
{
- QString prefix, function;
+ TQString prefix, function;
int index = groupComboBox->currentItem();
- QString s = (index != m_DCOP ) ? groupComboBox->text(index) : "DCOP";
+ TQString s = (index != m_DCOP ) ? groupComboBox->text(index) : "DCOP";
if (m_useInternalParser)
{
function = SpecialInformation::parserGroupName(s);
@@ -130,12 +130,12 @@ QString FunctionsDialog::currentFunctionText()
function = s + ".";
}
if (groupComboBox->currentText() == "Kommander")
- return QString("%1%2%3").arg(prefix).arg(functionListBox->currentText()).arg(params());
+ return TQString("%1%2%3").arg(prefix).arg(functionListBox->currentText()).arg(params());
else if (groupComboBox->currentItem() == m_DCOP || groupComboBox->currentItem() == m_Slots)
- return QString("%1%2.%3%4").arg(prefix).arg(widgetComboBox->currentText().section(' ', 0, 0))
+ return TQString("%1%2.%3%4").arg(prefix).arg(widgetComboBox->currentText().section(' ', 0, 0))
.arg(functionListBox->currentText().left(functionListBox->currentText().find('('))).arg(params());
else
- return QString("%1%2%3%4").arg(prefix).arg(function)
+ return TQString("%1%2%3%4").arg(prefix).arg(function)
.arg(functionListBox->currentText()).arg(params());
}
@@ -147,14 +147,14 @@ void FunctionsDialog::groupChanged(int index)
if (index == m_Slots)
{
KommanderWidget* a_atw = dynamic_cast<KommanderWidget *>(m_widgetList[widgetComboBox->currentText()]);
- QStringList pFunctions = QStringList::fromStrList(a_atw->object()->metaObject()->slotNames(true));
+ TQStringList pFunctions = TQStringList::fromStrList(a_atw->object()->metaObject()->slotNames(true));
for (uint i=0; i<pFunctions.count(); i++)
{
- QString slot = pFunctions[i];
- QString slotArgStr = slot.section(QRegExp("\\(|\\)"), 1);
+ TQString slot = pFunctions[i];
+ TQString slotArgStr = slot.section(TQRegExp("\\(|\\)"), 1);
if (slotArgStr.isEmpty() || m_acceptedSlots.contains(slotArgStr))
{
- QString name = slot.remove("()");
+ TQString name = slot.remove("()");
if (!m_slotList.contains(name))
{
m_slotList[name] = slot;
@@ -164,8 +164,8 @@ void FunctionsDialog::groupChanged(int index)
}
} else
{
- QString s = (index != m_DCOP ) ? groupComboBox->text(index) : "DCOP";
- QStringList pFunctions = SpecialInformation::functions(s);
+ TQString s = (index != m_DCOP ) ? groupComboBox->text(index) : "DCOP";
+ TQStringList pFunctions = SpecialInformation::functions(s);
KommanderWidget* a_atw = 0;
if (index == m_DCOP)
a_atw = dynamic_cast<KommanderWidget *>(m_widgetList[widgetComboBox->currentText()]);
@@ -194,10 +194,10 @@ void FunctionsDialog::functionChanged(int)
if (groupComboBox->currentItem() == m_Slots)
{
KommanderWidget* w = dynamic_cast<KommanderWidget *>(m_widgetList[widgetComboBox->currentText()]);
- QObject *o = w->object();
- QString slotHelp = i18n("To learn more about the slot, look at the documentation of the base Qt/KDE class, most probably <i>%1</i>.").arg(o->metaObject()->superClassName() ? QString(o->metaObject()->superClassName()) : QString(o->className()) );
- QString slotName = functionListBox->currentText();
- QString slot = m_slotList[slotName];
+ TQObject *o = w->object();
+ TQString slotHelp = i18n("To learn more about the slot, look at the documentation of the base Qt/KDE class, most probably <i>%1</i>.").arg(o->metaObject()->superClassName() ? TQString(o->metaObject()->superClassName()) : TQString(o->className()) );
+ TQString slotName = functionListBox->currentText();
+ TQString slot = m_slotList[slotName];
descriptionText->clear();
descriptionText->setText(i18n("<qt><h3>%1</h3>"
"<p><b>Description:</b> %2\n<p><b>Syntax:</b> <i>%3</i>%4</qt>")
@@ -205,10 +205,10 @@ void FunctionsDialog::functionChanged(int)
} else
{
int index = groupComboBox->currentItem();
- QString s = (index != m_DCOP ) ? groupComboBox->text(index) : "DCOP";
+ TQString s = (index != m_DCOP ) ? groupComboBox->text(index) : "DCOP";
m_function = SpecialInformation::functionObject(s,
functionListBox->currentText());
- QString defArgs;
+ TQString defArgs;
if (m_function.minArg() < m_function.argumentCount())
if (!m_function.minArg())
defArgs = i18n("<p>Parameters are not obligatory.");
@@ -233,7 +233,7 @@ void FunctionsDialog::functionChanged(int)
void FunctionsDialog::copyText()
{
- QString text = currentFunctionText();
+ TQString text = currentFunctionText();
int para, i;
insertedText->getCursorPosition(&para, &i);
// int cursorPos = insertedText->cursorPosition();
@@ -244,25 +244,25 @@ void FunctionsDialog::copyText()
void FunctionsDialog::showParameters()
{
KLineEdit* edits[MaxFunctionArgs] = {arg1Edit, arg2Edit, arg3Edit, arg4Edit, arg5Edit, arg6Edit};
- QLabel* labels[MaxFunctionArgs] = {argLabel1, argLabel2, argLabel3, argLabel4, argLabel5, argLabel6};
+ TQLabel* labels[MaxFunctionArgs] = {argLabel1, argLabel2, argLabel3, argLabel4, argLabel5, argLabel6};
KComboBox* combos[MaxFunctionArgs] = {combo1, combo2, combo3, combo4, combo5, combo6};
- QCheckBox* quotes[MaxFunctionArgs] = {quote1, quote2, quote3, quote4, quote5, quote6};
+ TQCheckBox* quotes[MaxFunctionArgs] = {quote1, quote2, quote3, quote4, quote5, quote6};
if (groupComboBox->currentItem() == m_Slots)
{
widgetComboBox->setShown(true);
widgetLabel->setShown(true);
- QString slot = m_slotList[functionListBox->currentText()];
- QStringList slotArgs = QStringList::split(',', slot.section(QRegExp("\\(|\\)"), 1), false);
+ TQString slot = m_slotList[functionListBox->currentText()];
+ TQStringList slotArgs = TQStringList::split(',', slot.section(TQRegExp("\\(|\\)"), 1), false);
int argsCount = slotArgs.count();
for (int i = 0; i < MaxFunctionArgs; i++)
{
labels[i]->setShown(i < argsCount);
- QString type;
+ TQString type;
if (i < argsCount)
{
- type = slotArgs[i].remove(QRegExp("\\*|\\&|const\\s"));
- labels[i]->setText(QString("%1:").arg(type));
+ type = slotArgs[i].remove(TQRegExp("\\*|\\&|const\\s"));
+ labels[i]->setText(TQString("%1:").arg(type));
}
quotes[i]->setChecked(true);
quotes[i]->setShown(false);
@@ -279,7 +279,7 @@ void FunctionsDialog::showParameters()
combos[i]->setShown(false);
edits[i]->setShown(i < argsCount);
edits[i]->clear();
- if (type == "QString")
+ if (type == "TQString")
{
quotes[i]->setShown(i < argsCount);
}
@@ -303,7 +303,7 @@ void FunctionsDialog::showParameters()
{
labels[i]->setShown(i < argsCount);
if (i < argsCount)
- labels[i]->setText(QString("%1:").arg(m_function.argumentName(i)));
+ labels[i]->setText(TQString("%1:").arg(m_function.argumentName(i)));
quotes[i]->setChecked(true);
quotes[i]->setShown(false);
if (m_function.argumentType(i) == "bool")
@@ -336,7 +336,7 @@ void FunctionsDialog::showParameters()
combos[i]->setShown(false);
edits[i]->setShown(i < argsCount);
edits[i]->clear();
- if (m_function.argumentType(i) == "QString")
+ if (m_function.argumentType(i) == "TQString")
{
quotes[i]->setShown(i < argsCount);
}
@@ -346,24 +346,24 @@ void FunctionsDialog::showParameters()
}
}
-QString FunctionsDialog::params()
+TQString FunctionsDialog::params()
{
- QLabel* labels[MaxFunctionArgs] = {argLabel1, argLabel2, argLabel3, argLabel4, argLabel5, argLabel6};
+ TQLabel* labels[MaxFunctionArgs] = {argLabel1, argLabel2, argLabel3, argLabel4, argLabel5, argLabel6};
KLineEdit* edits[MaxFunctionArgs] = {arg1Edit, arg2Edit, arg3Edit, arg4Edit, arg5Edit, arg6Edit};
KComboBox* combos[MaxFunctionArgs] = {combo1, combo2, combo3, combo4, combo5, combo6};
- QStringList pars;
- QCheckBox* quotes[MaxFunctionArgs] = {quote1, quote2, quote3, quote4, quote5, quote6};
+ TQStringList pars;
+ TQCheckBox* quotes[MaxFunctionArgs] = {quote1, quote2, quote3, quote4, quote5, quote6};
bool params = false;
bool slotsShown = (groupComboBox->currentItem() == m_Slots);
for (int i=0; i<MaxFunctionArgs; i++)
{
if (edits[i]->isShown())
{
- QString s = edits[i]->text();
+ TQString s = edits[i]->text();
if (!s.isEmpty() || i < m_function.minArg())
{
- if (quotes[i]->isChecked() && ( (!slotsShown && m_function.argumentType(i) == "QString")
- || (slotsShown && labels[i]->text().startsWith("QString")) ) )
+ if (quotes[i]->isChecked() && ( (!slotsShown && m_function.argumentType(i) == "TQString")
+ || (slotsShown && labels[i]->text().startsWith("TQString")) ) )
s = '"' + s + '"';
pars.append(s);
}
@@ -371,7 +371,7 @@ QString FunctionsDialog::params()
} else
if (combos[i]->isShown())
{
- QString s = combos[i]->currentText();
+ TQString s = combos[i]->currentText();
if (!s.isEmpty() || i < m_function.minArg())
{
if (s != "true" && s !="false")
@@ -381,9 +381,9 @@ QString FunctionsDialog::params()
params = true;
}
}
- QString a_param = pars.join(", ");
+ TQString a_param = pars.join(", ");
if (params)
- return QString("(%1)").arg(a_param);
+ return TQString("(%1)").arg(a_param);
else
return a_param;
}