diff options
author | Caolán McNamara <caolanm@redhat.com> | 2018-10-24 12:45:08 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2018-10-24 17:46:09 +0200 |
commit | 74d4f1b43bc6c9b5ea2a8197e51cbcb2c376de6b (patch) | |
tree | 7893d81c71a4b5f8f965461506774d36ee2279c9 /dbaccess/source/ui/dlg/textconnectionsettings.cxx | |
parent | 510c64cd540694f4b7e0896a56b3d0d3fbdacd0a (diff) |
weld TextConnectionSettingsDialog
Change-Id: Iaa08d066d9c2198bca7e21f619fb89808620fba9
Reviewed-on: https://gerrit.libreoffice.org/62295
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'dbaccess/source/ui/dlg/textconnectionsettings.cxx')
-rw-r--r-- | dbaccess/source/ui/dlg/textconnectionsettings.cxx | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/dbaccess/source/ui/dlg/textconnectionsettings.cxx b/dbaccess/source/ui/dlg/textconnectionsettings.cxx index 6e87f811da5a..dcf578c6e40d 100644 --- a/dbaccess/source/ui/dlg/textconnectionsettings.cxx +++ b/dbaccess/source/ui/dlg/textconnectionsettings.cxx @@ -26,26 +26,18 @@ namespace dbaui { // TextConnectionSettingsDialog - TextConnectionSettingsDialog::TextConnectionSettingsDialog( vcl::Window* _pParent, SfxItemSet& _rItems ) - :ModalDialog( _pParent, "TextConnectionSettingsDialog", "dbaccess/ui/textconnectionsettings.ui" ) - ,m_rItems( _rItems ) + TextConnectionSettingsDialog::TextConnectionSettingsDialog(weld::Window* pParent, SfxItemSet& rItems) + : GenericDialogController(pParent, "dbaccess/ui/textconnectionsettings.ui", "TextConnectionSettingsDialog") + , m_rItems(rItems) + , m_xContainer(m_xBuilder->weld_widget("TextPageContainer")) + , m_xOK(m_xBuilder->weld_button("ok")) + , m_xTextConnectionHelper(new DBOTextConnectionHelper(m_xContainer.get(), TC_HEADER | TC_SEPARATORS | TC_CHARSET)) { - get(m_pOK, "ok"); - m_pTextConnectionHelper.reset( VclPtr<OTextConnectionHelper>::Create( get<VclVBox>("TextPageContainer"), TC_HEADER | TC_SEPARATORS | TC_CHARSET ) ); - - m_pOK->SetClickHdl( LINK( this, TextConnectionSettingsDialog, OnOK ) ); + m_xOK->connect_clicked(LINK(this, TextConnectionSettingsDialog, OnOK)); } TextConnectionSettingsDialog::~TextConnectionSettingsDialog() { - disposeOnce(); - } - - void TextConnectionSettingsDialog::dispose() - { - m_pOK.clear(); - m_pTextConnectionHelper.disposeAndClear(); - ModalDialog::dispose(); } void TextConnectionSettingsDialog::bindItemStorages( SfxItemSet& _rSet, PropertyValues& _rValues ) @@ -58,18 +50,18 @@ namespace dbaui _rValues[ PROPERTY_ID_ENCODING ].reset( new SetItemPropertyStorage( _rSet, DSID_CHARSET ) ); } - short TextConnectionSettingsDialog::Execute() + short TextConnectionSettingsDialog::run() { - m_pTextConnectionHelper->implInitControls( m_rItems, true ); - return ModalDialog::Execute(); + m_xTextConnectionHelper->implInitControls(m_rItems, true); + return GenericDialogController::run(); } - IMPL_LINK_NOARG( TextConnectionSettingsDialog, OnOK, Button*, void ) + IMPL_LINK_NOARG(TextConnectionSettingsDialog, OnOK, weld::Button&, void) { - if ( m_pTextConnectionHelper->prepareLeave() ) + if (m_xTextConnectionHelper->prepareLeave()) { - m_pTextConnectionHelper->FillItemSet( m_rItems, false/*bUnused*/ ); - EndDialog( RET_OK ); + m_xTextConnectionHelper->FillItemSet( m_rItems, false/*bUnused*/ ); + m_xDialog->response(RET_OK); } } |