From 53652d62b456365069a0d5227c6aa1d55aec536a Mon Sep 17 00:00:00 2001 From: Timothy Warren Date: Fri, 30 Mar 2012 10:13:16 -0400 Subject: [PATCH] Move datagrid reset logic to data_grid class --- sys/common/data_grid.php | 7 +++++++ sys/windows/widgets/connection_sidebar.php | 7 ------- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/sys/common/data_grid.php b/sys/common/data_grid.php index 089f797..a593cc4 100644 --- a/sys/common/data_grid.php +++ b/sys/common/data_grid.php @@ -67,6 +67,13 @@ class Data_Grid extends GtkTreeView { public function reset($model = null) { $this->model->clear(); + + $cols = $this->get_columns(); + + foreach($cols as $c) + { + $this->remove_column($c); + } } } // End of data_grid.php \ No newline at end of file diff --git a/sys/windows/widgets/connection_sidebar.php b/sys/windows/widgets/connection_sidebar.php index 456ee7c..dec4057 100644 --- a/sys/windows/widgets/connection_sidebar.php +++ b/sys/windows/widgets/connection_sidebar.php @@ -253,13 +253,6 @@ class Connection_Sidebar extends GtkVBox { public function refresh() { $this->treeview->reset(); - $cols = $this->treeview->get_columns(); - - foreach($cols as $c) - { - $this->treeview->remove_column($c); - } - $this->_render(); }