diff options
author | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-10-24 18:30:31 +0200 |
---|---|---|
committer | Balazs Varga <balazs.varga.extern@allotropia.de> | 2023-10-26 09:21:27 +0200 |
commit | 6a8cae6995d22666c0a6fd2b42c171ef27ae30ac (patch) | |
tree | d1b0da427559055f7c9194721c08494ee3a73aed /cui/source/options | |
parent | 9e8c90d92a6658ecc732554cb220d14eaee4692b (diff) |
tdf#157840 - UI: Part 6 - Unify lockdown behavior of Options dialog
for Security Page.
Change-Id: I9b5282326ea8edeb00d45d9d034a18041f89a281
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/158393
Tested-by: Jenkins
Reviewed-by: Balazs Varga <balazs.varga.extern@allotropia.de>
Diffstat (limited to 'cui/source/options')
-rw-r--r-- | cui/source/options/optinet2.cxx | 37 | ||||
-rw-r--r-- | cui/source/options/optinet2.hxx | 8 |
2 files changed, 45 insertions, 0 deletions
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 29fe7d758d8d..90801955edaa 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -497,19 +497,27 @@ SvxSecurityTabPage::SvxSecurityTabPage(weld::Container* pPage, weld::DialogContr : SfxTabPage(pPage, pController, "cui/ui/optsecuritypage.ui", "OptSecurityPage", &rSet) , m_xSecurityOptionsPB(m_xBuilder->weld_button("options")) , m_xSavePasswordsCB(m_xBuilder->weld_check_button("savepassword")) + , m_xSavePasswordsImg(m_xBuilder->weld_widget("locksavepassword")) , m_xShowConnectionsPB(m_xBuilder->weld_button("connections")) , m_xMasterPasswordCB(m_xBuilder->weld_check_button("usemasterpassword")) + , m_xMasterPasswordImg(m_xBuilder->weld_widget("lockusemasterpassword")) , m_xMasterPasswordFT(m_xBuilder->weld_label("masterpasswordtext")) , m_xMasterPasswordPB(m_xBuilder->weld_button("masterpassword")) , m_xMacroSecFrame(m_xBuilder->weld_container("macrosecurity")) , m_xMacroSecPB(m_xBuilder->weld_button("macro")) , m_xCertFrame(m_xBuilder->weld_container("certificatepath")) , m_xCertPathPB(m_xBuilder->weld_button("cert")) + , m_xCertPathImg(m_xBuilder->weld_widget("lockcertipath")) + , m_xCertPathLabel(m_xBuilder->weld_label("label7")) , m_xTSAURLsFrame(m_xBuilder->weld_container("tsaurls")) , m_xTSAURLsPB(m_xBuilder->weld_button("tsas")) + , m_xTSAURLsImg(m_xBuilder->weld_widget("locktsas")) + , m_xTSAURLsLabel(m_xBuilder->weld_label("label9")) , m_xNoPasswordSaveFT(m_xBuilder->weld_label("nopasswordsave")) , m_xCertMgrPathLB(m_xBuilder->weld_button("browse")) , m_xParameterEdit(m_xBuilder->weld_entry("parameterfield")) + , m_xCertMgrPathImg(m_xBuilder->weld_widget("lockcertimanager")) + , m_xCertMgrPathLabel(m_xBuilder->weld_label("label11")) { //fdo#65595, we need height-for-width support here, but for now we can //bodge it @@ -798,6 +806,16 @@ void SvxSecurityTabPage::InitControls() m_xMasterPasswordFT->set_sensitive(true); } } + + if (officecfg::Office::Common::Passwords::UseStorage::isReadOnly()) + { + m_xSavePasswordsCB->set_sensitive(false); + m_xShowConnectionsPB->set_sensitive(false); + m_xSavePasswordsImg->set_visible(true); + m_xMasterPasswordCB->set_sensitive(false); + m_xMasterPasswordPB->set_sensitive(false); + m_xMasterPasswordImg->set_visible(true); + } } catch (const Exception&) { @@ -810,6 +828,25 @@ void SvxSecurityTabPage::InitControls() if (!sCurCertMgr.isEmpty()) m_xParameterEdit->set_text(sCurCertMgr); + + bool bEnable = !officecfg::Office::Common::Security::Scripting::CertMgrPath::isReadOnly(); + m_xCertMgrPathLB->set_sensitive(bEnable); + m_xParameterEdit->set_sensitive(bEnable); + m_xCertMgrPathLabel->set_sensitive(bEnable); + m_xCertMgrPathImg->set_visible(!bEnable); + + bEnable = !officecfg::Office::Common::Security::Scripting::TSAURLs::isReadOnly(); + m_xTSAURLsPB->set_sensitive(bEnable); + m_xTSAURLsLabel->set_sensitive(bEnable); + m_xTSAURLsImg->set_visible(!bEnable); + +#ifndef UNX + bEnable = !officecfg::Office::Common::Security::Scripting::CertDir::isReadOnly() || + !officecfg::Office::Common::Security::Scripting::ManualCertDir::isReadOnly(); + m_xCertPathPB->set_sensitive(bEnable); + m_xCertPathLabel->set_sensitive(bEnable); + m_xCertPathImg->set_visible(!bEnable); +#endif } catch (const uno::Exception&) { diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx index f99c30b0b12b..1ad30723f758 100644 --- a/cui/source/options/optinet2.hxx +++ b/cui/source/options/optinet2.hxx @@ -90,9 +90,11 @@ private: std::unique_ptr<weld::Button> m_xSecurityOptionsPB; std::unique_ptr<weld::CheckButton> m_xSavePasswordsCB; + std::unique_ptr<weld::Widget> m_xSavePasswordsImg; std::unique_ptr<weld::Button> m_xShowConnectionsPB; std::unique_ptr<weld::CheckButton> m_xMasterPasswordCB; + std::unique_ptr<weld::Widget> m_xMasterPasswordImg; std::unique_ptr<weld::Label> m_xMasterPasswordFT; std::unique_ptr<weld::Button> m_xMasterPasswordPB; @@ -101,14 +103,20 @@ private: std::unique_ptr<weld::Container> m_xCertFrame; std::unique_ptr<weld::Button> m_xCertPathPB; + std::unique_ptr<weld::Widget> m_xCertPathImg; + std::unique_ptr<weld::Label> m_xCertPathLabel; std::unique_ptr<weld::Container> m_xTSAURLsFrame; std::unique_ptr<weld::Button> m_xTSAURLsPB; + std::unique_ptr<weld::Widget> m_xTSAURLsImg; + std::unique_ptr<weld::Label> m_xTSAURLsLabel; std::unique_ptr<weld::Label> m_xNoPasswordSaveFT; std::unique_ptr<weld::Button> m_xCertMgrPathLB; std::unique_ptr<weld::Entry> m_xParameterEdit; + std::unique_ptr<weld::Widget> m_xCertMgrPathImg; + std::unique_ptr<weld::Label> m_xCertMgrPathLabel; DECL_LINK(SecurityOptionsHdl, weld::Button&, void); DECL_LINK(SavePasswordHdl, weld::Toggleable&, void); |