Kaydet (Commit) d1864173 authored tarafından Xisco Fauli's avatar Xisco Fauli Kaydeden (comit) Xisco Faulí

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: 's avatarXisco Faulí <xiscofauli@libreoffice.org>
üst c371d8ba
......@@ -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,
......
......@@ -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 )
{
......
......@@ -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;
......
......@@ -243,6 +243,21 @@
<property name="position">11</property>
</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>
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment