|
|
|
@ -326,7 +326,7 @@ bool Knowit::open(const KURL& fname)
|
|
|
|
|
TQFile file(fname.path());
|
|
|
|
|
if (!file.open(IO_ReadOnly)) {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>Cannot open file<br><b>%1</b></qt>")
|
|
|
|
|
.tqarg(fname.url()));
|
|
|
|
|
.arg(fname.url()));
|
|
|
|
|
if (filename == fname)
|
|
|
|
|
filename = "";
|
|
|
|
|
return false;
|
|
|
|
@ -376,7 +376,7 @@ bool Knowit::open(const KURL& fname)
|
|
|
|
|
slotNoteChanged(active);
|
|
|
|
|
Edit->setModified(false);
|
|
|
|
|
actionRecent->addURL(filename);
|
|
|
|
|
slotStatusMsg(i18n("File %1 opened.").tqarg(filename.fileName()));
|
|
|
|
|
slotStatusMsg(i18n("File %1 opened.").arg(filename.fileName()));
|
|
|
|
|
slotActionUpdate();
|
|
|
|
|
|
|
|
|
|
file.close();
|
|
|
|
@ -392,7 +392,7 @@ bool Knowit::save(const KURL& fname)
|
|
|
|
|
TQFile file(fname.path());
|
|
|
|
|
if (!file.open(IO_WriteOnly)) {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>Cannot save file<br><b>%1</b></qt>")
|
|
|
|
|
.tqarg(fname.url()));
|
|
|
|
|
.arg(fname.url()));
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
if (Items->prevItem && Edit->isModified())
|
|
|
|
@ -407,7 +407,7 @@ bool Knowit::save(const KURL& fname)
|
|
|
|
|
Notes.modified = false;
|
|
|
|
|
Edit->setModified(false);
|
|
|
|
|
actionRecent->addURL(filename);
|
|
|
|
|
slotStatusMsg(i18n("File %1 saved.").tqarg(filename.fileName()));
|
|
|
|
|
slotStatusMsg(i18n("File %1 saved.").arg(filename.fileName()));
|
|
|
|
|
if (Options.autosave)
|
|
|
|
|
AutosaveTimer->start(Options.autosave * 60 * 1000, true);
|
|
|
|
|
return true;
|
|
|
|
@ -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>").tqarg(filename.fileName()))
|
|
|
|
|
i18n("<qt>File <b>%1</b><br>\ncannot be saved. Quit anyway?</qt>").arg(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>")
|
|
|
|
|
.tqarg(filename.isEmpty() ? Untitled : filename.fileName()))) {
|
|
|
|
|
.arg(filename.isEmpty() ? Untitled : filename.fileName()))) {
|
|
|
|
|
case KMessageBox::Yes:
|
|
|
|
|
slotFileSave();
|
|
|
|
|
return shuttingDown = !modified();
|
|
|
|
@ -491,7 +491,7 @@ void Knowit::find(TQListViewItem* start)
|
|
|
|
|
}
|
|
|
|
|
it++;
|
|
|
|
|
}
|
|
|
|
|
KMessageBox::information(0, i18n("<qt>Sought text:<br><b>%1</b><br>not found.</qt>").tqarg(soughtText));
|
|
|
|
|
KMessageBox::information(0, i18n("<qt>Sought text:<br><b>%1</b><br>not found.</qt>").arg(soughtText));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -671,7 +671,7 @@ void Knowit::slotNoteRemove()
|
|
|
|
|
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.tqarg(elt->text(0))) == KMessageBox::Yes) {
|
|
|
|
|
if (KMessageBox::questionYesNo(0, msg.arg(elt->text(0))) == KMessageBox::Yes) {
|
|
|
|
|
TQListViewItem* parent = elt->parent();
|
|
|
|
|
Notes.removeNote(elt);
|
|
|
|
|
if (!Notes.count())
|
|
|
|
@ -884,7 +884,7 @@ void Knowit::slotFileSaveAs()
|
|
|
|
|
TQFileInfo fileinfo(url.path());
|
|
|
|
|
if (fileinfo.exists() && KMessageBox::questionYesNo(0,
|
|
|
|
|
i18n("<qt>File<br><b>%1</b><br>already exists. Overwrite it?</qt>")
|
|
|
|
|
.tqarg(url.path())) == KMessageBox::No)
|
|
|
|
|
.arg(url.path())) == KMessageBox::No)
|
|
|
|
|
return;
|
|
|
|
|
save(url);
|
|
|
|
|
}
|
|
|
|
@ -901,8 +901,8 @@ void Knowit::slotFileInfo()
|
|
|
|
|
}
|
|
|
|
|
KMessageBox::information(0, i18n("<qt><h1>%1</h1>"
|
|
|
|
|
"Document path: %2<br>"
|
|
|
|
|
"Number of notes: %3</qt>").tqarg(filename.fileName())
|
|
|
|
|
.tqarg(filename.path()).tqarg(count));
|
|
|
|
|
"Number of notes: %3</qt>").arg(filename.fileName())
|
|
|
|
|
.arg(filename.path()).arg(count));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -976,7 +976,7 @@ void Knowit::slotFileExport()
|
|
|
|
|
TQFileInfo fileinfo(url.path());
|
|
|
|
|
if (fileinfo.exists() && KMessageBox::questionYesNo(0,
|
|
|
|
|
i18n("<qt>File<br><b>%1</b><br>already exists. Overwrite it?</qt>")
|
|
|
|
|
.tqarg(url.path())) == KMessageBox::No)
|
|
|
|
|
.arg(url.path())) == KMessageBox::No)
|
|
|
|
|
return;
|
|
|
|
|
int choice = ChooserDlg.getChoice();
|
|
|
|
|
TQListViewItem* start = (choice & KnowitChooser::SaveAll) ?
|
|
|
|
@ -985,8 +985,8 @@ void Knowit::slotFileExport()
|
|
|
|
|
TQString style;
|
|
|
|
|
if (choice & KnowitChooser::Style)
|
|
|
|
|
style = TQString("body {font-family: \"%1\"; color: %2; background-color: %3}")
|
|
|
|
|
.tqarg(Edit->family()).tqarg(Edit->paletteForegroundColor().name())
|
|
|
|
|
.tqarg(Edit->paletteBackgroundColor().name());
|
|
|
|
|
.arg(Edit->family()).arg(Edit->paletteForegroundColor().name())
|
|
|
|
|
.arg(Edit->paletteBackgroundColor().name());
|
|
|
|
|
Notes.find(start)->saveHTML(url, origname, style, choice);
|
|
|
|
|
Options.exportFlags = choice;
|
|
|
|
|
}
|
|
|
|
@ -1114,7 +1114,7 @@ void Knowit::slotEditInsertDate()
|
|
|
|
|
Edit->setUnderline(Options.insertDateUnderline);
|
|
|
|
|
Edit->setColor(TQColor(Options.insertDateColor));
|
|
|
|
|
Edit->insert(TQString("%1")
|
|
|
|
|
.tqarg(TQDateTime::currentDateTime().toString(Options.insertDateFormat)));
|
|
|
|
|
.arg(TQDateTime::currentDateTime().toString(Options.insertDateFormat)));
|
|
|
|
|
Edit->setItalic(ii);
|
|
|
|
|
Edit->setBold(ib);
|
|
|
|
|
Edit->setUnderline(iu);
|
|
|
|
@ -1134,7 +1134,7 @@ void Knowit::slotEditInsertFile()
|
|
|
|
|
TQFile file(url.path());
|
|
|
|
|
if (!file.open(IO_ReadOnly)) {
|
|
|
|
|
KMessageBox::error(0, i18n("<qt>Cannot open file<br><b>%1</b></qt>")
|
|
|
|
|
.tqarg(url.url()));
|
|
|
|
|
.arg(url.url()));
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
TQTextStream ts(&file);
|
|
|
|
@ -1165,10 +1165,10 @@ void Knowit::slotEditChanged()
|
|
|
|
|
actionBold->setChecked(Edit->bold());
|
|
|
|
|
actionItalic->setChecked(Edit->italic());
|
|
|
|
|
actionUnderline->setChecked(Edit->underline());
|
|
|
|
|
actionEditAlignLeft->setChecked(Edit->tqalignment() == TQt::AlignLeft);
|
|
|
|
|
actionEditAlignRight->setChecked(Edit->tqalignment() == TQt::AlignRight);
|
|
|
|
|
actionEditAlignCenter->setChecked(Edit->tqalignment() == TQt::AlignCenter);
|
|
|
|
|
actionEditAlignJustify->setChecked(Edit->tqalignment() == TQt::AlignJustify);
|
|
|
|
|
actionEditAlignLeft->setChecked(Edit->alignment() == TQt::AlignLeft);
|
|
|
|
|
actionEditAlignRight->setChecked(Edit->alignment() == TQt::AlignRight);
|
|
|
|
|
actionEditAlignCenter->setChecked(Edit->alignment() == TQt::AlignCenter);
|
|
|
|
|
actionEditAlignJustify->setChecked(Edit->alignment() == TQt::AlignJustify);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
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>");
|
|
|
|
|
if (Links->currentItem() != -1 && KMessageBox::questionYesNo(0,
|
|
|
|
|
msg.tqarg(Links->currentText())) == KMessageBox::Yes) {
|
|
|
|
|
msg.arg(Links->currentText())) == KMessageBox::Yes) {
|
|
|
|
|
currentNote()->removeLink(Links->currentItem());
|
|
|
|
|
Links->removeItem(Links->currentItem());
|
|
|
|
|
if (!Links->count())
|
|
|
|
|