[Libreoffice-commits] core.git: svx/source

Samuel Mehrbrodt Samuel.Mehrbrodt at cib.de
Thu Nov 3 12:22:00 UTC 2016


 svx/source/dialog/SafeModeDialog.cxx |   78 +++++++++++++++++++++--------------
 svx/source/dialog/SafeModeDialog.hxx |    1 
 2 files changed, 48 insertions(+), 31 deletions(-)

New commits:
commit 00e48a2ea00e973ae6e29950ca7c6846cfeabff4
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date:   Thu Nov 3 11:33:47 2016 +0100

    SafeModeDialog: Fix enabling/disabling of widgets
    
    Change-Id: I7133b64f975fa8e68550d41056b689dfc18cf172
    Reviewed-on: https://gerrit.libreoffice.org/30520
    Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
    Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>

diff --git a/svx/source/dialog/SafeModeDialog.cxx b/svx/source/dialog/SafeModeDialog.cxx
index 35b135b..1a39d38 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 9bc5d91..692242c 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);
 


More information about the Libreoffice-commits mailing list