diff options
Diffstat (limited to 'kommander/editor/assoctexteditorimpl.cpp')
-rw-r--r-- | kommander/editor/assoctexteditorimpl.cpp | 126 |
1 files changed, 63 insertions, 63 deletions
diff --git a/kommander/editor/assoctexteditorimpl.cpp b/kommander/editor/assoctexteditorimpl.cpp index 25ac7f30..cb5502a2 100644 --- a/kommander/editor/assoctexteditorimpl.cpp +++ b/kommander/editor/assoctexteditorimpl.cpp @@ -39,16 +39,16 @@ #include <kparts/partmanager.h> /* QT INCLUDES */ -#include <qstringlist.h> -#include <qmetaobject.h> -#include <qcombobox.h> -#include <qstring.h> -#include <qfile.h> -#include <qobject.h> -#include <qobjectlist.h> -#include <qtimer.h> -#include <qevent.h> -#include <qvaluelist.h> +#include <tqstringlist.h> +#include <tqmetaobject.h> +#include <tqcombobox.h> +#include <tqstring.h> +#include <tqfile.h> +#include <tqobject.h> +#include <tqobjectlist.h> +#include <tqtimer.h> +#include <tqevent.h> +#include <tqvaluelist.h> /* OTHER INCLUDES */ #include <cstdio> @@ -61,10 +61,10 @@ #include "choosewidgetimpl.h" #include "functionsimpl.h" -QValueList<QWidget *> openedWidgets; +TQValueList<TQWidget *> openedWidgets; -AssocTextEditor::AssocTextEditor(QWidget *a_widget, FormWindow* a_form, - PropertyEditor* a_property, KParts::PartManager *partManager, QWidget *a_parent, const char *a_name, bool a_modal) +AssocTextEditor::AssocTextEditor(TQWidget *a_widget, FormWindow* a_form, + PropertyEditor* a_property, KParts::PartManager *partManager, TQWidget *a_parent, const char *a_name, bool a_modal) : AssocTextEditorBase(a_parent, a_name, a_modal) { // text editor @@ -90,7 +90,7 @@ AssocTextEditor::AssocTextEditor(QWidget *a_widget, FormWindow* a_form, } doc = KTextEditor::createDocument ("libkatepart", a_parent, "KTextEditor::Document"); - QGridLayout *layout = new QGridLayout(editorFrame, 1, 1); + TQGridLayout *layout = new TQGridLayout(editorFrame, 1, 1); view = doc->createView(editorFrame); layout->addWidget(view, 1,1); partManager->addPart(doc, true); @@ -138,7 +138,7 @@ AssocTextEditor::AssocTextEditor(QWidget *a_widget, FormWindow* a_form, readOnlyAction = view->actionCollection()->action("tools_toggle_write_lock"); popup->insertSeparator(); highlightPopup = new KPopupMenu(popup); - connect(highlightPopup, SIGNAL(activated(int)), SLOT(slotHighlightingChanged(int))); + connect(highlightPopup, TQT_SIGNAL(activated(int)), TQT_SLOT(slotHighlightingChanged(int))); popup->insertItem(i18n("&Highlighting"), highlightPopup); @@ -151,13 +151,13 @@ AssocTextEditor::AssocTextEditor(QWidget *a_widget, FormWindow* a_form, readOnlyAction->activate(); setWidget(a_widget); - connect(doc, SIGNAL(textChanged()), SLOT(textEditChanged())); - connect(widgetsComboBox, SIGNAL(activated(int)), SLOT(widgetChanged(int))); - connect(stateComboBox, SIGNAL(activated(int)), SLOT(stateChanged(int))); - connect(filePushButton, SIGNAL(clicked()), SLOT(insertFile())); - connect(functionButton, SIGNAL(clicked()), SLOT(insertFunction())); - connect(widgetComboBox, SIGNAL(activated(int)), SLOT(insertWidgetName(int))); - connect(treeWidgetButton, SIGNAL(clicked()), SLOT(selectWidget())); + connect(doc, TQT_SIGNAL(textChanged()), TQT_SLOT(textEditChanged())); + connect(widgetsComboBox, TQT_SIGNAL(activated(int)), TQT_SLOT(widgetChanged(int))); + connect(stateComboBox, TQT_SIGNAL(activated(int)), TQT_SLOT(stateChanged(int))); + connect(filePushButton, TQT_SIGNAL(clicked()), TQT_SLOT(insertFile())); + connect(functionButton, TQT_SIGNAL(clicked()), TQT_SLOT(insertFunction())); + connect(widgetComboBox, TQT_SIGNAL(activated(int)), TQT_SLOT(insertWidgetName(int))); + connect(treeWidgetButton, TQT_SIGNAL(clicked()), TQT_SLOT(selectWidget())); view->setFocus(); } @@ -170,7 +170,7 @@ AssocTextEditor::~AssocTextEditor() openedWidgets.remove(m_widget); } -void AssocTextEditor::setWidget(QWidget *a_widget) +void AssocTextEditor::setWidget(TQWidget *a_widget) { KommanderWidget *a_atw = dynamic_cast<KommanderWidget *>(a_widget); if (!a_widget || !a_atw) @@ -197,10 +197,10 @@ void AssocTextEditor::setWidget(QWidget *a_widget) stateComboBox->insertItem("population"); // set states and population scripts - QStringList at = a_atw->associatedText(); + TQStringList at = a_atw->associatedText(); m_atdict.clear(); - QStringList::iterator at_it = at.begin(); - for(QStringList::ConstIterator s_it = m_states.begin(); s_it != m_states.end(); ++s_it) + TQStringList::iterator at_it = at.begin(); + for(TQStringList::ConstIterator s_it = m_states.begin(); s_it != m_states.end(); ++s_it) { if(at_it != at.end()) { @@ -208,7 +208,7 @@ void AssocTextEditor::setWidget(QWidget *a_widget) ++at_it; } else - m_atdict[(*s_it)] = QString::null; + m_atdict[(*s_it)] = TQString::null; } m_populationText = a_atw->populationText(); @@ -268,20 +268,20 @@ void AssocTextEditor::save() const if (atw->associatedText() != associatedText()) { - QString text = i18n("Set the \'text association\' of \'%1\'").arg(m_widget->name()); + TQString text = i18n("Set the \'text association\' of \'%1\'").arg(m_widget->name()); SetPropertyCommand *cmd = new SetPropertyCommand(text, m_formWindow, m_widget, m_propertyEditor, "associations", atw->associatedText(), - associatedText(), QString::null, QString::null, false); + associatedText(), TQString::null, TQString::null, false); cmd->execute(); m_formWindow->commandHistory()->addCommand(cmd); MetaDataBase::setPropertyChanged(m_widget, "associations", true); } if (atw->populationText() != populationText()) { - QString text = i18n("Set the \'population text\' of \'%1\'").arg(m_widget->name()); + TQString text = i18n("Set the \'population text\' of \'%1\'").arg(m_widget->name()); SetPropertyCommand *cmd = new SetPropertyCommand(text, m_formWindow, m_widget, m_propertyEditor, "populationText", atw->populationText(), - populationText(), QString::null, QString::null, false); + populationText(), TQString::null, TQString::null, false); cmd->execute(); m_formWindow->commandHistory()->addCommand(cmd); MetaDataBase::setPropertyChanged(m_widget, "populationText", true); @@ -289,46 +289,46 @@ void AssocTextEditor::save() const } -QStringList AssocTextEditor::associatedText() const +TQStringList AssocTextEditor::associatedText() const { - QStringList at; - for(QStringList::ConstIterator it = m_states.begin(); it != m_states.end(); ++it) + TQStringList at; + for(TQStringList::ConstIterator it = m_states.begin(); it != m_states.end(); ++it) at.append(m_atdict[(*it)]); return at; } -QString AssocTextEditor::populationText() const +TQString AssocTextEditor::populationText() const { return m_populationText; } -QStringList AssocTextEditor::buildWidgetList() +TQStringList AssocTextEditor::buildWidgetList() { - QStringList widgetList; - QObject* thisObject = m_formWindow->mainContainer(); - QObjectList *objectList = thisObject->queryList(); + TQStringList widgetList; + TQObject* thisObject = m_formWindow->mainContainer(); + TQObjectList *objectList = thisObject->queryList(); objectList->prepend(thisObject); - for (QObjectListIt it(*objectList); it.current(); ++it) + for (TQObjectListIt it(*objectList); it.current(); ++it) { // There is a warning message with the property() function if it does not exist. // Verify the property exists with the meta information first */ bool pExists = false; - QMetaObject *metaObj = it.current()->metaObject(); + TQMetaObject *metaObj = it.current()->metaObject(); if(metaObj) { int id = metaObj->findProperty("KommanderWidget", true); - const QMetaProperty *metaProp = metaObj->property(id, true); + const TQMetaProperty *metaProp = metaObj->property(id, true); if(metaProp && metaProp->isValid()) pExists = true; } if(pExists) { - QVariant flag = (it.current())->property("KommanderWidget"); - if(flag.isValid() && !(QString(it.current()->name()).startsWith("qt_"))) + TQVariant flag = (it.current())->property("KommanderWidget"); + if(flag.isValid() && !(TQString(it.current()->name()).startsWith("qt_"))) { - widgetList.append( widgetToString( (QWidget*)it.current()) ); - m_widgetList.insert(it.current()->name(), (QWidget*)it.current()); + widgetList.append( widgetToString( (TQWidget*)it.current()) ); + m_widgetList.insert(it.current()->name(), (TQWidget*)it.current()); } } } @@ -352,7 +352,7 @@ void AssocTextEditor::stateChanged(int a_index) KTextEditor::ViewCursorInterface *viewCursorIf = dynamic_cast<KTextEditor::ViewCursorInterface*>(view); viewCursorIf->setCursorPositionReal(0, 0); highlightPopup->clear(); - QString hlType = "Kommander (old parser)"; + TQString hlType = "Kommander (old parser)"; if (useInternalParser()) hlType = "Kommander (new parser)"; KTextEditor::HighlightingInterface *hlIf = dynamic_cast<KTextEditor::HighlightingInterface*>(doc); @@ -381,7 +381,7 @@ void AssocTextEditor::textEditChanged() m_atdict[m_currentState] = associatedTextEdit->text(); int index = stateComboBox->currentItem(); if (associatedTextEdit->text().isEmpty()) - stateComboBox->changeItem(QPixmap(), stateComboBox->currentText(), index); + stateComboBox->changeItem(TQPixmap(), stateComboBox->currentText(), index); else if (!stateComboBox->pixmap(index) || stateComboBox->pixmap(index)->isNull()) stateComboBox->changeItem(scriptPixmap, stateComboBox->currentText(), index); } @@ -397,7 +397,7 @@ void AssocTextEditor::selectWidget() ChooseWidget cDialog(this); cDialog.setWidget(m_formWindow->mainContainer()); if (cDialog.exec()) { - QString newWidget = cDialog.selection(); + TQString newWidget = cDialog.selection(); for (int i = 0; i<widgetsComboBox->count(); i++) if (widgetsComboBox->text(i) == newWidget) { widgetsComboBox->setCurrentItem(i); @@ -409,7 +409,7 @@ void AssocTextEditor::selectWidget() -void AssocTextEditor::insertAssociatedText(const QString& a_text) +void AssocTextEditor::insertAssociatedText(const TQString& a_text) { uint line, col; KTextEditor::ViewCursorInterface *viewCursorIf = dynamic_cast<KTextEditor::ViewCursorInterface*>(view); @@ -419,28 +419,28 @@ void AssocTextEditor::insertAssociatedText(const QString& a_text) void AssocTextEditor::insertFile() { - QString fileName = KFileDialog::getOpenFileName(); + TQString fileName = KFileDialog::getOpenFileName(); if(fileName.isEmpty()) return; - QFile insertFile(fileName); + TQFile insertFile(fileName); if(!insertFile.open(IO_ReadOnly)) { KMessageBox::error( this, i18n("<qt>Cannot open file<br><b>%1</b></qt").arg( fileName ) ); return; } - QTextStream insertStream(&insertFile); - QString insertText = insertStream.read(); + TQTextStream insertStream(&insertFile); + TQString insertText = insertStream.read(); insertAssociatedText(insertText); insertFile.close(); } void AssocTextEditor::insertWidgetName(int index) { - QString prefix; + TQString prefix; if (!useInternalParser()) - prefix = QString(QChar(ESCCHAR)); + prefix = TQString(TQChar(ESCCHAR)); insertAssociatedText(prefix + widgetToString(widgetFromString(widgetComboBox->text(index)), false)); } @@ -451,19 +451,19 @@ void AssocTextEditor::insertFunction() insertAssociatedText(pDialog.functionText()); } -QString AssocTextEditor::widgetToString(QWidget* widget, bool formatted) +TQString AssocTextEditor::widgetToString(TQWidget* widget, bool formatted) { if (!widget) - return QString::null; + return TQString::null; else if (formatted) - return QString("%1 (%2)").arg(widget->name()).arg(widget->className()); + return TQString("%1 (%2)").arg(widget->name()).arg(widget->className()); else return widget->name(); } -QWidget* AssocTextEditor::widgetFromString(const QString& name) +TQWidget* AssocTextEditor::widgetFromString(const TQString& name) { - QString realname = name; + TQString realname = name; int i = realname.find(' '); if (i != -1) realname.truncate(i); @@ -482,7 +482,7 @@ void AssocTextEditor::slotHighlightingChanged(int mode) bool AssocTextEditor::useInternalParser() { - QString s = ""; + TQString s = ""; int line = -1; while (s.isEmpty() && line < (int)associatedTextEdit->numLines()) { @@ -497,7 +497,7 @@ bool AssocTextEditor::useInternalParser() return false; } -void AssocTextEditor::closeEvent ( QCloseEvent * e ) +void AssocTextEditor::closeEvent ( TQCloseEvent * e ) { deleteLater(); e->accept(); |