Ticket #4188: 0002-Wireless-Device-icon-use-the-same-status-code-as-the.patch

File 0002-Wireless-Device-icon-use-the-same-status-code-as-the.patch, 2.1 KB (added by manuq, 11 years ago)

Updated patch.

  • extensions/deviceicon/network.py

    From 30471f60a5a81aee1e715715a2a5666fde2c7a2e Mon Sep 17 00:00:00 2001
    From: Simon Schampijer <simon@laptop.org>
    Date: Tue, 11 Dec 2012 21:10:58 +0100
    Subject: [PATCH shell 2/2] Wireless Device icon: use the same status code as
     the newtworkview has, call update_color - SL
     #4188
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
    
    Using the same code to indicate connection status as the
    WirelessNetworkView, and calling update_color as WirelessNetworkView
    does too, fixes the issue described in SL #4188.
    
    Signed-off-by: Simon Schampijer <simon@laptop.org>
    Signed-off-by: Manuel Quiñones <manuq@laptop.org>
    ---
     extensions/deviceicon/network.py | 7 +++++--
     1 file changed, 5 insertions(+), 2 deletions(-)
    
    diff --git a/extensions/deviceicon/network.py b/extensions/deviceicon/network.py
    index ebbafdd..2dd8bdd 100644
    a b class WirelessDeviceView(ToolButton): 
    471471    def __state_changed_cb(self, new_state, old_state, reason):
    472472        self._device_state = new_state
    473473        self._update_state()
     474        self._update_color()
    474475        self._device_props.Get(network.NM_WIRELESS_IFACE, 'ActiveAccessPoint',
    475476                               reply_handler=self.__get_active_ap_reply_cb,
    476477                               error_handler=self.__get_active_ap_error_cb)
    class WirelessDeviceView(ToolButton): 
    552553                self._icon.props.icon_name = 'network-adhoc-%s' % channel
    553554            self._icon.props.base_color = profile.get_color()
    554555
    555         if (state >= network.NM_DEVICE_STATE_PREPARE) and \
    556            (state <= network.NM_DEVICE_STATE_IP_CONFIG):
     556        if state == network.NM_DEVICE_STATE_PREPARE or \
     557           state == network.NM_DEVICE_STATE_CONFIG or \
     558           state == network.NM_DEVICE_STATE_NEED_AUTH or \
     559           state == network.NM_DEVICE_STATE_IP_CONFIG:
    557560            self._palette.set_connecting()
    558561            self._icon.props.pulsing = True
    559562        elif state == network.NM_DEVICE_STATE_ACTIVATED: