diff options
Diffstat (limited to 'quanta/dialogs/settings/abbreviation.cpp')
-rw-r--r-- | quanta/dialogs/settings/abbreviation.cpp | 90 |
1 files changed, 45 insertions, 45 deletions
diff --git a/quanta/dialogs/settings/abbreviation.cpp b/quanta/dialogs/settings/abbreviation.cpp index 56f81c0e..79dc4bc1 100644 --- a/quanta/dialogs/settings/abbreviation.cpp +++ b/quanta/dialogs/settings/abbreviation.cpp @@ -13,13 +13,13 @@ ***************************************************************************/ //qt includes -#include <qdom.h> -#include <qfile.h> -#include <qfileinfo.h> -#include <qlineedit.h> -#include <qtextedit.h> -#include <qtextstream.h> -#include <qtimer.h> +#include <tqdom.h> +#include <tqfile.h> +#include <tqfileinfo.h> +#include <tqlineedit.h> +#include <tqtextedit.h> +#include <tqtextstream.h> +#include <tqtimer.h> //kde includes #include <kcombobox.h> @@ -41,13 +41,13 @@ #include "dtds.h" -AbbreviationDlg::AbbreviationDlg(QWidget *parent, const char *name): +AbbreviationDlg::AbbreviationDlg(TQWidget *parent, const char *name): AbbreviationDlgS(parent, name) { m_oldItem = 0L; m_currentAbbrev = 0L; - QMapConstIterator<QString, Abbreviation> it; + TQMapConstIterator<TQString, Abbreviation> it; for (it = qConfig.abbreviations.constBegin(); it != qConfig.abbreviations.constEnd(); ++it) { groupCombo->insertItem(it.key()); @@ -59,10 +59,10 @@ AbbreviationDlg::~AbbreviationDlg() { } -void AbbreviationDlg::slotGroupChanged(const QString& newGroupName) +void AbbreviationDlg::slotGroupChanged(const TQString& newGroupName) { //save the current template - QListViewItem *item = templatesList->currentItem(); + TQListViewItem *item = templatesList->currentItem(); if (item && m_currentAbbrev) m_currentAbbrev->abbreviations.insert(item->text(0) + " " + item->text(1), codeEdit->text()); dtepList->clear(); @@ -70,9 +70,9 @@ void AbbreviationDlg::slotGroupChanged(const QString& newGroupName) codeEdit->clear(); m_oldItem = 0L; m_currentAbbrev = &qConfig.abbreviations[newGroupName]; - QString templateStr; - QString templateName; - QMap<QString, QString>::ConstIterator it; + TQString templateStr; + TQString templateName; + TQMap<TQString, TQString>::ConstIterator it; for ( it = m_currentAbbrev->abbreviations.constBegin(); it != m_currentAbbrev->abbreviations.constEnd(); ++it ) { templateStr = it.key(); @@ -80,7 +80,7 @@ void AbbreviationDlg::slotGroupChanged(const QString& newGroupName) templateStr = templateStr.left(templateStr.find(' ')); new KListViewItem(templatesList, templateStr, templateName); } - for ( QStringList::ConstIterator dtepit = m_currentAbbrev->dteps.constBegin(); dtepit != m_currentAbbrev->dteps.constEnd(); ++dtepit ) + for ( TQStringList::ConstIterator dtepit = m_currentAbbrev->dteps.constBegin(); dtepit != m_currentAbbrev->dteps.constEnd(); ++dtepit ) { dtepList->insertItem(DTDs::ref()->getDTDNickNameFromName(*dtepit)); } @@ -92,13 +92,13 @@ void AbbreviationDlg::slotGroupChanged(const QString& newGroupName) void AbbreviationDlg::slotNewGroup() { bool ok; - QString groupName = KInputDialog::getText(i18n("New Abbreviation Group"), i18n("Group name:"), "", &ok, this); + TQString groupName = KInputDialog::getText(i18n("New Abbreviation Group"), i18n("Group name:"), "", &ok, this); if (ok && !groupName.isEmpty()) { if (qConfig.abbreviations.contains(groupName)) { KMessageBox::error(this, i18n("<qt>There is already an abbreviation group called <b>%1</b>. Choose an unique name for the new group.</qt>").arg(groupName), i18n("Group already exists")); - QTimer::singleShot(0, this, SLOT(slotNewGroup())); + TQTimer::singleShot(0, this, TQT_SLOT(slotNewGroup())); } else { groupCombo->insertItem(groupName); @@ -110,17 +110,17 @@ void AbbreviationDlg::slotNewGroup() void AbbreviationDlg::slotAddDTEP() { - QStringList lst = DTDs::ref()->nickNameList(false); + TQStringList lst = DTDs::ref()->nickNameList(false); for (uint i = 0; i < dtepList->count(); i++) lst.remove(dtepList->text(i)); bool ok = false; - QStringList res = KInputDialog::getItemList( + TQStringList res = KInputDialog::getItemList( i18n( "Add DTEP" ), i18n( "Select a DTEP:" ), lst, 0, true, &ok, this ); if (ok) { dtepList->insertStringList(res); - for (QStringList::ConstIterator it = res.constBegin(); it != res.constEnd(); ++it) + for (TQStringList::ConstIterator it = res.constBegin(); it != res.constEnd(); ++it) { m_currentAbbrev->dteps.append(DTDs::ref()->getDTDNameFromNickName(*it)); } @@ -146,18 +146,18 @@ void AbbreviationDlg::slotRemoveDTEP() } } -void AbbreviationDlg::slotTemplateSelectionChanged(QListViewItem* item) +void AbbreviationDlg::slotTemplateSelectionChanged(TQListViewItem* item) { if (!item) return; - //QListViewItem *m_oldItem = templatesList->currentItem(); + //TQListViewItem *m_oldItem = templatesList->currentItem(); if (m_oldItem) { - QString key = m_oldItem->text(0)+" " +m_oldItem->text(1); + TQString key = m_oldItem->text(0)+" " +m_oldItem->text(1); m_currentAbbrev->abbreviations.insert(key, codeEdit->text()); } - QString code = m_currentAbbrev->abbreviations[item->text(0)+" " +item->text(1)]; + TQString code = m_currentAbbrev->abbreviations[item->text(0)+" " +item->text(1)]; codeEdit->setText(code); m_oldItem = item; } @@ -170,11 +170,11 @@ void AbbreviationDlg::slotAddTemplate() w.templateEdit->setFocus(); if (dlg.exec()) { - QString templateName = w.templateEdit->text(); - QString description = w.descriptionEdit->text(); + TQString templateName = w.templateEdit->text(); + TQString description = w.descriptionEdit->text(); if (!templateName.isEmpty()) { - QListViewItem *item = new KListViewItem(templatesList, templateName, description); + TQListViewItem *item = new KListViewItem(templatesList, templateName, description); templatesList->setCurrentItem(item); templatesList->setSelected(item, true); templatesList->ensureItemVisible(item); @@ -185,9 +185,9 @@ void AbbreviationDlg::slotAddTemplate() void AbbreviationDlg::slotRemoveTemplate() { - QListViewItem *item = templatesList->currentItem(); + TQListViewItem *item = templatesList->currentItem(); if (item && - KMessageBox::warningContinueCancel(this, i18n("<qt>Do you really want to remove the <b>%1</b> template?</qt>").arg(item->text(1)),QString::null,KStdGuiItem::del()) == KMessageBox::Continue) + KMessageBox::warningContinueCancel(this, i18n("<qt>Do you really want to remove the <b>%1</b> template?</qt>").arg(item->text(1)),TQString::null,KStdGuiItem::del()) == KMessageBox::Continue) { m_currentAbbrev->abbreviations.remove(item->text(0)+" "+item->text(1)); delete item; @@ -198,7 +198,7 @@ void AbbreviationDlg::slotRemoveTemplate() void AbbreviationDlg::slotEditTemplate() { - QListViewItem *item = templatesList->currentItem(); + TQListViewItem *item = templatesList->currentItem(); if (!item) return; KDialogBase dlg(this, 0, true, i18n("Edit Code Template"), KDialogBase::Ok | KDialogBase::Cancel); @@ -218,33 +218,33 @@ void AbbreviationDlg::slotEditTemplate() void AbbreviationDlg::saveTemplates() { - QListViewItem *item = templatesList->currentItem(); + TQListViewItem *item = templatesList->currentItem(); if (item && m_currentAbbrev) m_currentAbbrev->abbreviations.insert(item->text(0) + " " + item->text(1), codeEdit->text()); - QString abbrevFile = KGlobal::dirs()->saveLocation("data") + resourceDir + "abbreviations.xml"; - QString s = "<!DOCTYPE Templates>\n<Templates>\n</Templates>\n"; - QString s2; - QDomDocument doc; + TQString abbrevFile = KGlobal::dirs()->saveLocation("data") + resourceDir + "abbreviations.xml"; + TQString s = "<!DOCTYPE Templates>\n<Templates>\n</Templates>\n"; + TQString s2; + TQDomDocument doc; doc.setContent(s); - QDomNode firstNode = doc.firstChild(); + TQDomNode firstNode = doc.firstChild(); Abbreviation abbrev; - QMap<QString, Abbreviation>::ConstIterator abbrevIt; + TQMap<TQString, Abbreviation>::ConstIterator abbrevIt; for (abbrevIt = qConfig.abbreviations.constBegin(); abbrevIt != qConfig.abbreviations.constEnd(); ++abbrevIt) { - QDomElement groupEl = doc.createElement("Group"); + TQDomElement groupEl = doc.createElement("Group"); groupEl.setAttribute("name", abbrevIt.key()); abbrev = abbrevIt.data(); - for (QStringList::ConstIterator dtepIt = abbrev.dteps.constBegin(); dtepIt != abbrev.dteps.constEnd(); ++dtepIt) + for (TQStringList::ConstIterator dtepIt = abbrev.dteps.constBegin(); dtepIt != abbrev.dteps.constEnd(); ++dtepIt) { - QDomElement el = doc.createElement("DTEP"); + TQDomElement el = doc.createElement("DTEP"); el.setAttribute("name", *dtepIt); groupEl.appendChild(el); } int pos; - QMap<QString,QString>::ConstIterator it; + TQMap<TQString,TQString>::ConstIterator it; for (it = abbrev.abbreviations.constBegin(); it != abbrev.abbreviations.constEnd(); ++it) { - QDomElement el = doc.createElement("Template"); + TQDomElement el = doc.createElement("Template"); el.setAttribute("code", it.data()); s = it.key(); s2 = ""; @@ -261,11 +261,11 @@ void AbbreviationDlg::saveTemplates() firstNode.appendChild(groupEl); } - QFile f(abbrevFile); + TQFile f(abbrevFile); if (f.open(IO_WriteOnly | IO_Truncate)) { - QTextStream str(&f); - str.setEncoding(QTextStream::UnicodeUTF8); + TQTextStream str(&f); + str.setEncoding(TQTextStream::UnicodeUTF8); str << doc.toString(); f.close(); } else |