[tuxdroid-svn] r6022 - software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/execut
Status: Beta
Brought to you by:
ks156
From: jerome <c2m...@c2...> - 2009-12-30 13:20:03
|
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. |