diff options
Diffstat (limited to 'kmouth/phrasebook')
-rw-r--r-- | kmouth/phrasebook/phrasebook.cpp | 146 | ||||
-rw-r--r-- | kmouth/phrasebook/phrasebook.h | 72 | ||||
-rw-r--r-- | kmouth/phrasebook/phrasebookdialog.cpp | 226 | ||||
-rw-r--r-- | kmouth/phrasebook/phrasebookdialog.h | 58 | ||||
-rw-r--r-- | kmouth/phrasebook/phrasebookparser.cpp | 22 | ||||
-rw-r--r-- | kmouth/phrasebook/phrasebookparser.h | 24 | ||||
-rw-r--r-- | kmouth/phrasebook/phrasetree.cpp | 126 | ||||
-rw-r--r-- | kmouth/phrasebook/phrasetree.h | 40 |
8 files changed, 357 insertions, 357 deletions
diff --git a/kmouth/phrasebook/phrasebook.cpp b/kmouth/phrasebook/phrasebook.cpp index 0ec8da3..cc5d900 100644 --- a/kmouth/phrasebook/phrasebook.cpp +++ b/kmouth/phrasebook/phrasebook.cpp @@ -15,12 +15,12 @@ * * ***************************************************************************/ -#include <qprinter.h> -#include <qpainter.h> -#include <qfile.h> -#include <qxml.h> -#include <qregexp.h> -#include <qptrstack.h> +#include <tqprinter.h> +#include <tqpainter.h> +#include <tqfile.h> +#include <tqxml.h> +#include <tqregexp.h> +#include <tqptrstack.h> #include <klocale.h> #include <kaction.h> @@ -40,29 +40,29 @@ Phrase::Phrase() { this->shortcut = ""; } -Phrase::Phrase (const QString &phrase) { +Phrase::Phrase (const TQString &phrase) { this->phrase = phrase; this->shortcut = ""; } -Phrase::Phrase (const QString &phrase, const QString &shortcut) { +Phrase::Phrase (const TQString &phrase, const TQString &shortcut) { this->phrase = phrase; this->shortcut = shortcut; } -QString Phrase::getPhrase() const { +TQString Phrase::getPhrase() const { return phrase; } -QString Phrase::getShortcut() const { +TQString Phrase::getShortcut() const { return shortcut; } -void Phrase::setPhrase (const QString &phrase) { +void Phrase::setPhrase (const TQString &phrase) { this->phrase = phrase; } -void Phrase::setShortcut (const QString &shortcut) { +void Phrase::setShortcut (const TQString &shortcut) { this->shortcut = shortcut; } @@ -95,19 +95,19 @@ int PhraseBookEntry::getLevel() const { // *************************************************************************** void PhraseBook::print(KPrinter *pPrinter) { - QPainter printpainter; + TQPainter printpainter; printpainter.begin(pPrinter); - QRect size = printpainter.viewport (); + TQRect size = printpainter.viewport (); int x = size.x(); int y = size.y(); int w = size.width(); - printpainter.setFont (QFont (KGlobalSettings::generalFont().family(), 12)); - QFontMetrics metrics = printpainter.fontMetrics(); + printpainter.setFont (TQFont (KGlobalSettings::generalFont().family(), 12)); + TQFontMetrics metrics = printpainter.fontMetrics(); PhraseBookEntryList::iterator it; for (it = begin(); it != end(); ++it) { - QRect rect = metrics.boundingRect (x+16*(*it).getLevel(), y, + TQRect rect = metrics.boundingRect (x+16*(*it).getLevel(), y, w-16*(*it).getLevel(), 0, Qt::AlignJustify | Qt::WordBreak, (*it).getPhrase().getPhrase()); @@ -126,15 +126,15 @@ void PhraseBook::print(KPrinter *pPrinter) { printpainter.end(); } -bool PhraseBook::decode (const QString &xml) { - QXmlInputSource source; +bool PhraseBook::decode (const TQString &xml) { + TQXmlInputSource source; source.setData (xml); return decode (source); } -bool PhraseBook::decode (QXmlInputSource &source) { +bool PhraseBook::decode (TQXmlInputSource &source) { PhraseBookParser parser; - QXmlSimpleReader reader; + TQXmlSimpleReader reader; reader.setFeature ("http://trolltech.com/xml/features/report-start-end-entity", true); reader.setContentHandler (&parser); @@ -147,12 +147,12 @@ bool PhraseBook::decode (QXmlInputSource &source) { return false; } -QCString encodeString (const QString str) { - QCString res = ""; +TQCString encodeString (const TQString str) { + TQCString res = ""; for (int i = 0; i < (int)str.length(); i++) { - QChar ch = str.at(i); + TQChar ch = str.at(i); ushort uc = ch.unicode(); - QCString number; number.setNum(uc); + TQCString number; number.setNum(uc); if ((uc>127) || (uc<32) || (ch=='<') || (ch=='>') || (ch=='&') || (ch==';')) res = res + "&#" + number + ";"; else @@ -161,8 +161,8 @@ QCString encodeString (const QString str) { return res; } -QString PhraseBook::encode () { - QString result; +TQString PhraseBook::encode () { + TQString result; result = "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n"; result += "<!DOCTYPE phrasebook>\n"; result += "<phrasebook>\n"; @@ -199,8 +199,8 @@ QString PhraseBook::encode () { return result; } -QStringList PhraseBook::toStringList () { - QStringList result; +TQStringList PhraseBook::toStringList () { + TQStringList result; PhraseBook::iterator it; for (it = begin(); it != end(); ++it) { @@ -211,12 +211,12 @@ QStringList PhraseBook::toStringList () { } bool PhraseBook::save (const KURL &url) { - QRegExp pattern("*.phrasebook",true,true); + TQRegExp pattern("*.phrasebook",true,true); return save (url, pattern.exactMatch(url.filename())); } -void PhraseBook::save (QTextStream &stream, bool asPhrasebook) { +void PhraseBook::save (TQTextStream &stream, bool asPhrasebook) { if (asPhrasebook) stream << encode(); else @@ -225,11 +225,11 @@ void PhraseBook::save (QTextStream &stream, bool asPhrasebook) { bool PhraseBook::save (const KURL &url, bool asPhrasebook) { if (url.isLocalFile()) { - QFile file(url.path()); + TQFile file(url.path()); if(!file.open(IO_WriteOnly)) return false; - QTextStream stream(&file); + TQTextStream stream(&file); save (stream, asPhrasebook); file.close(); @@ -249,21 +249,21 @@ bool PhraseBook::save (const KURL &url, bool asPhrasebook) { } } -int PhraseBook::save (QWidget *parent, const QString &title, KURL &url, bool phrasebookFirst) { +int PhraseBook::save (TQWidget *parent, const TQString &title, KURL &url, bool phrasebookFirst) { // KFileDialog::getSaveURL(...) is not useful here as we need // to know the requested file type. - QString filters; + TQString filters; if (phrasebookFirst) filters = i18n("*.phrasebook|Phrase Books (*.phrasebook)\n*.txt|Plain Text Files (*.txt)\n*|All Files"); else filters = i18n("*.txt|Plain Text Files (*.txt)\n*.phrasebook|Phrase Books (*.phrasebook)\n*|All Files"); - KFileDialog fdlg(QString::null,filters, parent, "filedialog", true); + KFileDialog fdlg(TQString::null,filters, parent, "filedialog", true); fdlg.setCaption(title); fdlg.setOperationMode( KFileDialog::Saving ); - if (fdlg.exec() != QDialog::Accepted) { + if (fdlg.exec() != TQDialog::Accepted) { return 0; } @@ -274,7 +274,7 @@ int PhraseBook::save (QWidget *parent, const QString &title, KURL &url, bool phr } if (KIO::NetAccess::exists(url)) { - if (KMessageBox::warningContinueCancel(0,QString("<qt>%1</qt>").arg(i18n("The file %1 already exists. " + if (KMessageBox::warningContinueCancel(0,TQString("<qt>%1</qt>").arg(i18n("The file %1 already exists. " "Do you want to overwrite it?").arg(url.url())),i18n("File Exists"),i18n("&Overwrite"))==KMessageBox::Cancel) { return 0; } @@ -286,7 +286,7 @@ int PhraseBook::save (QWidget *parent, const QString &title, KURL &url, bool phr url.setFileName (url.fileName(false) + ".phrasebook"); } else if (url.fileName (false).right (11).contains (".phrasebook", false) == 0) { - int filetype = KMessageBox::questionYesNoCancel (0,QString("<qt>%1</qt>").arg(i18n("Your chosen filename <i>%1</i> has a different extension than <i>.phrasebook</i>. " + int filetype = KMessageBox::questionYesNoCancel (0,TQString("<qt>%1</qt>").arg(i18n("Your chosen filename <i>%1</i> has a different extension than <i>.phrasebook</i>. " "Do you wish to add <i>.phrasebook</i> to the filename?").arg(url.filename())),i18n("File Extension"),i18n("Add"),i18n("Do Not Add")); if (filetype == KMessageBox::Cancel) { return 0; @@ -302,7 +302,7 @@ int PhraseBook::save (QWidget *parent, const QString &title, KURL &url, bool phr result = save (url, false); } else { - int filetype = KMessageBox::questionYesNoCancel (0,QString("<qt>%1</qt>").arg(i18n("Your chosen filename <i>%1</i> has the extension <i>.phrasebook</i>. " + int filetype = KMessageBox::questionYesNoCancel (0,TQString("<qt>%1</qt>").arg(i18n("Your chosen filename <i>%1</i> has the extension <i>.phrasebook</i>. " "Do you wish to save in phrasebook format?").arg(url.filename())),i18n("File Extension"),i18n("As Phrasebook"),i18n("As Plain Text")); if (filetype == KMessageBox::Cancel) { return 0; @@ -325,21 +325,21 @@ int PhraseBook::save (QWidget *parent, const QString &title, KURL &url, bool phr } bool PhraseBook::open (const KURL &url) { - QString tempFile; + TQString tempFile; KURL fileUrl = url; - QString protocol = fileUrl.protocol(); + TQString protocol = fileUrl.protocol(); if (protocol.isEmpty() || protocol.isNull()) { fileUrl.setProtocol ("file"); fileUrl.setPath (url.url()); } if (KIO::NetAccess::download (fileUrl, tempFile)) { - QStringList list = QStringList(); + TQStringList list = TQStringList(); // First: try to load it as a normal phrase book - QFile file(tempFile); - QXmlInputSource source (&file); + TQFile file(tempFile); + TQXmlInputSource source (&file); bool error = !decode (source); // Second: if the file does not contain a phrase book, load it as @@ -347,12 +347,12 @@ bool PhraseBook::open (const KURL &url) { if (error) { // Load each line of the plain text file as a new phrase - QFile file(tempFile); + TQFile file(tempFile); if (file.open(IO_ReadOnly)) { - QTextStream stream(&file); + TQTextStream stream(&file); while (!stream.atEnd()) { - QString s = stream.readLine(); + TQString s = stream.readLine(); if (!(s.isNull() || s.isEmpty())) *this += PhraseBookEntry(Phrase(s, ""), 0, true); } @@ -370,14 +370,14 @@ bool PhraseBook::open (const KURL &url) { return false; } -void PhraseBook::addToGUI (QPopupMenu *popup, KToolBar *toolbar, KActionCollection *phrases, - QObject *receiver, const char *slot) const { +void PhraseBook::addToGUI (TQPopupMenu *popup, KToolBar *toolbar, KActionCollection *phrases, + TQObject *receiver, const char *slot) const { if ((popup != 0) || (toolbar != 0)) { - QPtrStack<QWidget> stack; - QWidget *parent = popup; + TQPtrStack<TQWidget> stack; + TQWidget *parent = popup; int level = 0; - QValueListConstIterator<PhraseBookEntry> it; + TQValueListConstIterator<PhraseBookEntry> it; for (it = begin(); it != end(); ++it) { int newLevel = (*it).getLevel(); while (newLevel > level) { @@ -422,10 +422,10 @@ void PhraseBook::addToGUI (QPopupMenu *popup, KToolBar *toolbar, KActionCollecti } } -void PhraseBook::insert (const QString &name, const PhraseBook &book) { +void PhraseBook::insert (const TQString &name, const PhraseBook &book) { *this += PhraseBookEntry(Phrase(name), 0, false); - QValueListConstIterator<PhraseBookEntry> it; + TQValueListConstIterator<PhraseBookEntry> it; for (it = book.begin(); it != book.end(); ++it) { *this += PhraseBookEntry ((*it).getPhrase(), (*it).getLevel()+1, (*it).isPhrase()); } @@ -433,14 +433,14 @@ void PhraseBook::insert (const QString &name, const PhraseBook &book) { // *************************************************************************** -PhraseBookDrag::PhraseBookDrag (PhraseBook *book, QWidget *dragSource, const char *name) - : QDragObject (dragSource, name) +PhraseBookDrag::PhraseBookDrag (PhraseBook *book, TQWidget *dragSource, const char *name) + : TQDragObject (dragSource, name) { setBook (book); } -PhraseBookDrag::PhraseBookDrag (QWidget *dragSource, const char *name) - : QDragObject (dragSource, name) +PhraseBookDrag::PhraseBookDrag (TQWidget *dragSource, const char *name) + : TQDragObject (dragSource, name) { setBook (0); } @@ -451,9 +451,9 @@ PhraseBookDrag::~PhraseBookDrag () { void PhraseBookDrag::setBook (PhraseBook *book) { if (book == 0) { isEmpty = true; - xmlphrasebook.setText(QString::null); - xml.setText(QString::null); - plain.setText(QString::null); + xmlphrasebook.setText(TQString::null); + xml.setText(TQString::null); + plain.setText(TQString::null); } else { isEmpty = false; @@ -477,8 +477,8 @@ const char *PhraseBookDrag::format (int i) const { return xmlphrasebook.format(i/3); } -QByteArray PhraseBookDrag::encodedData (const char* mime) const { - QCString m(mime); +TQByteArray PhraseBookDrag::encodedData (const char* mime) const { + TQCString m(mime); m = m.lower(); if (m.contains("xml-phrasebook")) return xmlphrasebook.encodedData(mime); @@ -488,18 +488,18 @@ QByteArray PhraseBookDrag::encodedData (const char* mime) const { return plain.encodedData(mime); } -bool PhraseBookDrag::canDecode (const QMimeSource* e) { - return QTextDrag::canDecode(e); +bool PhraseBookDrag::canDecode (const TQMimeSource* e) { + return TQTextDrag::canDecode(e); } -bool PhraseBookDrag::decode (const QMimeSource *e, PhraseBook *book) { - QString string; - QCString subtype1 = "x-xml-phrasebook"; - QCString subtype2 = "xml"; +bool PhraseBookDrag::decode (const TQMimeSource *e, PhraseBook *book) { + TQString string; + TQCString subtype1 = "x-xml-phrasebook"; + TQCString subtype2 = "xml"; - if (!QTextDrag::decode(e, string, subtype1)) - if (!QTextDrag::decode(e, string, subtype2)) { - if (QTextDrag::decode(e, string)) { + if (!TQTextDrag::decode(e, string, subtype1)) + if (!TQTextDrag::decode(e, string, subtype2)) { + if (TQTextDrag::decode(e, string)) { *book += PhraseBookEntry(Phrase(string, ""), 0, true); return true; } diff --git a/kmouth/phrasebook/phrasebook.h b/kmouth/phrasebook/phrasebook.h index 83cb3a9..b0133b1 100644 --- a/kmouth/phrasebook/phrasebook.h +++ b/kmouth/phrasebook/phrasebook.h @@ -18,9 +18,9 @@ #ifndef PHRASEBOOK_H #define PHRASEBOOK_H -#include <qobject.h> -#include <qdragobject.h> -#include <qxml.h> +#include <tqobject.h> +#include <tqdragobject.h> +#include <tqxml.h> #include <kaction.h> #include <kprinter.h> @@ -35,18 +35,18 @@ class Phrase { friend class PhraseBookParser; public: Phrase(); - Phrase (const QString &phrase); - Phrase (const QString &phrase, const QString &shortcut); + Phrase (const TQString &phrase); + Phrase (const TQString &phrase, const TQString &shortcut); - QString getPhrase() const; - QString getShortcut() const; + TQString getPhrase() const; + TQString getShortcut() const; - void setPhrase (const QString &phrase); - void setShortcut (const QString &shortcut); + void setPhrase (const TQString &phrase); + void setShortcut (const TQString &shortcut); private: - QString phrase; - QString shortcut; + TQString phrase; + TQString shortcut; }; /** @@ -72,7 +72,7 @@ private: int level; }; -typedef QValueList<PhraseBookEntry> PhraseBookEntryList; +typedef TQValueList<PhraseBookEntry> PhraseBookEntryList; /** * The class PhraseBook implements a phrase book. It mainly stores a @@ -96,10 +96,10 @@ public: bool open (const KURL &url); /** decodes a phrase book. Returns true if successful. */ - bool decode (const QString &xml); + bool decode (const TQString &xml); /** decodes a phrase book. Returns true if successful. */ - bool decode (QXmlInputSource &source); + bool decode (TQXmlInputSource &source); /** Writes the phrases to a file. Returns true if successful. */ bool save (const KURL &url); @@ -107,8 +107,8 @@ public: /** Writes the phrases to a file. Returns true if successful. */ bool save (const KURL &url, bool asPhrasebook); - /** Writes the phrases to a QTextStream. */ - void save (QTextStream &stream, bool asPhrasebook); + /** Writes the phrases to a TQTextStream. */ + void save (TQTextStream &stream, bool asPhrasebook); /** Prints the phrases. */ void print (KPrinter *pPrinter); @@ -118,63 +118,63 @@ public: * 0, if the user canceled the operation, * -1, if there was an error when saving the file. */ - int save (QWidget *parent, const QString &title, KURL &url, bool phrasebookFirst = true); + int save (TQWidget *parent, const TQString &title, KURL &url, bool phrasebookFirst = true); /** encodes the phrase book. Returns the encoded xml code. */ - QString encode (); + TQString encode (); - /** Stores all entries in a QStringList. All hierarchy information and all + /** Stores all entries in a TQStringList. All hierarchy information and all * shortcuts are ignored during this operation. */ - QStringList toStringList(); + TQStringList toStringList(); /** Adds the entries of the book to both the given popup menu and the given * toolbar. The corresponding actions will be inserted into phrases. */ - void addToGUI (QPopupMenu *popup, KToolBar *toolbar, + void addToGUI (TQPopupMenu *popup, KToolBar *toolbar, KActionCollection *phrases, - QObject *receiver, const char *slot) const; + TQObject *receiver, const char *slot) const; /** Inserts book into a new sub phrase book. * @param name the name of the new sub phrase book. * @param book the phrase book to insert. */ - void insert (const QString &name, const PhraseBook &book); + void insert (const TQString &name, const PhraseBook &book); }; /** * The class PhraseBookDrag implements drag and drop support for phrase books. * @author Gunnar Schmi Dt */ -class PhraseBookDrag: public QDragObject { +class PhraseBookDrag: public TQDragObject { Q_OBJECT public: - PhraseBookDrag (PhraseBook *book, QWidget *dragSource = 0, const char *name = 0); - PhraseBookDrag (QWidget *dragSource = 0, const char *name = 0); + PhraseBookDrag (PhraseBook *book, TQWidget *dragSource = 0, const char *name = 0); + PhraseBookDrag (TQWidget *dragSource = 0, const char *name = 0); ~PhraseBookDrag (); virtual void setBook (PhraseBook *book); const char *format (int i) const; - virtual QByteArray encodedData (const char *) const; + virtual TQByteArray encodedData (const char *) const; - static bool canDecode (const QMimeSource *e); - static bool decode (const QMimeSource *e, PhraseBook *book); + static bool canDecode (const TQMimeSource *e); + static bool decode (const TQMimeSource *e, PhraseBook *book); private: bool isEmpty; - QTextDrag xmlphrasebook; - QTextDrag xml; - QTextDrag plain; + TQTextDrag xmlphrasebook; + TQTextDrag xml; + TQTextDrag plain; }; class PhraseAction : public KAction { Q_OBJECT public: - PhraseAction (const QString& phrase, const QString& cut, const QObject* receiver, const char* slot, KActionCollection* parent) + PhraseAction (const TQString& phrase, const TQString& cut, const TQObject* receiver, const char* slot, KActionCollection* parent) : KAction (phrase, "phrase", KShortcut(cut), 0, 0, parent, phrase.latin1()) { this->phrase = phrase; - connect (this, SIGNAL(slotActivated (const QString &)), receiver, slot); + connect (this, TQT_SIGNAL(slotActivated (const TQString &)), receiver, slot); }; ~PhraseAction () { } @@ -186,10 +186,10 @@ public slots: } signals: - void slotActivated (const QString &phrase); + void slotActivated (const TQString &phrase); private: - QString phrase; + TQString phrase; }; #endif diff --git a/kmouth/phrasebook/phrasebookdialog.cpp b/kmouth/phrasebook/phrasebookdialog.cpp index cc79d2f..2abe3d0 100644 --- a/kmouth/phrasebook/phrasebookdialog.cpp +++ b/kmouth/phrasebook/phrasebookdialog.cpp @@ -16,18 +16,18 @@ ***************************************************************************/ // include files for QT -#include <qapplication.h> -#include <qlayout.h> -#include <qclipboard.h> -#include <qradiobutton.h> -#include <qevent.h> -#include <qpainter.h> -#include <qstyle.h> -#include <qgroupbox.h> -#include <qpopupmenu.h> -#include <qvaluestack.h> -#include <qptrstack.h> -#include <qwhatsthis.h> +#include <tqapplication.h> +#include <tqlayout.h> +#include <tqclipboard.h> +#include <tqradiobutton.h> +#include <tqevent.h> +#include <tqpainter.h> +#include <tqstyle.h> +#include <tqgroupbox.h> +#include <tqpopupmenu.h> +#include <tqvaluestack.h> +#include <tqptrstack.h> +#include <tqwhatsthis.h> // include files for KDE #include <kpopupmenu.h> @@ -53,9 +53,9 @@ namespace PhraseBookPrivate { }; } -CheckBookItem::CheckBookItem (QListViewItem *parent, QListViewItem *last, - const QString &text, const QString &name, const QString &filename) - : QCheckListItem (parent, text, QCheckListItem::CheckBox) +CheckBookItem::CheckBookItem (TQListViewItem *parent, TQListViewItem *last, + const TQString &text, const TQString &name, const TQString &filename) + : TQCheckListItem (parent, text, TQCheckListItem::CheckBox) { moveItem (last); setText(PhraseBookPrivate::name, name); @@ -70,9 +70,9 @@ CheckBookItem::CheckBookItem (QListViewItem *parent, QListViewItem *last, ((CheckBookItem*)parent)->childChange (numberOfBooks, selectedBooks); } -CheckBookItem::CheckBookItem (QListView *parent, QListViewItem *last, - const QString &text, const QString &name, const QString &filename) - : QCheckListItem (parent, text, QCheckListItem::CheckBox) +CheckBookItem::CheckBookItem (TQListView *parent, TQListViewItem *last, + const TQString &text, const TQString &name, const TQString &filename) + : TQCheckListItem (parent, text, TQCheckListItem::CheckBox) { moveItem (last); setText(PhraseBookPrivate::name, name); @@ -90,7 +90,7 @@ CheckBookItem::~CheckBookItem () { } void CheckBookItem::activate() { - QListView *lv = listView(); + TQListView *lv = listView(); if ((lv != 0) && (!lv->isEnabled()) || (!isEnabled())) return; @@ -100,9 +100,9 @@ void CheckBookItem::activate() { } void CheckBookItem::stateChange (bool on) { - QListViewItem *item = firstChild(); + TQListViewItem *item = firstChild(); if (item == 0) { - QListViewItem *parent = this->parent(); + TQListViewItem *parent = this->parent(); if (parent != 0) { if (on) ((CheckBookItem*)parent)->childChange (0, 1); @@ -114,10 +114,10 @@ void CheckBookItem::stateChange (bool on) { } void CheckBookItem::propagateStateChange () { - QListViewItem *item = firstChild(); + TQListViewItem *item = firstChild(); while (item != 0) { - if (isOn() != ((QCheckListItem*)item)->isOn()) - ((QCheckListItem*)item)->setOn (isOn()); + if (isOn() != ((TQCheckListItem*)item)->isOn()) + ((TQCheckListItem*)item)->setOn (isOn()); else ((CheckBookItem*)item)->propagateStateChange (); item = item->nextSibling(); @@ -127,22 +127,22 @@ void CheckBookItem::propagateStateChange () { void CheckBookItem::childChange (int numberDiff, int selDiff) { numberOfBooks += numberDiff; selectedBooks += selDiff; - QListViewItem *parent = this->parent(); + TQListViewItem *parent = this->parent(); if (parent != 0) ((CheckBookItem*)parent)->childChange (numberDiff, selDiff); - QString text = i18n(" (%1 of %2 books selected)"); + TQString text = i18n(" (%1 of %2 books selected)"); text = text.arg(selectedBooks).arg(numberOfBooks); setText(0, this->text(PhraseBookPrivate::name)+text); } /***************************************************************************/ -InitialPhraseBookWidget::InitialPhraseBookWidget (QWidget *parent, const char *name) - : QWidget(parent, name) +InitialPhraseBookWidget::InitialPhraseBookWidget (TQWidget *parent, const char *name) + : TQWidget(parent, name) { - QVBoxLayout *mainLayout = new QVBoxLayout (this, 0, KDialog::spacingHint()); - QLabel *label = new QLabel (i18n("Please decide which phrase books you need:"), this, "booksTitle"); + TQVBoxLayout *mainLayout = new TQVBoxLayout (this, 0, KDialog::spacingHint()); + TQLabel *label = new TQLabel (i18n("Please decide which phrase books you need:"), this, "booksTitle"); mainLayout->add (label); books = new KListView (this, "books"); @@ -153,7 +153,7 @@ InitialPhraseBookWidget::InitialPhraseBookWidget (QWidget *parent, const char *n books->addColumn (i18n("Book")); books->setRootIsDecorated (true); books->setAllColumnsShowFocus (true); - books->setSelectionMode (QListView::Multi); + books->setSelectionMode (TQListView::Multi); mainLayout->add (books); initStandardPhraseBooks(); @@ -165,17 +165,17 @@ InitialPhraseBookWidget::~InitialPhraseBookWidget () { void InitialPhraseBookWidget::initStandardPhraseBooks() { StandardBookList bookPaths = PhraseBookDialog::standardPhraseBooks(); - QListViewItem *parent = 0; - QListViewItem *last = 0; - QStringList currentNamePath = ""; - QPtrStack<QListViewItem> stack; + TQListViewItem *parent = 0; + TQListViewItem *last = 0; + TQStringList currentNamePath = ""; + TQPtrStack<TQListViewItem> stack; StandardBookList::iterator it; for (it = bookPaths.begin(); it != bookPaths.end(); ++it) { - QString namePath = (*it).path; - QStringList dirs = QStringList::split("/", namePath); + TQString namePath = (*it).path; + TQStringList dirs = TQStringList::split("/", namePath); - QStringList::iterator it1=currentNamePath.begin(); - QStringList::iterator it2=dirs.begin(); + TQStringList::iterator it1=currentNamePath.begin(); + TQStringList::iterator it2=dirs.begin(); for (; (it1 != currentNamePath.end()) && (it1 != dirs.end()) && (*it1 == *it2); ++it1, ++it2); for (; it1 != currentNamePath.end(); ++it1) { @@ -184,17 +184,17 @@ void InitialPhraseBookWidget::initStandardPhraseBooks() { } for (; it2 != dirs.end(); ++it2) { stack.push (parent); - QListViewItem *newParent; + TQListViewItem *newParent; if (parent == 0) - newParent = new CheckBookItem (books, last, *it2, *it2, QString::null); + newParent = new CheckBookItem (books, last, *it2, *it2, TQString::null); else - newParent = new CheckBookItem (parent, last, *it2, *it2, QString::null); + newParent = new CheckBookItem (parent, last, *it2, *it2, TQString::null); parent = newParent; last = 0; } currentNamePath = dirs; - QListViewItem *book; + TQListViewItem *book; if (parent == 0) book = new CheckBookItem (books, last, (*it).name, (*it).name, (*it).filename); else @@ -205,13 +205,13 @@ void InitialPhraseBookWidget::initStandardPhraseBooks() { void InitialPhraseBookWidget::createBook () { PhraseBook book; - QListViewItem *item = books->firstChild(); + TQListViewItem *item = books->firstChild(); while (item != 0) { if (item->firstChild() != 0) { item = item->firstChild(); } else { - if (((QCheckListItem*)item)->isOn()) { + if (((TQCheckListItem*)item)->isOn()) { PhraseBook localBook; localBook.open(KURL( item->text(PhraseBookPrivate::filename ))); book += localBook; @@ -225,7 +225,7 @@ void InitialPhraseBookWidget::createBook () { } } - QString bookLocation = KApplication::kApplication()->dirs()->saveLocation ("appdata", "/"); + TQString bookLocation = KApplication::kApplication()->dirs()->saveLocation ("appdata", "/"); if (!bookLocation.isNull() && !bookLocation.isEmpty()) { book.save (KURL( bookLocation + "standard.phrasebook" )); } @@ -233,15 +233,15 @@ void InitialPhraseBookWidget::createBook () { /***************************************************************************/ -ButtonBoxWidget::ButtonBoxWidget (QWidget *parent, const char *name) +ButtonBoxWidget::ButtonBoxWidget (TQWidget *parent, const char *name) : ButtonBoxUI (parent, name) { - keyButtonPlaceLayout = new QGridLayout (keyButtonPlace, 1, 1, 0, 0, "keyButtonPlaceLayout"); + keyButtonPlaceLayout = new TQGridLayout (keyButtonPlace, 1, 1, 0, 0, "keyButtonPlaceLayout"); keyButton = new KKeyButton (keyButtonPlace, "key"); keyButtonPlaceLayout->addWidget (keyButton, 1,1); - QWhatsThis::add (keyButton, i18n("By clicking on this button you can select the keyboard shortcut associated with the selected phrase.")); + TQWhatsThis::add (keyButton, i18n("By clicking on this button you can select the keyboard shortcut associated with the selected phrase.")); - group = new QButtonGroup (phrasebox); + group = new TQButtonGroup (phrasebox); group->hide(); group->setExclusive (true); group->insert (noKey); @@ -264,7 +264,7 @@ PhraseBookDialog::PhraseBookDialog () initGUI(); initActions(); initStandardPhraseBooks(); - QString standardBook = KApplication::kApplication()->dirs()->findResource("appdata", "standard.phrasebook"); + TQString standardBook = KApplication::kApplication()->dirs()->findResource("appdata", "standard.phrasebook"); if (!standardBook.isNull() && !standardBook.isEmpty()) { PhraseBook book; book.open(KURL( standardBook )); @@ -288,9 +288,9 @@ PhraseBookDialog::~PhraseBookDialog() { } void PhraseBookDialog::initGUI () { - QWidget *page = new QWidget( this ); + TQWidget *page = new TQWidget( this ); setCentralWidget(page); - QVBoxLayout *mainLayout = new QVBoxLayout (page, 0); + TQVBoxLayout *mainLayout = new TQVBoxLayout (page, 0); treeView = new PhraseTree (page, "phrasetree"); treeView->setSorting (-1); @@ -301,19 +301,19 @@ void PhraseBookDialog::initGUI () { treeView->addColumn (i18n("Shortcut")); treeView->setRootIsDecorated (true); treeView->setAllColumnsShowFocus (true); - treeView->setSelectionMode (QListView::Extended); - QWhatsThis::add (treeView, i18n("This list contains the current phrase book in a tree structure. You can select and modify individual phrases and sub phrase books")); - connect (treeView, SIGNAL(selectionChanged()), this, SLOT(selectionChanged())); - connect (treeView, SIGNAL(contextMenuRequested (QListViewItem *, const QPoint &, int)), this, SLOT(contextMenuRequested (QListViewItem *, const QPoint &, int))); - connect (treeView, SIGNAL(dropped (QDropEvent *, QListViewItem *, QListViewItem *)), this, SLOT(slotDropped (QDropEvent *, QListViewItem *, QListViewItem *))); - connect (treeView, SIGNAL(moved (QListViewItem *, QListViewItem *, QListViewItem *)), this, SLOT(slotMoved (QListViewItem *, QListViewItem *, QListViewItem *))); + treeView->setSelectionMode (TQListView::Extended); + TQWhatsThis::add (treeView, i18n("This list contains the current phrase book in a tree structure. You can select and modify individual phrases and sub phrase books")); + connect (treeView, TQT_SIGNAL(selectionChanged()), this, TQT_SLOT(selectionChanged())); + connect (treeView, TQT_SIGNAL(contextMenuRequested (TQListViewItem *, const TQPoint &, int)), this, TQT_SLOT(contextMenuRequested (TQListViewItem *, const TQPoint &, int))); + connect (treeView, TQT_SIGNAL(dropped (TQDropEvent *, TQListViewItem *, TQListViewItem *)), this, TQT_SLOT(slotDropped (TQDropEvent *, TQListViewItem *, TQListViewItem *))); + connect (treeView, TQT_SIGNAL(moved (TQListViewItem *, TQListViewItem *, TQListViewItem *)), this, TQT_SLOT(slotMoved (TQListViewItem *, TQListViewItem *, TQListViewItem *))); mainLayout->addWidget (treeView); buttonBox = new ButtonBoxWidget (page, "buttonbox"); - connect (buttonBox->lineEdit, SIGNAL(textChanged(const QString &)), SLOT(slotTextChanged(const QString &))); - connect (buttonBox->noKey, SIGNAL(clicked()), SLOT(slotNoKey())); - connect (buttonBox->customKey, SIGNAL(clicked()), SLOT(slotCustomKey())); - connect (buttonBox->keyButton, SIGNAL(capturedShortcut(const KShortcut&)), SLOT(capturedShortcut(const KShortcut&))); + connect (buttonBox->lineEdit, TQT_SIGNAL(textChanged(const TQString &)), TQT_SLOT(slotTextChanged(const TQString &))); + connect (buttonBox->noKey, TQT_SIGNAL(clicked()), TQT_SLOT(slotNoKey())); + connect (buttonBox->customKey, TQT_SIGNAL(clicked()), TQT_SLOT(slotCustomKey())); + connect (buttonBox->keyButton, TQT_SIGNAL(capturedShortcut(const KShortcut&)), TQT_SLOT(capturedShortcut(const KShortcut&))); mainLayout->addWidget (buttonBox); treeView->setFocus(); @@ -322,23 +322,23 @@ void PhraseBookDialog::initGUI () { void PhraseBookDialog::initActions() { // The file menu - fileNewPhrase = new KAction (i18n("&New Phrase"), "phrase_new", 0, this, SLOT(slotAddPhrase()), actionCollection(),"file_new_phrase"); + fileNewPhrase = new KAction (i18n("&New Phrase"), "phrase_new", 0, this, TQT_SLOT(slotAddPhrase()), actionCollection(),"file_new_phrase"); fileNewPhrase->setStatusText(i18n("Adds a new phrase")); fileNewPhrase->setWhatsThis (i18n("Adds a new phrase")); - fileNewBook = new KAction (i18n("New Phrase &Book"), "phrasebook_new", 0, this, SLOT(slotAddPhrasebook()), actionCollection(),"file_new_book"); + fileNewBook = new KAction (i18n("New Phrase &Book"), "phrasebook_new", 0, this, TQT_SLOT(slotAddPhrasebook()), actionCollection(),"file_new_book"); fileNewBook->setStatusText(i18n("Adds a new phrase book into which other books and phrases can be placed")); fileNewBook->setWhatsThis (i18n("Adds a new phrase book into which other books and phrases can be placed")); - fileSave = KStdAction::save(this, SLOT(slotSave()), actionCollection()); + fileSave = KStdAction::save(this, TQT_SLOT(slotSave()), actionCollection()); fileSave->setStatusText(i18n("Saves the phrase book onto the hard disk")); fileSave->setWhatsThis (i18n("Saves the phrase book onto the hard disk")); - fileImport = new KAction (i18n("&Import..."), "phrasebook_open", 0, this, SLOT(slotImportPhrasebook()), actionCollection(),"file_import"); + fileImport = new KAction (i18n("&Import..."), "phrasebook_open", 0, this, TQT_SLOT(slotImportPhrasebook()), actionCollection(),"file_import"); fileImport->setStatusText(i18n("Imports a file and adds its contents to the phrase book")); fileImport->setWhatsThis (i18n("Imports a file and adds its contents to the phrase book")); - toolbarImport = new KToolBarPopupAction (i18n("&Import..."), "phrasebook_open", 0, this, SLOT(slotImportPhrasebook()), actionCollection(),"toolbar_import"); + toolbarImport = new KToolBarPopupAction (i18n("&Import..."), "phrasebook_open", 0, this, TQT_SLOT(slotImportPhrasebook()), actionCollection(),"toolbar_import"); toolbarImport->setStatusText(i18n("Imports a file and adds its contents to the phrase book")); toolbarImport->setWhatsThis (i18n("Imports a file and adds its contents to the phrase book")); @@ -346,32 +346,32 @@ void PhraseBookDialog::initActions() { fileImportStandardBook->setStatusText(i18n("Imports a standard phrase book and adds its contents to the phrase book")); fileImportStandardBook->setWhatsThis (i18n("Imports a standard phrase book and adds its contents to the phrase book")); - fileExport = new KAction (i18n("&Export..."), "phrasebook_save", 0, this, SLOT(slotExportPhrasebook()), actionCollection(),"file_export"); + fileExport = new KAction (i18n("&Export..."), "phrasebook_save", 0, this, TQT_SLOT(slotExportPhrasebook()), actionCollection(),"file_export"); fileExport->setStatusText(i18n("Exports the currently selected phrase(s) or phrase book(s) into a file")); fileExport->setWhatsThis (i18n("Exports the currently selected phrase(s) or phrase book(s) into a file")); - filePrint = KStdAction::print(this, SLOT(slotPrint()), actionCollection()); + filePrint = KStdAction::print(this, TQT_SLOT(slotPrint()), actionCollection()); filePrint->setStatusText(i18n("Prints the currently selected phrase(s) or phrase book(s)")); filePrint->setWhatsThis (i18n("Prints the currently selected phrase(s) or phrase book(s)")); - fileClose = KStdAction::close(this, SLOT(close()), actionCollection()); + fileClose = KStdAction::close(this, TQT_SLOT(close()), actionCollection()); fileClose->setStatusText(i18n("Closes the window")); fileClose->setWhatsThis (i18n("Closes the window")); // The edit menu - editCut = KStdAction::cut(this, SLOT(slotCut()), actionCollection()); + editCut = KStdAction::cut(this, TQT_SLOT(slotCut()), actionCollection()); editCut->setStatusText(i18n("Cuts the currently selected entries from the phrase book and puts it to the clipboard")); editCut->setWhatsThis (i18n("Cuts the currently selected entries from the phrase book and puts it to the clipboard")); - editCopy = KStdAction::copy(this, SLOT(slotCopy()), actionCollection()); + editCopy = KStdAction::copy(this, TQT_SLOT(slotCopy()), actionCollection()); editCopy->setStatusText(i18n("Copies the currently selected entry from the phrase book to the clipboard")); editCopy->setWhatsThis (i18n("Copies the currently selected entry from the phrase book to the clipboard")); - editPaste = KStdAction::paste(this, SLOT(slotPaste()), actionCollection()); + editPaste = KStdAction::paste(this, TQT_SLOT(slotPaste()), actionCollection()); editPaste->setStatusText(i18n("Pastes the clipboard contents to actual position")); editPaste->setWhatsThis (i18n("Pastes the clipboard contents to actual position")); - editDelete = new KAction (i18n("&Delete"), "editdelete", 0, this, SLOT(slotRemove()), actionCollection(),"edit_delete"); + editDelete = new KAction (i18n("&Delete"), "editdelete", 0, this, TQT_SLOT(slotRemove()), actionCollection(),"edit_delete"); editDelete->setStatusText(i18n("Deletes the selected entries from the phrase book")); editDelete->setWhatsThis (i18n("Deletes the selected entries from the phrase book")); @@ -379,17 +379,17 @@ void PhraseBookDialog::initActions() { createGUI("phrasebookdialogui.rc"); } -QString PhraseBookDialog::displayPath (QString filename) { - QFileInfo file(filename); - QString path = file.dirPath(); - QString dispPath = ""; - uint position = path.find("/kmouth/books/")+QString("/kmouth/books/").length(); +TQString PhraseBookDialog::displayPath (TQString filename) { + TQFileInfo file(filename); + TQString path = file.dirPath(); + TQString dispPath = ""; + uint position = path.find("/kmouth/books/")+TQString("/kmouth/books/").length(); while (path.length() > position) { file.setFile(path); KDesktopFile *dirDesc = new KDesktopFile(path+"/.directory", true, "data"); - QString name = dirDesc->readName(); + TQString name = dirDesc->readName(); delete dirDesc; if (name.isNull() || name.isEmpty()) @@ -403,11 +403,11 @@ QString PhraseBookDialog::displayPath (QString filename) { } StandardBookList PhraseBookDialog::standardPhraseBooks() { - QStringList bookPaths = KGlobal::instance()->dirs()->findAllResources ( + TQStringList bookPaths = KGlobal::instance()->dirs()->findAllResources ( "data", "kmouth/books/*.phrasebook", true, true); - QStringList bookNames; - QMap<QString,StandardBook> bookMap; - QStringList::iterator it; + TQStringList bookNames; + TQMap<TQString,StandardBook> bookMap; + TQStringList::iterator it; for (it = bookPaths.begin(); it != bookPaths.end(); ++it) { PhraseBook pbook; if (pbook.open (KURL( *it ))) { @@ -435,18 +435,18 @@ void PhraseBookDialog::initStandardPhraseBooks () { StandardBookList bookPaths = standardPhraseBooks(); KActionMenu *parent = fileImportStandardBook; - QStringList currentNamePath = "x"; - QPtrStack<KActionMenu> stack; + TQStringList currentNamePath = "x"; + TQPtrStack<KActionMenu> stack; StandardBookList::iterator it; for (it = bookPaths.begin(); it != bookPaths.end(); ++it) { KURL url; url.setPath((*it).filename); - QString namePath = "x/"+(*it).path; - QStringList dirs = QStringList::split("/", namePath); + TQString namePath = "x/"+(*it).path; + TQStringList dirs = TQStringList::split("/", namePath); - QStringList::iterator it1=currentNamePath.begin(); - QStringList::iterator it2=dirs.begin(); + TQStringList::iterator it1=currentNamePath.begin(); + TQStringList::iterator it2=dirs.begin(); for (; (it1 != currentNamePath.end()) && (it1 != dirs.end()) && (*it1 == *it2); ++it1, ++it2); for (; it1 != currentNamePath.end(); ++it1) @@ -462,21 +462,21 @@ void PhraseBookDialog::initStandardPhraseBooks () { currentNamePath = dirs; KAction *book = new StandardPhraseBookInsertAction ( - url, (*it).name, this, SLOT(slotImportPhrasebook (const KURL &)), actionCollection()); + url, (*it).name, this, TQT_SLOT(slotImportPhrasebook (const KURL &)), actionCollection()); parent->insert(book); if (parent == fileImportStandardBook) book->plug(toolbarImport->popupMenu()); } } -PhraseTreeItem *selectedItem (QListView *treeView) { +PhraseTreeItem *selectedItem (TQListView *treeView) { PhraseTreeItem *currentItem = (PhraseTreeItem *)treeView->currentItem(); if ((currentItem == 0) || (!currentItem->isSelected())) return 0; - QListViewItemIterator it(treeView); + TQListViewItemIterator it(treeView); while (it.current()) { - QListViewItem *item = it.current(); + TQListViewItem *item = it.current(); if (item->isSelected() && (item != currentItem)) return 0; ++it; @@ -508,7 +508,7 @@ void PhraseBookDialog::selectionChanged () { buttonBox->lineEdit->setText(currentItem->text(0)); buttonBox->lineEdit->setEnabled(true); buttonBox->shortcutLabel->setEnabled(true); - QString shortcut = currentItem->text(1); + TQString shortcut = currentItem->text(1); buttonBox->keyButton->setShortcut(currentItem->cut(), false); if (shortcut.isEmpty() || shortcut.isNull()) { buttonBox->noKey->setChecked (true); @@ -554,7 +554,7 @@ bool PhraseBookDialog::queryClose() { return true; } -void PhraseBookDialog::slotTextChanged (const QString &s) { +void PhraseBookDialog::slotTextChanged (const TQString &s) { PhraseTreeItem *currentItem = selectedItem (treeView); if (currentItem != 0) currentItem->setText(0, s); @@ -567,7 +567,7 @@ void PhraseBookDialog::slotNoKey() { PhraseTreeItem *currentItem = selectedItem (treeView); if (currentItem != 0) { - currentItem->setCut (KShortcut(QString::null)); + currentItem->setCut (KShortcut(TQString::null)); buttonBox->keyButton->setShortcut(currentItem->cut(), false); } phrasebookChanged = true; @@ -593,11 +593,11 @@ void PhraseBookDialog::setShortcut( const KShortcut& cut ) { const KKey& key = seq.key(0); if (key.modFlags() == 0 && key.sym() < 0x3000 - && QChar(key.sym()).isLetterOrNumber()) + && TQChar(key.sym()).isLetterOrNumber()) { - QString s = i18n("In order to use the '%1' key as a shortcut, " + TQString s = i18n("In order to use the '%1' key as a shortcut, " "it must be combined with the " - "Win, Alt, Ctrl, and/or Shift keys.").arg(QChar(key.sym())); + "Win, Alt, Ctrl, and/or Shift keys.").arg(TQChar(key.sym())); KMessageBox::sorry( this, s, i18n("Invalid Shortcut Key") ); return; } @@ -615,8 +615,8 @@ void PhraseBookDialog::setShortcut( const KShortcut& cut ) { } } -QListViewItem *PhraseBookDialog::addBook (QListViewItem *parent, QListViewItem *after, PhraseBook *book) { - QListViewItem *newItem = treeView->addBook(parent, after, book); +TQListViewItem *PhraseBookDialog::addBook (TQListViewItem *parent, TQListViewItem *after, PhraseBook *book) { + TQListViewItem *newItem = treeView->addBook(parent, after, book); if (newItem != 0) { treeView->clearSelection(); treeView->ensureItemVisible(newItem); @@ -627,7 +627,7 @@ QListViewItem *PhraseBookDialog::addBook (QListViewItem *parent, QListViewItem * return newItem; } -QListViewItem *PhraseBookDialog::addBook (QListViewItem *item, PhraseBook *book) { +TQListViewItem *PhraseBookDialog::addBook (TQListViewItem *item, PhraseBook *book) { if (item == 0) return addBook(0, 0, book); else if (((PhraseTreeItem *)item)->isPhrase() || !item->isOpen()) @@ -639,14 +639,14 @@ QListViewItem *PhraseBookDialog::addBook (QListViewItem *item, PhraseBook *book) return addBook(item, 0, book); } -void PhraseBookDialog::contextMenuRequested(QListViewItem *, const QPoint &pos, int) { - QString name; +void PhraseBookDialog::contextMenuRequested(TQListViewItem *, const TQPoint &pos, int) { + TQString name; if (treeView->hasSelectedItems()) name = "phrasebook_popup_sel"; else name = "phrasebook_popup_nosel"; - QPopupMenu *popup = (QPopupMenu *)factory()->container(name,this); + TQPopupMenu *popup = (TQPopupMenu *)factory()->container(name,this); if (popup != 0) { popup->popup(pos, 0); } @@ -667,24 +667,24 @@ void PhraseBookDialog::slotCut () { void PhraseBookDialog::slotCopy () { PhraseBook book; treeView->fillBook (&book, true); - QApplication::clipboard()->setData(new PhraseBookDrag(&book)); + TQApplication::clipboard()->setData(new PhraseBookDrag(&book)); } void PhraseBookDialog::slotPaste () { PhraseBook book; - if (PhraseBookDrag::decode(QApplication::clipboard()->data(), &book)) { + if (PhraseBookDrag::decode(TQApplication::clipboard()->data(), &book)) { addBook (treeView->currentItem(), &book); } } -void PhraseBookDialog::slotDropped (QDropEvent *e, QListViewItem *parent, QListViewItem *after) { +void PhraseBookDialog::slotDropped (TQDropEvent *e, TQListViewItem *parent, TQListViewItem *after) { PhraseBook book; if (PhraseBookDrag::decode(e, &book)) { addBook(parent, after, &book); } } -void PhraseBookDialog::slotMoved (QListViewItem *item, QListViewItem *, QListViewItem *) { +void PhraseBookDialog::slotMoved (TQListViewItem *item, TQListViewItem *, TQListViewItem *) { treeView->ensureItemVisible(item); treeView->setSelected (item, true); phrasebookChanged = true; @@ -695,7 +695,7 @@ void PhraseBookDialog::slotAddPhrasebook () { Phrase phrase(i18n("(New Phrase Book)"), ""); book += PhraseBookEntry(phrase, 0, false); - QListViewItem *item = addBook (treeView->currentItem(), &book); + TQListViewItem *item = addBook (treeView->currentItem(), &book); item->setOpen (true); buttonBox->lineEdit->selectAll(); buttonBox->lineEdit->setFocus(); @@ -719,7 +719,7 @@ void PhraseBookDialog::slotSave () { } void PhraseBookDialog::slotImportPhrasebook () { - KURL url=KFileDialog::getOpenURL(QString::null, + KURL url=KFileDialog::getOpenURL(TQString::null, i18n("*.phrasebook|Phrase Books (*.phrasebook)\n*.txt|Plain Text Files (*.txt)\n*|All Files"), this, i18n("Import Phrasebook")); slotImportPhrasebook (url); diff --git a/kmouth/phrasebook/phrasebookdialog.h b/kmouth/phrasebook/phrasebookdialog.h index 774387f..d086299 100644 --- a/kmouth/phrasebook/phrasebookdialog.h +++ b/kmouth/phrasebook/phrasebookdialog.h @@ -18,11 +18,11 @@ #ifndef PHRASEBOOKDIALOG_H #define PHRASEBOOKDIALOG_H -#include <qbutton.h> -#include <qradiobutton.h> -#include <qbuttongroup.h> -#include <qlabel.h> -#include <qlistview.h> +#include <tqbutton.h> +#include <tqradiobutton.h> +#include <tqbuttongroup.h> +#include <tqlabel.h> +#include <tqlistview.h> #include <kmainwindow.h> #include <klineedit.h> #include <kkeybutton.h> @@ -38,22 +38,22 @@ class QString; class KListView; struct StandardBook { - QString name; - QString path; - QString filename; + TQString name; + TQString path; + TQString filename; }; -typedef QValueList<StandardBook> StandardBookList; +typedef TQValueList<StandardBook> StandardBookList; /**The class PhraseTreeItem is an ListViewItem for either a phrase or a phrase book. *@author Gunnar Schmi Dt */ -class CheckBookItem : public QCheckListItem { +class CheckBookItem : public TQCheckListItem { public: - CheckBookItem (QListViewItem *parent, QListViewItem *last, - const QString &text, const QString &name, const QString &filename); - CheckBookItem (QListView *parent, QListViewItem *last, - const QString &text, const QString &name, const QString &filename); + CheckBookItem (TQListViewItem *parent, TQListViewItem *last, + const TQString &text, const TQString &name, const TQString &filename); + CheckBookItem (TQListView *parent, TQListViewItem *last, + const TQString &text, const TQString &name, const TQString &filename); ~CheckBookItem(); protected: @@ -72,10 +72,10 @@ private: * @author Gunnar Schmi Dt */ -class InitialPhraseBookWidget : public QWidget { +class InitialPhraseBookWidget : public TQWidget { Q_OBJECT public: - InitialPhraseBookWidget(QWidget *parent, const char *name); + InitialPhraseBookWidget(TQWidget *parent, const char *name); ~InitialPhraseBookWidget(); void createBook(); @@ -95,10 +95,10 @@ private: class StandardPhraseBookInsertAction : public KAction { Q_OBJECT public: - StandardPhraseBookInsertAction (const KURL &url, const QString& name, const QObject* receiver, const char* slot, KActionCollection* parent) + StandardPhraseBookInsertAction (const KURL &url, const TQString& name, const TQObject* receiver, const char* slot, KActionCollection* parent) : KAction (name, "phrasebook", 0, 0, 0, parent, 0) { this->url = url; - connect (this, SIGNAL(slotActivated (const KURL &)), receiver, slot); + connect (this, TQT_SIGNAL(slotActivated (const KURL &)), receiver, slot); }; ~StandardPhraseBookInsertAction () { }; @@ -123,14 +123,14 @@ private: */ class ButtonBoxWidget : public ButtonBoxUI { public: - ButtonBoxWidget (QWidget *parent = 0, const char *name = 0); + ButtonBoxWidget (TQWidget *parent = 0, const char *name = 0); ~ButtonBoxWidget (); KKeyButton *keyButton; - QButtonGroup *group; + TQButtonGroup *group; protected: - QGridLayout *keyButtonPlaceLayout; + TQGridLayout *keyButtonPlaceLayout; }; /** @@ -147,7 +147,7 @@ private: */ PhraseBookDialog (); - static QString displayPath (QString path); + static TQString displayPath (TQString path); public: /** Returns a pointer to the instance of this dialog. As a part off the @@ -162,13 +162,13 @@ public: bool queryClose (); public slots: - void slotTextChanged (const QString &s); + void slotTextChanged (const TQString &s); void slotNoKey(); void slotCustomKey(); void capturedShortcut (const KShortcut& cut); void selectionChanged (); - void contextMenuRequested(QListViewItem *, const QPoint &pos, int); + void contextMenuRequested(TQListViewItem *, const TQPoint &pos, int); void slotRemove (); void slotCut (); @@ -184,8 +184,8 @@ public slots: void slotExportPhrasebook (); void slotPrint (); - void slotDropped (QDropEvent *e, QListViewItem *parent, QListViewItem *after); - void slotMoved (QListViewItem *item, QListViewItem *, QListViewItem *); + void slotDropped (TQDropEvent *e, TQListViewItem *parent, TQListViewItem *after); + void slotMoved (TQListViewItem *item, TQListViewItem *, TQListViewItem *); signals: void phrasebookConfirmed (PhraseBook &book); @@ -199,12 +199,12 @@ private: /** initializes the list of standard phrase books */ void initStandardPhraseBooks (); - QListViewItem *addBook (QListViewItem *parent, QListViewItem *after, PhraseBook *book); - QListViewItem *addBook (QListViewItem *item, PhraseBook *book); + TQListViewItem *addBook (TQListViewItem *parent, TQListViewItem *after, PhraseBook *book); + TQListViewItem *addBook (TQListViewItem *item, PhraseBook *book); void setShortcut (const KShortcut &cut); - void _warning (const KKeySequence &cut, QString sAction, QString sTitle); + void _warning (const KKeySequence &cut, TQString sAction, TQString sTitle); bool isGlobalKeyPresent (const KShortcut& cut, bool warnUser); bool isPhraseKeyPresent (const KShortcut& cut, bool warnUser); diff --git a/kmouth/phrasebook/phrasebookparser.cpp b/kmouth/phrasebook/phrasebookparser.cpp index 9883e49..441ab55 100644 --- a/kmouth/phrasebook/phrasebookparser.cpp +++ b/kmouth/phrasebook/phrasebookparser.cpp @@ -23,19 +23,19 @@ PhraseBookParser::PhraseBookParser() { PhraseBookParser::~PhraseBookParser() { } -bool PhraseBookParser::warning (const QXmlParseException &) { +bool PhraseBookParser::warning (const TQXmlParseException &) { return false; } -bool PhraseBookParser::error (const QXmlParseException &) { +bool PhraseBookParser::error (const TQXmlParseException &) { return false; } -bool PhraseBookParser::fatalError (const QXmlParseException &) { +bool PhraseBookParser::fatalError (const TQXmlParseException &) { return false; } -QString PhraseBookParser::errorString() { +TQString PhraseBookParser::errorString() { return ""; } @@ -48,9 +48,9 @@ bool PhraseBookParser::startDocument() { return true; } -bool PhraseBookParser::startElement (const QString &, const QString &, - const QString &name, - const QXmlAttributes &attributes) +bool PhraseBookParser::startElement (const TQString &, const TQString &, + const TQString &name, + const TQXmlAttributes &attributes) { if (name == "phrase") { if (isInPhrase) @@ -77,18 +77,18 @@ bool PhraseBookParser::startElement (const QString &, const QString &, return true; } -bool PhraseBookParser::characters (const QString &ch) { +bool PhraseBookParser::characters (const TQString &ch) { phrase.phrase += ch; return true; } -bool PhraseBookParser::ignorableWhitespace (const QString &ch) { +bool PhraseBookParser::ignorableWhitespace (const TQString &ch) { phrase.phrase += ch; return true; } -bool PhraseBookParser::endElement (const QString &, const QString &, - const QString &name) +bool PhraseBookParser::endElement (const TQString &, const TQString &, + const TQString &name) { if (name == "phrase") { list += PhraseBookEntry (phrase, level, true); diff --git a/kmouth/phrasebook/phrasebookparser.h b/kmouth/phrasebook/phrasebookparser.h index a6e436a..a858b4f 100644 --- a/kmouth/phrasebook/phrasebookparser.h +++ b/kmouth/phrasebook/phrasebookparser.h @@ -18,8 +18,8 @@ #ifndef PHRASEBOOKPARSER_H #define PHRASEBOOKPARSER_H -#include <qxml.h> -#include <qvaluestack.h> +#include <tqxml.h> +#include <tqvaluestack.h> #include "phrasebook.h" /** @@ -28,31 +28,31 @@ * @author Gunnar Schmi Dt */ -class PhraseBookParser : public QXmlDefaultHandler { +class PhraseBookParser : public TQXmlDefaultHandler { public: PhraseBookParser(); ~PhraseBookParser(); - bool warning (const QXmlParseException &exception); - bool error (const QXmlParseException &exception); - bool fatalError (const QXmlParseException &exception); - QString errorString(); + bool warning (const TQXmlParseException &exception); + bool error (const TQXmlParseException &exception); + bool fatalError (const TQXmlParseException &exception); + TQString errorString(); /** Processes the start of the document. */ bool startDocument(); /** Processes the start tag of an element. */ - bool startElement (const QString &, const QString &, const QString &name, - const QXmlAttributes &attributes); + bool startElement (const TQString &, const TQString &, const TQString &name, + const TQXmlAttributes &attributes); /** Processes a chunk of normal character data. */ - bool characters (const QString &ch); + bool characters (const TQString &ch); /** Processes whitespace. */ - bool ignorableWhitespace (const QString &ch); + bool ignorableWhitespace (const TQString &ch); /** Processes the end tag of an element. */ - bool endElement (const QString &, const QString &, const QString &name); + bool endElement (const TQString &, const TQString &, const TQString &name); /** Processes the end of the document. */ bool endDocument(); diff --git a/kmouth/phrasebook/phrasetree.cpp b/kmouth/phrasebook/phrasetree.cpp index 57d4f5e..6ffbaee 100644 --- a/kmouth/phrasebook/phrasetree.cpp +++ b/kmouth/phrasebook/phrasetree.cpp @@ -28,7 +28,7 @@ #include "phrasebookdialog.h" #include "phrasebook.h" -PhraseTreeItem::PhraseTreeItem (QListView *parent, QListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon) +PhraseTreeItem::PhraseTreeItem (TQListView *parent, TQListViewItem *after, TQString phrase, KShortcut shortcut, TQPixmap icon) : KListViewItem (parent, after, phrase) { isPhraseValue = true; @@ -38,7 +38,7 @@ PhraseTreeItem::PhraseTreeItem (QListView *parent, QListViewItem *after, QString setExpandable (false); } -PhraseTreeItem::PhraseTreeItem (QListViewItem *parent, QListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon) +PhraseTreeItem::PhraseTreeItem (TQListViewItem *parent, TQListViewItem *after, TQString phrase, KShortcut shortcut, TQPixmap icon) : KListViewItem (parent, after, phrase) { isPhraseValue = true; @@ -47,14 +47,14 @@ PhraseTreeItem::PhraseTreeItem (QListViewItem *parent, QListViewItem *after, QSt setPixmap(0, icon); setExpandable (false); } -PhraseTreeItem::PhraseTreeItem (QListView *parent, QListViewItem *after, QString name, QPixmap icon) +PhraseTreeItem::PhraseTreeItem (TQListView *parent, TQListViewItem *after, TQString name, TQPixmap icon) : KListViewItem (parent, after, name) { isPhraseValue = false; setPixmap(0, icon); setExpandable (true); } -PhraseTreeItem::PhraseTreeItem (QListViewItem *parent, QListViewItem *after, QString name, QPixmap icon) +PhraseTreeItem::PhraseTreeItem (TQListViewItem *parent, TQListViewItem *after, TQString name, TQPixmap icon) : KListViewItem (parent, after, name) { isPhraseValue = false; @@ -74,24 +74,24 @@ void PhraseTreeItem::setCut (KShortcut cut) { // *************************************************************************** -PhraseTree::PhraseTree (QWidget *parent, const char *name) +PhraseTree::PhraseTree (TQWidget *parent, const char *name) : KListView (parent, name) { phrasebook_open = KGlobal::iconLoader()->loadIcon("phrasebook", KIcon::Small); phrasebook_closed = KGlobal::iconLoader()->loadIcon("phrasebook_closed", KIcon::Small); phrase = KGlobal::iconLoader()->loadIcon("phrase", KIcon::Small); - connect (this, SIGNAL(expanded (QListViewItem *)), this, SLOT(itemExpanded (QListViewItem *))); - connect (this, SIGNAL(collapsed (QListViewItem *)), this, SLOT(itemCollapsed (QListViewItem *))); + connect (this, TQT_SIGNAL(expanded (TQListViewItem *)), this, TQT_SLOT(itemExpanded (TQListViewItem *))); + connect (this, TQT_SIGNAL(collapsed (TQListViewItem *)), this, TQT_SLOT(itemCollapsed (TQListViewItem *))); } PhraseTree::~PhraseTree (){ } namespace PhraseTreePrivate { - QListViewItem *prevSibling (QListViewItem *item) { - QListViewItem *parent = item->parent(); - QListViewItem *above = item->itemAbove(); + TQListViewItem *prevSibling (TQListViewItem *item) { + TQListViewItem *parent = item->parent(); + TQListViewItem *above = item->itemAbove(); if (above == parent) return 0; @@ -102,15 +102,15 @@ namespace PhraseTreePrivate { return above; } - bool findAbovePosition (QListViewItem *item, - QListViewItem **newParent, - QListViewItem **newAbove) + bool findAbovePosition (TQListViewItem *item, + TQListViewItem **newParent, + TQListViewItem **newAbove) { if (item == 0) return false; - QListViewItem *parent = item->parent(); - QListViewItem *above = item->itemAbove(); + TQListViewItem *parent = item->parent(); + TQListViewItem *above = item->itemAbove(); if (above == 0) return false; @@ -133,15 +133,15 @@ namespace PhraseTreePrivate { } } - bool findBelowPosition (QListViewItem *item, - QListViewItem **newParent, - QListViewItem **newAbove) + bool findBelowPosition (TQListViewItem *item, + TQListViewItem **newParent, + TQListViewItem **newAbove) { if (item == 0) return false; - QListViewItem *parent = item->parent(); - QListViewItem *below = item->nextSibling(); + TQListViewItem *parent = item->parent(); + TQListViewItem *below = item->nextSibling(); if (parent == 0 && below == 0) return false; @@ -162,14 +162,14 @@ namespace PhraseTreePrivate { } } - bool findRightPosition (QListViewItem *item, - QListViewItem **newParent, - QListViewItem **newAbove) + bool findRightPosition (TQListViewItem *item, + TQListViewItem **newParent, + TQListViewItem **newAbove) { if (item == 0) return false; - QListViewItem *above = prevSibling (item); + TQListViewItem *above = prevSibling (item); if (above == 0) return false; @@ -188,14 +188,14 @@ namespace PhraseTreePrivate { } } - bool findLeftPosition (QListViewItem *item, - QListViewItem **newParent, - QListViewItem **newAbove) + bool findLeftPosition (TQListViewItem *item, + TQListViewItem **newParent, + TQListViewItem **newAbove) { if (item == 0) return false; - QListViewItem *parent = item->parent(); + TQListViewItem *parent = item->parent(); if (parent == 0) return false; @@ -207,9 +207,9 @@ namespace PhraseTreePrivate { } } -void PhraseTree::moveItem (QListViewItem *item, - QListViewItem *parent, - QListViewItem *above) +void PhraseTree::moveItem (TQListViewItem *item, + TQListViewItem *parent, + TQListViewItem *above) { if (item != 0) { if (item->parent() == 0) @@ -227,7 +227,7 @@ void PhraseTree::moveItem (QListViewItem *item, } bool PhraseTree::hasSelectedItems() { - QListViewItem *i = firstChild(); + TQListViewItem *i = firstChild(); if ( !i ) return false; int level = 0; @@ -254,10 +254,10 @@ bool PhraseTree::hasSelectedItems() { } void PhraseTree::deleteSelectedItems() { - QListViewItem *i = firstChild(); + TQListViewItem *i = firstChild(); if ( !i ) return; - QListViewItem *deleteItem = 0; + TQListViewItem *deleteItem = 0; do { if (i->isSelected()) deleteItem = i; @@ -280,13 +280,13 @@ void PhraseTree::deleteSelectedItems() { while (i != 0); } -void PhraseTree::keyPressEvent (QKeyEvent *e) { +void PhraseTree::keyPressEvent (TQKeyEvent *e) { if ((e->state() & Qt::KeyButtonMask) == Qt::AltButton) { if (e->key() == Qt::Key_Up) { - QListViewItem *item = currentItem(); + TQListViewItem *item = currentItem(); if ((item != 0) && (item->isSelected())) { - QListViewItem *parent; - QListViewItem *above; + TQListViewItem *parent; + TQListViewItem *above; if (PhraseTreePrivate::findAbovePosition (item, &parent, &above)) { moveItem(item, parent, above); @@ -298,10 +298,10 @@ void PhraseTree::keyPressEvent (QKeyEvent *e) { return; } else if (e->key() == Qt::Key_Down) { - QListViewItem *item = currentItem(); + TQListViewItem *item = currentItem(); if ((item != 0) && (item->isSelected())) { - QListViewItem *parent; - QListViewItem *above; + TQListViewItem *parent; + TQListViewItem *above; if (PhraseTreePrivate::findBelowPosition (item, &parent, &above)) { moveItem(item, parent, above); @@ -313,10 +313,10 @@ void PhraseTree::keyPressEvent (QKeyEvent *e) { return; } else if (e->key() == Qt::Key_Left) { - QListViewItem *item = currentItem(); + TQListViewItem *item = currentItem(); if ((item != 0) && (item->isSelected())) { - QListViewItem *parent; - QListViewItem *above; + TQListViewItem *parent; + TQListViewItem *above; if (PhraseTreePrivate::findLeftPosition (item, &parent, &above)) { moveItem(item, parent, above); @@ -328,10 +328,10 @@ void PhraseTree::keyPressEvent (QKeyEvent *e) { return; } else if (e->key() == Qt::Key_Right) { - QListViewItem *item = currentItem(); + TQListViewItem *item = currentItem(); if ((item != 0) && (item->isSelected())) { - QListViewItem *parent; - QListViewItem *above; + TQListViewItem *parent; + TQListViewItem *above; if (PhraseTreePrivate::findRightPosition (item, &parent, &above)) { moveItem(item, parent, above); @@ -346,10 +346,10 @@ void PhraseTree::keyPressEvent (QKeyEvent *e) { KListView::keyPressEvent(e); } -PhraseTreeItem *PhraseTree::insertPhrase (QListViewItem *parent, QListViewItem *after, QString phrase, QString shortcut) { +PhraseTreeItem *PhraseTree::insertPhrase (TQListViewItem *parent, TQListViewItem *after, TQString phrase, TQString shortcut) { KShortcut cut = KShortcut(shortcut); if (isKeyPresent (cut, 0, false)) - cut = KShortcut(QString::null); + cut = KShortcut(TQString::null); if (parent == 0) return new PhraseTreeItem (this, after, phrase, cut, this->phrase); @@ -357,15 +357,15 @@ PhraseTreeItem *PhraseTree::insertPhrase (QListViewItem *parent, QListViewItem * return new PhraseTreeItem (parent, after, phrase, cut, this->phrase); } -PhraseTreeItem *PhraseTree::insertBook (QListViewItem *parent, QListViewItem *after, QString name) { +PhraseTreeItem *PhraseTree::insertBook (TQListViewItem *parent, TQListViewItem *after, TQString name) { if (parent == 0) return new PhraseTreeItem (this, after, name, phrasebook_closed); else return new PhraseTreeItem (parent, after, name, phrasebook_closed); } -QListViewItem *PhraseTree::addBook (QListViewItem *parent, QListViewItem *after, PhraseBook *book) { - QListViewItem *last = after; +TQListViewItem *PhraseTree::addBook (TQListViewItem *parent, TQListViewItem *after, PhraseBook *book) { + TQListViewItem *last = after; int level = 0; PhraseBookEntryList::iterator it; for (it = book->begin(); it != book->end(); ++it) { @@ -403,7 +403,7 @@ QListViewItem *PhraseTree::addBook (QListViewItem *parent, QListViewItem *after, } void PhraseTree::fillBook (PhraseBook *book, bool respectSelection) { - QListViewItem *i = firstChild(); + TQListViewItem *i = firstChild(); int level = 0; if ( !i ) return; @@ -432,11 +432,11 @@ void PhraseTree::fillBook (PhraseBook *book, bool respectSelection) { while (i != 0); } -QDragObject *PhraseTree::dragObject () { +TQDragObject *PhraseTree::dragObject () { return dragObject (true); } -QDragObject *PhraseTree::dragObject (bool isDependent) { +TQDragObject *PhraseTree::dragObject (bool isDependent) { PhraseBook book; fillBook (&book, true); if (isDependent) @@ -444,7 +444,7 @@ QDragObject *PhraseTree::dragObject (bool isDependent) { return new PhraseBookDrag(&book); } -bool PhraseTree::acceptDrag (QDropEvent* event) const { +bool PhraseTree::acceptDrag (TQDropEvent* event) const { if (KListView::acceptDrag (event)) return true; else @@ -463,10 +463,10 @@ static int keyConflict (const KShortcut& cut, const KShortcut& cut2) { return -1; } -void PhraseTree::_warning (const KKeySequence& cut, QString sAction, QString sTitle) { +void PhraseTree::_warning (const KKeySequence& cut, TQString sAction, TQString sTitle) { sAction = sAction.stripWhiteSpace(); - QString s = + TQString s = i18n("The '%1' key combination has already been allocated " "to %2.\n" "Please choose a unique key combination."). @@ -494,8 +494,8 @@ bool PhraseTree::isStdAccelPresent (const KShortcut& cut, bool warnUser) { } bool PhraseTree::isGlobalKeyPresent (const KShortcut& cut, bool warnUser) { - QMap<QString, QString> mapEntry = KGlobal::config()->entryMap ("Global Shortcuts"); - QMap<QString, QString>::Iterator it; + TQMap<TQString, TQString> mapEntry = KGlobal::config()->entryMap ("Global Shortcuts"); + TQMap<TQString, TQString>::Iterator it; for (it = mapEntry.begin(); it != mapEntry.end(); ++it) { int iSeq = keyConflict (cut, KShortcut(*it)); if (iSeq > -1) { @@ -510,7 +510,7 @@ bool PhraseTree::isGlobalKeyPresent (const KShortcut& cut, bool warnUser) { } bool PhraseTree::isPhraseKeyPresent (const KShortcut& cut, PhraseTreeItem* cutItem, bool warnUser) { - for (QListViewItemIterator it(this); it.current(); ++it) { + for (TQListViewItemIterator it(this); it.current(); ++it) { PhraseTreeItem* item = dynamic_cast<PhraseTreeItem*>(it.current()); if ((item != 0) && (item != cutItem)) { int iSeq = keyConflict (cut, item->cut()); @@ -539,13 +539,13 @@ bool PhraseTree::isKeyPresent (const KShortcut& cut, PhraseTreeItem* cutItem, bo return false; } -void PhraseTree::itemExpanded (QListViewItem *item) { +void PhraseTree::itemExpanded (TQListViewItem *item) { PhraseTreeItem *i = (PhraseTreeItem *)item; if (!i->isPhrase()) i->setPixmap(0, phrasebook_open); } -void PhraseTree::itemCollapsed (QListViewItem *item) { +void PhraseTree::itemCollapsed (TQListViewItem *item) { PhraseTreeItem *i = (PhraseTreeItem *)item; if (!i->isPhrase()) i->setPixmap(0, phrasebook_closed); diff --git a/kmouth/phrasebook/phrasetree.h b/kmouth/phrasebook/phrasetree.h index bd0e1f5..45ae26c 100644 --- a/kmouth/phrasebook/phrasetree.h +++ b/kmouth/phrasebook/phrasetree.h @@ -18,7 +18,7 @@ #ifndef PHRASETREE_H #define PHRASETREE_H -#include <qpixmap.h> +#include <tqpixmap.h> #include <kshortcut.h> #include <klistview.h> @@ -33,13 +33,13 @@ class PhraseTreeItem : public KListViewItem { friend class PhraseTree; private: /** Creates a phrase item within a sub phrase book */ - PhraseTreeItem (QListView *parent, QListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon); + PhraseTreeItem (TQListView *parent, TQListViewItem *after, TQString phrase, KShortcut shortcut, TQPixmap icon); /** Creates a phrase item at the top level */ - PhraseTreeItem (QListViewItem *parent, QListViewItem *after, QString phrase, KShortcut shortcut, QPixmap icon); + PhraseTreeItem (TQListViewItem *parent, TQListViewItem *after, TQString phrase, KShortcut shortcut, TQPixmap icon); /** Creates a phrase book item within a sub phrase book */ - PhraseTreeItem (QListView *parent, QListViewItem *after, QString name, QPixmap icon); + PhraseTreeItem (TQListView *parent, TQListViewItem *after, TQString name, TQPixmap icon); /** Creates a phrase book item at the top level */ - PhraseTreeItem (QListViewItem *parent, QListViewItem *after, QString name, QPixmap icon); + PhraseTreeItem (TQListViewItem *parent, TQListViewItem *after, TQString name, TQPixmap icon); public: bool isPhrase(); @@ -61,30 +61,30 @@ class PhraseTree : public KListView { friend class PhraseTreeItem; Q_OBJECT public: - PhraseTree (QWidget *parent = 0, const char *name = 0); + PhraseTree (TQWidget *parent = 0, const char *name = 0); ~PhraseTree (); - void keyPressEvent (QKeyEvent *e); + void keyPressEvent (TQKeyEvent *e); - PhraseTreeItem *insertPhrase (QListViewItem *parent, QListViewItem *after, QString phrase, QString shortcut); - PhraseTreeItem *insertBook (QListViewItem *parent, QListViewItem *after, QString name); + PhraseTreeItem *insertPhrase (TQListViewItem *parent, TQListViewItem *after, TQString phrase, TQString shortcut); + PhraseTreeItem *insertBook (TQListViewItem *parent, TQListViewItem *after, TQString name); - QListViewItem *addBook (QListViewItem *parent, QListViewItem *after, PhraseBook *book); + TQListViewItem *addBook (TQListViewItem *parent, TQListViewItem *after, PhraseBook *book); void fillBook (PhraseBook *book, bool respectSelection); - QDragObject *dragObject (); - QDragObject *dragObject (bool isDependent); + TQDragObject *dragObject (); + TQDragObject *dragObject (bool isDependent); - void moveItem (QListViewItem *item, QListViewItem *parent, QListViewItem *above); + void moveItem (TQListViewItem *item, TQListViewItem *parent, TQListViewItem *above); bool hasSelectedItems(); void deleteSelectedItems(); protected: - bool acceptDrag (QDropEvent* event) const; + bool acceptDrag (TQDropEvent* event) const; private: - void _warning (const KKeySequence& cut, QString sAction, QString sTitle); + void _warning (const KKeySequence& cut, TQString sAction, TQString sTitle); bool isStdAccelPresent (const KShortcut& cut, bool warnUser); bool isGlobalKeyPresent (const KShortcut& cut, bool warnUser); bool isApplicationKeyPresent (const KShortcut& cut, bool warnUser); @@ -93,16 +93,16 @@ public: bool isKeyPresent (const KShortcut& cut, PhraseTreeItem* cutItem, bool warnUser); public slots: - void itemExpanded (QListViewItem *item); - void itemCollapsed (QListViewItem *item); + void itemExpanded (TQListViewItem *item); + void itemCollapsed (TQListViewItem *item); signals: void shortcutRequest (PhraseShortcutRequest *request); private: - QPixmap phrasebook_open; - QPixmap phrasebook_closed; - QPixmap phrase; + TQPixmap phrasebook_open; + TQPixmap phrasebook_closed; + TQPixmap phrase; }; #endif |