aboutsummaryrefslogtreecommitdiffstats
path: root/fileencryptiondialog.cpp
diff options
context:
space:
mode:
authornils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2010-06-25 17:23:54 +0000
committernils <nils@34ebc366-c3a9-4b3c-9f84-69acf7962910>2010-06-25 17:23:54 +0000
commit6252c2bfaeacd7977958c6b0c7376db7b21cdcb2 (patch)
tree35bce47fa18c3c1c537ad08350afe6de142aa9c0 /fileencryptiondialog.cpp
parentredo to redo-action (diff)
downloadgpg4usb-6252c2bfaeacd7977958c6b0c7376db7b21cdcb2.tar.gz
gpg4usb-6252c2bfaeacd7977958c6b0c7376db7b21cdcb2.zip
added warning, if file exists in file encryption
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@362 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'fileencryptiondialog.cpp')
-rwxr-xr-xfileencryptiondialog.cpp14
1 files changed, 10 insertions, 4 deletions
diff --git a/fileencryptiondialog.cpp b/fileencryptiondialog.cpp
index d1f02ef..25db7f0 100755
--- a/fileencryptiondialog.cpp
+++ b/fileencryptiondialog.cpp
@@ -38,7 +38,6 @@ FileEncryptionDialog::FileEncryptionDialog(GpgME::Context *ctx, QString iconPath
: QDialog(parent)
{
-
mCtx = ctx;
setWindowTitle(tr("Encrypt / Decrypt File"));
resize(500, 200);
@@ -136,8 +135,9 @@ void FileEncryptionDialog::selectOutputFile()
path = QFileInfo(outputFileEdit->text()).absolutePath();
}
- QString outfileName = QFileDialog::getSaveFileName(this, tr("Save File"), path);
+ QString outfileName = QFileDialog::getSaveFileName(this, tr("Save File"),path, NULL ,NULL ,QFileDialog::DontConfirmOverwrite);
outputFileEdit->setText(outfileName);
+
}
void FileEncryptionDialog::executeAction()
@@ -173,8 +173,14 @@ void FileEncryptionDialog::executeAction()
QDataStream out(&outfile);
out.writeRawData(outBuffer->data(), outBuffer->length());
- accept();
- QMessageBox::information(0, "Done", "Output saved to " + outputFileEdit->text());
+ QMessageBox::StandardButton ret;
+ ret = QMessageBox::warning(this, tr("File"),
+ tr("File exists! Do you want to overwrite it?"),
+ QMessageBox::Ok|QMessageBox::Cancel);
+ if (ret == QMessageBox::Ok){
+ accept();
+ QMessageBox::information(0, "Done", "Output saved to " + outputFileEdit->text());
+ }
}
void FileEncryptionDialog::showKeyList()