[tuxdroid-svn] r6025 - 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 18:32:41
|
Author: jerome Date: 2009-12-30 19:32:30 +0100 (Wed, 30 Dec 2009) New Revision: 6025 Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py Log: * Forget to add remote control buttons. Modified: software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py =================================================================== --- software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-30 13:39:30 UTC (rev 6024) +++ software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py 2009-12-30 18:32:30 UTC (rev 6025) @@ -191,11 +191,12 @@ def onPluginEvent(self, eventName, eventValues): '''Callback on plugin event. ''' + self.throwTrace(eventValues[0]) #Start the adequate function for each plugin command. if not self.getCommand() == 'run': return - if eventName == 'head': + if ( eventName == 'head' ) or ( eventValues[0] in ["K_OK", "K_RECEIVECALL", "K_HANGUP"] ): #If no commands defined, then quit plugin. if self.command == "": @@ -203,23 +204,26 @@ #Incoming call head button if self.command == COMMAND_INCOMING: - self.client.notify(ACCEPT_INCOMING) - self.command = WAIT_END_CALL - self.stopTTS() + if ( eventName == 'head' ) or ( eventValues[0] in ["K_OK", "K_RECEIVECALL"] ): + self.client.notify(ACCEPT_INCOMING) + self.command = WAIT_END_CALL + self.stopTTS() elif self.command == WAIT_END_CALL: - self.client.notify(CLOSE_CALL) + if ( eventName == 'head' ) or ( eventValues[0] in ["K_OK", "K_HANGUP"] ): + self.client.notify(CLOSE_CALL) #Outgoing call head button elif self.command == COMMAND_OUTGOING_USER: - self.client.notify(CALL_CONTACT) - self.command = WAIT_END_CALL - self.stopTTS() - self.throwNotification("start") - self.throwActuation("openMouth") - self.throwActuation("upFlippers") - self.throwNotification("stop") + if eventValues[0] != "K_HANGUP": + self.client.notify(CALL_CONTACT) + self.command = WAIT_END_CALL + self.stopTTS() + self.throwNotification("start") + self.throwActuation("openMouth") + self.throwActuation("upFlippers") + self.throwNotification("stop") - elif eventName == 'left': + elif ( eventName == 'left' ) or ( eventValues[0] == "K_LEFT" ): #Incoming call left flipper if self.command == COMMAND_INCOMING: self.client.notify(REJECT_INCOMING) @@ -228,7 +232,7 @@ elif self.command == COMMAND_OUTGOING_USER: self.client.notify(NEXT_CONTACT) - elif eventName == 'right': + elif ( eventName == 'right' ) or ( eventValues[0] == "K_RIGHT" ): #Incoming call right fliper if self.command == COMMAND_INCOMING: self.client.notify(REJECT_INCOMING) |