diff options
author | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-05-01 22:16:02 +0000 |
---|---|---|
committer | ubbo <ubbo@34ebc366-c3a9-4b3c-9f84-69acf7962910> | 2012-05-01 22:16:02 +0000 |
commit | 7c874c55c8242baaa770c46718a5c66b3bf8284a (patch) | |
tree | 2dd2fcff16431e86408b63b460ef5766529e1150 /verifydetailsdialog.cpp | |
parent | verify file working now (diff) | |
download | gpg4usb-7c874c55c8242baaa770c46718a5c66b3bf8284a.tar.gz gpg4usb-7c874c55c8242baaa770c46718a5c66b3bf8284a.zip |
show error if file could not be read, don't crash on invalid data for verify
git-svn-id: http://cpunk.de/svn/src/gpg4usb/trunk@911 34ebc366-c3a9-4b3c-9f84-69acf7962910
Diffstat (limited to 'verifydetailsdialog.cpp')
-rw-r--r-- | verifydetailsdialog.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/verifydetailsdialog.cpp b/verifydetailsdialog.cpp index 5fcedc8..55fb567 100644 --- a/verifydetailsdialog.cpp +++ b/verifydetailsdialog.cpp @@ -50,6 +50,10 @@ void VerifyDetailsDialog::refresh() QVBoxLayout *mVboxLayout = new QVBoxLayout(mVbox); mainLayout->addWidget(mVbox); + // Button Box for close button + buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); + connect(buttonBox, SIGNAL(rejected()), this, SLOT(close())); + // Get signature information of current text //QByteArray text = mTextpage->toPlainText().toUtf8(); //mCtx->preventNoDataErr(&text); @@ -60,6 +64,12 @@ void VerifyDetailsDialog::refresh() sign = mCtx->verify(mInputData); } + if(sign==0) { + mVboxLayout->addWidget(new QLabel(tr("No valid input found"))); + mVboxLayout->addWidget(buttonBox); + return; + } + // Get timestamp of signature of current text QDateTime timestamp; timestamp.setTime_t(sign->timestamp); @@ -91,8 +101,5 @@ void VerifyDetailsDialog::refresh() mVboxLayout->addWidget(sbox); } - // Button Box for close button - buttonBox = new QDialogButtonBox(QDialogButtonBox::Close); - connect(buttonBox, SIGNAL(rejected()), this, SLOT(close())); mVboxLayout->addWidget(buttonBox); } |