From 0918f0019b1325a45d4fca8acd12c7fb9bc5a5cd Mon Sep 17 00:00:00 2001 From: tangstad Date: Fri, 21 Apr 2006 14:59:25 +0000 Subject: [PATCH] Adding plots to panes is now done in row_activated_handler again, which makes it respond to double-clicks instead of just being selected in navigator. --- system/navigator.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/system/navigator.py b/system/navigator.py index a5ebf42..bff4d31 100644 --- a/system/navigator.py +++ b/system/navigator.py @@ -16,6 +16,7 @@ class NavigatorView (gtk.TreeView): self.set_headers_visible(False) self.connect('cursor_changed', self.cursor_changed_handler) + self.connect('row_activated', self.row_activated_handler) renderer = gtk.CellRendererText() self.object_col = gtk.TreeViewColumn('Object', renderer, text=0) @@ -28,12 +29,23 @@ class NavigatorView (gtk.TreeView): model, tree_iter = selection.get_selected() obj = self.data_tree.get_value(tree_iter, 2) + if isinstance(obj, dataset.Dataset): + logger.log('debug', 'Selecting dataset') + self.project.set_current_data(obj) + elif not isinstance(obj, plots.Plot): + t = type(obj) + logger.log('debug', 'Selected datatype was %s. Don\'t know what to do.' % t) + + def row_activated_handler(self, widget, path, column): + tree_iter = self.data_tree.get_iter(path) + obj = self.data_tree.get_value(tree_iter, 2) + if isinstance(obj, plots.Plot): logger.log('debug', 'Activating plot') self.app.change_plot(obj) elif isinstance(obj, dataset.Dataset): - logger.log('debug', 'Selecting dataset') - self.project.set_current_data(obj) + # do nothing + pass else: t = type(obj) - logger.log('debug', 'Datatype was %s. Don\'t know what to do.' % t) + logger.log('debug', 'Activated datatype was %s. Don\'t know what to do.' % t)