From 6bad56ad25af5df93f7dfbd2467dfa1f2135cc33 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Thu, 12 Apr 2012 11:32:15 -0400 Subject: [PATCH] Partially Resolve #15 --- index.php | 2 +- sys/widgets/connection_sidebar.php | 2 +- sys/widgets/data_grid.php | 14 +++++++++----- sys/widgets/db_tabs.php | 2 +- 4 files changed, 12 insertions(+), 8 deletions(-) diff --git a/index.php b/index.php index dcc54c1..2fb5692 100644 --- a/index.php +++ b/index.php @@ -136,7 +136,7 @@ foreach(pdo_drivers() as $d) } // Load Firebird if there is support -if(function_exists('fbird_connect')) +if (function_exists('fbird_connect')) { array_map('do_include', glob($path.'firebird/*.php')); } diff --git a/sys/widgets/connection_sidebar.php b/sys/widgets/connection_sidebar.php index bd560d1..5a744f9 100644 --- a/sys/widgets/connection_sidebar.php +++ b/sys/widgets/connection_sidebar.php @@ -83,7 +83,7 @@ class Connection_Sidebar extends GtkVBox { // Create the treeview $this->treeview = (isset($this->treeview)) ? $this->treeview - : new Data_Grid(); + : new Data_Grid(new GTKTreeStore(Gobject::TYPE_PHP_VALUE)); $model = $this->treeview->get_model(); diff --git a/sys/widgets/data_grid.php b/sys/widgets/data_grid.php index 137dd45..797d390 100644 --- a/sys/widgets/data_grid.php +++ b/sys/widgets/data_grid.php @@ -26,11 +26,15 @@ class Data_Grid extends GtkTreeView { */ public function __construct($model = null) { - $this->model = ( ! is_null($model)) - ? $model - : new GtkTreeStore(Gobject::TYPE_PHP_VALUE); - - parent::__construct($this->model); + if ( ! is_null($model)) + { + $this->model = $model; + parent::__construct($this->model); + } + else + { + parent::__construct(); + } } // -------------------------------------------------------------------------- diff --git a/sys/widgets/db_tabs.php b/sys/widgets/db_tabs.php index 8ea9cbd..52d51b1 100644 --- a/sys/widgets/db_tabs.php +++ b/sys/widgets/db_tabs.php @@ -212,7 +212,7 @@ class DB_tabs extends GTKNotebook { */ private static function _add_tab(&$conn, $tab_name, $col_name, $method, $events=array()) { - $tab = new Data_Grid(); + $tab = new Data_Grid(new GTKTreeStore(Gobject::TYPE_PHP_VALUE)); $tab_model = $tab->get_model(); $conn_name = $conn->conn_name;