summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2019-03-12 18:37:26 +0000
committerCaolán McNamara <caolanm@redhat.com>2019-03-13 09:53:32 +0100
commit0faf4e5c2e98219b17e042594710f6872bf6a615 (patch)
tree618ec137e00e30bbf6ab25d33374c8d20576853d
parentfdc44bd929f038182dda4ea951f3b70dfc67f8d1 (diff)
weld DatabaseRegistrationDialog
Change-Id: I739785daef892ac16d2a41a98268f18670daeedb Reviewed-on: https://gerrit.libreoffice.org/69136 Tested-by: Jenkins Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
-rw-r--r--cui/inc/strings.hrc2
-rw-r--r--cui/source/factory/dlgfact.cxx25
-rw-r--r--cui/source/factory/dlgfact.hxx2
-rw-r--r--cui/source/inc/dbregister.hxx9
-rw-r--r--cui/source/options/dbregister.cxx16
-rw-r--r--dbaccess/source/ui/browser/unodatbr.cxx2
-rw-r--r--include/svx/databaseregistrationui.hxx4
-rw-r--r--include/svx/svxdlg.hxx2
-rw-r--r--sc/source/ui/drawfunc/drawsh.cxx2
-rw-r--r--sd/source/ui/func/fuconnct.cxx2
-rw-r--r--sd/source/ui/func/fumeasur.cxx2
-rw-r--r--svx/source/dialog/databaseregistrationui.cxx4
-rw-r--r--sw/source/uibase/shells/drawdlg.cxx2
13 files changed, 31 insertions, 43 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() )
diff --git a/dbaccess/source/ui/browser/unodatbr.cxx b/dbaccess/source/ui/browser/unodatbr.cxx
index d366b3a4618f..ee49f5b1f3e6 100644
--- a/dbaccess/source/ui/browser/unodatbr.cxx
+++ b/dbaccess/source/ui/browser/unodatbr.cxx
@@ -1823,7 +1823,7 @@ void SbaTableQueryBrowser::Execute(sal_uInt16 nId, const Sequence< PropertyValue
break;
case ID_TREE_ADMINISTRATE:
- svx::administrateDatabaseRegistration( getView() );
+ svx::administrateDatabaseRegistration( getFrameWeld() );
break;
case ID_BROWSER_REFRESH:
diff --git a/include/svx/databaseregistrationui.hxx b/include/svx/databaseregistrationui.hxx
index ad66832aad35..e1fb1e3a4700 100644
--- a/include/svx/databaseregistrationui.hxx
+++ b/include/svx/databaseregistrationui.hxx
@@ -22,7 +22,7 @@
#include <svx/svxdllapi.h>
-namespace vcl { class Window; }
+namespace weld { class Window; }
#define SID_SB_POOLING_ENABLED (RID_OFA_START + 247)
#define SID_SB_DRIVER_TIMEOUTS (RID_OFA_START + 248)
@@ -32,7 +32,7 @@ namespace svx
{
/** opens a dialog which allows the user to administrate the database registrations
*/
- sal_uInt16 SVX_DLLPUBLIC administrateDatabaseRegistration( vcl::Window* _parentWindow );
+ sal_uInt16 SVX_DLLPUBLIC administrateDatabaseRegistration( weld::Window* _parentWindow );
}
diff --git a/include/svx/svxdlg.hxx b/include/svx/svxdlg.hxx
index 548e2e783183..ccf03a210f42 100644
--- a/include/svx/svxdlg.hxx
+++ b/include/svx/svxdlg.hxx
@@ -420,7 +420,7 @@ public:
SdrModel* pModel,
const SdrObject* pObj,
bool bHasObj )=0;
- virtual VclPtr<SfxAbstractDialog> CreateSfxDialog( vcl::Window* pParent,
+ virtual VclPtr<SfxAbstractDialog> CreateSfxDialog( weld::Window* pParent,
const SfxItemSet& rAttr,
const SdrView* pView,
sal_uInt32 nResId )=0;
diff --git a/sc/source/ui/drawfunc/drawsh.cxx b/sc/source/ui/drawfunc/drawsh.cxx
index 33af4c4f1289..e9de68d42c5f 100644
--- a/sc/source/ui/drawfunc/drawsh.cxx
+++ b/sc/source/ui/drawfunc/drawsh.cxx
@@ -462,7 +462,7 @@ void ScDrawShell::ExecuteMeasureDlg( SfxRequest& rReq )
pView->MergeAttrFromMarked( aNewAttr, false );
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- vcl::Window* pWin = pViewData->GetDialogParent();
+ weld::Window* pWin = pViewData->GetFrameWeld();
ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog(pWin, aNewAttr, pView, RID_SVXPAGE_MEASURE));
sal_uInt16 nResult = pDlg->Execute();
diff --git a/sd/source/ui/func/fuconnct.cxx b/sd/source/ui/func/fuconnct.cxx
index 12c8daefda58..fb5cb5afba0d 100644
--- a/sd/source/ui/func/fuconnct.cxx
+++ b/sd/source/ui/func/fuconnct.cxx
@@ -56,7 +56,7 @@ void FuConnectionDlg::DoExecute( SfxRequest& rReq )
if( !pArgs )
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog(rReq.GetFrameWindow(), aNewAttr, mpView, RID_SVXPAGE_CONNECTION));
+ ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog(rReq.GetFrameWeld(), aNewAttr, mpView, RID_SVXPAGE_CONNECTION));
if( pDlg->Execute() == RET_OK )
{
diff --git a/sd/source/ui/func/fumeasur.cxx b/sd/source/ui/func/fumeasur.cxx
index 09e7f86e1e7d..e7ec6224a8ea 100644
--- a/sd/source/ui/func/fumeasur.cxx
+++ b/sd/source/ui/func/fumeasur.cxx
@@ -56,7 +56,7 @@ void FuMeasureDlg::DoExecute( SfxRequest& rReq )
if( !pArgs )
{
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog(rReq.GetFrameWindow(), aNewAttr, mpView, RID_SVXPAGE_MEASURE));
+ ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog(rReq.GetFrameWeld(), aNewAttr, mpView, RID_SVXPAGE_MEASURE));
if( pDlg->Execute() == RET_OK )
{
diff --git a/svx/source/dialog/databaseregistrationui.cxx b/svx/source/dialog/databaseregistrationui.cxx
index 04778639eda6..11bb05c4a5cb 100644
--- a/svx/source/dialog/databaseregistrationui.cxx
+++ b/svx/source/dialog/databaseregistrationui.cxx
@@ -28,14 +28,14 @@
namespace svx
{
- sal_uInt16 administrateDatabaseRegistration( vcl::Window* _parentWindow )
+ sal_uInt16 administrateDatabaseRegistration(weld::Window* parentWindow)
{
sal_uInt16 nResult = RET_CANCEL;
SfxItemSet aRegistrationItems( SfxGetpApp()->GetPool(), svl::Items<SID_SB_DB_REGISTER, SID_SB_DB_REGISTER>{} );
SvxAbstractDialogFactory* pDialogFactory = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<SfxAbstractDialog> pDialog( pDialogFactory->CreateSfxDialog( _parentWindow, aRegistrationItems, nullptr, RID_SFXPAGE_DBREGISTER ) );
+ ScopedVclPtr<SfxAbstractDialog> pDialog(pDialogFactory->CreateSfxDialog(parentWindow, aRegistrationItems, nullptr, RID_SFXPAGE_DBREGISTER));
nResult = pDialog->Execute();
return nResult;
diff --git a/sw/source/uibase/shells/drawdlg.cxx b/sw/source/uibase/shells/drawdlg.cxx
index 71fb6b17d4a1..17f80756147e 100644
--- a/sw/source/uibase/shells/drawdlg.cxx
+++ b/sw/source/uibase/shells/drawdlg.cxx
@@ -73,7 +73,7 @@ void SwDrawShell::ExecDrawDlg(SfxRequest& rReq)
bool bHasMarked = pView->AreObjectsMarked();
SvxAbstractDialogFactory* pFact = SvxAbstractDialogFactory::Create();
- ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog(rReq.GetFrameWindow(),
+ ScopedVclPtr<SfxAbstractDialog> pDlg(pFact->CreateSfxDialog(rReq.GetFrameWeld(),
aNewAttr, pView, RID_SVXPAGE_MEASURE));
if (pDlg->Execute() == RET_OK)
{