diff options
Diffstat (limited to 'kmouth/phrasebook')
-rw-r--r-- | kmouth/phrasebook/CMakeLists.txt | 31 | ||||
-rw-r--r-- | kmouth/phrasebook/buttonboxui.ui | 3 | ||||
-rw-r--r-- | kmouth/phrasebook/phrasebook.cpp | 8 | ||||
-rw-r--r-- | kmouth/phrasebook/phrasebook.h | 6 | ||||
-rw-r--r-- | kmouth/phrasebook/phrasebookdialog.cpp | 42 | ||||
-rw-r--r-- | kmouth/phrasebook/phrasebookdialog.h | 8 | ||||
-rw-r--r-- | kmouth/phrasebook/phrasetree.cpp | 4 | ||||
-rw-r--r-- | kmouth/phrasebook/phrasetree.h | 2 |
8 files changed, 69 insertions, 35 deletions
diff --git a/kmouth/phrasebook/CMakeLists.txt b/kmouth/phrasebook/CMakeLists.txt new file mode 100644 index 0000000..ed96605 --- /dev/null +++ b/kmouth/phrasebook/CMakeLists.txt @@ -0,0 +1,31 @@ +include_directories( + ${CMAKE_BINARY_DIR} + ${CMAKE_CURRENT_BINARY_DIR} + ${CMAKE_CURRENT_SOURCE_DIR} + ${TDE_INCLUDE_DIR} + ${TQT_INCLUDE_DIRS} +) + +link_directories( + ${TQT_LIBRARY_DIRS} + ${TDE_LIB_DIR} +) + + +##### phrasebook (static) + +tde_add_library( phrasebook STATIC_PIC AUTOMOC + + SOURCES + buttonboxui.ui + phrasetree.cpp + phrasebookparser.cpp + phrasebookdialog.cpp + phrasebook.cpp +) + + +install( + FILES phrasebookdialogui.rc + DESTINATION ${DATA_INSTALL_DIR}/kmouth +) diff --git a/kmouth/phrasebook/buttonboxui.ui b/kmouth/phrasebook/buttonboxui.ui index 59f1d40..73eccf5 100644 --- a/kmouth/phrasebook/buttonboxui.ui +++ b/kmouth/phrasebook/buttonboxui.ui @@ -104,4 +104,7 @@ </grid> </widget> <layoutdefaults spacing="6" margin="11"/> +<includes> + <include location="global" impldecl="in implementation">klineedit.h</include> +</includes> </UI> diff --git a/kmouth/phrasebook/phrasebook.cpp b/kmouth/phrasebook/phrasebook.cpp index 94eb42f..1fc4f9f 100644 --- a/kmouth/phrasebook/phrasebook.cpp +++ b/kmouth/phrasebook/phrasebook.cpp @@ -245,7 +245,7 @@ bool PhraseBook::save (const KURL &url, bool asPhrasebook) { save (*tempFile.textStream(), asPhrasebook); tempFile.close(); - return TDEIO::NetAccess::upload(tempFile.name(), url); + return TDEIO::NetAccess::upload( tempFile.name(), url, 0 ); } } @@ -273,7 +273,7 @@ int PhraseBook::save (TQWidget *parent, const TQString &title, KURL &url, bool p return -1; } - if (TDEIO::NetAccess::exists(url)) { + if (TDEIO::NetAccess::exists(url, false, 0)) { 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; @@ -334,12 +334,12 @@ bool PhraseBook::open (const KURL &url) { fileUrl.setPath (url.url()); } - if (TDEIO::NetAccess::download (fileUrl, tempFile)) { + if (TDEIO::NetAccess::download(fileUrl, tempFile, 0)) { TQStringList list = TQStringList(); // First: try to load it as a normal phrase book TQFile file(tempFile); - TQXmlInputSource source (TQT_TQIODEVICE(&file)); + TQXmlInputSource source (&file); bool error = !decode (source); // Second: if the file does not contain a phrase book, load it as diff --git a/kmouth/phrasebook/phrasebook.h b/kmouth/phrasebook/phrasebook.h index 4fee8cc..92fabeb 100644 --- a/kmouth/phrasebook/phrasebook.h +++ b/kmouth/phrasebook/phrasebook.h @@ -147,7 +147,7 @@ public: * @author Gunnar Schmi Dt */ class PhraseBookDrag: public TQDragObject { - Q_OBJECT + TQ_OBJECT public: PhraseBookDrag (PhraseBook *book, TQWidget *dragSource = 0, const char *name = 0); @@ -170,13 +170,13 @@ private: }; class PhraseAction : public TDEAction { - Q_OBJECT + TQ_OBJECT public: PhraseAction (const TQString& phrase, const TQString& cut, const TQObject* receiver, const char* slot, TDEActionCollection* parent) : TDEAction (phrase, "phrase", TDEShortcut(cut), 0, 0, parent, phrase.latin1()) { this->phrase = phrase; - connect (this, TQT_SIGNAL(slotActivated (const TQString &)), receiver, slot); + connect (this, TQ_SIGNAL(slotActivated (const TQString &)), receiver, slot); }; ~PhraseAction () { } diff --git a/kmouth/phrasebook/phrasebookdialog.cpp b/kmouth/phrasebook/phrasebookdialog.cpp index 3525ce7..c26c7d5 100644 --- a/kmouth/phrasebook/phrasebookdialog.cpp +++ b/kmouth/phrasebook/phrasebookdialog.cpp @@ -303,17 +303,17 @@ void PhraseBookDialog::initGUI () { treeView->setAllColumnsShowFocus (true); 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()), TQT_TQOBJECT(this), TQT_SLOT(selectionChanged())); - connect (treeView, TQT_SIGNAL(contextMenuRequested (TQListViewItem *, const TQPoint &, int)), TQT_TQOBJECT(this), TQT_SLOT(contextMenuRequested (TQListViewItem *, const TQPoint &, int))); - connect (treeView, TQT_SIGNAL(dropped (TQDropEvent *, TQListViewItem *, TQListViewItem *)), TQT_TQOBJECT(this), TQT_SLOT(slotDropped (TQDropEvent *, TQListViewItem *, TQListViewItem *))); - connect (treeView, TQT_SIGNAL(moved (TQListViewItem *, TQListViewItem *, TQListViewItem *)), TQT_TQOBJECT(this), TQT_SLOT(slotMoved (TQListViewItem *, TQListViewItem *, TQListViewItem *))); + connect (treeView, TQ_SIGNAL(selectionChanged()), this, TQ_SLOT(selectionChanged())); + connect (treeView, TQ_SIGNAL(contextMenuRequested (TQListViewItem *, const TQPoint &, int)), this, TQ_SLOT(contextMenuRequested (TQListViewItem *, const TQPoint &, int))); + connect (treeView, TQ_SIGNAL(dropped (TQDropEvent *, TQListViewItem *, TQListViewItem *)), this, TQ_SLOT(slotDropped (TQDropEvent *, TQListViewItem *, TQListViewItem *))); + connect (treeView, TQ_SIGNAL(moved (TQListViewItem *, TQListViewItem *, TQListViewItem *)), this, TQ_SLOT(slotMoved (TQListViewItem *, TQListViewItem *, TQListViewItem *))); mainLayout->addWidget (treeView); buttonBox = new ButtonBoxWidget (page, "buttonbox"); - 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 TDEShortcut&)), TQT_SLOT(capturedShortcut(const TDEShortcut&))); + connect (buttonBox->lineEdit, TQ_SIGNAL(textChanged(const TQString &)), TQ_SLOT(slotTextChanged(const TQString &))); + connect (buttonBox->noKey, TQ_SIGNAL(clicked()), TQ_SLOT(slotNoKey())); + connect (buttonBox->customKey, TQ_SIGNAL(clicked()), TQ_SLOT(slotCustomKey())); + connect (buttonBox->keyButton, TQ_SIGNAL(capturedShortcut(const TDEShortcut&)), TQ_SLOT(capturedShortcut(const TDEShortcut&))); mainLayout->addWidget (buttonBox); treeView->setFocus(); @@ -322,23 +322,23 @@ void PhraseBookDialog::initGUI () { void PhraseBookDialog::initActions() { // The file menu - fileNewPhrase = new TDEAction (i18n("&New Phrase"), "phrase_new", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAddPhrase()), actionCollection(),"file_new_phrase"); + fileNewPhrase = new TDEAction (i18n("&New Phrase"), "phrase_new", 0, this, TQ_SLOT(slotAddPhrase()), actionCollection(),"file_new_phrase"); fileNewPhrase->setStatusText(i18n("Adds a new phrase")); fileNewPhrase->setWhatsThis (i18n("Adds a new phrase")); - fileNewBook = new TDEAction (i18n("New Phrase &Book"), "phrasebook_new", 0, TQT_TQOBJECT(this), TQT_SLOT(slotAddPhrasebook()), actionCollection(),"file_new_book"); + fileNewBook = new TDEAction (i18n("New Phrase &Book"), "phrasebook_new", 0, this, TQ_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(TQT_TQOBJECT(this), TQT_SLOT(slotSave()), actionCollection()); + fileSave = KStdAction::save(this, TQ_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 TDEAction (i18n("&Import..."), "phrasebook_open", 0, TQT_TQOBJECT(this), TQT_SLOT(slotImportPhrasebook()), actionCollection(),"file_import"); + fileImport = new TDEAction (i18n("&Import..."), "phrasebook_open", 0, this, TQ_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 TDEToolBarPopupAction (i18n("&Import..."), "phrasebook_open", 0, TQT_TQOBJECT(this), TQT_SLOT(slotImportPhrasebook()), actionCollection(),"toolbar_import"); + toolbarImport = new TDEToolBarPopupAction (i18n("&Import..."), "phrasebook_open", 0, this, TQ_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 TDEAction (i18n("&Export..."), "phrasebook_save", 0, TQT_TQOBJECT(this), TQT_SLOT(slotExportPhrasebook()), actionCollection(),"file_export"); + fileExport = new TDEAction (i18n("&Export..."), "phrasebook_save", 0, this, TQ_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(TQT_TQOBJECT(this), TQT_SLOT(slotPrint()), actionCollection()); + filePrint = KStdAction::print(this, TQ_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(TQT_TQOBJECT(this), TQT_SLOT(close()), actionCollection()); + fileClose = KStdAction::close(this, TQ_SLOT(close()), actionCollection()); fileClose->setStatusText(i18n("Closes the window")); fileClose->setWhatsThis (i18n("Closes the window")); // The edit menu - editCut = KStdAction::cut(TQT_TQOBJECT(this), TQT_SLOT(slotCut()), actionCollection()); + editCut = KStdAction::cut(this, TQ_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(TQT_TQOBJECT(this), TQT_SLOT(slotCopy()), actionCollection()); + editCopy = KStdAction::copy(this, TQ_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(TQT_TQOBJECT(this), TQT_SLOT(slotPaste()), actionCollection()); + editPaste = KStdAction::paste(this, TQ_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 TDEAction (i18n("&Delete"), "edit-delete", 0, TQT_TQOBJECT(this), TQT_SLOT(slotRemove()), actionCollection(),"edit_delete"); + editDelete = new TDEAction (i18n("&Delete"), "edit-delete", 0, this, TQ_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")); @@ -462,7 +462,7 @@ void PhraseBookDialog::initStandardPhraseBooks () { currentNamePath = dirs; TDEAction *book = new StandardPhraseBookInsertAction ( - url, (*it).name, TQT_TQOBJECT(this), TQT_SLOT(slotImportPhrasebook (const KURL &)), actionCollection()); + url, (*it).name, this, TQ_SLOT(slotImportPhrasebook (const KURL &)), actionCollection()); parent->insert(book); if (parent == fileImportStandardBook) book->plug(toolbarImport->popupMenu()); diff --git a/kmouth/phrasebook/phrasebookdialog.h b/kmouth/phrasebook/phrasebookdialog.h index 0665281..96260f9 100644 --- a/kmouth/phrasebook/phrasebookdialog.h +++ b/kmouth/phrasebook/phrasebookdialog.h @@ -73,7 +73,7 @@ private: */ class InitialPhraseBookWidget : public TQWidget { - Q_OBJECT + TQ_OBJECT public: InitialPhraseBookWidget(TQWidget *parent, const char *name); @@ -94,13 +94,13 @@ private: * @author Gunnar Schmi Dt */ class StandardPhraseBookInsertAction : public TDEAction { - Q_OBJECT + TQ_OBJECT public: StandardPhraseBookInsertAction (const KURL &url, const TQString& name, const TQObject* receiver, const char* slot, TDEActionCollection* parent) : TDEAction (name, "phrasebook", 0, 0, 0, parent, 0) { this->url = url; - connect (this, TQT_SIGNAL(slotActivated (const KURL &)), receiver, slot); + connect (this, TQ_SIGNAL(slotActivated (const KURL &)), receiver, slot); }; ~StandardPhraseBookInsertAction () { }; @@ -142,7 +142,7 @@ protected: class PhraseBookDialog : public TDEMainWindow { friend class InitialPhraseBookWidget; - Q_OBJECT + TQ_OBJECT private: /** Constructor. It is private because this class implements the singleton diff --git a/kmouth/phrasebook/phrasetree.cpp b/kmouth/phrasebook/phrasetree.cpp index 6a2bac2..f08e95a 100644 --- a/kmouth/phrasebook/phrasetree.cpp +++ b/kmouth/phrasebook/phrasetree.cpp @@ -81,8 +81,8 @@ PhraseTree::PhraseTree (TQWidget *parent, const char *name) phrasebook_closed = TDEGlobal::iconLoader()->loadIcon("phrasebook_closed", TDEIcon::Small); phrase = TDEGlobal::iconLoader()->loadIcon("phrase", TDEIcon::Small); - connect (this, TQT_SIGNAL(expanded (TQListViewItem *)), this, TQT_SLOT(itemExpanded (TQListViewItem *))); - connect (this, TQT_SIGNAL(collapsed (TQListViewItem *)), this, TQT_SLOT(itemCollapsed (TQListViewItem *))); + connect (this, TQ_SIGNAL(expanded (TQListViewItem *)), this, TQ_SLOT(itemExpanded (TQListViewItem *))); + connect (this, TQ_SIGNAL(collapsed (TQListViewItem *)), this, TQ_SLOT(itemCollapsed (TQListViewItem *))); } PhraseTree::~PhraseTree (){ diff --git a/kmouth/phrasebook/phrasetree.h b/kmouth/phrasebook/phrasetree.h index a4936f4..b8d578e 100644 --- a/kmouth/phrasebook/phrasetree.h +++ b/kmouth/phrasebook/phrasetree.h @@ -59,7 +59,7 @@ private: class PhraseTree : public TDEListView { friend class PhraseTreeItem; - Q_OBJECT + TQ_OBJECT public: PhraseTree (TQWidget *parent = 0, const char *name = 0); |