From 3b860457efe6957ea02731a693ab88e2b4703244 Mon Sep 17 00:00:00 2001
From: Denis Fomin <fominde@gmail.com>
Date: Tue, 14 Aug 2012 22:36:16 +0400
Subject: [PATCH] [Darlan and I].added the ability to restore the old tray icon
 (envelope).'trayicon_blink' in the ACE. Fixes #7176

---
 src/common/config.py |  1 +
 src/statusicon.py    | 26 +++++++++++++++++---------
 2 files changed, 18 insertions(+), 9 deletions(-)

diff --git a/src/common/config.py b/src/common/config.py
index e76e261bc..0d9babc1f 100644
--- a/src/common/config.py
+++ b/src/common/config.py
@@ -207,6 +207,7 @@ class Config:
             'use_kib_mib': [opt_bool, False, _('IEC standard says KiB = 1024 bytes, KB = 1000 bytes.')],
             'notify_on_all_muc_messages': [opt_bool, False],
             'trayicon_notification_on_events': [opt_bool, True, _('Notify of events in the notification area.')],
+            'trayicon_blink': [opt_bool, True, _('If False, Gajim will display a static event icon instead of the blinking status icon in the notification area when notifying on event.')],
             'last_save_dir': [opt_str, ''],
             'last_send_dir': [opt_str, ''],
             'last_emoticons_dir': [opt_str, ''],
diff --git a/src/statusicon.py b/src/statusicon.py
index f5bc54d77..c129c7899 100644
--- a/src/statusicon.py
+++ b/src/statusicon.py
@@ -129,13 +129,28 @@ class StatusIcon:
         """
         Apart from image, we also update tooltip text here
         """
+        def really_set_img():
+            if image.get_storage_type() == gtk.IMAGE_PIXBUF:
+                self.status_icon.set_from_pixbuf(image.get_pixbuf())
+            # FIXME: oops they forgot to support GIF animation?
+            # or they were lazy to get it to work under Windows! WTF!
+            elif image.get_storage_type() == gtk.IMAGE_ANIMATION:
+                self.status_icon.set_from_pixbuf(
+                        image.get_animation().get_static_image())
+            #       self.status_icon.set_from_animation(image.get_animation())
+
         if not gajim.interface.systray_enabled:
             return
         if gajim.config.get('trayicon') == 'always':
             self.status_icon.set_visible(True)
         if gajim.events.get_nb_systray_events():
             self.status_icon.set_visible(True)
-            self.status_icon.set_blinking(True)
+            if gajim.config.get('trayicon_blink'):
+                self.status_icon.set_blinking(True)
+            else:
+                image = gtkgui_helpers.load_icon('event')
+                really_set_img()
+                return
         else:
             if gajim.config.get('trayicon') == 'on_event':
                 self.status_icon.set_visible(False)
@@ -143,14 +158,7 @@ class StatusIcon:
 
         image = gajim.interface.jabber_state_images[self.statusicon_size][
                                                                 self.status]
-        if image.get_storage_type() == gtk.IMAGE_PIXBUF:
-            self.status_icon.set_from_pixbuf(image.get_pixbuf())
-        # FIXME: oops they forgot to support GIF animation?
-        # or they were lazy to get it to work under Windows! WTF!
-        elif image.get_storage_type() == gtk.IMAGE_ANIMATION:
-            self.status_icon.set_from_pixbuf(
-                    image.get_animation().get_static_image())
-        #       self.img_tray.set_from_animation(image.get_animation())
+        really_set_img()
 
     def change_status(self, global_status):
         """
-- 
GitLab