[Libreoffice-commits] core.git: include/svtools sc/source svtools/source svtools/uiconfig

Xisco Fauli (via logerrit) logerrit at kemper.freedesktop.org
Thu Apr 4 08:54:58 UTC 2019


 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(-)

New commits:
commit d186417395b29a5404aed3f819dd81aa92385f20
Author:     Xisco Fauli <xiscofauli at libreoffice.org>
AuthorDate: Wed Apr 3 18:16:01 2019 +0200
Commit:     Xisco FaulĂ­ <xiscofauli at libreoffice.org>
CommitDate: Thu Apr 4 10:54:31 2019 +0200

    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 at libreoffice.org>

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>


More information about the Libreoffice-commits mailing list