Kaydet (Commit) 9be9b407 authored tarafından Mike Kaganski's avatar Mike Kaganski Kaydeden (comit) Xisco Faulí

tdf#121180: close Options dialog when restart is confirmed

Change-Id: Ieb6e62ca83921abed6b6432d70c6717dadfaaa34
Reviewed-on: https://gerrit.libreoffice.org/65090Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: Jenkins
Reviewed-by: 's avatarMike Kaganski <mike.kaganski@collabora.com>
(cherry picked from commit 0fa14d58)
Reviewed-on: https://gerrit.libreoffice.org/65184Reviewed-by: 's avatarXisco Faulí <xiscofauli@libreoffice.org>
üst 112c73ef
...@@ -697,8 +697,9 @@ IMPL_LINK_NOARG(OfaTreeOptionsDialog, ApplyHdl_Impl, Button*, void) ...@@ -697,8 +697,9 @@ IMPL_LINK_NOARG(OfaTreeOptionsDialog, ApplyHdl_Impl, Button*, void)
if ( bNeedsRestart ) if ( bNeedsRestart )
{ {
SolarMutexGuard aGuard; SolarMutexGuard aGuard;
::svtools::executeRestartDialog(comphelper::getProcessComponentContext(), if (svtools::executeRestartDialog(comphelper::getProcessComponentContext(),
GetFrameWeld(), eRestartReason); GetFrameWeld(), eRestartReason))
EndDialog(RET_OK);
} }
} }
......
...@@ -58,8 +58,8 @@ enum RestartReason { ...@@ -58,8 +58,8 @@ enum RestartReason {
RESTART_REASON_NONE RESTART_REASON_NONE
}; };
// Must be called with the solar mutex locked: // Must be called with the solar mutex locked; returns if restart was initiated:
SVT_DLLPUBLIC void executeRestartDialog( SVT_DLLPUBLIC bool executeRestartDialog(
css::uno::Reference< css::uno::XComponentContext > const & context, css::uno::Reference< css::uno::XComponentContext > const & context,
weld::Window* parent, RestartReason reason); weld::Window* parent, RestartReason reason);
......
...@@ -90,18 +90,20 @@ IMPL_LINK_NOARG(RestartDialog, hdlNo, weld::Button&, void) ...@@ -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, css::uno::Reference< css::uno::XComponentContext > const & context,
weld::Window* parent, RestartReason reason) weld::Window* parent, RestartReason reason)
{ {
auto xRestartManager = css::task::OfficeRestartManager::get(context); auto xRestartManager = css::task::OfficeRestartManager::get(context);
if (xRestartManager->isRestartRequested(false)) 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); RestartDialog aDlg(parent, reason);
if (aDlg.run()) { if (aDlg.run()) {
xRestartManager->requestRestart( xRestartManager->requestRestart(
css::uno::Reference< css::task::XInteractionHandler >()); css::uno::Reference< css::task::XInteractionHandler >());
return true;
} }
return false;
} }
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
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