diff options
author | Mike Kaganski <mike.kaganski@collabora.com> | 2023-02-26 17:08:28 +0300 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2023-02-26 16:08:11 +0000 |
commit | 05079016e97d0b41c45cc71695d922fce9ae1e6c (patch) | |
tree | 9a6b6c3e7996eccac29db9fec125ad98c986729b /cui | |
parent | cbf7c0da0f7cd24b2f0da3261dd419be115e57b9 (diff) |
Cleanup general options tab a bit
The crashreporter feature (and thus, the whole frame visibility) depends
not on OS, but on the HAVE_FEATURE_BREAKPAD define. No need to control
the checkbox visibility separate from the label, when we can show the
whole frame selectively.
The quickstarter feature is only available on Windows, since the systray
support was removed in commit 3e9c908b73f0fe0978c9980750a06bbc9e02295e
(remove Linux ("UNX") systray "Quickstarter", 2018-05-23).
Change-Id: Id990b53a6bbfa6b42defec0cc196e7fe817a1924
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/147738
Tested-by: Jenkins
Reviewed-by: Mike Kaganski <mike.kaganski@collabora.com>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optgdlg.cxx | 39 | ||||
-rw-r--r-- | cui/source/options/optgdlg.hxx | 7 | ||||
-rw-r--r-- | cui/uiconfig/ui/optgeneralpage.ui | 21 |
3 files changed, 24 insertions, 43 deletions
diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx index 1037cdd7ed1f..57eaee46d908 100644 --- a/cui/source/options/optgdlg.cxx +++ b/cui/source/options/optgdlg.cxx @@ -164,15 +164,13 @@ OfaMiscTabPage::OfaMiscTabPage(weld::Container* pPage, weld::DialogController* p , m_xYearFrame(m_xBuilder->weld_widget("yearframe")) , m_xYearValueField(m_xBuilder->weld_spin_button("year")) , m_xToYearFT(m_xBuilder->weld_label("toyear")) +#if HAVE_FEATURE_BREAKPAD + , m_xPrivacyFrame(m_xBuilder->weld_widget("privacyframe")) , m_xCrashReport(m_xBuilder->weld_check_button("crashreport")) - , m_xQuickStarterFrame(m_xBuilder->weld_widget("quickstarter")) - , m_xHelpImproveLabel(m_xBuilder->weld_label("label7")) //"Help Improve" -#if defined(UNX) - , m_xQuickLaunchCB(m_xBuilder->weld_check_button("systray")) -#else - , m_xQuickLaunchCB(m_xBuilder->weld_check_button("quicklaunch")) #endif #if defined(_WIN32) + , m_xQuickStarterFrame(m_xBuilder->weld_widget("quickstarter")) + , m_xQuickLaunchCB(m_xBuilder->weld_check_button("quicklaunch")) , m_xFileAssocFrame(m_xBuilder->weld_widget("fileassoc")) , m_xFileAssocBtn(m_xBuilder->weld_button("assocfiles")) , m_xPerformFileExtCheck(m_xBuilder->weld_check_button("cbPerformFileExtCheck")) @@ -186,21 +184,16 @@ OfaMiscTabPage::OfaMiscTabPage(weld::Container* pPage, weld::DialogController* p m_xFileDlgCB->set_sensitive(false); } - m_xQuickLaunchCB->show(); - - //Only available in Win or if building the gtk systray -#if !defined(_WIN32) - m_xQuickStarterFrame->hide(); - //Hide frame label in case of no content - m_xHelpImproveLabel->hide(); -#else - // Store-packaged apps (located under the protected Program Files\WindowsApps) can't use normal - // shell shortcuts to their exe; hide. TODO: show a button to open "Startup Apps" system applet? - if (sal::systools::IsStorePackagedApp()) - m_xQuickStarterFrame->hide(); +#if HAVE_FEATURE_BREAKPAD + m_xPrivacyFrame->show(); #endif #if defined(_WIN32) + // Store-packaged apps (located under the protected Program Files\WindowsApps) can't use normal + // shell shortcuts to their exe. TODO: show a button to open "Startup Apps" system applet? + if (!sal::systools::IsStorePackagedApp()) + m_xQuickStarterFrame->show(); + m_xFileAssocFrame->show(); m_xFileAssocBtn->connect_clicked(LINK(this, OfaMiscTabPage, FileAssocClick)); #endif @@ -272,15 +265,15 @@ bool OfaMiscTabPage::FillItemSet( SfxItemSet* rSet ) m_xPerformFileExtCheck->get_active(), batch); bModified = true; } -#endif - - batch->commit(); if( m_xQuickLaunchCB->get_state_changed_from_saved()) { rSet->Put(SfxBoolItem(SID_ATTR_QUICKLAUNCHER, m_xQuickLaunchCB->get_active())); bModified = true; } +#endif + + batch->commit(); return bModified; } @@ -312,10 +305,9 @@ void OfaMiscTabPage::Reset( const SfxItemSet* rSet ) m_xCrashReport->set_active(officecfg::Office::Common::Misc::CrashReport::get() && CrashReporter::IsDumpEnable()); m_xCrashReport->set_sensitive(!officecfg::Office::Common::Misc::CrashReport::isReadOnly() && CrashReporter::IsDumpEnable()); m_xCrashReport->save_state(); -#else - m_xCrashReport->hide(); #endif +#if defined(_WIN32) const SfxPoolItem* pItem = nullptr; SfxItemState eState = rSet->GetItemState( SID_ATTR_QUICKLAUNCHER, false, &pItem ); if ( SfxItemState::SET == eState ) @@ -328,7 +320,6 @@ void OfaMiscTabPage::Reset( const SfxItemSet* rSet ) m_xQuickLaunchCB->save_state(); -#if defined(_WIN32) m_xPerformFileExtCheck->set_active( officecfg::Office::Common::Misc::PerformFileExtCheck::get()); m_xPerformFileExtCheck->save_state(); diff --git a/cui/source/options/optgdlg.hxx b/cui/source/options/optgdlg.hxx index e13102270bdc..3fbf194afc7c 100644 --- a/cui/source/options/optgdlg.hxx +++ b/cui/source/options/optgdlg.hxx @@ -18,6 +18,7 @@ */ #pragma once #include <memory> +#include <config_features.h> #include <sfx2/tabdlg.hxx> #include <svx/langbox.hxx> @@ -42,11 +43,13 @@ private: std::unique_ptr<weld::Widget> m_xYearFrame; std::unique_ptr<weld::SpinButton> m_xYearValueField; std::unique_ptr<weld::Label> m_xToYearFT; +#if HAVE_FEATURE_BREAKPAD + std::unique_ptr<weld::Widget> m_xPrivacyFrame; std::unique_ptr<weld::CheckButton> m_xCrashReport; +#endif +#if defined(_WIN32) std::unique_ptr<weld::Widget> m_xQuickStarterFrame; - std::unique_ptr<weld::Label> m_xHelpImproveLabel; std::unique_ptr<weld::CheckButton> m_xQuickLaunchCB; -#if defined(_WIN32) std::unique_ptr<weld::Widget> m_xFileAssocFrame; std::unique_ptr<weld::Button> m_xFileAssocBtn; std::unique_ptr<weld::CheckButton> m_xPerformFileExtCheck; diff --git a/cui/uiconfig/ui/optgeneralpage.ui b/cui/uiconfig/ui/optgeneralpage.ui index 2917de27e0b9..ce2743e99b6f 100644 --- a/cui/uiconfig/ui/optgeneralpage.ui +++ b/cui/uiconfig/ui/optgeneralpage.ui @@ -268,7 +268,7 @@ </child> <child> <object class="GtkFrame" id="privacyframe"> - <property name="visible">True</property> + <property name="visible">False</property> <property name="can-focus">False</property> <property name="label-xalign">0</property> <property name="shadow-type">none</property> @@ -318,12 +318,12 @@ </child> <child> <object class="GtkFrame" id="quickstarter"> - <property name="visible">True</property> + <property name="visible">False</property> <property name="can-focus">False</property> <property name="label-xalign">0</property> <property name="shadow-type">none</property> <child> - <!-- n-columns=1 n-rows=2 --> + <!-- n-columns=1 n-rows=1 --> <object class="GtkGrid" id="grid7"> <property name="visible">True</property> <property name="can-focus">False</property> @@ -333,6 +333,7 @@ <child> <object class="GtkCheckButton" id="quicklaunch"> <property name="label" translatable="yes" context="optgeneralpage|quicklaunch">Load %PRODUCTNAME during system start-up</property> + <property name="visible">True</property> <property name="can-focus">True</property> <property name="receives-default">False</property> <property name="no-show-all">True</property> @@ -344,20 +345,6 @@ <property name="top-attach">0</property> </packing> </child> - <child> - <object class="GtkCheckButton" id="systray"> - <property name="label" translatable="yes" context="optgeneralpage|systray">Enable systray Quickstarter</property> - <property name="can-focus">True</property> - <property name="receives-default">False</property> - <property name="no-show-all">True</property> - <property name="use-underline">True</property> - <property name="draw-indicator">True</property> - </object> - <packing> - <property name="left-attach">0</property> - <property name="top-attach">1</property> - </packing> - </child> </object> </child> <child type="label"> |