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)