changeset 13943:fe49adb8ec1c

[Darlan and I].added the ability to restore the old tray icon (envelope).'trayicon_blink' in the ACE. Fixes #7176
author Fomin Denis <fominde@gmail.com>
date Tue, 14 Aug 2012 22:36:16 +0400
parents d0cfa7938e57
children ee8ea17504e2
files src/common/config.py src/statusicon.py
diffstat 2 files changed, 18 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/src/common/config.py	Sun Aug 12 22:04:20 2012 +0400
+++ b/src/common/config.py	Tue Aug 14 22:36:16 2012 +0400
@@ -207,6 +207,7 @@
             '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, ''],
--- a/src/statusicon.py	Sun Aug 12 22:04:20 2012 +0400
+++ b/src/statusicon.py	Tue Aug 14 22:36:16 2012 +0400
@@ -129,13 +129,28 @@
         """
         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 @@
 
         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):
         """