Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/shell/view/devices/wirelessnetwork.py
diff options
context:
space:
mode:
Diffstat (limited to 'shell/view/devices/wirelessnetwork.py')
-rw-r--r--shell/view/devices/wirelessnetwork.py21
1 files changed, 20 insertions, 1 deletions
diff --git a/shell/view/devices/wirelessnetwork.py b/shell/view/devices/wirelessnetwork.py
index 659ec6b..a08de58 100644
--- a/shell/view/devices/wirelessnetwork.py
+++ b/shell/view/devices/wirelessnetwork.py
@@ -3,4 +3,23 @@ from view.devices import deviceview
class DeviceView(deviceview.DeviceView):
def __init__(self, model):
deviceview.DeviceView.__init__(self, model)
- self.props.icon_name = 'theme:stock-net-wireless-00'
+ self._model = model
+
+ self._update_icon()
+ model.connect('notify::strength', self._strength_changed_cb)
+
+ def _strength_changed_cb(self, model, pspec):
+ self._update_icon()
+
+ def _update_icon(self):
+ strength = self._model.props.strength
+ if strength < 21:
+ self.props.icon_name = 'theme:stock-net-wireless-00'
+ elif strength < 41:
+ self.props.icon_name = 'theme:stock-net-wireless-21-40'
+ elif strength < 61:
+ self.props.icon_name = 'theme:stock-net-wireless-41-60'
+ elif strength < 81:
+ self.props.icon_name = 'theme:stock-net-wireless-61-80'
+ else:
+ self.props.icon_name = 'theme:stock-net-wireless-81-100'