22#include <com/sun/star/sdbcx/XCreateCatalog.hpp>
23#include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
33 : GenericDialogController(_pParent,
"dbaccess/ui/choosedatasourcedialog.ui",
"ChooseDataSourceDialog")
34 , m_xDatasource(m_xBuilder->weld_tree_view(
"treeview"))
39#ifdef HAVE_ODBC_ADMINISTRATION
41 m_xManageDatasources->show();
42 m_xManageDatasources->set_sensitive(
true);
54 if (rListBox.n_children())
61 short nRet = GenericDialogController::run();
62#ifdef HAVE_ODBC_ADMINISTRATION
63 if (m_xODBCManagement.get())
64 m_xODBCManagement->disableCallback();
69#ifdef HAVE_ODBC_ADMINISTRATION
72 if ( !m_xODBCManagement.get() )
75 if ( !m_xODBCManagement->manageDataSources_async() )
78 m_xDatasource->grab_focus();
79 m_xManageDatasources->set_sensitive(
false);
83 m_xDatasource->set_sensitive(
false);
84 m_xOk->set_sensitive(
false);
85 m_xCancel->set_sensitive(
false);
86 m_xManageDatasources->set_sensitive(
false);
88 SAL_WARN_IF( !m_xODBCManagement->isRunning(),
"dbaccess.ui",
"ODatasourceSelectDialog::ManageClickHdl: success, but not running - you were *fast*!" );
91IMPL_LINK_NOARG( ODatasourceSelectDialog, ManageProcessFinished,
void*,
void )
93 m_xODBCManagement->receivedCallback();
95 std::set<OUString> aOdbcDatasources;
96 OOdbcEnumeration aEnumeration;
97 aEnumeration.getDatasourceNames( aOdbcDatasources );
98 fillListBox( aOdbcDatasources );
100 m_xDatasource->set_sensitive(
true);
101 m_xOk->set_sensitive(
true);
102 m_xCancel->set_sensitive(
true);
103 m_xManageDatasources->set_sensitive(
true);
114 for (
auto const& datasource : _rDatasources)
121 if (!sSelected.isEmpty())
Reference< XExecutableDialog > m_xDialog
virtual ~ODatasourceSelectDialog() override
ODatasourceSelectDialog(weld::Window *pParent, const std::set< OUString > &rDatasources)
void fillListBox(const std::set< OUString > &_rDatasources)
std::unique_ptr< weld::TreeView > m_xDatasource
virtual short run() override
#define LINK(Instance, Class, Member)
#define SAL_WARN_IF(condition, area, stream)
IMPL_LINK_NOARG(OApplicationController, OnClipboardChanged, TransferableDataHelper *, void)
IMPL_LINK(OApplicationController, OnSelectContainer, void *, _pType, void)