Permalink
Browse files

SafeModeDialog: Group options

Change-Id: Ife0903c90f17efb2a1c6681ece8dd9af257873cd
Reviewed-on: https://gerrit.libreoffice.org/30453
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
  • Loading branch information...
1 parent 69de2b4 commit e13827070cdcdf7bbf96678e7527c684519124d8 @smehrbrodt smehrbrodt committed Nov 1, 2016
Showing with 262 additions and 91 deletions.
  1. +103 −37 svx/source/dialog/SafeModeDialog.cxx
  2. +10 −0 svx/source/dialog/SafeModeDialog.hxx
  3. +149 −54 svx/uiconfig/ui/safemodedialog.ui
@@ -37,6 +37,14 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent)
mpBtnQuit(),
mpBtnRestart(),
+ mpBoxRestore(),
+ mpBoxConfigure(),
+ mpBoxReset(),
+
+ mpRadioRestore(),
+ mpRadioConfigure(),
+ mpRadioReset(),
+
mpCBCheckProfilesafeConfig(),
mpCBCheckProfilesafeExtensions(),
mpCBDisableAllExtensions(),
@@ -52,6 +60,14 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent)
get(mpBtnQuit, "btn_quit");
get(mpBtnRestart, "btn_restart");
+ get(mpBoxRestore, "group_restore");
+ get(mpBoxConfigure, "group_configure");
+ get(mpBoxReset, "group_reset");
+
+ get(mpRadioRestore, "radio_restore");
+ get(mpRadioConfigure, "radio_configure");
+ get(mpRadioReset, "radio_reset");
+
get(mpCBCheckProfilesafeConfig, "check_profilesafe_config");
get(mpCBCheckProfilesafeExtensions, "check_profilesafe_extensions");
get(mpCBDisableAllExtensions, "check_disable_all_extensions");
@@ -64,6 +80,10 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent)
get(mpBugLink, "linkbutton_bugs");
get(mpUserProfileLink, "linkbutton_profile");
+ mpRadioRestore->SetClickHdl(LINK(this, SafeModeDialog, RadioBtnHdl));
+ mpRadioConfigure->SetClickHdl(LINK(this, SafeModeDialog, RadioBtnHdl));
+ mpRadioReset->SetClickHdl(LINK(this, SafeModeDialog, RadioBtnHdl));
+
mpBtnContinue->SetClickHdl(LINK(this, SafeModeDialog, BtnHdl));
mpBtnQuit->SetClickHdl(LINK(this, SafeModeDialog, BtnHdl));
mpBtnRestart->SetClickHdl(LINK(this, SafeModeDialog, BtnHdl));
@@ -109,9 +129,13 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent)
{
mpCBResetCustomizations->Disable();
}
-
// no disabe of mpCBResetWholeUserProfile, always possible (as last choice)
+ // Check the first radio button and disable the other parts
+ mpRadioRestore->Check();
+ mpBoxConfigure->Disable();
+ mpBoxReset->Disable();
+
// Set URL for help button (module=safemode)
OUString sURL("http://hub.libreoffice.org/send-feedback/?LOversion=" + utl::ConfigManager::getAboutBoxProductVersion() +
"&LOlocale=" + utl::ConfigManager::getLocale() + "&LOmodule=safemode");
@@ -127,6 +151,14 @@ SafeModeDialog::~SafeModeDialog()
void SafeModeDialog::dispose()
{
+ mpRadioRestore.clear();
+ mpRadioConfigure.clear();
+ mpRadioReset.clear();
+
+ mpBoxRestore.clear();
+ mpBoxConfigure.clear();
+ mpBoxReset.clear();
+
mpBtnContinue.clear();
mpBtnQuit.clear();
mpBtnRestart.clear();
@@ -156,58 +188,92 @@ bool SafeModeDialog::Close()
void SafeModeDialog::applyChanges()
{
- if (mpCBCheckProfilesafeConfig->IsChecked())
- {
- // reset UserConfiguration to last known working state
- // ProfileSafeMode/BackupFileHelper
- maBackupFileHelper.tryPop();
- }
-
- if (mpCBCheckProfilesafeExtensions->IsChecked())
+ /// Restore
+ if (mpRadioRestore->IsChecked())
{
- // reset State of installed Extensions to last known working state
- // ProfileSafeMode/BackupFileHelper
- maBackupFileHelper.tryPopExtensionInfo();
+ if (mpCBCheckProfilesafeConfig->IsChecked())
+ {
+ // reset UserConfiguration to last known working state
+ // ProfileSafeMode/BackupFileHelper
+ maBackupFileHelper.tryPop();
+ }
+
+ if (mpCBCheckProfilesafeExtensions->IsChecked())
+ {
+ // reset State of installed Extensions to last known working state
+ // ProfileSafeMode/BackupFileHelper
+ maBackupFileHelper.tryPopExtensionInfo();
+ }
}
- if (mpCBDisableAllExtensions->IsChecked())
+ // Configure
+ if (mpRadioConfigure->IsChecked())
{
- // Disable all extensions
- comphelper::BackupFileHelper::tryDisableAllExtensions();
+ if (mpCBDisableAllExtensions->IsChecked())
+ {
+ // Disable all extensions
+ comphelper::BackupFileHelper::tryDisableAllExtensions();
+ }
+
+ if (mpCBDeinstallUserExtensions->IsChecked())
+ {
+ // Deinstall all User Extensions (installed for User only)
+ comphelper::BackupFileHelper::tryDeinstallUserExtensions();
+ }
+
+ if (mpCBDeinstallAllExtensions->IsChecked())
+ {
+ // Deinstall all Extensions (user|shared|bundled)
+ comphelper::BackupFileHelper::tryDeinstallAllExtensions();
+ }
+
+ if (mpCBDisableHWAcceleration->IsChecked())
+ {
+ comphelper::BackupFileHelper::tryDisableHWAcceleration();
+ }
}
- if (mpCBDeinstallUserExtensions->IsChecked())
+ // Reset
+ if (mpRadioReset->IsChecked())
{
- // Deinstall all User Extensions (installed for User only)
- comphelper::BackupFileHelper::tryDeinstallUserExtensions();
+ if (mpCBResetCustomizations->IsChecked())
+ {
+ // Reset customizations (Settings and UserInterface modifications)
+ comphelper::BackupFileHelper::tryResetCustomizations();
+ }
+
+ if (mpCBResetWholeUserProfile->IsChecked())
+ {
+ // Reset the whole UserProfile
+ comphelper::BackupFileHelper::tryResetUserProfile();
+ }
}
- if (mpCBDeinstallAllExtensions->IsChecked())
- {
- // Deinstall all Extensions (user|shared|bundled)
- comphelper::BackupFileHelper::tryDeinstallAllExtensions();
- }
+ // Then restart
+ css::task::OfficeRestartManager::get(comphelper::getProcessComponentContext())->requestRestart(
+ css::uno::Reference< css::task::XInteractionHandler >());
+}
- if (mpCBDisableHWAcceleration->IsChecked())
+IMPL_LINK(SafeModeDialog, RadioBtnHdl, Button*, pBtn, void)
+{
+ if (pBtn == mpRadioConfigure.get())
{
- comphelper::BackupFileHelper::tryDisableHWAcceleration();
+ mpBoxConfigure->Enable();
+ mpBoxRestore->Disable();
+ mpBoxReset->Disable();
}
-
- if (mpCBResetCustomizations->IsChecked())
+ else if (pBtn == mpRadioReset.get())
{
- // Reset customizations (Settings and UserInterface modifications)
- comphelper::BackupFileHelper::tryResetCustomizations();
+ mpBoxReset->Enable();
+ mpBoxConfigure->Disable();
+ mpBoxRestore->Disable();
}
-
- if (mpCBResetWholeUserProfile->IsChecked())
+ else if (pBtn == mpRadioRestore.get())
{
- // Reset the whole UserProfile
- comphelper::BackupFileHelper::tryResetUserProfile();
+ mpBoxRestore->Enable();
+ mpBoxReset->Disable();
+ mpBoxConfigure->Disable();
}
-
- // Then restart
- css::task::OfficeRestartManager::get(comphelper::getProcessComponentContext())->requestRestart(
- css::uno::Reference< css::task::XInteractionHandler >());
}
IMPL_LINK(SafeModeDialog, BtnHdl, Button*, pBtn, void)
@@ -12,6 +12,7 @@
#include <vcl/dialog.hxx>
#include <vcl/button.hxx>
+#include <vcl/layout.hxx>
#include <vcl/fixed.hxx>
#include <vcl/edit.hxx>
#include <vcl/vclmedit.hxx>
@@ -36,6 +37,14 @@ private:
VclPtr<Button> mpBtnQuit;
VclPtr<Button> mpBtnRestart;
+ VclPtr<VclBox> mpBoxRestore;
+ VclPtr<VclBox> mpBoxConfigure;
+ VclPtr<VclBox> mpBoxReset;
+
+ VclPtr<RadioButton> mpRadioRestore;
+ VclPtr<RadioButton> mpRadioConfigure;
+ VclPtr<RadioButton> mpRadioReset;
+
VclPtr<CheckBox> mpCBCheckProfilesafeConfig;
VclPtr<CheckBox> mpCBCheckProfilesafeExtensions;
VclPtr<CheckBox> mpCBDisableAllExtensions;
@@ -54,6 +63,7 @@ private:
void applyChanges();
static void openWebBrowser(const OUString & sURL, const OUString &sTitle);
+ DECL_LINK(RadioBtnHdl, Button*, void);
DECL_LINK(CheckBoxHdl, CheckBox&, void);
DECL_LINK(BtnHdl, Button*, void);
};
Oops, something went wrong.

0 comments on commit e138270

Please sign in to comment.