diff options
author | Caolán McNamara <caolanm@redhat.com> | 2019-07-26 20:12:30 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2019-07-27 12:51:46 +0200 |
commit | ac1ae3e055f9104b40a12a8f5b6418817230af0d (patch) | |
tree | 02997fb9ef280e9dd1e11d9d57039f0613877a5f | |
parent | e171aec015212aa295e5e1831474b8af636e477b (diff) |
weld SvxAccessibilityOptionsTabPage
Change-Id: I77354538eb8ff31dcc3bfc3d5a7742e92b8cd7b5
Reviewed-on: https://gerrit.libreoffice.org/76455
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | cui/source/options/optaccessibility.cxx | 80 | ||||
-rw-r--r-- | cui/source/options/optaccessibility.hxx | 18 |
2 files changed, 40 insertions, 58 deletions
diff --git a/cui/source/options/optaccessibility.cxx b/cui/source/options/optaccessibility.cxx index 716fc042d7fe..47b44435e3f9 100644 --- a/cui/source/options/optaccessibility.cxx +++ b/cui/source/options/optaccessibility.cxx @@ -22,69 +22,53 @@ #include <vcl/svapp.hxx> #include <officecfg/Office/Common.hxx> -SvxAccessibilityOptionsTabPage::SvxAccessibilityOptionsTabPage(vcl::Window* pParent, +SvxAccessibilityOptionsTabPage::SvxAccessibilityOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet) - : SfxTabPage(pParent, "OptAccessibilityPage", - "cui/ui/optaccessibilitypage.ui", &rSet) + : SfxTabPage(pParent, "cui/ui/optaccessibilitypage.ui", "OptAccessibilityPage", &rSet) + , m_xAccessibilityTool(m_xBuilder->weld_check_button("acctool")) + , m_xTextSelectionInReadonly(m_xBuilder->weld_check_button("textselinreadonly")) + , m_xAnimatedGraphics(m_xBuilder->weld_check_button("animatedgraphics")) + , m_xAnimatedTexts(m_xBuilder->weld_check_button("animatedtext")) + , m_xAutoDetectHC(m_xBuilder->weld_check_button("autodetecthc")) + , m_xAutomaticFontColor(m_xBuilder->weld_check_button("autofontcolor")) + , m_xPagePreviews(m_xBuilder->weld_check_button("systempagepreviewcolor")) { - get(m_pAccessibilityTool, "acctool"); - get(m_pTextSelectionInReadonly, "textselinreadonly"); - get(m_pAnimatedGraphics, "animatedgraphics"); - get(m_pAnimatedTexts, "animatedtext"); - - get(m_pAutoDetectHC, "autodetecthc"); - get(m_pAutomaticFontColor, "autofontcolor"); - get(m_pPagePreviews, "systempagepreviewcolor"); - #ifdef UNX // UNIX: read the gconf2 setting instead to use the checkbox - m_pAccessibilityTool->Hide(); + m_xAccessibilityTool->hide(); #endif } SvxAccessibilityOptionsTabPage::~SvxAccessibilityOptionsTabPage() { - disposeOnce(); -} - -void SvxAccessibilityOptionsTabPage::dispose() -{ - m_pAccessibilityTool.clear(); - m_pTextSelectionInReadonly.clear(); - m_pAnimatedGraphics.clear(); - m_pAnimatedTexts.clear(); - m_pAutoDetectHC.clear(); - m_pAutomaticFontColor.clear(); - m_pPagePreviews.clear(); - SfxTabPage::dispose(); } -VclPtr<SfxTabPage> SvxAccessibilityOptionsTabPage::Create( TabPageParent pParent, const SfxItemSet* rAttrSet ) +VclPtr<SfxTabPage> SvxAccessibilityOptionsTabPage::Create(TabPageParent pParent, const SfxItemSet* rAttrSet) { - return VclPtr<SvxAccessibilityOptionsTabPage>::Create(pParent.pParent, *rAttrSet); + return VclPtr<SvxAccessibilityOptionsTabPage>::Create(pParent, *rAttrSet); } bool SvxAccessibilityOptionsTabPage::FillItemSet( SfxItemSet* ) { std::shared_ptr<comphelper::ConfigurationChanges> batch( comphelper::ConfigurationChanges::create() ); if ( !officecfg::Office::Common::Accessibility::IsForPagePreviews::isReadOnly() ) - officecfg::Office::Common::Accessibility::IsForPagePreviews::set(m_pPagePreviews->IsChecked(), batch); + officecfg::Office::Common::Accessibility::IsForPagePreviews::set(m_xPagePreviews->get_active(), batch); if ( !officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::isReadOnly() ) - officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::set(m_pAnimatedGraphics->IsChecked(), batch); + officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::set(m_xAnimatedGraphics->get_active(), batch); if ( !officecfg::Office::Common::Accessibility::IsAllowAnimatedText::isReadOnly() ) - officecfg::Office::Common::Accessibility::IsAllowAnimatedText::set(m_pAnimatedTexts->IsChecked(), batch); + officecfg::Office::Common::Accessibility::IsAllowAnimatedText::set(m_xAnimatedTexts->get_active(), batch); if ( !officecfg::Office::Common::Accessibility::IsAutomaticFontColor::isReadOnly() ) - officecfg::Office::Common::Accessibility::IsAutomaticFontColor::set(m_pAutomaticFontColor->IsChecked(), batch); + officecfg::Office::Common::Accessibility::IsAutomaticFontColor::set(m_xAutomaticFontColor->get_active(), batch); if ( !officecfg::Office::Common::Accessibility::IsSelectionInReadonly::isReadOnly() ) - officecfg::Office::Common::Accessibility::IsSelectionInReadonly::set(m_pTextSelectionInReadonly->IsChecked(), batch); + officecfg::Office::Common::Accessibility::IsSelectionInReadonly::set(m_xTextSelectionInReadonly->get_active(), batch); if ( !officecfg::Office::Common::Accessibility::AutoDetectSystemHC::isReadOnly() ) - officecfg::Office::Common::Accessibility::AutoDetectSystemHC::set(m_pAutoDetectHC->IsChecked(), batch); + officecfg::Office::Common::Accessibility::AutoDetectSystemHC::set(m_xAutoDetectHC->get_active(), batch); batch->commit(); AllSettings aAllSettings = Application::GetSettings(); MiscSettings aMiscSettings = aAllSettings.GetMiscSettings(); #ifndef UNX - aMiscSettings.SetEnableATToolSupport(m_pAccessibilityTool->IsChecked()); + aMiscSettings.SetEnableATToolSupport(m_xAccessibilityTool->get_active()); #endif aAllSettings.SetMiscSettings(aMiscSettings); Application::MergeSystemSettings( aAllSettings ); @@ -95,33 +79,33 @@ bool SvxAccessibilityOptionsTabPage::FillItemSet( SfxItemSet* ) void SvxAccessibilityOptionsTabPage::Reset( const SfxItemSet* ) { - m_pPagePreviews->Check( officecfg::Office::Common::Accessibility::IsForPagePreviews::get() ); + m_xPagePreviews->set_active( officecfg::Office::Common::Accessibility::IsForPagePreviews::get() ); if( officecfg::Office::Common::Accessibility::IsForPagePreviews::isReadOnly() ) - m_pPagePreviews->Disable(); + m_xPagePreviews->set_sensitive(false); - m_pAnimatedGraphics->Check( officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::get() ); + m_xAnimatedGraphics->set_active( officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::get() ); if( officecfg::Office::Common::Accessibility::IsAllowAnimatedGraphics::isReadOnly() ) - m_pAnimatedGraphics->Disable(); + m_xAnimatedGraphics->set_sensitive(false); - m_pAnimatedTexts->Check( officecfg::Office::Common::Accessibility::IsAllowAnimatedText::get() ); + m_xAnimatedTexts->set_active( officecfg::Office::Common::Accessibility::IsAllowAnimatedText::get() ); if( officecfg::Office::Common::Accessibility::IsAllowAnimatedText::isReadOnly() ) - m_pAnimatedTexts->Disable(); + m_xAnimatedTexts->set_sensitive(false); - m_pAutomaticFontColor->Check( officecfg::Office::Common::Accessibility::IsAutomaticFontColor::get() ); + m_xAutomaticFontColor->set_active( officecfg::Office::Common::Accessibility::IsAutomaticFontColor::get() ); if( officecfg::Office::Common::Accessibility::IsAutomaticFontColor::isReadOnly() ) - m_pAutomaticFontColor->Disable(); + m_xAutomaticFontColor->set_sensitive(false); - m_pTextSelectionInReadonly->Check( officecfg::Office::Common::Accessibility::IsSelectionInReadonly::get() ); + m_xTextSelectionInReadonly->set_active( officecfg::Office::Common::Accessibility::IsSelectionInReadonly::get() ); if( officecfg::Office::Common::Accessibility::IsSelectionInReadonly::isReadOnly() ) - m_pTextSelectionInReadonly->Disable(); + m_xTextSelectionInReadonly->set_sensitive(false); - m_pAutoDetectHC->Check( officecfg::Office::Common::Accessibility::AutoDetectSystemHC::get() ); + m_xAutoDetectHC->set_active( officecfg::Office::Common::Accessibility::AutoDetectSystemHC::get() ); if( officecfg::Office::Common::Accessibility::AutoDetectSystemHC::isReadOnly() ) - m_pAutoDetectHC->Disable(); + m_xAutoDetectHC->set_sensitive(false); AllSettings aAllSettings = Application::GetSettings(); const MiscSettings& aMiscSettings = aAllSettings.GetMiscSettings(); - m_pAccessibilityTool->Check(aMiscSettings.GetEnableATToolSupport()); + m_xAccessibilityTool->set_active(aMiscSettings.GetEnableATToolSupport()); } /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/options/optaccessibility.hxx b/cui/source/options/optaccessibility.hxx index 359a2a286ab4..5a1ed1bbb3c2 100644 --- a/cui/source/options/optaccessibility.hxx +++ b/cui/source/options/optaccessibility.hxx @@ -20,22 +20,20 @@ #define INCLUDED_CUI_SOURCE_OPTIONS_OPTACCESSIBILITY_HXX #include <sfx2/tabdlg.hxx> -#include <vcl/button.hxx> class SvxAccessibilityOptionsTabPage : public SfxTabPage { - VclPtr<CheckBox> m_pAccessibilityTool; - VclPtr<CheckBox> m_pTextSelectionInReadonly; - VclPtr<CheckBox> m_pAnimatedGraphics; - VclPtr<CheckBox> m_pAnimatedTexts; - VclPtr<CheckBox> m_pAutoDetectHC; - VclPtr<CheckBox> m_pAutomaticFontColor; - VclPtr<CheckBox> m_pPagePreviews; + std::unique_ptr<weld::CheckButton> m_xAccessibilityTool; + std::unique_ptr<weld::CheckButton> m_xTextSelectionInReadonly; + std::unique_ptr<weld::CheckButton> m_xAnimatedGraphics; + std::unique_ptr<weld::CheckButton> m_xAnimatedTexts; + std::unique_ptr<weld::CheckButton> m_xAutoDetectHC; + std::unique_ptr<weld::CheckButton> m_xAutomaticFontColor; + std::unique_ptr<weld::CheckButton> m_xPagePreviews; public: - SvxAccessibilityOptionsTabPage( vcl::Window* pParent, const SfxItemSet& rSet ); + SvxAccessibilityOptionsTabPage(TabPageParent pParent, const SfxItemSet& rSet); virtual ~SvxAccessibilityOptionsTabPage() override; - virtual void dispose() override; static VclPtr<SfxTabPage> Create( TabPageParent pParent, const SfxItemSet* rAttrSet ); virtual bool FillItemSet( SfxItemSet* rSet ) override; |