Author: jerome
Date: 2009-12-30 14:12:47 +0100 (Wed, 30 Dec 2009)
New Revision: 6022

Modified:
   
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py
Log:
* Added SkypeStarted callback

Modified: 
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py
===================================================================
--- 
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py
      2009-12-30 12:13:33 UTC (rev 6021)
+++ 
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/connector.py
      2009-12-30 13:12:47 UTC (rev 6022)
@@ -38,7 +38,8 @@
     #--------------------
     # Public objects
     #--------------------
-    
+    #Event sent when skype starts.
+    OnSkypeStarted = None
     #Event sent if Skype client was closed.
     OnSkypeClosed = None
     #API ready event.
@@ -59,7 +60,9 @@
     apiReady = False
     #Skype client object.
     skypeClient = None 
-    #Skype client Loop thread.
+    #Skype client Loop thread.
+    __started = False
+    __startedMutex = threading.Lock()
     __clientLoop__ = None
     
     # 
==========================================================================
@@ -145,8 +148,20 @@
         '''Check for skype client running(used with ExtendedThread object).
         '''
         #Check if skype is closed.
-        if not self.skypeClient.isRunning():
-            self.__onSkypeClosed__()
+        if not self.skypeClient.isRunning():
+            self.__startedMutex.acquire()
+            self.__started = False
+            self.__startedMutex.release()
+            self.__onSkypeClosed__()
+        else:
+            self.__startedMutex.acquire()
+            if not self.__started:
+                #Skype started event.
+                if self.OnSkypeStarted != None:
+                    thread = threading.Thread(target=self.OnSkypeStarted)
+                    thread.start()
+                    self.__started = True
+            self.__startedMutex.release()
             
     # 
--------------------------------------------------------------------------
     # Skype api Event handler, notify of new available API status. 


------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev 
_______________________________________________
Tux-droid-svn mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/tux-droid-svn

Reply via email to