summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cui/source/options/optupdt.cxx13
-rw-r--r--cui/source/options/optupdt.hxx2
2 files changed, 12 insertions, 3 deletions
diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index 3623bd65200c..ae2aec7acb1d 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -37,6 +37,8 @@
#include <com/sun/star/util/URLTransformer.hpp>
#include <com/sun/star/util/XURLTransformer.hpp>
#include <com/sun/star/setup/UpdateCheckConfig.hpp>
+#include <com/sun/star/configuration/ReadWriteAccess.hpp>
+#include <com/sun/star/beans/PropertyAttribute.hpp>
#include <osl/file.hxx>
#include <osl/security.hxx>
@@ -67,6 +69,7 @@ SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage(vcl::Window* pParent, const SfxIt
uno::Reference < uno::XComponentContext > xContext( ::comphelper::getProcessComponentContext() );
m_xUpdateAccess = setup::UpdateCheckConfig::create( xContext );
+ m_xReadWriteAccess = css::configuration::ReadWriteAccess::create(xContext, "*");
bool bDownloadSupported = false;
m_xUpdateAccess->getByName( "DownloadSupported" ) >>= bDownloadSupported;
@@ -274,11 +277,15 @@ void SvxOnlineUpdateTabPage::Reset( const SfxItemSet* )
{
bool bValue = false;
m_xUpdateAccess->getByName( "AutoCheckEnabled" ) >>= bValue;
+ OUStringLiteral sPath("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/AutoCheckEnabled");
+ beans::Property aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName(sPath);
+ bool bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
m_pAutoCheckCheckBox->Check(bValue);
- m_pEveryDayButton->Enable(bValue);
- m_pEveryWeekButton->Enable(bValue);
- m_pEveryMonthButton->Enable(bValue);
+ m_pAutoCheckCheckBox->Enable(!bReadOnly);
+ m_pEveryDayButton->Enable(bValue && !bReadOnly);
+ m_pEveryWeekButton->Enable(bValue && !bReadOnly);
+ m_pEveryMonthButton->Enable(bValue && !bReadOnly);
sal_Int64 nValue = 0;
m_xUpdateAccess->getByName( "CheckInterval" ) >>= nValue;
diff --git a/cui/source/options/optupdt.hxx b/cui/source/options/optupdt.hxx
index 9460930fc164..04a97b742f74 100644
--- a/cui/source/options/optupdt.hxx
+++ b/cui/source/options/optupdt.hxx
@@ -23,6 +23,7 @@
#include <sfx2/tabdlg.hxx>
#include <vcl/fixed.hxx>
#include <com/sun/star/container/XNameReplace.hpp>
+#include <com/sun/star/configuration/XReadWriteAccess.hpp>
// class SvxPathTabPage --------------------------------------------------
@@ -50,6 +51,7 @@ private:
DECL_LINK_TYPED(ExtrasCheckHdl_Impl, Button*, void);
css::uno::Reference< css::container::XNameReplace > m_xUpdateAccess;
+ css::uno::Reference<css::configuration::XReadWriteAccess> m_xReadWriteAccess;
void UpdateLastCheckedText();
void UpdateUserAgent();