diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-17 09:52:29 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-17 14:08:07 +0200 |
commit | 6c8c47429936c30ebb760253fa4078c1e410eea5 (patch) | |
tree | f3c6ffeca318801302c7c35a36c69a95c9d52b50 | |
parent | 2410cce33e9bde53cecd8d2d5a73ab91121567e3 (diff) |
weld SwMailMergeFieldConnectionsDlg
Change-Id: I15ee027db596c98eef878e2e174429c532789dad
Reviewed-on: https://gerrit.libreoffice.org/61871
Tested-by: Jenkins
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r-- | sw/inc/swabstdlg.hxx | 2 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.cxx | 14 | ||||
-rw-r--r-- | sw/source/ui/dialog/swdlgfact.hxx | 13 | ||||
-rw-r--r-- | sw/source/ui/envelp/mailmrge.cxx | 14 | ||||
-rw-r--r-- | sw/source/uibase/inc/mailmrge.hxx | 9 | ||||
-rw-r--r-- | sw/source/uibase/uiview/view2.cxx | 2 | ||||
-rw-r--r-- | sw/uiconfig/swriter/ui/mergeconnectdialog.ui | 18 |
7 files changed, 36 insertions, 36 deletions
diff --git a/sw/inc/swabstdlg.hxx b/sw/inc/swabstdlg.hxx index 8478b77b990f..fdd6a431544f 100644 --- a/sw/inc/swabstdlg.hxx +++ b/sw/inc/swabstdlg.hxx @@ -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, diff --git a/sw/source/ui/dialog/swdlgfact.cxx b/sw/source/ui/dialog/swdlgfact.cxx index e8eb7119af93..6dca63b32f43 100644 --- a/sw/source/ui/dialog/swdlgfact.cxx +++ b/sw/source/ui/dialog/swdlgfact.cxx @@ -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) diff --git a/sw/source/ui/dialog/swdlgfact.hxx b/sw/source/ui/dialog/swdlgfact.hxx index 6471d1864c4c..07953242d358 100644 --- a/sw/source/ui/dialog/swdlgfact.hxx +++ b/sw/source/ui/dialog/swdlgfact.hxx @@ -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; diff --git a/sw/source/ui/envelp/mailmrge.cxx b/sw/source/ui/envelp/mailmrge.cxx index 6230ad636d48..9bcd53d6c206 100644 --- a/sw/source/ui/envelp/mailmrge.cxx +++ b/sw/source/ui/envelp/mailmrge.cxx @@ -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: */ diff --git a/sw/source/uibase/inc/mailmrge.hxx b/sw/source/uibase/inc/mailmrge.hxx index 6a2b5bf53566..23f51e363d8d 100644 --- a/sw/source/uibase/inc/mailmrge.hxx +++ b/sw/source/uibase/inc/mailmrge.hxx @@ -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(); } }; diff --git a/sw/source/uibase/uiview/view2.cxx b/sw/source/uibase/uiview/view2.cxx index 8d2b1e91eabc..93bc535e9b31 100644 --- a/sw/source/uibase/uiview/view2.cxx +++ b/sw/source/uibase/uiview/view2.cxx @@ -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 diff --git a/sw/uiconfig/swriter/ui/mergeconnectdialog.ui b/sw/uiconfig/swriter/ui/mergeconnectdialog.ui index 162196ad0cbf..dc2fa1f82e96 100644 --- a/sw/uiconfig/swriter/ui/mergeconnectdialog.ui +++ b/sw/uiconfig/swriter/ui/mergeconnectdialog.ui @@ -1,11 +1,15 @@ <?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> |