diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-18 09:33:49 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-18 15:08:19 +0200 |
commit | de09774238831ad43ec6e7ec7778db4d6a88fe3e (patch) | |
tree | 90366872f6b99330385dafe31c02f9ba1e1a64f0 /sw | |
parent | a1b9f7e81aa1a105bbac08d310825f367dbfe601 (diff) |
weld SwMailMergeOutputTypePage
Change-Id: I4177bfd48b6af1cfc526e5ff43f00f1405ea647f
Reviewed-on: https://gerrit.libreoffice.org/61911
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'sw')
-rw-r--r-- | sw/source/ui/dbui/mailmergewizard.cxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmoutputtypepage.cxx | 41 | ||||
-rw-r--r-- | sw/source/ui/dbui/mmoutputtypepage.hxx | 17 |
3 files changed, 26 insertions, 34 deletions
diff --git a/sw/source/ui/dbui/mailmergewizard.cxx b/sw/source/ui/dbui/mailmergewizard.cxx index 43234669beef..5883c910dce0 100644 --- a/sw/source/ui/dbui/mailmergewizard.cxx +++ b/sw/source/ui/dbui/mailmergewizard.cxx @@ -102,7 +102,7 @@ VclPtr<TabPage> SwMailMergeWizard::createPage(WizardState _nState) SetRoadmapHelpId("modules/swriter/ui/mmselectpage/MMSelectPage"); break; case MM_OUTPUTTYPETPAGE : - pRet = VclPtr<SwMailMergeOutputTypePage>::Create(this); + pRet = VclPtr<SwMailMergeOutputTypePage>::Create(this, TabPageParent(this)); SetRoadmapHelpId("modules/swriter/ui/mmoutputtypepage/MMOutputTypePage"); break; case MM_ADDRESSBLOCKPAGE : diff --git a/sw/source/ui/dbui/mmoutputtypepage.cxx b/sw/source/ui/dbui/mmoutputtypepage.cxx index 78328fe95788..ae0171148c8a 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.cxx +++ b/sw/source/ui/dbui/mmoutputtypepage.cxx @@ -39,26 +39,24 @@ using namespace ::com::sun::star; -SwMailMergeOutputTypePage::SwMailMergeOutputTypePage(SwMailMergeWizard* pParent) - : svt::OWizardPage(pParent, "MMOutputTypePage", - "modules/swriter/ui/mmoutputtypepage.ui") - , m_pWizard(pParent) +SwMailMergeOutputTypePage::SwMailMergeOutputTypePage(SwMailMergeWizard* pWizard, TabPageParent pParent) + : svt::OWizardPage(pParent, "modules/swriter/ui/mmoutputtypepage.ui", "MMOutputTypePage") + , m_pWizard(pWizard) + , m_xLetterRB(m_xBuilder->weld_radio_button("letter")) + , m_xMailRB(m_xBuilder->weld_radio_button("email")) + , m_xLetterHint(m_xBuilder->weld_label("letterft")) + , m_xMailHint(m_xBuilder->weld_label("emailft")) { - get(m_pLetterRB, "letter"); - get(m_pMailRB, "email"); - get(m_pLetterHint, "letterft"); - get(m_pMailHint, "emailft"); - - Link<Button*,void> aLink = LINK(this, SwMailMergeOutputTypePage, TypeHdl_Impl); - m_pLetterRB->SetClickHdl(aLink); - m_pMailRB->SetClickHdl(aLink); + Link<weld::ToggleButton&,void> aLink = LINK(this, SwMailMergeOutputTypePage, TypeHdl_Impl); + m_xLetterRB->connect_toggled(aLink); + m_xMailRB->connect_toggled(aLink); SwMailMergeConfigItem& rConfigItem = m_pWizard->GetConfigItem(); if(rConfigItem.IsOutputToLetter()) - m_pLetterRB->Check(); + m_xLetterRB->set_active(true); else - m_pMailRB->Check(); - TypeHdl_Impl(m_pLetterRB); + m_xMailRB->set_active(true); + TypeHdl_Impl(*m_xLetterRB); } SwMailMergeOutputTypePage::~SwMailMergeOutputTypePage() @@ -68,20 +66,15 @@ SwMailMergeOutputTypePage::~SwMailMergeOutputTypePage() void SwMailMergeOutputTypePage::dispose() { - m_pLetterRB.clear(); - m_pMailRB.clear(); - m_pLetterHint.clear(); - m_pMailHint.clear(); m_pWizard.clear(); svt::OWizardPage::dispose(); } - -IMPL_LINK_NOARG(SwMailMergeOutputTypePage, TypeHdl_Impl, Button*, void) +IMPL_LINK_NOARG(SwMailMergeOutputTypePage, TypeHdl_Impl, weld::ToggleButton&, void) { - bool bLetter = m_pLetterRB->IsChecked(); - m_pLetterHint->Show(bLetter); - m_pMailHint->Show(!bLetter); + bool bLetter = m_xLetterRB->get_active(); + m_xLetterHint->show(bLetter); + m_xMailHint->show(!bLetter); m_pWizard->GetConfigItem().SetOutputToLetter(bLetter); m_pWizard->updateRoadmapItemLabel( MM_ADDRESSBLOCKPAGE ); m_pWizard->UpdateRoadmap(); diff --git a/sw/source/ui/dbui/mmoutputtypepage.hxx b/sw/source/ui/dbui/mmoutputtypepage.hxx index 99a4e4185068..258a2a03695c 100644 --- a/sw/source/ui/dbui/mmoutputtypepage.hxx +++ b/sw/source/ui/dbui/mmoutputtypepage.hxx @@ -20,24 +20,23 @@ #define INCLUDED_SW_SOURCE_UI_DBUI_MMOUTPUTTYPEPAGE_HXX #include <svtools/wizardmachine.hxx> -#include <vcl/button.hxx> +#include <vcl/weld.hxx> #include <mailmergehelper.hxx> class SwMailMergeWizard; class SwMailMergeOutputTypePage : public svt::OWizardPage { - VclPtr<RadioButton> m_pLetterRB; - VclPtr<RadioButton> m_pMailRB; - - VclPtr<FixedText> m_pLetterHint; - VclPtr<FixedText> m_pMailHint; - VclPtr<SwMailMergeWizard> m_pWizard; - DECL_LINK(TypeHdl_Impl, Button*, void); + std::unique_ptr<weld::RadioButton> m_xLetterRB; + std::unique_ptr<weld::RadioButton> m_xMailRB; + std::unique_ptr<weld::Label> m_xLetterHint; + std::unique_ptr<weld::Label> m_xMailHint; + + DECL_LINK(TypeHdl_Impl, weld::ToggleButton&, void); public: - SwMailMergeOutputTypePage( SwMailMergeWizard* _pParent); + SwMailMergeOutputTypePage(SwMailMergeWizard* pWizard, TabPageParent pParent); virtual ~SwMailMergeOutputTypePage() override; virtual void dispose() override; }; |