From 5c36dd8e78c620a190d7d2993252b0a671b6570e Mon Sep 17 00:00:00 2001
From: Julien Pivotto <roidelapluie@esquimaux.be>
Date: Fri, 13 Jul 2007 10:11:49 +0000
Subject: [PATCH] [Lukas and I] use 'event' instead of 'message' as icons names
 ans states. Fix #2755.

---
 .../crystal/16x16/{message.gif => event.gif}        | Bin
 .../dcraven/16x16/{message.png => event.png}        | Bin
 .../dcraven/32x32/{message.png => event.png}        | Bin
 .../iconsets/gnome/16x16/{message.gif => event.gif} | Bin
 .../goojim/16x16/{message.png => event.png}         | Bin
 .../goojim/32x32/{message.png => event.png}         | Bin
 .../gossip/16x16/{message.png => event.png}         | Bin
 data/iconsets/gota/16x16/{message.gif => event.gif} | Bin
 data/iconsets/gota/32x32/{message.gif => event.gif} | Bin
 .../jabberbulb/16x16/{message.gif => event.gif}     | Bin
 .../nuvola/16x16/{message.gif => event.gif}         | Bin
 .../simplebulb/16x16/{message.png => event.png}     | Bin
 .../stellar/16x16/{message.gif => event.gif}        | Bin
 data/iconsets/sun/16x16/{message.gif => event.gif}  | Bin
 src/chat_control.py                                 |   6 +++---
 src/common/helpers.py                               |   6 +++---
 src/groupchat_control.py                            |   7 ++++---
 src/roster_window.py                                |  10 +++++-----
 src/statusicon.py                                   |   3 ++-
 src/systray.py                                      |   3 ++-
 20 files changed, 19 insertions(+), 16 deletions(-)
 rename data/iconsets/crystal/16x16/{message.gif => event.gif} (100%)
 rename data/iconsets/dcraven/16x16/{message.png => event.png} (100%)
 rename data/iconsets/dcraven/32x32/{message.png => event.png} (100%)
 rename data/iconsets/gnome/16x16/{message.gif => event.gif} (100%)
 rename data/iconsets/goojim/16x16/{message.png => event.png} (100%)
 rename data/iconsets/goojim/32x32/{message.png => event.png} (100%)
 rename data/iconsets/gossip/16x16/{message.png => event.png} (100%)
 rename data/iconsets/gota/16x16/{message.gif => event.gif} (100%)
 rename data/iconsets/gota/32x32/{message.gif => event.gif} (100%)
 rename data/iconsets/jabberbulb/16x16/{message.gif => event.gif} (100%)
 rename data/iconsets/nuvola/16x16/{message.gif => event.gif} (100%)
 rename data/iconsets/simplebulb/16x16/{message.png => event.png} (100%)
 rename data/iconsets/stellar/16x16/{message.gif => event.gif} (100%)
 rename data/iconsets/sun/16x16/{message.gif => event.gif} (100%)

