diff options
author | Tünde Tóth <toth.tunde@nisz.hu> | 2022-05-31 16:11:03 +0200 |
---|---|---|
committer | László Németh <nemeth@numbertext.org> | 2022-06-23 17:07:00 +0200 |
commit | 18cc891483fef63ad168273658a30bff72b87a95 (patch) | |
tree | f0cca081ee60f61fa0660ea77d595ae3cd1d08d6 /cui | |
parent | 4142d728f003166ebe520bfdaf672505e585b807 (diff) |
tdf#149401 show "Restart LibreOffice" dialog changing AutoRecovery
Changing "Save Autorecovery... information every ... minutes"
option in Tools->Options...->Load/Save->General shows that
dialog window to warn about its work.
Change-Id: I91ae72ea1e52ec5c6d9286a43cd986386636076c
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/135221
Tested-by: László Németh <nemeth@numbertext.org>
Reviewed-by: László Németh <nemeth@numbertext.org>
Diffstat (limited to 'cui')
-rw-r--r-- | cui/source/options/optsave.cxx | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/cui/source/options/optsave.cxx b/cui/source/options/optsave.cxx index 717fa623a668..43468715cd3a 100644 --- a/cui/source/options/optsave.cxx +++ b/cui/source/options/optsave.cxx @@ -25,6 +25,7 @@ #include <svl/eitem.hxx> #include <svl/intitem.hxx> #include "optsave.hxx" +#include <treeopt.hxx> #include <officecfg/Office/Common.hxx> #include <comphelper/processfactory.hxx> #include <unotools/moduleoptions.hxx> @@ -37,6 +38,7 @@ #include <com/sun/star/beans/PropertyValue.hpp> #include <sfx2/sfxsids.hrc> #include <sfx2/docfilt.hxx> +#include <svtools/restartdialog.hxx> #include <unotools/optionsdlg.hxx> #include <osl/diagnose.h> #include <tools/diagnose_ex.h> @@ -225,7 +227,7 @@ void SvxSaveTabPage::DetectHiddenControls() bool SvxSaveTabPage::FillItemSet( SfxItemSet* rSet ) { auto xChanges = comphelper::ConfigurationChanges::create(); - bool bModified = false; + bool bModified = false, bRequestRestart = false; if(m_xLoadUserSettingsCB->get_state_changed_from_saved()) officecfg::Office::Common::Load::UserDefinedSettings::set(m_xLoadUserSettingsCB->get_active(), xChanges); @@ -255,7 +257,7 @@ bool SvxSaveTabPage::FillItemSet( SfxItemSet* rSet ) { rSet->Put( SfxBoolItem( SID_ATTR_AUTOSAVE, m_xAutoSaveCB->get_active() ) ); - bModified = true; + bModified = bRequestRestart = true; } if ( m_xWarnAlienFormatCB->get_state_changed_from_saved() ) { @@ -268,7 +270,7 @@ bool SvxSaveTabPage::FillItemSet( SfxItemSet* rSet ) { rSet->Put( SfxUInt16Item( SID_ATTR_AUTOSAVEMINUTE, static_cast<sal_uInt16>(m_xAutoSaveEdit->get_value()) ) ); - bModified = true; + bModified = bRequestRestart = true; } if ( m_xUserAutoSaveCB->get_state_changed_from_saved() ) @@ -322,6 +324,14 @@ bool SvxSaveTabPage::FillItemSet( SfxItemSet* rSet ) aModuleOpt.SetFactoryDefaultFilter(SvtModuleOptions::EFactory::WRITERGLOBAL, pImpl->aDefaultArr[APP_WRITER_GLOBAL]); xChanges->commit(); + + if (bRequestRestart) + { + OfaTreeOptionsDialog* pParentDlg(static_cast<OfaTreeOptionsDialog*>(GetDialogController())); + if (pParentDlg) + pParentDlg->SetNeedsRestart(svtools::RESTART_REASON_SAVE); + } + return bModified; } |