Revert "Rename a number of old tq methods that are no longer tq specific"

This reverts commit 58ed6eb0cb.
pull/1/head
Timothy Pearson 13 years ago
parent 58ed6eb0cb
commit 1bc598742e

@ -16,11 +16,11 @@
***************************************************************************/ ***************************************************************************/
#include <tqtimer.h> #include <tqtimer.h>
#include <clipboard.h> #include <tqclipboard.h>
#include <tqdatetime.h> #include <tqdatetime.h>
#include <tqdir.h> #include <tqdir.h>
#include <tqfile.h> #include <tqfile.h>
#include <textstream.h> #include <tqtextstream.h>
#include <tqpainter.h> #include <tqpainter.h>
#include <tqpaintdevicemetrics.h> #include <tqpaintdevicemetrics.h>
#include <tqwhatsthis.h> #include <tqwhatsthis.h>
@ -76,7 +76,7 @@ Knowit::Knowit(TQWidget*, const char *name) : KMainWindow(0, name),
setAutoSaveSettings(); setAutoSaveSettings();
setCentralWidget(Layout); setCentralWidget(Layout);
TQWhatsThis::add(Layout, i18n("Move it to change tree/edit layout.")); TQWhatsThis::add(Layout, i18n("Move it to change tree/edit tqlayout."));
connect(Items, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)), connect(Items, TQT_SIGNAL(contextMenu(KListView*, TQListViewItem*, const TQPoint&)),
TQT_TQOBJECT(this), TQT_SLOT(slotContextMenu(KListView*, TQListViewItem*, const TQPoint&))); TQT_TQOBJECT(this), TQT_SLOT(slotContextMenu(KListView*, TQListViewItem*, const TQPoint&)));
connect(Items, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this, connect(Items, TQT_SIGNAL(selectionChanged(TQListViewItem*)), this,
@ -271,7 +271,7 @@ Knowit::Knowit(TQWidget*, const char *name) : KMainWindow(0, name),
/* System tray */ /* System tray */
systray = new KnowitTray(this, "Systray"); systray = new KnowitTray(this, "Systray");
systray->setPixmap(Notes.Pixmaps[1]); systray->setPixmap(Notes.Pixmaps[1]);
systray->setAlignment(TQt::AlignHCenter | TQt::AlignVCenter); systray->tqsetAlignment(TQt::AlignHCenter | TQt::AlignVCenter);
/* Autosave */ /* Autosave */
AutosaveTimer = new TQTimer(this); AutosaveTimer = new TQTimer(this);
@ -326,7 +326,7 @@ bool Knowit::open(const KURL& fname)
TQFile file(fname.path()); TQFile file(fname.path());
if (!file.open(IO_ReadOnly)) { if (!file.open(IO_ReadOnly)) {
KMessageBox::error(0, i18n("<qt>Cannot open file<br><b>%1</b></qt>") KMessageBox::error(0, i18n("<qt>Cannot open file<br><b>%1</b></qt>")
.arg(fname.url())); .tqarg(fname.url()));
if (filename == fname) if (filename == fname)
filename = ""; filename = "";
return false; return false;
@ -376,7 +376,7 @@ bool Knowit::open(const KURL& fname)
slotNoteChanged(active); slotNoteChanged(active);
Edit->setModified(false); Edit->setModified(false);
actionRecent->addURL(filename); actionRecent->addURL(filename);
slotStatusMsg(i18n("File %1 opened.").arg(filename.fileName())); slotStatusMsg(i18n("File %1 opened.").tqarg(filename.fileName()));
slotActionUpdate(); slotActionUpdate();
file.close(); file.close();
@ -392,7 +392,7 @@ bool Knowit::save(const KURL& fname)
TQFile file(fname.path()); TQFile file(fname.path());
if (!file.open(IO_WriteOnly)) { if (!file.open(IO_WriteOnly)) {
KMessageBox::error(0, i18n("<qt>Cannot save file<br><b>%1</b></qt>") KMessageBox::error(0, i18n("<qt>Cannot save file<br><b>%1</b></qt>")
.arg(fname.url())); .tqarg(fname.url()));
return false; return false;
} }
if (Items->prevItem && Edit->isModified()) if (Items->prevItem && Edit->isModified())
@ -407,7 +407,7 @@ bool Knowit::save(const KURL& fname)
Notes.modified = false; Notes.modified = false;
Edit->setModified(false); Edit->setModified(false);
actionRecent->addURL(filename); actionRecent->addURL(filename);
slotStatusMsg(i18n("File %1 saved.").arg(filename.fileName())); slotStatusMsg(i18n("File %1 saved.").tqarg(filename.fileName()));
if (Options.autosave) if (Options.autosave)
AutosaveTimer->start(Options.autosave * 60 * 1000, true); AutosaveTimer->start(Options.autosave * 60 * 1000, true);
return true; return true;
@ -443,13 +443,13 @@ bool Knowit::queryClose()
else if (Options.unconditionalSave) { else if (Options.unconditionalSave) {
slotFileSave(); slotFileSave();
return shuttingDown = filename.isEmpty() || !modified() || (KMessageBox::questionYesNo(0, 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); == KMessageBox::Yes);
} }
else else
switch (KMessageBox::questionYesNoCancel(0, switch (KMessageBox::questionYesNoCancel(0,
i18n("<qt>File <b>%1</b><br>\nwas modified. Do you want to save it?</qt>") 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: case KMessageBox::Yes:
slotFileSave(); slotFileSave();
return shuttingDown = !modified(); return shuttingDown = !modified();
@ -491,7 +491,7 @@ void Knowit::find(TQListViewItem* start)
} }
it++; 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));
} }
@ -671,7 +671,7 @@ void Knowit::slotNoteRemove()
i18n("<qt>Are you sure you want to delete note<br><b>%1</b><br> " i18n("<qt>Are you sure you want to delete note<br><b>%1</b><br> "
"and its subnotes?</qt>") : "and its subnotes?</qt>") :
i18n("<qt>Are you sure you want to delete note<br><b>%1</b>?</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) { if (KMessageBox::questionYesNo(0, msg.tqarg(elt->text(0))) == KMessageBox::Yes) {
TQListViewItem* parent = elt->parent(); TQListViewItem* parent = elt->parent();
Notes.removeNote(elt); Notes.removeNote(elt);
if (!Notes.count()) if (!Notes.count())
@ -884,7 +884,7 @@ void Knowit::slotFileSaveAs()
TQFileInfo fileinfo(url.path()); TQFileInfo fileinfo(url.path());
if (fileinfo.exists() && KMessageBox::questionYesNo(0, if (fileinfo.exists() && KMessageBox::questionYesNo(0,
i18n("<qt>File<br><b>%1</b><br>already exists. Overwrite it?</qt>") i18n("<qt>File<br><b>%1</b><br>already exists. Overwrite it?</qt>")
.arg(url.path())) == KMessageBox::No) .tqarg(url.path())) == KMessageBox::No)
return; return;
save(url); save(url);
} }
@ -901,8 +901,8 @@ void Knowit::slotFileInfo()
} }
KMessageBox::information(0, i18n("<qt><h1>%1</h1>" KMessageBox::information(0, i18n("<qt><h1>%1</h1>"
"Document path: %2<br>" "Document path: %2<br>"
"Number of notes: %3</qt>").arg(filename.fileName()) "Number of notes: %3</qt>").tqarg(filename.fileName())
.arg(filename.path()).arg(count)); .tqarg(filename.path()).tqarg(count));
} }
@ -926,7 +926,7 @@ void Knowit::slotFilePrint()
TQRect view(body); TQRect view(body);
int page = 1; int page = 1;
while (true) { 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()); view.moveBy(0, body.height());
p.translate( 0 , -body.height()); p.translate( 0 , -body.height());
p.setFont(Edit->font()); p.setFont(Edit->font());
@ -976,7 +976,7 @@ void Knowit::slotFileExport()
TQFileInfo fileinfo(url.path()); TQFileInfo fileinfo(url.path());
if (fileinfo.exists() && KMessageBox::questionYesNo(0, if (fileinfo.exists() && KMessageBox::questionYesNo(0,
i18n("<qt>File<br><b>%1</b><br>already exists. Overwrite it?</qt>") i18n("<qt>File<br><b>%1</b><br>already exists. Overwrite it?</qt>")
.arg(url.path())) == KMessageBox::No) .tqarg(url.path())) == KMessageBox::No)
return; return;
int choice = ChooserDlg.getChoice(); int choice = ChooserDlg.getChoice();
TQListViewItem* start = (choice & KnowitChooser::SaveAll) ? TQListViewItem* start = (choice & KnowitChooser::SaveAll) ?
@ -985,8 +985,8 @@ void Knowit::slotFileExport()
TQString style; TQString style;
if (choice & KnowitChooser::Style) if (choice & KnowitChooser::Style)
style = TQString("body {font-family: \"%1\"; color: %2; background-color: %3}") style = TQString("body {font-family: \"%1\"; color: %2; background-color: %3}")
.arg(Edit->family()).arg(Edit->paletteForegroundColor().name()) .tqarg(Edit->family()).tqarg(Edit->paletteForegroundColor().name())
.arg(Edit->paletteBackgroundColor().name()); .tqarg(Edit->paletteBackgroundColor().name());
Notes.find(start)->saveHTML(url, origname, style, choice); Notes.find(start)->saveHTML(url, origname, style, choice);
Options.exportFlags = choice; Options.exportFlags = choice;
} }
@ -1031,22 +1031,22 @@ void Knowit::slotEditNormal()
void Knowit::slotEditAlignLeft() void Knowit::slotEditAlignLeft()
{ {
Edit->setAlignment(TQt::AlignLeft); Edit->tqsetAlignment(TQt::AlignLeft);
} }
void Knowit::slotEditAlignRight() void Knowit::slotEditAlignRight()
{ {
Edit->setAlignment(TQt::AlignRight); Edit->tqsetAlignment(TQt::AlignRight);
} }
void Knowit::slotEditAlignJustify() void Knowit::slotEditAlignJustify()
{ {
Edit->setAlignment(TQt::AlignJustify); Edit->tqsetAlignment(TQt::AlignJustify);
} }
void Knowit::slotEditAlignCenter() void Knowit::slotEditAlignCenter()
{ {
Edit->setAlignment(TQt::AlignCenter); Edit->tqsetAlignment(TQt::AlignCenter);
} }
void Knowit::slotEditListBullet() void Knowit::slotEditListBullet()
@ -1114,7 +1114,7 @@ void Knowit::slotEditInsertDate()
Edit->setUnderline(Options.insertDateUnderline); Edit->setUnderline(Options.insertDateUnderline);
Edit->setColor(TQColor(Options.insertDateColor)); Edit->setColor(TQColor(Options.insertDateColor));
Edit->insert(TQString("%1") Edit->insert(TQString("%1")
.arg(TQDateTime::currentDateTime().toString(Options.insertDateFormat))); .tqarg(TQDateTime::tqcurrentDateTime().toString(Options.insertDateFormat)));
Edit->setItalic(ii); Edit->setItalic(ii);
Edit->setBold(ib); Edit->setBold(ib);
Edit->setUnderline(iu); Edit->setUnderline(iu);
@ -1134,7 +1134,7 @@ void Knowit::slotEditInsertFile()
TQFile file(url.path()); TQFile file(url.path());
if (!file.open(IO_ReadOnly)) { if (!file.open(IO_ReadOnly)) {
KMessageBox::error(0, i18n("<qt>Cannot open file<br><b>%1</b></qt>") KMessageBox::error(0, i18n("<qt>Cannot open file<br><b>%1</b></qt>")
.arg(url.url())); .tqarg(url.url()));
return; return;
} }
TQTextStream ts(&file); TQTextStream ts(&file);
@ -1165,10 +1165,10 @@ void Knowit::slotEditChanged()
actionBold->setChecked(Edit->bold()); actionBold->setChecked(Edit->bold());
actionItalic->setChecked(Edit->italic()); actionItalic->setChecked(Edit->italic());
actionUnderline->setChecked(Edit->underline()); actionUnderline->setChecked(Edit->underline());
actionEditAlignLeft->setChecked(Edit->alignment() == TQt::AlignLeft); actionEditAlignLeft->setChecked(Edit->tqalignment() == TQt::AlignLeft);
actionEditAlignRight->setChecked(Edit->alignment() == TQt::AlignRight); actionEditAlignRight->setChecked(Edit->tqalignment() == TQt::AlignRight);
actionEditAlignCenter->setChecked(Edit->alignment() == TQt::AlignCenter); actionEditAlignCenter->setChecked(Edit->tqalignment() == TQt::AlignCenter);
actionEditAlignJustify->setChecked(Edit->alignment() == TQt::AlignJustify); actionEditAlignJustify->setChecked(Edit->tqalignment() == TQt::AlignJustify);
} }
void Knowit::slotEditCursorChanged(int, int) void Knowit::slotEditCursorChanged(int, int)
@ -1277,7 +1277,7 @@ void Knowit::slotLinkRemove()
{ {
TQString 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, if (Links->currentItem() != -1 && KMessageBox::questionYesNo(0,
msg.arg(Links->currentText())) == KMessageBox::Yes) { msg.tqarg(Links->currentText())) == KMessageBox::Yes) {
currentNote()->removeLink(Links->currentItem()); currentNote()->removeLink(Links->currentItem());
Links->removeItem(Links->currentItem()); Links->removeItem(Links->currentItem());
if (!Links->count()) if (!Links->count())
@ -1322,7 +1322,7 @@ void Knowit::slotLinkCopy()
{ {
if (Links->currentItem() == -1) return; if (Links->currentItem() == -1) return;
TNoteLink link = currentNote()->link(Links->currentItem()); TNoteLink link = currentNote()->link(Links->currentItem());
kapp->clipboard()->setText(link.link, TQClipboard::Clipboard); kapp->tqclipboard()->setText(link.link, TQClipboard::Clipboard);
kapp->clipboard()->setText(link.link, TQClipboard::Selection); kapp->tqclipboard()->setText(link.link, TQClipboard::Selection);
} }

@ -120,7 +120,7 @@ class Knowit : public KMainWindow
TNote* currentNote() const; TNote* currentNote() const;
public slots: public slots:
/** Status bar text has changed - displays it */ /** tqStatus bar text has changed - displays it */
void slotStatusMsg(const TQString& text); void slotStatusMsg(const TQString& text);
/** Shows requested popup menu for notes */ /** Shows requested popup menu for notes */
void slotContextMenu(KListView*, TQListViewItem*, const TQPoint&); void slotContextMenu(KListView*, TQListViewItem*, const TQPoint&);
@ -180,11 +180,11 @@ class Knowit : public KMainWindow
void slotEditUnderline(); void slotEditUnderline();
/** Changes color of selected/current text */ /** Changes color of selected/current text */
void slotEditColor(); void slotEditColor();
/** Changes vertical alignment to superscript */ /** Changes vertical tqalignment to superscript */
void slotEditSuperscript(); void slotEditSuperscript();
/** Changes vertical alignment to subscript */ /** Changes vertical tqalignment to subscript */
void slotEditSubscript(); void slotEditSubscript();
/** Restores normal vertical alignment */ /** Restores normal vertical tqalignment */
void slotEditNormal(); void slotEditNormal();
/** Prompts for text and shows note containing it */ /** Prompts for text and shows note containing it */
void slotEditFind(); void slotEditFind();

@ -19,7 +19,7 @@
#include <tqcheckbox.h> #include <tqcheckbox.h>
#include <tqlabel.h> #include <tqlabel.h>
#include <layout.h> #include <tqlayout.h>
#include <tqvbox.h> #include <tqvbox.h>
#include <kcombobox.h> #include <kcombobox.h>
@ -31,28 +31,28 @@ KnowitChooser::KnowitChooser(int flags)
{ {
TQLabel* l1; TQLabel* l1;
TQLabel* l2; TQLabel* l2;
TQVBoxLayout* layout = new TQVBoxLayout(plainPage()); TQVBoxLayout* tqlayout = new TQVBoxLayout(plainPage());
layout->addWidget(l1 = new TQLabel(i18n("&Exported notes:"), plainPage())); tqlayout->addWidget(l1 = new TQLabel(i18n("&Exported notes:"), plainPage()));
layout->addWidget(notes = new KComboBox(plainPage(), "Notes")); tqlayout->addWidget(notes = new KComboBox(plainPage(), "Notes"));
l1->setBuddy(notes); l1->setBuddy(notes);
notes->insertItem(i18n("All")); notes->insertItem(i18n("All"));
notes->insertItem(i18n("Current with children")); notes->insertItem(i18n("Current with tqchildren"));
notes->insertItem(i18n("Current only")); notes->insertItem(i18n("Current only"));
layout->addWidget(l2 = new TQLabel(i18n("&Encoding:"), plainPage())); tqlayout->addWidget(l2 = new TQLabel(i18n("&Encoding:"), plainPage()));
layout->addWidget(charset = new KComboBox(plainPage(), "Encoding")); tqlayout->addWidget(charset = new KComboBox(plainPage(), "Encoding"));
l2->setBuddy(charset); l2->setBuddy(charset);
charset->insertItem(i18n("Local (8-bit)")); charset->insertItem(i18n("Local (8-bit)"));
charset->insertItem(i18n("UTF-8")); charset->insertItem(i18n("UTF-8"));
layout->addItem(new TQSpacerItem(0, 10)); tqlayout->addItem(new TQSpacerItem(0, 10));
layout->addWidget(enumerate = new TQCheckBox(i18n("Numbered titles"), tqlayout->addWidget(enumerate = new TQCheckBox(i18n("Numbered titles"),
plainPage(), "Numbered")); plainPage(), "Numbered"));
layout->addWidget(toc = new TQCheckBox(i18n("Table of contents"), tqlayout->addWidget(toc = new TQCheckBox(i18n("Table of contents"),
plainPage(), "TOC")); plainPage(), "TOC"));
layout->addWidget(rule = new TQCheckBox(i18n("Rule betweeen notes"), tqlayout->addWidget(rule = new TQCheckBox(i18n("Rule betweeen notes"),
plainPage(), "Rule")); plainPage(), "Rule"));
layout->addWidget(style = new TQCheckBox(i18n("Use editor font and colors"), tqlayout->addWidget(style = new TQCheckBox(i18n("Use editor font and colors"),
plainPage(), "Style")); plainPage(), "Style"));
setChoice(flags); setChoice(flags);
} }

@ -20,7 +20,7 @@
#include <tqtoolbutton.h> #include <tqtoolbutton.h>
#include <tqlabel.h> #include <tqlabel.h>
#include <layout.h> #include <tqlayout.h>
#include <tqvbox.h> #include <tqvbox.h>
#include <kfiledialog.h> #include <kfiledialog.h>
@ -33,27 +33,27 @@
KnowitLinkDialog::KnowitLinkDialog() KnowitLinkDialog::KnowitLinkDialog()
: KDialogBase(Plain, i18n("Modify link"), Ok|Cancel, Ok) : KDialogBase(Plain, i18n("Modify link"), Ok|Cancel, Ok)
{ {
TQVBoxLayout* layout = new TQVBoxLayout(plainPage()); TQVBoxLayout* tqlayout = new TQVBoxLayout(plainPage());
TQHBox* typeBox = new TQHBox(plainPage()); TQHBox* typeBox = new TQHBox(plainPage());
layout->addWidget(typeBox); tqlayout->addWidget(typeBox);
new TQLabel(i18n("Referenced item:"), typeBox); new TQLabel(i18n("Referenced item:"), typeBox);
linkType = new KComboBox(typeBox, "LinkType"); linkType = new KComboBox(typeBox, "LinkType");
linkType->insertItem(i18n("File or URL")); linkType->insertItem(i18n("File or URL"));
linkType->insertItem(i18n("KnowIt note")); linkType->insertItem(i18n("KnowIt note"));
layout->addItem(new TQSpacerItem(0, 5)); tqlayout->addItem(new TQSpacerItem(0, 5));
TQHBox* editBox = new TQHBox(plainPage()); TQHBox* editBox = new TQHBox(plainPage());
layout->addWidget(editBox); tqlayout->addWidget(editBox);
linkValue = new KLineEdit("Link text", editBox); linkValue = new KLineEdit("Link text", editBox);
linkValue->setMinimumWidth(300); linkValue->setMinimumWidth(300);
browse = new TQToolButton(editBox, "Browse"); browse = new TQToolButton(editBox, "Browse");
browse->setIconSet(TQIconSet(KGlobal::iconLoader()->loadIcon("fileopen", browse->setIconSet(TQIconSet(KGlobal::iconLoader()->loadIcon("fileopen",
KIcon::Toolbar, KIcon::SizeSmall))); KIcon::Toolbar, KIcon::SizeSmall)));
layout->addItem(new TQSpacerItem(0, 5)); tqlayout->addItem(new TQSpacerItem(0, 5));
layout->addWidget(new TQLabel(i18n("Link description:"), plainPage())); tqlayout->addWidget(new TQLabel(i18n("Link description:"), plainPage()));
layout->addWidget(linkDescription = new KLineEdit("Link description", plainPage())); tqlayout->addWidget(linkDescription = new KLineEdit("Link description", plainPage()));
connect(browse, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBrowse())); connect(browse, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotBrowse()));
connect(linkType, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotTypeChanged(int))); connect(linkType, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotTypeChanged(int)));

@ -23,7 +23,7 @@
#include <tqtoolbutton.h> #include <tqtoolbutton.h>
#include <tqspinbox.h> #include <tqspinbox.h>
#include <tqdatetime.h> #include <tqdatetime.h>
#include <layout.h> #include <tqlayout.h>
#include <tqwhatsthis.h> #include <tqwhatsthis.h>
#include <tqstring.h> #include <tqstring.h>
#include <tqlabel.h> #include <tqlabel.h>
@ -132,17 +132,17 @@ KnowitPreferences::KnowitPreferences()
: KDialogBase(IconList, i18n("KnowIt Preferences"), Ok|Cancel, Ok) : KDialogBase(IconList, i18n("KnowIt Preferences"), Ok|Cancel, Ok)
{ {
TQFrame* page; TQFrame* page;
TQVBoxLayout* layout; TQVBoxLayout* tqlayout;
/* first page: General */ /* first page: General */
page = addPage(i18n("General"), i18n("General options"), page = addPage(i18n("General"), i18n("General options"),
KGlobal::iconLoader()->loadIcon(TQString("configure"), KIcon::Toolbar, KIcon::SizeMedium)); KGlobal::iconLoader()->loadIcon(TQString("configure"), KIcon::Toolbar, KIcon::SizeMedium));
layout = new TQVBoxLayout(page, 0, spacingHint()); tqlayout = new TQVBoxLayout(page, 0, spacingHint());
layout->addWidget(docked = new TQCheckBox(i18n("&Dock in System tray"), page, "Dock")); tqlayout->addWidget(docked = new TQCheckBox(i18n("&Dock in System tray"), page, "Dock"));
layout->addWidget(reopen = new TQCheckBox(i18n("Open &last file on startup"), page, "Reopen")); tqlayout->addWidget(reopen = new TQCheckBox(i18n("Open &last file on startup"), page, "Reopen"));
TQHBox* autosaveBox = new TQHBox(page); TQHBox* autosaveBox = new TQHBox(page);
layout->addWidget(autosaveBox); tqlayout->addWidget(autosaveBox);
new TQLabel(i18n("Autosave:"), autosaveBox); new TQLabel(i18n("Autosave:"), autosaveBox);
autosave = new TQSpinBox(0, 120, 5, autosaveBox, "Autosave"); autosave = new TQSpinBox(0, 120, 5, autosaveBox, "Autosave");
autosave->setPrefix(i18n("every ")); autosave->setPrefix(i18n("every "));
@ -151,32 +151,32 @@ KnowitPreferences::KnowitPreferences()
TQWhatsThis::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.")); "after the specified interval. Set to <i>never</i> to disable autosave."));
layout->addWidget(unconditionalSave = new TQCheckBox(i18n("Automatically save file on e&xit"), tqlayout->addWidget(unconditionalSave = new TQCheckBox(i18n("Automatically save file on e&xit"),
page, "UnconditionalSave")); page, "UnconditionalSave"));
TQWhatsThis::add(unconditionalSave, i18n("Current file will be automatically saved " TQWhatsThis::add(unconditionalSave, i18n("Current file will be automatically saved "
"on exit without confirmation.")); "on exit without confirmation."));
layout->addWidget(backup = new TQCheckBox(i18n("Create &backups"), tqlayout->addWidget(backup = new TQCheckBox(i18n("Create &backups"),
page, "Backup")); page, "Backup"));
TQWhatsThis::add(backup, i18n("Create backup of current document before it is saved.")); TQWhatsThis::add(backup, i18n("Create backup of current document before it is saved."));
layout->addWidget(multipleInstances = new TQCheckBox(i18n("Allow &multiple instances of KnowIt"), tqlayout->addWidget(multipleInstances = new TQCheckBox(i18n("Allow &multiple instances of KnowIt"),
page, "Instances")); page, "Instances"));
TQWhatsThis::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, " "instance of KnowIt will be allowed. If there is another instance already running, "
"it will be automatically activated instead of running new one.")); "it will be automatically activated instead of running new one."));
layout->addStretch(1); tqlayout->addStretch(1);
/* second page: Interface */ /* second page: Interface */
page = addPage(i18n("Interface"), i18n("Interface options"), page = addPage(i18n("Interface"), i18n("Interface options"),
KGlobal::iconLoader()->loadIcon(TQString("misc"), KIcon::Toolbar, KIcon::SizeMedium)); KGlobal::iconLoader()->loadIcon(TQString("misc"), KIcon::Toolbar, KIcon::SizeMedium));
layout = new TQVBoxLayout(page, 0, spacingHint()); tqlayout = new TQVBoxLayout(page, 0, spacingHint());
layout->addWidget(horizontalSplit = new TQCheckBox(i18n("Split window &horizontally"), page, "Split")); tqlayout->addWidget(horizontalSplit = new TQCheckBox(i18n("Split window &horizontally"), page, "Split"));
TQWhatsThis::add(horizontalSplit, i18n("If this option is set, notes tree will " 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>" "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.")); "Otherwise notes tree will be displayed at the top and the editor at the bottom."));
TQHBox* defaultNameBox = new TQHBox(page); TQHBox* defaultNameBox = new TQHBox(page);
layout->addWidget(defaultNameBox); tqlayout->addWidget(defaultNameBox);
new TQLabel(i18n("Default note name:"), defaultNameBox); new TQLabel(i18n("Default note name:"), defaultNameBox);
defaultName = new KLineEdit(defaultNameBox, "DefaultName"); defaultName = new KLineEdit(defaultNameBox, "DefaultName");
TQWhatsThis::add(defaultName, i18n("Default name for new notes. It would be " TQWhatsThis::add(defaultName, i18n("Default name for new notes. It would be "
@ -184,7 +184,7 @@ KnowitPreferences::KnowitPreferences()
"consider setting default name to none.")); "consider setting default name to none."));
TQHBox* linkBox = new TQHBox(page); TQHBox* linkBox = new TQHBox(page);
layout->addWidget(linkBox); tqlayout->addWidget(linkBox);
new TQLabel(i18n("Link format:"), linkBox); new TQLabel(i18n("Link format:"), linkBox);
linkFormat = new KComboBox(linkBox, "LinkFormat"); linkFormat = new KComboBox(linkBox, "LinkFormat");
linkFormat->insertItem(i18n("Description (link)")); linkFormat->insertItem(i18n("Description (link)"));
@ -193,31 +193,31 @@ KnowitPreferences::KnowitPreferences()
linkFormat->insertItem(i18n("Description only")); linkFormat->insertItem(i18n("Description only"));
TQHBox* alternateBox = new TQHBox(page); TQHBox* alternateBox = new TQHBox(page);
layout->addWidget(alternateBox); tqlayout->addWidget(alternateBox);
alternateTree = new TQCheckBox(i18n("Alternate colors in tree"), alternateBox, "Alternate"); alternateTree = new TQCheckBox(i18n("Alternate colors in tree"), alternateBox, "Alternate");
alternateColor = new KColorButton(TQColor("White"), alternateBox, "AlternateColor"); alternateColor = new KColorButton(TQColor("White"), alternateBox, "AlternateColor");
layout->addWidget(autoCollapse = new TQCheckBox(i18n("Automatically collapse other notes"), page, "AutoCollapse")); tqlayout->addWidget(autoCollapse = new TQCheckBox(i18n("Automatically collapse other notes"), page, "AutoCollapse"));
TQWhatsThis::add(autoCollapse, i18n("If this option is set, only current subtree " TQWhatsThis::add(autoCollapse, i18n("If this option is set, only current subtree "
"will be visible, other notes will be automatically collapsed.")); "will be visible, other notes will be automatically collapsed."));
layout->addStretch(1); tqlayout->addStretch(1);
/* third page: Editor */ /* third page: Editor */
page = addPage(i18n("Editor"), i18n("Editor options"), page = addPage(i18n("Editor"), i18n("Editor options"),
KGlobal::iconLoader()->loadIcon(TQString("edit"), KIcon::Toolbar, KIcon::SizeMedium)); KGlobal::iconLoader()->loadIcon(TQString("edit"), KIcon::Toolbar, KIcon::SizeMedium));
layout = new TQVBoxLayout(page, 0, spacingHint()); tqlayout = new TQVBoxLayout(page, 0, spacingHint());
layout->addWidget(wordwrap = new TQCheckBox(i18n("Use &word wrap"), tqlayout->addWidget(wordwrap = new TQCheckBox(i18n("Use &word wrap"),
page, "WordWrap")); page, "WordWrap"));
layout->addWidget(enterBreakLine = new TQCheckBox(i18n("'Enter' ends current line, not paragraph"), tqlayout->addWidget(enterBreakLine = new TQCheckBox(i18n("'Enter' ends current line, not paragraph"),
page, "EnterLineBreak")); page, "EnterLineBreak"));
layout->addWidget(tabfocus = new TQCheckBox(i18n("'Tab' in editor changes focus"), tqlayout->addWidget(tabfocus = new TQCheckBox(i18n("'Tab' in editor changes focus"),
page, "TabFocus")); page, "TabFocus"));
#if TDE_VERSION_MAJOR == 3 && TDE_VERSION_MINOR < 1 #if TDE_VERSION_MAJOR == 3 && TDE_VERSION_MINOR < 1
tabfocus->hide(); tabfocus->hide();
#endif #endif
TQHBox* colorBox = new TQHBox(page); TQHBox* colorBox = new TQHBox(page);
layout->addWidget(colorBox); tqlayout->addWidget(colorBox);
customColors = new TQCheckBox(i18n("Use &custom colors"), colorBox, "CustomColors"); customColors = new TQCheckBox(i18n("Use &custom colors"), colorBox, "CustomColors");
editColors = new KDualColorButton(colorBox); editColors = new KDualColorButton(colorBox);
@ -226,7 +226,7 @@ KnowitPreferences::KnowitPreferences()
KFontChooser::getFontList(fontList, false); KFontChooser::getFontList(fontList, false);
TQHBox* fontBox = new TQHBox(page); TQHBox* fontBox = new TQHBox(page);
layout->addWidget(fontBox); tqlayout->addWidget(fontBox);
customFont = new TQCheckBox(i18n("Use custom font:"), fontBox, "customFont"); customFont = new TQCheckBox(i18n("Use custom font:"), fontBox, "customFont");
fontFamily = new KComboBox(true, fontBox); fontFamily = new KComboBox(true, fontBox);
fontFamily->insertStringList(fontList); fontFamily->insertStringList(fontList);
@ -235,13 +235,13 @@ KnowitPreferences::KnowitPreferences()
fontSize->insertItem(TQString(TQString().setNum(fontSizes[i])),i); fontSize->insertItem(TQString(TQString().setNum(fontSizes[i])),i);
} }
layout->addStretch(1); tqlayout->addStretch(1);
/* fourth page: Templates */ /* fourth page: Templates */
page = addPage(i18n("Templates"), i18n("Templates configuration"), page = addPage(i18n("Templates"), i18n("Templates configuration"),
KGlobal::iconLoader()->loadIcon(TQString("wizard"), KIcon::Toolbar, KIcon::SizeMedium)); KGlobal::iconLoader()->loadIcon(TQString("wizard"), KIcon::Toolbar, KIcon::SizeMedium));
layout = new TQVBoxLayout(page, 0, spacingHint()); tqlayout = new TQVBoxLayout(page, 0, spacingHint());
TQWhatsThis::add(page, i18n("<html>\n" TQWhatsThis::add(page, i18n("<html>\n"
"<p>These expressions may be used: </p>\n" "<p>These expressions may be used: </p>\n"
"<table>\n" "<table>\n"
@ -266,13 +266,13 @@ KnowitPreferences::KnowitPreferences()
"</table></html>")); "</table></html>"));
TQHBox* topBox = new TQHBox(page); TQHBox* topBox = new TQHBox(page);
layout->addWidget(topBox); tqlayout->addWidget(topBox);
TQLabel * label1 = new TQLabel(i18n("Date Format: "), topBox); TQLabel * label1 = new TQLabel(i18n("Date Format: "), topBox);
label1->setFixedSize(label1->sizeHint()); label1->setFixedSize(label1->tqsizeHint());
insertDatePreview = new TQLabel("", topBox); insertDatePreview = new TQLabel("", topBox);
TQHBox *tmpBox = new TQHBox(page); TQHBox *tmpBox = new TQHBox(page);
layout->addWidget(tmpBox); tqlayout->addWidget(tmpBox);
insertDateColorButton = new KColorButton(TQColor("Blue"), tmpBox, "InsertDateColorButton"); insertDateColorButton = new KColorButton(TQColor("Blue"), tmpBox, "InsertDateColorButton");
insertDateFormatEdit = new KLineEdit(tmpBox, "InsertDateFormatEdit"); insertDateFormatEdit = new KLineEdit(tmpBox, "InsertDateFormatEdit");
insertDateItalicButton = new TQToolButton(tmpBox,"InsertDateItalicButton"); insertDateItalicButton = new TQToolButton(tmpBox,"InsertDateItalicButton");
@ -284,9 +284,9 @@ KnowitPreferences::KnowitPreferences()
insertDateUnderlineButton = new TQToolButton(tmpBox, "InsertDateUnderlineButton"); insertDateUnderlineButton = new TQToolButton(tmpBox, "InsertDateUnderlineButton");
insertDateUnderlineButton->setIconSet(TQIconSet(KGlobal::iconLoader()->loadIcon("text_under", KIcon::Toolbar))); insertDateUnderlineButton->setIconSet(TQIconSet(KGlobal::iconLoader()->loadIcon("text_under", KIcon::Toolbar)));
insertDateUnderlineButton->setToggleButton(true); insertDateUnderlineButton->setToggleButton(true);
insertDateColorButton->setFixedSize(insertDateBoldButton->sizeHint()); insertDateColorButton->setFixedSize(insertDateBoldButton->tqsizeHint());
insertDateFormatEdit->setMinimumWidth(6*insertDateBoldButton->sizeHint().width()); insertDateFormatEdit->setMinimumWidth(6*insertDateBoldButton->tqsizeHint().width());
layout->addStretch(1); tqlayout->addStretch(1);
setIconListAllVisible(true); setIconListAllVisible(true);
} }
@ -379,7 +379,7 @@ void KnowitPreferences::slotUpdateDatePreview()
if(insertDateItalicButton->isOn()) str +="<i>"; if(insertDateItalicButton->isOn()) str +="<i>";
if(insertDateUnderlineButton->isOn()) str += "<u>"; if(insertDateUnderlineButton->isOn()) str += "<u>";
str += "<font COLOR=\""+insertDateColorButton->color().name()+"\">"; str += "<font COLOR=\""+insertDateColorButton->color().name()+"\">";
str += TQString("%1").arg(TQDateTime::currentDateTime().toString(insertDateFormatEdit->text())); str += TQString("%1").tqarg(TQDateTime::tqcurrentDateTime().toString(insertDateFormatEdit->text()));
str += "</font>"; str += "</font>";
if(insertDateUnderlineButton->isOn()) str += "</u>"; if(insertDateUnderlineButton->isOn()) str += "</u>";
if(insertDateItalicButton->isOn()) str +="</i>"; if(insertDateItalicButton->isOn()) str +="</i>";

