summaryrefslogtreecommitdiff
path: root/dbaccess/source/ui/dlg/RelationDlg.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'dbaccess/source/ui/dlg/RelationDlg.cxx')
-rw-r--r--dbaccess/source/ui/dlg/RelationDlg.cxx92
1 files changed, 38 insertions, 54 deletions
diff --git a/dbaccess/source/ui/dlg/RelationDlg.cxx b/dbaccess/source/ui/dlg/RelationDlg.cxx
index 19cb52e7276c..0a9146174b6a 100644
--- a/dbaccess/source/ui/dlg/RelationDlg.cxx
+++ b/dbaccess/source/ui/dlg/RelationDlg.cxx
@@ -49,29 +49,29 @@ using namespace ::dbtools;
ORelationDialog::ORelationDialog( OJoinTableView* pParent,
const TTableConnectionData::value_type& pConnectionData,
bool bAllowTableSelect )
- : ModalDialog(pParent, "RelationDialog",
- "dbaccess/ui/relationdialog.ui")
+ : GenericDialogController(pParent->GetFrameWeld(),
+ "dbaccess/ui/relationdialog.ui", "RelationDialog")
+ , m_pParent(pParent)
, m_pOrigConnData(pConnectionData)
, m_bTriedOneUpdate(false)
+ , m_xRB_NoCascUpd(m_xBuilder->weld_radio_button("addaction"))
+ , m_xRB_CascUpd(m_xBuilder->weld_radio_button("addcascade"))
+ , m_xRB_CascUpdNull(m_xBuilder->weld_radio_button("addnull"))
+ , m_xRB_CascUpdDefault(m_xBuilder->weld_radio_button("adddefault"))
+ , m_xRB_NoCascDel(m_xBuilder->weld_radio_button("delaction"))
+ , m_xRB_CascDel(m_xBuilder->weld_radio_button("delcascade"))
+ , m_xRB_CascDelNull(m_xBuilder->weld_radio_button("delnull"))
+ , m_xRB_CascDelDefault(m_xBuilder->weld_radio_button("deldefault"))
+ , m_xPB_OK(m_xBuilder->weld_button("ok"))
{
- get(m_pRB_NoCascUpd, "addaction");
- get(m_pRB_CascUpd, "addcascade");
- get(m_pRB_CascUpdNull, "addnull");
- get(m_pRB_CascUpdDefault, "adddefault");
- get(m_pRB_NoCascDel, "delaction");
- get(m_pRB_CascDel, "delcascade");
- get(m_pRB_CascDelNull, "delnull");
- get(m_pRB_CascDelDefault, "deldefault");
- get(m_pPB_OK, "ok");
-
// Copy connection
m_pConnData.reset( pConnectionData->NewInstance() );
m_pConnData->CopyFrom( *pConnectionData );
Init(m_pConnData);
- m_xTableControl.reset( new OTableListBoxControl(this, &pParent->GetTabWinMap(), this) );
+ m_xTableControl.reset(new OTableListBoxControl(m_xBuilder.get(), &pParent->GetTabWinMap(), this));
- m_pPB_OK->SetClickHdl( LINK(this, ORelationDialog, OKClickHdl) );
+ m_xPB_OK->connect_clicked(LINK(this, ORelationDialog, OKClickHdl));
m_xTableControl->Init( m_pConnData );
if ( bAllowTableSelect )
@@ -86,24 +86,8 @@ ORelationDialog::ORelationDialog( OJoinTableView* pParent,
ORelationDialog::~ORelationDialog()
{
- disposeOnce();
}
-void ORelationDialog::dispose()
-{
- m_pRB_NoCascUpd.clear();
- m_pRB_CascUpd.clear();
- m_pRB_CascUpdNull.clear();
- m_pRB_CascUpdDefault.clear();
- m_pRB_NoCascDel.clear();
- m_pRB_CascDel.clear();
- m_pRB_CascDelNull.clear();
- m_pRB_CascDelDefault.clear();
- m_pPB_OK.clear();
- ModalDialog::dispose();
-}
-
-
void ORelationDialog::Init(const TTableConnectionData::value_type& _pConnectionData)
{
ORelationTableConnectionData* pConnData = static_cast<ORelationTableConnectionData*>(_pConnectionData.get());
@@ -112,18 +96,18 @@ void ORelationDialog::Init(const TTableConnectionData::value_type& _pConnectionD
{
case KeyRule::NO_ACTION:
case KeyRule::RESTRICT:
- m_pRB_NoCascUpd->Check();
+ m_xRB_NoCascUpd->set_active(true);
break;
case KeyRule::CASCADE:
- m_pRB_CascUpd->Check();
+ m_xRB_CascUpd->set_active(true);
break;
case KeyRule::SET_NULL:
- m_pRB_CascUpdNull->Check();
+ m_xRB_CascUpdNull->set_active(true);
break;
case KeyRule::SET_DEFAULT:
- m_pRB_CascUpdDefault->Check();
+ m_xRB_CascUpdDefault->set_active(true);
break;
}
@@ -132,35 +116,35 @@ void ORelationDialog::Init(const TTableConnectionData::value_type& _pConnectionD
{
case KeyRule::NO_ACTION:
case KeyRule::RESTRICT:
- m_pRB_NoCascDel->Check();
+ m_xRB_NoCascDel->set_active(true);
break;
case KeyRule::CASCADE:
- m_pRB_CascDel->Check();
+ m_xRB_CascDel->set_active(true);
break;
case KeyRule::SET_NULL:
- m_pRB_CascDelNull->Check();
+ m_xRB_CascDelNull->set_active(true);
break;
case KeyRule::SET_DEFAULT:
- m_pRB_CascDelDefault->Check();
+ m_xRB_CascDelDefault->set_active(true);
break;
}
}
-IMPL_LINK_NOARG( ORelationDialog, OKClickHdl, Button*, void )
+IMPL_LINK_NOARG(ORelationDialog, OKClickHdl, weld::Button&, void)
{
// Read out RadioButtons
sal_uInt16 nAttrib = 0;
// Delete Rules
- if( m_pRB_NoCascDel->IsChecked() )
+ if( m_xRB_NoCascDel->get_active() )
nAttrib |= KeyRule::NO_ACTION;
- if( m_pRB_CascDel->IsChecked() )
+ if( m_xRB_CascDel->get_active() )
nAttrib |= KeyRule::CASCADE;
- if( m_pRB_CascDelNull->IsChecked() )
+ if( m_xRB_CascDelNull->get_active() )
nAttrib |= KeyRule::SET_NULL;
- if( m_pRB_CascDelDefault->IsChecked() )
+ if( m_xRB_CascDelDefault->get_active() )
nAttrib |= KeyRule::SET_DEFAULT;
ORelationTableConnectionData* pConnData = static_cast<ORelationTableConnectionData*>(m_pConnData.get());
@@ -168,13 +152,13 @@ IMPL_LINK_NOARG( ORelationDialog, OKClickHdl, Button*, void )
// Update Rules
nAttrib = 0;
- if( m_pRB_NoCascUpd->IsChecked() )
+ if( m_xRB_NoCascUpd->get_active() )
nAttrib |= KeyRule::NO_ACTION;
- if( m_pRB_CascUpd->IsChecked() )
+ if( m_xRB_CascUpd->get_active() )
nAttrib |= KeyRule::CASCADE;
- if( m_pRB_CascUpdNull->IsChecked() )
+ if( m_xRB_CascUpdNull->get_active() )
nAttrib |= KeyRule::SET_NULL;
- if( m_pRB_CascUpdDefault->IsChecked() )
+ if( m_xRB_CascUpdDefault->get_active() )
nAttrib |= KeyRule::SET_DEFAULT;
pConnData->SetUpdateRules( nAttrib );
@@ -192,15 +176,15 @@ IMPL_LINK_NOARG( ORelationDialog, OKClickHdl, Button*, void )
if ( *pConnData == *pOrigConnData || pConnData->Update())
{
m_pOrigConnData->CopyFrom( *m_pConnData );
- EndDialog( RET_OK );
+ m_xDialog->response(RET_OK);
return;
}
}
catch( const SQLException& )
{
- ::dbtools::showError( SQLExceptionInfo( ::cppu::getCaughtException() ),
- VCLUnoHelper::GetInterface(this),
- static_cast<OJoinTableView*>(GetParent())->getDesignView()->getController().getORB());
+ ::dbtools::showError(SQLExceptionInfo(::cppu::getCaughtException()),
+ m_xDialog->GetXWindow(),
+ m_pParent->getDesignView()->getController().getORB());
}
catch( const Exception& )
{
@@ -217,9 +201,9 @@ IMPL_LINK_NOARG( ORelationDialog, OKClickHdl, Button*, void )
m_xTableControl->lateInit();
}
-short ORelationDialog::Execute()
+short ORelationDialog::run()
{
- short nResult = ModalDialog::Execute();
+ short nResult = GenericDialogController::run();
if ((nResult != RET_OK) && m_bTriedOneUpdate)
return RET_NO;
@@ -228,7 +212,7 @@ short ORelationDialog::Execute()
void ORelationDialog::setValid(bool _bValid)
{
- m_pPB_OK->Enable(_bValid);
+ m_xPB_OK->set_sensitive(_bValid);
}
void ORelationDialog::notifyConnectionChange()