summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2023-12-19 10:47:57 +0100
committerStephan Bergmann <stephan.bergmann@allotropia.de>2023-12-19 14:13:25 +0100
commit30ab6dd73a15781abce9153105ec43ee887aace1 (patch)
tree029caf85f2e82fc9ae3f31db483994db585d8efc
parent09ec97405a6097c0db6ff9dc2aaac263dcd0d718 (diff)
Hide --enable-online-updaet-mar GUI behind ExperimentalMode for now
(and rename SvxOnlineUpdateTabPage's is...OnlineUpdateEnabled predicates to is...OnlineUpdaetAvailable, to avoid the overloaded term "enabled" here) Change-Id: I639ac72a17b98c883ff3082747b8576099299867 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/160975 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
-rw-r--r--cui/source/options/optupdt.cxx37
-rw-r--r--cui/source/options/optupdt.hxx4
-rw-r--r--cui/source/options/treeopt.cxx7
3 files changed, 28 insertions, 20 deletions
diff --git a/cui/source/options/optupdt.cxx b/cui/source/options/optupdt.cxx
index e8f4ee21c214..e3b855b15d1d 100644
--- a/cui/source/options/optupdt.cxx
+++ b/cui/source/options/optupdt.cxx
@@ -52,7 +52,8 @@ using namespace ::css;
SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage(weld::Container* pPage, weld::DialogController* pController, const SfxItemSet& rSet)
: SfxTabPage(pPage, pController, "cui/ui/optonlineupdatepage.ui", "OptOnlineUpdatePage", &rSet)
- , m_showTraditionalOnlineUpdate(isTraditionalOnlineUpdateEnabled())
+ , m_showTraditionalOnlineUpdate(isTraditionalOnlineUpdateAvailable())
+ , m_showMarOnlineUpdate(isMarOnlineUpdateAvailable())
, m_xNeverChecked(m_xBuilder->weld_label("neverchecked"))
, m_xAutoCheckCheckBox(m_xBuilder->weld_check_button("autocheck"))
, m_xAutoCheckImg(m_xBuilder->weld_widget("lockautocheck"))
@@ -121,12 +122,12 @@ SvxOnlineUpdateTabPage::SvxOnlineUpdateTabPage(weld::Container* pPage, weld::Dia
m_xPrivacyPolicyButton->hide();
}
-#if HAVE_FEATURE_UPDATE_MAR
- m_xMar->show();
- m_xEnableMar->set_sensitive(!officecfg::Office::Update::Update::Enabled::isReadOnly());
-#else
- m_xMar->hide();
-#endif
+ if (m_showMarOnlineUpdate) {
+ m_xMar->show();
+ m_xEnableMar->set_sensitive(!officecfg::Office::Update::Update::Enabled::isReadOnly());
+ } else {
+ m_xMar->hide();
+ }
}
SvxOnlineUpdateTabPage::~SvxOnlineUpdateTabPage()
@@ -325,14 +326,12 @@ bool SvxOnlineUpdateTabPage::FillItemSet( SfxItemSet* )
xChangesBatch->commitChanges();
}
-#if HAVE_FEATURE_UPDATE_MAR
- if (m_xEnableMar->get_state_changed_from_saved()) {
+ if (m_showMarOnlineUpdate && m_xEnableMar->get_state_changed_from_saved()) {
auto batch(comphelper::ConfigurationChanges::create());
officecfg::Office::Update::Update::Enabled::set(m_xEnableMar->get_active(), batch);
batch->commit();
bModified = true;
}
-#endif
return bModified;
}
@@ -400,10 +399,10 @@ void SvxOnlineUpdateTabPage::Reset( const SfxItemSet* )
m_xAutoDownloadCheckBox->save_state();
}
-#if HAVE_FEATURE_UPDATE_MAR
- m_xEnableMar->set_active(officecfg::Office::Update::Update::Enabled::get());
- m_xEnableMar->save_state();
-#endif
+ if (m_showMarOnlineUpdate) {
+ m_xEnableMar->set_active(officecfg::Office::Update::Update::Enabled::get());
+ m_xEnableMar->save_state();
+ }
}
void SvxOnlineUpdateTabPage::FillUserData()
@@ -493,7 +492,7 @@ IMPL_LINK_NOARG(SvxOnlineUpdateTabPage, CheckNowHdl_Impl, weld::Button&, void)
}
}
-bool SvxOnlineUpdateTabPage::isTraditionalOnlineUpdateEnabled() {
+bool SvxOnlineUpdateTabPage::isTraditionalOnlineUpdateAvailable() {
try
{
css::uno::Reference < css::uno::XInterface > xService( setup::UpdateCheck::create( ::comphelper::getProcessComponentContext() ) );
@@ -506,4 +505,12 @@ bool SvxOnlineUpdateTabPage::isTraditionalOnlineUpdateEnabled() {
return false;
}
+bool SvxOnlineUpdateTabPage::isMarOnlineUpdateAvailable() {
+#if HAVE_FEATURE_UPDATE_MAR
+ return officecfg::Office::Common::Misc::ExperimentalMode::get();
+#else
+ return false;
+#endif
+}
+
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/optupdt.hxx b/cui/source/options/optupdt.hxx
index b6e7e4c448f4..48113c8079d6 100644
--- a/cui/source/options/optupdt.hxx
+++ b/cui/source/options/optupdt.hxx
@@ -29,6 +29,7 @@ class SvxOnlineUpdateTabPage : public SfxTabPage
{
private:
bool m_showTraditionalOnlineUpdate;
+ bool m_showMarOnlineUpdate;
OUString m_aNeverChecked;
OUString m_aLastCheckedTemplate;
@@ -79,7 +80,8 @@ public:
virtual void Reset( const SfxItemSet* rSet ) override;
virtual void FillUserData() override;
- static bool isTraditionalOnlineUpdateEnabled();
+ static bool isTraditionalOnlineUpdateAvailable();
+ static bool isMarOnlineUpdateAvailable();
};
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index deb0ecaa2844..a8d055078ffc 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -1734,14 +1734,13 @@ void OfaTreeOptionsDialog::generalOptions(const std::vector<sal_uInt16>& vPageId
if ( lcl_isOptionHidden( nPageId, aOptionsDlgOpt ) )
continue;
-#if !HAVE_FEATURE_UPDATE_MAR
- // Disable Online Update page if service not installed
+ // Disable Online Update page if neither mode is available
if( RID_SVXPAGE_ONLINEUPDATE == nPageId
- && !SvxOnlineUpdateTabPage::isTraditionalOnlineUpdateEnabled() )
+ && !(SvxOnlineUpdateTabPage::isTraditionalOnlineUpdateAvailable()
+ || SvxOnlineUpdateTabPage::isMarOnlineUpdateAvailable()) )
{
continue;
}
-#endif
// Disable Basic IDE options, if experimental features are not enabled
if( RID_SVXPAGE_BASICIDE_OPTIONS == nPageId )