From 76338d6e775d1913be37b35b1d8007768da1dfd4 Mon Sep 17 00:00:00 2001
From: Vincent Hanquez <tab@snarc.org>
Date: Tue, 29 Mar 2005 17:57:07 +0000
Subject: [PATCH] when there's no systray, prevent gajim from not working.
 Although, systray should be access only by a set of method to prevent those
 type of things..

---
 plugins/gtkgui/gtkgui.py        | 2 ++
 plugins/gtkgui/roster_window.py | 6 ++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py
index f16b55b2b..a178ee18a 100644
--- a/plugins/gtkgui/gtkgui.py
+++ b/plugins/gtkgui/gtkgui.py
@@ -699,6 +699,8 @@ class plugin:
 		self.systray_enabled = True
 
 	def hide_systray(self):
+		if not self.systray_enabled:
+			return
 		self.systray.hide_icon()
 		self.systray_enabled = False
 	
diff --git a/plugins/gtkgui/roster_window.py b/plugins/gtkgui/roster_window.py
index 3f6d136d5..8f0cddea5 100644
--- a/plugins/gtkgui/roster_window.py
+++ b/plugins/gtkgui/roster_window.py
@@ -691,7 +691,8 @@ class Roster_window:
 				if accountIter:
 					model.set_value(accountIter, 0, self.pixbufs['connecting'])
 				self.plugin.connected[account] = 1
-				self.plugin.systray.set_status('connecting')
+				if self.plugin.systray_enabled:
+					self.plugin.systray.set_status('connecting')
 
 			save_pass = 0
 			if self.plugin.accounts[account].has_key('savepass'):
@@ -797,7 +798,8 @@ class Roster_window:
 		self.cb.handler_unblock(self.id_signal_cb)
 		statuss = ['offline', 'connecting', 'online', 'away', 'xa', 'dnd',\
 			'invisible']
-		self.plugin.systray.set_status(statuss[maxi])
+		if self.plugin.systray_enabled:
+			self.plugin.systray.set_status(statuss[maxi])
 		image = self.pixbufs[statuss[maxi]]
 		if image.get_storage_type() == gtk.IMAGE_ANIMATION:
 			pixbuf = image.get_animation().get_static_image()