SafeModeDialog: restart in normal mode instead of quitting
Change-Id: I546629656ada6c7a8a15b4dc77a042e1f1106924 Reviewed-on: https://gerrit.libreoffice.org/33059 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Katarina Behrens <Katarina.Behrens@cib.de>
This commit is contained in:
parent
3db1ce30ab
commit
29b13a24cf
@ -37,8 +37,8 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent)
|
|||||||
: Dialog(pParent, "SafeModeDialog", "svx/ui/safemodedialog.ui"),
|
: Dialog(pParent, "SafeModeDialog", "svx/ui/safemodedialog.ui"),
|
||||||
|
|
||||||
mpBtnContinue(),
|
mpBtnContinue(),
|
||||||
mpBtnQuit(),
|
|
||||||
mpBtnRestart(),
|
mpBtnRestart(),
|
||||||
|
mpBtnApply(),
|
||||||
|
|
||||||
mpBoxRestore(),
|
mpBoxRestore(),
|
||||||
mpBoxConfigure(),
|
mpBoxConfigure(),
|
||||||
@ -63,8 +63,8 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent)
|
|||||||
maBackupFileHelper()
|
maBackupFileHelper()
|
||||||
{
|
{
|
||||||
get(mpBtnContinue, "btn_continue");
|
get(mpBtnContinue, "btn_continue");
|
||||||
get(mpBtnQuit, "btn_quit");
|
|
||||||
get(mpBtnRestart, "btn_restart");
|
get(mpBtnRestart, "btn_restart");
|
||||||
|
get(mpBtnApply, "btn_apply");
|
||||||
|
|
||||||
get(mpBoxRestore, "group_restore");
|
get(mpBoxRestore, "group_restore");
|
||||||
get(mpBoxConfigure, "group_configure");
|
get(mpBoxConfigure, "group_configure");
|
||||||
@ -96,8 +96,8 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent)
|
|||||||
mpRadioReset->SetClickHdl(LINK(this, SafeModeDialog, RadioBtnHdl));
|
mpRadioReset->SetClickHdl(LINK(this, SafeModeDialog, RadioBtnHdl));
|
||||||
|
|
||||||
mpBtnContinue->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl));
|
mpBtnContinue->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl));
|
||||||
mpBtnQuit->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl));
|
|
||||||
mpBtnRestart->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl));
|
mpBtnRestart->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl));
|
||||||
|
mpBtnApply->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl));
|
||||||
|
|
||||||
mpCBCheckProfilesafeConfig->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl));
|
mpCBCheckProfilesafeConfig->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl));
|
||||||
mpCBCheckProfilesafeExtensions->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));
|
mpBtnCreateZip->SetClickHdl(LINK(this, SafeModeDialog, CreateZipBtnHdl));
|
||||||
|
|
||||||
// Disable restart btn until some checkbox is active
|
// Disable restart btn until some checkbox is active
|
||||||
mpBtnRestart->Disable();
|
mpBtnApply->Disable();
|
||||||
|
|
||||||
// Check the first radio button and call its handler,
|
// Check the first radio button and call its handler,
|
||||||
// it'll disable the relevant parts
|
// it'll disable the relevant parts
|
||||||
@ -145,8 +145,8 @@ void SafeModeDialog::dispose()
|
|||||||
mpBoxReset.clear();
|
mpBoxReset.clear();
|
||||||
|
|
||||||
mpBtnContinue.clear();
|
mpBtnContinue.clear();
|
||||||
mpBtnQuit.clear();
|
|
||||||
mpBtnRestart.clear();
|
mpBtnRestart.clear();
|
||||||
|
mpBtnApply.clear();
|
||||||
|
|
||||||
mpCBCheckProfilesafeConfig.clear();
|
mpCBCheckProfilesafeConfig.clear();
|
||||||
mpCBCheckProfilesafeExtensions.clear();
|
mpCBCheckProfilesafeExtensions.clear();
|
||||||
@ -318,12 +318,15 @@ IMPL_LINK(SafeModeDialog, DialogBtnHdl, Button*, pBtn, void)
|
|||||||
{
|
{
|
||||||
Close();
|
Close();
|
||||||
}
|
}
|
||||||
else if (pBtn == mpBtnQuit.get())
|
|
||||||
{
|
|
||||||
Close();
|
|
||||||
Application::Quit();
|
|
||||||
}
|
|
||||||
else if (pBtn == mpBtnRestart.get())
|
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();
|
sfx2::SafeMode::putRestartFlag();
|
||||||
Close();
|
Close();
|
||||||
@ -394,7 +397,7 @@ IMPL_LINK(SafeModeDialog, CheckBoxHdl, CheckBox&, /*pCheckBox*/, void)
|
|||||||
mpCBResetCustomizations->IsChecked() ||
|
mpCBResetCustomizations->IsChecked() ||
|
||||||
mpCBResetWholeUserProfile->IsChecked());
|
mpCBResetWholeUserProfile->IsChecked());
|
||||||
|
|
||||||
mpBtnRestart->Enable(bEnable);
|
mpBtnApply->Enable(bEnable);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|
||||||
|
@ -34,8 +34,8 @@ public:
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
VclPtr<Button> mpBtnContinue;
|
VclPtr<Button> mpBtnContinue;
|
||||||
VclPtr<Button> mpBtnQuit;
|
|
||||||
VclPtr<Button> mpBtnRestart;
|
VclPtr<Button> mpBtnRestart;
|
||||||
|
VclPtr<Button> mpBtnApply;
|
||||||
|
|
||||||
VclPtr<VclBox> mpBoxRestore;
|
VclPtr<VclBox> mpBoxRestore;
|
||||||
VclPtr<VclBox> mpBoxConfigure;
|
VclPtr<VclBox> mpBoxConfigure;
|
||||||
|
@ -48,8 +48,8 @@
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="btn_quit">
|
<object class="GtkButton" id="btn_restart">
|
||||||
<property name="label" translatable="yes">_Quit</property>
|
<property name="label" translatable="yes">_Restart in Normal Mode</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
<property name="receives_default">True</property>
|
<property name="receives_default">True</property>
|
||||||
@ -62,7 +62,7 @@
|
|||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
<child>
|
<child>
|
||||||
<object class="GtkButton" id="btn_restart">
|
<object class="GtkButton" id="btn_apply">
|
||||||
<property name="label" translatable="yes">_Apply Changes and Restart</property>
|
<property name="label" translatable="yes">_Apply Changes and Restart</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<property name="can_focus">True</property>
|
<property name="can_focus">True</property>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user