[Libreoffice-commits] core.git: Branch 'libreoffice-6-2' - cui/source include/svtools svtools/source

Libreoffice Gerrit user logerrit at kemper.freedesktop.org
Mon Dec 17 08:45:45 UTC 2018


 cui/source/options/treeopt.cxx           |    5 +++--
 include/svtools/restartdialog.hxx        |    4 ++--
 svtools/source/dialogs/restartdialog.cxx |    6 ++++--
 3 files changed, 9 insertions(+), 6 deletions(-)

New commits:
commit 9be9b4072741ac3c7282f272484df1f65aa2765e
Author:     Mike Kaganski <mike.kaganski at collabora.com>
AuthorDate: Thu Dec 13 14:24:01 2018 +0300
Commit:     Xisco Faulí <xiscofauli at libreoffice.org>
CommitDate: Mon Dec 17 09:45:25 2018 +0100

    tdf#121180: close Options dialog when restart is confirmed
    
    Change-Id: Ieb6e62ca83921abed6b6432d70c6717dadfaaa34
    Reviewed-on: https://gerrit.libreoffice.org/65090
    Reviewed-by: Caolán McNamara <caolanm at redhat.com>
    Tested-by: Jenkins
    Reviewed-by: Mike Kaganski <mike.kaganski at collabora.com>
    (cherry picked from commit 0fa14d58457e9418ff756a0efd66e365c4403a67)
    Reviewed-on: https://gerrit.libreoffice.org/65184
    Reviewed-by: Xisco Faulí <xiscofauli at libreoffice.org>

diff --git a/cui/source/options/treeopt.cxx b/cui/source/options/treeopt.cxx
index a0ced4fccd16..cebb55371923 100644
--- a/cui/source/options/treeopt.cxx
+++ b/cui/source/options/treeopt.cxx
@@ -697,8 +697,9 @@ IMPL_LINK_NOARG(OfaTreeOptionsDialog, ApplyHdl_Impl, Button*, void)
     if ( bNeedsRestart )
     {
         SolarMutexGuard aGuard;
-        ::svtools::executeRestartDialog(comphelper::getProcessComponentContext(),
-                                        GetFrameWeld(), eRestartReason);
+        if (svtools::executeRestartDialog(comphelper::getProcessComponentContext(),
+                                        GetFrameWeld(), eRestartReason))
+            EndDialog(RET_OK);
     }
 }
 
diff --git a/include/svtools/restartdialog.hxx b/include/svtools/restartdialog.hxx
index 750542a37459..f29366c1b592 100644
--- a/include/svtools/restartdialog.hxx
+++ b/include/svtools/restartdialog.hxx
@@ -58,8 +58,8 @@ enum RestartReason {
     RESTART_REASON_NONE
 };
 
-// Must be called with the solar mutex locked:
-SVT_DLLPUBLIC void executeRestartDialog(
+// Must be called with the solar mutex locked; returns if restart was initiated:
+SVT_DLLPUBLIC bool executeRestartDialog(
     css::uno::Reference< css::uno::XComponentContext > const & context,
     weld::Window* parent, RestartReason reason);
 
diff --git a/svtools/source/dialogs/restartdialog.cxx b/svtools/source/dialogs/restartdialog.cxx
index 1de2e09cc014..079cc5e28f21 100644
--- a/svtools/source/dialogs/restartdialog.cxx
+++ b/svtools/source/dialogs/restartdialog.cxx
@@ -90,18 +90,20 @@ IMPL_LINK_NOARG(RestartDialog, hdlNo, weld::Button&, void)
 
 }
 
-void svtools::executeRestartDialog(
+bool svtools::executeRestartDialog(
     css::uno::Reference< css::uno::XComponentContext > const & context,
     weld::Window* parent, RestartReason reason)
 {
     auto xRestartManager = css::task::OfficeRestartManager::get(context);
     if (xRestartManager->isRestartRequested(false))
-        return; // don't try to show another dialog when restart is already in progress
+        return true; // don't try to show another dialog when restart is already in progress
     RestartDialog aDlg(parent, reason);
     if (aDlg.run()) {
         xRestartManager->requestRestart(
             css::uno::Reference< css::task::XInteractionHandler >());
+        return true;
     }
+    return false;
 }
 
 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */


More information about the Libreoffice-commits mailing list