diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-09-30 20:22:58 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-10-01 09:53:34 +0200 |
commit | 724cca5d89a856095f2720ce61b9cdffa84f49ec (patch) | |
tree | 1ff2fc1bc4d6ee81570b0b5f8535a1e889a7a265 | |
parent | f6a2b24ce17293043f7ddbed0bc218264be6487d (diff) |
weld SafeModeDialog
Change-Id: I079aa278f6f2672534128df7a8739425223c0c74
Reviewed-on: https://gerrit.libreoffice.org/79897
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | svx/source/dialog/SafeModeDialog.cxx | 304 | ||||
-rw-r--r-- | svx/source/dialog/SafeModeDialog.hxx | 81 | ||||
-rw-r--r-- | svx/source/dialog/SafeModeUI.cxx | 6 | ||||
-rw-r--r-- | svx/uiconfig/ui/safemodedialog.ui | 11 |
4 files changed, 169 insertions, 233 deletions
diff --git a/svx/source/dialog/SafeModeDialog.cxx b/svx/source/dialog/SafeModeDialog.cxx index b99770d1d827..a9054153da31 100644 --- a/svx/source/dialog/SafeModeDialog.cxx +++ b/svx/source/dialog/SafeModeDialog.cxx @@ -30,172 +30,110 @@ using namespace css; -SafeModeDialog::SafeModeDialog(vcl::Window* pParent) -: Dialog(pParent, "SafeModeDialog", "svx/ui/safemodedialog.ui"), - - mpBtnContinue(), - mpBtnRestart(), - mpBtnApply(), - - mpBoxRestore(), - mpBoxConfigure(), - mpBoxDeinstall(), - mpBoxReset(), - - mpRadioRestore(), - mpRadioConfigure(), - mpRadioExtensions(), - mpRadioReset(), - - mpCBCheckProfilesafeConfig(), - mpCBCheckProfilesafeExtensions(), - mpCBDisableAllExtensions(), - mpCBDeinstallUserExtensions(), - mpCBResetSharedExtensions(), - mpCBResetBundledExtensions(), - mpCBDisableHWAcceleration(), - mpCBResetCustomizations(), - mpCBResetWholeUserProfile(), - - maBackupFileHelper() +SafeModeDialog::SafeModeDialog(weld::Window* pParent) + : GenericDialogController(pParent, "svx/ui/safemodedialog.ui", "SafeModeDialog") + , mxBtnContinue(m_xBuilder->weld_button("btn_continue")) + , mxBtnRestart(m_xBuilder->weld_button("btn_restart")) + , mxBtnApply(m_xBuilder->weld_button("btn_apply")) + , mxBoxRestore(m_xBuilder->weld_container("group_restore")) + , mxBoxConfigure(m_xBuilder->weld_container("group_configure")) + , mxBoxDeinstall(m_xBuilder->weld_container("group_deinstall")) + , mxBoxReset(m_xBuilder->weld_container("group_reset")) + , mxRadioRestore(m_xBuilder->weld_radio_button("radio_restore")) + , mxRadioConfigure(m_xBuilder->weld_radio_button("radio_configure")) + , mxRadioExtensions(m_xBuilder->weld_radio_button("radio_extensions")) + , mxRadioReset(m_xBuilder->weld_radio_button("radio_reset")) + , mxCBCheckProfilesafeConfig(m_xBuilder->weld_check_button("check_profilesafe_config")) + , mxCBCheckProfilesafeExtensions(m_xBuilder->weld_check_button("check_profilesafe_extensions")) + , mxCBDisableAllExtensions(m_xBuilder->weld_check_button("check_disable_all_extensions")) + , mxCBDeinstallUserExtensions(m_xBuilder->weld_check_button("check_deinstall_user_extensions")) + , mxCBResetSharedExtensions(m_xBuilder->weld_check_button("check_reset_shared_extensions")) + , mxCBResetBundledExtensions(m_xBuilder->weld_check_button("check_reset_bundled_extensions")) + , mxCBDisableHWAcceleration(m_xBuilder->weld_check_button("check_disable_hw_acceleration")) + , mxCBResetCustomizations(m_xBuilder->weld_check_button("check_reset_customizations")) + , mxCBResetWholeUserProfile(m_xBuilder->weld_check_button("check_reset_whole_userprofile")) + , mxBugLink(m_xBuilder->weld_link_button("linkbutton_bugs")) + , mxUserProfileLink(m_xBuilder->weld_link_button("linkbutton_profile")) + , mxBtnCreateZip(m_xBuilder->weld_button("btn_create_zip")) + , mxExpander(m_xBuilder->weld_expander("expander")) + , maBackupFileHelper() { - get(mpBtnContinue, "btn_continue"); - get(mpBtnRestart, "btn_restart"); - get(mpBtnApply, "btn_apply"); - - 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(mpRadioExtensions, "radio_extensions"); - get(mpRadioReset, "radio_reset"); - - get(mpCBCheckProfilesafeConfig, "check_profilesafe_config"); - get(mpCBCheckProfilesafeExtensions, "check_profilesafe_extensions"); - get(mpCBDisableAllExtensions, "check_disable_all_extensions"); - get(mpCBDeinstallUserExtensions, "check_deinstall_user_extensions"); - get(mpCBResetSharedExtensions, "check_reset_shared_extensions"); - get(mpCBResetBundledExtensions, "check_reset_bundled_extensions"); - get(mpCBDisableHWAcceleration, "check_disable_hw_acceleration"); - get(mpCBResetCustomizations, "check_reset_customizations"); - get(mpCBResetWholeUserProfile, "check_reset_whole_userprofile"); - - get(mpBugLink, "linkbutton_bugs"); - get(mpUserProfileLink, "linkbutton_profile"); - get(mpBtnCreateZip, "btn_create_zip"); - - mpRadioRestore->SetClickHdl(LINK(this, SafeModeDialog, RadioBtnHdl)); - mpRadioConfigure->SetClickHdl(LINK(this, SafeModeDialog, RadioBtnHdl)); - mpRadioExtensions->SetClickHdl(LINK(this, SafeModeDialog, RadioBtnHdl)); - mpRadioReset->SetClickHdl(LINK(this, SafeModeDialog, RadioBtnHdl)); - - mpBtnContinue->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl)); - mpBtnRestart->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl)); - mpBtnApply->SetClickHdl(LINK(this, SafeModeDialog, DialogBtnHdl)); - - mpCBCheckProfilesafeConfig->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl)); - mpCBCheckProfilesafeExtensions->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl)); - mpCBDisableAllExtensions->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl)); - mpCBDeinstallUserExtensions->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl)); - mpCBResetSharedExtensions->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl)); - mpCBResetBundledExtensions->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl)); - mpCBDisableHWAcceleration->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl)); - mpCBResetCustomizations->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl)); - mpCBResetWholeUserProfile->SetToggleHdl(LINK(this, SafeModeDialog, CheckBoxHdl)); - - mpBtnCreateZip->SetClickHdl(LINK(this, SafeModeDialog, CreateZipBtnHdl)); + m_xDialog->set_centered_on_parent(false); + mxRadioRestore->connect_clicked(LINK(this, SafeModeDialog, RadioBtnHdl)); + mxRadioConfigure->connect_clicked(LINK(this, SafeModeDialog, RadioBtnHdl)); + mxRadioExtensions->connect_clicked(LINK(this, SafeModeDialog, RadioBtnHdl)); + mxRadioReset->connect_clicked(LINK(this, SafeModeDialog, RadioBtnHdl)); + + mxBtnContinue->connect_clicked(LINK(this, SafeModeDialog, DialogBtnHdl)); + mxBtnRestart->connect_clicked(LINK(this, SafeModeDialog, DialogBtnHdl)); + mxBtnApply->connect_clicked(LINK(this, SafeModeDialog, DialogBtnHdl)); + + mxCBCheckProfilesafeConfig->connect_toggled(LINK(this, SafeModeDialog, CheckBoxHdl)); + mxCBCheckProfilesafeExtensions->connect_toggled(LINK(this, SafeModeDialog, CheckBoxHdl)); + mxCBDisableAllExtensions->connect_toggled(LINK(this, SafeModeDialog, CheckBoxHdl)); + mxCBDeinstallUserExtensions->connect_toggled(LINK(this, SafeModeDialog, CheckBoxHdl)); + mxCBResetSharedExtensions->connect_toggled(LINK(this, SafeModeDialog, CheckBoxHdl)); + mxCBResetBundledExtensions->connect_toggled(LINK(this, SafeModeDialog, CheckBoxHdl)); + mxCBDisableHWAcceleration->connect_toggled(LINK(this, SafeModeDialog, CheckBoxHdl)); + mxCBResetCustomizations->connect_toggled(LINK(this, SafeModeDialog, CheckBoxHdl)); + mxCBResetWholeUserProfile->connect_toggled(LINK(this, SafeModeDialog, CheckBoxHdl)); + + mxBtnCreateZip->connect_clicked(LINK(this, SafeModeDialog, CreateZipBtnHdl)); // Disable restart btn until some checkbox is active - mpBtnApply->Disable(); + mxBtnApply->set_sensitive(false); // Check the first radio button and call its handler, // it'll disable the relevant parts - mpRadioRestore->Check(); - RadioBtnHdl( mpRadioRestore ); + mxRadioRestore->set_active(true); + RadioBtnHdl(*mxRadioRestore); // Set URL for help button (module=safemode) OUString sURL("http://hub.libreoffice.org/send-feedback/?LOversion=" + utl::ConfigManager::getAboutBoxProductVersion() + "&LOlocale=" + utl::ConfigManager::getUILocale() + "&LOmodule=safemode"); - mpBugLink->SetURL(sURL); + mxBugLink->set_uri(sURL); - mpUserProfileLink->SetURL(comphelper::BackupFileHelper::getUserProfileURL()); + mxUserProfileLink->set_uri(comphelper::BackupFileHelper::getUserProfileURL()); } SafeModeDialog::~SafeModeDialog() { - disposeOnce(); -} - -void SafeModeDialog::dispose() -{ - mpRadioRestore.clear(); - mpRadioConfigure.clear(); - mpRadioExtensions.clear(); - mpRadioReset.clear(); - - mpBoxRestore.clear(); - mpBoxConfigure.clear(); - mpBoxDeinstall.clear(); - mpBoxReset.clear(); - - mpBtnContinue.clear(); - mpBtnRestart.clear(); - mpBtnApply.clear(); - - mpCBCheckProfilesafeConfig.clear(); - mpCBCheckProfilesafeExtensions.clear(); - mpCBDisableAllExtensions.clear(); - mpCBDeinstallUserExtensions.clear(); - mpCBResetSharedExtensions.clear(); - mpCBResetBundledExtensions.clear(); - mpCBDisableHWAcceleration.clear(); - mpCBResetCustomizations.clear(); - mpCBResetWholeUserProfile.clear(); - - mpBugLink.clear(); - mpUserProfileLink.clear(); - mpBtnCreateZip.clear(); - - Dialog::dispose(); } void SafeModeDialog::enableDisableWidgets() { - mpCBCheckProfilesafeConfig->Enable(maBackupFileHelper.isPopPossible()); - mpCBCheckProfilesafeExtensions->Enable(maBackupFileHelper.isPopPossibleExtensionInfo()); - mpCBDisableAllExtensions->Enable(comphelper::BackupFileHelper::isTryDisableAllExtensionsPossible()); - mpCBDeinstallUserExtensions->Enable(comphelper::BackupFileHelper::isTryDeinstallUserExtensionsPossible()); - mpCBResetSharedExtensions->Enable(comphelper::BackupFileHelper::isTryResetSharedExtensionsPossible()); - mpCBResetBundledExtensions->Enable(comphelper::BackupFileHelper::isTryResetBundledExtensionsPossible()); - mpCBResetCustomizations->Enable(comphelper::BackupFileHelper::isTryResetCustomizationsPossible()); - - // no disable of mpCBResetWholeUserProfile, always possible (as last choice) + mxCBCheckProfilesafeConfig->set_sensitive(maBackupFileHelper.isPopPossible()); + mxCBCheckProfilesafeExtensions->set_sensitive(maBackupFileHelper.isPopPossibleExtensionInfo()); + mxCBDisableAllExtensions->set_sensitive(comphelper::BackupFileHelper::isTryDisableAllExtensionsPossible()); + mxCBDeinstallUserExtensions->set_sensitive(comphelper::BackupFileHelper::isTryDeinstallUserExtensionsPossible()); + mxCBResetSharedExtensions->set_sensitive(comphelper::BackupFileHelper::isTryResetSharedExtensionsPossible()); + mxCBResetBundledExtensions->set_sensitive(comphelper::BackupFileHelper::isTryResetBundledExtensionsPossible()); + mxCBResetCustomizations->set_sensitive(comphelper::BackupFileHelper::isTryResetCustomizationsPossible()); + + // no disable of mxCBResetWholeUserProfile, always possible (as last choice) } -bool SafeModeDialog::Close() +short SafeModeDialog::run() { + short nRet = weld::GenericDialogController::run(); // Remove the safe mode flag before exiting this dialog sfx2::SafeMode::removeFlag(); - - return Dialog::Close(); + return nRet; } void SafeModeDialog::applyChanges() { // Restore - if (mpRadioRestore->IsChecked()) + if (mxRadioRestore->get_active()) { - if (mpCBCheckProfilesafeConfig->IsChecked()) + if (mxCBCheckProfilesafeConfig->get_active()) { // reset UserConfiguration to last known working state // ProfileSafeMode/BackupFileHelper maBackupFileHelper.tryPop(); } - if (mpCBCheckProfilesafeExtensions->IsChecked()) + if (mxCBCheckProfilesafeExtensions->get_active()) { // reset State of installed Extensions to last known working state // ProfileSafeMode/BackupFileHelper @@ -204,35 +142,35 @@ void SafeModeDialog::applyChanges() } // Configure - if (mpRadioConfigure->IsChecked()) + if (mxRadioConfigure->get_active()) { - if (mpCBDisableAllExtensions->IsChecked()) + if (mxCBDisableAllExtensions->get_active()) { // Disable all extensions comphelper::BackupFileHelper::tryDisableAllExtensions(); } - if (mpCBDisableHWAcceleration->IsChecked()) + if (mxCBDisableHWAcceleration->get_active()) { comphelper::BackupFileHelper::tryDisableHWAcceleration(); } } // Deinstall - if (mpRadioExtensions->IsChecked()) + if (mxRadioExtensions->get_active()) { - if (mpCBDeinstallUserExtensions->IsChecked()) + if (mxCBDeinstallUserExtensions->get_active()) { // Deinstall all User Extensions (installed for User only) comphelper::BackupFileHelper::tryDeinstallUserExtensions(); } - if (mpCBResetSharedExtensions->IsChecked()) + if (mxCBResetSharedExtensions->get_active()) { // Reset shared Extensions comphelper::BackupFileHelper::tryResetSharedExtensions(); } - if (mpCBResetBundledExtensions->IsChecked()) + if (mxCBResetBundledExtensions->get_active()) { // Reset bundled Extensions comphelper::BackupFileHelper::tryResetBundledExtensions(); @@ -240,15 +178,15 @@ void SafeModeDialog::applyChanges() } // Reset - if (mpRadioReset->IsChecked()) + if (mxRadioReset->get_active()) { - if (mpCBResetCustomizations->IsChecked()) + if (mxCBResetCustomizations->get_active()) { // Reset customizations (Settings and UserInterface modifications) comphelper::BackupFileHelper::tryResetCustomizations(); } - if (mpCBResetWholeUserProfile->IsChecked()) + if (mxCBResetWholeUserProfile->get_active()) { // Reset the whole UserProfile comphelper::BackupFileHelper::tryResetUserProfile(); @@ -260,73 +198,73 @@ void SafeModeDialog::applyChanges() css::uno::Reference< css::task::XInteractionHandler >()); } -IMPL_LINK(SafeModeDialog, RadioBtnHdl, Button*, pBtn, void) +IMPL_LINK(SafeModeDialog, RadioBtnHdl, weld::Button&, rBtn, void) { - if (pBtn == mpRadioRestore.get()) + if (&rBtn == mxRadioRestore.get()) { // Enable the currently selected box - mpBoxRestore->Enable(); + mxBoxRestore->set_sensitive(true); // Make sure only possible choices are active enableDisableWidgets(); // Disable the unselected boxes - mpBoxReset->Disable(); - mpBoxConfigure->Disable(); - mpBoxDeinstall->Disable(); + mxBoxReset->set_sensitive(false); + mxBoxConfigure->set_sensitive(false); + mxBoxDeinstall->set_sensitive(false); } - else if (pBtn == mpRadioConfigure.get()) + else if (&rBtn == mxRadioConfigure.get()) { // Enable the currently selected box - mpBoxConfigure->Enable(); + mxBoxConfigure->set_sensitive(true); // Make sure only possible choices are active enableDisableWidgets(); // Disable the unselected boxes - mpBoxRestore->Disable(); - mpBoxReset->Disable(); - mpBoxDeinstall->Disable(); + mxBoxRestore->set_sensitive(false); + mxBoxReset->set_sensitive(false); + mxBoxDeinstall->set_sensitive(false); } - else if (pBtn == mpRadioExtensions.get()) + else if (&rBtn == mxRadioExtensions.get()) { // Enable the currently selected box - mpBoxDeinstall->Enable(); + mxBoxDeinstall->set_sensitive(true); // Make sure only possible choices are active enableDisableWidgets(); // Disable the unselected boxes - mpBoxRestore->Disable(); - mpBoxConfigure->Disable(); - mpBoxReset->Disable(); + mxBoxRestore->set_sensitive(false); + mxBoxConfigure->set_sensitive(false); + mxBoxReset->set_sensitive(false); } - else if (pBtn == mpRadioReset.get()) + else if (&rBtn == mxRadioReset.get()) { // Enable the currently selected box - mpBoxReset->Enable(); + mxBoxReset->set_sensitive(true); // Make sure only possible choices are active enableDisableWidgets(); // Disable the unselected boxes - mpBoxConfigure->Disable(); - mpBoxRestore->Disable(); - mpBoxDeinstall->Disable(); + mxBoxConfigure->set_sensitive(false); + mxBoxRestore->set_sensitive(false); + mxBoxDeinstall->set_sensitive(false); } } -IMPL_LINK(SafeModeDialog, DialogBtnHdl, Button*, pBtn, void) +IMPL_LINK(SafeModeDialog, DialogBtnHdl, weld::Button&, rBtn, void) { - if (pBtn == mpBtnContinue.get()) + if (&rBtn == mxBtnContinue.get()) { - Close(); + m_xDialog->response(RET_CLOSE); } - else if (pBtn == mpBtnRestart.get()) + else if (&rBtn == mxBtnRestart.get()) { sfx2::SafeMode::putRestartFlag(); - Close(); + m_xDialog->response(RET_CLOSE); uno::Reference< uno::XComponentContext > xContext = comphelper::getProcessComponentContext(); css::task::OfficeRestartManager::get(xContext)->requestRestart( css::uno::Reference< css::task::XInteractionHandler >()); } - else if (pBtn == mpBtnApply.get()) + else if (&rBtn == mxBtnApply.get()) { sfx2::SafeMode::putRestartFlag(); - Close(); + m_xDialog->response(RET_CLOSE); applyChanges(); } } @@ -362,7 +300,7 @@ namespace { } } -IMPL_LINK(SafeModeDialog, CreateZipBtnHdl, Button*, /*pBtn*/, void) +IMPL_LINK(SafeModeDialog, CreateZipBtnHdl, weld::Button&, /*rBtn*/, void) { const OUString zipFileName("libreoffice-profile.zip"); const OUString zipFileURL(comphelper::BackupFileHelper::getUserProfileURL() + "/" + zipFileName); @@ -375,31 +313,31 @@ IMPL_LINK(SafeModeDialog, CreateZipBtnHdl, Button*, /*pBtn*/, void) } catch (const uno::Exception &) { - std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(), + std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(m_xDialog.get(), VclMessageType::Warning, VclButtonsType::Ok, SvxResId(RID_SVXSTR_SAFEMODE_ZIP_FAILURE))); xBox->run(); return; } - ProfileExportedDialog aDialog(GetFrameWeld()); + ProfileExportedDialog aDialog(m_xDialog.get()); aDialog.run(); } -IMPL_LINK(SafeModeDialog, CheckBoxHdl, CheckBox&, /*pCheckBox*/, void) +IMPL_LINK(SafeModeDialog, CheckBoxHdl, weld::ToggleButton&, /*pCheckBox*/, void) { const bool bEnable( - mpCBCheckProfilesafeConfig->IsChecked() || - mpCBCheckProfilesafeExtensions->IsChecked() || - mpCBDisableAllExtensions->IsChecked() || - mpCBDeinstallUserExtensions->IsChecked() || - mpCBResetSharedExtensions->IsChecked() || - mpCBResetBundledExtensions->IsChecked() || - mpCBDisableHWAcceleration->IsChecked() || - mpCBResetCustomizations->IsChecked() || - mpCBResetWholeUserProfile->IsChecked()); - - mpBtnApply->Enable(bEnable); + mxCBCheckProfilesafeConfig->get_active() || + mxCBCheckProfilesafeExtensions->get_active() || + mxCBDisableAllExtensions->get_active() || + mxCBDeinstallUserExtensions->get_active() || + mxCBResetSharedExtensions->get_active() || + mxCBResetBundledExtensions->get_active() || + mxCBDisableHWAcceleration->get_active() || + mxCBResetCustomizations->get_active() || + mxCBResetWholeUserProfile->get_active()); + + mxBtnApply->set_sensitive(bEnable); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/svx/source/dialog/SafeModeDialog.hxx b/svx/source/dialog/SafeModeDialog.hxx index 5c84bf9bde20..713a95f4a310 100644 --- a/svx/source/dialog/SafeModeDialog.hxx +++ b/svx/source/dialog/SafeModeDialog.hxx @@ -10,55 +10,46 @@ #ifndef INCLUDED_SVX_SOURCE_DIALOG_SAFEMODEDIALOG_HXX #define INCLUDED_SVX_SOURCE_DIALOG_SAFEMODEDIALOG_HXX -#include <vcl/dialog.hxx> -#include <vcl/button.hxx> -#include <vcl/layout.hxx> -#include <vcl/fixed.hxx> -#include <vcl/edit.hxx> -#include <vcl/fixedhyper.hxx> #include <comphelper/backupfilehelper.hxx> +#include <vcl/weld.hxx> -class SafeModeDialog : public Dialog +class SafeModeDialog : public weld::GenericDialogController { public: - - explicit SafeModeDialog(vcl::Window* pParent); - + explicit SafeModeDialog(weld::Window* pParent); + virtual short run() override; virtual ~SafeModeDialog() override; - virtual void dispose() override; - - virtual bool Close() override; - private: - VclPtr<Button> mpBtnContinue; - VclPtr<Button> mpBtnRestart; - VclPtr<Button> mpBtnApply; - - VclPtr<VclBox> mpBoxRestore; - VclPtr<VclBox> mpBoxConfigure; - VclPtr<VclBox> mpBoxDeinstall; - VclPtr<VclBox> mpBoxReset; - - VclPtr<RadioButton> mpRadioRestore; - VclPtr<RadioButton> mpRadioConfigure; - VclPtr<RadioButton> mpRadioExtensions; - VclPtr<RadioButton> mpRadioReset; - - VclPtr<CheckBox> mpCBCheckProfilesafeConfig; - VclPtr<CheckBox> mpCBCheckProfilesafeExtensions; - VclPtr<CheckBox> mpCBDisableAllExtensions; - VclPtr<CheckBox> mpCBDeinstallUserExtensions; - VclPtr<CheckBox> mpCBResetSharedExtensions; - VclPtr<CheckBox> mpCBResetBundledExtensions; - VclPtr<CheckBox> mpCBDisableHWAcceleration; - VclPtr<CheckBox> mpCBResetCustomizations; - VclPtr<CheckBox> mpCBResetWholeUserProfile; - - VclPtr<FixedHyperlink> mpBugLink; - VclPtr<FixedHyperlink> mpUserProfileLink; - VclPtr<Button> mpBtnCreateZip; + std::unique_ptr<weld::Button> mxBtnContinue; + std::unique_ptr<weld::Button> mxBtnRestart; + std::unique_ptr<weld::Button> mxBtnApply; + + std::unique_ptr<weld::Container> mxBoxRestore; + std::unique_ptr<weld::Container> mxBoxConfigure; + std::unique_ptr<weld::Container> mxBoxDeinstall; + std::unique_ptr<weld::Container> mxBoxReset; + + std::unique_ptr<weld::RadioButton> mxRadioRestore; + std::unique_ptr<weld::RadioButton> mxRadioConfigure; + std::unique_ptr<weld::RadioButton> mxRadioExtensions; + std::unique_ptr<weld::RadioButton> mxRadioReset; + + std::unique_ptr<weld::CheckButton> mxCBCheckProfilesafeConfig; + std::unique_ptr<weld::CheckButton> mxCBCheckProfilesafeExtensions; + std::unique_ptr<weld::CheckButton> mxCBDisableAllExtensions; + std::unique_ptr<weld::CheckButton> mxCBDeinstallUserExtensions; + std::unique_ptr<weld::CheckButton> mxCBResetSharedExtensions; + std::unique_ptr<weld::CheckButton> mxCBResetBundledExtensions; + std::unique_ptr<weld::CheckButton> mxCBDisableHWAcceleration; + std::unique_ptr<weld::CheckButton> mxCBResetCustomizations; + std::unique_ptr<weld::CheckButton> mxCBResetWholeUserProfile; + + std::unique_ptr<weld::LinkButton> mxBugLink; + std::unique_ptr<weld::LinkButton> mxUserProfileLink; + std::unique_ptr<weld::Button> mxBtnCreateZip; + std::unique_ptr<weld::Expander> mxExpander; // local BackupFileHelper for handling possible restores comphelper::BackupFileHelper maBackupFileHelper; @@ -66,10 +57,10 @@ private: void enableDisableWidgets(); void applyChanges(); - DECL_LINK(RadioBtnHdl, Button*, void); - DECL_LINK(CheckBoxHdl, CheckBox&, void); - DECL_LINK(CreateZipBtnHdl, Button*, void); - DECL_LINK(DialogBtnHdl, Button*, void); + DECL_LINK(RadioBtnHdl, weld::Button&, void); + DECL_LINK(CheckBoxHdl, weld::ToggleButton&, void); + DECL_LINK(CreateZipBtnHdl, weld::Button&, void); + DECL_LINK(DialogBtnHdl, weld::Button&, void); }; #endif diff --git a/svx/source/dialog/SafeModeUI.cxx b/svx/source/dialog/SafeModeUI.cxx index 970bef37ce47..541057e0c846 100644 --- a/svx/source/dialog/SafeModeUI.cxx +++ b/svx/source/dialog/SafeModeUI.cxx @@ -14,6 +14,7 @@ #include <cppuhelper/supportsservice.hxx> #include <vcl/svapp.hxx> +#include <vcl/window.hxx> #include "SafeModeDialog.hxx" @@ -61,8 +62,9 @@ css::uno::Any SAL_CALL SafeModeUI::dispatchWithReturnValue(const css::util::URL& { SolarMutexGuard aGuard; css::uno::Any aRet; - ScopedVclPtrInstance<SafeModeDialog> xDialog(nullptr); - xDialog->Execute(); + vcl::Window* pParentWindow = Application::GetDefDialogParent(); + SafeModeDialog aDialog(pParentWindow ? pParentWindow->GetFrameWeld() : nullptr); + aDialog.run(); return aRet; } diff --git a/svx/uiconfig/ui/safemodedialog.ui b/svx/uiconfig/ui/safemodedialog.ui index cdff5a8b387f..c48526f3fc59 100644 --- a/svx/uiconfig/ui/safemodedialog.ui +++ b/svx/uiconfig/ui/safemodedialog.ui @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<!-- Generated with glade 3.20.0 --> +<!-- Generated with glade 3.22.1 --> <interface domain="svx"> <requires lib="gtk+" version="3.18"/> <object class="GtkDialog" id="SafeModeDialog"> @@ -7,7 +7,13 @@ <property name="border_width">6</property> <property name="title" translatable="yes" context="safemodedialog|SafeModeDialog">Safe Mode</property> <property name="resizable">False</property> + <property name="modal">True</property> + <property name="default_width">0</property> + <property name="default_height">0</property> <property name="type_hint">dialog</property> + <child> + <placeholder/> + </child> <child internal-child="vbox"> <object class="GtkBox" id="dialog-vbox1"> <property name="can_focus">False</property> @@ -37,6 +43,7 @@ <property name="label" translatable="yes" context="safemodedialog|btn_continue">_Continue in Safe Mode</property> <property name="visible">True</property> <property name="can_focus">True</property> + <property name="can_default">True</property> <property name="has_default">True</property> <property name="receives_default">True</property> <property name="use_underline">True</property> @@ -114,7 +121,6 @@ You can make one or more of the following changes to your user profile to return <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> @@ -482,5 +488,4 @@ You can make one or more of the following changes to your user profile to return <action-widget response="-11">help</action-widget> </action-widgets> </object> - <object class="GtkActionGroup" id="actiongroup1"/> </interface> |