From 724cf69947021a4af46a8028c147a624644ce98b Mon Sep 17 00:00:00 2001 From: ubbo Date: Fri, 25 Sep 2009 12:30:48 +0000 Subject: fill-in outputfilename in fileencryptiondialog after choosing input git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@226 34ebc366-c3a9-4b3c-9f84-69acf7962910 --- fileencryptiondialog.cpp | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) (limited to 'fileencryptiondialog.cpp') 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 + * + * 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 #include @@ -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() -- cgit v1.2.3