From d186417395b29a5404aed3f819dd81aa92385f20 Mon Sep 17 00:00:00 2001 From: Xisco Fauli Date: Wed, 3 Apr 2019 18:16:01 +0200 Subject: tdf#124323: show restart dialog when toggling multi-threaded... MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit calculation Change-Id: I853ae21d4c085488232a375ef42480453c01880b Reviewed-on: https://gerrit.libreoffice.org/70210 Tested-by: Jenkins Reviewed-by: Xisco FaulĂ­ --- include/svtools/restartdialog.hxx | 3 +++ sc/source/ui/optdlg/tpcalc.cxx | 6 ++++++ svtools/source/dialogs/restartdialog.cxx | 3 +++ svtools/uiconfig/ui/restartdialog.ui | 19 +++++++++++++++++-- 4 files changed, 29 insertions(+), 2 deletions(-) diff --git a/include/svtools/restartdialog.hxx b/include/svtools/restartdialog.hxx index 2e7c481e1ef7..83b0a8cad218 100644 --- a/include/svtools/restartdialog.hxx +++ b/include/svtools/restartdialog.hxx @@ -60,6 +60,9 @@ enum RestartReason { // For the OpenCL changes to take effect, // %PRODUCTNAME must be restarted: RESTART_REASON_OPENCL, + // For the multi-threaded calculation changes to take effect, + // %PRODUCTNAME must be restarted: + RESTART_REASON_THREADING, // For restructuring the Forms menu, // %PRODUCTNAME must be restarted: RESTART_REASON_MSCOMPATIBLE_FORMS_MENU, diff --git a/sc/source/ui/optdlg/tpcalc.cxx b/sc/source/ui/optdlg/tpcalc.cxx index cc29f7ce7789..5f294aa51d68 100644 --- a/sc/source/ui/optdlg/tpcalc.cxx +++ b/sc/source/ui/optdlg/tpcalc.cxx @@ -27,6 +27,7 @@ #include #include #include +#include #include @@ -206,6 +207,11 @@ bool ScTpCalcOptions::FillItemSet( SfxItemSet* rCoreAttrs ) std::shared_ptr xBatch(comphelper::ConfigurationChanges::create()); officecfg::Office::Calc::Formula::Calculation::UseThreadedCalculationForFormulaGroups::set(bShouldEnableThreading, xBatch); xBatch->commit(); + SolarMutexGuard aGuard; + if (svtools::executeRestartDialog( + comphelper::getProcessComponentContext(), GetFrameWeld(), + svtools::RESTART_REASON_THREADING)) + GetParentDialog()->EndDialog(RET_OK); } if ( *pLocalOptions != *pOldOptions ) { diff --git a/svtools/source/dialogs/restartdialog.cxx b/svtools/source/dialogs/restartdialog.cxx index 3e665ede47c0..23a7f592f54e 100644 --- a/svtools/source/dialogs/restartdialog.cxx +++ b/svtools/source/dialogs/restartdialog.cxx @@ -65,6 +65,9 @@ public: case svtools::RESTART_REASON_OPENCL: reason_ = m_xBuilder->weld_widget("reason_opencl"); break; + case svtools::RESTART_REASON_THREADING: + reason_ = m_xBuilder->weld_widget("reason_threading"); + break; case svtools::RESTART_REASON_MSCOMPATIBLE_FORMS_MENU: reason_ = m_xBuilder->weld_widget("reason_mscompatible_formsmenu"); break; diff --git a/svtools/uiconfig/ui/restartdialog.ui b/svtools/uiconfig/ui/restartdialog.ui index 5962da9940bc..6db5793a260b 100644 --- a/svtools/uiconfig/ui/restartdialog.ui +++ b/svtools/uiconfig/ui/restartdialog.ui @@ -243,6 +243,21 @@ 11 + + + False + True + For the multi-threaded calculation changes to take effect, %PRODUCTNAME must be restarted. + True + 50 + 0 + + + False + True + 12 + + False @@ -255,7 +270,7 @@ False True - 12 + 13 @@ -269,7 +284,7 @@ False True - 13 + 14 -- cgit