summaryrefslogtreecommitdiffstats
path: root/src/knowit.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2013-02-01 15:01:31 -0600
committerTimothy Pearson <[email protected]>2013-02-01 15:01:31 -0600
commit7f80a1ffb726ee7258f793fd15ea1fc320869539 (patch)
tree56f64e112d3b3c7c4dfa69c55f08b73d096d5b99 /src/knowit.cpp
parentf2dfe595395df6225b7ab6a75a05354fd5933af4 (diff)
downloadknowit-7f80a1ffb726ee7258f793fd15ea1fc320869539.tar.gz
knowit-7f80a1ffb726ee7258f793fd15ea1fc320869539.zip
Rename a number of classes to enhance compatibility with KDE4
Diffstat (limited to 'src/knowit.cpp')
-rw-r--r--src/knowit.cpp142
1 files changed, 71 insertions, 71 deletions
diff --git a/src/knowit.cpp b/src/knowit.cpp
index 448c7c3..2c3d412 100644
--- a/src/knowit.cpp
+++ b/src/knowit.cpp
@@ -57,7 +57,7 @@
const TQString Knowit::Untitled = i18n("untitled") + ".kno";
-Knowit::Knowit(TQWidget*, const char *name) : KMainWindow(0, name),
+Knowit::Knowit(TQWidget*, const char *name) : TDEMainWindow(0, name),
FindDlg(), PrefDlg(), ChooserDlg(), LinkDlg(), Notes()
{
@@ -77,8 +77,8 @@ Knowit::Knowit(TQWidget*, const char *name) : KMainWindow(0, name),
setCentralWidget(Layout);
TQWhatsThis::add(Layout, i18n("Move it to change tree/edit layout."));
- connect(Items, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)),
- TQT_TQOBJECT(this), TQT_SLOT(slotContextMenu(KListView*, TQListViewItem*, const TQPoint&)));
+ connect(Items, TQT_SIGNAL(contextMenu(TDEListView*, TQListViewItem*, const TQPoint&)),
+ TQT_TQOBJECT(this), TQT_SLOT(slotContextMenu(TDEListView*, TQListViewItem*, const TQPoint&)));
connect(Items, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this,
TQT_SLOT(slotItemChanged(TQListViewItem*)));
connect(Items, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this,
@@ -96,7 +96,7 @@ Knowit::Knowit(TQWidget*, const char *name) : KMainWindow(0, name),
connect(Edit, TQT_SIGNAL(textDropped(const TQString&, int)),
TQT_TQOBJECT(this), TQT_SLOT(slotLinkDropped(const TQString&, int)));
- /* Links (KListBox) */
+ /* Links (TDEListBox) */
connect(Links, TQT_SIGNAL(doubleClicked(TQListBoxItem*)),
TQT_TQOBJECT(this), TQT_SLOT(slotShowAttachment(TQListBoxItem*)));
connect(Links, TQT_SIGNAL(contextMenuRequested(TQListBoxItem*, const TQPoint&)),
@@ -113,10 +113,10 @@ Knowit::Knowit(TQWidget*, const char *name) : KMainWindow(0, name),
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),
+ new TDEAction(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),
+ new TDEAction(i18n("Document &information..."), "", "", TQT_TQOBJECT(this),
TQT_SLOT(slotFileInfo()), actionCollection(), "file_info");
KStdAction::quit(TQT_TQOBJECT(this), TQT_SLOT(slotFileQuit()), actionCollection());
@@ -126,49 +126,49 @@ Knowit::Knowit(TQWidget*, const char *name) : KMainWindow(0, name),
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",
+ actionBold = new TDEToggleAction(i18n("Toggle &bold"), "text_bold",
"Ctrl+B", TQT_TQOBJECT(this), TQT_SLOT(slotEditBold()), actionCollection(), "edit_bold");
- actionItalic = new KToggleAction(i18n("Toggle &italic"), "text_italic",
+ actionItalic = new TDEToggleAction(i18n("Toggle &italic"), "text_italic",
"Ctrl+I", TQT_TQOBJECT(this), TQT_SLOT(slotEditItalic()), actionCollection(),
"edit_italic");
- actionUnderline = new KToggleAction(i18n("Toggle &underline"), "text_under",
+ actionUnderline = new TDEToggleAction(i18n("Toggle &underline"), "text_under",
"Ctrl+U", TQT_TQOBJECT(this), TQT_SLOT(slotEditUnderline()), actionCollection(),
"edit_underline");
- new KAction(i18n("&Text color..."), "color_line", "Ctrl+#", TQT_TQOBJECT(this),
+ new TDEAction(i18n("&Text color..."), "color_line", "Ctrl+#", TQT_TQOBJECT(this),
TQT_SLOT(slotEditColor()), actionCollection(), "edit_color");
- new KAction(i18n("&Superscript"), "text_super", "", TQT_TQOBJECT(this),
+ new TDEAction(i18n("&Superscript"), "text_super", "", TQT_TQOBJECT(this),
TQT_SLOT(slotEditSuperscript()), actionCollection(), "edit_superscript");
- new KAction(i18n("&Subscript"), "text_sub", "", TQT_TQOBJECT(this),
+ new TDEAction(i18n("&Subscript"), "text_sub", "", TQT_TQOBJECT(this),
TQT_SLOT(slotEditSubscript()), actionCollection(), "edit_subscript");
- new KAction(i18n("&Normal text"), "", "", TQT_TQOBJECT(this),
+ new TDEAction(i18n("&Normal text"), "", "", TQT_TQOBJECT(this),
TQT_SLOT(slotEditNormal()), actionCollection(), "edit_align_normal");
- new KAction(i18n("&Bullet list"), "", "", TQT_TQOBJECT(this),
+ new TDEAction(i18n("&Bullet list"), "", "", TQT_TQOBJECT(this),
TQT_SLOT(slotEditListBullet()), actionCollection(), "list_bullet");
- new KAction(i18n("&Numbered list"), "", "", TQT_TQOBJECT(this),
+ new TDEAction(i18n("&Numbered list"), "", "", TQT_TQOBJECT(this),
TQT_SLOT(slotEditListNumber()), actionCollection(), "list_number");
- new KAction(i18n("&Uppercase list"), "", "", TQT_TQOBJECT(this),
+ new TDEAction(i18n("&Uppercase list"), "", "", TQT_TQOBJECT(this),
TQT_SLOT(slotEditListUpper()), actionCollection(), "list_upper");
- new KAction(i18n("&Lowercase list"), "", "", TQT_TQOBJECT(this),
+ new TDEAction(i18n("&Lowercase list"), "", "", TQT_TQOBJECT(this),
TQT_SLOT(slotEditListLower()), actionCollection(), "list_lower");
- new KAction(i18n("N&o list"), "", "", TQT_TQOBJECT(this),
+ new TDEAction(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),
+ new TDEAction(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),
+ actionEditAlignLeft = new TDEToggleAction(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",
+ actionEditAlignRight = new TDEToggleAction(i18n("Align &right"), "text_right", "Ctrl+R",
TQT_TQOBJECT(this), TQT_SLOT(slotEditAlignRight()), actionCollection(), "edit_align_right");
- actionEditAlignJustify = new KToggleAction(i18n("&Justify"), "text_block", "Ctrl+J",
+ actionEditAlignJustify = new TDEToggleAction(i18n("&Justify"), "text_block", "Ctrl+J",
TQT_TQOBJECT(this), TQT_SLOT(slotEditAlignJustify()), actionCollection(), "edit_align_justify");
- actionEditAlignCenter = new KToggleAction(i18n("&Center"), "text_center", "Ctrl+E", TQT_TQOBJECT(this),
+ actionEditAlignCenter = new TDEToggleAction(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),
+ new TDEAction(i18n("Insert &date"), "date", "F5", TQT_TQOBJECT(this),
TQT_SLOT(slotEditInsertDate()), actionCollection(), "edit_insert_date");
- new KAction(i18n("Insert &file..."), "", "", TQT_TQOBJECT(this),
+ new TDEAction(i18n("Insert &file..."), "", "", TQT_TQOBJECT(this),
TQT_SLOT(slotEditInsertFile()), actionCollection(), "edit_insert_file");
- actionRawTextMode = new KToggleAction(i18n("&Raw Text Mode"),
+ actionRawTextMode = new TDEToggleAction(i18n("&Raw Text Mode"),
"source", "F10", TQT_TQOBJECT(this), TQT_SLOT(slotRawTextMode()),
actionCollection(), "edit_raw_text");
@@ -181,49 +181,49 @@ Knowit::Knowit(TQWidget*, const char *name) : KMainWindow(0, name),
connect(Edit, TQT_SIGNAL(redoAvailable(bool)), actionRedo, TQT_SLOT(setEnabled(bool)));
/* Actions: notes */
- new KAction(i18n("&Add"), "", "Alt+Insert", TQT_TQOBJECT(this), TQT_SLOT(slotNoteAdd()),
+ new TDEAction(i18n("&Add"), "", "Alt+Insert", TQT_TQOBJECT(this), TQT_SLOT(slotNoteAdd()),
actionCollection(), "note_add");
- new KAction(i18n("Add &subnote"), "", "Alt+Shift+Insert", TQT_TQOBJECT(this),
+ new TDEAction(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),
+ new TDEAction(i18n("&Delete"), "", "Alt+Delete", TQT_TQOBJECT(this),
TQT_SLOT(slotNoteRemove()), actionCollection(), "note_delete");
- new KAction(i18n("&Rename"), "", "F2", TQT_TQOBJECT(this),
+ new TDEAction(i18n("&Rename"), "", "F2", TQT_TQOBJECT(this),
TQT_SLOT(slotNoteRename()), actionCollection(), "note_rename");
- new KAction(i18n("E&xpand all"), "", "", TQT_TQOBJECT(Items),
+ new TDEAction(i18n("E&xpand all"), "", "", TQT_TQOBJECT(Items),
TQT_SLOT(slotExpandAll()), actionCollection(), "note_expand_all");
- new KAction(i18n("&Expand current"), "", "Alt++", TQT_TQOBJECT(Items),
+ new TDEAction(i18n("&Expand current"), "", "Alt++", TQT_TQOBJECT(Items),
TQT_SLOT(slotExpand()), actionCollection(), "note_expand");
- new KAction(i18n("Co&llapse all"), "", "", TQT_TQOBJECT(Items),
+ new TDEAction(i18n("Co&llapse all"), "", "", TQT_TQOBJECT(Items),
TQT_SLOT(slotCollapseAll()), actionCollection(), "note_collapse_all");
- new KAction(i18n("&Collapse current"), "", "Alt+-", TQT_TQOBJECT(Items),
+ new TDEAction(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),
+ new TDEAction(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),
+ new TDEAction(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),
+ new TDEAction(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),
+ new TDEAction(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),
+ new TDEAction(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),
+ new TDEAction(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),
+ new TDEAction(i18n("Sort"), "", "", TQT_TQOBJECT(this),
TQT_SLOT(slotNoteSort()), actionCollection(), "note_sort");
/* Actions: Links */
- new KAction(i18n("&Add link..."), "attach", "Ctrl+Shift+I", TQT_TQOBJECT(this),
+ new TDEAction(i18n("&Add link..."), "attach", "Ctrl+Shift+I", TQT_TQOBJECT(this),
TQT_SLOT(slotLinkAdd()), actionCollection(), "link_add");
- new KAction(i18n("&Remove link"), "", "", TQT_TQOBJECT(this),
+ new TDEAction(i18n("&Remove link"), "", "", TQT_TQOBJECT(this),
TQT_SLOT(slotLinkRemove()), actionCollection(), "link_remove");
- new KAction(i18n("Open link"), "run", "", TQT_TQOBJECT(this),
+ new TDEAction(i18n("Open link"), "run", "", TQT_TQOBJECT(this),
TQT_SLOT(slotLinkOpen()), actionCollection(), "link_open");
- new KAction(i18n("Open link with..."), "", "", TQT_TQOBJECT(this),
+ new TDEAction(i18n("Open link with..."), "", "", TQT_TQOBJECT(this),
TQT_SLOT(slotLinkOpenWith()), actionCollection(), "link_open_with");
- new KAction(i18n("&Modify link..."), "", "", TQT_TQOBJECT(this),
+ new TDEAction(i18n("&Modify link..."), "", "", TQT_TQOBJECT(this),
TQT_SLOT(slotLinkModify()), actionCollection(), "link_modify");
- new KAction(i18n("&Copy link location"), "", "", TQT_TQOBJECT(this),
+ new TDEAction(i18n("&Copy link location"), "", "", TQT_TQOBJECT(this),
TQT_SLOT(slotLinkCopy()), actionCollection(), "link_copy");
/* Actions: Options */
@@ -232,27 +232,27 @@ Knowit::Knowit(TQWidget*, const char *name) : KMainWindow(0, name),
KStdAction::preferences(TQT_TQOBJECT(this), TQT_SLOT(slotOptions()), actionCollection());
/* Actions: Help */
- new KAction(i18n("&Tip of the day"), "idea", "", TQT_TQOBJECT(this),
+ new TDEAction(i18n("&Tip of the day"), "idea", "", TQT_TQOBJECT(this),
TQT_SLOT(slotHelpTip()), actionCollection(), "help_tip");
/* Actions: nonplugged */
- new KAction(i18n("Minimize"), "", "", TQT_TQOBJECT(this), TQT_SLOT(showMinimized()),
+ new TDEAction(i18n("Minimize"), "", "", TQT_TQOBJECT(this), TQT_SLOT(showMinimized()),
actionCollection(), "window_minimize");
- new KAction(i18n("Switch area"), "", "Ctrl+M", TQT_TQOBJECT(this),
+ new TDEAction(i18n("Switch area"), "", "Ctrl+M", TQT_TQOBJECT(this),
TQT_SLOT(slotEditSwitch()), actionCollection(), "edit_switch");
- new KAction(i18n("Overwrite Mode"), "", "Insert", TQT_TQOBJECT(this),
+ new TDEAction(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),
+ new TDEAction(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),
+ new TDEAction(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),
+ new TDEAction(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),
+ new TDEAction(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),
+ new TDEAction(i18n("Go to first subnote"), "", "Alt+Right", TQT_TQOBJECT(Items),
TQT_SLOT(slotItemRight()), actionCollection(), "note_right");
- new KAction(i18n("Go to parent note"), "", "Alt+Left", TQT_TQOBJECT(Items),
+ new TDEAction(i18n("Go to parent note"), "", "Alt+Left", TQT_TQOBJECT(Items),
TQT_SLOT(slotItemLeft()), actionCollection(), "note_left");
/* Actions */
@@ -349,16 +349,16 @@ bool Knowit::open(const KURL& fname)
name = ls.readLine();
name = name.stripWhiteSpace();
if (depth == prevdepth) /* same level */
- if (depth) current = new KListViewItem(current->parent(), current, name);
- else current = new KListViewItem(Items, current, name);
+ if (depth) current = new TDEListViewItem(current->parent(), current, name);
+ else current = new TDEListViewItem(Items, current, name);
else if (depth > prevdepth) /* subnote */
- current = new KListViewItem(current, name);
+ current = new TDEListViewItem(current, name);
else { /* parent note */
for(uint i=depth; i<prevdepth && current; i++)
current = current->parent();
if (current && current->parent())
- current = new KListViewItem(current->parent(), current, name);
- else current = new KListViewItem(Items, current, name);
+ current = new TDEListViewItem(current->parent(), current, name);
+ else current = new TDEListViewItem(Items, current, name);
}
prevdepth = depth;
Notes.addNote(current);
@@ -431,7 +431,7 @@ void Knowit::closeEvent(TQCloseEvent* e)
{
if (!Options.docked || ((KnowitApplication*)kapp)->closeByLogout()) {
saveOptions();
- KMainWindow::closeEvent(e);
+ TDEMainWindow::closeEvent(e);
}
else
hide();
@@ -601,7 +601,7 @@ void Knowit::slotStatusMsg(const TQString &text)
}
-void Knowit::slotContextMenu(KListView*, TQListViewItem*, const TQPoint& p)
+void Knowit::slotContextMenu(TDEListView*, TQListViewItem*, const TQPoint& p)
{
TQWidget *w = factory()->container("notes_popup", this);
if (w)
@@ -622,18 +622,18 @@ void Knowit::slotContextLinksMenu(TQListBoxItem*, const TQPoint& p)
void Knowit::slotNoteAdd()
{
bool Ok;
- KListViewItem* elt;
+ TDEListViewItem* elt;
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(),
+ elt = new TDEListViewItem(Items->currentItem()->parent(),
Items->currentItem(), text);
else
- elt = new KListViewItem(Items, Items->currentItem(), text);
+ elt = new TDEListViewItem(Items, Items->currentItem(), text);
else
- elt = new KListViewItem(Items, text);
+ elt = new TDEListViewItem(Items, text);
Notes.addNote(elt);
slotNoteChanged(elt);
if (Notes.count() == 1)
@@ -654,11 +654,11 @@ void Knowit::slotNoteAddChild()
while (lastChild && lastChild->nextSibling())
lastChild = lastChild->nextSibling();
- KListViewItem* elt;
+ TDEListViewItem* elt;
if (lastChild)
- elt = new KListViewItem(Items->currentItem(), lastChild, text);
+ elt = new TDEListViewItem(Items->currentItem(), lastChild, text);
else
- elt = new KListViewItem(Items->currentItem(), text);
+ elt = new TDEListViewItem(Items->currentItem(), text);
Notes.addNote(elt);
slotNoteChanged(elt);
}