summaryrefslogtreecommitdiffabout
path: root/pwmanager/pwmanager/pwmdocui.cpp
Side-by-side diff
Diffstat (limited to 'pwmanager/pwmanager/pwmdocui.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--pwmanager/pwmanager/pwmdocui.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/pwmanager/pwmanager/pwmdocui.cpp b/pwmanager/pwmanager/pwmdocui.cpp
index 5e675fc..41afa6a 100644
--- a/pwmanager/pwmanager/pwmdocui.cpp
+++ b/pwmanager/pwmanager/pwmdocui.cpp
@@ -231,97 +231,97 @@ int PwMDocUi::dirtyAskSave(const QString &docTitle)
("\" has been modified.\n"
"Do you want to save it?"),
i18n("save?"));
if (ret == KMessageBox::Yes) {
return 0;
} else if (ret == KMessageBox::No) {
return 1;
}
#endif
// cancel
return -1;
}
bool PwMDocUi::saveDocUi(PwMDoc *doc)
{
PWM_ASSERT(doc);
doc->timer()->getLock(DocTimer::id_autoLockTimer);
if (doc->isDocEmpty()) {
KMessageBox::information(currentView,
i18n
("Sorry, there's nothing to save.\n"
"Please first add some passwords."),
i18n("nothing to do"));
doc->timer()->putLock(DocTimer::id_autoLockTimer);
return true;
}
PwMerror ret = doc->saveDoc(conf()->confGlobCompression());
if (ret == e_filename) {
doc->timer()->putLock(DocTimer::id_autoLockTimer);
return saveAsDocUi(doc);
} else if (ret == e_weakPw) {
KMessageBox::error(currentView,
i18n("Error: This is a weak password.\n"
"Please select another password."),
i18n("weak password"));
doc->timer()->putLock(DocTimer::id_autoLockTimer);
return false;
} else if (ret == e_fileBackup) {
KMessageBox::error(currentView,
i18n("Error: Couldn't make backup-file!"),
i18n("backup failed"));
doc->timer()->putLock(DocTimer::id_autoLockTimer);
return false;
} else if (ret != e_success) {
KMessageBox::error(currentView,
i18n("Error: Couldn't write to file.\n"
- "Please check if you have permission to "
+ "Please check if you have permission to\n"
"write to the file in that directory."),
i18n("error while writing"));
doc->timer()->putLock(DocTimer::id_autoLockTimer);
return false;
}
doc->timer()->putLock(DocTimer::id_autoLockTimer);
return true;
}
bool PwMDocUi::saveAsDocUi(PwMDoc *doc)
{
PWM_ASSERT(doc);
doc->timer()->getLock(DocTimer::id_autoLockTimer);
if (doc->isDocEmpty()) {
KMessageBox::information(currentView,
i18n
("Sorry, there's nothing to save.\n"
"Please first add some passwords."),
i18n("nothing to do"));
doc->timer()->putLock(DocTimer::id_autoLockTimer);
return true;
}
#ifndef PWM_EMBEDDED
QString fn(KFileDialog::getSaveFileName(QString::null,
i18n("*.pwm|PwManager Password file"),
currentView));
#else
QString fn = locateLocal( "data", KGlobal::getAppName() + "/*.pwm" );
fn = KFileDialog::getSaveFileName(fn,
i18n("password filename(*.pwm)"),
currentView);
#endif
if (fn == "") {
doc->timer()->putLock(DocTimer::id_autoLockTimer);
return false;
}
if (fn.right(4) != ".pwm")
fn += ".pwm";
PwMerror ret = doc->saveDoc(conf()->confGlobCompression(), &fn);
if (ret != e_success) {
KMessageBox::error(currentView,
i18n("Error: Couldn't write to file.\n"
"Please check if you have permission to "
"write to the file in that directory."),
i18n("error while writing"));
doc->timer()->putLock(DocTimer::id_autoLockTimer);