[Sugar-devel] [PATCH] Sugar Ad-hoc icons show in search results when connect/disconnect to AP OLPC #10412

Simon Schampijer simon at schampijer.de
Wed Nov 3 10:20:31 EDT 2010


When searching for an AP the Sugar ad-hoc networks are greyed
out (if their name does not contain the search string). When
then trying to connect to an AP the Sugar ad-hoc networks get
colored again.

The patch does make sure that the color is not set by each update
and that the member change does not trigger setting the color
of the icon.
---
 src/jarabe/desktop/networkviews.py |    8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/jarabe/desktop/networkviews.py b/src/jarabe/desktop/networkviews.py
index 87f182f..6305f04 100644
--- a/src/jarabe/desktop/networkviews.py
+++ b/src/jarabe/desktop/networkviews.py
@@ -517,9 +517,6 @@ class SugarAdhocView(CanvasPulsingIcon):
         else:
             icon_name = self._ICON_NAME + str(self._channel)
 
-        self.props.base_color = self._state_color
-        self._palette_icon.props.xo_color = self._state_color
-
         if icon_name is not None:
             self.props.icon_name = icon_name
             icon = self._palette.props.icon
@@ -549,6 +546,7 @@ class SugarAdhocView(CanvasPulsingIcon):
 
     def _update_color(self):
         if self._greyed_out:
+            self.props.pulsing = False
             self.props.base_color = XoColor('#D5D5D5,#D5D5D5')
         else:
             self.props.base_color = self._state_color
@@ -557,12 +555,12 @@ class SugarAdhocView(CanvasPulsingIcon):
         if channel == self._channel:
             if has_members == True:
                 self._state_color = profile.get_color()
-                self.props.base_color = self._state_color
-                self._palette_icon.props.xo_color = self._state_color
             else:
                 color = '%s,%s' % (profile.get_color().get_stroke_color(),
                                    style.COLOR_TRANSPARENT.get_svg())
                 self._state_color = XoColor(color)
+
+            if not self._greyed_out:
                 self.props.base_color = self._state_color
                 self._palette_icon.props.xo_color = self._state_color
 
-- 
1.7.2.3



More information about the Sugar-devel mailing list