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

irem iremsendur1 at gmail.com
Mon May 23 08:35:02 UTC 2016


 cui/source/options/optjava.cxx           |   15 ++++++----
 include/svtools/restartdialog.hxx        |   11 ++++++-
 svtools/source/dialogs/restartdialog.cxx |    9 ++++++
 svtools/uiconfig/ui/restartdialog.ui     |   45 +++++++++++++++++++++++++++++++
 4 files changed, 73 insertions(+), 7 deletions(-)

New commits:
commit a4e8419c8a1eb3e56ef973de4b15fdafc91248a2
Author: irem <iremsendur1 at gmail.com>
Date:   Wed May 11 10:42:17 2016 +0300

    tdf#99211 Use the restart dialog for notifications about restart
    
    Change-Id: I97a10cddafc464ccbdd37902c5d24b73246f5c3f
    Reviewed-on: https://gerrit.libreoffice.org/24877
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Caolán McNamara <caolanm at redhat.com>

diff --git a/cui/source/options/optjava.cxx b/cui/source/options/optjava.cxx
index 44f9ccf..20a651b 100644
--- a/cui/source/options/optjava.cxx
+++ b/cui/source/options/optjava.cxx
@@ -55,6 +55,9 @@
 
 #define CLASSPATH_DELIMITER SAL_PATHSEPARATOR
 
+#include <svtools/restartdialog.hxx>
+#include <comphelper/solarmutex.hxx>
+
 using namespace ::com::sun::star::lang;
 using namespace ::com::sun::star::ucb;
 using namespace ::com::sun::star::ui::dialogs;
@@ -329,8 +332,8 @@ IMPL_LINK_NOARG_TYPED(SvxJavaOptionsPage, ParameterHdl_Impl, Button*, void)
             (void)eErr;
             if ( bRunning )
             {
-                ScopedVclPtrInstance< MessageDialog > aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO );
-                aWarnBox->Execute();
+                SolarMutexGuard aGuard;
+                svtools::executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, svtools::RESTART_REASON_ASSIGNING_JAVAPARAMETERS);
             }
         }
     }
@@ -374,8 +377,8 @@ IMPL_LINK_NOARG_TYPED(SvxJavaOptionsPage, ClassPathHdl_Impl, Button*, void)
             (void)eErr;
             if ( bRunning )
             {
-                ScopedVclPtrInstance< MessageDialog > aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO );
-                aWarnBox->Execute();
+                SolarMutexGuard aGuard;
+                svtools::executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, svtools::RESTART_REASON_ASSIGNING_FOLDERS);
             }
         }
     }
@@ -650,8 +653,8 @@ bool SvxJavaOptionsPage::FillItemSet( SfxItemSet* /*rCoreSet*/ )
         SvtMiscOptions aMiscOpt;
         aMiscOpt.SetExperimentalMode( m_pExperimentalCB->IsChecked() );
         bModified = true;
-        ScopedVclPtrInstance< MessageDialog > aWarnBox( this, CUI_RES( RID_SVXSTR_OPTIONS_RESTART ), VCL_MESSAGE_INFO );
-        aWarnBox->Execute();
+        SolarMutexGuard aGuard;
+        svtools::executeRestartDialog(comphelper::getProcessComponentContext(), nullptr, svtools::RESTART_REASON_EXP_FEATURES);
     }
 
     if ( m_pMacroCB->IsValueChangedFromSaved() )
diff --git a/include/svtools/restartdialog.hxx b/include/svtools/restartdialog.hxx
index 78f29b9..e04f5f6 100644
--- a/include/svtools/restartdialog.hxx
+++ b/include/svtools/restartdialog.hxx
@@ -38,9 +38,18 @@ enum RestartReason {
     RESTART_REASON_LANGUAGE_CHANGE,
         // "For the updated language settings to take effect,
         // %PRODUCTNAME must be restarted."
-    RESTART_REASON_ADDING_PATH
+    RESTART_REASON_ADDING_PATH,
         // "For the added path to take effect,
         // %PRODUCTNAME must be restarted."
+    RESTART_REASON_ASSIGNING_JAVAPARAMETERS,
+        // "For the assigned java parameters to take effect,
+        // %PRODUCTNAME must be restarted."
+    RESTART_REASON_ASSIGNING_FOLDERS,
+        // "For the assigned folders and archives to take effect,
+        // %PRODUCTNAME must be restarted."
+    RESTART_REASON_EXP_FEATURES
+        // "For the modified experimental features 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 99c0fd8..bc6c3f7 100644
--- a/svtools/source/dialogs/restartdialog.cxx
+++ b/svtools/source/dialogs/restartdialog.cxx
@@ -49,6 +49,15 @@ public:
         case svtools::RESTART_REASON_ADDING_PATH:
             get(reason_, "reason_adding_path");
             break;
+        case svtools::RESTART_REASON_ASSIGNING_JAVAPARAMETERS:
+            get(reason_, "reason_assigning_javaparameters");
+            break;
+        case svtools::RESTART_REASON_ASSIGNING_FOLDERS:
+            get(reason_, "reason_assigning_folders");
+            break;
+        case svtools::RESTART_REASON_EXP_FEATURES:
+            get(reason_,"reason_exp_features");
+            break;
         default:
             assert(false); // this cannot happen
         }
diff --git a/svtools/uiconfig/ui/restartdialog.ui b/svtools/uiconfig/ui/restartdialog.ui
index 0d94b81..03584e6 100644
--- a/svtools/uiconfig/ui/restartdialog.ui
+++ b/svtools/uiconfig/ui/restartdialog.ui
@@ -151,6 +151,51 @@
               </packing>
             </child>
             <child>
+              <object class="GtkLabel" id="reason_assigning_javaparameters">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">For the assigned Java parameters 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">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="reason_assigning_folders">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">For the assigned folders and archives 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">4</property>
+              </packing>
+            </child>
+            <child>
+              <object class="GtkLabel" id="reason_exp_features">
+                <property name="can_focus">False</property>
+                <property name="no_show_all">True</property>
+                <property name="xalign">0</property>
+                <property name="label" translatable="yes">For the modified experimental features 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">5</property>
+              </packing>
+            </child>
+            <child>
               <object class="GtkLabel" id="label">
                 <property name="visible">True</property>
                 <property name="can_focus">False</property>


More information about the Libreoffice-commits mailing list