diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2009-09-25 12:30:48 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2009-09-25 12:30:48 +0000 |
commit | 724cf69947021a4af46a8028c147a624644ce98b (patch) | |
tree | 104a04783be28e2f8d832565429d0a1bad691fbd /fileencryptiondialog.cpp | |
parent | fixed bug in key generating, that no passphrase was given for never expiring ... (diff) | |
download | gpg4usb-724cf69947021a4af46a8028c147a624644ce98b.tar.gz gpg4usb-724cf69947021a4af46a8028c147a624644ce98b.zip |
fill-in outputfilename in fileencryptiondialog after choosing input
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@226 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'fileencryptiondialog.cpp')
-rwxr-xr-x | fileencryptiondialog.cpp | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/fileencryptiondialog.cpp b/fileencryptiondialog.cpp index 8d5e702..93faad1 100755 --- a/fileencryptiondialog.cpp +++ b/fileencryptiondialog.cpp @@ -1,3 +1,23 @@ +/* + * fileencryptiondialog.cpp + * + * Copyright 2008 gpg4usb-team <[email protected]> + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, + * MA 02110-1301, USA. + */ #include <QWidget> #include <QDialogButtonBox> @@ -84,6 +104,19 @@ void FileEncryptionDialog::selectInputFile() { QString infileName = QFileDialog::getOpenFileName(this, tr("Open File"), "", tr("Files") + "All Files (*)"); inputFileEdit->insert(infileName); + if(infileName > 0 && outputFileEdit->text().size()==0) { + if(radioEnc->isChecked()) { + outputFileEdit->setText(infileName+".asc"); + } else { + if (infileName.endsWith(".asc", Qt::CaseInsensitive)) { + QString ofn = infileName; + ofn.chop(4); + outputFileEdit->setText(ofn); + } else { + outputFileEdit->setText(infileName+".out"); + } + } + } } void FileEncryptionDialog::selectOutputFile() |