summaryrefslogtreecommitdiff
path: root/cui
diff options
context:
space:
mode:
authorStephan Bergmann <stephan.bergmann@allotropia.de>2024-04-10 13:30:59 +0200
committerStephan Bergmann <stephan.bergmann@allotropia.de>2024-04-10 14:54:41 +0200
commitfe66cf8c8048bfd8a4386c0c711bd6912af9ec63 (patch)
tree52bd8db9ed56b7dbd641ad8895d8d59ba38c8f36 /cui
parent7f9a35e6efc4118ecc46fa6f76fc5a812259eea1 (diff)
New Expert Configuration setting to not offer Safe Mode in the UI
/org.openoffice.Office/Common/Misc/OfferSafeMode (default: true), controlling: * "Help - Restart in Safe Mode..." menu entry * "Restart LibreOffice to enter safe mode" checkbox in the "Crash Report" dialog * "To start temporarily with a fresh user profile,..." tip of the day (It does not control the --safe-mode command line argument, though.) Change-Id: I66084448a1ba9427aaafef630187b4bf25219a2c Reviewed-on: https://gerrit.libreoffice.org/c/core/+/165926 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <stephan.bergmann@allotropia.de>
Diffstat (limited to 'cui')
-rw-r--r--cui/source/dialogs/tipofthedaydlg.cxx17
1 files changed, 15 insertions, 2 deletions
diff --git a/cui/source/dialogs/tipofthedaydlg.cxx b/cui/source/dialogs/tipofthedaydlg.cxx
index bbb26a054be9..40bb606130f2 100644
--- a/cui/source/dialogs/tipofthedaydlg.cxx
+++ b/cui/source/dialogs/tipofthedaydlg.cxx
@@ -121,8 +121,21 @@ void TipOfTheDayDialog::UpdateTip()
{
constexpr sal_Int32 nNumberOfTips = std::size(TIPOFTHEDAY_STRINGARRAY);
- if ((m_nCurrentTip >= nNumberOfTips) || (m_nCurrentTip < 0))
- m_nCurrentTip = 0;
+ for (;;)
+ {
+ if ((m_nCurrentTip >= nNumberOfTips) || (m_nCurrentTip < 0))
+ m_nCurrentTip = 0;
+ if (std::get<1>(TIPOFTHEDAY_STRINGARRAY[m_nCurrentTip])
+ == "svx/ui/safemodedialog/SafeModeDialog"
+ && !officecfg::Office::Common::Misc::OfferSafeMode::get())
+ {
+ ++m_nCurrentTip;
+ }
+ else
+ {
+ break;
+ }
+ }
//title
m_xDialog->set_title(CuiResId(STR_TITLE)