From a94a92e73e0cd02d08b6a333dd835e1d51528b81 Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Mon, 9 Apr 2012 08:57:01 -0400 Subject: [PATCH] Fix db_tab reset Fixes #10 --- sys/db/drivers/pgsql.php | 8 ++++---- sys/windows/widgets/db_tabs.php | 36 +-------------------------------- 2 files changed, 5 insertions(+), 39 deletions(-) diff --git a/sys/db/drivers/pgsql.php b/sys/db/drivers/pgsql.php index da80583..011d6ca 100644 --- a/sys/db/drivers/pgsql.php +++ b/sys/db/drivers/pgsql.php @@ -121,10 +121,10 @@ SQL; */ public function get_schemas() { - $sql = <<query($sql); diff --git a/sys/windows/widgets/db_tabs.php b/sys/windows/widgets/db_tabs.php index dd283e2..a89a78e 100644 --- a/sys/windows/widgets/db_tabs.php +++ b/sys/windows/widgets/db_tabs.php @@ -46,9 +46,6 @@ class DB_tabs extends GTKNotebook { public function __construct() { parent::__construct(); - - // Move the tab bar to the bottom - //$this->set_tab_pos(Gtk::POS_BOTTOM); } // -------------------------------------------------------------------------- @@ -155,7 +152,7 @@ class DB_tabs extends GTKNotebook { */ public static function reset() { - for($i=0, $max=self::$instance->get_n_pages(); $i <= $max; $i++) + for($i=self::$instance->get_n_pages(); $i >= 0; $i--) { self::$instance->remove_page($i); } @@ -193,36 +190,5 @@ class DB_tabs extends GTKNotebook { } } - - // -------------------------------------------------------------------------- - - /** - * Simplify adding multi-level array to the Notebook object - * - * @param object $conn - * @param string $tab_name - * @param string $col_name - * @param string $method - * @return void - */ - /*private static function _add_multi_level_tab(&$conn, $tab_name, $col_name, $method, $params=array()) - { - $tab = new Data_Grid(); - $tab_model = $tab->get_model(); - - $tab_data = call_user_func_array(array($conn, $method), $params); - - if ($tab_data !== FALSE) - { - for($i=0, $c=count($tab_data); $i < $c; $i++) - { - $j = 0; - foreach($tab_data[$i] as $key => $val) - { - - } - } - } - }*/ } // End of db_tabs.php