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

Enable "Encrypt with password" if keyring is empty

GnuPG-bug-id: 5545
parent 81bb8ed2
...@@ -567,10 +567,20 @@ void SignEncryptWidget::setSigningChecked(bool value) ...@@ -567,10 +567,20 @@ void SignEncryptWidget::setSigningChecked(bool value)
mSigChk->setChecked(value); mSigChk->setChecked(value);
} }
void SignEncryptWidget::setEncryptionChecked(bool value) void SignEncryptWidget::setEncryptionChecked(bool checked)
{ {
mEncSelfChk->setChecked(value); if (checked) {
mEncOtherChk->setChecked(value); const bool haveOwnKeys = !KeyCache::instance()->secretKeys().empty();
const bool haveOtherKeys = !KeyCache::instance()->keys().empty();
const bool haveKeys = haveOwnKeys && haveOtherKeys;
mEncSelfChk->setChecked(haveKeys);
mEncOtherChk->setChecked(haveKeys);
mSymmetric->setChecked(!haveKeys);
} else {
mEncSelfChk->setChecked(false);
mEncOtherChk->setChecked(false);
mSymmetric->setChecked(false);
}
} }
void SignEncryptWidget::setProtocol(GpgME::Protocol proto) void SignEncryptWidget::setProtocol(GpgME::Protocol proto)
......
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