From 245185c0a9ae218522f4510796dad8269e7cfbbb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bastian=20K=C3=B6cher?= Date: Fri, 24 Apr 2015 16:32:03 +0200 Subject: [PATCH] - Added missing function in IndicatorTrayIconGUI class - Fixed wrong icon path --- gtk/wicd-client.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gtk/wicd-client.py b/gtk/wicd-client.py index 288e319..43c9bf7 100644 --- a/gtk/wicd-client.py +++ b/gtk/wicd-client.py @@ -979,8 +979,8 @@ TX:''')) def __init__(self, parent): TrayIcon.TrayIconGUI.__init__(self, parent) self.ind = appindicator.Indicator( - "wicd", "", appindicator.CATEGORY_SYSTEM_SERVICES) - self.ind.set_icon(wpath.images + "no-signal.png") + "wicd", "wicd-gtk", appindicator.CATEGORY_SYSTEM_SERVICES, wpath.images) + self.current_icon_name = '' # Rescaning when hovering over the net_menu doesn't work. # (AFAICT, AppIndicator menus don't report PRELIGHT status.) @@ -1017,6 +1017,12 @@ TX:''')) if path != self.current_icon_path: self.current_icon_path = path self.ind.set_icon(path) + + def set_from_name(self, name=None): + """ Sets a new tray icon picture. """ + if name != self.current_icon_name: + self.current_icon_name = name + self.ind.set_icon(name) def visible(self, val): """ Set if the icon is visible or not.