From fe62c5a13a7fb09f46cf469f695b2f60f1494e7a Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Tue, 31 Jan 2012 16:19:34 -0500 Subject: [PATCH] Added more fields to db connection window Added Firebird class, close to finished db connection mockup --- src/databases/firebird.php | 28 +++++++++++++++++ src/windows/add_db.php | 61 +++++++++++++++++++++++++++++++------- 2 files changed, 78 insertions(+), 11 deletions(-) create mode 100644 src/databases/firebird.php diff --git a/src/databases/firebird.php b/src/databases/firebird.php new file mode 100644 index 0000000..0c4dfd1 --- /dev/null +++ b/src/databases/firebird.php @@ -0,0 +1,28 @@ +conn = @ibase_connect($db, $user, $pass); + } +} \ No newline at end of file diff --git a/src/windows/add_db.php b/src/windows/add_db.php index 40b9989..e0f89b9 100644 --- a/src/windows/add_db.php +++ b/src/windows/add_db.php @@ -16,6 +16,8 @@ * Window controlling addtion of database connections */ class Add_DB extends GtkWindow { + + var $dbtype, $host, $user, $password, $database; function __construct() { @@ -23,8 +25,6 @@ class Add_DB extends GtkWindow { $this->set_title("OpenSQLManager - Add Database Connection"); - $this->resize(400, 300); - // Add the Vbox, and show the window $this->add($this->_layout()); $this->show_all(); @@ -46,19 +46,58 @@ class Add_DB extends GtkWindow { 'ODBC' ); - //Row 1 - Database type - $dbtypelbl = new GtkLabel("Database Type"); - $dbtype = GtkComboBox::new_text(); - $align = new GtkAlignment(0, 0.5, 0, 0); - $align->add($dbtypelbl); + //Table attach + //$tbl->attach(left_start, right_stop, top_start, bottom_stop) - foreach($db_types as $t) + //Row 1 - Database type { - $dbtype->append_text($t); + $dbtypelbl = new GtkLabel("Database Type"); + $this->dbtype = GtkComboBox::new_text(); + $typealign = new GtkAlignment(0, 0.5, 0, 0); + $typealign->add($dbtypelbl); + + foreach($db_types as $t) + { + $this->dbtype->append_text($t); + } + + $table->attach($typealign, 0, 1, 0, 1); + $table->attach($this->dbtype, 1, 2, 0, 1); + } - $table->attach($align, 0,1,0,1); - $table->attach($dbtype, 1,2,0,1); + //Row 2 - Host + { + $hostlbl = new GtkLabel("DB Host"); + $this->host = new GtkEntry(); + $hostalign = new GtkAlignment(0, 0.5, 0, 0); + $hostalign->add($hostlbl); + + $table->attach($hostalign, 0, 1, 1, 2); + $table->attach($this->host, 1, 2, 1, 2); + } + + //Row 3 - Username + { + $userlbl = new GtkLabel("DB User"); + $this->user = new GtkEntry(); + $useralign = new GtkAlignment(0, 0.5, 0, 0); + $useralign->add($userlbl); + + $table->attach($useralign, 0, 1, 2, 3); + $table->attach($this->user, 1, 2, 2, 3); + } + + //Row 4 - Password + { + $passlbl = new GtkLabel("DB Password"); + $this->pass = new GtkEntry(); + $passalign = new GtkAlignment(0, 0.5, 0, 0); + $passalign->add($passlbl); + + $table->attach($passalign, 0, 1, 3, 4); + $table->attach($this->pass, 1, 2, 3, 4); + } return $table;