Double clicking a function in the navigator causes the first four plots of that
function to be displayed in the main view. If the function has returned less than four plots the remaining ViewFrames will be cleared.
This commit is contained in:
@@ -39,7 +39,9 @@ class NavigatorView (gtk.TreeView):
|
||||
self.append_column(self.object_col)
|
||||
|
||||
# send events to plots / itself
|
||||
self.enable_model_drag_source(gtk.gdk.BUTTON1_MASK,[("GTK_TREE_MODEL_ROW",gtk.TARGET_SAME_APP,7)], gtk.gdk.ACTION_LINK | gtk.gdk.ACTION_MOVE)
|
||||
self.enable_model_drag_source(gtk.gdk.BUTTON1_MASK,
|
||||
[("GTK_TREE_MODEL_ROW", gtk.TARGET_SAME_APP, 7)],
|
||||
gtk.gdk.ACTION_LINK | gtk.gdk.ACTION_MOVE)
|
||||
|
||||
self.connect("drag-data-get",self.slot_drag_data)
|
||||
|
||||
@@ -78,10 +80,12 @@ class NavigatorView (gtk.TreeView):
|
||||
tmp = self._previous_selection
|
||||
self._previous_selection = paths
|
||||
# set timestamp on newly selected objects
|
||||
[self.data_tree.set_value(self.data_tree.get_iter(path),6,time.time()) for path in paths if path not in tmp]
|
||||
[self.data_tree.set_value(self.data_tree.get_iter(path), 6, time.time())
|
||||
for path in paths if path not in tmp]
|
||||
|
||||
objs = [self.data_tree.get_iter(path) for path in paths]
|
||||
objs = [(self.data_tree.get_value(iter,6), self.data_tree.get_value(iter,2)) for iter in objs]
|
||||
objs = [(self.data_tree.get_value(iter,6), self.data_tree.get_value(iter,2))
|
||||
for iter in objs]
|
||||
objs.sort()
|
||||
objs = [obj for timestamp, obj in objs]
|
||||
# order dataset
|
||||
@@ -132,6 +136,15 @@ class NavigatorView (gtk.TreeView):
|
||||
self.app.change_plot(obj)
|
||||
elif isinstance(obj, dataset.Dataset):
|
||||
self.display_data_info(obj)
|
||||
elif obj == None:
|
||||
children = []
|
||||
i = self.data_tree.iter_children(tree_iter)
|
||||
while i:
|
||||
child = self.data_tree.get(i, 2)[0]
|
||||
if isinstance(child, plots.Plot):
|
||||
children.append(child)
|
||||
i = self.data_tree.iter_next(i)
|
||||
self.app.change_plots(children)
|
||||
else:
|
||||
t = type(obj)
|
||||
logger.log('debug', 'Activated datatype was %s. Don\'t know what to do.' % t)
|
||||
|
Reference in New Issue
Block a user