From 7b1c84065d4ad2d16b02fb4fe9e024965dd69fad Mon Sep 17 00:00:00 2001 From: Agustin Zubiaga Date: Wed, 15 Feb 2012 15:34:35 +0000 Subject: Auto remove duplicate StopWatch items Signed-off-by: Agustin Zubiaga --- (limited to 'activity.py') diff --git a/activity.py b/activity.py index ee57d61..ee445ce 100644 --- a/activity.py +++ b/activity.py @@ -341,9 +341,11 @@ class SimpleGraph(activity.Activity): self.show_all() def _add_value(self, widget, label="", value="0.0"): - pos = self.labels_and_values.add_value(label, value) - self.chart_data.insert(pos, (label, float(value))) - self._update_chart_data() + data = (label, float(value)) + if not data in self.chart_data: + pos = self.labels_and_values.add_value(label, value) + self.chart_data.insert(pos, data) + self._update_chart_data() def _remove_value(self, widget): path = self.labels_and_values.remove_selected_value() -- cgit v0.9.1