From a084d003a927440fb56b11a0b7175360a1af41ab Mon Sep 17 00:00:00 2001 From: Caolán McNamara Date: Tue, 20 Mar 2018 17:17:10 +0000 Subject: weld OSQLMessageBox MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: Idbdb07bc342a91695d15ea1a87d1863798ca34b0 Reviewed-on: https://gerrit.libreoffice.org/51676 Tested-by: Jenkins Reviewed-by: Caolán McNamara Tested-by: Caolán McNamara --- .../source/ui/relationdesign/RelationController.cxx | 7 ++++--- .../source/ui/relationdesign/RelationTableView.cxx | 20 ++++++++++---------- 2 files changed, 14 insertions(+), 13 deletions(-) (limited to 'dbaccess/source/ui/relationdesign') diff --git a/dbaccess/source/ui/relationdesign/RelationController.cxx b/dbaccess/source/ui/relationdesign/RelationController.cxx index 316080ebca42..e5a401e427f8 100644 --- a/dbaccess/source/ui/relationdesign/RelationController.cxx +++ b/dbaccess/source/ui/relationdesign/RelationController.cxx @@ -162,7 +162,8 @@ void ORelationController::Execute(sal_uInt16 _nId, const Sequence< PropertyValue if(!::dbaui::checkDataSourceAvailable(::comphelper::getString(getDataSource()->getPropertyValue(PROPERTY_NAME)), getORB())) { OUString aMessage(DBA_RES(STR_DATASOURCE_DELETED)); - ScopedVclPtrInstance(getView(), aMessage)->Execute(); + OSQLWarningBox aWarning(getFrameWeld(), aMessage); + aWarning.run(); } else { @@ -207,8 +208,8 @@ void ORelationController::impl_initialize() { OUString sTitle(DBA_RES(STR_RELATIONDESIGN)); sTitle = sTitle.copy(3); - ScopedVclPtrInstance< OSQLMessageBox > aDlg(nullptr,sTitle,DBA_RES(STR_RELATIONDESIGN_NOT_AVAILABLE)); - aDlg->Execute(); + OSQLMessageBox aDlg(getFrameWeld(), sTitle, DBA_RES(STR_RELATIONDESIGN_NOT_AVAILABLE)); + aDlg.run(); } disconnect(); throw SQLException(); diff --git a/dbaccess/source/ui/relationdesign/RelationTableView.cxx b/dbaccess/source/ui/relationdesign/RelationTableView.cxx index 006b8033e44a..7c9827489458 100644 --- a/dbaccess/source/ui/relationdesign/RelationTableView.cxx +++ b/dbaccess/source/ui/relationdesign/RelationTableView.cxx @@ -323,8 +323,8 @@ void ORelationTableView::AddTabWin(const OUString& _rComposedName, const OUStrin void ORelationTableView::RemoveTabWin( OTableWindow* pTabWin ) { - ScopedVclPtrInstance< OSQLWarningBox > aDlg( this, DBA_RES( STR_QUERY_REL_DELETE_WINDOW ), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes ); - if ( m_bInRemove || aDlg->Execute() == RET_YES ) + OSQLWarningBox aDlg(GetFrameWeld(), DBA_RES(STR_QUERY_REL_DELETE_WINDOW), MessBoxStyle::YesNo | MessBoxStyle::DefaultYes); + if (m_bInRemove || aDlg.run() == RET_YES) { m_pView->getController().ClearUndoManager(); OJoinTableView::RemoveTabWin( pTabWin ); @@ -341,14 +341,14 @@ void ORelationTableView::lookForUiActivities() { OUString sTitle(DBA_RES(STR_RELATIONDESIGN)); sTitle = sTitle.copy(3); - ScopedVclPtrInstance< OSQLMessageBox > aDlg(this,DBA_RES(STR_QUERY_REL_EDIT_RELATION),OUString(),MessBoxStyle::NONE); - aDlg->SetText(sTitle); - aDlg->RemoveButton(aDlg->GetButtonId(0)); - aDlg->AddButton( DBA_RES(STR_QUERY_REL_EDIT), RET_OK, ButtonDialogFlags::Default | ButtonDialogFlags::Focus); - aDlg->AddButton( DBA_RES(STR_QUERY_REL_CREATE), RET_YES); - aDlg->AddButton( StandardButtonType::Cancel,RET_CANCEL); - sal_uInt16 nRet = aDlg->Execute(); - if( nRet == RET_CANCEL) + OSQLMessageBox aDlg(GetFrameWeld(), DBA_RES(STR_QUERY_REL_EDIT_RELATION), OUString(), MessBoxStyle::NONE); + aDlg.set_title(sTitle); + aDlg.add_button(DBA_RES(STR_QUERY_REL_EDIT), RET_OK); + aDlg.set_default_response(RET_OK); + aDlg.add_button(DBA_RES(STR_QUERY_REL_CREATE), RET_YES); + aDlg.add_button(Button::GetStandardText(StandardButtonType::Cancel), RET_CANCEL); + sal_uInt16 nRet = aDlg.run(); + if (nRet == RET_CANCEL) { m_pCurrentlyTabConnData.reset(); } -- cgit v1.2.3