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

weld SwMailMergeFieldConnectionsDlg

Change-Id: I15ee027db596c98eef878e2e174429c532789dad
Reviewed-on: https://gerrit.libreoffice.org/61871
Tested-by: Jenkins
Reviewed-by: 's avatarCaolán McNamara <caolanm@redhat.com>
Tested-by: 's avatarCaolán McNamara <caolanm@redhat.com>
üst 2410cce3
......@@ -460,7 +460,7 @@ public:
sal_Int32 nCommandType,
const css::uno::Reference< css::sdbc::XConnection>& xConnection ) = 0;
virtual VclPtr<AbstractMailMergeCreateFromDlg> CreateMailMergeCreateFromDlg(vcl::Window* pParent) = 0;
virtual VclPtr<AbstractMailMergeFieldConnectionsDlg> CreateMailMergeFieldConnectionsDlg(vcl::Window* pParent) = 0;
virtual VclPtr<AbstractMailMergeFieldConnectionsDlg> CreateMailMergeFieldConnectionsDlg(weld::Window* pParent) = 0;
virtual VclPtr<VclAbstractDialog> CreateMultiTOXMarkDlg(weld::Window* pParent, SwTOXMgr &rTOXMgr) = 0;
virtual VclPtr<SfxAbstractTabDialog> CreateOutlineTabDialog(weld::Window* pParent,
const SfxItemSet* pSwItemSet,
......
......@@ -214,7 +214,12 @@ short AbstractJavaEditDialog_Impl::Execute()
IMPL_ABSTDLG_BASE(AbstractMailMergeDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractMailMergeCreateFromDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractMailMergeFieldConnectionsDlg_Impl);
short AbstractMailMergeFieldConnectionsDlg_Impl::Execute()
{
return m_xDlg->run();
}
IMPL_ABSTDLG_BASE(AbstractMultiTOXTabDialog_Impl);
IMPL_ABSTDLG_BASE(AbstractEditRegionDlg_Impl);
IMPL_ABSTDLG_BASE(AbstractInsertSectionTabDialog_Impl);
......@@ -637,7 +642,7 @@ bool AbstractMailMergeCreateFromDlg_Impl::IsThisDocument() const
bool AbstractMailMergeFieldConnectionsDlg_Impl::IsUseExistingConnections() const
{
return pDlg->IsUseExistingConnections();
return m_xDlg->IsUseExistingConnections();
}
CurTOXType AbstractMultiTOXTabDialog_Impl::GetCurrentTOXType() const
......@@ -1040,10 +1045,9 @@ VclPtr<AbstractMailMergeCreateFromDlg> SwAbstractDialogFactory_Impl::CreateMailM
return VclPtr<AbstractMailMergeCreateFromDlg_Impl>::Create(pDlg);
}
VclPtr<AbstractMailMergeFieldConnectionsDlg> SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg(vcl::Window* pParent)
VclPtr<AbstractMailMergeFieldConnectionsDlg> SwAbstractDialogFactory_Impl::CreateMailMergeFieldConnectionsDlg(weld::Window* pParent)
{
VclPtr<SwMailMergeFieldConnectionsDlg> pDlg = VclPtr<SwMailMergeFieldConnectionsDlg>::Create( pParent );
return VclPtr<AbstractMailMergeFieldConnectionsDlg_Impl>::Create( pDlg );
return VclPtr<AbstractMailMergeFieldConnectionsDlg_Impl>::Create(o3tl::make_unique<SwMailMergeFieldConnectionsDlg>(pParent));
}
VclPtr<VclAbstractDialog> SwAbstractDialogFactory_Impl::CreateMultiTOXMarkDlg(weld::Window* pParent, SwTOXMgr &rTOXMgr)
......
......@@ -508,8 +508,15 @@ class AbstractMailMergeCreateFromDlg_Impl : public AbstractMailMergeCreateFromDl
class SwMailMergeFieldConnectionsDlg;
class AbstractMailMergeFieldConnectionsDlg_Impl : public AbstractMailMergeFieldConnectionsDlg
{
DECL_ABSTDLG_BASE(AbstractMailMergeFieldConnectionsDlg_Impl,SwMailMergeFieldConnectionsDlg)
virtual bool IsUseExistingConnections() const override ;
protected:
std::unique_ptr<SwMailMergeFieldConnectionsDlg> m_xDlg;
public:
explicit AbstractMailMergeFieldConnectionsDlg_Impl(std::unique_ptr<SwMailMergeFieldConnectionsDlg> p)
: m_xDlg(std::move(p))
{
}
virtual short Execute() override;
virtual bool IsUseExistingConnections() const override ;
};
class SwMultiTOXTabDialog;
......@@ -670,7 +677,7 @@ public:
sal_Int32 nCommandType,
const css::uno::Reference< css::sdbc::XConnection>& xConnection ) override;
virtual VclPtr<AbstractMailMergeCreateFromDlg> CreateMailMergeCreateFromDlg(vcl::Window* pParent) override;
virtual VclPtr<AbstractMailMergeFieldConnectionsDlg> CreateMailMergeFieldConnectionsDlg(vcl::Window* pParent) override;
virtual VclPtr<AbstractMailMergeFieldConnectionsDlg> CreateMailMergeFieldConnectionsDlg(weld::Window* pParent) override;
virtual VclPtr<VclAbstractDialog> CreateMultiTOXMarkDlg(weld::Window* pParent, SwTOXMgr &rTOXMgr) override;
virtual VclPtr<SfxAbstractTabDialog> CreateOutlineTabDialog(weld::Window* pParent, const SfxItemSet* pSwItemSet,
SwWrtShell &) override;
......
......@@ -634,22 +634,14 @@ void SwMailMergeCreateFromDlg::dispose()
ModalDialog::dispose();
}
SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(vcl::Window* pParent)
: ModalDialog(pParent, "MergeConnectDialog",
"modules/swriter/ui/mergeconnectdialog.ui")
SwMailMergeFieldConnectionsDlg::SwMailMergeFieldConnectionsDlg(weld::Window* pParent)
: GenericDialogController(pParent, "modules/swriter/ui/mergeconnectdialog.ui", "MergeConnectDialog")
, m_xUseExistingRB(m_xBuilder->weld_radio_button("existing"))
{
get(m_pUseExistingRB, "existing");
}
SwMailMergeFieldConnectionsDlg::~SwMailMergeFieldConnectionsDlg()
{
disposeOnce();
}
void SwMailMergeFieldConnectionsDlg::dispose()
{
m_pUseExistingRB.clear();
ModalDialog::dispose();
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
......@@ -152,17 +152,16 @@ public:
}
};
class SwMailMergeFieldConnectionsDlg : public ModalDialog
class SwMailMergeFieldConnectionsDlg : public weld::GenericDialogController
{
VclPtr<RadioButton> m_pUseExistingRB;
std::unique_ptr<weld::RadioButton> m_xUseExistingRB;
public:
SwMailMergeFieldConnectionsDlg(vcl::Window* pParent);
SwMailMergeFieldConnectionsDlg(weld::Window* pParent);
virtual ~SwMailMergeFieldConnectionsDlg() override;
virtual void dispose() override;
bool IsUseExistingConnections() const
{
return m_pUseExistingRB->IsChecked();
return m_xUseExistingRB->get_active();
}
};
......
......@@ -2308,7 +2308,7 @@ void SwView::GenerateFormLetter(bool bUseCurrentDocument)
{
//take an existing data source or create a new one?
SwAbstractDialogFactory* pFact = SwAbstractDialogFactory::Create();
ScopedVclPtr<AbstractMailMergeFieldConnectionsDlg> pConnectionsDlg( pFact->CreateMailMergeFieldConnectionsDlg(&GetViewFrame()->GetWindow()) );
ScopedVclPtr<AbstractMailMergeFieldConnectionsDlg> pConnectionsDlg(pFact->CreateMailMergeFieldConnectionsDlg(GetFrameWeld()));
if(RET_OK == pConnectionsDlg->Execute())
bCallAddressPilot = !pConnectionsDlg->IsUseExistingConnections();
else
......
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.22.1 -->
<interface domain="sw">
<!-- interface-requires gtk+ 3.0 -->
<requires lib="gtk+" version="3.18"/>
<object class="GtkDialog" id="MergeConnectDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="title" translatable="yes" context="mergeconnectdialog|MergeConnectDialog">Data Source Connection</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>
......@@ -57,6 +61,7 @@
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
<property name="secondary">True</property>
</packing>
</child>
</object>
......@@ -98,13 +103,10 @@
<property name="xalign">0</property>
<property name="active">True</property>
<property name="draw_indicator">True</property>
<property name="group">new</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">0</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
......@@ -121,25 +123,21 @@
<packing>
<property name="left_attach">0</property>
<property name="top_attach">1</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
<property name="label" translatable="yes" context="mergeconnectdialog|label2">Fields are used to personalize form letters. The fields are placeholders for data from a data source, such as a database. The fields in the form letter must be connected to the data source.</property>
<property name="wrap">True</property>
<property name="max_width_chars">52</property>
<property name="xalign">0</property>
<property name="yalign">0</property>
</object>
<packing>
<property name="left_attach">0</property>
<property name="top_attach">2</property>
<property name="width">1</property>
<property name="height">1</property>
</packing>
</child>
</object>
......
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