diff --git a/data/iconsets/crystal/16x16/message.gif b/data/iconsets/crystal/16x16/event.gif
similarity index 100%
rename from data/iconsets/crystal/16x16/message.gif
rename to data/iconsets/crystal/16x16/event.gif
diff --git a/data/iconsets/dcraven/16x16/message.png b/data/iconsets/dcraven/16x16/event.png
similarity index 100%
rename from data/iconsets/dcraven/16x16/message.png
rename to data/iconsets/dcraven/16x16/event.png
diff --git a/data/iconsets/dcraven/32x32/message.png b/data/iconsets/dcraven/32x32/event.png
similarity index 100%
rename from data/iconsets/dcraven/32x32/message.png
rename to data/iconsets/dcraven/32x32/event.png
diff --git a/data/iconsets/gnome/16x16/message.gif b/data/iconsets/gnome/16x16/event.gif
similarity index 100%
rename from data/iconsets/gnome/16x16/message.gif
rename to data/iconsets/gnome/16x16/event.gif
diff --git a/data/iconsets/goojim/16x16/message.png b/data/iconsets/goojim/16x16/event.png
similarity index 100%
rename from data/iconsets/goojim/16x16/message.png
rename to data/iconsets/goojim/16x16/event.png
diff --git a/data/iconsets/goojim/32x32/message.png b/data/iconsets/goojim/32x32/event.png
similarity index 100%
rename from data/iconsets/goojim/32x32/message.png
rename to data/iconsets/goojim/32x32/event.png
diff --git a/data/iconsets/gossip/16x16/message.png b/data/iconsets/gossip/16x16/event.png
similarity index 100%
rename from data/iconsets/gossip/16x16/message.png
rename to data/iconsets/gossip/16x16/event.png
diff --git a/data/iconsets/gota/16x16/message.gif b/data/iconsets/gota/16x16/event.gif
similarity index 100%
rename from data/iconsets/gota/16x16/message.gif
rename to data/iconsets/gota/16x16/event.gif
diff --git a/data/iconsets/gota/32x32/message.gif b/data/iconsets/gota/32x32/event.gif
similarity index 100%
rename from data/iconsets/gota/32x32/message.gif
rename to data/iconsets/gota/32x32/event.gif
diff --git a/data/iconsets/jabberbulb/16x16/message.gif b/data/iconsets/jabberbulb/16x16/event.gif
similarity index 100%
rename from data/iconsets/jabberbulb/16x16/message.gif
rename to data/iconsets/jabberbulb/16x16/event.gif
diff --git a/data/iconsets/nuvola/16x16/message.gif b/data/iconsets/nuvola/16x16/event.gif
similarity index 100%
rename from data/iconsets/nuvola/16x16/message.gif
rename to data/iconsets/nuvola/16x16/event.gif
diff --git a/data/iconsets/simplebulb/16x16/message.png b/data/iconsets/simplebulb/16x16/event.png
similarity index 100%
rename from data/iconsets/simplebulb/16x16/message.png
rename to data/iconsets/simplebulb/16x16/event.png
diff --git a/data/iconsets/stellar/16x16/message.gif b/data/iconsets/stellar/16x16/event.gif
similarity index 100%
rename from data/iconsets/stellar/16x16/message.gif
rename to data/iconsets/stellar/16x16/event.gif
diff --git a/data/iconsets/sun/16x16/message.gif b/data/iconsets/sun/16x16/event.gif
similarity index 100%
rename from data/iconsets/sun/16x16/message.gif
rename to data/iconsets/sun/16x16/event.gif
diff --git a/src/chat_control.py b/src/chat_control.py
index 7d7cf5cbd6..7d2213e4b4 100644
--- a/src/chat_control.py
+++ b/src/chat_control.py
@@ -1457,13 +1457,13 @@ class ChatControl(ChatControlBase):
 			jid = self.contact.jid
 		num_unread = len(gajim.events.get_events(self.account, jid,
 			['printed_' + self.type_id, self.type_id]))
-		# Set tab image (always 16x16); unread messages show the 'message' image
+		# Set tab image (always 16x16); unread messages show the 'event' image
 		tab_img = None
 		
 		if num_unread and gajim.config.get('show_unread_tab_icon'):
 			img_16 = gajim.interface.roster.get_appropriate_state_images(
-				self.contact.jid, icon_name = 'message')
-			tab_img = img_16['message']
+				self.contact.jid, icon_name = 'event')
+			tab_img = img_16['event']
 		else:
 			contact = gajim.contacts.get_contact_with_highest_priority(
 				self.account, self.contact.jid)
diff --git a/src/common/helpers.py b/src/common/helpers.py
index bfc9ec7ff7..2b6f7b5cc1 100644
--- a/src/common/helpers.py
+++ b/src/common/helpers.py
@@ -547,14 +547,14 @@ def get_global_status():
 def get_icon_name_to_show(contact, account = None):
 	'''Get the icon name to show in online, away, requested, ...'''
 	if account and gajim.events.get_nb_roster_events(account, contact.jid):
-		return 'message'
+		return 'event'
 	if account and gajim.events.get_nb_roster_events(account,
 	contact.get_full_jid()):
-		return 'message'
+		return 'event'
 	if account and gajim.interface.minimized_controls.has_key(account) and \
 	contact.jid in gajim.interface.minimized_controls[account] and gajim.interface.\
 		minimized_controls[account][contact.jid].get_nb_unread_pm() > 0:
-		return 'message'
+		return 'event'
 	if account and gajim.gc_connected[account].has_key(contact.jid):
 		if gajim.gc_connected[account][contact.jid]:
 			return 'muc_active'
diff --git a/src/groupchat_control.py b/src/groupchat_control.py
index f72ad0c1ac..6d22288d34 100644
--- a/src/groupchat_control.py
+++ b/src/groupchat_control.py
@@ -10,6 +10,7 @@
 ## Copyright (C) 2006 Travis Shirk <travis@pobox.com>
 ## Copyright (C) 2005-2007 Nikos Kouremenos <kourem@gmail.com>
 ## Copyright (C) 2007 Julien Pivotto <roidelapluie@gmail.com>
+## Copyright (C) 2007 Lukas Petrovicky <lukas@petrovicky.net>
 ##
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published
@@ -552,8 +553,8 @@ class GroupchatControl(ChatControlBase):
 				model = self.list_treeview.get_model()
 				state_images =\
 					gajim.interface.roster.get_appropriate_state_images(
-						self.room_jid, icon_name = 'message')
-				image = state_images['message']
+						self.room_jid, icon_name = 'event')
+				image = state_images['event']
 				model[iter][C_IMG] = image
 			if self.parent_win:
 				self.parent_win.show_title()
