[Libreoffice-commits] core.git: svx/source svx/uiconfig
Samuel Mehrbrodt
Samuel.Mehrbrodt at cib.de
Tue Nov 1 14:59:48 UTC 2016
svx/source/dialog/SafeModeDialog.cxx | 140 +++++++++++++++++-------
svx/source/dialog/SafeModeDialog.hxx | 10 +
svx/uiconfig/ui/safemodedialog.ui | 203 +++++++++++++++++++++++++----------
3 files changed, 262 insertions(+), 91 deletions(-)
New commits:
commit e13827070cdcdf7bbf96678e7527c684519124d8
Author: Samuel Mehrbrodt <Samuel.Mehrbrodt at cib.de>
Date: Tue Nov 1 09:46:26 2016 +0100
SafeModeDialog: Group options
Change-Id: Ife0903c90f17efb2a1c6681ece8dd9af257873cd
Reviewed-on: https://gerrit.libreoffice.org/30453
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 4a3a835..0dc4c47 100644
--- a/svx/source/dialog/SafeModeDialog.cxx
+++ b/svx/source/dialog/SafeModeDialog.cxx
@@ -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)
diff --git a/svx/source/dialog/SafeModeDialog.hxx b/svx/source/dialog/SafeModeDialog.hxx
index f770c53..05ee6a2 100644
--- a/svx/source/dialog/SafeModeDialog.hxx
+++ b/svx/source/dialog/SafeModeDialog.hxx
@@ -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);
};
diff --git a/svx/uiconfig/ui/safemodedialog.ui b/svx/uiconfig/ui/safemodedialog.ui
index bc5226e..74d32df 100644
--- a/svx/uiconfig/ui/safemodedialog.ui
+++ b/svx/uiconfig/ui/safemodedialog.ui
@@ -91,13 +91,15 @@ The offered possible changes get more radical from top to bottom, so it is recom
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
- <object class="GtkCheckButton" id="check_profilesafe_config">
- <property name="label" translatable="yes">Restore UserConfiguration to last known working state from backup</property>
+ <object class="GtkRadioButton" id="radio_restore">
+ <property name="label" translatable="yes">Restore</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="active">True</property>
<property name="draw_indicator">True</property>
+ <property name="group">radio_configure</property>
</object>
<packing>
<property name="expand">False</property>
@@ -106,13 +108,43 @@ The offered possible changes get more radical from top to bottom, so it is recom
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="check_profilesafe_extensions">
- <property name="label" translatable="yes">Restore enable/disable State of installed User Extensions to last known working state</property>
+ <object class="GtkBox" id="group_restore">
<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="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>
+ <object class="GtkCheckButton" id="check_profilesafe_config">
+ <property name="label" translatable="yes">Restore UserConfiguration to last known working state from backup</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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="check_profilesafe_extensions">
+ <property name="label" translatable="yes">Restore enable/disable State of installed User Extensions to last known working state</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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -121,13 +153,15 @@ The offered possible changes get more radical from top to bottom, so it is recom
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="check_disable_all_extensions">
- <property name="label" translatable="yes">Disable all User Extensions</property>
+ <object class="GtkRadioButton" id="radio_configure">
+ <property name="label" translatable="yes">Configure</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="active">True</property>
<property name="draw_indicator">True</property>
+ <property name="group">radio_restore</property>
</object>
<packing>
<property name="expand">False</property>
@@ -136,13 +170,73 @@ 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="GtkBox" id="group_configure">
<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="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>
+ <object class="GtkCheckButton" id="check_disable_all_extensions">
+ <property name="label" translatable="yes">Disable all User 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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <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>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
+ <child>
+ <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>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">2</property>
+ </packing>
+ </child>
+ <child>
+ <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>
+ <property name="xalign">0</property>
+ <property name="draw_indicator">True</property>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">3</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -151,13 +245,15 @@ The offered possible changes get more radical from top to bottom, so it is recom
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="check_deinstall_all_extensions">
- <property name="label" translatable="yes">Deinstall all Extensions (including shared and bundled)</property>
+ <object class="GtkRadioButton" id="radio_reset">
+ <property name="label" translatable="yes">Reset</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="active">True</property>
<property name="draw_indicator">True</property>
+ <property name="group">radio_restore</property>
</object>
<packing>
<property name="expand">False</property>
@@ -166,13 +262,42 @@ The offered possible changes get more radical from top to bottom, so it is recom
</packing>
</child>
<child>
- <object class="GtkCheckButton" id="check_disable_hw_acceleration">
- <property name="label" translatable="yes">Disable hardware acceleration (OpenGL, OpenCL)</property>
+ <object class="GtkBox" id="group_reset">
<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="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">
+ <property name="label" translatable="yes">Reset User Customizations (Settings, User Interface modifications, AutoCorrect, AutoText, etc.)</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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">0</property>
+ </packing>
+ </child>
+ <child>
+ <object class="GtkCheckButton" id="check_reset_whole_userprofile">
+ <property name="label" translatable="yes">Reset the whole User Profile to initial state after Installation</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>
+ </object>
+ <packing>
+ <property name="expand">False</property>
+ <property name="fill">True</property>
+ <property name="position">1</property>
+ </packing>
+ </child>
</object>
<packing>
<property name="expand">False</property>
@@ -180,36 +305,6 @@ The offered possible changes get more radical from top to bottom, so it is recom
<property name="position">5</property>
</packing>
</child>
- <child>
- <object class="GtkCheckButton" id="check_reset_customizations">
- <property name="label" translatable="yes">Reset User Customizations (Settings, User Interface modifications, AutoCorrect, AutoText, etc.)</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>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">6</property>
- </packing>
- </child>
- <child>
- <object class="GtkCheckButton" id="check_reset_whole_userprofile">
- <property name="label" translatable="yes">Reset the whole User Profile to initial state after Installation</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>
- </object>
- <packing>
- <property name="expand">False</property>
- <property name="fill">True</property>
- <property name="position">7</property>
- </packing>
- </child>
</object>
<packing>
<property name="expand">False</property>
More information about the Libreoffice-commits
mailing list