Kaydet (Commit) de097742 authored tarafından Caolán McNamara's avatar Caolán McNamara

weld SwMailMergeOutputTypePage

Change-Id: I4177bfd48b6af1cfc526e5ff43f00f1405ea647f
Reviewed-on: https://gerrit.libreoffice.org/61911Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst a1b9f7e8
......@@ -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 :
......
......@@ -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();
......
......@@ -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;
};
......
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