@@ -836,7 +837,7 @@ class GroupchatControl(ChatControlBase):
 			nick)
 		state_images = gajim.interface.roster.jabber_state_images['16']
 		if len(gajim.events.get_events(self.account, self.room_jid + '/' + nick)):
-			image = state_images['message']
+			image = state_images['event']
 		else:
 			image = state_images[gc_contact.show]
 
diff --git a/src/roster_window.py b/src/roster_window.py
index e62829034b..5110e62f54 100644
--- a/src/roster_window.py
+++ b/src/roster_window.py
@@ -677,13 +677,13 @@ class RosterWindow:
 		# look if another resource has awaiting events
 		for c in contact_instances:
 			c_icon_name = helpers.get_icon_name_to_show(c, account)
-			if c_icon_name in ('message', 'muc_active', 'muc_inactive'):
+			if c_icon_name in ('event', 'muc_active', 'muc_inactive'):
 				icon_name = c_icon_name
 				break
 		path = model.get_path(iter)
 		if model.iter_has_child(iter):
 			if not self.tree.row_expanded(path) and \
-			icon_name not in ('message', 'muc_active', 'muc_inactive'):
+			icon_name not in ('event', 'muc_active', 'muc_inactive'):
 				child_iter = model.iter_children(iter)
 				if icon_name in ('error', 'offline'):
 					# get the icon from the first child as they are sorted by show
@@ -700,7 +700,7 @@ class RosterWindow:
 					child_jid = model[child_iter][C_JID].decode('utf-8')
 					child_account = model[child_iter][C_ACCOUNT].decode('utf-8')
 					if len(gajim.events.get_events(child_account, child_jid)):
-						icon_name = 'message'
+						icon_name = 'event'
 						break
 					child_iter = model.iter_next(child_iter)
 			if self.tree.row_expanded(path):
@@ -4292,11 +4292,11 @@ class RosterWindow:
 				'not in roster')
 		else:
 			list = ('connecting', 'online', 'chat', 'away', 'xa', 'dnd',
-				'invisible', 'offline', 'error', 'requested', 'message', 'opened',
+				'invisible', 'offline', 'error', 'requested', 'event', 'opened',
 				'closed', 'not in roster', 'muc_active', 'muc_inactive')
 			if pixbuf2:
 				list = ('connecting', 'online', 'chat', 'away', 'xa', 'dnd',
-					'offline', 'error', 'requested', 'message', 'not in roster')
+					'offline', 'error', 'requested', 'event', 'not in roster')
 		return self._load_icon_list(list, path, pixbuf2)
 
 	def load_icon(self, icon_name):
diff --git a/src/statusicon.py b/src/statusicon.py
index 1e9f0ae4e5..6610e0087e 100644
--- a/src/statusicon.py
+++ b/src/statusicon.py
@@ -1,6 +1,7 @@
 ## statusicon.py
 ##
 ## Copyright (C) 2006 Nikos Kouremenos <kourem@gmail.com>
+## Copyright (C) 2007 Lukas Petrovicky <lukas@petrovicky.net>
 ##
 ## This program is free software; you can redistribute it and/or
 ## modify it under the terms of the GNU General Public License
@@ -56,7 +57,7 @@ class StatusIcon(systray.Systray):
 		text = helpers.get_notification_icon_tooltip_text()
 		self.status_icon.set_tooltip(text)
 		if gajim.events.get_nb_systray_events():
-			state = 'message' # FIXME: this state should be called event, not message
+			state = 'event'
 			self.status_icon.props.blinking = True
 		else:
 			state = self.status
diff --git a/src/systray.py b/src/systray.py
index d9e31d3944..f7bd724939 100644
--- a/src/systray.py
+++ b/src/systray.py
@@ -6,6 +6,7 @@
 ## Copyright (C) 2005 Dimitur Kirov <dkirov@gmail.com>
 ## Copyright (C) 2005-2006 Travis Shirk <travis@pobox.com>
 ## Copyright (C) 2005 Norman Rasmussen <norman@rasmussen.co.za>
+## Copyright (C) 2007 Lukas Petrovicky <lukas@petrovicky.net>
 ##
 ## This program is free software; you can redistribute it and/or modify
 ## it under the terms of the GNU General Public License as published
@@ -82,7 +83,7 @@ class Systray:
 		if not gajim.interface.systray_enabled:
 			return
 		if gajim.events.get_nb_systray_events():
-			state = 'message'
+			state = 'event'
 		else:
 			state = self.status
 		image = gajim.interface.roster.jabber_state_images['16'][state]
-- 
GitLab