[Darlan and I].added the ability to restore the old tray icon (envelope).'trayicon_blink' in the ACE. Fixes #7176
This commit is contained in:
		
							parent
							
								
									2959ca91a2
								
							
						
					
					
						commit
						3b860457ef
					
				
					 2 changed files with 18 additions and 9 deletions
				
			
		| 
						 | 
				
			
			@ -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, ''],
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -129,20 +129,7 @@ class StatusIcon:
 | 
			
		|||
        """
 | 
			
		||||
        Apart from image, we also update tooltip text here
 | 
			
		||||
        """
 | 
			
		||||
        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)
 | 
			
		||||
        else:
 | 
			
		||||
            if gajim.config.get('trayicon') == 'on_event':
 | 
			
		||||
                self.status_icon.set_visible(False)
 | 
			
		||||
            self.status_icon.set_blinking(False)
 | 
			
		||||
 | 
			
		||||
        image = gajim.interface.jabber_state_images[self.statusicon_size][
 | 
			
		||||
                                                                self.status]
 | 
			
		||||
        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?
 | 
			
		||||
| 
						 | 
				
			
			@ -150,7 +137,28 @@ class StatusIcon:
 | 
			
		|||
            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())
 | 
			
		||||
            #       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)
 | 
			
		||||
            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)
 | 
			
		||||
            self.status_icon.set_blinking(False)
 | 
			
		||||
 | 
			
		||||
        image = gajim.interface.jabber_state_images[self.statusicon_size][
 | 
			
		||||
                                                                self.status]
 | 
			
		||||
        really_set_img()
 | 
			
		||||
 | 
			
		||||
    def change_status(self, global_status):
 | 
			
		||||
        """
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue