diff options
Diffstat (limited to 'src/knowit.cpp')
-rw-r--r-- | src/knowit.cpp | 680 |
1 files changed, 340 insertions, 340 deletions
diff --git a/src/knowit.cpp b/src/knowit.cpp index f789582..4c77fac 100644 --- a/src/knowit.cpp +++ b/src/knowit.cpp @@ -2,7 +2,7 @@ knowit.cpp - description ------------------- begin : czw wrz 26 08:27:40 CEST 2002 - copyright : (C) 2002-2004 by Micha³ Rudolf + copyright : (C) 2002-2004 by Micha� Rudolf email : mrudolf@kdewebdev.org ***************************************************************************/ @@ -15,17 +15,17 @@ * * ***************************************************************************/ -#include <qtimer.h> -#include <qclipboard.h> -#include <qdatetime.h> -#include <qdir.h> -#include <qfile.h> -#include <qtextstream.h> -#include <qpainter.h> -#include <qpaintdevicemetrics.h> -#include <qwhatsthis.h> -#include <qsimplerichtext.h> -#include <qsplitter.h> +#include <tqtimer.h> +#include <tqclipboard.h> +#include <tqdatetime.h> +#include <tqdir.h> +#include <tqfile.h> +#include <tqtextstream.h> +#include <tqpainter.h> +#include <tqpaintdevicemetrics.h> +#include <tqwhatsthis.h> +#include <tqsimplerichtext.h> +#include <tqsplitter.h> #include <kaction.h> #include <kcmdlineargs.h> @@ -55,205 +55,205 @@ #include "knowittree.h" #include "knowitlinks.h" -const QString Knowit::Untitled = i18n("untitled") + ".kno"; +const TQString Knowit::Untitled = i18n("untitled") + ".kno"; -Knowit::Knowit(QWidget*, const char *name) : KMainWindow(0, name), +Knowit::Knowit(TQWidget*, const char *name) : KMainWindow(0, name), FindDlg(), PrefDlg(), ChooserDlg(), LinkDlg(), Notes() { statusBar()->insertItem(i18n("Ready"), 0); - Layout = new QSplitter(this); + Layout = new TQSplitter(this); Items = new KnowitTree(Layout, "Items"); - QSplitter* EditLayout = new QSplitter(Layout); - EditLayout->setOrientation(QSplitter::Vertical); + TQSplitter* EditLayout = new TQSplitter(Layout); + EditLayout->setOrientation(Qt::Vertical); Edit = new KnowitEdit(EditLayout, "Edit"); Links = new KnowitLinks(EditLayout); - connect(&FindDlg, SIGNAL(search()), this, SLOT(slotEditFind())); + connect(&FindDlg, TQT_SIGNAL(search()), TQT_TQOBJECT(this), TQT_SLOT(slotEditFind())); lastSought = 0; /* main view */ setAutoSaveSettings(); setCentralWidget(Layout); - QWhatsThis::add(Layout, i18n("Move it to change tree/edit layout.")); - connect(Items, SIGNAL(contextMenu(KListView*, QListViewItem*, const QPoint&)), - this, SLOT(slotContextMenu(KListView*, QListViewItem*, const QPoint&))); - connect(Items, SIGNAL(selectionChanged(QListViewItem*)), this, - SLOT(slotItemChanged(QListViewItem*))); - connect(Items, SIGNAL(selectionChanged(QListViewItem*)), this, - SLOT(slotItemChanged(QListViewItem*))); + TQWhatsThis::add(Layout, i18n("Move it to change tree/edit tqlayout.")); + connect(Items, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)), + TQT_TQOBJECT(this), TQT_SLOT(slotContextMenu(KListView*, TQListViewItem*, const TQPoint&))); + connect(Items, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, + TQT_SLOT(slotItemChanged(TQListViewItem*))); + connect(Items, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, + TQT_SLOT(slotItemChanged(TQListViewItem*))); - /* Edit (QTextEdit) */ + /* Edit (TQTextEdit) */ Edit->setMinimumSize(200, 150); - Edit->setTextFormat(Qt::RichText); - QWhatsThis::add(Edit, i18n("<h2>Note text</h2>Add text for selected note here.\n" + Edit->setTextFormat(TQt::RichText); + TQWhatsThis::add(Edit, i18n("<h2>Note text</h2>Add text for selected note here.\n" "Text can be formatted, for example <b>bold</b> or <i>italic</i>.")); - connect(Edit, SIGNAL(selectionChanged()), this, SLOT(slotEditChanged())); - connect(Edit, SIGNAL(textChanged()), this, SLOT(slotEditChanged())); - connect(Edit, SIGNAL(cursorPositionChanged(int, int)), this, - SLOT(slotEditCursorChanged(int, int))); - connect(Edit, SIGNAL(textDropped(const QString&, int)), - this, SLOT(slotLinkDropped(const QString&, int))); + connect(Edit, TQT_SIGNAL(selectionChanged()), TQT_TQOBJECT(this), TQT_SLOT(slotEditChanged())); + connect(Edit, TQT_SIGNAL(textChanged()), TQT_TQOBJECT(this), TQT_SLOT(slotEditChanged())); + connect(Edit, TQT_SIGNAL(cursorPositionChanged(int, int)), this, + TQT_SLOT(slotEditCursorChanged(int, int))); + connect(Edit, TQT_SIGNAL(textDropped(const TQString&, int)), + TQT_TQOBJECT(this), TQT_SLOT(slotLinkDropped(const TQString&, int))); /* Links (KListBox) */ - connect(Links, SIGNAL(doubleClicked(QListBoxItem*)), - this, SLOT(slotShowAttachment(QListBoxItem*))); - connect(Links, SIGNAL(contextMenuRequested(QListBoxItem*, const QPoint&)), - this, SLOT(slotContextLinksMenu(QListBoxItem*, const QPoint&))); - connect(Links, SIGNAL(textDropped(const QString&, int)), - this, SLOT(slotLinkDropped(const QString&, int))); - connect(Links, SIGNAL(linkRemove()), this, SLOT(slotLinkRemove())); - connect(Links, SIGNAL(linkOpen()), this, SLOT(slotLinkOpen())); - connect(Links, SIGNAL(linkOpenWith()), this, SLOT(slotLinkOpenWith())); + connect(Links, TQT_SIGNAL(doubleClicked(TQListBoxItem*)), + TQT_TQOBJECT(this), TQT_SLOT(slotShowAttachment(TQListBoxItem*))); + connect(Links, TQT_SIGNAL(contextMenuRequested(TQListBoxItem*, const TQPoint&)), + TQT_TQOBJECT(this), TQT_SLOT(slotContextLinksMenu(TQListBoxItem*, const TQPoint&))); + connect(Links, TQT_SIGNAL(textDropped(const TQString&, int)), + TQT_TQOBJECT(this), TQT_SLOT(slotLinkDropped(const TQString&, int))); + connect(Links, TQT_SIGNAL(linkRemove()), TQT_TQOBJECT(this), TQT_SLOT(slotLinkRemove())); + connect(Links, TQT_SIGNAL(linkOpen()), TQT_TQOBJECT(this), TQT_SLOT(slotLinkOpen())); + connect(Links, TQT_SIGNAL(linkOpenWith()), TQT_TQOBJECT(this), TQT_SLOT(slotLinkOpenWith())); /* Actions: File */ - KStdAction::openNew(this, SLOT(slotFileNew()), actionCollection()); - KStdAction::open(this, SLOT(slotFileOpen()), actionCollection()); - actionRecent = KStdAction::openRecent(this, SLOT(slotFileRecent(const KURL&)), actionCollection()); - KStdAction::save(this, SLOT(slotFileSave()), actionCollection()); - KStdAction::saveAs(this, SLOT(slotFileSaveAs()), actionCollection()); - new KAction(i18n("&Export to HTML..."), "", "", this, - SLOT(slotFileExport()), actionCollection(), "file_export_html"); - KStdAction::print(this, SLOT(slotFilePrint()), actionCollection()); - new KAction(i18n("Document &information..."), "", "", this, - SLOT(slotFileInfo()), actionCollection(), "file_info"); - KStdAction::quit(this, SLOT(slotFileQuit()), actionCollection()); + KStdAction::openNew(TQT_TQOBJECT(this), TQT_SLOT(slotFileNew()), actionCollection()); + KStdAction::open(TQT_TQOBJECT(this), TQT_SLOT(slotFileOpen()), actionCollection()); + actionRecent = KStdAction::openRecent(TQT_TQOBJECT(this), TQT_SLOT(slotFileRecent(const KURL&)), actionCollection()); + KStdAction::save(TQT_TQOBJECT(this), TQT_SLOT(slotFileSave()), actionCollection()); + KStdAction::saveAs(TQT_TQOBJECT(this), TQT_SLOT(slotFileSaveAs()), actionCollection()); + new KAction(i18n("&Export to HTML..."), "", "", TQT_TQOBJECT(this), + TQT_SLOT(slotFileExport()), actionCollection(), "file_export_html"); + KStdAction::print(TQT_TQOBJECT(this), TQT_SLOT(slotFilePrint()), actionCollection()); + new KAction(i18n("Document &information..."), "", "", TQT_TQOBJECT(this), + TQT_SLOT(slotFileInfo()), actionCollection(), "file_info"); + KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(slotFileQuit()), actionCollection()); /* Actions: Edit */ - actionCut = KStdAction::cut(Edit, SLOT(cut()), actionCollection()); - actionCopy = KStdAction::copy(Edit, SLOT(copy()), actionCollection()); - KStdAction::paste(Edit, SLOT(paste()), actionCollection()); - actionUndo = KStdAction::undo(Edit, SLOT(undo()), actionCollection()); - actionRedo = KStdAction::redo(Edit, SLOT(redo()), actionCollection()); + actionCut = KStdAction::cut(TQT_TQOBJECT(Edit), TQT_SLOT(cut()), actionCollection()); + actionCopy = KStdAction::copy(TQT_TQOBJECT(Edit), TQT_SLOT(copy()), actionCollection()); + KStdAction::paste(TQT_TQOBJECT(Edit), TQT_SLOT(paste()), actionCollection()); + actionUndo = KStdAction::undo(TQT_TQOBJECT(Edit), TQT_SLOT(undo()), actionCollection()); + actionRedo = KStdAction::redo(TQT_TQOBJECT(Edit), TQT_SLOT(redo()), actionCollection()); actionBold = new KToggleAction(i18n("Toggle &bold"), "text_bold", - "Ctrl+B", this, SLOT(slotEditBold()), actionCollection(), "edit_bold"); + "Ctrl+B", TQT_TQOBJECT(this), TQT_SLOT(slotEditBold()), actionCollection(), "edit_bold"); actionItalic = new KToggleAction(i18n("Toggle &italic"), "text_italic", - "Ctrl+I", this, SLOT(slotEditItalic()), actionCollection(), + "Ctrl+I", TQT_TQOBJECT(this), TQT_SLOT(slotEditItalic()), actionCollection(), "edit_italic"); actionUnderline = new KToggleAction(i18n("Toggle &underline"), "text_under", - "Ctrl+U", this, SLOT(slotEditUnderline()), actionCollection(), + "Ctrl+U", TQT_TQOBJECT(this), TQT_SLOT(slotEditUnderline()), actionCollection(), "edit_underline"); - new KAction(i18n("&Text color..."), "color_line", "Ctrl+#", this, - SLOT(slotEditColor()), actionCollection(), "edit_color"); - new KAction(i18n("&Superscript"), "text_super", "", this, - SLOT(slotEditSuperscript()), actionCollection(), "edit_superscript"); - new KAction(i18n("&Subscript"), "text_sub", "", this, - SLOT(slotEditSubscript()), actionCollection(), "edit_subscript"); - new KAction(i18n("&Normal text"), "", "", this, - SLOT(slotEditNormal()), actionCollection(), "edit_align_normal"); - new KAction(i18n("&Bullet list"), "", "", this, - SLOT(slotEditListBullet()), actionCollection(), "list_bullet"); - new KAction(i18n("&Numbered list"), "", "", this, - SLOT(slotEditListNumber()), actionCollection(), "list_number"); - new KAction(i18n("&Uppercase list"), "", "", this, - SLOT(slotEditListUpper()), actionCollection(), "list_upper"); - new KAction(i18n("&Lowercase list"), "", "", this, - SLOT(slotEditListLower()), actionCollection(), "list_lower"); - new KAction(i18n("N&o list"), "", "", this, - SLOT(slotEditListNone()), actionCollection(), "list_none"); - KStdAction::find(&FindDlg, SLOT(exec()), actionCollection()); - KStdAction::findNext(this, SLOT(slotEditFindNext()), actionCollection()); - new KAction(i18n("&Go to ¬e..."), "goto", "Ctrl+G", this, - SLOT(slotEditGoTo()), actionCollection(), "goto_note"); - actionEditAlignLeft = new KToggleAction(i18n("Align &left"), "text_left", "Ctrl+L", this, - SLOT(slotEditAlignLeft()), actionCollection(), "edit_align_left"); + new KAction(i18n("&Text color..."), "color_line", "Ctrl+#", TQT_TQOBJECT(this), + TQT_SLOT(slotEditColor()), actionCollection(), "edit_color"); + new KAction(i18n("&Superscript"), "text_super", "", TQT_TQOBJECT(this), + TQT_SLOT(slotEditSuperscript()), actionCollection(), "edit_superscript"); + new KAction(i18n("&Subscript"), "text_sub", "", TQT_TQOBJECT(this), + TQT_SLOT(slotEditSubscript()), actionCollection(), "edit_subscript"); + new KAction(i18n("&Normal text"), "", "", TQT_TQOBJECT(this), + TQT_SLOT(slotEditNormal()), actionCollection(), "edit_align_normal"); + new KAction(i18n("&Bullet list"), "", "", TQT_TQOBJECT(this), + TQT_SLOT(slotEditListBullet()), actionCollection(), "list_bullet"); + new KAction(i18n("&Numbered list"), "", "", TQT_TQOBJECT(this), + TQT_SLOT(slotEditListNumber()), actionCollection(), "list_number"); + new KAction(i18n("&Uppercase list"), "", "", TQT_TQOBJECT(this), + TQT_SLOT(slotEditListUpper()), actionCollection(), "list_upper"); + new KAction(i18n("&Lowercase list"), "", "", TQT_TQOBJECT(this), + TQT_SLOT(slotEditListLower()), actionCollection(), "list_lower"); + new KAction(i18n("N&o list"), "", "", TQT_TQOBJECT(this), + TQT_SLOT(slotEditListNone()), actionCollection(), "list_none"); + KStdAction::find(TQT_TQOBJECT(&FindDlg), TQT_SLOT(exec()), actionCollection()); + KStdAction::findNext(TQT_TQOBJECT(this), TQT_SLOT(slotEditFindNext()), actionCollection()); + new KAction(i18n("&Go to ¬e..."), "goto", "Ctrl+G", TQT_TQOBJECT(this), + TQT_SLOT(slotEditGoTo()), actionCollection(), "goto_note"); + actionEditAlignLeft = new KToggleAction(i18n("Align &left"), "text_left", "Ctrl+L", TQT_TQOBJECT(this), + TQT_SLOT(slotEditAlignLeft()), actionCollection(), "edit_align_left"); actionEditAlignRight = new KToggleAction(i18n("Align &right"), "text_right", "Ctrl+R", - this, SLOT(slotEditAlignRight()), actionCollection(), "edit_align_right"); + TQT_TQOBJECT(this), TQT_SLOT(slotEditAlignRight()), actionCollection(), "edit_align_right"); actionEditAlignJustify = new KToggleAction(i18n("&Justify"), "text_block", "Ctrl+J", - this, SLOT(slotEditAlignJustify()), actionCollection(), "edit_align_justify"); - actionEditAlignCenter = new KToggleAction(i18n("&Center"), "text_center", "Ctrl+E", this, - SLOT(slotEditAlignCenter()), actionCollection(), "edit_align_center"); - new KAction(i18n("Insert &date"), "date", "F5", this, - SLOT(slotEditInsertDate()), actionCollection(), "edit_insert_date"); - new KAction(i18n("Insert &file..."), "", "", this, - SLOT(slotEditInsertFile()), actionCollection(), "edit_insert_file"); + TQT_TQOBJECT(this), TQT_SLOT(slotEditAlignJustify()), actionCollection(), "edit_align_justify"); + actionEditAlignCenter = new KToggleAction(i18n("&Center"), "text_center", "Ctrl+E", TQT_TQOBJECT(this), + TQT_SLOT(slotEditAlignCenter()), actionCollection(), "edit_align_center"); + new KAction(i18n("Insert &date"), "date", "F5", TQT_TQOBJECT(this), + TQT_SLOT(slotEditInsertDate()), actionCollection(), "edit_insert_date"); + new KAction(i18n("Insert &file..."), "", "", TQT_TQOBJECT(this), + TQT_SLOT(slotEditInsertFile()), actionCollection(), "edit_insert_file"); actionRawTextMode = new KToggleAction(i18n("&Raw Text Mode"), - "source", "F10", this, SLOT(slotRawTextMode()), + "source", "F10", TQT_TQOBJECT(this), TQT_SLOT(slotRawTextMode()), actionCollection(), "edit_raw_text"); /* Actions: edit setup */ actionCut->setEnabled(false); actionCopy->setEnabled(false); - connect(Edit, SIGNAL(copyAvailable(bool)), actionCut, SLOT(setEnabled(bool))); - connect(Edit, SIGNAL(copyAvailable(bool)), actionCopy, SLOT(setEnabled(bool))); - connect(Edit, SIGNAL(undoAvailable(bool)), actionUndo, SLOT(setEnabled(bool))); - connect(Edit, SIGNAL(redoAvailable(bool)), actionRedo, SLOT(setEnabled(bool))); + connect(Edit, TQT_SIGNAL(copyAvailable(bool)), actionCut, TQT_SLOT(setEnabled(bool))); + connect(Edit, TQT_SIGNAL(copyAvailable(bool)), actionCopy, TQT_SLOT(setEnabled(bool))); + connect(Edit, TQT_SIGNAL(undoAvailable(bool)), actionUndo, TQT_SLOT(setEnabled(bool))); + connect(Edit, TQT_SIGNAL(redoAvailable(bool)), actionRedo, TQT_SLOT(setEnabled(bool))); /* Actions: notes */ - new KAction(i18n("&Add"), "", "Alt+Insert", this, SLOT(slotNoteAdd()), + new KAction(i18n("&Add"), "", "Alt+Insert", TQT_TQOBJECT(this), TQT_SLOT(slotNoteAdd()), actionCollection(), "note_add"); - new KAction(i18n("Add &subnote"), "", "Alt+Shift+Insert", this, - SLOT(slotNoteAddChild()), actionCollection(), "note_add_child"); - new KAction(i18n("&Delete"), "", "Alt+Delete", this, - SLOT(slotNoteRemove()), actionCollection(), "note_delete"); - new KAction(i18n("&Rename"), "", "F2", this, - SLOT(slotNoteRename()), actionCollection(), "note_rename"); - new KAction(i18n("E&xpand all"), "", "", Items, - SLOT(slotExpandAll()), actionCollection(), "note_expand_all"); - new KAction(i18n("&Expand current"), "", "Alt++", Items, - SLOT(slotExpand()), actionCollection(), "note_expand"); - new KAction(i18n("Co&llapse all"), "", "", Items, - SLOT(slotCollapseAll()), actionCollection(), "note_collapse_all"); - new KAction(i18n("&Collapse current"), "", "Alt+-", Items, - SLOT(slotCollapse()), actionCollection(), "note_collapse"); - new KAction(i18n("Move up"), "up", "Alt+Shift+Up", this, - SLOT(slotNoteMoveUp()), actionCollection(), "note_move_up"); - new KAction(i18n("Move down"), "down", "Alt+Shift+Down", this, - SLOT(slotNoteMoveDown()), actionCollection(), "note_move_down"); - new KAction(i18n("Move level up"), "back", "Alt+Shift+Left", this, - SLOT(slotNoteMoveLeft()), actionCollection(), "note_move_left"); - new KAction(i18n("Move level down"), "forward", "Alt+Shift+Right", this, - SLOT(slotNoteMoveRight()), actionCollection(), "note_move_right"); - new KAction(i18n("Move at the beginning"), "top", "Alt+Shift+Home", this, - SLOT(slotNoteMoveBegin()), actionCollection(), "note_move_begin"); - new KAction(i18n("Move at the end"), "bottom", "Alt+Shift+End", this, - SLOT(slotNoteMoveEnd()), actionCollection(), "note_move_end"); - new KAction(i18n("Sort"), "", "", this, - SLOT(slotNoteSort()), actionCollection(), "note_sort"); + new KAction(i18n("Add &subnote"), "", "Alt+Shift+Insert", TQT_TQOBJECT(this), + TQT_SLOT(slotNoteAddChild()), actionCollection(), "note_add_child"); + new KAction(i18n("&Delete"), "", "Alt+Delete", TQT_TQOBJECT(this), + TQT_SLOT(slotNoteRemove()), actionCollection(), "note_delete"); + new KAction(i18n("&Rename"), "", "F2", TQT_TQOBJECT(this), + TQT_SLOT(slotNoteRename()), actionCollection(), "note_rename"); + new KAction(i18n("E&xpand all"), "", "", TQT_TQOBJECT(Items), + TQT_SLOT(slotExpandAll()), actionCollection(), "note_expand_all"); + new KAction(i18n("&Expand current"), "", "Alt++", TQT_TQOBJECT(Items), + TQT_SLOT(slotExpand()), actionCollection(), "note_expand"); + new KAction(i18n("Co&llapse all"), "", "", TQT_TQOBJECT(Items), + TQT_SLOT(slotCollapseAll()), actionCollection(), "note_collapse_all"); + new KAction(i18n("&Collapse current"), "", "Alt+-", TQT_TQOBJECT(Items), + TQT_SLOT(slotCollapse()), actionCollection(), "note_collapse"); + new KAction(i18n("Move up"), "up", "Alt+Shift+Up", TQT_TQOBJECT(this), + TQT_SLOT(slotNoteMoveUp()), actionCollection(), "note_move_up"); + new KAction(i18n("Move down"), "down", "Alt+Shift+Down", TQT_TQOBJECT(this), + TQT_SLOT(slotNoteMoveDown()), actionCollection(), "note_move_down"); + new KAction(i18n("Move level up"), "back", "Alt+Shift+Left", TQT_TQOBJECT(this), + TQT_SLOT(slotNoteMoveLeft()), actionCollection(), "note_move_left"); + new KAction(i18n("Move level down"), "forward", "Alt+Shift+Right", TQT_TQOBJECT(this), + TQT_SLOT(slotNoteMoveRight()), actionCollection(), "note_move_right"); + new KAction(i18n("Move at the beginning"), "top", "Alt+Shift+Home", TQT_TQOBJECT(this), + TQT_SLOT(slotNoteMoveBegin()), actionCollection(), "note_move_begin"); + new KAction(i18n("Move at the end"), "bottom", "Alt+Shift+End", TQT_TQOBJECT(this), + TQT_SLOT(slotNoteMoveEnd()), actionCollection(), "note_move_end"); + new KAction(i18n("Sort"), "", "", TQT_TQOBJECT(this), + TQT_SLOT(slotNoteSort()), actionCollection(), "note_sort"); /* Actions: Links */ - new KAction(i18n("&Add link..."), "attach", "Ctrl+Shift+I", this, - SLOT(slotLinkAdd()), actionCollection(), "link_add"); - new KAction(i18n("&Remove link"), "", "", this, - SLOT(slotLinkRemove()), actionCollection(), "link_remove"); - new KAction(i18n("Open link"), "run", "", this, - SLOT(slotLinkOpen()), actionCollection(), "link_open"); - new KAction(i18n("Open link with..."), "", "", this, - SLOT(slotLinkOpenWith()), actionCollection(), "link_open_with"); - new KAction(i18n("&Modify link..."), "", "", this, - SLOT(slotLinkModify()), actionCollection(), "link_modify"); - new KAction(i18n("&Copy link location"), "", "", this, - SLOT(slotLinkCopy()), actionCollection(), "link_copy"); + new KAction(i18n("&Add link..."), "attach", "Ctrl+Shift+I", TQT_TQOBJECT(this), + TQT_SLOT(slotLinkAdd()), actionCollection(), "link_add"); + new KAction(i18n("&Remove link"), "", "", TQT_TQOBJECT(this), + TQT_SLOT(slotLinkRemove()), actionCollection(), "link_remove"); + new KAction(i18n("Open link"), "run", "", TQT_TQOBJECT(this), + TQT_SLOT(slotLinkOpen()), actionCollection(), "link_open"); + new KAction(i18n("Open link with..."), "", "", TQT_TQOBJECT(this), + TQT_SLOT(slotLinkOpenWith()), actionCollection(), "link_open_with"); + new KAction(i18n("&Modify link..."), "", "", TQT_TQOBJECT(this), + TQT_SLOT(slotLinkModify()), actionCollection(), "link_modify"); + new KAction(i18n("&Copy link location"), "", "", TQT_TQOBJECT(this), + TQT_SLOT(slotLinkCopy()), actionCollection(), "link_copy"); /* Actions: Options */ - KStdAction::keyBindings(this, SLOT(slotOptionsKeys()), actionCollection()); - KStdAction::configureToolbars(this, SLOT(slotOptionsToolbar()), actionCollection()); - KStdAction::preferences(this, SLOT(slotOptions()), actionCollection()); + KStdAction::keyBindings(TQT_TQOBJECT(this), TQT_SLOT(slotOptionsKeys()), actionCollection()); + KStdAction::configureToolbars(TQT_TQOBJECT(this), TQT_SLOT(slotOptionsToolbar()), actionCollection()); + KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(slotOptions()), actionCollection()); /* Actions: Help */ - new KAction(i18n("&Tip of the day"), "idea", "", this, - SLOT(slotHelpTip()), actionCollection(), "help_tip"); + new KAction(i18n("&Tip of the day"), "idea", "", TQT_TQOBJECT(this), + TQT_SLOT(slotHelpTip()), actionCollection(), "help_tip"); /* Actions: nonplugged */ - new KAction(i18n("Minimize"), "", "", this, SLOT(showMinimized()), + new KAction(i18n("Minimize"), "", "", TQT_TQOBJECT(this), TQT_SLOT(showMinimized()), actionCollection(), "window_minimize"); - new KAction(i18n("Switch area"), "", "Ctrl+M", this, - SLOT(slotEditSwitch()), actionCollection(), "edit_switch"); - new KAction(i18n("Overwrite Mode"), "", "Insert", this, - SLOT(slotOverwriteModeChange()), actionCollection(), "overwrite_mode_change"); - new KAction(i18n("Go to previous note"), "", "Alt+Up", Items, - SLOT(slotItemUp()), actionCollection(), "note_previous"); - new KAction(i18n("Go to next note"), "", "Alt+Down", Items, - SLOT(slotItemDown()), actionCollection(), "note_next"); - new KAction(i18n("Go to first note"), "", "Alt+Home", Items, - SLOT(slotItemBegin()), actionCollection(), "note_begin"); - new KAction(i18n("Go to last note"), "", "Alt+End", Items, - SLOT(slotItemEnd()), actionCollection(), "note_end"); - new KAction(i18n("Go to first subnote"), "", "Alt+Right", Items, - SLOT(slotItemRight()), actionCollection(), "note_right"); - new KAction(i18n("Go to parent note"), "", "Alt+Left", Items, - SLOT(slotItemLeft()), actionCollection(), "note_left"); + new KAction(i18n("Switch area"), "", "Ctrl+M", TQT_TQOBJECT(this), + TQT_SLOT(slotEditSwitch()), actionCollection(), "edit_switch"); + new KAction(i18n("Overwrite Mode"), "", "Insert", TQT_TQOBJECT(this), + TQT_SLOT(slotOverwriteModeChange()), actionCollection(), "overwrite_mode_change"); + new KAction(i18n("Go to previous note"), "", "Alt+Up", TQT_TQOBJECT(Items), + TQT_SLOT(slotItemUp()), actionCollection(), "note_previous"); + new KAction(i18n("Go to next note"), "", "Alt+Down", TQT_TQOBJECT(Items), + TQT_SLOT(slotItemDown()), actionCollection(), "note_next"); + new KAction(i18n("Go to first note"), "", "Alt+Home", TQT_TQOBJECT(Items), + TQT_SLOT(slotItemBegin()), actionCollection(), "note_begin"); + new KAction(i18n("Go to last note"), "", "Alt+End", TQT_TQOBJECT(Items), + TQT_SLOT(slotItemEnd()), actionCollection(), "note_end"); + new KAction(i18n("Go to first subnote"), "", "Alt+Right", TQT_TQOBJECT(Items), + TQT_SLOT(slotItemRight()), actionCollection(), "note_right"); + new KAction(i18n("Go to tqparent note"), "", "Alt+Left", TQT_TQOBJECT(Items), + TQT_SLOT(slotItemLeft()), actionCollection(), "note_left"); /* Actions */ #if KDE_VERSION_MAJOR >= 3 && KDE_VERSION_MINOR >= 1 @@ -265,17 +265,17 @@ Knowit::Knowit(QWidget*, const char *name) : KMainWindow(0, name), /* Insert/overwrite mode */ statusBar()->insertFixedItem(("WWW"), StatusOvr, true); statusBar()->changeItem(i18n("INS"), StatusOvr); - connect(statusBar(), SIGNAL(pressed(int)), this, - SLOT(slotOverwriteModeChange(int))); + connect(statusBar(), TQT_SIGNAL(pressed(int)), this, + TQT_SLOT(slotOverwriteModeChange(int))); /* System tray */ systray = new KnowitTray(this, "Systray"); systray->setPixmap(Notes.Pixmaps[1]); - systray->setAlignment(Qt::AlignHCenter | Qt::AlignVCenter); + systray->tqsetAlignment(TQt::AlignHCenter | TQt::AlignVCenter); /* Autosave */ - AutosaveTimer = new QTimer(this); - connect(AutosaveTimer, SIGNAL(timeout()), this, SLOT(slotFileAutosave())); + AutosaveTimer = new TQTimer(this); + connect(AutosaveTimer, TQT_SIGNAL(timeout()), TQT_TQOBJECT(this), TQT_SLOT(slotFileAutosave())); /* Configuration */ config = kapp->config(); @@ -306,7 +306,7 @@ Knowit::Knowit(QWidget*, const char *name) : KMainWindow(0, name), applyMainWindowSettings(config); /* check if knowituirc was found */ - QWidget *w = factory()->container("notes_popup", this); + TQWidget *w = factory()->container("notes_popup", this); if (!w) KMessageBox::error(0, i18n("<qt><p>Cannot open resource file <b>knowitui.rc</b>. " "Some of the menus and toolbars will be missing.</p>" @@ -323,46 +323,46 @@ Knowit::~Knowit() bool Knowit::open(const KURL& fname) { - QFile file(fname.path()); + TQFile file(fname.path()); if (!file.open(IO_ReadOnly)) { KMessageBox::error(0, i18n("<qt>Cannot open file<br><b>%1</b></qt>") - .arg(fname.url())); + .tqarg(fname.url())); if (filename == fname) filename = ""; return false; } uint prevdepth = 0; reset(); - QTextStream ts(&file); - ts.setEncoding(QTextStream::UnicodeUTF8); - QString s = ""; - QListViewItem* current = 0; - QListViewItem* active = 0; + TQTextStream ts(&file); + ts.setEncoding(TQTextStream::UnicodeUTF8); + TQString s = ""; + TQListViewItem* current = 0; + TQListViewItem* active = 0; Notes.autoUpdate = false; while (!s.isNull()) { s = ts.readLine(); if (s.left(9) == "\\NewEntry" || s.left(13) == "\\CurrentEntry") { - QString name; + TQString name; uint depth; - QTextIStream ls(&s); + TQTextIStream ls(&s); ls >> name >> depth; name = ls.readLine(); name = name.stripWhiteSpace(); if (depth == prevdepth) /* same level */ - if (depth) current = new KListViewItem(current->parent(), current, name); + if (depth) current = new KListViewItem(current->tqparent(), current, name); else current = new KListViewItem(Items, current, name); else if (depth > prevdepth) /* subnote */ current = new KListViewItem(current, name); - else { /* parent note */ + else { /* tqparent note */ for(uint i=depth; i<prevdepth && current; i++) - current = current->parent(); - if (current && current->parent()) - current = new KListViewItem(current->parent(), current, name); + current = current->tqparent(); + if (current && current->tqparent()) + current = new KListViewItem(current->tqparent(), current, name); else current = new KListViewItem(Items, current, name); } prevdepth = depth; Notes.addNote(current); - Notes.find(current)->open(ts); + Notes.tqfind(current)->open(ts); if (s.left(13) == "\\CurrentEntry") active = current; } @@ -376,7 +376,7 @@ bool Knowit::open(const KURL& fname) slotNoteChanged(active); Edit->setModified(false); actionRecent->addURL(filename); - slotStatusMsg(i18n("File %1 opened.").arg(filename.fileName())); + slotStatusMsg(i18n("File %1 opened.").tqarg(filename.fileName())); slotActionUpdate(); file.close(); @@ -389,25 +389,25 @@ bool Knowit::open(const KURL& fname) bool Knowit::save(const KURL& fname) { - QFile file(fname.path()); + TQFile file(fname.path()); if (!file.open(IO_WriteOnly)) { KMessageBox::error(0, i18n("<qt>Cannot save file<br><b>%1</b></qt>") - .arg(fname.url())); + .tqarg(fname.url())); return false; } if (Items->prevItem && Edit->isModified()) - Notes.changeNote(Items->prevItem, Edit->length() ? Edit->text() : QString()); + Notes.changeNote(Items->prevItem, Edit->length() ? Edit->text() : TQString()); - QTextStream ts(&file); - ts.setEncoding(QTextStream::UnicodeUTF8); - for (QListViewItemIterator it(Items); it.current(); it++) - Notes.find(it.current())->save(ts, it.current() == Items->currentItem()); + TQTextStream ts(&file); + ts.setEncoding(TQTextStream::UnicodeUTF8); + for (TQListViewItemIterator it(Items); it.current(); it++) + Notes.tqfind(it.current())->save(ts, it.current() == Items->currentItem()); filename = fname; setCaption(fname.fileName()); Notes.modified = false; Edit->setModified(false); actionRecent->addURL(filename); - slotStatusMsg(i18n("File %1 saved.").arg(filename.fileName())); + slotStatusMsg(i18n("File %1 saved.").tqarg(filename.fileName())); if (Options.autosave) AutosaveTimer->start(Options.autosave * 60 * 1000, true); return true; @@ -427,7 +427,7 @@ void Knowit::reset() -void Knowit::closeEvent(QCloseEvent* e) +void Knowit::closeEvent(TQCloseEvent* e) { if (!Options.docked || ((KnowitApplication*)kapp)->closeByLogout()) { saveOptions(); @@ -443,13 +443,13 @@ bool Knowit::queryClose() else if (Options.unconditionalSave) { slotFileSave(); return shuttingDown = filename.isEmpty() || !modified() || (KMessageBox::questionYesNo(0, - i18n("<qt>File <b>%1</b><br>\ncannot be saved. Quit anyway?</qt>").arg(filename.fileName())) + i18n("<qt>File <b>%1</b><br>\ncannot be saved. Quit anyway?</qt>").tqarg(filename.fileName())) == KMessageBox::Yes); } else switch (KMessageBox::questionYesNoCancel(0, i18n("<qt>File <b>%1</b><br>\nwas modified. Do you want to save it?</qt>") - .arg(filename.isEmpty() ? Untitled : filename.fileName()))) { + .tqarg(filename.isEmpty() ? Untitled : filename.fileName()))) { case KMessageBox::Yes: slotFileSave(); return shuttingDown = !modified(); @@ -472,26 +472,26 @@ bool Knowit::queryExit() } -void Knowit::find(QListViewItem* start) +void Knowit::tqfind(TQListViewItem* start) { if (soughtText.isEmpty() || !Items->firstChild()) return; if (start && lastSought == start && - Edit->find(soughtText, FindDlg.case_sensitive(), false)) + Edit->tqfind(soughtText, FindDlg.case_sensitive(), false)) return; if (!start) start = Items->firstChild(); - QListViewItemIterator it(start); + TQListViewItemIterator it(start); while (it.current()) { - QString s = Notes.text(it.current()); + TQString s = Notes.text(it.current()); if (lastSought != it.current() && - s.contains(soughtText, FindDlg.case_sensitive())) { + s.tqcontains(soughtText, FindDlg.case_sensitive())) { slotNoteChanged(it.current()); - Edit->find(soughtText, FindDlg.case_sensitive(), false); + Edit->tqfind(soughtText, FindDlg.case_sensitive(), false); lastSought = it.current(); return; } it++; } - KMessageBox::information(0, i18n("<qt>Sought text:<br><b>%1</b><br>not found.</qt>").arg(soughtText)); + KMessageBox::information(0, i18n("<qt>Sought text:<br><b>%1</b><br>not found.</qt>").tqarg(soughtText)); } @@ -513,14 +513,14 @@ void Knowit::saveOptions() void Knowit::readOptions() { config->setGroup("MainWindow"); - QValueList<int> sizes = config->readIntListEntry("Widgets"); + TQValueList<int> sizes = config->readIntListEntry("Widgets"); if (sizes.count() == 2) Layout->setSizes(sizes); Options.read(config); config->setGroup("General"); runMinimized = config->readBoolEntry("Minimized", false); - QString oldfile = config->readEntry("LastFile"); - QSize defSize = size(); + TQString oldfile = config->readEntry("LastFile"); + TQSize defSize = size(); resize(config->readSizeEntry("Geometry", &defSize)); actionCollection()->readShortcutSettings("Keys", config); actionRecent->loadEntries(config,"Recent Files"); @@ -529,7 +529,7 @@ void Knowit::readOptions() applyOptions(Options); } -void Knowit::slotNoteChanged(QListViewItem* item) +void Knowit::slotNoteChanged(TQListViewItem* item) { if (item) { if (Options.autoCollapse) @@ -554,17 +554,17 @@ void Knowit::applyOptions(const KnowitOptions& O, bool store) systray->hide(); if (O.customColors) { - Edit->setPaletteForegroundColor(QColor(Options.foreEditColor)); - Edit->setPaletteBackgroundColor(QColor(Options.backEditColor)); + Edit->setPaletteForegroundColor(TQColor(Options.foreEditColor)); + Edit->setPaletteBackgroundColor(TQColor(Options.backEditColor)); } else Edit->unsetPalette(); if (Options.customFont) - Edit->setFont(QFont(Options.fontFamily, Options.fontSize)); + Edit->setFont(TQFont(Options.fontFamily, Options.fontSize)); else Edit->unsetFont(); - Edit->setWordWrap(O.wordwrap ? QTextEdit::WidgetWidth : QTextEdit::NoWrap); + Edit->setWordWrap(O.wordwrap ? TQTextEdit::WidgetWidth : TQTextEdit::NoWrap); #if KDE_VERSION_MAJOR >= 3 && KDE_VERSION_MINOR >= 1 Edit->setTabChangesFocus(O.tabfocus); #endif @@ -573,10 +573,10 @@ void Knowit::applyOptions(const KnowitOptions& O, bool store) else AutosaveTimer->start(O.autosave * 60 * 1000, true); Edit->swapEOL = O.enterBreakLine; - Layout->setOrientation(O.horizontalSplit ? QSplitter::Horizontal : - QSplitter::Vertical); - Items->setAlternateBackground(O.alternateTree ? QColor(O.alternateColor) : QColor()); - Items->repaintContents(); + Layout->setOrientation(O.horizontalSplit ? Qt::Horizontal : + Qt::Vertical); + Items->setAlternateBackground(O.alternateTree ? TQColor(O.alternateColor) : TQColor()); + Items->tqrepaintContents(); if (Items->currentItem()) slotItemChanged(Items->currentItem()); slotNoteChanged(Items->currentItem()); @@ -585,7 +585,7 @@ void Knowit::applyOptions(const KnowitOptions& O, bool store) TNote* Knowit::currentNote() const { if (!Items->currentItem()) return 0; - return Notes.find(Items->currentItem()); + return Notes.tqfind(Items->currentItem()); } @@ -594,26 +594,26 @@ TNote* Knowit::currentNote() const /*** Slots ***/ -void Knowit::slotStatusMsg(const QString &text) +void Knowit::slotStatusMsg(const TQString &text) { statusBar()->clear(); statusBar()->changeItem(text, 0); } -void Knowit::slotContextMenu(KListView*, QListViewItem*, const QPoint& p) +void Knowit::slotContextMenu(KListView*, TQListViewItem*, const TQPoint& p) { - QWidget *w = factory()->container("notes_popup", this); + TQWidget *w = factory()->container("notes_popup", this); if (w) - static_cast<QPopupMenu *>(w)->exec(p); + static_cast<TQPopupMenu *>(w)->exec(p); } -void Knowit::slotContextLinksMenu(QListBoxItem*, const QPoint& p) +void Knowit::slotContextLinksMenu(TQListBoxItem*, const TQPoint& p) { - QWidget *w = factory()->container("links_popup", this); + TQWidget *w = factory()->container("links_popup", this); if (w) - static_cast<QPopupMenu *>(w)->exec(p); + static_cast<TQPopupMenu *>(w)->exec(p); } @@ -623,12 +623,12 @@ void Knowit::slotNoteAdd() { bool Ok; KListViewItem* elt; - QString text = KInputDialog::getText(i18n("Add note"), + TQString text = KInputDialog::getText(i18n("Add note"), i18n("Note title:"), Options.defaultName, &Ok); if (!Ok) return; if (Items->currentItem()) - if (Items->currentItem()->parent()) - elt = new KListViewItem(Items->currentItem()->parent(), + if (Items->currentItem()->tqparent()) + elt = new KListViewItem(Items->currentItem()->tqparent(), Items->currentItem(), text); else elt = new KListViewItem(Items, Items->currentItem(), text); @@ -647,10 +647,10 @@ void Knowit::slotNoteAddChild() return; } bool Ok; - QString text = KInputDialog::getText(i18n("Add subnote"), + TQString text = KInputDialog::getText(i18n("Add subnote"), i18n("Note title:"), Options.defaultName, &Ok); if (!Ok) return; - QListViewItem* lastChild = Items->currentItem()->firstChild(); + TQListViewItem* lastChild = Items->currentItem()->firstChild(); while (lastChild && lastChild->nextSibling()) lastChild = lastChild->nextSibling(); @@ -665,21 +665,21 @@ void Knowit::slotNoteAddChild() void Knowit::slotNoteRemove() { - QListViewItem* elt = Items->currentItem(); + TQListViewItem* elt = Items->currentItem(); if (!elt) return; - QString msg = elt->childCount() ? + TQString msg = elt->childCount() ? i18n("<qt>Are you sure you want to delete note<br><b>%1</b><br> " "and its subnotes?</qt>") : i18n("<qt>Are you sure you want to delete note<br><b>%1</b>?</qt>"); - if (KMessageBox::questionYesNo(0, msg.arg(elt->text(0))) == KMessageBox::Yes) { - QListViewItem* parent = elt->parent(); + if (KMessageBox::questionYesNo(0, msg.tqarg(elt->text(0))) == KMessageBox::Yes) { + TQListViewItem* tqparent = elt->tqparent(); Notes.removeNote(elt); if (!Notes.count()) slotActionUpdate(); - if (!parent) - parent = Items->firstChild(); + if (!tqparent) + tqparent = Items->firstChild(); Items->prevItem = 0; - slotNoteChanged(parent); + slotNoteChanged(tqparent); } } @@ -696,19 +696,19 @@ void Knowit::slotNoteRename() -void Knowit::slotItemChanged(QListViewItem* i) +void Knowit::slotItemChanged(TQListViewItem* i) { if (Items->prevItem && Edit->isModified()) - Notes.changeNote(Items->prevItem, Edit->length() ? Edit->text() : QString()); + Notes.changeNote(Items->prevItem, Edit->length() ? Edit->text() : TQString()); Items->prevItem = i; - QString s; + TQString s; if (!Items->prevItem || (s = Notes.text(Items->prevItem)).isEmpty()) Edit->setText(""); else Edit->setText(s); Edit->setModified(false); Links->clear(); - TNote* note = Notes.find(i); + TNote* note = Notes.tqfind(i); if (note) for (int j=0; j<note->linkCount(); j++) Links->insertItem(note->link(j).icon(), note->link(j).text(Options.linkFormat)); @@ -720,9 +720,9 @@ void Knowit::slotItemChanged(QListViewItem* i) void Knowit::slotNoteMoveUp() { - QListViewItem* elt = Items->currentItem(); + TQListViewItem* elt = Items->currentItem(); if (elt && elt->itemAbove()) { - QListViewItem* above = elt->parent() ? elt->parent()->firstChild() + TQListViewItem* above = elt->tqparent() ? elt->tqparent()->firstChild() : Items->firstChild(); if (above == elt) return; @@ -733,9 +733,9 @@ void Knowit::slotNoteMoveUp() if (above) elt->moveItem(above); else { - QListViewItem* parent = elt->parent(); + TQListViewItem* tqparent = elt->tqparent(); Items->takeNode(elt); - Items->insertNode(parent, elt); + Items->insertNode(tqparent, elt); } slotNoteChanged(elt); Notes.modified = true; @@ -744,7 +744,7 @@ void Knowit::slotNoteMoveUp() void Knowit::slotNoteMoveDown() { - QListViewItem* elt = Items->currentItem(); + TQListViewItem* elt = Items->currentItem(); if (elt && elt->nextSibling()) { elt->moveItem(elt->nextSibling()); slotNoteChanged(elt); @@ -754,13 +754,13 @@ void Knowit::slotNoteMoveDown() void Knowit::slotNoteMoveBegin() { - QListViewItem* elt = Items->currentItem(); + TQListViewItem* elt = Items->currentItem(); if (elt) { - QListViewItem* parent = elt->parent(); + TQListViewItem* tqparent = elt->tqparent(); Items->takeNode(elt); Items->insertItem(elt); - if (parent) - Notes.find(parent)->updateView(); + if (tqparent) + Notes.tqfind(tqparent)->updateView(); slotNoteChanged(elt); Notes.modified = true; } @@ -768,31 +768,31 @@ void Knowit::slotNoteMoveBegin() void Knowit::slotNoteMoveEnd() { - QListViewItem* elt = Items->currentItem(); + TQListViewItem* elt = Items->currentItem(); if (!elt) return; - QListViewItem* last = Items->firstChild(); - QListViewItem* parent = elt->parent(); + TQListViewItem* last = Items->firstChild(); + TQListViewItem* tqparent = elt->tqparent(); while (last->nextSibling()) last = last->nextSibling(); if (elt && elt != last) { Items->takeNode(elt); Items->insertNode(0, elt, last); slotNoteChanged(elt); - if (parent) - Notes.find(parent)->updateView(); + if (tqparent) + Notes.tqfind(tqparent)->updateView(); Notes.modified = true; } } void Knowit::slotNoteMoveLeft() { - QListViewItem* elt = Items->currentItem(); - QListViewItem* parent = elt->parent(); - if (elt && parent) { + TQListViewItem* elt = Items->currentItem(); + TQListViewItem* tqparent = elt->tqparent(); + if (elt && tqparent) { Items->takeNode(elt); - Items->insertNode(parent->parent(), elt, parent); - Notes.find(parent)->updateView(); + Items->insertNode(tqparent->tqparent(), elt, tqparent); + Notes.tqfind(tqparent)->updateView(); slotNoteChanged(elt); Notes.modified = true; } @@ -800,8 +800,8 @@ void Knowit::slotNoteMoveLeft() void Knowit::slotNoteMoveRight() { - QListViewItem* elt = Items->currentItem(); - QListViewItem* above = elt->itemAbove(); + TQListViewItem* elt = Items->currentItem(); + TQListViewItem* above = elt->itemAbove(); if (elt && above) { if (above->depth() < elt->depth()) return; @@ -811,11 +811,11 @@ void Knowit::slotNoteMoveRight() } else { while (above->depth() > elt->depth()+1) - above = above->parent(); + above = above->tqparent(); Items->takeNode(elt); - Items->insertNode(above->parent(), elt, above); + Items->insertNode(above->tqparent(), elt, above); } - Notes.find(above)->updateView(); + Notes.tqfind(above)->updateView(); slotNoteChanged(elt); Notes.modified = true; } @@ -825,7 +825,7 @@ void Knowit::slotNoteSort() { if (Items->currentItem()) { Items->currentItem()->sortChildItems(0, true); - Items->repaintContents(); + Items->tqrepaintContents(); } } @@ -839,7 +839,7 @@ void Knowit::slotFileNew() void Knowit::slotFileOpen() { if (!queryClose()) return; - KURL url=KFileDialog::getOpenURL(QString::null, + KURL url=KFileDialog::getOpenURL(TQString(), i18n("*.kno|KnowIt files (*.kno)\n*|All files"), this, i18n("Open File...")); if (!url.isEmpty()) open(url); @@ -876,15 +876,15 @@ void Knowit::slotFileRecent(const KURL& url) void Knowit::slotFileSaveAs() { - KURL url=KFileDialog::getSaveURL(QDir::currentDirPath(), + KURL url=KFileDialog::getSaveURL(TQDir::currentDirPath(), i18n("*.kno|KnowIt files (*.kno)\n*|All files"), this, i18n("Save as...")); if (!url.isEmpty()) { - if (!url.fileName().contains('.')) + if (!url.fileName().tqcontains('.')) url = KURL(url.path() + ".kno"); - QFileInfo fileinfo(url.path()); + TQFileInfo fileinfo(url.path()); if (fileinfo.exists() && KMessageBox::questionYesNo(0, i18n("<qt>File<br><b>%1</b><br>already exists. Overwrite it?</qt>") - .arg(url.path())) == KMessageBox::No) + .tqarg(url.path())) == KMessageBox::No) return; save(url); } @@ -894,15 +894,15 @@ void Knowit::slotFileSaveAs() void Knowit::slotFileInfo() { int count = 0; - QListViewItemIterator it(Items); + TQListViewItemIterator it(Items); while (it.current()) { count++; it++; } KMessageBox::information(0, i18n("<qt><h1>%1</h1>" "Document path: %2<br>" - "Number of notes: %3</qt>").arg(filename.fileName()) - .arg(filename.path()).arg(count)); + "Number of notes: %3</qt>").tqarg(filename.fileName()) + .tqarg(filename.path()).tqarg(count)); } @@ -913,25 +913,25 @@ void Knowit::slotFilePrint() if (Edit->text().stripWhiteSpace().isEmpty() || !printer.setup(this)) return; - QSimpleRichText richText(Edit->text(), Edit->font()); - QPainter p(&printer); - QPaintDeviceMetrics metrics(p.device()); + TQSimpleRichText richText(Edit->text(), Edit->font()); + TQPainter p(&printer); + TQPaintDeviceMetrics metrics(p.device()); int dpix = metrics.logicalDpiX(); int dpiy = metrics.logicalDpiY(); const int margin = 72; // pt - QRect body(margin*dpix / 72, margin*dpiy / 72, + TQRect body(margin*dpix / 72, margin*dpiy / 72, metrics.width()- margin*dpix /72*2, metrics.height()-margin*dpiy/72*2); richText.setWidth(&p, body.width()); - QRect view(body); + TQRect view(body); int page = 1; while (true) { - richText.draw(&p, body.left(), body.top(), view, colorGroup()); + richText.draw(&p, body.left(), body.top(), view, tqcolorGroup()); view.moveBy(0, body.height()); p.translate( 0 , -body.height()); p.setFont(Edit->font()); - p.drawText( view.right() - p.fontMetrics().width( QString::number(page)), - view.bottom() + p.fontMetrics().ascent() + 5, QString::number(page)); + p.drawText( view.right() - p.fontMetrics().width( TQString::number(page)), + view.bottom() + p.fontMetrics().ascent() + 5, TQString::number(page)); if (view.top() >= body.top() + richText.height()) break; printer.newPage(); @@ -954,10 +954,10 @@ void Knowit::slotFileExport() { if (!Items->firstChild()) return; /* nothing to export */ ChooserDlg.setChoice(Options.exportFlags); - if (ChooserDlg.exec() != QDialog::Accepted) return; /* cancelled */ + if (ChooserDlg.exec() != TQDialog::Accepted) return; /* cancelled */ /* Deduce filename from Knowit document name */ - QString htmlfile; + TQString htmlfile; if (filename.isValid()) { htmlfile = filename.path(); if (htmlfile.right(4) == ".kno") @@ -965,29 +965,29 @@ void Knowit::slotFileExport() else htmlfile = ""; } if (htmlfile.isEmpty()) - htmlfile == QDir::currentDirPath(); + htmlfile == TQDir::currentDirPath(); /* Confirm/choose filename */ KURL url=KFileDialog::getSaveURL(htmlfile, i18n("*.html|HTML files (*.html)\n*|All files"), this, i18n("Export to HTML")); if (!url.isEmpty()) { - if (!url.fileName().contains('.')) + if (!url.fileName().tqcontains('.')) url = KURL(url.path() + ".html"); - QFileInfo fileinfo(url.path()); + TQFileInfo fileinfo(url.path()); if (fileinfo.exists() && KMessageBox::questionYesNo(0, i18n("<qt>File<br><b>%1</b><br>already exists. Overwrite it?</qt>") - .arg(url.path())) == KMessageBox::No) + .tqarg(url.path())) == KMessageBox::No) return; int choice = ChooserDlg.getChoice(); - QListViewItem* start = (choice & KnowitChooser::SaveAll) ? + TQListViewItem* start = (choice & KnowitChooser::SaveAll) ? Items->firstChild() : Items->currentItem(); - QString origname = filename.isEmpty() ? Untitled : filename.path(); - QString style; + TQString origname = filename.isEmpty() ? Untitled : filename.path(); + TQString style; if (choice & KnowitChooser::Style) - style = QString("body {font-family: \"%1\"; color: %2; background-color: %3}") - .arg(Edit->family()).arg(Edit->paletteForegroundColor().name()) - .arg(Edit->paletteBackgroundColor().name()); - Notes.find(start)->saveHTML(url, origname, style, choice); + style = TQString("body {font-family: \"%1\"; color: %2; background-color: %3}") + .tqarg(Edit->family()).tqarg(Edit->paletteForegroundColor().name()) + .tqarg(Edit->paletteBackgroundColor().name()); + Notes.tqfind(start)->saveHTML(url, origname, style, choice); Options.exportFlags = choice; } } @@ -1009,69 +1009,69 @@ void Knowit::slotEditUnderline() void Knowit::slotEditColor() { - QColor color = Edit->color(); - if (KColorDialog::getColor(color) == QDialog::Accepted) + TQColor color = Edit->color(); + if (KColorDialog::getColor(color) == TQDialog::Accepted) Edit->setColor(color); } void Knowit::slotEditSuperscript() { - Edit->setVerticalAlignment(QTextEdit::AlignSuperScript); + Edit->setVerticalAlignment(TQTextEdit::AlignSuperScript); } void Knowit::slotEditSubscript() { - Edit->setVerticalAlignment(QTextEdit::AlignSubScript); + Edit->setVerticalAlignment(TQTextEdit::AlignSubScript); } void Knowit::slotEditNormal() { - Edit->setVerticalAlignment(QTextEdit::AlignNormal); + Edit->setVerticalAlignment(TQTextEdit::AlignNormal); } void Knowit::slotEditAlignLeft() { - Edit->setAlignment(Qt::AlignLeft); + Edit->tqsetAlignment(TQt::AlignLeft); } void Knowit::slotEditAlignRight() { - Edit->setAlignment(Qt::AlignRight); + Edit->tqsetAlignment(TQt::AlignRight); } void Knowit::slotEditAlignJustify() { - Edit->setAlignment(Qt::AlignJustify); + Edit->tqsetAlignment(TQt::AlignJustify); } void Knowit::slotEditAlignCenter() { - Edit->setAlignment(Qt::AlignCenter); + Edit->tqsetAlignment(TQt::AlignCenter); } void Knowit::slotEditListBullet() { - Edit->setParagType(QStyleSheetItem::DisplayListItem, QStyleSheetItem::ListDisc); + Edit->setParagType(TQStyleSheetItem::DisplayListItem, TQStyleSheetItem::ListDisc); } void Knowit::slotEditListNumber() { - Edit->setParagType(QStyleSheetItem::DisplayListItem, QStyleSheetItem::ListDecimal); + Edit->setParagType(TQStyleSheetItem::DisplayListItem, TQStyleSheetItem::ListDecimal); } void Knowit::slotEditListUpper() { - Edit->setParagType(QStyleSheetItem::DisplayListItem, QStyleSheetItem::ListUpperAlpha); + Edit->setParagType(TQStyleSheetItem::DisplayListItem, TQStyleSheetItem::ListUpperAlpha); } void Knowit::slotEditListLower() { - Edit->setParagType(QStyleSheetItem::DisplayListItem, QStyleSheetItem::ListLowerAlpha); + Edit->setParagType(TQStyleSheetItem::DisplayListItem, TQStyleSheetItem::ListLowerAlpha); } void Knowit::slotEditListNone() { - Edit->setParagType(QStyleSheetItem::DisplayBlock, QStyleSheetItem::ListDisc); + Edit->setParagType(TQStyleSheetItem::DisplayBlock, TQStyleSheetItem::ListDisc); } void Knowit::slotEditFind() @@ -1079,27 +1079,27 @@ void Knowit::slotEditFind() if (soughtText != FindDlg.getText()) { soughtText = FindDlg.getText(); lastSought = 0; - find(); + tqfind(); } else - find(Items->currentItem()); + tqfind(Items->currentItem()); } void Knowit::slotEditFindNext() { if (soughtText.isEmpty()) FindDlg.exec(); - find(Items->currentItem()); + tqfind(Items->currentItem()); } void Knowit::slotEditGoTo() { bool Ok; - QString page = KInputDialog::getText(i18n("Go to"), + TQString page = KInputDialog::getText(i18n("Go to"), i18n("Go to page with given title"), "", &Ok); if (Ok && !page.isEmpty()) { - QListViewItem* item = Items->findItem(page, 0); - if (!item) item = Items->findItem(page, 0, Qt::ExactMatch); - if (!item) item = Items->findItem(page, 0, Qt::Contains); + TQListViewItem* item = Items->tqfindItem(page, 0); + if (!item) item = Items->tqfindItem(page, 0, TQt::ExactMatch); + if (!item) item = Items->tqfindItem(page, 0, TQt::Contains); slotNoteChanged(item); } } @@ -1108,13 +1108,13 @@ void Knowit::slotEditInsertDate() { if (Items->currentItem()) { bool ib = actionBold->isChecked(), ii=actionItalic->isChecked(), iu=actionUnderline->isChecked(); - QColor color = Edit->color(); + TQColor color = Edit->color(); Edit->setItalic(Options.insertDateItalic); Edit->setBold(Options.insertDateBold); Edit->setUnderline(Options.insertDateUnderline); - Edit->setColor(QColor(Options.insertDateColor)); - Edit->insert(QString("%1") - .arg(QDateTime::currentDateTime().toString(Options.insertDateFormat))); + Edit->setColor(TQColor(Options.insertDateColor)); + Edit->insert(TQString("%1") + .tqarg(TQDateTime::tqcurrentDateTime().toString(Options.insertDateFormat))); Edit->setItalic(ii); Edit->setBold(ib); Edit->setUnderline(iu); @@ -1127,19 +1127,19 @@ void Knowit::slotEditInsertFile() { if (!Items->currentItem()) return; - KURL url=KFileDialog::getOpenURL(QString::null, + KURL url=KFileDialog::getOpenURL(TQString(), i18n("*|All files"), this, i18n("Insert file...")); if (url.isEmpty()) return; - QFile file(url.path()); + TQFile file(url.path()); if (!file.open(IO_ReadOnly)) { KMessageBox::error(0, i18n("<qt>Cannot open file<br><b>%1</b></qt>") - .arg(url.url())); + .tqarg(url.url())); return; } - QTextStream ts(&file); - ts.setEncoding(QTextStream::UnicodeUTF8); - QString s, text; + TQTextStream ts(&file); + ts.setEncoding(TQTextStream::UnicodeUTF8); + TQString s, text; while (true) { s = ts.readLine(); if (s.isNull()) @@ -1165,10 +1165,10 @@ void Knowit::slotEditChanged() actionBold->setChecked(Edit->bold()); actionItalic->setChecked(Edit->italic()); actionUnderline->setChecked(Edit->underline()); - actionEditAlignLeft->setChecked(Edit->alignment() == Qt::AlignLeft); - actionEditAlignRight->setChecked(Edit->alignment() == Qt::AlignRight); - actionEditAlignCenter->setChecked(Edit->alignment() == Qt::AlignCenter); - actionEditAlignJustify->setChecked(Edit->alignment() == Qt::AlignJustify); + actionEditAlignLeft->setChecked(Edit->tqalignment() == TQt::AlignLeft); + actionEditAlignRight->setChecked(Edit->tqalignment() == TQt::AlignRight); + actionEditAlignCenter->setChecked(Edit->tqalignment() == TQt::AlignCenter); + actionEditAlignJustify->setChecked(Edit->tqalignment() == TQt::AlignJustify); } void Knowit::slotEditCursorChanged(int, int) @@ -1181,7 +1181,7 @@ void Knowit::slotEditCursorChanged(int, int) void Knowit::slotOptions() { PrefDlg.setOptions(Options); - if (PrefDlg.exec() == QDialog::Accepted) + if (PrefDlg.exec() == TQDialog::Accepted) applyOptions(PrefDlg.getOptions()); } @@ -1238,13 +1238,13 @@ void Knowit::slotRawTextMode() if (!Items->currentItem()) return; if (Items->prevItem && Edit->isModified()) - Notes.changeNote(Items->prevItem, Edit->length() ? Edit->text() : QString()); + Notes.changeNote(Items->prevItem, Edit->length() ? Edit->text() : TQString()); Edit->setTextFormat(actionRawTextMode->isChecked() ? - Qt::PlainText : Qt::RichText); + TQt::PlainText : TQt::RichText); Edit->setText(Notes.text(Items->currentItem())); } -void Knowit::slotShowAttachment(QListBoxItem*) +void Knowit::slotShowAttachment(TQListBoxItem*) { slotLinkOpen(); } @@ -1254,7 +1254,7 @@ void Knowit::slotLinkAdd() slotLinkDropped("", 0); } -void Knowit::slotLinkDropped(const QString& s, int flags) +void Knowit::slotLinkDropped(const TQString& s, int flags) { TNoteLink link; link.link = s; @@ -1275,9 +1275,9 @@ void Knowit::slotLinkDropped(const QString& s, int flags) void Knowit::slotLinkRemove() { - QString msg = i18n("<qt>Are you sure you want to remove link:<br><b>%1</b>?</qt>"); + TQString msg = i18n("<qt>Are you sure you want to remove link:<br><b>%1</b>?</qt>"); if (Links->currentItem() != -1 && KMessageBox::questionYesNo(0, - msg.arg(Links->currentText())) == KMessageBox::Yes) { + msg.tqarg(Links->currentText())) == KMessageBox::Yes) { currentNote()->removeLink(Links->currentItem()); Links->removeItem(Links->currentItem()); if (!Links->count()) @@ -1291,10 +1291,10 @@ void Knowit::slotLinkOpen() return; TNoteLink link = currentNote()->link(Links->currentItem()); if (link.isLocalReference()) { - QString s = link.link.remove(0, 9); - QListViewItem* item = Items->findItem(s, 0); - if (!item) Items->findItem(s, 0, Qt::BeginsWith); - if (!item) Items->findItem(s, 0, Qt::Contains); + TQString s = link.link.remove(0, 9); + TQListViewItem* item = Items->tqfindItem(s, 0); + if (!item) Items->tqfindItem(s, 0, TQt::BeginsWith); + if (!item) Items->tqfindItem(s, 0, TQt::Contains); slotNoteChanged(item); } else @@ -1322,7 +1322,7 @@ void Knowit::slotLinkCopy() { if (Links->currentItem() == -1) return; TNoteLink link = currentNote()->link(Links->currentItem()); - kapp->clipboard()->setText(link.link, QClipboard::Clipboard); - kapp->clipboard()->setText(link.link, QClipboard::Selection); + kapp->tqclipboard()->setText(link.link, TQClipboard::Clipboard); + kapp->tqclipboard()->setText(link.link, TQClipboard::Selection); } |