Commit d6582a49 authored by Ingo Klöcker's avatar Ingo Klöcker
Browse files

Do not show "opaque signature" warning if just one file is to be signed

GnuPG-bug-id: 5535
parent e54ed508
Pipeline #76251 passed with stage
in 15 minutes and 20 seconds
......@@ -119,7 +119,8 @@ public:
mOutLayout(new QVBoxLayout),
mOutputLabel{nullptr},
mArchive(false),
mUseOutputDir(false)
mUseOutputDir(false),
mSingleFile{true}
{
setTitle(i18nc("@title", "Sign / Encrypt Files"));
auto vLay = new QVBoxLayout(this);
......@@ -156,7 +157,7 @@ public:
mOutLayout->addWidget(mUseOutputDirChk);
connect (mUseOutputDirChk, &QCheckBox::toggled, this, [this] (bool state) {
mUseOutputDir = state;
mArchive = !mUseOutputDir;
mArchive = !mUseOutputDir && !mSingleFile;
updateFileWidgets();
});
......@@ -208,6 +209,12 @@ public:
}
}
void setSingleFile(bool singleFile)
{
mSingleFile = singleFile;
mArchive = !mUseOutputDir && !mSingleFile;
}
bool validatePage() override
{
bool sign = !mWidget->signKey().isNull();
......@@ -416,6 +423,7 @@ private:
QLabel *mOutputLabel;
bool mArchive;
bool mUseOutputDir;
bool mSingleFile;
};
class ResultPage : public NewResultPage
......@@ -529,6 +537,11 @@ void SignEncryptFilesWizard::setArchiveMutable(bool archive)
mSigEncPage->setArchiveMutable(archive);
}
void SignEncryptFilesWizard::setSingleFile(bool singleFile)
{
mSigEncPage->setSingleFile(singleFile);
}
std::vector<Key> SignEncryptFilesWizard::resolvedRecipients() const
{
return mSigEncPage->recipients();
......
......@@ -69,6 +69,8 @@ public:
void setArchiveForced(bool archive);
void setArchiveMutable(bool archive);
void setSingleFile(bool singleFile);
void setOutputNames(const QMap<int, QString> &nameMap) const;
QMap<int, QString> outputNames() const;
......
......@@ -328,6 +328,7 @@ void SignEncryptFilesController::setFiles(const QStringList &files)
}
}
d->ensureWizardCreated();
d->wizard->setSingleFile(!archive);
d->wizard->setOutputNames(buildOutputNames(files, archive));
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment