[tuxdroid-svn] r959 - in software/gadgets/skype_controller: . skype_controller skype_controller/Scr
Status: Beta
Brought to you by:
ks156
From: jerome <c2m...@c2...> - 2008-04-04 15:09:49
|
Author: jerome Date: 2008-04-04 17:09:47 +0200 (Fri, 04 Apr 2008) New Revision: 959 Modified: software/gadgets/skype_controller/skype_controller.tgf software/gadgets/skype_controller/skype_controller/Scripts/Python/GUI/skype/other.pyp software/gadgets/skype_controller/skype_controller/Scripts/Python/init.pyp software/gadgets/skype_controller/skype_controller/Scripts/Python/main.pyp software/gadgets/skype_controller/skype_controller/Scripts/Python/tux_skype.py software/gadgets/skype_controller/skype_controller/Strings/fr_ALL.xml software/gadgets/skype_controller/skype_controller/strings.xml Log: * Added call normals phones using the remote button pushing alt remote control button. * Updated help file. * Fixed a bug Modified: software/gadgets/skype_controller/skype_controller/Scripts/Python/GUI/skype/other.pyp =================================================================== --- software/gadgets/skype_controller/skype_controller/Scripts/Python/GUI/skype/other.pyp 2008-04-03 11:42:25 UTC (rev 958) +++ software/gadgets/skype_controller/skype_controller/Scripts/Python/GUI/skype/other.pyp 2008-04-04 15:09:47 UTC (rev 959) @@ -295,13 +295,16 @@ if user_to_call == _me.get_param('list_users')[i][1]: skid = _me.get_param('list_users')[i][0] + if skid == None: + skid = user_to_call + name_to_read = None if _me.get_param('custom_names'): for i in range(len(_me.get_param('list_phonetic'))): if skid == _me.get_param('list_phonetic')[i][0]: name_to_read = _me.get_param('list_phonetic')[i][2] break - + if skid != None: self.skype.make_simple_call(skid, to_read=name_to_read) Modified: software/gadgets/skype_controller/skype_controller/Scripts/Python/init.pyp =================================================================== --- software/gadgets/skype_controller/skype_controller/Scripts/Python/init.pyp 2008-04-03 11:42:25 UTC (rev 958) +++ software/gadgets/skype_controller/skype_controller/Scripts/Python/init.pyp 2008-04-04 15:09:47 UTC (rev 959) @@ -22,6 +22,11 @@ _me.set_param('posxy', (0, 0)) _me.set_param('dimentions', (0, 0)) _me.set_param('api_error_quit_flag', False) + +_me.set_param('to_call', '') +_me.set_param('flag0', 0) +_me.set_param('mutex', threading.Lock()) + head_pof = None # ---------------------------------------------------------------------------- @@ -148,9 +153,166 @@ _me.gui('skype').hide_from_main() _me.set_param('api_error_quit_flag', False) _me.exit_main_loop() + + +def numeric_keypad_initialization(): + """ + Using the numeric remote keypad as an old phone. + """ + def fract(number): + """ + Cut the number to have a pretty and correct tts phone number. + """ + divided = [] + lenght = len(number) + if (lenght % 2) == 0: + i = 0 + while i != lenght: + hach = '%s%s ' % (number[i], number[i+1]) + divided.append(hach) + i += 2 + else: + hach = '%s ' % (number[:3]) + divided.append(hach) + i = 3 + while i != lenght: + hach = '%s%s ' % (number[i], number[i+1]) + divided.append(hach) + i += 2 - + result = '' + for i in range(len(divided)): + result += divided[i] + + return result + + + def test(): + if _me.get_param('mutex').locked(): + return + _me.get_param('mutex').acquire() + time.sleep(1.0) + if _me.get_param('flag0') >= 2: + _me.set_param('to_call', _me.get_param('to_call') + '+' ) + else: + _me.set_param('to_call', _me.get_param('to_call') + '0' ) + + _me.set_param('flag0', 0) + _me.get_param('mutex').release() + + + + def K0(): + _me.set_param('flag0', _me.get_param('flag0') + 1) + t = threading.Thread(target=test) + t.start() + + + def K1(): + _me.set_param('to_call', _me.get_param('to_call') + '1') + + def K2(): + _me.set_param('to_call', _me.get_param('to_call') + '2') + + def K3(): + _me.set_param('to_call', _me.get_param('to_call') + '3') + + def K4(): + _me.set_param('to_call', _me.get_param('to_call') + '4') + + def K5(): + _me.set_param('to_call', _me.get_param('to_call') + '5') + + def K6(): + _me.set_param('to_call', _me.get_param('to_call') + '6') + + def K7(): + _me.set_param('to_call', _me.get_param('to_call') + '7') + + def K8(): + _me.set_param('to_call', _me.get_param('to_call') + '8') + + def K9(): + _me.set_param('to_call', _me.get_param('to_call') + '9') + + + def tell(): + if _me.get_param('to_call') == '+': + tux.tts.speak('plus') + return + tux.cmd.mouth_open() + if tux.tts.sound_on: + tux.tts.stop() + tux.tts.speak(fract(_me.get_param('to_call'))) + tux.cmd.mouth_close() + + + def kreturn(): + _me.set_param('to_call', _me.get_param('to_call')[:(len(_me.get_param('to_call')) -1) ]) + + + def call(): + _me.get_param('skype_object').make_pstn_call(_me.get_param('to_call')) + _me.set_param('to_call', '') + + + def abort(): + _me.get_param('skype_object').close_active_call() + _me.set_param('to_call', '') + + + def restore(): + + tux.event.on_remote_bt[K_OK] = _me.get_param('ok_context') + tux.event.on_remote_bt[K_RECEIVECALL] = _me.get_param('receivecall_context') + tux.event.on_remote_bt[K_HANGUP] = _me.get_param('hangup_context') + + tux.event.on_remote_bt[K_0] = None + tux.event.on_remote_bt[K_1] = None + tux.event.on_remote_bt[K_2] = None + tux.event.on_remote_bt[K_3] = None + tux.event.on_remote_bt[K_4] = None + tux.event.on_remote_bt[K_5] = None + tux.event.on_remote_bt[K_6] = None + tux.event.on_remote_bt[K_7] = None + tux.event.on_remote_bt[K_8] = None + tux.event.on_remote_bt[K_9] = None + + tux.event.on_remote_bt[K_BACKSPACE] = None + tux.event.on_remote_bt[K_STARTVOIP] = None + tux.event.on_remote_bt[K_ALT] = _me.get_funct('numeric_keypad_initialization') + + if _me.get_param('remote_t9'): + _me.get_param('skype_object').call_t9_object() + + tux.event.on_remote_bt[K_0] = K0 + tux.event.on_remote_bt[K_1] = K1 + tux.event.on_remote_bt[K_2] = K2 + tux.event.on_remote_bt[K_3] = K3 + tux.event.on_remote_bt[K_4] = K4 + tux.event.on_remote_bt[K_5] = K5 + tux.event.on_remote_bt[K_6] = K6 + tux.event.on_remote_bt[K_7] = K7 + tux.event.on_remote_bt[K_8] = K8 + tux.event.on_remote_bt[K_9] = K9 + + + tux.event.on_remote_bt[K_BACKSPACE] = kreturn + tux.event.on_remote_bt[K_STARTVOIP] = tell + + + _me.set_param('ok_context', tux.event.on_remote_bt[K_OK]) + _me.set_param('receivecall_context', tux.event.on_remote_bt[K_RECEIVECALL]) + _me.set_param('hangup_context', tux.event.on_remote_bt[K_HANGUP]) + + tux.event.on_remote_bt[K_OK] = call + tux.event.on_remote_bt[K_RECEIVECALL] = call + tux.event.on_remote_bt[K_HANGUP] = abort + + tux.event.on_remote_bt[K_ALT] = restore + + # ---------------------------------------------------------------------------- # Initialization and finalization shared functions # ---------------------------------------------------------------------------- @@ -176,6 +338,7 @@ _me.insert_funct('attach_strings', attach_strings) _me.insert_funct('quit_gadget', quit_gadget) _me.insert_funct('show_gadget_in_thread', show_gadget_in_thread) +_me.insert_funct('numeric_keypad_initialization', numeric_keypad_initialization) _me.insert_funct('connect_to_skype', connect_to_skype) _me.insert_funct('on_no_rf', on_no_rf) _me.insert_funct('skype_connection_lost', skype_connection_lost) Modified: software/gadgets/skype_controller/skype_controller/Scripts/Python/main.pyp =================================================================== --- software/gadgets/skype_controller/skype_controller/Scripts/Python/main.pyp 2008-04-03 11:42:25 UTC (rev 958) +++ software/gadgets/skype_controller/skype_controller/Scripts/Python/main.pyp 2008-04-04 15:09:47 UTC (rev 959) @@ -8,4 +8,5 @@ _me.get_funct('connect_to_skype')() if _me.get_param('skype_object').connection_state: _me.get_funct('show_gadget_in_thread')() + tux.event.on_remote_bt[K_ALT] = _me.get_funct('numeric_keypad_initialization') _me.run_main_loop() Modified: software/gadgets/skype_controller/skype_controller/Scripts/Python/tux_skype.py =================================================================== --- software/gadgets/skype_controller/skype_controller/Scripts/Python/tux_skype.py 2008-04-03 11:42:25 UTC (rev 958) +++ software/gadgets/skype_controller/skype_controller/Scripts/Python/tux_skype.py 2008-04-04 15:09:47 UTC (rev 959) @@ -888,10 +888,7 @@ def __set_tux_events(self): """ Set all events needed. - """ - def hello(): - print 'coucou' - + """ if not sk_commands.skype_connected(): try: if on_skype_connection_lost != None: @@ -1277,5 +1274,11 @@ self.my_T9.insert_word_in_database(liste[i]) self.my_T9.init_my_word() self.kstop() + + + def call_t9_object(self): + self.my_T9 = t9.tuxdroid_t9() + self.my_T9.clear_database() + self.init_touchs() Modified: software/gadgets/skype_controller/skype_controller/Strings/fr_ALL.xml =================================================================== --- software/gadgets/skype_controller/skype_controller/Strings/fr_ALL.xml 2008-04-03 11:42:25 UTC (rev 958) +++ software/gadgets/skype_controller/skype_controller/Strings/fr_ALL.xml 2008-04-04 15:09:47 UTC (rev 959) @@ -37,11 +37,8 @@ d'utiliser ou non l'interface graphique. Astuce: pour profiter pleinement de l'interface sans fil de Tux Droid, vous -pouvez paramétrer skype pour lançer directement votre session, ce qui vous permettra -de n'avoir aucune interaction avec le PC pour faire fonctionner le gadget. +pouvez paramétrer skype pour lançer directement votre session. - Dans cette version alpha, plusieurs options sont offertes: - - Lancement du gadget: -------------------------------------- @@ -56,6 +53,10 @@ - Télécommande, flèches: recherche linéaire de contacts. - Flèche gauche: Recherche vers l'arrière. - Flèche droite: Recherche vers l'avant. + +- Bouton ok: Appeller le contact sélectionné. +- Bouton téléphone vert: Appeller contact sélectionné. + - Fonctions lors d'un appel. ---------------------------------------------- @@ -72,16 +73,18 @@ L'option 'noms personnalisés' vous permettra de corriger la manière dont Tux Droid prononcera le nom de vos contacts, mais permet aussi de renommer n'importe qui de manière amusante. -Pour utilisez cette option, le gadget a besoin d'être initialisé au moins une fois, -ensuite, pour l'utilisez, il vous suffira de cocher l'option dans les paramètres du gadget, -et pui enfin, paramétrer les noms que vous voulez entendre. +Pour utiliser cette option, le gadget a besoin d'être initialisé au moins une fois, +ensuite, pour l'utiliser, vous devez cocher l'option dans les paramètres du gadget, +Enfin, paramétrer les noms que vous voulez entendre. - Mode recherche par 'T9': ----------------------------------------- - -L'option 'T9' vous permettre de réaliser une recherche T9 de vos contacts -via la télécommande. -Sélectionnez votre contact de la meme manière que pour un téléphone portable, pour appeller ce contact, appuyer sur le bouton play/pause de la télécommande. + +Ce mode peut être activé dans la fenêtre des paramètres du gadget. +Une fois activée, vous pourre utiliser la télécommande pour faire une recherche T9. +Sélectionnez une lettre grâce au keypad. + + - Bouton play/pause: Appellez le contact sélectionné. - Bouton stop: Réinitialiser la recherche. - Bouton retour arrière: retirer un caractère. - Flèche haute: Précédent contact possible. @@ -95,6 +98,19 @@ - Bouton bleu: Status 'Ne pas déranger'. - Bouton jaune: Status 'Absent'. +Appeller des téléphones normaux: +------------------------------------------------------- + + - Vous pouvez composer le numéro avec la télécommande + - Bouton alt: Démarrer/ arreter le mode keypad. + - Bouton ok ou téléphone vert: Appeller contact sélectionné. + - Aile gauche ou bouton téléphone rouge: Finir un appel. + - Bouton retour arrière: Effacé le dernier nombre entré. + +Lire les messages texte: +---------------------------------------- + Quand Tux vous dis que vous avez un nouveau message, appuyez sur le bouton de tête pour le faire lire. + Dans le cas d'un double appel, Tux vous le signalera grâce à un son, et coupera automatiquement le nouvel appel pour vous laisser continuer votre conversations. Au cas ou un nouveau message arriverait lors d'une de vos conversation, vous en serez notifié grâce aux yeux de Tux.</help_text> <name_to_read type='str'>Controleur Skype</name_to_read> Modified: software/gadgets/skype_controller/skype_controller/strings.xml =================================================================== --- software/gadgets/skype_controller/skype_controller/strings.xml 2008-04-03 11:42:25 UTC (rev 958) +++ software/gadgets/skype_controller/skype_controller/strings.xml 2008-04-04 15:09:47 UTC (rev 959) @@ -32,16 +32,13 @@ <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> <help_text type='str'> Recommanded skype version : 2.0 - Launch skype controller, if your skype is not detected, gadget will launch it automaticly -First time, you will choose to display or not the gadget graphical interface. + Launch skype controller, if your skype client is not detected, the gadget will launch it automaticlly +When launching the skype controller gadget the gadget graphical interface or not. - To make the Tux Droid wireless interface usefull you can ask to skype -to get automaticly connected to your account that will let you released from the computer. +For the ease of use from a distance, it is advised to configure the skype client to sign in automatically at startup. - With this alpha version, a lot of functions are offers: - -- Launch gadget: --------------------------------------- +- Contact list browsing and calling +--------------------------------------------------- - Tux Droid wings: search contacts. - Right wing: Backward search. @@ -54,12 +51,16 @@ - Remote control, arrows: search contacts - Left arrow: Backward search. - Right arrow: Forward search. + +- Ok button: Call selected contact. + +- Green phone button: Call selected contact. - Functions availables in 'call' mode -------------------------------------------------------- - Tux Droid wings: - - Right wing: Take an incomming call. + - Right wing: Accept incomming call. - Left wing: Refuse/finish an incomming/outgoing call. - Tux Doid head button: @@ -67,18 +68,17 @@ - 'Customized names' mode: --------------------------------------------- -This option let you tell to Tux Droid how you want -he pronounce yours contacts names. - -To use this option, the gadget need to be initialized one time, -next, you just need to activate this function in the parameters side. -Finally, you need to specify what you want tux to say in the 'manage' window. + With this mode you can change the name Tux will use with the TTS for a given contact name. +To use this mode you will need to run the skype controller gadget first to load your contact list. +Next, you need to enable the -use customized names- mode from the settings window of the gadget. +Finally, click the -manage- button to modify the names in your contact list. - 'T9' search mode: ----------------------------------------- -This option let you realize a T9 search with the remote control within yours contacts -Select your, to call him, push the remote control play/pause button. +This mode can be enabled in the settings window of the skype controller gadget. Once enabled you can use the remote control to do a T9 search. Select a letter + - play/pause: Call this contact. + - using the numeric keypad on the remote control. - Stop button: Initialize search. - Backspace button: remove one caracter. - Up arrow: Previous available contact. @@ -91,8 +91,22 @@ - Blue button: Do not disturb mode - Yellow button: Away mode. +- Making a call to a normal phone. +---------------------------------------------------------- + + - With the remote control you can dial the phone number of a normal phone. + - Alt button: Start/stop the numeric keypad mode. + - Ok button or green phone button: Call selected number. + - Left wing or red phone hangup button: Abort call. + - Backspace button : Delete last entry. + +Reading text messages: +-------------------------------------------- + + When Tux says you received a new message and you press the head button shortly after, Tux read the message. + In case of an other call is incomming, Tux will play a sound and will place this call in finished to let you continue your conversation. -In case of a new message detected and you are calling, you will be notified with the Tux Droid eyes.</help_text> +When you receive a text message while you are calling, Tux will flash his eyes.</help_text> <name_to_read type='str'>Skype controller</name_to_read> <no_dongle type='str'>Dongle is not connected.</no_dongle> <no_phonetic_using_normal_list type='str'>You need to edit your customized contact list. Starting with standart skype list.</no_phonetic_using_normal_list> Modified: software/gadgets/skype_controller/skype_controller.tgf =================================================================== (Binary files differ) |