aboutsummaryrefslogtreecommitdiffstats
path: root/textedit.cpp
diff options
context:
space:
mode:
authorubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-01-23 23:08:18 +0000
committerubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910>2011-01-23 23:08:18 +0000
commit739790698c84b2da0b630ccd0c6c260afba74bb6 (patch)
treed762067cff365915ec22b11197c6213cade2dc72 /textedit.cpp
parentnow there's no asking to save every single document, if multiple documents ar... (diff)
downloadgpg4usb-739790698c84b2da0b630ccd0c6c260afba74bb6.tar.gz
gpg4usb-739790698c84b2da0b630ccd0c6c260afba74bb6.zip
format text, filenames in save-as dialog, set version to 0.3
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@444 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to '')
-rw-r--r--textedit.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/textedit.cpp b/textedit.cpp
index 8595c4b..a92757e 100644
--- a/textedit.cpp
+++ b/textedit.cpp
@@ -141,8 +141,16 @@ bool TextEdit::saveFile(const QString &fileName)
bool TextEdit::saveAs()
{
+ EditorPage *page = curPage();
+ QString path;
+ if(page->getFilePath() != "") {
+ path = page->getFilePath();
+ } else {
+ path = tabWidget->tabText(tabWidget->currentIndex()).remove(0,2);
+ }
+
QString fileName = QFileDialog::getSaveFileName(this, tr("Save file "),
- QDir::currentPath());
+ path);
return saveFile(fileName);
}
@@ -207,7 +215,8 @@ bool TextEdit::maybeSaveCurrentTab(bool askToSave) {
QString filePath = page->getFilePath();
if (askToSave) {
result = QMessageBox::warning(this, tr("Unsaved document"),
- tr("The document has been modified:")+"\n\n"+docname+"\n\n\n"+tr("Do you want to save your changes?"),
+ tr("<h3>The document \"%1\" has been modified.<br/>Do you want to save your changes?</h3>").arg(docname)+
+ tr("<b>Note:</b> If you don't save these files, all changes are lost.<br/>"),
QMessageBox::Save | QMessageBox::Discard | QMessageBox::Cancel);
}
if ((result == QMessageBox::Save) || (!askToSave)) {