summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-11-03 11:33:47 +0100
committerSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>2016-11-03 12:21:18 +0000
commit00e48a2ea00e973ae6e29950ca7c6846cfeabff4 (patch)
tree897fdcf86266c2cf638ca1246e83df3d2b0440b4 /svx
parent291d8d4f9460f8d5292cab2ef706fd8b501641b4 (diff)
SafeModeDialog: Fix enabling/disabling of widgets
Change-Id: I7133b64f975fa8e68550d41056b689dfc18cf172 Reviewed-on: https://gerrit.libreoffice.org/30520 Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Diffstat (limited to 'svx')
-rw-r--r--svx/source/dialog/SafeModeDialog.cxx78
-rw-r--r--svx/source/dialog/SafeModeDialog.hxx1
2 files changed, 48 insertions, 31 deletions
diff --git a/svx/source/dialog/SafeModeDialog.cxx b/svx/source/dialog/SafeModeDialog.cxx
index 35b135bff628..1a39d385c574 100644
--- a/svx/source/dialog/SafeModeDialog.cxx
+++ b/svx/source/dialog/SafeModeDialog.cxx
@@ -106,37 +106,6 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent)
// Disable restart btn until some checkbox is active
mpBtnRestart->Disable();
- if (!maBackupFileHelper.isPopPossible())
- {
- mpCBCheckProfilesafeConfig->Disable();
- }
-
- if (!maBackupFileHelper.isPopPossibleExtensionInfo())
- {
- mpCBCheckProfilesafeExtensions->Disable();
- }
-
- if (!comphelper::BackupFileHelper::isTryDisableAllExtensionsPossible())
- {
- mpCBDisableAllExtensions->Disable();
- }
-
- if (!comphelper::BackupFileHelper::isTryDeinstallUserExtensionsPossible())
- {
- mpCBDeinstallUserExtensions->Disable();
- }
-
- if (!comphelper::BackupFileHelper::isTryDeinstallAllExtensionsPossible())
- {
- mpCBDeinstallAllExtensions->Disable();
- }
-
- if (!comphelper::BackupFileHelper::isTryResetCustomizationsPossible())
- {
- 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();
@@ -185,6 +154,40 @@ void SafeModeDialog::dispose()
Dialog::dispose();
}
+void SafeModeDialog::enableDisableWidgets()
+{
+ if (!maBackupFileHelper.isPopPossible())
+ {
+ mpCBCheckProfilesafeConfig->Disable();
+ }
+
+ if (!maBackupFileHelper.isPopPossibleExtensionInfo())
+ {
+ mpCBCheckProfilesafeExtensions->Disable();
+ }
+
+ if (!comphelper::BackupFileHelper::isTryDisableAllExtensionsPossible())
+ {
+ mpCBDisableAllExtensions->Disable();
+ }
+
+ if (!comphelper::BackupFileHelper::isTryDeinstallUserExtensionsPossible())
+ {
+ mpCBDeinstallUserExtensions->Disable();
+ }
+
+ if (!comphelper::BackupFileHelper::isTryDeinstallAllExtensionsPossible())
+ {
+ mpCBDeinstallAllExtensions->Disable();
+ }
+
+ if (!comphelper::BackupFileHelper::isTryResetCustomizationsPossible())
+ {
+ mpCBResetCustomizations->Disable();
+ }
+ // no disabe of mpCBResetWholeUserProfile, always possible (as last choice)
+}
+
bool SafeModeDialog::Close()
{
// Remove the safe mode flag before exiting this dialog
@@ -265,19 +268,32 @@ IMPL_LINK(SafeModeDialog, RadioBtnHdl, Button*, pBtn, void)
{
if (pBtn == mpRadioConfigure.get())
{
+ // Enable the currently selected box
mpBoxConfigure->Enable();
+ // Make sure only possible choices are active
+ enableDisableWidgets();
+ // Disable the unselected boxes
mpBoxRestore->Disable();
mpBoxReset->Disable();
+
}
else if (pBtn == mpRadioReset.get())
{
+ // Enable the currently selected box
mpBoxReset->Enable();
+ // Make sure only possible choices are active
+ enableDisableWidgets();
+ // Disable the unselected boxes
mpBoxConfigure->Disable();
mpBoxRestore->Disable();
}
else if (pBtn == mpRadioRestore.get())
{
+ // Enable the currently selected box
mpBoxRestore->Enable();
+ // Make sure only possible choices are active
+ enableDisableWidgets();
+ // Disable the unselected boxes
mpBoxReset->Disable();
mpBoxConfigure->Disable();
}
diff --git a/svx/source/dialog/SafeModeDialog.hxx b/svx/source/dialog/SafeModeDialog.hxx
index 9bc5d91e9e7e..692242caebfe 100644
--- a/svx/source/dialog/SafeModeDialog.hxx
+++ b/svx/source/dialog/SafeModeDialog.hxx
@@ -61,6 +61,7 @@ private:
// local BackupFileHelper for handling possible restores
comphelper::BackupFileHelper maBackupFileHelper;
+ void enableDisableWidgets();
void applyChanges();
static void openWebBrowser(const OUString & sURL, const OUString &sTitle);