From 6cd947041b3352bebddf3863a86b0a15f8222bcf Mon Sep 17 00:00:00 2001 From: kali Date: Fri, 5 Oct 2012 21:22:36 +0900 Subject: fix seticon call breakage when interface dies --- src/leap/baseapp/systray.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/leap/baseapp/systray.py b/src/leap/baseapp/systray.py index 39a23f49..adcfe9b9 100644 --- a/src/leap/baseapp/systray.py +++ b/src/leap/baseapp/systray.py @@ -162,9 +162,10 @@ class StatusAwareTrayIconMixin(object): oldlayout.itemAt(new).widget().show() def setIcon(self, name): - icon = self.Icons.get(name)(self) - self.trayIcon.setIcon(icon) - #self.setWindowIcon(icon) + icon_fun = self.Icons.get(name) + if icon_fun and callable(icon_fun): + icon = icon_fun(self) + self.trayIcon.setIcon(icon) def getIcon(self, icon_name): return self.states.get(icon_name, None) -- cgit v1.2.3