diff options
Diffstat (limited to 'dbaccess/source')
-rw-r--r-- | dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx | 45 | ||||
-rw-r--r-- | dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx | 14 |
2 files changed, 23 insertions, 36 deletions
diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx index 24cae55f638b..d3f3d88205f5 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.cxx @@ -242,38 +242,27 @@ using namespace ::com::sun::star; OGenericAdministrationPage::callModifiedHdl(); } - VclPtr<OMySQLIntroPageSetup> OMySQLIntroPageSetup::CreateMySQLIntroTabPage( vcl::Window* _pParent, const SfxItemSet& _rAttrSet ) + VclPtr<OMySQLIntroPageSetup> OMySQLIntroPageSetup::CreateMySQLIntroTabPage(TabPageParent pParent, const SfxItemSet& rAttrSet) { - return VclPtr<OMySQLIntroPageSetup>::Create( _pParent, _rAttrSet); + return VclPtr<OMySQLIntroPageSetup>::Create(pParent, rAttrSet); } - - OMySQLIntroPageSetup::OMySQLIntroPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs ) - :OGenericAdministrationPage(pParent, "DBWizMysqlIntroPage", "dbaccess/ui/dbwizmysqlintropage.ui", _rCoreAttrs) + OMySQLIntroPageSetup::OMySQLIntroPageSetup(TabPageParent pParent, const SfxItemSet& _rCoreAttrs) + : OGenericAdministrationPage(pParent, "dbaccess/ui/dbwizmysqlintropage.ui", "DBWizMysqlIntroPage", _rCoreAttrs) + , m_xODBCDatabase(m_xBuilder->weld_radio_button("odbc")) + , m_xJDBCDatabase(m_xBuilder->weld_radio_button("jdbc")) + , m_xNATIVEDatabase(m_xBuilder->weld_radio_button("directly")) { - get(m_pODBCDatabase, "odbc"); - get(m_pJDBCDatabase, "jdbc"); - get(m_pNATIVEDatabase, "directly"); - - m_pODBCDatabase->SetToggleHdl(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected)); - m_pJDBCDatabase->SetToggleHdl(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected)); - m_pNATIVEDatabase->SetToggleHdl(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected)); + m_xODBCDatabase->connect_toggled(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected)); + m_xJDBCDatabase->connect_toggled(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected)); + m_xNATIVEDatabase->connect_toggled(LINK(this, OMySQLIntroPageSetup, OnSetupModeSelected)); } OMySQLIntroPageSetup::~OMySQLIntroPageSetup() { - disposeOnce(); - } - - void OMySQLIntroPageSetup::dispose() - { - m_pODBCDatabase.clear(); - m_pJDBCDatabase.clear(); - m_pNATIVEDatabase.clear(); - OGenericAdministrationPage::dispose(); } - IMPL_LINK_NOARG(OMySQLIntroPageSetup, OnSetupModeSelected, RadioButton&, void) + IMPL_LINK_NOARG(OMySQLIntroPageSetup, OnSetupModeSelected, weld::ToggleButton&, void) { maClickHdl.Call( this ); } @@ -284,17 +273,17 @@ using namespace ::com::sun::star; const DbuTypeCollectionItem* pCollectionItem = dynamic_cast<const DbuTypeCollectionItem*>( _rSet.GetItem(DSID_TYPECOLLECTION) ); bool bHasMySQLNative = ( pCollectionItem != nullptr ) && pCollectionItem->getCollection()->hasDriver( "sdbc:mysql:mysqlc:" ); if ( bHasMySQLNative ) - m_pNATIVEDatabase->Show(); + m_xNATIVEDatabase->show(); // if any of the options is checked, then there's nothing to do - if ( m_pODBCDatabase->IsChecked() || m_pJDBCDatabase->IsChecked() || m_pNATIVEDatabase->IsChecked() ) + if ( m_xODBCDatabase->get_active() || m_xJDBCDatabase->get_active() || m_xNATIVEDatabase->get_active() ) return; // prefer "native" or "JDBC" if ( bHasMySQLNative ) - m_pNATIVEDatabase->Check(); + m_xNATIVEDatabase->set_active(true); else - m_pJDBCDatabase->Check(); + m_xJDBCDatabase->set_active(true); } void OMySQLIntroPageSetup::fillControls(std::vector< std::unique_ptr<ISaveValueWrapper> >& /*_rControlList*/) @@ -313,9 +302,9 @@ using namespace ::com::sun::star; OMySQLIntroPageSetup::ConnectionType OMySQLIntroPageSetup::getMySQLMode() { - if (m_pJDBCDatabase->IsChecked()) + if (m_xJDBCDatabase->get_active()) return VIA_JDBC; - else if (m_pNATIVEDatabase->IsChecked()) + else if (m_xNATIVEDatabase->get_active()) return VIA_NATIVE; else return VIA_ODBC; diff --git a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx index 099af83ba54a..ffa1198858bb 100644 --- a/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx +++ b/dbaccess/source/ui/dlg/DBSetupConnectionPages.hxx @@ -200,11 +200,10 @@ namespace dbaui VIA_NATIVE }; - OMySQLIntroPageSetup( vcl::Window* pParent, const SfxItemSet& _rCoreAttrs); + OMySQLIntroPageSetup(TabPageParent pParent, const SfxItemSet& rCoreAttrs); virtual ~OMySQLIntroPageSetup() override; - virtual void dispose() override; - static VclPtr<OMySQLIntroPageSetup> CreateMySQLIntroTabPage( vcl::Window* _pParent, const SfxItemSet& _rAttrSet ); + static VclPtr<OMySQLIntroPageSetup> CreateMySQLIntroTabPage(TabPageParent pParent, const SfxItemSet& rAttrSet); ConnectionType getMySQLMode(); void SetClickHdl( const Link<OMySQLIntroPageSetup *, void>& rLink ) { maClickHdl = rLink; } @@ -215,13 +214,12 @@ namespace dbaui virtual void fillWindows(std::vector< std::unique_ptr<ISaveValueWrapper> >& _rControlList) override; private: - VclPtr<RadioButton> m_pODBCDatabase; - VclPtr<RadioButton> m_pJDBCDatabase; - VclPtr<RadioButton> m_pNATIVEDatabase; + std::unique_ptr<weld::RadioButton> m_xODBCDatabase; + std::unique_ptr<weld::RadioButton> m_xJDBCDatabase; + std::unique_ptr<weld::RadioButton> m_xNATIVEDatabase; Link<OMySQLIntroPageSetup *, void> maClickHdl; - DECL_LINK(OnSetupModeSelected, RadioButton&, void); - + DECL_LINK(OnSetupModeSelected, weld::ToggleButton&, void); }; // OAuthentificationPageSetup |