Projects/laydi
Projects
/
laydi
Archived
7
0
Fork 0

only update novel current selection

This commit is contained in:
Arnar Flatberg 2006-10-09 18:31:09 +00:00
parent 38b77a8f25
commit 026d68cc5a
1 changed files with 5 additions and 2 deletions

View File

@ -21,6 +21,7 @@ class Project:
self.datasets = [] self.datasets = []
self.sel_obj = dataset.Selection('Current Selection') self.sel_obj = dataset.Selection('Current Selection')
self.selections = [] self.selections = []
self._last_selection = None
def add_selection_observer(self, observer): def add_selection_observer(self, observer):
self._selection_observers.append(observer) self._selection_observers.append(observer)
@ -42,8 +43,10 @@ class Project:
def set_selection(self, dim_name, selection): def set_selection(self, dim_name, selection):
"""Sets a current selection and notify observers""" """Sets a current selection and notify observers"""
self.sel_obj[dim_name] = set(selection) if self._last_selection != selection:
self.notify_selection_listeners(dim_name) self.sel_obj[dim_name] = set(selection)
self.notify_selection_listeners(dim_name)
self._last_selection = selection
def get_selection(self): def get_selection(self):
"""Returns the current selection object""" """Returns the current selection object"""