changeset 0052f87c1e25 in /home/hg/repos/gajim
details:http://hg.gajim.org/gajim?cmd=changeset;node=0052f87c1e25 description: differenciate popup_image and popup_image_path un notification when we path an icon name or an image path
diffstat:
src/common/connection_handlers_events.py | 3 ++- src/notify.py | 13 ++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-)
diffs (45 lines):
diff -r ebaa739d1c47 -r 0052f87c1e25 src/common/connection_handlers_events.py --- a/src/common/connection_handlers_events.py Mon Feb 18 20:12:45 2013 +0100 +++ b/src/common/connection_handlers_events.py Mon Feb 18 20:52:04 2013 +0100 @@ -2350,7 +2350,7 @@ iconset = gajim.config.get('iconset') img_path = os.path.join(helpers.get_iconset_path(iconset), '48x48', show_image) - self.popup_image = self.get_path_to_generic_or_avatar(img_path, + self.popup_image_path = self.get_path_to_generic_or_avatar(img_path, jid=self.jid, suffix=suffix)
self.popup_timeout = gajim.config.get('notification_timeout') @@ -2399,6 +2399,7 @@ self.popup_event_type = '' self.popup_msg_type = '' self.popup_image = '' + self.popup_image_path = '' self.popup_timeout = -1
self.do_command = False diff -r ebaa739d1c47 -r 0052f87c1e25 src/notify.py --- a/src/notify.py Mon Feb 18 20:12:45 2013 +0100 +++ b/src/notify.py Mon Feb 18 20:52:04 2013 +0100 @@ -156,13 +156,16 @@
def _nec_notification(self, obj): if obj.do_popup: - if isinstance(obj.popup_image, str): - icon_path = gtkgui_helpers.get_icon_path(obj.popup_image, - 48) + if obj.popup_image: + icon_path = gtkgui_helpers.get_icon_path(obj.popup_image, 48) if icon_path: - obj.popup_image = icon_path + image_path = icon_path + elif obj.popup_image_path: + image_path = obj.popup_image_path + else: + image_path = '' popup(obj.popup_event_type, obj.jid, obj.conn.name, - obj.popup_msg_type, path_to_image=obj.popup_image, + obj.popup_msg_type, path_to_image=image_path, title=obj.popup_title, text=obj.popup_text, timeout=obj.popup_timeout)