diff options
Diffstat (limited to 'cui')
-rw-r--r-- | cui/inc/strings.hrc | 2 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.cxx | 25 | ||||
-rw-r--r-- | cui/source/factory/dlgfact.hxx | 2 | ||||
-rw-r--r-- | cui/source/inc/dbregister.hxx | 9 | ||||
-rw-r--r-- | cui/source/options/dbregister.cxx | 16 |
5 files changed, 21 insertions, 33 deletions
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<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateEventConfigDialog(we return VclPtr<CuiAbstractSingleTabController_Impl>::Create(std::make_unique<SfxMacroAssignDlg>(pParent, _rxDocumentFrame, rAttr)); } -VclPtr<SfxAbstractDialog> AbstractDialogFactory_Impl::CreateSfxDialog(vcl::Window* pParent, +VclPtr<SfxAbstractDialog> 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<CuiAbstractSingleTabController_Impl>::Create(std::make_unique<SvxMeasureDialog>(pParent ? pParent->GetFrameWeld() : nullptr, rAttr, pView)); - } - case RID_SVXPAGE_CONNECTION : - return VclPtr<CuiAbstractSingleTabController_Impl>::Create(std::make_unique<SvxConnectionDialog>(pParent ? pParent->GetFrameWeld() : nullptr, rAttr, pView)); - - case RID_SFXPAGE_DBREGISTER : - pDlg = VclPtr<DatabaseRegistrationDialog>::Create( pParent, rAttr ); - break; - default: - break; + case RID_SVXPAGE_MEASURE: + return VclPtr<CuiAbstractSingleTabController_Impl>::Create(std::make_unique<SvxMeasureDialog>(pParent, rAttr, pView)); + case RID_SVXPAGE_CONNECTION: + return VclPtr<CuiAbstractSingleTabController_Impl>::Create(std::make_unique<SvxConnectionDialog>(pParent, rAttr, pView)); + case RID_SFXPAGE_DBREGISTER: + return VclPtr<CuiAbstractSingleTabController_Impl>::Create(std::make_unique<DatabaseRegistrationDialog>(pParent, rAttr)); } - if ( pDlg ) - return VclPtr<CuiAbstractSfxDialog_Impl>::Create( pDlg ); - return nullptr; } - VclPtr<AbstractSvxPostItDialog> 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<VclAbstractDialog> CreateVclDialog( vcl::Window* pParent, sal_uInt32 nResId ) override; - virtual VclPtr<SfxAbstractDialog> CreateSfxDialog( vcl::Window* pParent, + virtual VclPtr<SfxAbstractDialog> 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<SfxTabPage> page = DbRegistrationOptionsPage::Create(get_content_area(), &getRegistrationItems()); - SetTabPage(page); - SetText(page->get<VclFrame>("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() ) |