diff options
author | Katarina Behrens <Katarina.Behrens@cib.de> | 2017-12-13 18:39:10 +0100 |
---|---|---|
committer | Thorsten Behrens <Thorsten.Behrens@CIB.de> | 2017-12-19 01:24:56 +0100 |
commit | df4fac1dbce087bbd01bbec242b93c72edcef74b (patch) | |
tree | 7d058ff2a40f0c46e9ab835ada78e3931e98b947 /cui | |
parent | Do things with preferred GPG keys (diff) | |
download | core-df4fac1dbce087bbd01bbec242b93c72edcef74b.tar.gz core-df4fac1dbce087bbd01bbec242b93c72edcef74b.zip |
Read/write preferred GPG signing/encryption keys
Change-Id: I3e21469c5f4c4f199407bbe9faba2e2ddca531b3
Reviewed-on: https://gerrit.libreoffice.org/46692
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optgenrl.cxx | 33 |
1 files changed, 31 insertions, 2 deletions
diff --git a/cui/source/options/optgenrl.cxx b/cui/source/options/optgenrl.cxx index b63fbf580b69..83a98e60c7b0 100644 --- a/cui/source/options/optgenrl.cxx +++ b/cui/source/options/optgenrl.cxx @@ -428,10 +428,29 @@ bool SvxGeneralTabPage::GetData_Impl() ); // modified? + bool bModified = false; for (auto const & i: vFields) + { if (i->pEdit->IsValueChangedFromSaved()) - return true; - return false; + { + bModified = true; + break; + } + } + +#if HAVE_FEATURE_GPGME + OUString aSK = m_pSigningKeyLB->GetSelectedEntryPos() == 0 ? OUString() //i.e. no key + : m_pSigningKeyLB->GetSelectedEntry(); + OUString aEK = m_pEncryptionKeyLB->GetSelectedEntryPos() == 0 ? OUString() + : m_pEncryptionKeyLB->GetSelectedEntry(); + aUserOpt.SetToken( UserOptToken::SigningKey, aSK ); + aUserOpt.SetToken( UserOptToken::EncryptionKey, aEK ); + + bModified |= m_pSigningKeyLB->IsValueChangedFromSaved(); + bModified |= m_pEncryptionKeyLB->IsValueChangedFromSaved(); +#endif + + return bModified; } @@ -461,6 +480,16 @@ void SvxGeneralTabPage::SetData_Impl() // saving for (auto const & i: vFields) i->pEdit->SaveValue(); + +#if HAVE_FEATURE_GPGME + OUString aSK = aUserOpt.GetToken(UserOptToken::SigningKey); + aSK.isEmpty() ? m_pSigningKeyLB->SelectEntryPos( 0 ) //i.e. 'No Key' + : m_pSigningKeyLB->SelectEntry( aSK ); + + OUString aEK = aUserOpt.GetToken(UserOptToken::EncryptionKey); + aEK.isEmpty() ? m_pEncryptionKeyLB->SelectEntryPos( 0 ) //i.e. 'No Key' + : m_pEncryptionKeyLB->SelectEntry( aEK ); +#endif } |