From 0faf4e5c2e98219b17e042594710f6872bf6a615 Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 12 Mar 2019 18:37:26 +0000 Subject: weld DatabaseRegistrationDialog MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I739785daef892ac16d2a41a98268f18670daeedb Reviewed-on: https://gerrit.libreoffice.org/69136 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- cui/inc/strings.hrc | 2 ++ cui/source/factory/dlgfact.cxx | 25 +++++++------------------ cui/source/factory/dlgfact.hxx | 2 +- cui/source/inc/dbregister.hxx | 9 +++------ cui/source/options/dbregister.cxx | 16 ++++++++-------- 5 files changed, 21 insertions(+), 33 deletions(-) (limited to 'cui') diff --git a/cui/inc/strings.hrc b/cui/inc/strings.hrc index 37dc1f719c9f..6627ad93bc44 100644 --- a/cui/inc/strings.hrc +++ b/cui/inc/strings.hrc @@ -390,6 +390,8 @@ #define RID_SVXSTR_FILTER_ALL NC_("RID_SVXSTR_FILTER_ALL", "All files") +#define RID_SVXSTR_REGISTERED_DATABASES NC_("RID_SVXSTR_REGISTERED_DATABASES", "Registered Databases") + #endif /* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/cui/source/factory/dlgfact.cxx b/cui/source/factory/dlgfact.cxx index b155a8685b9a..91b3e943621b 100644 --- a/cui/source/factory/dlgfact.cxx +++ b/cui/source/factory/dlgfact.cxx @@ -1304,35 +1304,24 @@ VclPtr AbstractDialogFactory_Impl::CreateEventConfigDialog(we return VclPtr::Create(std::make_unique(pParent, _rxDocumentFrame, rAttr)); } -VclPtr AbstractDialogFactory_Impl::CreateSfxDialog(vcl::Window* pParent, +VclPtr AbstractDialogFactory_Impl::CreateSfxDialog(weld::Window* pParent, const SfxItemSet& rAttr, const SdrView* pView, sal_uInt32 nResId) { - SfxSingleTabDialog* pDlg=nullptr; switch ( nResId ) { - case RID_SVXPAGE_MEASURE : - { - return VclPtr::Create(std::make_unique(pParent ? pParent->GetFrameWeld() : nullptr, rAttr, pView)); - } - case RID_SVXPAGE_CONNECTION : - return VclPtr::Create(std::make_unique(pParent ? pParent->GetFrameWeld() : nullptr, rAttr, pView)); - - case RID_SFXPAGE_DBREGISTER : - pDlg = VclPtr::Create( pParent, rAttr ); - break; - default: - break; + case RID_SVXPAGE_MEASURE: + return VclPtr::Create(std::make_unique(pParent, rAttr, pView)); + case RID_SVXPAGE_CONNECTION: + return VclPtr::Create(std::make_unique(pParent, rAttr, pView)); + case RID_SFXPAGE_DBREGISTER: + return VclPtr::Create(std::make_unique(pParent, rAttr)); } - if ( pDlg ) - return VclPtr::Create( pDlg ); - return nullptr; } - VclPtr AbstractDialogFactory_Impl::CreateSvxPostItDialog( weld::Window* pParent, const SfxItemSet& rCoreSet, bool bPrevNext ) diff --git a/cui/source/factory/dlgfact.hxx b/cui/source/factory/dlgfact.hxx index 44ad834a3b50..83e156abbf97 100644 --- a/cui/source/factory/dlgfact.hxx +++ b/cui/source/factory/dlgfact.hxx @@ -667,7 +667,7 @@ class AbstractDialogFactory_Impl : public SvxAbstractDialogFactory public: virtual VclPtr CreateVclDialog( vcl::Window* pParent, sal_uInt32 nResId ) override; - virtual VclPtr CreateSfxDialog( vcl::Window* pParent, + virtual VclPtr CreateSfxDialog( weld::Window* pParent, const SfxItemSet& rAttr, const SdrView* pView, sal_uInt32 nResId ) override; diff --git a/cui/source/inc/dbregister.hxx b/cui/source/inc/dbregister.hxx index 4e77f06f2e13..167090f40d0c 100644 --- a/cui/source/inc/dbregister.hxx +++ b/cui/source/inc/dbregister.hxx @@ -106,18 +106,15 @@ namespace svx }; class DatabaseRegistrationDialog :public RegistrationItemSetHolder - ,public SfxSingleTabDialog + ,public SfxSingleTabDialogController { public: - DatabaseRegistrationDialog( vcl::Window* pParent, const SfxItemSet& rAttr ); + DatabaseRegistrationDialog(weld::Window* pParent, const SfxItemSet& rAttr); - virtual short Execute() override; + virtual short run() override; }; - - } - #endif // INCLUDED_CUI_SOURCE_INC_DBREGISTER_HXX diff --git a/cui/source/options/dbregister.cxx b/cui/source/options/dbregister.cxx index 557d2e04e6c0..86f7375c35cd 100644 --- a/cui/source/options/dbregister.cxx +++ b/cui/source/options/dbregister.cxx @@ -71,19 +71,19 @@ RegistrationItemSetHolder::~RegistrationItemSetHolder() // class DatabaseRegistrationDialog ------------------------------------------------ -DatabaseRegistrationDialog::DatabaseRegistrationDialog( vcl::Window* pParent, const SfxItemSet& rInAttrs ) +DatabaseRegistrationDialog::DatabaseRegistrationDialog(weld::Window* pParent, const SfxItemSet& rInAttrs) : RegistrationItemSetHolder(rInAttrs) - , SfxSingleTabDialog(pParent, getRegistrationItems()) + , SfxSingleTabDialogController(pParent, getRegistrationItems()) { - VclPtr page = DbRegistrationOptionsPage::Create(get_content_area(), &getRegistrationItems()); - SetTabPage(page); - SetText(page->get("frame1")->get_label()); + TabPageParent aParent(get_content_area(), this); + SetTabPage(DbRegistrationOptionsPage::Create(aParent, &getRegistrationItems())); + m_xDialog->set_title(CuiResId(RID_SVXSTR_REGISTERED_DATABASES)); } -short DatabaseRegistrationDialog::Execute() +short DatabaseRegistrationDialog::run() { - short result = SfxSingleTabDialog::Execute(); - if ( result == RET_OK ) + short result = SfxSingleTabDialogController::run(); + if (result == RET_OK) { DBG_ASSERT( GetOutputItemSet(), "DatabaseRegistrationDialog::Execute: no output items!" ); if ( GetOutputItemSet() ) -- cgit