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

Berk Gureken berkgureken at gmail.com
Mon Apr 11 07:11:44 UTC 2016


 cui/source/options/optgdlg.cxx           |    8 ++++++--
 include/svtools/restartdialog.hxx        |    5 ++++-
 svtools/source/dialogs/restartdialog.cxx |    3 +++
 svtools/uiconfig/ui/restartdialog.ui     |   23 +++++++++++++++++++----
 4 files changed, 32 insertions(+), 7 deletions(-)

New commits:
commit cf81f3ba0602eeffad8907a1bb9cdd24e62c2d1e
Author: Berk Gureken <berkgureken at gmail.com>
Date:   Tue Mar 22 07:15:05 2016 +0200

    tdf#79656 Restart now window for language change
    
    When you change the UI language and click OK,
    Restart Now window opens instead of warning window.
    
    Change-Id: Ic503bf4536a855891456f48745b748786857200f
    Reviewed-on: https://gerrit.libreoffice.org/23421
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Jan Holesovsky <kendy at collabora.com>

diff --git a/cui/source/options/optgdlg.cxx b/cui/source/options/optgdlg.cxx
index 52ef10e..396d1ee 100644
--- a/cui/source/options/optgdlg.cxx
+++ b/cui/source/options/optgdlg.cxx
@@ -97,6 +97,8 @@
 #include <svx/ofaitem.hxx>
 #include <svtools/apearcfg.hxx>
 #include <svtools/optionsdrawinglayer.hxx>
+#include <svtools/restartdialog.hxx>
+#include <comphelper/solarmutex.hxx>
 
 #include <config_vclplug.h>
 
@@ -1285,8 +1287,10 @@ bool OfaLanguagesTabPage::FillItemSet( SfxItemSet* rSet )
             xProp->setPropertyValue(sUserLocaleKey, makeAny(aLangString));
             Reference< XChangesBatch >(xProp, UNO_QUERY_THROW)->commitChanges();
             // display info
-            ScopedVclPtrInstance< MessageDialog > aBox(this, CUI_RES(RID_SVXSTR_LANGUAGE_RESTART), VCL_MESSAGE_INFO);
-            aBox->Execute();
+            SolarMutexGuard aGuard;
+            svtools::executeRestartDialog(
+                comphelper::getProcessComponentContext(), nullptr,
+                svtools::RESTART_REASON_LANGUAGE_CHANGE);
 
             // tell quickstarter to stop being a veto listener
 
diff --git a/include/svtools/restartdialog.hxx b/include/svtools/restartdialog.hxx
index e1ca07d..d90ec4d 100644
--- a/include/svtools/restartdialog.hxx
+++ b/include/svtools/restartdialog.hxx
@@ -32,9 +32,12 @@ enum RestartReason {
     RESTART_REASON_BIBLIOGRAPHY_INSTALL,
         // "For the bibliography to work properly,
         // %PRODUCTNAME must be restarted."
-    RESTART_REASON_MAILMERGE_INSTALL
+    RESTART_REASON_MAILMERGE_INSTALL,
         // "For the mail merge to work properly,
         // %PRODUCTNAME must be restarted."
+    RESTART_REASON_LANGUAGE_CHANGE
+        // "For the updated language settings to take effect,
+        // %PRODUCTNAME must be restarted."
 };
 
 // Must be called with the solar mutex locked:
diff --git a/svtools/source/dialogs/restartdialog.cxx b/svtools/source/dialogs/restartdialog.cxx
index 0ff1340..3b9df0f 100644
--- a/svtools/source/dialogs/restartdialog.cxx
+++ b/svtools/source/dialogs/restartdialog.cxx
@@ -43,6 +43,9 @@ public:
         case svtools::RESTART_REASON_MAILMERGE_INSTALL:
             get(reason_, "reason_mailmerge_install");
             break;
+        case svtools::RESTART_REASON_LANGUAGE_CHANGE:
+            get(reason_, "reason_language_change");
+            break;
         default:
             assert(false); // this cannot happen
         }
diff --git a/svtools/uiconfig/ui/restartdialog.ui b/svtools/uiconfig/ui/restartdialog.ui
index 9e4b984..2dc71d7 100644
--- a/svtools/uiconfig/ui/restartdialog.ui
+++ b/svtools/uiconfig/ui/restartdialog.ui
@@ -91,6 +91,21 @@
               </packing>
             </child>
             <child>
+              <object class="GtkLabel" id="reason_mailmerge_install">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">For mail merge to work properly, %PRODUCTNAME must be restarted.</property>
+                <property name="wrap">True</property>
+                <property name="max_width_chars">50</property>
+              </object>
+              <packing>
+                <property name="expand">False</property>
+                <property name="fill">True</property>
+                <property name="position">2</property>
+              </packing>
+            </child>
+            <child>
               <object class="GtkLabel" id="reason_bibliography_install">
                 <property name="can_focus">False</property>
                 <property name="no_show_all">True</property>
@@ -106,18 +121,18 @@
               </packing>
             </child>
             <child>
-              <object class="GtkLabel" id="reason_mailmerge_install">
+              <object class="GtkLabel" id="reason_language_change">
                 <property name="can_focus">False</property>
                 <property name="no_show_all">True</property>
                 <property name="xalign">0</property>
-                <property name="label" translatable="yes">For mail merge to work properly, %PRODUCTNAME must be restarted.</property>
+                <property name="label" translatable="yes">For the updated language settings to take effect, %PRODUCTNAME must be restarted.</property>
                 <property name="wrap">True</property>
                 <property name="max_width_chars">50</property>
               </object>
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">2</property>
+                <property name="position">3</property>
               </packing>
             </child>
             <child>
@@ -131,7 +146,7 @@
               <packing>
                 <property name="expand">False</property>
                 <property name="fill">True</property>
-                <property name="position">3</property>
+                <property name="position">5</property>
               </packing>
             </child>
           </object>


More information about the Libreoffice-commits mailing list