summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXisco Fauli <xiscofauli@libreoffice.org>2019-04-03 18:16:01 +0200
committerXisco Faulí <xiscofauli@libreoffice.org>2019-04-04 10:54:31 +0200
commitd186417395b29a5404aed3f819dd81aa92385f20 (patch)
tree15a375285ce3cb614fcd0ff8c41e03e78d7f772d
parentc371d8ba8960e7830027d4d8d9155bab94722952 (diff)
tdf#124323: show restart dialog when toggling multi-threaded...
calculation Change-Id: I853ae21d4c085488232a375ef42480453c01880b Reviewed-on: https://gerrit.libreoffice.org/70210 Tested-by: Jenkins Reviewed-by: Xisco Faulí <xiscofauli@libreoffice.org>
-rw-r--r--include/svtools/restartdialog.hxx3
-rw-r--r--sc/source/ui/optdlg/tpcalc.cxx6
-rw-r--r--svtools/source/dialogs/restartdialog.cxx3
-rw-r--r--svtools/uiconfig/ui/restartdialog.ui19
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 <docoptio.hxx>
#include <sc.hrc>
#include <officecfg/Office/Calc.hxx>
+#include <svtools/restartdialog.hxx>
#include <tpcalc.hxx>
@@ -206,6 +207,11 @@ bool ScTpCalcOptions::FillItemSet( SfxItemSet* rCoreAttrs )
std::shared_ptr<comphelper::ConfigurationChanges> 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
@@ -244,6 +244,21 @@
</packing>
</child>
<child>
+ <object class="GtkLabel" id="reason_threading">
+ <property name="can_focus">False</property>
+ <property name="no_show_all">True</property>
+ <property name="label" translatable="yes" context="restartdialog|reason_threading">For the multi-threaded calculation changes to take effect, %PRODUCTNAME must be restarted.</property>
+ <property name="wrap">True</property>
+ <property name="max_width_chars">50</property>
+ <property name="xalign">0</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">12</property>
+ </packing>
+ </child>
+ <child>
<object class="GtkLabel" id="reason_mscompatible_formsmenu">
<property name="can_focus">False</property>
<property name="no_show_all">True</property>
@@ -255,7 +270,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">12</property>
+ <property name="position">13</property>
</packing>
</child>
<child>
@@ -269,7 +284,7 @@
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
- <property name="position">13</property>
+ <property name="position">14</property>
</packing>
</child>
</object>