@ -19,8 +19,8 @@
#include <tqstringlist.h> #include <tqstringlist.h>
#include <tqfile.h> #include <tqfile.h>
#include <tqdatetime.h> #include <tqdatetime.h>
#include <textstream.h> #include <tqtextstream.h>
#include <textcodec.h> #include <tqtextcodec.h>
#include <klocale.h> #include <klocale.h>
#include <klistview.h> #include <klistview.h>
#include <kglobal.h> #include <kglobal.h>
@ -51,8 +51,8 @@ TQString TNoteLink::text(int fmt) const
if (fmt == LinkOnly || description.isEmpty()) return link; if (fmt == LinkOnly || description.isEmpty()) return link;
else if (fmt == DescriptionOnly) return description; else if (fmt == DescriptionOnly) return description;
else if (fmt == LinkDescription) else if (fmt == LinkDescription)
return TQString("%1 (%2)").arg(link).arg(description); return TQString("%1 (%2)").tqarg(link).tqarg(description);
else return TQString("%1 (%2)").arg(description).arg(link); else return TQString("%1 (%2)").tqarg(description).tqarg(link);
} }
TQPixmap TNoteLink::icon() const TQPixmap TNoteLink::icon() const
@ -238,7 +238,7 @@ bool TNote::saveHTML(const KURL& fname, const TQString& origname, const TQString
ts << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n" ts << "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\">\n"
"<html>\n<head>\n <title>" << i18n("KnowIt document") << "<html>\n<head>\n <title>" << i18n("KnowIt document") <<
TQString("</title>\n <meta http-equiv=\"Content-Type\" " TQString("</title>\n <meta http-equiv=\"Content-Type\" "
"content=\"text/html; charset=%1\">\n").arg(ts.codec()->mimeName()); "content=\"text/html; charset=%1\">\n").tqarg(ts.codec()->mimeName());
if (!style.isEmpty()) if (!style.isEmpty())
ts << " <style type=\"text/css\">\n " << style << "\n </style>\n"; ts << " <style type=\"text/css\">\n " << style << "\n </style>\n";
ts << "</head>\n\n<body>\n"; ts << "</head>\n\n<body>\n";
@ -246,7 +246,7 @@ bool TNote::saveHTML(const KURL& fname, const TQString& origname, const TQString
TQValueVector<int> Depths; TQValueVector<int> Depths;
Depths.append(0); Depths.append(0);
if (flags & TOC) { if (flags & TOC) {
ts << TQString("<h1>%1</h1>\n").arg(i18n("Table of contents")); ts << TQString("<h1>%1</h1>\n").tqarg(i18n("Table of contents"));
saveHTMLTocEntry(ts, Depths, flags); saveHTMLTocEntry(ts, Depths, flags);
ts << "\n\n"; ts << "\n\n";
} }
@ -256,9 +256,9 @@ bool TNote::saveHTML(const KURL& fname, const TQString& origname, const TQString
saveHTMLBuf(ts, Depths, flags); saveHTMLBuf(ts, Depths, flags);
TQString epilog = i18n("Exported from %1 by KnowIt %2, %3."); TQString epilog = i18n("Exported from %1 by KnowIt %2, %3.");
ts << "<br><br><br><small>" << epilog.arg(origname) ts << "<br><br><br><small>" << epilog.tqarg(origname)
.arg(VERSION) .tqarg(VERSION)
.arg(TQDateTime::currentDateTime().toString()) << "</small>\n\n"; .tqarg(TQDateTime::tqcurrentDateTime().toString()) << "</small>\n\n";
ts << "</body>\n</html>\n\n"; ts << "</body>\n</html>\n\n";
return true; return true;
} }
@ -272,12 +272,12 @@ bool TNote::saveHTMLBuf(TQTextStream& ts, TQValueVector<int>& depths,
else if (hlevel > 3) hlevel = 3; else if (hlevel > 3) hlevel = 3;
TQString id, number; TQString id, number;
for (uint i=0; i<depths.count(); i++) for (uint i=0; i<depths.count(); i++)
id += TQString("%1.").arg(depths[i]); id += TQString("%1.").tqarg(depths[i]);
if (flags & Enumerate) if (flags & Enumerate)
number = id + " "; number = id + " ";
ts << TQString("<h%1 id=\"S%2\">%3%4</h%5>").arg(hlevel).arg(id).arg(number) ts << TQString("<h%1 id=\"S%2\">%3%4</h%5>").tqarg(hlevel).tqarg(id).tqarg(number)
.arg(item->text(0)).arg(hlevel); .tqarg(item->text(0)).tqarg(hlevel);
TQString htmltext = text; TQString htmltext = text;
int begin = htmltext.find("<body"); int begin = htmltext.find("<body");
if (begin >= 0) begin = htmltext.find(">", begin); if (begin >= 0) begin = htmltext.find(">", begin);
@ -289,14 +289,14 @@ bool TNote::saveHTMLBuf(TQTextStream& ts, TQValueVector<int>& depths,
/* save links */ /* save links */
for (TQValueList<TNoteLink>::Iterator LinkList = links.begin(); for (TQValueList<TNoteLink>::Iterator LinkList = links.begin();
LinkList != links.end(); ++LinkList) LinkList != links.end(); ++LinkList)
ts << TQString("<a href=\"%1\">%2</a><br>\n").arg((*LinkList).link) ts << TQString("<a href=\"%1\">%2</a><br>\n").tqarg((*LinkList).link)
.arg((*LinkList).text(TNoteLink::DescriptionOnly)); .tqarg((*LinkList).text(TNoteLink::DescriptionOnly));
/* save rule */ /* save rule */
if (flags & AddRule) ts << "<hr size=\"1\" noshade>\n\n"; if (flags & AddRule) ts << "<hr size=\"1\" noshade>\n\n";
else ts << "\n\n"; else ts << "\n\n";
/* save children */ /* save tqchildren */
if ((SaveSubnotes | SaveAll) & flags && item->childCount()) { if ((SaveSubnotes | SaveAll) & flags && item->childCount()) {
depths.append(0); depths.append(0);
collection->find(item->firstChild())->saveHTMLBuf(ts, depths, flags); collection->find(item->firstChild())->saveHTMLBuf(ts, depths, flags);
@ -321,11 +321,11 @@ bool TNote::saveHTMLTocEntry(TQTextStream& ts, TQValueVector<int>& depths, int f
TQString id, number; TQString id, number;
for (uint i=0; i<depths.count(); i++) for (uint i=0; i<depths.count(); i++)
id += TQString("%1.").arg(depths[i]); id += TQString("%1.").tqarg(depths[i]);
if (flags & Enumerate) number = id + " "; if (flags & Enumerate) number = id + " ";
ts << space; ts << space;
ts << TQString("<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)); arg(item->text(0));
if ((SaveSubnotes | SaveAll) & flags && item->childCount()) { if ((SaveSubnotes | SaveAll) & flags && item->childCount()) {
depths.append(0); depths.append(0);
@ -397,9 +397,9 @@ void TNote::save(TQTextStream& ts, bool current)
const TQString activeheader = "\\CurrentEntry %1 %2\n"; const TQString activeheader = "\\CurrentEntry %1 %2\n";
if (current) if (current)
ts << activeheader.arg(item->depth()).arg(item->text(0)); ts << activeheader.tqarg(item->depth()).tqarg(item->text(0));
else else
ts << header.arg(item->depth()).arg(item->text(0)); ts << header.tqarg(item->depth()).tqarg(item->text(0));
for (TQValueList<TNoteLink>::Iterator LinkList = links.begin(); for (TQValueList<TNoteLink>::Iterator LinkList = links.begin();
LinkList != links.end(); ++LinkList) LinkList != links.end(); ++LinkList)
(*LinkList).save(ts); (*LinkList).save(ts);

Loading…
Cancel
Save