From 29b13a24cf5f0e6e58641d4a55cdfa03c83b68ac Mon Sep 17 00:00:00 2001 From: Katarina Behrens Date: Fri, 13 Jan 2017 23:17:52 +0100 Subject: [PATCH] SafeModeDialog: restart in normal mode instead of quitting Change-Id: I546629656ada6c7a8a15b4dc77a042e1f1106924 Reviewed-on: https://gerrit.libreoffice.org/33059 Reviewed-by: Katarina Behrens Tested-by: Katarina Behrens --- svx/source/dialog/SafeModeDialog.cxx | 25 ++++++++++++++----------- svx/source/dialog/SafeModeDialog.hxx | 2 +- svx/uiconfig/ui/safemodedialog.ui | 6 +++--- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/svx/source/dialog/SafeModeDialog.cxx b/svx/source/dialog/SafeModeDialog.cxx index abc2215a5633..d8b41899cdb4 100644 --- a/svx/source/dialog/SafeModeDialog.cxx +++ b/svx/source/dialog/SafeModeDialog.cxx @@ -37,8 +37,8 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent) : Dialog(pParent, "SafeModeDialog", "svx/ui/safemodedialog.ui"), mpBtnContinue(), - mpBtnQuit(), mpBtnRestart(), + mpBtnApply(), mpBoxRestore(), mpBoxConfigure(), @@ -63,8 +63,8 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent) maBackupFileHelper() { get(mpBtnContinue, "btn_continue"); - get(mpBtnQuit, "btn_quit"); get(mpBtnRestart, "btn_restart"); + get(mpBtnApply, "btn_apply"); get(mpBoxRestore, "group_restore"); get(mpBoxConfigure, "group_configure"); @@ -96,8 +96,8 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent) mpRadioReset->SetClickHdl(LINK(this, SafeModeDialog, RadioBtnHdl)); mpBtnContinue->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl)); - mpBtnQuit->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl)); mpBtnRestart->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl)); + mpBtnApply->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl)); mpCBCheckProfilesafeConfig->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl)); mpCBCheckProfilesafeExtensions->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl)); @@ -112,7 +112,7 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent) mpBtnCreateZip->SetClickHdl(LINK(this, SafeModeDialog, CreateZipBtnHdl)); // Disable restart btn until some checkbox is active - mpBtnRestart->Disable(); + mpBtnApply->Disable(); // Check the first radio button and call its handler, // it'll disable the relevant parts @@ -145,8 +145,8 @@ void SafeModeDialog::dispose() mpBoxReset.clear(); mpBtnContinue.clear(); - mpBtnQuit.clear(); mpBtnRestart.clear(); + mpBtnApply.clear(); mpCBCheckProfilesafeConfig.clear(); mpCBCheckProfilesafeExtensions.clear(); @@ -318,12 +318,15 @@ IMPL_LINK(SafeModeDialog, DialogBtnHdl, Button*, pBtn, void) { Close(); } - else if (pBtn == mpBtnQuit.get()) - { - Close(); - Application::Quit(); - } else if (pBtn == mpBtnRestart.get()) + { + sfx2::SafeMode::putRestartFlag(); + Close(); + uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); + css::task::OfficeRestartManager::get(xContext)->requestRestart( + css::uno::Reference< css::task::XInteractionHandler >()); + } + else if (pBtn == mpBtnApply.get()) { sfx2::SafeMode::putRestartFlag(); Close(); @@ -394,7 +397,7 @@ IMPL_LINK(SafeModeDialog, CheckBoxHdl, CheckBox&, /*pCheckBox*/, void) mpCBResetCustomizations->IsChecked() || mpCBResetWholeUserProfile->IsChecked()); - mpBtnRestart->Enable(bEnable); + mpBtnApply->Enable(bEnable); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/dialog/SafeModeDialog.hxx b/svx/source/dialog/SafeModeDialog.hxx index aebbb8edfcb4..b70265de2c30 100644 --- a/svx/source/dialog/SafeModeDialog.hxx +++ b/svx/source/dialog/SafeModeDialog.hxx @@ -34,8 +34,8 @@ public: private: VclPtr