Debian Codegraph @

DatabaseExplorer/AdapterSelectDlg.cpp

raw
1 //////////////////////////////////////////////////////////////////////////////
2 //////////////////////////////////////////////////////////////////////////////
3 //
4 // copyright : (C) 2014 Eran Ifrah
5 // file name : AdapterSelectDlg.cpp
6 //
7 // -------------------------------------------------------------------------
8 // A
9 // _____ _ _ _ _
10 // / __ \ | | | | (_) |
11 // | / \/ ___ __| | ___| | _| |_ ___
12 // | | / _ \ / _ |/ _ \ | | | __/ _ )
13 // | \__/\ (_) | (_| | __/ |___| | || __/
14 // \____/\___/ \__,_|\___\_____/_|\__\___|
15 //
16 // F i l e
17 //
18 // This program is free software; you can redistribute it and/or modify
19 // it under the terms of the GNU General Public License as published by
20 // the Free Software Foundation; either version 2 of the License, or
21 // (at your option) any later version.
22 //
23 //////////////////////////////////////////////////////////////////////////////
24 //////////////////////////////////////////////////////////////////////////////
25
26 #include "AdapterSelectDlg.h"
27 #include "ErdPanel.h"
28 #include "wx/wxxmlserializer/XmlSerializer.h"
29
30
31 AdapterSelectDlg::AdapterSelectDlg(wxWindow* parent, wxWindow* pParentBook, IManager* pManager , xsSerializable* pConnections) : _AdapterSelectDlg(parent) {
32 m_pParentBook = pParentBook;
33 m_pManager = pManager;
34 m_pConnectons = pConnections;
35 }
36
37 AdapterSelectDlg::~AdapterSelectDlg() {
38 }
39
40 void AdapterSelectDlg::OnMysqlClick(wxCommandEvent& event) {
41 //#ifdef DBL_USE_MYSQL
42 m_pManager->AddEditorPage(new ErdPanel(m_pParentBook, new MySqlDbAdapter(), m_pConnectons),_("MySQL ERD"));
43 Close();
44 //#else
45 // wxMessageBox( _("MySQL ERD is not supported."), _("DB Error"), wxOK | wxICON_WARNING );
46 //#endif
47 }
48 void AdapterSelectDlg::OnSqliteClick(wxCommandEvent& event) {
49 //#ifdef DBL_USE_SQLITE
50 m_pManager->AddEditorPage(new ErdPanel(m_pParentBook, new SQLiteDbAdapter(), m_pConnectons),_("SQLite ERD"));
51 Close();
52 //#else
53 // wxMessageBox( _("SQLite ERD is not supported."), _("DB Error"), wxOK | wxICON_WARNING );
54 //#endif
55 }
56 void AdapterSelectDlg::OnPostgresClick(wxCommandEvent& event) {
57 //#ifdef DBL_USE_POSTGRES
58 m_pManager->AddEditorPage(new ErdPanel(m_pParentBook, new PostgreSqlDbAdapter(), m_pConnectons),_("PostgreSQL ERD"));
59 Close();
60 //#else
61 // wxMessageBox( _("PostgreSQL ERD is not supported."), _("DB Error"), wxOK | wxICON_WARNING );
62 //#endif
63 }