Hello.

I have implemented ability to show name of contact with specified (in theme) color depending on his presence status. I want to use this behavior of gajim and hope that it will be commited.


But I don't want that is better: create new ticket in trac or send my patch here. On your site is written that I must subscribe this list. So, small patch attached :)
diff -urN gajim.orig/src/common/config.py gajim/src/common/config.py
--- gajim.orig/src/common/config.py	2006-03-11 19:30:10.000000000 +0300
+++ gajim/src/common/config.py	2006-03-11 18:28:14.000000000 +0300
@@ -192,6 +192,7 @@
@@ -264,6 +265,9 @@
 			'groupfont': [ opt_str, '', '', True ],
 			'groupfontattrs': [ opt_str, 'I', '', True ],
 			'contacttextcolor': [ opt_color, 'black', '', True ],
+			'contactawaycolor': [ opt_color, '#004bb4', '', True ],
+			'contactdndcolor': [ opt_color, '#7e0000', '', True ],
+			'contactxacolor': [ opt_color, '#004bb4', '', True ],
 			'contactbgcolor': [ opt_color, 'white', '', True ],
 			'contactfont': [ opt_str, '', '', True ],
 			'contactfontattrs': [ opt_str, '', '', True ],
diff -urN gajim.orig/src/roster_window.py gajim/src/roster_window.py
--- gajim.orig/src/roster_window.py	2006-03-11 19:29:31.000000000 +0300
+++ gajim/src/roster_window.py	2006-03-11 19:25:31.000000000 +0300
@@ -388,17 +388,37 @@
 			if add_acct:
 				name += ' (' + account + ')'
 
+		theme = gajim.config.get('roster_theme')
+
+		textcolor = gajim.config.get_per('themes', theme, 'contacttextcolor')
+
+		if contact.show == 'offline':
+			color = gtkgui_helpers._get_fade_color(self.tree, selected, focus)
+			textcolor = "#%04x%04x%04x" % (color.red, color.green, color.blue)			
+		if contact.show == 'away':
+			textcolor = gajim.config.get_per('themes', theme, 'contactawaycolor')
+		if contact.show == 'dnd':
+			textcolor = gajim.config.get_per('themes', theme, 'contactdndcolor')
+		if contact.show == 'xa':
+			textcolor = gajim.config.get_per('themes', theme, 'contactxacolor')
+
+		name = '<span foreground="%s">%s</span>' % (textcolor, name)
+		
 		# add status msg, if not empty, under contact name in the treeview
 		if contact.status and gajim.config.get('show_status_msgs_in_roster'):
 			status = contact.status.strip()
 			if status != '':
 				status = gtkgui_helpers.reduce_chars_newlines(status, max_lines = 1)
 				# escape markup entities and make them small italic and fg color
-				color = gtkgui_helpers._get_fade_color(self.tree, selected, focus)
-				colorstring = "#%04x%04x%04x" % (color.red, color.green, color.blue)
-				name += '\n<span size="small" style="italic" foreground="%s">%s</span>'\
-					% (colorstring, gtkgui_helpers.escape_for_pango_markup(status))
-
+				if contact.show == 'online':
+					color = gtkgui_helpers._get_fade_color(self.tree, selected, focus)
+					colorstring = "#%04x%04x%04x" % (color.red, color.green, color.blue)
+					name += '\n<span size="small" style="italic" foreground="%s">%s</span>'\
+						% (colorstring, gtkgui_helpers.escape_for_pango_markup(status))						
+				else:
+					name += '\n<span size="small" style="italic" foreground="%s">%s</span>'\
+						% (textcolor, gtkgui_helpers.escape_for_pango_markup(status))
+					
 		iter = iters[0] # choose the icon with the first iter
 		icon_name = helpers.get_icon_name_to_show(contact, account)
 		path = model.get_path(iter)
@@ -2567,10 +2587,8 @@
 			jid = model[iter][C_JID].decode('utf-8')
 			account = model[iter][C_ACCOUNT].decode('utf-8')
 			color = gajim.config.get_per('themes', theme, 'contacttextcolor')
-			if color:
-				renderer.set_property('foreground', color)
-			else:
-				renderer.set_property('foreground', None)
+
+			renderer.set_property('foreground', None)
 			if jid in gajim.newly_added[account]:
 				renderer.set_property('cell-background', '#adc3c6')
 			elif jid in gajim.to_be_removed[account]:
_______________________________________________
Gajim-devel mailing list
Gajim-devel@gajim.org
https://lists.gajim.org/cgi-bin/listinfo/gajim-devel

Reply via email to