Show the real status icon on new message patch by Dimitur Kirov
This commit is contained in:
		
							parent
							
								
									2aa4f0fa96
								
							
						
					
					
						commit
						ef7c64acf2
					
				
					 2 changed files with 13 additions and 8 deletions
				
			
		|  | @ -565,12 +565,7 @@ class RosterTooltip(gtk.Window): | |||
| 		self.hide() | ||||
| 		self.path = None | ||||
| 
 | ||||
| 	def populate(self, contacts, img): | ||||
| 		if img: | ||||
| 			self.image.set_from_pixbuf(img.get_pixbuf()) | ||||
| 		else: | ||||
| 			self.image.set_from_pixbuf(None) | ||||
| 		#self.image = img # why this doesn't work? MYSTERY! [maybe I need to sleep] | ||||
| 	def populate(self, contacts, path): | ||||
| 		if not contacts or len(contacts) == 0: | ||||
| 			return | ||||
| 		# default resource of the contact | ||||
|  | @ -579,6 +574,16 @@ class RosterTooltip(gtk.Window): | |||
| 			if prim_contact == None or contact.priority > prim_contact.priority: | ||||
| 				prim_contact = contact | ||||
| 
 | ||||
| 		# try to find the image for the contact status | ||||
| 		state_file = prim_contact.show.replace(' ', '_') | ||||
| 		files = [] | ||||
| 		files.append(path + state_file + '.gif') | ||||
| 		files.append(path + state_file + '.png') | ||||
| 		for file in files: | ||||
| 			if os.path.exists(file): | ||||
| 				self.image.set_from_file(file) | ||||
| 				break | ||||
| 
 | ||||
| 		info = '<span size="large" weight="bold">' + prim_contact.jid + '</span>' | ||||
| 		info += '\n<span weight="bold">' + _('Name: ') + '</span>' + \ | ||||
| 			prim_contact.name | ||||
|  |  | |||
|  | @ -576,7 +576,7 @@ class RosterWindow: | |||
| 				if self.tooltip.timeout == 0 or self.tooltip.path != props[0]: | ||||
| 					self.tooltip.path = row | ||||
| 					self.tooltip.timeout = gobject.timeout_add(500, | ||||
| 						self.show_tooltip, self.contacts[account][jid], img) | ||||
| 						self.show_tooltip, self.contacts[account][jid], self.path) | ||||
| 
 | ||||
| 	def on_agent_logging(self, widget, jid, state, account): | ||||
| 		'''When an agent is requested to log in or off''' | ||||
|  | @ -935,7 +935,7 @@ _('If "%s" accepts this request you will know his status.') %jid).get_response() | |||
| 	 | ||||
| 	def on_roster_treeview_button_press_event(self, widget, event): | ||||
| 		'''popup contact's, group's or agent's menu''' | ||||
| 		# hide tooltip, whichever button is pressed | ||||
| 		# hide tooltip, no matter the button is pressed | ||||
| 		self.tooltip.hide_tooltip() | ||||
| 		if event.button == 3: # Right click | ||||
| 			try: | ||||
|  |  | |||
		Loading…
	
	Add table
		
		Reference in a new issue