Author: jerome
Date: 2010-01-05 10:14:59 +0100 (Tue, 05 Jan 2010)
New Revision: 6030

Modified:
   
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py
Log:
* Added K_HANGUP rc button to reject a call.

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
   2010-01-05 08:23:04 UTC (rev 6029)
+++ 
software_suite_v3/software/plugin/plugin-skype/branches/in_out_plugin/executables/plugin-skype.py
   2010-01-05 09:14:59 UTC (rev 6030)
@@ -195,53 +195,44 @@
     def onPluginEvent(self, eventName, eventValues):
         '''Callback on plugin event.
         '''
+        
         #Start the adequate function for each plugin command.
         if not self.getCommand() == 'run':
             return
-        
-        if ( eventName == 'head' ) or ( eventValues[0] in ["K_OK", 
"K_RECEIVECALL", "K_HANGUP"] ):
-            #If no commands defined, then quit plugin.
+      
+        if self.command == "":
+            self.client.notify(END)
             
-            if self.command == "":
-                self.client.notify(END)
-                
-            #Incoming call head button
-            if self.command == COMMAND_INCOMING:
-                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:
-                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:
-                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' ) or ( eventValues[0] == "K_LEFT" ):
-            #Incoming call left flipper
-            if self.command == COMMAND_INCOMING:
+        #Incoming call head button
+        if self.command == COMMAND_INCOMING:
+            if ( eventName == 'head' ) or ( eventValues[0] in ["K_OK", 
"K_RECEIVECALL"] ):
+                self.client.notify(ACCEPT_INCOMING)
+                self.command = WAIT_END_CALL
+                self.stopTTS()
+            elif (eventName in ["left", "right"]) or ( eventValues[0] in 
["K_LEFT", "K_RIGHT", "K_HANGUP"] ):
                 self.client.notify(REJECT_INCOMING)
-            
-            #Outgoing call left flipper
-            elif self.command == COMMAND_OUTGOING_USER:
-                self.client.notify(NEXT_CONTACT)
                 
-        elif ( eventName == 'right' ) or ( eventValues[0] == "K_RIGHT" ):
-            #Incoming call right fliper
-            if self.command == COMMAND_INCOMING:
-                self.client.notify(REJECT_INCOMING)
-            
-            #Outgoing call right fliper.
-            elif self.command == COMMAND_OUTGOING_USER:
+        elif self.command == WAIT_END_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:
+            if ( eventName == 'head' ) or( eventValues[0] in ["K_OK", 
"K_RECEIVECALL"] ):
+                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' ) or ( eventValues[0] == "K_LEFT"): 
+                #Outgoing call left flipper
+                    self.client.notify(NEXT_CONTACT)
+                    
+            elif ( eventName == 'right' ) or ( eventValues[0] == "K_RIGHT" ):  
        
+                #Outgoing call right fliper.
                 self.client.notify(PREVIOUS_CONTACT)
                 
          


------------------------------------------------------------------------------
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