diff options
author | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-11-03 12:11:12 +0100 |
---|---|---|
committer | Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de> | 2016-11-03 12:23:32 +0000 |
commit | 16881e76fe0b318c7498f28ebfc81d65825d4830 (patch) | |
tree | 77b7ea70123236d21d5b55161c92110d4f92c99f | |
parent | da0a98fa6dcc11302ef8b1e04742c12d44baf54b (diff) |
SafeModeDialog: Better grouping of options
Disable/Deinstall extensions are mutually exclusive, so group them appropriately
Change-Id: I6dc9c53ef4c18103c7521d494a769d522b0412dd
Reviewed-on: https://gerrit.libreoffice.org/30522
Reviewed-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: Samuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
-rw-r--r-- | svx/source/dialog/SafeModeDialog.cxx | 48 | ||||
-rw-r--r-- | svx/source/dialog/SafeModeDialog.hxx | 2 | ||||
-rw-r--r-- | svx/uiconfig/ui/safemodedialog.ui | 57 |
3 files changed, 80 insertions, 27 deletions
diff --git a/svx/source/dialog/SafeModeDialog.cxx b/svx/source/dialog/SafeModeDialog.cxx index 1a39d385c574..6403154d08bf 100644 --- a/svx/source/dialog/SafeModeDialog.cxx +++ b/svx/source/dialog/SafeModeDialog.cxx @@ -42,10 +42,12 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent) mpBoxRestore(), mpBoxConfigure(), + mpBoxDeinstall(), mpBoxReset(), mpRadioRestore(), mpRadioConfigure(), + mpRadioDeinstall(), mpRadioReset(), mpCBCheckProfilesafeConfig(), @@ -65,10 +67,12 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent) get(mpBoxRestore, "group_restore"); get(mpBoxConfigure, "group_configure"); + get(mpBoxDeinstall, "group_deinstall"); get(mpBoxReset, "group_reset"); get(mpRadioRestore, "radio_restore"); get(mpRadioConfigure, "radio_configure"); + get(mpRadioDeinstall, "radio_deinstall"); get(mpRadioReset, "radio_reset"); get(mpCBCheckProfilesafeConfig, "check_profilesafe_config"); @@ -109,6 +113,7 @@ SafeModeDialog::SafeModeDialog(vcl::Window* pParent) // Check the first radio button and disable the other parts mpRadioRestore->Check(); mpBoxConfigure->Disable(); + mpBoxDeinstall->Disable(); mpBoxReset->Disable(); // Set URL for help button (module=safemode) @@ -128,10 +133,12 @@ void SafeModeDialog::dispose() { mpRadioRestore.clear(); mpRadioConfigure.clear(); + mpRadioDeinstall.clear(); mpRadioReset.clear(); mpBoxRestore.clear(); mpBoxConfigure.clear(); + mpBoxDeinstall.clear(); mpBoxReset.clear(); mpBtnContinue.clear(); @@ -225,6 +232,14 @@ void SafeModeDialog::applyChanges() comphelper::BackupFileHelper::tryDisableAllExtensions(); } + if (mpCBDisableHWAcceleration->IsChecked()) + { + comphelper::BackupFileHelper::tryDisableHWAcceleration(); + } + } + + if (mpRadioDeinstall->IsChecked()) + { if (mpCBDeinstallUserExtensions->IsChecked()) { // Deinstall all User Extensions (installed for User only) @@ -236,11 +251,6 @@ void SafeModeDialog::applyChanges() // Deinstall all Extensions (user|shared|bundled) comphelper::BackupFileHelper::tryDeinstallAllExtensions(); } - - if (mpCBDisableHWAcceleration->IsChecked()) - { - comphelper::BackupFileHelper::tryDisableHWAcceleration(); - } } // Reset @@ -266,7 +276,18 @@ void SafeModeDialog::applyChanges() IMPL_LINK(SafeModeDialog, RadioBtnHdl, Button*, pBtn, void) { - if (pBtn == mpRadioConfigure.get()) + 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(); + mpBoxDeinstall->Disable(); + } + else if (pBtn == mpRadioConfigure.get()) { // Enable the currently selected box mpBoxConfigure->Enable(); @@ -275,27 +296,30 @@ IMPL_LINK(SafeModeDialog, RadioBtnHdl, Button*, pBtn, void) // Disable the unselected boxes mpBoxRestore->Disable(); mpBoxReset->Disable(); + mpBoxDeinstall->Disable(); } - else if (pBtn == mpRadioReset.get()) + else if (pBtn == mpRadioDeinstall.get()) { // Enable the currently selected box - mpBoxReset->Enable(); + mpBoxDeinstall->Enable(); // Make sure only possible choices are active enableDisableWidgets(); // Disable the unselected boxes - mpBoxConfigure->Disable(); mpBoxRestore->Disable(); + mpBoxConfigure->Disable(); + mpBoxReset->Disable(); } - else if (pBtn == mpRadioRestore.get()) + else if (pBtn == mpRadioReset.get()) { // Enable the currently selected box - mpBoxRestore->Enable(); + mpBoxReset->Enable(); // Make sure only possible choices are active enableDisableWidgets(); // Disable the unselected boxes - mpBoxReset->Disable(); mpBoxConfigure->Disable(); + mpBoxRestore->Disable(); + mpBoxDeinstall->Disable(); } } diff --git a/svx/source/dialog/SafeModeDialog.hxx b/svx/source/dialog/SafeModeDialog.hxx index 692242caebfe..d926dd4d0c9a 100644 --- a/svx/source/dialog/SafeModeDialog.hxx +++ b/svx/source/dialog/SafeModeDialog.hxx @@ -39,10 +39,12 @@ private: VclPtr<VclBox> mpBoxRestore; VclPtr<VclBox> mpBoxConfigure; + VclPtr<VclBox> mpBoxDeinstall; VclPtr<VclBox> mpBoxReset; VclPtr<RadioButton> mpRadioRestore; VclPtr<RadioButton> mpRadioConfigure; + VclPtr<RadioButton> mpRadioDeinstall; VclPtr<RadioButton> mpRadioReset; VclPtr<CheckBox> mpCBCheckProfilesafeConfig; diff --git a/svx/uiconfig/ui/safemodedialog.ui b/svx/uiconfig/ui/safemodedialog.ui index 68b35ff648f0..fd6577c84a50 100644 --- a/svx/uiconfig/ui/safemodedialog.ui +++ b/svx/uiconfig/ui/safemodedialog.ui @@ -112,7 +112,6 @@ The offered possible changes get more radical from top to bottom, so it is recom <property name="visible">True</property> <property name="can_focus">False</property> <property name="margin_left">18</property> - <property name="margin_top">6</property> <property name="margin_bottom">6</property> <property name="orientation">vertical</property> <child> @@ -174,7 +173,6 @@ The offered possible changes get more radical from top to bottom, so it is recom <property name="visible">True</property> <property name="can_focus">False</property> <property name="margin_left">18</property> - <property name="margin_top">6</property> <property name="margin_bottom">6</property> <property name="orientation">vertical</property> <child> @@ -193,8 +191,8 @@ The offered possible changes get more radical from top to bottom, so it is recom </packing> </child> <child> - <object class="GtkCheckButton" id="check_deinstall_user_extensions"> - <property name="label" translatable="yes">Deinstall all user extensions</property> + <object class="GtkCheckButton" id="check_disable_hw_acceleration"> + <property name="label" translatable="yes">Disable hardware acceleration (OpenGL, OpenCL)</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -204,12 +202,42 @@ The offered possible changes get more radical from top to bottom, so it is recom <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">1</property> + <property name="position">3</property> </packing> </child> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">3</property> + </packing> + </child> + <child> + <object class="GtkRadioButton" id="radio_deinstall"> + <property name="label" translatable="yes">Deinstall extensions</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">False</property> + <property name="xalign">0</property> + <property name="draw_indicator">True</property> + <property name="group">radio_restore</property> + </object> + <packing> + <property name="expand">False</property> + <property name="fill">True</property> + <property name="position">4</property> + </packing> + </child> + <child> + <object class="GtkBox" id="group_deinstall"> + <property name="visible">True</property> + <property name="can_focus">False</property> + <property name="margin_left">18</property> + <property name="margin_bottom">6</property> + <property name="orientation">vertical</property> <child> - <object class="GtkCheckButton" id="check_deinstall_all_extensions"> - <property name="label" translatable="yes">Deinstall all extensions (including shared and bundled)</property> + <object class="GtkCheckButton" id="check_deinstall_user_extensions"> + <property name="label" translatable="yes">Deinstall all user extensions</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -219,12 +247,12 @@ The offered possible changes get more radical from top to bottom, so it is recom <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">2</property> + <property name="position">1</property> </packing> </child> <child> - <object class="GtkCheckButton" id="check_disable_hw_acceleration"> - <property name="label" translatable="yes">Disable hardware acceleration (OpenGL, OpenCL)</property> + <object class="GtkCheckButton" id="check_deinstall_all_extensions"> + <property name="label" translatable="yes">Deinstall all extensions (including shared and bundled)</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">False</property> @@ -234,14 +262,14 @@ The offered possible changes get more radical from top to bottom, so it is recom <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">3</property> + <property name="position">2</property> </packing> </child> </object> <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">3</property> + <property name="position">5</property> </packing> </child> <child> @@ -258,7 +286,7 @@ The offered possible changes get more radical from top to bottom, so it is recom <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">4</property> + <property name="position">6</property> </packing> </child> <child> @@ -266,7 +294,6 @@ The offered possible changes get more radical from top to bottom, so it is recom <property name="visible">True</property> <property name="can_focus">False</property> <property name="margin_left">18</property> - <property name="margin_top">6</property> <property name="orientation">vertical</property> <child> <object class="GtkCheckButton" id="check_reset_customizations"> @@ -302,7 +329,7 @@ The offered possible changes get more radical from top to bottom, so it is recom <packing> <property name="expand">False</property> <property name="fill">True</property> - <property name="position">5</property> + <property name="position">7</property> </packing> </child> </object> |