summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndras Timar <andras.timar@collabora.com>2016-09-20 21:52:08 +0200
committerAndras Timar <andras.timar@collabora.com>2016-09-21 21:42:33 +0000
commite58bd7a00eba8d2fd0f1db2e8121c81077a3101d (patch)
tree64d710e9aedc252e24a5cdb09e6f4c5f6238aa17
parent0794fb0edc85bf147e4d199e541efaad578e4b96 (diff)
tdf#101976 related: check for read-only state of all Online Update settings
Change-Id: I1c14d3fd8fd257f762f136f5b03ac0ec31b44254 Reviewed-on: https://gerrit.libreoffice.org/29109 Reviewed-by: Andras Timar <andras.timar@collabora.com> Tested-by: Andras Timar <andras.timar@collabora.com>
-rw-r--r--cui/source/options/optupdt.cxx27
1 files changed, 19 insertions, 8 deletions
diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index ae2aec7acb1d..518e3a118c62 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -283,12 +283,14 @@ void SvxOnlineUpdateTabPage::Reset( const SfxItemSet* )
m_pAutoCheckCheckBox->Check(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;
+ aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/CheckInterval");
+ bool bReadOnly2 = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
+ m_pEveryDayButton->Enable(bValue && !(bReadOnly || bReadOnly2));
+ m_pEveryWeekButton->Enable(bValue && !(bReadOnly || bReadOnly2));
+ m_pEveryMonthButton->Enable(bValue && !(bReadOnly || bReadOnly2));
if( nValue == 86400 )
m_pEveryDayButton->Check();
@@ -303,19 +305,27 @@ void SvxOnlineUpdateTabPage::Reset( const SfxItemSet* )
m_pEveryMonthButton->SaveValue();
m_xUpdateAccess->getByName( "AutoDownloadEnabled" ) >>= bValue;
+ aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/AutoDownloadEnabled");
+ bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
m_pAutoDownloadCheckBox->Check(bValue);
+ m_pAutoDownloadCheckBox->Enable(!bReadOnly);
m_pDestPathLabel->Enable();
m_pDestPath->Enable();
- m_pChangePathButton->Enable();
OUString sValue, aPath;
m_xUpdateAccess->getByName( "DownloadDestination" ) >>= sValue;
+ aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/DownloadDestination");
+ bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
+ m_pChangePathButton->Enable(!bReadOnly);
if( osl::FileBase::E_None == osl::FileBase::getSystemPathFromFileURL(sValue, aPath) )
m_pDestPath->SetText(aPath);
m_xUpdateAccess->getByName( "ExtendedUserAgent" ) >>= bValue;
+ aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/ExtendedUserAgent");
+ bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
m_pExtrasCheckBox->Check(bValue);
+ m_pExtrasCheckBox->Enable(!bReadOnly);
m_pExtrasCheckBox->SaveValue();
UpdateUserAgent();
@@ -329,10 +339,11 @@ void SvxOnlineUpdateTabPage::FillUserData()
IMPL_LINK_TYPED( SvxOnlineUpdateTabPage, AutoCheckHdl_Impl, Button*, pBox, void )
{
bool bEnabled = static_cast<CheckBox*>(pBox)->IsChecked();
-
- m_pEveryDayButton->Enable(bEnabled);
- m_pEveryWeekButton->Enable(bEnabled);
- m_pEveryMonthButton->Enable(bEnabled);
+ beans::Property aProperty = m_xReadWriteAccess->getPropertyByHierarchicalName("/org.openoffice.Office.Jobs/Jobs/org.openoffice.Office.Jobs:Job['UpdateCheck']/Arguments/CheckInterval");
+ bool bReadOnly = (aProperty.Attributes & beans::PropertyAttribute::READONLY) != 0;
+ m_pEveryDayButton->Enable(bEnabled && !bReadOnly);
+ m_pEveryWeekButton->Enable(bEnabled && !bReadOnly);
+ m_pEveryMonthButton->Enable(bEnabled && !bReadOnly);
}
IMPL_LINK_TYPED( SvxOnlineUpdateTabPage, ExtrasCheckHdl_Impl, Button*, , void )