only update novel current selection
This commit is contained in:
parent
38b77a8f25
commit
026d68cc5a
|
@ -21,6 +21,7 @@ class Project:
|
|||
self.datasets = []
|
||||
self.sel_obj = dataset.Selection('Current Selection')
|
||||
self.selections = []
|
||||
self._last_selection = None
|
||||
|
||||
def add_selection_observer(self, observer):
|
||||
self._selection_observers.append(observer)
|
||||
|
@ -42,8 +43,10 @@ class Project:
|
|||
|
||||
def set_selection(self, dim_name, selection):
|
||||
"""Sets a current selection and notify observers"""
|
||||
self.sel_obj[dim_name] = set(selection)
|
||||
self.notify_selection_listeners(dim_name)
|
||||
if self._last_selection != selection:
|
||||
self.sel_obj[dim_name] = set(selection)
|
||||
self.notify_selection_listeners(dim_name)
|
||||
self._last_selection = selection
|
||||
|
||||
def get_selection(self):
|
||||
"""Returns the current selection object"""
|
||||
|
|
Reference in New Issue