Kaydet (Commit) 16881e76 authored tarafından Samuel Mehrbrodt's avatar Samuel Mehrbrodt

SafeModeDialog: Better grouping of options

Disable/Deinstall extensions are mutually exclusive, so group them appropriately

Change-Id: I6dc9c53ef4c18103c7521d494a769d522b0412dd
Reviewed-on: https://gerrit.libreoffice.org/30522Reviewed-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
Tested-by: 's avatarSamuel Mehrbrodt <Samuel.Mehrbrodt@cib.de>
üst da0a98fa
......@@ -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();
}
}
......
......@@ -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;
......
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment