summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 19:20:52 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-30 19:20:52 +0000
commite86f8310a920cbf1ecfac955fbad05916e954693 (patch)
treeddc018560d03c6aa794d9f399d006e5e3aa597f0
parent1829a84466f690d4a6a10ddab91cea0f45ec9d77 (diff)
downloadknowit-e86f8310.tar.gz
knowit-e86f8310.zip
TQt4 port knowit
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/knowit@1238876 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
-rw-r--r--src/knowit.cpp680
-rw-r--r--src/knowit.h53
-rw-r--r--src/knowitapp.cpp2
-rw-r--r--src/knowitapp.h7
-rw-r--r--src/knowitchooser.cpp34
-rw-r--r--src/knowitchooser.h11
-rw-r--r--src/knowitedit.cpp30
-rw-r--r--src/knowitedit.h15
-rw-r--r--src/knowitlink.cpp40
-rw-r--r--src/knowitlink.h5
-rw-r--r--src/knowitlinks.cpp20
-rw-r--r--src/knowitlinks.h17
-rw-r--r--src/knowitpref.cpp202
-rw-r--r--src/knowitpref.h41
-rw-r--r--src/knowittray.cpp10
-rw-r--r--src/knowittray.h2
-rw-r--r--src/knowittree.cpp38
-rw-r--r--src/knowittree.h13
-rw-r--r--src/notes.cpp156
-rw-r--r--src/notes.h72
20 files changed, 728 insertions, 720 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 &note..."), "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 &note..."), "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);
}
diff --git a/src/knowit.h b/src/knowit.h
index 59c0ca7..095f6f6 100644
--- a/src/knowit.h
+++ b/src/knowit.h
@@ -22,7 +22,7 @@
#include <config.h>
#endif
-#include <qurloperator.h>
+#include <tqurloperator.h>
#include <keditcl.h>
#include <klocale.h>
@@ -34,8 +34,8 @@
#include "knowitlink.h"
#include "notes.h"
-class QSplitter;
-class QTimer;
+class TQSplitter;
+class TQTimer;
class KAction;
class KConfig;
class KListBox;
@@ -51,15 +51,16 @@ class KnowitTree;
class Knowit : public KMainWindow
{
Q_OBJECT
+ TQ_OBJECT
private:
- static const QString Untitled;
+ static const TQString Untitled;
KConfig *config;
- QSplitter* Layout;
+ TQSplitter* Layout;
KnowitTree* Items;
KListBox* Links;
KnowitEdit* Edit;
KURL filename;
- QPixmap pixmapFolder, pixmapFolderText, pixmapText, pixmapEmpty;
+ TQPixmap pixmapFolder, pixmapFolderText, pixmapText, pixmapEmpty;
KEdFind FindDlg;
KnowitOptions Options;
KnowitPreferences PrefDlg;
@@ -69,11 +70,11 @@ class Knowit : public KMainWindow
/* data items */
TNotesCollection Notes;
bool runMinimized;
- QListViewItem* lastSought;
- QString soughtText;
- QTimer* AutosaveTimer;
+ TQListViewItem* lastSought;
+ TQString soughtText;
+ TQTimer* AutosaveTimer;
/* for saving backups */
- QUrlOperator URLOperator;
+ TQUrlOperator URLOperator;
/* false by default, set to true on queryClose() */
bool shuttingDown;
/* actions */
@@ -87,7 +88,7 @@ class Knowit : public KMainWindow
enum {StatusText = 1, StatusOvr = 2};
public:
/** Constructor of main window */
- Knowit(QWidget* parent=0, const char *name=0);
+ Knowit(TQWidget* tqparent=0, const char *name=0);
/** Standard destructor */
~Knowit();
/** Opens document */
@@ -108,23 +109,23 @@ class Knowit : public KMainWindow
/** Finds and shows next occurence of currently sought text
- or show message that it couldn't be found */
- void find(QListViewItem* start = 0);
+ void tqfind(TQListViewItem* start = 0);
/** Returns true if notes or current text were modified */
bool modified();
- /** Reimplemented from QWidget to prevent from closing when docked */
- virtual void closeEvent(QCloseEvent* e);
+ /** Reimplemented from TQWidget to prevent from closing when docked */
+ virtual void closeEvent(TQCloseEvent* e);
/** Apply current configuration */
void applyOptions(const KnowitOptions& O, bool store = true);
/** Returns current note */
TNote* currentNote() const;
public slots:
- /** Status bar text has changed - displays it */
- void slotStatusMsg(const QString& text);
+ /** tqStatus bar text has changed - displays it */
+ void slotStatusMsg(const TQString& text);
/** Shows requested popup menu for notes */
- void slotContextMenu(KListView*, QListViewItem*, const QPoint&);
+ void slotContextMenu(KListView*, TQListViewItem*, const TQPoint&);
/** Shows given note */
- void slotNoteChanged(QListViewItem* item);
+ void slotNoteChanged(TQListViewItem* item);
/** Add same-level note */
void slotNoteAdd();
/** Adds subnote */
@@ -150,7 +151,7 @@ class Knowit : public KMainWindow
void slotNoteMoveRight();
/** Current item has changed - updates associated text and shows next */
- void slotItemChanged(QListViewItem*);
+ void slotItemChanged(TQListViewItem*);
/** Resets to a new file */
void slotFileNew();
/** Prompts for a file to open and opens it */
@@ -179,11 +180,11 @@ class Knowit : public KMainWindow
void slotEditUnderline();
/** Changes color of selected/current text */
void slotEditColor();
- /** Changes vertical alignment to superscript */
+ /** Changes vertical tqalignment to superscript */
void slotEditSuperscript();
- /** Changes vertical alignment to subscript */
+ /** Changes vertical tqalignment to subscript */
void slotEditSubscript();
- /** Restores normal vertical alignment */
+ /** Restores normal vertical tqalignment */
void slotEditNormal();
/** Prompts for text and shows note containing it */
void slotEditFind();
@@ -199,7 +200,7 @@ class Knowit : public KMainWindow
void slotEditAlignJustify();
/** Centers text */
void slotEditAlignCenter();
- /** Change selected paragraphs to list. Warning: uses obsolete Qt function */
+ /** Change selected paragraphs to list. Warning: uses obsolete TQt function */
void slotEditListBullet();
void slotEditListNumber();
void slotEditListUpper();
@@ -235,13 +236,13 @@ class Knowit : public KMainWindow
void slotRawTextMode();
/** Shows requested popup menu for links */
- void slotContextLinksMenu(QListBoxItem* item, const QPoint&);
+ void slotContextLinksMenu(TQListBoxItem* item, const TQPoint&);
/** show current attachment **/
- void slotShowAttachment(QListBoxItem* i);
+ void slotShowAttachment(TQListBoxItem* i);
/** Add link **/
void slotLinkAdd();
/** Handle dropped link **/
- void slotLinkDropped(const QString& s, int flags);
+ void slotLinkDropped(const TQString& s, int flags);
/** Remove link **/
void slotLinkRemove();
/** Open link **/
diff --git a/src/knowitapp.cpp b/src/knowitapp.cpp
index 56d0f4b..16cc68d 100644
--- a/src/knowitapp.cpp
+++ b/src/knowitapp.cpp
@@ -26,7 +26,7 @@ KnowitApplication::~KnowitApplication()
{
}
-void KnowitApplication::commitData(QSessionManager& sm)
+void KnowitApplication::commitData(TQSessionManager& sm)
{
mcloseByLogout = true;
KUniqueApplication::commitData(sm);
diff --git a/src/knowitapp.h b/src/knowitapp.h
index f876202..eb98f58 100644
--- a/src/knowitapp.h
+++ b/src/knowitapp.h
@@ -22,18 +22,19 @@
class KnowitApplication : public KUniqueApplication
{
Q_OBJECT
+ TQ_OBJECT
public:
KnowitApplication(bool allowStyles = true, bool GUIEnabled = true);
~KnowitApplication();
/** Commits all Application-relevant data on shutdown.
*
- * This function is called when the QSessionManager wants to close the
+ * This function is called when the TQSessionManager wants to close the
* Application. It is reimplemented to set the boolean sessionClose flag.
*
- * @param sm The QSessionManager object.
+ * @param sm The TQSessionManager object.
*/
- virtual void commitData(QSessionManager& sm);
+ virtual void commitData(TQSessionManager& sm);
/** Returns TRUE if the Application is closed by the session manager. */
bool closeByLogout() {return(mcloseByLogout);}
diff --git a/src/knowitchooser.cpp b/src/knowitchooser.cpp
index 61e6542..bdffb7f 100644
--- a/src/knowitchooser.cpp
+++ b/src/knowitchooser.cpp
@@ -17,10 +17,10 @@
#include "knowitchooser.h"
-#include <qcheckbox.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qvbox.h>
+#include <tqcheckbox.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqvbox.h>
#include <kcombobox.h>
#include <klocale.h>
@@ -29,30 +29,30 @@
KnowitChooser::KnowitChooser(int flags)
: KDialogBase(Plain, i18n("Export"), Ok|Cancel, Ok)
{
- QLabel* l1;
- QLabel* l2;
- QVBoxLayout* layout = new QVBoxLayout(plainPage());
- layout->addWidget(l1 = new QLabel(i18n("&Exported notes:"), plainPage()));
- layout->addWidget(notes = new KComboBox(plainPage(), "Notes"));
+ TQLabel* l1;
+ TQLabel* l2;
+ TQVBoxLayout* tqlayout = new TQVBoxLayout(plainPage());
+ tqlayout->addWidget(l1 = new TQLabel(i18n("&Exported notes:"), plainPage()));
+ tqlayout->addWidget(notes = new KComboBox(plainPage(), "Notes"));
l1->setBuddy(notes);
notes->insertItem(i18n("All"));
- notes->insertItem(i18n("Current with children"));
+ notes->insertItem(i18n("Current with tqchildren"));
notes->insertItem(i18n("Current only"));
- layout->addWidget(l2 = new QLabel(i18n("&Encoding:"), plainPage()));
- layout->addWidget(charset = new KComboBox(plainPage(), "Encoding"));
+ tqlayout->addWidget(l2 = new TQLabel(i18n("&Encoding:"), plainPage()));
+ tqlayout->addWidget(charset = new KComboBox(plainPage(), "Encoding"));
l2->setBuddy(charset);
charset->insertItem(i18n("Local (8-bit)"));
charset->insertItem(i18n("UTF-8"));
- layout->addItem(new QSpacerItem(0, 10));
- layout->addWidget(enumerate = new QCheckBox(i18n("Numbered titles"),
+ tqlayout->addItem(new TQSpacerItem(0, 10));
+ tqlayout->addWidget(enumerate = new TQCheckBox(i18n("Numbered titles"),
plainPage(), "Numbered"));
- layout->addWidget(toc = new QCheckBox(i18n("Table of contents"),
+ tqlayout->addWidget(toc = new TQCheckBox(i18n("Table of contents"),
plainPage(), "TOC"));
- layout->addWidget(rule = new QCheckBox(i18n("Rule betweeen notes"),
+ tqlayout->addWidget(rule = new TQCheckBox(i18n("Rule betweeen notes"),
plainPage(), "Rule"));
- layout->addWidget(style = new QCheckBox(i18n("Use editor font and colors"),
+ tqlayout->addWidget(style = new TQCheckBox(i18n("Use editor font and colors"),
plainPage(), "Style"));
setChoice(flags);
}
diff --git a/src/knowitchooser.h b/src/knowitchooser.h
index b644f3d..1b60089 100644
--- a/src/knowitchooser.h
+++ b/src/knowitchooser.h
@@ -20,7 +20,7 @@
#include <kdialogbase.h>
-class QCheckBox;
+class TQCheckBox;
class KComboBox;
/**
@@ -29,13 +29,14 @@ class KComboBox;
class KnowitChooser : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
protected:
KComboBox* notes;
KComboBox* charset;
- QCheckBox* enumerate;
- QCheckBox* toc;
- QCheckBox* rule;
- QCheckBox* style;
+ TQCheckBox* enumerate;
+ TQCheckBox* toc;
+ TQCheckBox* rule;
+ TQCheckBox* style;
public:
enum {SaveCurrent = 0, SaveSubnotes = 0x0001, SaveAll = 0x0002, UseUTF8 = 0x0040,
Enumerate = 0x0080, AddRule = 0x0100, Style = 0x0200, TOC = 0x0400};
diff --git a/src/knowitedit.cpp b/src/knowitedit.cpp
index 298d63c..7f30eb4 100644
--- a/src/knowitedit.cpp
+++ b/src/knowitedit.cpp
@@ -18,42 +18,42 @@
#include "knowitedit.h"
#include <kurldrag.h>
-KnowitEdit::KnowitEdit(const QString& text, const QString& context, QWidget* parent,
- const char* name) : KTextEdit(text, context, parent, name), swapEOL(true)
+KnowitEdit::KnowitEdit(const TQString& text, const TQString& context, TQWidget* tqparent,
+ const char* name) : KTextEdit(text, context, tqparent, name), swapEOL(true)
{
setAcceptDrops(true);
}
-KnowitEdit::KnowitEdit(QWidget* parent, const char* name) : KTextEdit(parent, name),
+KnowitEdit::KnowitEdit(TQWidget* tqparent, const char* name) : KTextEdit(tqparent, name),
swapEOL(true)
{
}
-void KnowitEdit::keyPressEvent(QKeyEvent* e)
+void KnowitEdit::keyPressEvent(TQKeyEvent* e)
{
if (swapEOL &&
- (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return) &&
- (e->state() | (Qt::NoButton | Qt::ControlButton | Qt::Keypad) ==
- (Qt::NoButton | Qt::ControlButton | Qt::Keypad))) {
- QKeyEvent* e1 = new QKeyEvent(QKeyEvent::KeyPress, e->key(),
- e->ascii(), e->state() ^ Qt::ControlButton, e->text(), e->isAutoRepeat(),
+ (e->key() == TQt::Key_Enter || e->key() == TQt::Key_Return) &&
+ (e->state() | (Qt::NoButton | TQt::ControlButton | TQt::Keypad) ==
+ (Qt::NoButton | TQt::ControlButton | TQt::Keypad))) {
+ TQKeyEvent* e1 = new TQKeyEvent(TQKeyEvent::KeyPress, e->key(),
+ e->ascii(), e->state() ^ TQt::ControlButton, e->text(), e->isAutoRepeat(),
e->count());
e->ignore();
- QTextEdit::keyPressEvent(e1);
+ TQTextEdit::keyPressEvent(e1);
}
- else QTextEdit::keyPressEvent(e);
+ else TQTextEdit::keyPressEvent(e);
}
-void KnowitEdit::contentsDragEnterEvent(QDragEnterEvent* event)
+void KnowitEdit::contentsDragEnterEvent(TQDragEnterEvent* event)
{
if (KURLDrag::canDecode(event))
event->accept(true);
- else QTextEdit::contentsDragEnterEvent(event);
+ else TQTextEdit::contentsDragEnterEvent(event);
}
-void KnowitEdit::contentsDropEvent(QDropEvent* event)
+void KnowitEdit::contentsDropEvent(TQDropEvent* event)
{
if (KURLDrag::canDecode(event)) {
KURL::List L;
@@ -61,6 +61,6 @@ void KnowitEdit::contentsDropEvent(QDropEvent* event)
for (uint i=0; i<L.count(); i++)
emit textDropped(L[i].url(), L.count() > 1);
}
- else QTextEdit::contentsDropEvent(event);
+ else TQTextEdit::contentsDropEvent(event);
}
diff --git a/src/knowitedit.h b/src/knowitedit.h
index f391468..d225ac6 100644
--- a/src/knowitedit.h
+++ b/src/knowitedit.h
@@ -21,16 +21,17 @@
class KnowitEdit : public KTextEdit
{
Q_OBJECT
+ TQ_OBJECT
public:
bool swapEOL;
- KnowitEdit(const QString& text, const QString& context=QString::null,
- QWidget* parent=0, const char* name = 0);
- KnowitEdit(QWidget* parent=0, const char* name = 0);
- virtual void keyPressEvent(QKeyEvent* e);
- virtual void contentsDragEnterEvent(QDragEnterEvent* event);
- virtual void contentsDropEvent(QDropEvent* event);
+ KnowitEdit(const TQString& text, const TQString& context=TQString(),
+ TQWidget* tqparent=0, const char* name = 0);
+ KnowitEdit(TQWidget* tqparent=0, const char* name = 0);
+ virtual void keyPressEvent(TQKeyEvent* e);
+ virtual void contentsDragEnterEvent(TQDragEnterEvent* event);
+ virtual void contentsDropEvent(TQDropEvent* event);
signals:
- void textDropped(const QString& s, int flags);
+ void textDropped(const TQString& s, int flags);
};
diff --git a/src/knowitlink.cpp b/src/knowitlink.cpp
index 7aa3a7f..e503c25 100644
--- a/src/knowitlink.cpp
+++ b/src/knowitlink.cpp
@@ -18,10 +18,10 @@
#include "knowitlink.h"
#include "notes.h"
-#include <qtoolbutton.h>
-#include <qlabel.h>
-#include <qlayout.h>
-#include <qvbox.h>
+#include <tqtoolbutton.h>
+#include <tqlabel.h>
+#include <tqlayout.h>
+#include <tqvbox.h>
#include <kfiledialog.h>
#include <kglobal.h>
@@ -33,30 +33,30 @@
KnowitLinkDialog::KnowitLinkDialog()
: KDialogBase(Plain, i18n("Modify link"), Ok|Cancel, Ok)
{
- QVBoxLayout* layout = new QVBoxLayout(plainPage());
+ TQVBoxLayout* tqlayout = new TQVBoxLayout(plainPage());
- QHBox* typeBox = new QHBox(plainPage());
- layout->addWidget(typeBox);
- new QLabel(i18n("Referenced item:"), typeBox);
+ TQHBox* typeBox = new TQHBox(plainPage());
+ tqlayout->addWidget(typeBox);
+ new TQLabel(i18n("Referenced item:"), typeBox);
linkType = new KComboBox(typeBox, "LinkType");
linkType->insertItem(i18n("File or URL"));
linkType->insertItem(i18n("KnowIt note"));
- layout->addItem(new QSpacerItem(0, 5));
- QHBox* editBox = new QHBox(plainPage());
- layout->addWidget(editBox);
+ tqlayout->addItem(new TQSpacerItem(0, 5));
+ TQHBox* editBox = new TQHBox(plainPage());
+ tqlayout->addWidget(editBox);
linkValue = new KLineEdit("Link text", editBox);
linkValue->setMinimumWidth(300);
- browse = new QToolButton(editBox, "Browse");
- browse->setIconSet(QIconSet(KGlobal::iconLoader()->loadIcon("fileopen",
+ browse = new TQToolButton(editBox, "Browse");
+ browse->setIconSet(TQIconSet(KGlobal::iconLoader()->loadIcon("fileopen",
KIcon::Toolbar, KIcon::SizeSmall)));
- layout->addItem(new QSpacerItem(0, 5));
- layout->addWidget(new QLabel(i18n("Link description:"), plainPage()));
- layout->addWidget(linkDescription = new KLineEdit("Link description", plainPage()));
+ tqlayout->addItem(new TQSpacerItem(0, 5));
+ tqlayout->addWidget(new TQLabel(i18n("Link description:"), plainPage()));
+ tqlayout->addWidget(linkDescription = new KLineEdit("Link description", plainPage()));
- connect(browse, SIGNAL(clicked()), this, SLOT(slotBrowse()));
- connect(linkType, SIGNAL(activated(int)), this, SLOT(slotTypeChanged(int)));
+ connect(browse, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBrowse()));
+ connect(linkType, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotTypeChanged(int)));
}
KnowitLinkDialog::~KnowitLinkDialog()
@@ -72,7 +72,7 @@ bool KnowitLinkDialog::modifyLink(TNoteLink& link)
else
linkValue->setText(link.link);
slotTypeChanged(linkType->currentItem());
- if (exec() == QDialog::Accepted) {
+ if (exec() == TQDialog::Accepted) {
link.description = linkDescription->text();
if (linkType->currentItem())
link.link = "knowit://" + linkValue->text();
@@ -86,7 +86,7 @@ bool KnowitLinkDialog::modifyLink(TNoteLink& link)
void KnowitLinkDialog::slotBrowse()
{
- KURL url=KFileDialog::getOpenURL(QString::null,
+ KURL url=KFileDialog::getOpenURL(TQString(),
i18n("*|All files"), this, i18n("Choose link..."));
if (!url.isEmpty()) {
linkValue->setText(url.url());
diff --git a/src/knowitlink.h b/src/knowitlink.h
index 2c9b712..a33acad 100644
--- a/src/knowitlink.h
+++ b/src/knowitlink.h
@@ -23,15 +23,16 @@
class KComboBox;
class KLineEdit;
class TNoteLink;
-class QToolButton;
+class TQToolButton;
class KnowitLinkDialog : public KDialogBase {
Q_OBJECT
+ TQ_OBJECT
protected:
KComboBox* linkType;
KLineEdit* linkValue;
KLineEdit* linkDescription;
- QToolButton* browse;
+ TQToolButton* browse;
public:
KnowitLinkDialog();
~KnowitLinkDialog();
diff --git a/src/knowitlinks.cpp b/src/knowitlinks.cpp
index daab0bb..819fa3f 100644
--- a/src/knowitlinks.cpp
+++ b/src/knowitlinks.cpp
@@ -16,21 +16,21 @@
***************************************************************************/
#include "knowitlinks.h"
-#include <qevent.h>
+#include <tqevent.h>
#include <kurldrag.h>
-KnowitLinks::KnowitLinks(QWidget* parent, const char* name)
- : KListBox(parent, name)
+KnowitLinks::KnowitLinks(TQWidget* tqparent, const char* name)
+ : KListBox(tqparent, name)
{
setAcceptDrops(true);
}
-void KnowitLinks::dragEnterEvent(QDragEnterEvent* event)
+void KnowitLinks::dragEnterEvent(TQDragEnterEvent* event)
{
event->accept(KURLDrag::canDecode(event));
}
-void KnowitLinks::dropEvent(QDropEvent* event)
+void KnowitLinks::dropEvent(TQDropEvent* event)
{
if (KURLDrag::canDecode(event)) {
KURL::List L;
@@ -40,15 +40,15 @@ void KnowitLinks::dropEvent(QDropEvent* event)
}
}
-void KnowitLinks::keyPressEvent(QKeyEvent* e)
+void KnowitLinks::keyPressEvent(TQKeyEvent* e)
{
- if (currentItem() != -1 && (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return)) {
+ if (currentItem() != -1 && (e->key() == TQt::Key_Enter || e->key() == TQt::Key_Return)) {
e->ignore();
- if ((e->state() | Qt::NoButton | Qt::Keypad) ==
- (Qt::NoButton | Qt::Keypad)) emit linkOpen();
+ if ((e->state() | Qt::NoButton | TQt::Keypad) ==
+ (Qt::NoButton | TQt::Keypad)) emit linkOpen();
else emit linkOpenWith();
}
- else if (currentItem() != -1 && e->key() == Qt::Key_Delete) {
+ else if (currentItem() != -1 && e->key() == TQt::Key_Delete) {
e->ignore();
emit linkRemove();
}
diff --git a/src/knowitlinks.h b/src/knowitlinks.h
index 24606a7..641f834 100644
--- a/src/knowitlinks.h
+++ b/src/knowitlinks.h
@@ -19,21 +19,22 @@
#define __KNOWIT_LINKS_H__
#include <klistbox.h>
-class QDropEvent;
-class QKeyEvent;
-class QDragEnterEvent;
+class TQDropEvent;
+class TQKeyEvent;
+class TQDragEnterEvent;
class KnowitLinks : public KListBox
{
Q_OBJECT
+ TQ_OBJECT
public:
- KnowitLinks(QWidget* parent=0, const char* name = 0);
+ KnowitLinks(TQWidget* tqparent=0, const char* name = 0);
protected:
- virtual void dragEnterEvent(QDragEnterEvent* event);
- virtual void dropEvent(QDropEvent* event);
- virtual void keyPressEvent(QKeyEvent* e);
+ virtual void dragEnterEvent(TQDragEnterEvent* event);
+ virtual void dropEvent(TQDropEvent* event);
+ virtual void keyPressEvent(TQKeyEvent* e);
signals:
- void textDropped(const QString& s, int flags);
+ void textDropped(const TQString& s, int flags);
void linkRemove();
void linkOpen();
void linkOpenWith();
diff --git a/src/knowitpref.cpp b/src/knowitpref.cpp
index 8f089c9..ac0bdf6 100644
--- a/src/knowitpref.cpp
+++ b/src/knowitpref.cpp
@@ -2,7 +2,7 @@
knowitpref.cpp - description
-------------------
begin : czw lis 28 2002
- copyright : (C) 2002-2004 by Micha³ Rudolf
+ copyright : (C) 2002-2004 by Micha� Rudolf
email : mrudolf@kdewebdev.org
***************************************************************************/
@@ -18,16 +18,16 @@
#include "knowitpref.h"
-#include <qcheckbox.h>
-#include <qcolor.h>
-#include <qtoolbutton.h>
-#include <qspinbox.h>
-#include <qdatetime.h>
-#include <qlayout.h>
-#include <qwhatsthis.h>
-#include <qstring.h>
-#include <qlabel.h>
-#include <qvbox.h>
+#include <tqcheckbox.h>
+#include <tqcolor.h>
+#include <tqtoolbutton.h>
+#include <tqspinbox.h>
+#include <tqdatetime.h>
+#include <tqlayout.h>
+#include <tqwhatsthis.h>
+#include <tqstring.h>
+#include <tqlabel.h>
+#include <tqvbox.h>
#include <kconfig.h>
#include <kcombobox.h>
@@ -95,7 +95,7 @@ void KnowitOptions::read(KConfig* config)
horizontalSplit = config->readNumEntry("HorizontalSplit", true);
defaultName = config->readEntry("DefaultName", i18n("New note"));
alternateTree = config->readBoolEntry("AlternateTree", false);
- alternateColor = config->readEntry("AlternateColor", QString("LightYellow"));
+ alternateColor = config->readEntry("AlternateColor", TQString("LightYellow"));
autoCollapse = config->readBoolEntry("AutoCollapse", false);
unconditionalSave = config->readBoolEntry("UnconditionalSave", false);
backup = config->readBoolEntry("Backup", true);
@@ -109,15 +109,15 @@ void KnowitOptions::read(KConfig* config)
enterBreakLine = config->readBoolEntry("EnterBreakLine", true);
tabfocus = config->readBoolEntry("TabFocus", false);
customColors = config->readBoolEntry("CustomColors", false);
- foreEditColor = config->readEntry("ForeEditColor", QString("Black"));
- backEditColor = config->readEntry("BackEditColor", QString("White"));
+ foreEditColor = config->readEntry("ForeEditColor", TQString("Black"));
+ backEditColor = config->readEntry("BackEditColor", TQString("White"));
customFont = config->readBoolEntry("CustomFont", false);
- fontFamily = config->readEntry("FontFamily", QString("Helvetica"));
+ fontFamily = config->readEntry("FontFamily", TQString("Helvetica"));
fontSize = config->readNumEntry("FontSize", 10); // KDE-Default?
config->setGroup("Templates");
- insertDateFormat = config->readEntry("InsertDateFormatString", QString("ddd d MMM yyyy, hh:mm:ss"));
- insertDateColor = config->readEntry("InsertDateColor", QString("Blue"));
+ insertDateFormat = config->readEntry("InsertDateFormatString", TQString("ddd d MMM yyyy, hh:mm:ss"));
+ insertDateColor = config->readEntry("InsertDateColor", TQString("Blue"));
insertDateBold = config->readBoolEntry("InsertDateBold", false);
insertDateItalic = config->readBoolEntry("InsertDateItalic", true);
insertDateUnderline = config->readBoolEntry("InsertDateUnderline", false);
@@ -131,118 +131,118 @@ void KnowitOptions::read(KConfig* config)
KnowitPreferences::KnowitPreferences()
: KDialogBase(IconList, i18n("KnowIt Preferences"), Ok|Cancel, Ok)
{
- QFrame* page;
- QVBoxLayout* layout;
+ TQFrame* page;
+ TQVBoxLayout* tqlayout;
/* first page: General */
page = addPage(i18n("General"), i18n("General options"),
- KGlobal::iconLoader()->loadIcon(QString("configure"), KIcon::Toolbar, KIcon::SizeMedium));
- layout = new QVBoxLayout(page, 0, spacingHint());
- layout->addWidget(docked = new QCheckBox(i18n("&Dock in System tray"), page, "Dock"));
- layout->addWidget(reopen = new QCheckBox(i18n("Open &last file on startup"), page, "Reopen"));
-
- QHBox* autosaveBox = new QHBox(page);
- layout->addWidget(autosaveBox);
- new QLabel(i18n("Autosave:"), autosaveBox);
- autosave = new QSpinBox(0, 120, 5, autosaveBox, "Autosave");
+ KGlobal::iconLoader()->loadIcon(TQString("configure"), KIcon::Toolbar, KIcon::SizeMedium));
+ tqlayout = new TQVBoxLayout(page, 0, spacingHint());
+ tqlayout->addWidget(docked = new TQCheckBox(i18n("&Dock in System tray"), page, "Dock"));
+ tqlayout->addWidget(reopen = new TQCheckBox(i18n("Open &last file on startup"), page, "Reopen"));
+
+ TQHBox* autosaveBox = new TQHBox(page);
+ tqlayout->addWidget(autosaveBox);
+ new TQLabel(i18n("Autosave:"), autosaveBox);
+ autosave = new TQSpinBox(0, 120, 5, autosaveBox, "Autosave");
autosave->setPrefix(i18n("every "));
autosave->setSuffix(i18n(" min."));
autosave->setSpecialValueText(i18n("Never"));
- QWhatsThis::add(autosave, i18n("Current file will be automatically saved "
+ TQWhatsThis::add(autosave, i18n("Current file will be automatically saved "
"after the specified interval. Set to <i>never</i> to disable autosave."));
- layout->addWidget(unconditionalSave = new QCheckBox(i18n("Automatically save file on e&xit"),
+ tqlayout->addWidget(unconditionalSave = new TQCheckBox(i18n("Automatically save file on e&xit"),
page, "UnconditionalSave"));
- QWhatsThis::add(unconditionalSave, i18n("Current file will be automatically saved "
+ TQWhatsThis::add(unconditionalSave, i18n("Current file will be automatically saved "
"on exit without confirmation."));
- layout->addWidget(backup = new QCheckBox(i18n("Create &backups"),
+ tqlayout->addWidget(backup = new TQCheckBox(i18n("Create &backups"),
page, "Backup"));
- QWhatsThis::add(backup, i18n("Create backup of current document before it is saved."));
- layout->addWidget(multipleInstances = new QCheckBox(i18n("Allow &multiple instances of KnowIt"),
+ TQWhatsThis::add(backup, i18n("Create backup of current document before it is saved."));
+ tqlayout->addWidget(multipleInstances = new TQCheckBox(i18n("Allow &multiple instances of KnowIt"),
page, "Instances"));
- QWhatsThis::add(multipleInstances, i18n("If this option is disabled, only one "
+ TQWhatsThis::add(multipleInstances, i18n("If this option is disabled, only one "
"instance of KnowIt will be allowed. If there is another instance already running, "
"it will be automatically activated instead of running new one."));
- layout->addStretch(1);
+ tqlayout->addStretch(1);
/* second page: Interface */
page = addPage(i18n("Interface"), i18n("Interface options"),
- KGlobal::iconLoader()->loadIcon(QString("misc"), KIcon::Toolbar, KIcon::SizeMedium));
- layout = new QVBoxLayout(page, 0, spacingHint());
- layout->addWidget(horizontalSplit = new QCheckBox(i18n("Split window &horizontally"), page, "Split"));
- QWhatsThis::add(horizontalSplit, i18n("If this option is set, notes tree will "
+ KGlobal::iconLoader()->loadIcon(TQString("misc"), KIcon::Toolbar, KIcon::SizeMedium));
+ tqlayout = new TQVBoxLayout(page, 0, spacingHint());
+ tqlayout->addWidget(horizontalSplit = new TQCheckBox(i18n("Split window &horizontally"), page, "Split"));
+ TQWhatsThis::add(horizontalSplit, i18n("If this option is set, notes tree will "
"be displayed on the left and the editor on the right (this is default).<br>"
"Otherwise notes tree will be displayed at the top and the editor at the bottom."));
- QHBox* defaultNameBox = new QHBox(page);
- layout->addWidget(defaultNameBox);
- new QLabel(i18n("Default note name:"), defaultNameBox);
+ TQHBox* defaultNameBox = new TQHBox(page);
+ tqlayout->addWidget(defaultNameBox);
+ new TQLabel(i18n("Default note name:"), defaultNameBox);
defaultName = new KLineEdit(defaultNameBox, "DefaultName");
- QWhatsThis::add(defaultName, i18n("Default name for new notes. It would be "
+ TQWhatsThis::add(defaultName, i18n("Default name for new notes. It would be "
"autoselected, so if you often copy text using mouse selection, you may "
"consider setting default name to none."));
- QHBox* linkBox = new QHBox(page);
- layout->addWidget(linkBox);
- new QLabel(i18n("Link format:"), linkBox);
+ TQHBox* linkBox = new TQHBox(page);
+ tqlayout->addWidget(linkBox);
+ new TQLabel(i18n("Link format:"), linkBox);
linkFormat = new KComboBox(linkBox, "LinkFormat");
linkFormat->insertItem(i18n("Description (link)"));
linkFormat->insertItem(i18n("Link (description)"));
linkFormat->insertItem(i18n("Link only"));
linkFormat->insertItem(i18n("Description only"));
- QHBox* alternateBox = new QHBox(page);
- layout->addWidget(alternateBox);
- alternateTree = new QCheckBox(i18n("Alternate colors in tree"), alternateBox, "Alternate");
- alternateColor = new KColorButton(QColor("White"), alternateBox, "AlternateColor");
+ TQHBox* alternateBox = new TQHBox(page);
+ tqlayout->addWidget(alternateBox);
+ alternateTree = new TQCheckBox(i18n("Alternate colors in tree"), alternateBox, "Alternate");
+ alternateColor = new KColorButton(TQColor("White"), alternateBox, "AlternateColor");
- layout->addWidget(autoCollapse = new QCheckBox(i18n("Automatically collapse other notes"), page, "AutoCollapse"));
- QWhatsThis::add(autoCollapse, i18n("If this option is set, only current subtree "
+ tqlayout->addWidget(autoCollapse = new TQCheckBox(i18n("Automatically collapse other notes"), page, "AutoCollapse"));
+ TQWhatsThis::add(autoCollapse, i18n("If this option is set, only current subtree "
"will be visible, other notes will be automatically collapsed."));
- layout->addStretch(1);
+ tqlayout->addStretch(1);
/* third page: Editor */
page = addPage(i18n("Editor"), i18n("Editor options"),
- KGlobal::iconLoader()->loadIcon(QString("edit"), KIcon::Toolbar, KIcon::SizeMedium));
- layout = new QVBoxLayout(page, 0, spacingHint());
- layout->addWidget(wordwrap = new QCheckBox(i18n("Use &word wrap"),
+ KGlobal::iconLoader()->loadIcon(TQString("edit"), KIcon::Toolbar, KIcon::SizeMedium));
+ tqlayout = new TQVBoxLayout(page, 0, spacingHint());
+ tqlayout->addWidget(wordwrap = new TQCheckBox(i18n("Use &word wrap"),
page, "WordWrap"));
- layout->addWidget(enterBreakLine = new QCheckBox(i18n("'Enter' ends current line, not paragraph"),
+ tqlayout->addWidget(enterBreakLine = new TQCheckBox(i18n("'Enter' ends current line, not paragraph"),
page, "EnterLineBreak"));
- layout->addWidget(tabfocus = new QCheckBox(i18n("'Tab' in editor changes focus"),
+ tqlayout->addWidget(tabfocus = new TQCheckBox(i18n("'Tab' in editor changes focus"),
page, "TabFocus"));
#if KDE_VERSION_MAJOR == 3 && KDE_VERSION_MINOR < 1
tabfocus->hide();
#endif
- QHBox* colorBox = new QHBox(page);
- layout->addWidget(colorBox);
- customColors = new QCheckBox(i18n("Use &custom colors"), colorBox, "CustomColors");
+ TQHBox* colorBox = new TQHBox(page);
+ tqlayout->addWidget(colorBox);
+ customColors = new TQCheckBox(i18n("Use &custom colors"), colorBox, "CustomColors");
editColors = new KDualColorButton(colorBox);
const char fontSizes[] = {4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,22,24,26,28,32,48,64,0};
- QStringList fontList;
+ TQStringList fontList;
KFontChooser::getFontList(fontList, false);
- QHBox* fontBox = new QHBox(page);
- layout->addWidget(fontBox);
- customFont = new QCheckBox(i18n("Use custom font:"), fontBox, "customFont");
+ TQHBox* fontBox = new TQHBox(page);
+ tqlayout->addWidget(fontBox);
+ customFont = new TQCheckBox(i18n("Use custom font:"), fontBox, "customFont");
fontFamily = new KComboBox(true, fontBox);
fontFamily->insertStringList(fontList);
fontSize = new KComboBox(true, fontBox);
for( int i=0; fontSizes[i] != 0; i++ ){
- fontSize->insertItem(QString().setNum(fontSizes[i]),i);
+ fontSize->insertItem(TQString(TQString().setNum(fontSizes[i])),i);
}
- layout->addStretch(1);
+ tqlayout->addStretch(1);
/* fourth page: Templates */
page = addPage(i18n("Templates"), i18n("Templates configuration"),
- KGlobal::iconLoader()->loadIcon(QString("wizard"), KIcon::Toolbar, KIcon::SizeMedium));
- layout = new QVBoxLayout(page, 0, spacingHint());
- QWhatsThis::add(page, i18n("<html>\n"
+ KGlobal::iconLoader()->loadIcon(TQString("wizard"), KIcon::Toolbar, KIcon::SizeMedium));
+ tqlayout = new TQVBoxLayout(page, 0, spacingHint());
+ TQWhatsThis::add(page, i18n("<html>\n"
"<p>These expressions may be used: </p>\n"
"<table>\n"
"<tr><th>d</th><td>the day as number without a leading zero (1-31)</td></tr>\n"
@@ -265,28 +265,28 @@ KnowitPreferences::KnowitPreferences()
"<tr><th>AP</th><td>use am/pm display</td></tr>\n"
"</table></html>"));
- QHBox* topBox = new QHBox(page);
- layout->addWidget(topBox);
- QLabel * label1 = new QLabel(i18n("Date Format: "), topBox);
- label1->setFixedSize(label1->sizeHint());
- insertDatePreview = new QLabel("", topBox);
+ TQHBox* topBox = new TQHBox(page);
+ tqlayout->addWidget(topBox);
+ TQLabel * label1 = new TQLabel(i18n("Date Format: "), topBox);
+ label1->setFixedSize(label1->tqsizeHint());
+ insertDatePreview = new TQLabel("", topBox);
- QHBox *tmpBox = new QHBox(page);
- layout->addWidget(tmpBox);
- insertDateColorButton = new KColorButton(QColor("Blue"), tmpBox, "InsertDateColorButton");
+ TQHBox *tmpBox = new TQHBox(page);
+ tqlayout->addWidget(tmpBox);
+ insertDateColorButton = new KColorButton(TQColor("Blue"), tmpBox, "InsertDateColorButton");
insertDateFormatEdit = new KLineEdit(tmpBox, "InsertDateFormatEdit");
- insertDateItalicButton = new QToolButton(tmpBox,"InsertDateItalicButton");
- insertDateItalicButton->setIconSet(QIconSet(KGlobal::iconLoader()->loadIcon("text_italic", KIcon::Toolbar)));
+ insertDateItalicButton = new TQToolButton(tmpBox,"InsertDateItalicButton");
+ insertDateItalicButton->setIconSet(TQIconSet(KGlobal::iconLoader()->loadIcon("text_italic", KIcon::Toolbar)));
insertDateItalicButton->setToggleButton(true);
- insertDateBoldButton = new QToolButton(tmpBox,"InsertDateBoldButton");
- insertDateBoldButton->setIconSet(QIconSet(KGlobal::iconLoader()->loadIcon("text_bold", KIcon::Toolbar)));
+ insertDateBoldButton = new TQToolButton(tmpBox,"InsertDateBoldButton");
+ insertDateBoldButton->setIconSet(TQIconSet(KGlobal::iconLoader()->loadIcon("text_bold", KIcon::Toolbar)));
insertDateBoldButton->setToggleButton(true);
- insertDateUnderlineButton = new QToolButton(tmpBox, "InsertDateUnderlineButton");
- insertDateUnderlineButton->setIconSet(QIconSet(KGlobal::iconLoader()->loadIcon("text_under", KIcon::Toolbar)));
+ insertDateUnderlineButton = new TQToolButton(tmpBox, "InsertDateUnderlineButton");
+ insertDateUnderlineButton->setIconSet(TQIconSet(KGlobal::iconLoader()->loadIcon("text_under", KIcon::Toolbar)));
insertDateUnderlineButton->setToggleButton(true);
- insertDateColorButton->setFixedSize(insertDateBoldButton->sizeHint());
- insertDateFormatEdit->setMinimumWidth(6*insertDateBoldButton->sizeHint().width());
- layout->addStretch(1);
+ insertDateColorButton->setFixedSize(insertDateBoldButton->tqsizeHint());
+ insertDateFormatEdit->setMinimumWidth(6*insertDateBoldButton->tqsizeHint().width());
+ tqlayout->addStretch(1);
setIconListAllVisible(true);
}
@@ -303,7 +303,7 @@ void KnowitPreferences::setOptions(const KnowitOptions& Options)
horizontalSplit->setChecked(Options.horizontalSplit);
defaultName->setText(Options.defaultName);
alternateTree->setChecked(Options.alternateTree);
- alternateColor->setColor(QColor(Options.alternateColor));
+ alternateColor->setColor(TQColor(Options.alternateColor));
autoCollapse->setChecked(Options.autoCollapse);
linkFormat->setCurrentItem(Options.linkFormat);
@@ -311,23 +311,23 @@ void KnowitPreferences::setOptions(const KnowitOptions& Options)
enterBreakLine->setChecked(Options.enterBreakLine);
tabfocus->setChecked(Options.tabfocus);
customColors->setChecked(Options.customColors);
- editColors->setForeground(QColor(Options.foreEditColor));
- editColors->setBackground(QColor(Options.backEditColor));
+ editColors->setForeground(TQColor(Options.foreEditColor));
+ editColors->setBackground(TQColor(Options.backEditColor));
customFont->setChecked(Options.customFont);
fontFamily->setCurrentText(Options.fontFamily);
- fontSize->setCurrentText(QString().setNum(Options.fontSize));
+ fontSize->setCurrentText(TQString().setNum(Options.fontSize));
insertDateFormatEdit->setText(Options.insertDateFormat);
- insertDateColorButton->setColor(QColor(Options.insertDateColor));
+ insertDateColorButton->setColor(TQColor(Options.insertDateColor));
insertDateBoldButton->setOn(Options.insertDateBold);
insertDateItalicButton->setOn(Options.insertDateItalic);
insertDateUnderlineButton->setOn(Options.insertDateUnderline);
slotUpdateDatePreview();
- connect(insertDateColorButton, SIGNAL(clicked()), this, SLOT(slotUpdateDatePreview()));
- connect(insertDateFormatEdit, SIGNAL(textChanged (const QString &)), this, SLOT(slotUpdateDatePreview()));
- connect(insertDateItalicButton, SIGNAL(toggled(bool)), this, SLOT(slotUpdateDatePreview()));
- connect(insertDateBoldButton, SIGNAL(toggled(bool)), this, SLOT(slotUpdateDatePreview()));
- connect(insertDateUnderlineButton, SIGNAL(toggled(bool)), this, SLOT(slotUpdateDatePreview()));
+ connect(insertDateColorButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotUpdateDatePreview()));
+ connect(insertDateFormatEdit, TQT_SIGNAL(textChanged (const TQString &)), this, TQT_SLOT(slotUpdateDatePreview()));
+ connect(insertDateItalicButton, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotUpdateDatePreview()));
+ connect(insertDateBoldButton, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotUpdateDatePreview()));
+ connect(insertDateUnderlineButton, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotUpdateDatePreview()));
/* non-GUI options */
firstLink = Options.firstLink;
@@ -374,18 +374,18 @@ KnowitOptions KnowitPreferences::getOptions() const
void KnowitPreferences::slotUpdateDatePreview()
{
- QString str = "<html><p align=\"center\">";
+ TQString str = "<html><p align=\"center\">";
if(insertDateBoldButton->isOn()) str += "<b>";
if(insertDateItalicButton->isOn()) str +="<i>";
if(insertDateUnderlineButton->isOn()) str += "<u>";
str += "<font COLOR=\""+insertDateColorButton->color().name()+"\">";
- str += QString("%1").arg(QDateTime::currentDateTime().toString(insertDateFormatEdit->text()));
+ str += TQString("%1").tqarg(TQDateTime::tqcurrentDateTime().toString(insertDateFormatEdit->text()));
str += "</font>";
if(insertDateUnderlineButton->isOn()) str += "</u>";
if(insertDateItalicButton->isOn()) str +="</i>";
if(insertDateBoldButton->isOn()) str += "</b>";
str += "</p></html>";
- insertDatePreview->setPaletteBackgroundColor(QColor("White"));
+ insertDatePreview->setPaletteBackgroundColor(TQColor("White"));
insertDatePreview->setText(str);
}
diff --git a/src/knowitpref.h b/src/knowitpref.h
index bc74398..8ec5d86 100644
--- a/src/knowitpref.h
+++ b/src/knowitpref.h
@@ -18,12 +18,12 @@
#ifndef KNOWITPREF_H
#define KNOWITPREF_H
-#include <qstring.h>
+#include <tqstring.h>
#include <kdialogbase.h>
-class QCheckBox;
-class QSpinBox;
-class QToolButton;
+class TQCheckBox;
+class TQSpinBox;
+class TQToolButton;
class KLineEdit;
class KColorButton;
class KDualColorButton;
@@ -43,9 +43,9 @@ public:
/* GUI */
bool horizontalSplit;
int linkFormat;
- QString defaultName;
+ TQString defaultName;
bool alternateTree;
- QString alternateColor;
+ TQString alternateColor;
bool autoCollapse;
/* Links */
bool firstLink;
@@ -54,13 +54,13 @@ public:
bool enterBreakLine;
bool tabfocus;
bool customColors;
- QString backEditColor;
- QString foreEditColor;
+ TQString backEditColor;
+ TQString foreEditColor;
bool customFont;
- QString fontFamily;
+ TQString fontFamily;
int fontSize;
/* Date format */
- QString insertDateFormat, insertDateColor;
+ TQString insertDateFormat, insertDateColor;
bool insertDateBold, insertDateItalic, insertDateUnderline;
void save(KConfig* config) const;
void read(KConfig* config);
@@ -72,24 +72,25 @@ public:
class KnowitPreferences : public KDialogBase
{
Q_OBJECT
+ TQ_OBJECT
private:
- QCheckBox *docked, *reopen, *horizontalSplit, *multipleInstances, *backup;
- QCheckBox *unconditionalSave;
- QCheckBox *wordwrap, *tabfocus, *customColors;
+ TQCheckBox *docked, *reopen, *horizontalSplit, *multipleInstances, *backup;
+ TQCheckBox *unconditionalSave;
+ TQCheckBox *wordwrap, *tabfocus, *customColors;
KDualColorButton* editColors;
- QCheckBox *enterBreakLine;
+ TQCheckBox *enterBreakLine;
KLineEdit *defaultName;
- QCheckBox *alternateTree;
+ TQCheckBox *alternateTree;
KColorButton *alternateColor;
- QCheckBox* autoCollapse;
- QCheckBox* customFont;
+ TQCheckBox* autoCollapse;
+ TQCheckBox* customFont;
KComboBox *fontFamily, *fontSize;
KComboBox *linkFormat;
KLineEdit *insertDateFormatEdit;
KColorButton *insertDateColorButton;
- QLabel *insertDatePreview;
- QSpinBox* autosave;
- QToolButton *insertDateItalicButton, *insertDateBoldButton, *insertDateUnderlineButton;
+ TQLabel *insertDatePreview;
+ TQSpinBox* autosave;
+ TQToolButton *insertDateItalicButton, *insertDateBoldButton, *insertDateUnderlineButton;
bool firstLink;
int exportFlags;
public:
diff --git a/src/knowittray.cpp b/src/knowittray.cpp
index b08703a..0cb2e07 100644
--- a/src/knowittray.cpp
+++ b/src/knowittray.cpp
@@ -18,16 +18,16 @@
#include <kpopupmenu.h>
#include <klocale.h>
-KnowitTray::KnowitTray (QWidget* parent, const char* name) :
- KSystemTray(parent, name)
+KnowitTray::KnowitTray (TQWidget* tqparent, const char* name) :
+ KSystemTray(tqparent, name)
{
- contextMenu()->insertItem(i18n("&Undock"), parent,
- SLOT(slotUndock()));
+ contextMenu()->insertItem(i18n("&Undock"), tqparent,
+ TQT_SLOT(slotUndock()));
}
void KnowitTray::contextMenuAboutToShow (KPopupMenu* menu)
{
menu->removeItemAt(menu->count()-1);
- menu->insertItem(i18n("&Quit"), parent(), SLOT(slotFileQuit()));
+ menu->insertItem(i18n("&Quit"), tqparent(), TQT_SLOT(slotFileQuit()));
}
diff --git a/src/knowittray.h b/src/knowittray.h
index 023eef2..4236486 100644
--- a/src/knowittray.h
+++ b/src/knowittray.h
@@ -22,7 +22,7 @@
class KnowitTray : public KSystemTray
{
public:
- KnowitTray(QWidget* parent=0, const char* name=0);
+ KnowitTray(TQWidget* tqparent=0, const char* name=0);
protected:
virtual void contextMenuAboutToShow (KPopupMenu* menu);
};
diff --git a/src/knowittree.cpp b/src/knowittree.cpp
index ad260fb..055b1b9 100644
--- a/src/knowittree.cpp
+++ b/src/knowittree.cpp
@@ -16,14 +16,14 @@
***************************************************************************/
#include <klocale.h>
-#include <qevent.h>
-#include <qdragobject.h>
-#include <qheader.h>
-#include <qwhatsthis.h>
+#include <tqevent.h>
+#include <tqdragobject.h>
+#include <tqheader.h>
+#include <tqwhatsthis.h>
#include "knowittree.h"
-KnowitTree::KnowitTree(QWidget* parent, const char* name)
- : KListView(parent, name)
+KnowitTree::KnowitTree(TQWidget* tqparent, const char* name)
+ : KListView(tqparent, name)
{
setMinimumSize(150, 150);
addColumn(i18n("Notes"));
@@ -35,25 +35,25 @@ KnowitTree::KnowitTree(QWidget* parent, const char* name)
setSorting(-1);
setDragAutoScroll(true);
prevItem = 0;
- QWhatsThis::add(this, i18n("<h2>Notes hierarchy</h2>"
+ TQWhatsThis::add(this, i18n("<h2>Notes hierarchy</h2>"
"Here you can browse notes tree. "
"You can also add notes using right-click menu, or reorganize them using "
"drag and drop."));
}
-void KnowitTree::takeNode(QListViewItem* item)
+void KnowitTree::takeNode(TQListViewItem* item)
{
- if (item->parent())
- item->parent()->takeItem(item);
+ if (item->tqparent())
+ item->tqparent()->takeItem(item);
else
takeItem(item);
}
-void KnowitTree::insertNode(QListViewItem* parent, QListViewItem* item, QListViewItem* after)
+void KnowitTree::insertNode(TQListViewItem* tqparent, TQListViewItem* item, TQListViewItem* after)
{
- if (parent)
- parent->insertItem(item);
+ if (tqparent)
+ tqparent->insertItem(item);
else
insertItem(item);
if (after)
@@ -61,9 +61,9 @@ void KnowitTree::insertNode(QListViewItem* parent, QListViewItem* item, QListVie
}
-void KnowitTree::contentsDragMoveEvent(QDragMoveEvent* event)
+void KnowitTree::contentsDragMoveEvent(TQDragMoveEvent* event)
{
- QListViewItem* item = itemAt(event->pos());
+ TQListViewItem* item = itemAt(event->pos());
/* check if on root decoration */
if (!item || event->pos().x() > header()->cellPos(header()->mapToActual(0)) +
treeStepSize() * (item->depth() + 1) + itemMargin() ||
@@ -75,7 +75,7 @@ void KnowitTree::contentsDragMoveEvent(QDragMoveEvent* event)
void KnowitTree::slotCollapseAll()
{
- QListViewItem* it = firstChild();
+ TQListViewItem* it = firstChild();
while(it) {
it->setOpen(false);
it = it->nextSibling();
@@ -91,7 +91,7 @@ void KnowitTree::slotCollapse()
void KnowitTree::slotExpandAll()
{
- QListViewItem* it = firstChild();
+ TQListViewItem* it = firstChild();
while(it) {
it->setOpen(true);
it = it->nextSibling();
@@ -123,7 +123,7 @@ void KnowitTree::slotItemBegin()
void KnowitTree::slotItemEnd()
{
- QListViewItem* elt = firstChild();
+ TQListViewItem* elt = firstChild();
if (elt)
while (elt->itemBelow())
elt = elt->itemBelow();
@@ -133,7 +133,7 @@ void KnowitTree::slotItemEnd()
void KnowitTree::slotItemLeft()
{
if (currentItem())
- setCurrentItem(currentItem()->parent());
+ setCurrentItem(currentItem()->tqparent());
}
void KnowitTree::slotItemRight()
diff --git a/src/knowittree.h b/src/knowittree.h
index 85ba50c..fb144d8 100644
--- a/src/knowittree.h
+++ b/src/knowittree.h
@@ -17,17 +17,18 @@
#ifndef __KNOWIT_TREE_H__
#define __KNOWIT_TREE_H__
#include <klistview.h>
-class QDragMoveEvent;
+class TQDragMoveEvent;
class KnowitTree : public KListView
{
Q_OBJECT
+ TQ_OBJECT
public:
- KnowitTree(QWidget* parent=0, const char* name = 0);
- QListViewItem* prevItem;
- void takeNode(QListViewItem* item);
- void insertNode(QListViewItem* parent, QListViewItem* item, QListViewItem* after = 0);
+ KnowitTree(TQWidget* tqparent=0, const char* name = 0);
+ TQListViewItem* prevItem;
+ void takeNode(TQListViewItem* item);
+ void insertNode(TQListViewItem* tqparent, TQListViewItem* item, TQListViewItem* after = 0);
protected:
- virtual void contentsDragMoveEvent(QDragMoveEvent* event);
+ virtual void contentsDragMoveEvent(TQDragMoveEvent* event);
public slots:
/** Shows only first-level notes */
void slotCollapseAll();
diff --git a/src/notes.cpp b/src/notes.cpp
index 0c53883..4030f8f 100644
--- a/src/notes.cpp
+++ b/src/notes.cpp
@@ -16,11 +16,11 @@
***************************************************************************/
#include "notes.h"
-#include <qstringlist.h>
-#include <qfile.h>
-#include <qdatetime.h>
-#include <qtextstream.h>
-#include <qtextcodec.h>
+#include <tqstringlist.h>
+#include <tqfile.h>
+#include <tqdatetime.h>
+#include <tqtextstream.h>
+#include <tqtextcodec.h>
#include <klocale.h>
#include <klistview.h>
#include <kglobal.h>
@@ -37,7 +37,7 @@
#endif
-void TNoteLink::save(QTextStream& ts) const
+void TNoteLink::save(TQTextStream& ts) const
{
if (!link.isEmpty()) {
ts << "\\Link " << link << "\n";
@@ -46,16 +46,16 @@ void TNoteLink::save(QTextStream& ts) const
}
}
-QString TNoteLink::text(int fmt) const
+TQString TNoteLink::text(int fmt) const
{
if (fmt == LinkOnly || description.isEmpty()) return link;
else if (fmt == DescriptionOnly) return description;
else if (fmt == LinkDescription)
- return QString("%1 (%2)").arg(link).arg(description);
- else return QString("%1 (%2)").arg(description).arg(link);
+ return TQString("%1 (%2)").tqarg(link).tqarg(description);
+ else return TQString("%1 (%2)").tqarg(description).tqarg(link);
}
-QPixmap TNoteLink::icon() const
+TQPixmap TNoteLink::icon() const
{
return KGlobal::iconLoader()->loadIcon(KMimeType::iconForURL(KURL(link)),
KIcon::Small);
@@ -98,40 +98,40 @@ TNotesCollection::TNotesCollection()
TNotesCollection::~TNotesCollection()
{}
-void TNotesCollection::addNote(QListViewItem* item)
+void TNotesCollection::addNote(TQListViewItem* item)
{
insert(item, new TNote(item, this));
- QListViewItem* parent = item->parent();
- if (parent) find(parent)->updateView();
+ TQListViewItem* tqparent = item->tqparent();
+ if (tqparent) tqfind(tqparent)->updateView();
modified = true;
}
-void TNotesCollection::addNote(QListViewItem* item, const QString& s)
+void TNotesCollection::addNote(TQListViewItem* item, const TQString& s)
{
insert(item, new TNote(item, this, s));
- QListViewItem* parent = item->parent();
- if (parent) find(parent)->updateView();
+ TQListViewItem* tqparent = item->tqparent();
+ if (tqparent) tqfind(tqparent)->updateView();
modified = true;
}
-void TNotesCollection::removeNote(QListViewItem* item)
+void TNotesCollection::removeNote(TQListViewItem* item)
{
- TNote* note = find(item);
+ TNote* note = tqfind(item);
if (!note) qWarning("Internal error while removing note\n");
else {
- QListViewItem* parent = item->parent();
- for (QListViewItemIterator it(item); it.current() &&
+ TQListViewItem* tqparent = item->tqparent();
+ for (TQListViewItemIterator it(item); it.current() &&
(it.current() == item || it.current()->depth() > item->depth()); ++it)
- find(it.current())->destroy();
+ tqfind(it.current())->destroy();
delete item;
- if (parent) find(parent)->updateView();
+ if (tqparent) tqfind(tqparent)->updateView();
modified = true;
}
}
-bool TNotesCollection::changeNote(QListViewItem* item, const QString& s)
+bool TNotesCollection::changeNote(TQListViewItem* item, const TQString& s)
{
- TNote* changed = find(item);
+ TNote* changed = tqfind(item);
if (!changed) {
qWarning("Internal error while changing note\n");
return false;
@@ -149,9 +149,9 @@ void TNotesCollection::clearNotes()
setAutoDelete(false);
}
-const QString& TNotesCollection::text(QListViewItem* item)
+const TQString& TNotesCollection::text(TQListViewItem* item)
{
- TNote* note = find(item);
+ TNote* note = tqfind(item);
if (!note)
qFatal("Internal error while accessing note text\n");
return note->text;
@@ -159,7 +159,7 @@ const QString& TNotesCollection::text(QListViewItem* item)
void TNotesCollection::updateNotesView()
{
- for (QPtrDictIterator<TNote> it(*this); it.current(); ++it)
+ for (TQPtrDictIterator<TNote> it(*this); it.current(); ++it)
it.current()->updateView();
}
@@ -167,14 +167,14 @@ void TNotesCollection::updateNotesView()
-TNote::TNote(QListViewItem* i, TNotesCollection* coll) : text()
+TNote::TNote(TQListViewItem* i, TNotesCollection* coll) : text()
{
collection = coll;
item = i;
updateView();
}
-TNote::TNote(QListViewItem* i, TNotesCollection* coll, const QString& s) :
+TNote::TNote(TQListViewItem* i, TNotesCollection* coll, const TQString& s) :
text(s)
{
collection = coll;
@@ -187,9 +187,9 @@ bool TNote::isEmpty()
return !text.length();
}
-bool TNote::contains(const QString& sought, bool case_sensitive)
+bool TNote::tqcontains(const TQString& sought, bool case_sensitive)
{
- return text.contains(sought, case_sensitive);
+ return text.tqcontains(sought, case_sensitive);
}
@@ -203,7 +203,7 @@ void TNote::destroy()
delete this;
}
-bool TNote::change(const QString& s)
+bool TNote::change(const TQString& s)
{
if (text == s)
return false;
@@ -226,27 +226,27 @@ void TNote::updateView()
item->setPixmap(0, collection->Pixmaps[state()]);
}
-bool TNote::saveHTML(const KURL& fname, const QString& origname, const QString& style,
+bool TNote::saveHTML(const KURL& fname, const TQString& origname, const TQString& style,
int flags)
{
- QFile file(fname.path());
+ TQFile file(fname.path());
if (!file.open( IO_WriteOnly))
return false;
- QTextStream ts(&file);
- if (flags & UseUTF8) ts.setEncoding(QTextStream::UnicodeUTF8);
- else ts.setEncoding(QTextStream::Locale);
+ TQTextStream ts(&file);
+ if (flags & UseUTF8) ts.setEncoding(TQTextStream::UnicodeUTF8);
+ else ts.setEncoding(TQTextStream::Locale);
ts << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
"<html>\n<head>\n <title>" << i18n("KnowIt document") <<
- QString("</title>\n <meta http-equiv=\"Content-Type\" "
- "content=\"text/html; charset=%1\">\n").arg(ts.codec()->mimeName());
+ TQString("</title>\n <meta http-equiv=\"Content-Type\" "
+ "content=\"text/html; charset=%1\">\n").tqarg(ts.codec()->mimeName());
if (!style.isEmpty())
ts << " <style type=\"text/css\">\n " << style << "\n </style>\n";
ts << "</head>\n\n<body>\n";
- QValueVector<int> Depths;
+ TQValueVector<int> Depths;
Depths.append(0);
if (flags & TOC) {
- ts << QString("<h1>%1</h1>\n").arg(i18n("Table of contents"));
+ ts << TQString("<h1>%1</h1>\n").tqarg(i18n("Table of contents"));
saveHTMLTocEntry(ts, Depths, flags);
ts << "\n\n";
}
@@ -255,62 +255,62 @@ bool TNote::saveHTML(const KURL& fname, const QString& origname, const QString&
Depths.append(0);
saveHTMLBuf(ts, Depths, flags);
- QString epilog = i18n("Exported from %1 by KnowIt %2, %3.");
- ts << "<br><br><br><small>" << epilog.arg(origname)
- .arg(VERSION)
- .arg(QDateTime::currentDateTime().toString()) << "</small>\n\n";
+ TQString epilog = i18n("Exported from %1 by KnowIt %2, %3.");
+ ts << "<br><br><br><small>" << epilog.tqarg(origname)
+ .tqarg(VERSION)
+ .tqarg(TQDateTime::tqcurrentDateTime().toString()) << "</small>\n\n";
ts << "</body>\n</html>\n\n";
return true;
}
-bool TNote::saveHTMLBuf(QTextStream& ts, QValueVector<int>& depths,
+bool TNote::saveHTMLBuf(TQTextStream& ts, TQValueVector<int>& depths,
int flags)
{
int hlevel = depths.count();
depths.last() = depths.last()+1;
if (hlevel < 1) hlevel = 1;
else if (hlevel > 3) hlevel = 3;
- QString id, number;
+ TQString id, number;
for (uint i=0; i<depths.count(); i++)
- id += QString("%1.").arg(depths[i]);
+ id += TQString("%1.").tqarg(depths[i]);
if (flags & Enumerate)
number = id + " ";
- ts << QString("<h%1 id=\"S%2\">%3%4</h%5>").arg(hlevel).arg(id).arg(number)
- .arg(item->text(0)).arg(hlevel);
- QString htmltext = text;
- int begin = htmltext.find("<body");
- if (begin >= 0) begin = htmltext.find(">", begin);
- int end = htmltext.find("</body>");
+ ts << TQString("<h%1 id=\"S%2\">%3%4</h%5>").tqarg(hlevel).tqarg(id).tqarg(number)
+ .tqarg(item->text(0)).tqarg(hlevel);
+ TQString htmltext = text;
+ int begin = htmltext.tqfind("<body");
+ if (begin >= 0) begin = htmltext.tqfind(">", begin);
+ int end = htmltext.tqfind("</body>");
if (begin < 0) begin = 0;
if (end <= begin) end = htmltext.length();
ts << htmltext.mid(begin+1, end-begin-1);
/* save links */
- for (QValueList<TNoteLink>::Iterator LinkList = links.begin();
+ for (TQValueList<TNoteLink>::Iterator LinkList = links.begin();
LinkList != links.end(); ++LinkList)
- ts << QString("<a href=\"%1\">%2</a><br>\n").arg((*LinkList).link)
- .arg((*LinkList).text(TNoteLink::DescriptionOnly));
+ ts << TQString("<a href=\"%1\">%2</a><br>\n").tqarg((*LinkList).link)
+ .tqarg((*LinkList).text(TNoteLink::DescriptionOnly));
/* save rule */
if (flags & AddRule) ts << "<hr size=\"1\" noshade>\n\n";
else ts << "\n\n";
- /* save children */
+ /* save tqchildren */
if ((SaveSubnotes | SaveAll) & flags && item->childCount()) {
depths.append(0);
- collection->find(item->firstChild())->saveHTMLBuf(ts, depths, flags);
+ collection->tqfind(item->firstChild())->saveHTMLBuf(ts, depths, flags);
}
if ((SaveSubnotes | SaveAll) & flags && item->nextSibling())
- collection->find(item->nextSibling())->saveHTMLBuf(ts, depths, flags);
+ collection->tqfind(item->nextSibling())->saveHTMLBuf(ts, depths, flags);
if (!item->nextSibling()) depths.pop_back();
return true;
}
-bool TNote::saveHTMLTocEntry(QTextStream& ts, QValueVector<int>& depths, int flags)
+bool TNote::saveHTMLTocEntry(TQTextStream& ts, TQValueVector<int>& depths, int flags)
{
- QString space;
+ TQString space;
space.fill(' ', depths.count());
depths.last() = depths.last()+1;
if (depths.last() == 1) {
@@ -319,20 +319,20 @@ bool TNote::saveHTMLTocEntry(QTextStream& ts, QValueVector<int>& depths, int fla
ts << "<dl>\n";
}
- QString id, number;
+ TQString id, number;
for (uint i=0; i<depths.count(); i++)
- id += QString("%1.").arg(depths[i]);
+ id += TQString("%1.").tqarg(depths[i]);
if (flags & Enumerate) number = id + " ";
ts << space;
- ts << QString("<dt><a href=\"#S%1\">%2%3</a></dt>\n").arg(id).arg(number).
+ ts << TQString("<dt><a href=\"#S%1\">%2%3</a></dt>\n").tqarg(id).tqarg(number).
arg(item->text(0));
if ((SaveSubnotes | SaveAll) & flags && item->childCount()) {
depths.append(0);
- collection->find(item->firstChild())->saveHTMLTocEntry(ts, depths, flags);
+ collection->tqfind(item->firstChild())->saveHTMLTocEntry(ts, depths, flags);
}
if ((SaveSubnotes | SaveAll) & flags && item->nextSibling())
- collection->find(item->nextSibling())->saveHTMLTocEntry(ts, depths, flags);
+ collection->tqfind(item->nextSibling())->saveHTMLTocEntry(ts, depths, flags);
if (!item->nextSibling()) {
depths.pop_back();
ts << space;
@@ -343,7 +343,7 @@ bool TNote::saveHTMLTocEntry(QTextStream& ts, QValueVector<int>& depths, int fla
return true;
}
-void TNote::addLink(const QString& s)
+void TNote::addLink(const TQString& s)
{
links.append(TNoteLink(s));
collection->modified = true;
@@ -361,7 +361,7 @@ void TNote::removeLink(int i)
collection->modified = true;
}
-void TNote::modifyLink(int i, const QString& s)
+void TNote::modifyLink(int i, const TQString& s)
{
links[i].link = s;
collection->modified = true;
@@ -374,7 +374,7 @@ void TNote::modifyLink(int i, TNoteLink& l)
links[i] = l;
}
-void TNote::modifyLinkDescription(int i, const QString& s)
+void TNote::modifyLinkDescription(int i, const TQString& s)
{
links[i].description = s;
collection->modified = true;
@@ -391,16 +391,16 @@ const TNoteLink& TNote::link(int i) const
}
-void TNote::save(QTextStream& ts, bool current)
+void TNote::save(TQTextStream& ts, bool current)
{
- const QString header = "\\NewEntry %1 %2\n";
- const QString activeheader = "\\CurrentEntry %1 %2\n";
+ const TQString header = "\\NewEntry %1 %2\n";
+ const TQString activeheader = "\\CurrentEntry %1 %2\n";
if (current)
- ts << activeheader.arg(item->depth()).arg(item->text(0));
+ ts << activeheader.tqarg(item->depth()).tqarg(item->text(0));
else
- ts << header.arg(item->depth()).arg(item->text(0));
- for (QValueList<TNoteLink>::Iterator LinkList = links.begin();
+ ts << header.tqarg(item->depth()).tqarg(item->text(0));
+ for (TQValueList<TNoteLink>::Iterator LinkList = links.begin();
LinkList != links.end(); ++LinkList)
(*LinkList).save(ts);
ts << text;
@@ -409,9 +409,9 @@ void TNote::save(QTextStream& ts, bool current)
ts << '\n';
}
-void TNote::open(QTextStream& ts)
+void TNote::open(TQTextStream& ts)
{
- QString s;
+ TQString s;
text = "";
links.clear();
diff --git a/src/notes.h b/src/notes.h
index e91c7e1..d4ed9f8 100644
--- a/src/notes.h
+++ b/src/notes.h
@@ -17,13 +17,13 @@
#ifndef KNOWIT_NOTES_H
#define KNOWIT_NOTES_H
-#include <qstring.h>
-#include <qpixmap.h>
-#include <qvaluelist.h>
-#include <qvaluevector.h>
-#include <qptrdict.h>
-class QTextStream;
-class QListViewItem;
+#include <tqstring.h>
+#include <tqpixmap.h>
+#include <tqvaluelist.h>
+#include <tqvaluevector.h>
+#include <tqptrdict.h>
+class TQTextStream;
+class TQListViewItem;
class KURL;
class TNote;
@@ -32,74 +32,74 @@ class TNoteLink
{
public:
enum {DescriptionLink, LinkDescription, LinkOnly, DescriptionOnly};
- QString link;
- QString description;
+ TQString link;
+ TQString description;
TNoteLink() {}
- TNoteLink(const QString& s) {link = s;}
- TNoteLink(const QString& s1, const QString& s2) {link = s1; description = s2;}
+ TNoteLink(const TQString& s) {link = s;}
+ TNoteLink(const TQString& s1, const TQString& s2) {link = s1; description = s2;}
int operator==(const TNoteLink& N) const {return link == N.link &&
description == N.description;}
int operator!=(const TNoteLink& N) const {return link != N.link ||
description != N.description;}
- void save(QTextStream& ts) const;
+ void save(TQTextStream& ts) const;
void open() const;
void openWith() const;
- QString text(int fmt = DescriptionLink) const;
- QPixmap icon() const;
+ TQString text(int fmt = DescriptionLink) const;
+ TQPixmap icon() const;
bool isLocalReference() const;
};
-class TNotesCollection : public QPtrDict<TNote> {
+class TNotesCollection : public TQPtrDict<TNote> {
public:
- QPixmap Pixmaps[4];
+ TQPixmap Pixmaps[4];
TNotesCollection();
~TNotesCollection();
- void addNote(QListViewItem* item);
- void addNote(QListViewItem* item, const QString& s);
- void removeNote(QListViewItem* item);
- bool changeNote(QListViewItem* item, const QString& s);
+ void addNote(TQListViewItem* item);
+ void addNote(TQListViewItem* item, const TQString& s);
+ void removeNote(TQListViewItem* item);
+ bool changeNote(TQListViewItem* item, const TQString& s);
void clearNotes();
void updateNotesView();
bool modified;
bool autoUpdate;
- const QString& text(QListViewItem* item);
+ const TQString& text(TQListViewItem* item);
};
class TNote {
private:
- QValueList<TNoteLink> links;
+ TQValueList<TNoteLink> links;
TNotesCollection* collection;
- bool saveHTMLBuf(QTextStream& ts, QValueVector<int>& depths,
+ bool saveHTMLBuf(TQTextStream& ts, TQValueVector<int>& depths,
int flags = SaveAll);
- bool saveHTMLTocEntry(QTextStream& ts, QValueVector<int>& depths, int flags);
+ bool saveHTMLTocEntry(TQTextStream& ts, TQValueVector<int>& depths, int flags);
public:
typedef enum {Empty, Text, EmptyParent, TextParent} State;
enum {SaveCurrent = 0, SaveSubnotes = 0x0001, SaveAll = 0x0002, UseUTF8 = 0x0040,
Enumerate = 0x0080, AddRule = 0x0100, Style = 0x0200, TOC = 0x0400};
- QListViewItem* item;
- QString text;
+ TQListViewItem* item;
+ TQString text;
bool isEmpty();
- bool contains(const QString& sought, bool case_sensitive = false);
- bool change(const QString& s);
+ bool tqcontains(const TQString& sought, bool case_sensitive = false);
+ bool change(const TQString& s);
void destroy();
void updateView();
State state();
- void open(QTextStream& ts);
- void save(QTextStream& ts, bool current = false);
- bool saveHTML(const KURL& fname, const QString& origname, const QString& style,
+ void open(TQTextStream& ts);
+ void save(TQTextStream& ts, bool current = false);
+ bool saveHTML(const KURL& fname, const TQString& origname, const TQString& style,
int flags = SaveAll);
- void addLink(const QString& s);
+ void addLink(const TQString& s);
void addLink(const TNoteLink& l);
int linkCount() const;
const TNoteLink& link(int i) const;
void removeLink(int i);
- void modifyLink(int i, const QString& s);
+ void modifyLink(int i, const TQString& s);
void modifyLink(int i, TNoteLink& l);
- void modifyLinkDescription(int i, const QString& s);
- TNote(QListViewItem* i, TNotesCollection* coll);
- TNote(QListViewItem* i, TNotesCollection* coll, const QString& s);
+ void modifyLinkDescription(int i, const TQString& s);
+ TNote(TQListViewItem* i, TNotesCollection* coll);
+ TNote(TQListViewItem* i, TNotesCollection* coll, const TQString& s);
~TNote();
};
#endif