diff options
author | Aron Budea <aron.budea@collabora.com> | 2018-04-01 00:28:57 +0200 |
---|---|---|
committer | Noel Grandin <noel.grandin@collabora.co.uk> | 2018-04-02 08:51:38 +0200 |
commit | 5092305fa80f1900d7229df75a30204ecb53daf0 (patch) | |
tree | dd9b562bb258e487da5be2ee1b522e178f592e6d /cui/source | |
parent | 3939e10c515364cb9ef0a089d3db667aed0aa5ea (diff) |
Respect read-only config items in Internet/Proxy dialog
Change-Id: Ie310d97eba7b02135ddd04dcdd5ff38542d490f8
Reviewed-on: https://gerrit.libreoffice.org/52204
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'cui/source')
-rw-r--r-- | cui/source/options/optinet2.cxx | 54 | ||||
-rw-r--r-- | cui/source/options/optinet2.hxx | 2 |
2 files changed, 34 insertions, 22 deletions
diff --git a/cui/source/options/optinet2.cxx b/cui/source/options/optinet2.cxx index 1a03dba47d9c..16d62d4acaa5 100644 --- a/cui/source/options/optinet2.cxx +++ b/cui/source/options/optinet2.cxx @@ -20,6 +20,7 @@ #include <sal/config.h> #include <o3tl/string_view.hxx> +#include <officecfg/Inet.hxx> #include <officecfg/Office/Common.hxx> #include <officecfg/Office/Security.hxx> #include <tools/config.hxx> @@ -417,7 +418,7 @@ void SvxProxyTabPage::Reset(const SfxItemSet*) m_pFtpPortED->SaveValue(); m_pNoProxyForED->SaveValue(); - EnableControls_Impl( m_pProxyModeLB->GetSelectedEntryPos() == 2 ); + EnableControls_Impl(); } bool SvxProxyTabPage::FillItemSet(SfxItemSet* ) @@ -504,26 +505,37 @@ bool SvxProxyTabPage::FillItemSet(SfxItemSet* ) return bModified; } -void SvxProxyTabPage::EnableControls_Impl(bool bEnable) +void SvxProxyTabPage::EnableControls_Impl() { - m_pHttpProxyFT->Enable(bEnable); - m_pHttpProxyED->Enable(bEnable); - m_pHttpPortFT->Enable(bEnable); - m_pHttpPortED->Enable(bEnable); - - m_pHttpsProxyFT->Enable(bEnable); - m_pHttpsProxyED->Enable(bEnable); - m_pHttpsPortFT->Enable(bEnable); - m_pHttpsPortED->Enable(bEnable); - - m_pFtpProxyFT->Enable(bEnable); - m_pFtpProxyED->Enable(bEnable); - m_pFtpPortFT->Enable(bEnable); - m_pFtpPortED->Enable(bEnable); - - m_pNoProxyForFT->Enable(bEnable); - m_pNoProxyForED->Enable(bEnable); - m_pNoProxyDescFT->Enable(bEnable); + m_pProxyModeLB->Enable(!officecfg::Inet::Settings::ooInetNoProxy::isReadOnly()); + + const bool bManualConfig = m_pProxyModeLB->GetSelectedEntryPos() == 2; + + const bool bHTTPProxyNameEnabled = bManualConfig && !officecfg::Inet::Settings::ooInetHTTPProxyName::isReadOnly(); + const bool bHTTPProxyPortEnabled = bManualConfig && !officecfg::Inet::Settings::ooInetHTTPProxyPort::isReadOnly(); + m_pHttpProxyFT->Enable(bHTTPProxyNameEnabled); + m_pHttpProxyED->Enable(bHTTPProxyNameEnabled); + m_pHttpPortFT->Enable(bHTTPProxyPortEnabled); + m_pHttpPortED->Enable(bHTTPProxyPortEnabled); + + const bool bHTTPSProxyNameEnabled = bManualConfig && !officecfg::Inet::Settings::ooInetHTTPSProxyName::isReadOnly(); + const bool bHTTPSProxyPortEnabled = bManualConfig && !officecfg::Inet::Settings::ooInetHTTPSProxyPort::isReadOnly(); + m_pHttpsProxyFT->Enable(bHTTPSProxyNameEnabled); + m_pHttpsProxyED->Enable(bHTTPSProxyNameEnabled); + m_pHttpsPortFT->Enable(bHTTPSProxyPortEnabled); + m_pHttpsPortED->Enable(bHTTPSProxyPortEnabled); + + const bool bFTPProxyNameEnabled = bManualConfig && !officecfg::Inet::Settings::ooInetFTPProxyName::isReadOnly(); + const bool bFTPProxyPortEnabled = bManualConfig && !officecfg::Inet::Settings::ooInetFTPProxyPort::isReadOnly(); + m_pFtpProxyFT->Enable(bFTPProxyNameEnabled); + m_pFtpProxyED->Enable(bFTPProxyNameEnabled); + m_pFtpPortFT->Enable(bFTPProxyPortEnabled); + m_pFtpPortED->Enable(bFTPProxyPortEnabled); + + const bool bInetNoProxyEnabled = bManualConfig && !officecfg::Inet::Settings::ooInetNoProxy::isReadOnly(); + m_pNoProxyForFT->Enable(bInetNoProxyEnabled); + m_pNoProxyForED->Enable(bInetNoProxyEnabled); + m_pNoProxyDescFT->Enable(bInetNoProxyEnabled); } @@ -537,7 +549,7 @@ IMPL_LINK( SvxProxyTabPage, ProxyHdl_Impl, ListBox&, rBox, void ) ReadConfigDefaults_Impl(); } - EnableControls_Impl(nPos == 2); + EnableControls_Impl(); } diff --git a/cui/source/options/optinet2.hxx b/cui/source/options/optinet2.hxx index cd402a4513bd..b0d8f7884dc8 100644 --- a/cui/source/options/optinet2.hxx +++ b/cui/source/options/optinet2.hxx @@ -81,7 +81,7 @@ private: css::uno::Reference< css::uno::XInterface > m_xConfigurationUpdateAccess; - void EnableControls_Impl(bool bEnable); + void EnableControls_Impl(); void ReadConfigData_Impl(); void ReadConfigDefaults_Impl(); void RestoreConfigDefaults_Impl(); |