cui/source/options/optupdt.cxx | 27 +++++++++++++++++++-------- 1 file changed, 19 insertions(+), 8 deletions(-)
New commits: commit e58bd7a00eba8d2fd0f1db2e8121c81077a3101d Author: Andras Timar <andras.ti...@collabora.com> Date: Tue Sep 20 21:52:08 2016 +0200 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.ti...@collabora.com> Tested-by: Andras Timar <andras.ti...@collabora.com> diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx index ae2aec7..518e3a1 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 ) _______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits