From 026d68cc5ad5583c76e46dc00596d48cd92c1781 Mon Sep 17 00:00:00 2001 From: flatberg Date: Mon, 9 Oct 2006 18:31:09 +0000 Subject: [PATCH] only update novel current selection --- system/project.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/system/project.py b/system/project.py index f83c093..1b879d0 100644 --- a/system/project.py +++ b/system/project.py @@ -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"""