no need of global things in systray.py
This commit is contained in:
		
							parent
							
								
									0393a34a65
								
							
						
					
					
						commit
						9fcb9f1d70
					
				
					 2 changed files with 16 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -24,6 +24,13 @@ import common.logger
 | 
			
		|||
version = '0.7'
 | 
			
		||||
config = common.config.Config()
 | 
			
		||||
connections = {}
 | 
			
		||||
 | 
			
		||||
h = logging.StreamHandler()
 | 
			
		||||
f = logging.Formatter('%(asctime)s %(name)s: %(message)s', '%d %b %Y %H:%M:%S')
 | 
			
		||||
h.setFormatter(f)
 | 
			
		||||
log = logging.getLogger('Gajim')
 | 
			
		||||
log.addHandler(h)
 | 
			
		||||
log.setLevel(logging.DEBUG)
 | 
			
		||||
 | 
			
		||||
logger = common.logger.Logger()
 | 
			
		||||
DATA_DIR = '../data'
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -24,6 +24,15 @@ import dialogs
 | 
			
		|||
from common import gajim
 | 
			
		||||
from common import i18n
 | 
			
		||||
 | 
			
		||||
try:
 | 
			
		||||
	import egg.trayicon as trayicon	# gnomepythonextras trayicon
 | 
			
		||||
except:
 | 
			
		||||
	try:
 | 
			
		||||
		import trayicon # our trayicon
 | 
			
		||||
	except:
 | 
			
		||||
		gajim.log.debug('No trayicon module available')
 | 
			
		||||
		pass
 | 
			
		||||
 | 
			
		||||
_ = i18n._
 | 
			
		||||
APP = i18n.APP
 | 
			
		||||
gtk.glade.bindtextdomain(APP, i18n.DIR)
 | 
			
		||||
| 
						 | 
				
			
			@ -261,8 +270,3 @@ class Systray:
 | 
			
		|||
		self.xml = gtk.glade.XML(GTKGUI_GLADE, 'systray_context_menu', APP)
 | 
			
		||||
		self.systray_context_menu = self.xml.get_widget('systray_context_menu')
 | 
			
		||||
		self.xml.signal_autoconnect(self)
 | 
			
		||||
		global trayicon
 | 
			
		||||
		try:
 | 
			
		||||
			import egg.trayicon as trayicon	# gnomepythonextras trayicon
 | 
			
		||||
		except:
 | 
			
		||||
			import trayicon # our trayicon
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		
		Reference in a new issue