[commit-gajim] r11240 - trunk/src

asterix at gajim.org asterix at gajim.org
Sun Apr 26 00:10:03 CEST 2009


Author: asterix
Date: 2009-04-26 00:10:03 +0200 (Sun, 26 Apr 2009)
New Revision: 11240

Modified:
   trunk/src/gajim.py
Log:
call gtk.gdk.threads_init() to initialise threads used when en/decrypting GPG. Fixes #4959


Modified: trunk/src/gajim.py
===================================================================
--- trunk/src/gajim.py	2009-04-25 17:23:09 UTC (rev 11239)
+++ trunk/src/gajim.py	2009-04-25 22:10:03 UTC (rev 11240)
@@ -477,19 +477,19 @@
 		self.dialog_created = True
 
 
-class ThreadInterface: 
-		def __init__(self, func, func_args, callback, callback_args): 
-			'''Call a function in a thread 
-			
-			:param func: the function to call in the thread 
-			:param func_args: list or arguments for this function 
-			:param callback: callback to call once function is finished 
-			:param callback_args: list of arguments for this callback 
-			''' 
-			def thread_function(func, func_args, callback, callback_args): 
-				output = func(*func_args) 
-				gobject.idle_add(callback, output, *callback_args) 
-			Thread(target=thread_function, args=(func, func_args, callback, 
+class ThreadInterface:
+		def __init__(self, func, func_args, callback, callback_args):
+			'''Call a function in a thread
+
+			:param func: the function to call in the thread
+			:param func_args: list or arguments for this function
+			:param callback: callback to call once function is finished
+			:param callback_args: list of arguments for this callback
+			'''
+			def thread_function(func, func_args, callback, callback_args):
+				output = func(*func_args)
+				gobject.idle_add(callback, output, *callback_args)
+			Thread(target=thread_function, args=(func, func_args, callback,
 				callback_args)).start()
 
 class Interface:
@@ -3536,6 +3536,7 @@
 	Interface()
 
 	try:
+		gtk.gdk.threads_init()
 		gtk.main()
 	except KeyboardInterrupt:
 		print >> sys.stderr, 'KeyboardInterrupt'



More information about the Commits mailing list