Fixup tooltips. Still not working for the home page case, since

the active device logic is pretty broken.
This commit is contained in:
Marco Pesenti Gritti
2007-02-25 17:34:15 +01:00
parent b26ddc64ba
commit 66f26e4b8b
5 changed files with 45 additions and 12 deletions
+9 -1
View File
@@ -27,18 +27,23 @@ from view.BuddyIcon import BuddyIcon
class AccessPointView(CanvasIcon):
def __init__(self, model):
CanvasIcon.__init__(self, tooltip=model.get_name())
CanvasIcon.__init__(self)
self._model = model
self.connect('activated', self._activate_cb)
model.connect('notify::strength', self._strength_changed_cb)
model.connect('notify::name', self._name_changed_cb)
self._update_icon()
self._update_name()
def _strength_changed_cb(self, model, pspec):
self._update_icon()
def _name_changed_cb(self, model, pspec):
self._update_name()
def _activate_cb(self, icon):
network_manager = hardwaremanager.get_network_manager()
@@ -47,6 +52,9 @@ class AccessPointView(CanvasIcon):
network_manager.set_active_device(device, network)
def _update_name(self):
self.props.tooltip = self._model.props.name
def _update_icon(self):
strength = self._model.props.strength
if strength < 21: