~ubuntu-branches/ubuntu/quantal/mysql-workbench/quantal

« back to all changes in this revision

Viewing changes to backend/wbpublic/grtui/grtdb_connection_editor.h

  • Committer: Package Import Robot
  • Author(s): Dmitry Smirnov
  • Date: 2012-03-01 21:57:30 UTC
  • Revision ID: package-import@ubuntu.com-20120301215730-o7y8av8y38n162ro
Tags: upstream-5.2.38+dfsg
ImportĀ upstreamĀ versionĀ 5.2.38+dfsg

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* 
 
2
 * Copyright (c) 2007, 2011, Oracle and/or its affiliates. All rights reserved.
 
3
 *
 
4
 * This program is free software; you can redistribute it and/or
 
5
 * modify it under the terms of the GNU General Public License as
 
6
 * published by the Free Software Foundation; version 2 of the
 
7
 * License.
 
8
 * 
 
9
 * This program is distributed in the hope that it will be useful,
 
10
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 
11
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
 
12
 * GNU General Public License for more details.
 
13
 * 
 
14
 * You should have received a copy of the GNU General Public License
 
15
 * along with this program; if not, write to the Free Software
 
16
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 
17
 * 02110-1301  USA
 
18
 */
 
19
#ifndef _GRTDBCONNECTIONEDITOR_H_
 
20
#define _GRTDBCONNECTIONEDITOR_H_
 
21
 
 
22
#include "wb_config.h"
 
23
 
 
24
#include "mforms/form.h"
 
25
#include "mforms/box.h"
 
26
#include "mforms/button.h"
 
27
#include "mforms/treeview.h"
 
28
 
 
29
#include "db_conn_be.h"
 
30
#include "grtdb_connect_panel.h"
 
31
#include "grt/grt_manager.h"
 
32
 
 
33
namespace grtui
 
34
{
 
35
 
 
36
class WBPUBLICBACKEND_PUBLIC_FUNC DbConnectionEditor : public mforms::Form
 
37
{
 
38
public:
 
39
  DbConnectionEditor(const db_mgmt_ManagementRef &mgmt);
 
40
  ~DbConnectionEditor();
 
41
 
 
42
  void run();
 
43
  db_mgmt_ConnectionRef run(const db_mgmt_ConnectionRef &connection);
 
44
  
 
45
protected:
 
46
  db_mgmt_ManagementRef _mgmt;
 
47
  DbConnectPanel _panel;
 
48
 
 
49
  mforms::Box _top_vbox;
 
50
  mforms::Box _top_hbox;
 
51
  
 
52
  mforms::Box    _conn_list_buttons_hbox;
 
53
  mforms::Button _add_conn_button;
 
54
  mforms::Button _del_conn_button;
 
55
  mforms::Button _dup_conn_button;
 
56
  mforms::Button _move_up_button;
 
57
  mforms::Button _move_down_button;
 
58
  mforms::TreeView _stored_connection_list;
 
59
  mforms::TextEntry *_conn_name;
 
60
 
 
61
  mforms::Box _bottom_hbox;
 
62
  mforms::Button _ok_button;
 
63
  mforms::Button _cancel_button;
 
64
  mforms::Button _test_button;
 
65
  
 
66
  //! Called from selector/list of connections to tell that things changed
 
67
  void change_active_stored_conn();
 
68
  
 
69
  void name_changed();
 
70
private:
 
71
  void add_stored_conn(bool copy);
 
72
  void del_stored_conn();
 
73
 
 
74
  void ok_clicked();
 
75
  void cancel_clicked();
 
76
  void reorder_conn(bool up);
 
77
  
 
78
  void reset_stored_conn_list();
 
79
  
 
80
  bool rename_stored_conn(const std::string &oname, const std::string &name);
 
81
};
 
82
 
 
83
};
 
84
 
 
85
#endif /* _GRTDBCONNECTIONEDITOR_H_ */