tux-droid-svn Mailing List for Tux Droid CE (Page 206)
Status: Beta
Brought to you by:
ks156
You can subscribe to this list here.
2007 |
Jan
|
Feb
(32) |
Mar
(108) |
Apr
(71) |
May
(38) |
Jun
(128) |
Jul
(1) |
Aug
(14) |
Sep
(77) |
Oct
(104) |
Nov
(90) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2008 |
Jan
(81) |
Feb
(18) |
Mar
(40) |
Apr
(102) |
May
(151) |
Jun
(74) |
Jul
(151) |
Aug
(257) |
Sep
(447) |
Oct
(379) |
Nov
(404) |
Dec
(430) |
2009 |
Jan
(173) |
Feb
(236) |
Mar
(519) |
Apr
(300) |
May
(112) |
Jun
(232) |
Jul
(314) |
Aug
(58) |
Sep
(203) |
Oct
(293) |
Nov
(26) |
Dec
(109) |
2010 |
Jan
(19) |
Feb
(25) |
Mar
(33) |
Apr
(1) |
May
|
Jun
(3) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
Author: jerome Date: 2008-01-25 10:56:22 +0100 (Fri, 25 Jan 2008) New Revision: 881 Modified: software/gadgets/shortcuts_manager/trunk/shortcuts_manager.tgf software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/add/other.pyp software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/conf/other.pyp software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/modify/other.pyp software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/init.pyp software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/main.pyp software/gadgets/shortcuts_manager/trunk/shortcuts_manager/settings.xml Log: * change combobox entry text language when manager language have changed. Modified: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/add/other.pyp =================================================================== --- software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/add/other.pyp 2008-01-24 15:26:36 UTC (rev 880) +++ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/add/other.pyp 2008-01-25 09:56:22 UTC (rev 881) @@ -9,31 +9,10 @@ SimpleGladeApp.__init__(self, path, root, domain, **kwargs) def new(self): - availables_buttons_en = {'0':'K_0', '1':'K_1', '2':'K_2', '3':'K_3', '4':'K_4',\ - '5':'K_5', '6':'K_6', '7':'K_7', '8':'K_8', '9':'K_9',\ - 'mute':'K_MUTE', 'volume plus':'K_VOLUMEPLUS', 'volume minus':'K_VOLUMEMINUS',\ - 'escape':'K_ESCAPE', 'yes':'K_YES', 'no':'K_NO', 'backspace':'K_BACKSPACE',\ - 'ip voice': 'K_STARTVOIP', 'receive call': 'K_RECEIVECALL', 'hang up':'K_HANGUP',\ - 'star':'K_START', 'sharp':'K_SHARP', 'red':'K_RED', 'green':'K_GREEN',\ - 'blue':'K_BLUE', 'yellow':'K_YELLOW', 'channel plus': 'K_CHANELPLUS',\ - 'channel minus':'K_CHANELMINUS', 'up':'K_UP', 'down': 'K_DOWN',\ - 'left':'K_LEFT', 'right': 'K_RIGHT', 'ok':'K_OK', 'fast rewind': 'K_FASTREWIND',\ - 'fast forward': 'K_FASTFORWARD', 'play/pause': 'K_PLAYPAUSE',\ - 'stop': 'K_STOP', 'recording': 'K_RECORDING', 'previous': 'K_PREVIOUS',\ - 'next': 'K_NEXT', 'menu': 'K_MENU', 'mouse': 'K_MOUSE', 'alt': 'K_ALT'} - - availables_buttons_fr = {'0':'K_0', '1':'K_1', '2':'K_2', '3':'K_3', '4':'K_4',\ - '5':'K_5', '6':'K_6', '7':'K_7', '8':'K_8', '9':'K_9',\ - 'mute':'K_MUTE', 'volume plus':'K_VOLUMEPLUS', 'volume moins':'K_VOLUMEMINUS',\ - 'espace':'K_ESCAPE', 'oui':'K_YES', 'non':'K_NO', 'espace arrière':'K_BACKSPACE',\ - 'voix ip': 'K_STARTVOIP', 'recevoir appel': 'K_RECEIVECALL', 'raccrocher':'K_HANGUP',\ - 'étoile':'K_START', 'dièse':'K_SHARP', 'rouge':'K_RED', 'vert':'K_GREEN',\ - 'bleu':'K_BLUE', 'jaune':'K_YELLOW', 'channel plus': 'K_CHANELPLUS',\ - 'channel moins':'K_CHANELMINUS', 'flèche haut':'K_UP', 'flèche bas': 'K_DOWN',\ - 'gauche':'K_LEFT', 'droite': 'K_RIGHT', 'ok':'K_OK', 'retour rapide': 'K_FASTREWIND',\ - 'avance rapide': 'K_FASTFORWARD', 'play/pause': 'K_PLAYPAUSE',\ - 'stop': 'K_STOP', 'enregistrer': 'K_RECORDING', 'précédent': 'K_PREVIOUS',\ - 'suivant': 'K_NEXT', 'menu': 'K_MENU', 'souris': 'K_MOUSE', 'alt': 'K_ALT'} + _me.get_funct('translate')() + _me.set_param('last_language', _me.get_var('language')) + availables_buttons_fr = _me.get_param('availables_buttons_fr') + availables_buttons_en = _me.get_param('availables_buttons_en') list_of_shortcuts = _me.get_param('list_of_shortcuts') temp = [] Modified: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/conf/other.pyp 2008-01-24 15:26:36 UTC (rev 880) +++ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/conf/other.pyp 2008-01-25 09:56:22 UTC (rev 881) @@ -38,6 +38,8 @@ """ Called function. """ + _me.get_funct('translate')() + _me.set_param('last_language', _me.get_var('language')) self.list_store = gtk.ListStore(str, str, str) self.get_widget("window1").set_title(_me.string('name_to_read')) application = _me.string('shortcut_name') Modified: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/modify/other.pyp =================================================================== --- software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/modify/other.pyp 2008-01-24 15:26:36 UTC (rev 880) +++ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/modify/other.pyp 2008-01-25 09:56:22 UTC (rev 881) @@ -9,32 +9,11 @@ SimpleGladeApp.__init__(self, path, root, domain, **kwargs) def new(self): + _me.get_funct('translate')() + _me.set_param('last_language', _me.get_var('language')) #Set values of the combobox entry. - availables_buttons_en = {'0':'K_0', '1':'K_1', '2':'K_2', '3':'K_3', '4':'K_4',\ - '5':'K_5', '6':'K_6', '7':'K_7', '8':'K_8', '9':'K_9',\ - 'mute':'K_MUTE', 'volume plus':'K_VOLUMEPLUS', 'volume minus':'K_VOLUMEMINUS',\ - 'escape':'K_ESCAPE', 'yes':'K_YES', 'no':'K_NO', 'backspace':'K_BACKSPACE',\ - 'ip voice': 'K_STARTVOIP', 'receive call': 'K_RECEIVECALL', 'hang up':'K_HANGUP',\ - 'star':'K_STAR', 'sharp':'K_SHARP', 'red':'K_RED', 'green':'K_GREEN',\ - 'blue':'K_BLUE', 'yellow':'K_YELLOW', 'channel plus': 'K_CHANELPLUS',\ - 'channel minus':'K_CHANELMINUS', 'up':'K_UP', 'down': 'K_DOWN',\ - 'left':'K_LEFT', 'right': 'K_RIGHT', 'ok':'K_OK', 'fast rewind': 'K_FASTREWIND',\ - 'fast forward': 'K_FASTFORWARD', 'play/pause': 'K_PLAYPAUSE',\ - 'stop': 'K_STOP', 'recording': 'K_RECORDING', 'previous': 'K_PREVIOUS',\ - 'next': 'K_NEXT', 'menu': 'K_MENU', 'mouse': 'K_MOUSE', 'alt': 'K_ALT'} - - availables_buttons_fr = {'0':'K_0', '1':'K_1', '2':'K_2', '3':'K_3', '4':'K_4',\ - '5':'K_5', '6':'K_6', '7':'K_7', '8':'K_8', '9':'K_9',\ - 'mute':'K_MUTE', 'volume plus':'K_VOLUMEPLUS', 'volume moins':'K_VOLUMEMINUS',\ - 'espace':'K_ESCAPE', 'oui':'K_YES', 'non':'K_NO', 'espace arrière':'K_BACKSPACE',\ - 'voix ip': 'K_STARTVOIP', 'recevoir appel': 'K_RECEIVECALL', 'raccrocher':'K_HANGUP',\ - 'étoile':'K_STAR', 'dièse':'K_SHARP', 'rouge':'K_RED', 'vert':'K_GREEN',\ - 'bleu':'K_BLUE', 'jaune':'K_YELLOW', 'channel plus': 'K_CHANELPLUS',\ - 'channel moins':'K_CHANELMINUS', 'flèche haut':'K_UP', 'flèche bas': 'K_DOWN',\ - 'gauche':'K_LEFT', 'droite': 'K_RIGHT', 'ok':'K_OK', 'retour rapide': 'K_FASTREWIND',\ - 'avance rapide': 'K_FASTFORWARD', 'play/pause': 'K_PLAYPAUSE',\ - 'stop': 'K_STOP', 'enregistrer': 'K_RECORDING', 'précédent': 'K_PREVIOUS',\ - 'suivant': 'K_NEXT', 'menu': 'K_MENU', 'souris': 'K_MOUSE', 'alt': 'K_ALT'} + availables_buttons_en = _me.get_param('availables_buttons_en') + availables_buttons_fr = _me.get_param('availables_buttons_fr') #Set globals values of the widgets components Modified: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/init.pyp =================================================================== --- software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/init.pyp 2008-01-24 15:26:36 UTC (rev 880) +++ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/init.pyp 2008-01-25 09:56:22 UTC (rev 881) @@ -4,6 +4,7 @@ import signal import os import thread +import threading import sys import gtk @@ -11,6 +12,34 @@ # Definition and initialization of the shared parameters # ---------------------------------------------------------------------------- +_me.set_param('availables_buttons_en', {'0':'K_0', '1':'K_1', '2':'K_2', '3':'K_3', '4':'K_4',\ + '5':'K_5', '6':'K_6', '7':'K_7', '8':'K_8', '9':'K_9',\ + 'mute':'K_MUTE', 'volume plus':'K_VOLUMEPLUS', 'volume minus':'K_VOLUMEMINUS',\ + 'escape':'K_ESCAPE', 'yes':'K_YES', 'no':'K_NO', 'backspace':'K_BACKSPACE',\ + 'ip voice': 'K_STARTVOIP', 'receive call': 'K_RECEIVECALL', 'hang up':'K_HANGUP',\ + 'star':'K_START', 'sharp':'K_SHARP', 'red':'K_RED', 'green':'K_GREEN',\ + 'blue':'K_BLUE', 'yellow':'K_YELLOW', 'channel plus': 'K_CHANELPLUS',\ + 'channel minus':'K_CHANELMINUS', 'up':'K_UP', 'down': 'K_DOWN',\ + 'left':'K_LEFT', 'right': 'K_RIGHT', 'ok':'K_OK', 'fast rewind': 'K_FASTREWIND',\ + 'fast forward': 'K_FASTFORWARD', 'play/pause': 'K_PLAYPAUSE',\ + 'stop': 'K_STOP', 'recording': 'K_RECORDING', 'previous': 'K_PREVIOUS',\ + 'next': 'K_NEXT', 'menu': 'K_MENU', 'mouse': 'K_MOUSE', 'alt': 'K_ALT'}) + +_me.set_param('availables_buttons_fr', {'0':'K_0', '1':'K_1', '2':'K_2', '3':'K_3', '4':'K_4',\ + '5':'K_5', '6':'K_6', '7':'K_7', '8':'K_8', '9':'K_9',\ + 'mute':'K_MUTE', 'volume plus':'K_VOLUMEPLUS', 'volume moins':'K_VOLUMEMINUS',\ + 'espace':'K_ESCAPE', 'oui':'K_YES', 'non':'K_NO', 'espace arrière':'K_BACKSPACE',\ + 'voix ip': 'K_STARTVOIP', 'recevoir appel': 'K_RECEIVECALL', 'raccrocher':'K_HANGUP',\ + 'étoile':'K_START', 'dièse':'K_SHARP', 'rouge':'K_RED', 'vert':'K_GREEN',\ + 'bleu':'K_BLUE', 'jaune':'K_YELLOW', 'channel plus': 'K_CHANELPLUS',\ + 'channel moins':'K_CHANELMINUS', 'flèche haut':'K_UP', 'flèche bas': 'K_DOWN',\ + 'gauche':'K_LEFT', 'droite': 'K_RIGHT', 'ok':'K_OK', 'retour rapide': 'K_FASTREWIND',\ + 'avance rapide': 'K_FASTFORWARD', 'play/pause': 'K_PLAYPAUSE',\ + 'stop': 'K_STOP', 'enregistrer': 'K_RECORDING', 'précédent': 'K_PREVIOUS',\ + 'suivant': 'K_NEXT', 'menu': 'K_MENU', 'souris': 'K_MOUSE', 'alt': 'K_ALT'}) + + + _me.set_param('shortcut', '') _me.set_param('name', '') @@ -428,6 +457,37 @@ """ tux.tts.speak_free(_me.string('testing') % _me.get_param('name')) thread.start_new_thread(launch_test, ()) + + +def translate(): + """ + """ + language = _me.get_var('language') + list = _me.get_param('list_of_shortcuts') + + if (len(list) > 0): + if _me.get_var('language') != _me.get_param('last_language'): + #translate + list = _me.get_param('list_of_shortcuts') + key = '' + val_key = 0 + tmp = [] + for i in list: + #getting corrspondings values. + if _me.get_var('language') == 'fr_ALL': + #we have no more than two languages used, let user modify parameters translation. + val_key = _me.get_param('availables_buttons_en')[i[2]] + for j in _me.get_param('availables_buttons_fr'): + if _me.get_param('availables_buttons_fr')[j] == val_key: + tmp.append([i[0], i[1], j]) + + else: + val_key = _me.get_param('availables_buttons_fr')[i[2]] + for j in _me.get_param('availables_buttons_en'): + if _me.get_param('availables_buttons_en')[j] == val_key: + tmp.append([i[0], i[1], j]) + _me.set_param('list_of_shortcuts', tmp) + # ---------------------------------------------------------------------------- # Initialization and finalization shared functions @@ -497,3 +557,4 @@ _me.insert_funct('assign_keys', assign_keys) _me.insert_funct('test_shortcut', test_shortcut) +_me.insert_funct('translate', translate) Modified: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/main.pyp =================================================================== --- software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/main.pyp 2008-01-24 15:26:36 UTC (rev 880) +++ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/main.pyp 2008-01-25 09:56:22 UTC (rev 881) @@ -1,10 +1,13 @@ # 'Voiceget' part of the gadget. This code is executed when the # gadget is launched in the gadgets manager. +language = _me.get_var('language') +_me.set_param('last_language', language) list = _me.get_param('list_of_shortcuts') -language = _me.get_var('language') tmp_list = [] +_me.get_funct('translate')() + availables_buttons_en = {'0':0, '1': 1, '2':2, '3':3, '4':4,\ '5':5, '6':6, '7':7, '8':8, '9':9,\ 'mute':K_MUTE, 'volume plus':K_VOLUMEPLUS, 'volume minus':K_VOLUMEMINUS,\ Modified: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/settings.xml =================================================================== --- software/gadgets/shortcuts_manager/trunk/shortcuts_manager/settings.xml 2008-01-24 15:26:36 UTC (rev 880) +++ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/settings.xml 2008-01-25 09:56:22 UTC (rev 881) @@ -24,6 +24,7 @@ </general> <parameters> <hidden_in_manager type='bool'>False</hidden_in_manager> + <last_language type='str'>en_US</last_language> <list_of_shortcuts type='list'>[]</list_of_shortcuts> </parameters> </settings> Modified: software/gadgets/shortcuts_manager/trunk/shortcuts_manager.tgf =================================================================== (Binary files differ) |
Author: Paul_R Date: 2008-01-24 16:26:36 +0100 (Thu, 24 Jan 2008) New Revision: 880 Added: software/gadgets/tux_controller/tags/0.1.1/ software/gadgets/tux_controller/tags/0.1.1/TuxController.tgf software/gadgets/tux_controller/tags/0.1.1/TuxController/ software/gadgets/tux_controller/tags/0.1.1/TuxController/Data/ software/gadgets/tux_controller/tags/0.1.1/TuxController/Data/rc_dict software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/ software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/ software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/battery.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/beak_closed.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/beak_open.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/down.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/eye_closed.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/eyel_close.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/eyer_close.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/gadget.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/gear-off.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/led_off.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/led_on.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/ledl_off.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/ledl_on.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/ledr_off.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/ledr_on.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/left.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/light.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/microphone.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/right.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/run.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/spin_left.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/spin_off.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/spin_off_charging.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/spin_right.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/up.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/wings_down.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/wings_up.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/ software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/ software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/ software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/conf/ software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/conf/other.glade software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/conf/other.pyp software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/widget/ software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/widget/other.glade software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/widget/other.pyp software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/widget/pixmaps/ software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/widget/pixmaps/Diagram1.png software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/init.pyp software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/main.pyp software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/notify.pyp software/gadgets/tux_controller/tags/0.1.1/TuxController/Strings/ software/gadgets/tux_controller/tags/0.1.1/TuxController/Strings/fr_ALL.xml software/gadgets/tux_controller/tags/0.1.1/TuxController/about.xml software/gadgets/tux_controller/tags/0.1.1/TuxController/parts.xml software/gadgets/tux_controller/tags/0.1.1/TuxController/settings.xml software/gadgets/tux_controller/tags/0.1.1/TuxController/strings.xml Log: * Tag of the version 0.1.1 (controller for tuxsetup v0.1.2) Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Data/rc_dict =================================================================== --- software/gadgets/tux_controller/tags/0.1.1/TuxController/Data/rc_dict (rev 0) +++ software/gadgets/tux_controller/tags/0.1.1/TuxController/Data/rc_dict 2008-01-24 15:26:36 UTC (rev 880) @@ -0,0 +1 @@ +words=[['Eyes', []], ['Mouth', []], ['Wings', []], ['Flash', []], ['Leds', []], ['Hide', []], ['Show', []], ['Panel', []]] \ No newline at end of file Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/battery.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/battery.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/beak_closed.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/beak_closed.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/beak_open.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/beak_open.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/down.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/down.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/eye_closed.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/eye_closed.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/eyel_close.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/eyel_close.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/eyer_close.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/eyer_close.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/gadget.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/gadget.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/gear-off.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/gear-off.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/led_off.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/led_off.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/led_on.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/led_on.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/ledl_off.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/ledl_off.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/ledl_on.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/ledl_on.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/ledr_off.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/ledr_off.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/ledr_on.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/ledr_on.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/left.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/left.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/light.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/light.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/microphone.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/microphone.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/right.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/right.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/run.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/run.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/spin_left.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/spin_left.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/spin_off.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/spin_off.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/spin_off_charging.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/spin_off_charging.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/spin_right.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/spin_right.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/up.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/up.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/wings_down.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/wings_down.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/wings_up.png =================================================================== (Binary files differ) Property changes on: software/gadgets/tux_controller/tags/0.1.1/TuxController/Pictures/Icons/wings_up.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/conf/other.glade =================================================================== --- software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/conf/other.glade (rev 0) +++ software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/conf/other.glade 2008-01-24 15:26:36 UTC (rev 880) @@ -0,0 +1,305 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="window1"> + <property name="height_request">102</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Parameters</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">False</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="frame4"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment7"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed5"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="label_remote"> + <property name="width_request">336</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Current : None</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button_remote"> + <property name="width_request">62</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Set</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_button_remote_clicked" last_modification_time="Sat, 22 Sep 2007 00:55:36 GMT"/> + </widget> + <packing> + <property name="x">256</property> + <property name="y">0</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label11"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Remote</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed3"> + <property name="visible">True</property> + + <child> + <widget class="GtkButton" id="button2"> + <property name="width_request">96</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_accept_clicked" last_modification_time="Wed, 11 Jul 2007 19:53:32 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image2"> + <property name="visible">True</property> + <property name="stock">gtk-apply</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="label" translatable="yes">Accept</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">256</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button3"> + <property name="width_request">96</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_cancel_clicked" last_modification_time="Thu, 09 Aug 2007 13:50:03 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox3"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image3"> + <property name="visible">True</property> + <property name="stock">gtk-cancel</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="label" translatable="yes">Cancel</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">152</property> + <property name="y">0</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> +</widget> + +</glade-interface> Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/conf/other.pyp (rev 0) +++ software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/conf/other.pyp 2008-01-24 15:26:36 UTC (rev 880) @@ -0,0 +1,75 @@ +bindtextdomain("params", "") + +class Window(SimpleGladeApp): + + def __init__(self, + path=_me.get_path('root') + '/Scripts/Python/GUI/conf/other.glade', + root="window1", + domain="params", **kwargs): + """ + Constructor + """ + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + + def new(self): + """ + On new window + """ + self.updates_commons() + self.updates_specifics() + + def updates_commons(self): + """ + Updates common widgets + """ + # Window title + txt = "%s : %s" % (_me.string('name_to_read'), + _me.string('gui_conf_window_title')) + self.get_widget("window1").set_title(txt) + + # Remote Frame + txt = _me.string('gui_conf_remote_title') + self.get_widget("label11").set_text(txt) + + txt = "%s : None" % _me.string('gui_conf_current_bind_lb') + self.get_widget("label_remote").set_text(txt) + + txt = _me.string('gui_conf_remote_set_bt') + self.get_widget("button_remote").set_label(txt) + + # Bottom buttons + txt = _me.string('gui_conf_cancel_bt') + self.get_widget("label6").set_text(txt) + + txt = _me.string('gui_conf_accept_bt') + self.get_widget("label5").set_text(txt) + + def updates_specifics(self): + """ + Updates specific widgets + """ + pass + + def on_button_remote_clicked(self, widget, *args): + """ + On button 'set' remote clicked + """ + def remote_set_caption(): + tux.sys.wait(0.1) + gadgets['Manager'].gui('remote').window.set_captions(gadgets[_me.get_name()]) + if gadgets.has_key('Manager'): + if not gadgets['Manager'].gui('remote').showed(): + gadgets['Manager'].gui('remote').show() + thread.start_new_thread(remote_set_caption, ()) + + def on_accept_clicked(self, widget, *args): + """ + On button 'accept' clicked + """ + self.get_widget("window1").destroy() + + def on_cancel_clicked(self, widget, *args): + """ + On button 'cancel' clicked + """ + self.get_widget("window1").destroy() Added: software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/widget/other.glade (rev 0) +++ software/gadgets/tux_controller/tags/0.1.1/TuxController/Scripts/Python/GUI/widget/other.glade 2008-01-24 15:26:36 UTC (rev 880) @@ -0,0 +1,2705 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="window1"> + <property name="visible">True</property> + <property name="title" translatable="yes">Widget</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">False</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + <signal name="destroy" handler="on_window1_destroy" last_modification_time="Thu, 15 Nov 2007 14:17:58 GMT"/> + + <child> + <widget class="GtkVBox" id="vbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkHBox" id="hbox18"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkTable" id="table1"> + <property name="border_width">2</property> + <property name="visible">True</property> + <property name="n_rows">7</property> + <property name="n_columns">2</property> + <property name="homogeneous">False</property> + <property name="row_spacing">0</property> + <property name="column_spacing">0</property> + + <child> + <widget class="GtkFixed" id="fixed13"> + <property name="height_request">57</property> + <property name="visible">True</property> + + <child> + <widget class="GtkCheckButton" id="chkShow"> + <property name="width_request">216</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes"> </property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">False</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <signal name="toggled" handler="on_chkShow_toggled" last_modification_time="Thu, 06 Dec 2007 12:55:43 GMT"/> + </widget> + <packing> + <property name="x">8</property> + <property name="y">15</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">0</property> + <property name="bottom_attach">1</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed25"> + <property name="visible">True</property> + + <child> + <widget class="GtkImage" id="imgSpin"> + <property name="width_request">367</property> + <property name="height_request">83</property> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="x">40</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnSpinLeft"> + <property name="width_request">34</property> + <property name="height_request">34</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NONE</property> + <property name="focus_on_click">False</property> + <signal name="pressed" handler="on_btnSpinLeft_pressed" last_modification_time="Wed, 14 Nov 2007 15:46:35 GMT"/> + <signal name="released" handler="on_btnSpinLeft_released" last_modification_time="Wed, 14 Nov 2007 15:46:38 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment9"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox9"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="imgSpinLeft"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="stock">gtk-go-back</property> + <property name="icon_size">4</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label9"> + <property name="visible">True</property> + <property name="label" translatable="yes"> +</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">0</property> + <property name="y">24</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnSpinRight"> + <property name="width_request">34</property> + <property name="height_request">34</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NONE</property> + <property name="focus_on_click">False</property> + <signal name="pressed" handler="on_btnSpinRight_pressed" last_modification_time="Wed, 14 Nov 2007 15:46:46 GMT"/> + <signal name="released" handler="on_btnSpinRight_released" last_modification_time="Wed, 14 Nov 2007 15:46:50 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment8"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox8"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="imgSpinRight"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="stock">gtk-go-forward</property> + <property name="icon_size">4</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label8"> + <property name="visible">True</property> + <property name="label" translatable="yes"> +</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">26</property> + <property name="y">24</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">4</property> + <property name="bottom_attach">5</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed24"> + <property name="visible">True</property> + + <child> + <widget class="GtkButton" id="btnWingsDown"> + <property name="width_request">34</property> + <property name="height_request">34</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NONE</property> + <property name="focus_on_click">False</property> + <signal name="clicked" handler="on_btnWingsDown_released" last_modification_time="Thu, 06 Dec 2007 14:43:04 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment7"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox7"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="imgWingsDown"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="stock">gtk-go-down</property> + <property name="icon_size">4</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label7"> + <property name="visible">True</property> + <property name="label" translatable="yes"> +</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">16</property> + <property name="y">56</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnWingsUp"> + <property name="width_request">34</property> + <property name="height_request">34</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NONE</property> + <property name="focus_on_click">False</property> + <signal name="clicked" handler="on_btnWingsUp_released" last_modification_time="Thu, 06 Dec 2007 14:42:55 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment6"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox6"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="imgWingsUp"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="stock">gtk-go-up</property> + <property name="icon_size">4</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="label" translatable="yes"> +</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">16</property> + <property name="y">24</property> + </packing> + </child> + + <child> + <widget class="GtkImage" id="imgWings"> + <property name="width_request">367</property> + <property name="height_request">142</property> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="x">40</property> + <property name="y">0</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">3</property> + <property name="bottom_attach">4</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed23"> + <property name="visible">True</property> + + <child> + <widget class="GtkButton" id="btnMouthOpen"> + <property name="width_request">34</property> + <property name="height_request">34</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NONE</property> + <property name="focus_on_click">False</property> + <signal name="clicked" handler="on_btnMouthOpen_released" last_modification_time="Thu, 06 Dec 2007 14:29:34 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox5"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="imgMouthOpen"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="stock">gtk-go-down</property> + <property name="icon_size">4</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="label" translatable="yes"> +</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">16</property> + <property name="y">28</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnMouthClose"> + <property name="width_request">34</property> + <property name="height_request">34</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NONE</property> + <property name="focus_on_click">False</property> + <signal name="clicked" handler="on_btnMouthClose_released" last_modification_time="Thu, 06 Dec 2007 14:29:07 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment12"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox12"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="imgMouthClose"> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="stock">gtk-go-up</property> + <property name="icon_size">4</property> + <property name="xalign">0</property> + <property name="yalign">0</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="label" translatable="yes"> +</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">16</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkImage" id="imgMouth"> + <property name="width_request">367</property> + <property name="height_request">62</property> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="x">40</property> + <property name="y">0</property> + </packing> + </child> + </widget> + <packing> + <property name="left_attach">0</property> + <property name="right_attach">1</property> + <property name="top_attach">2</property> + <property name="bottom_attach">3</property> + <property name="x_options">fill</property> + <property name="y_options">fill</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fix1"> + <property name="height_request">21</property> + <property name="visible">True</property> + + <child> + <widget class="GtkSpinButton" id="spinLED"> + <property name="width_request">70</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="has_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">1 0 127 1 10 10</property> + </widget> + <packing> + <property name="x">70</property> + <property name="y">15</property> + </packing> + </child> + + <child> + <widget class="GtkVSeparator" id="vseparator19"> + <property name="width_request">16</property> + <property name="height_request">50</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">20</property> + <property name="y">4</property> + </packing> + </child> + + <child> + <widget class="GtkVSeparator" id="vseparator18"> + <property name="width_request">16</property> + <property name="height_request">50</property> + <property name="visible">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">4</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lblLED"> + <property name="width_request">16</property> + <property name="height_request">51</property> + <property name="visible">True</property> + <property name="label" translatable="yes"> </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_CENTER</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">True</property> + <property name="angle">90</property> + </widget> + <packing> + <property name="x">9</property> + <property name="y">3</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnLEDRun"> + <property name="width_request">36</property> + <property name="height_request">36</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NONE</property> + <property name="focus_on_click">False</property> + <signal name="clicked" handler="on_btnLEDRun_clicked" last_modification_time="Thu, 15 Nov 2007 10:50:39 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment16"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="... [truncated message content] |
From: Paul_R <c2m...@c2...> - 2008-01-24 15:21:15
|
Author: Paul_R Date: 2008-01-24 16:21:14 +0100 (Thu, 24 Jan 2008) New Revision: 879 Modified: software/gadgets/weather/trunk/Weather.tgf software/gadgets/weather/trunk/Weather/Scripts/Python/main.pyp Log: * Fixed some bugs Modified: software/gadgets/weather/trunk/Weather/Scripts/Python/main.pyp =================================================================== --- software/gadgets/weather/trunk/Weather/Scripts/Python/main.pyp 2008-01-24 14:37:28 UTC (rev 878) +++ software/gadgets/weather/trunk/Weather/Scripts/Python/main.pyp 2008-01-24 15:21:14 UTC (rev 879) @@ -58,7 +58,7 @@ if len(weather_list) == 0: tux.tts.select_voice(_me.get_var('speaker'), _me.get_var('pitch')) tux.tts.speak(_me.string('bad_conf')) - return + return if _me.get_param('degrees_celcius') == True: text = _me.string('current_weather')\ + _me.get_param('city') + ". "\ @@ -80,16 +80,16 @@ + _me.string('%') tux.tts.select_voice(_me.get_var('speaker'), _me.get_var('pitch')) tux.tts.speak(text) - + lang = _me.string('lang') if _me.get_param('read_tommorow'): if _me.get_param('degrees_celcius') == True: - lang = _me.string('lang') + if lang == 'en': celcius_low = int(((float(weather_list[1]['low_temp']) - 32) / 9) * 5) celcius_high = int(((float(weather_list[1]['high_temp']) - 32) / 9) * 5) else: - celcius_low = float(weather_list[1]['low_temp']) - celcius_high = float(weather_list[1]['high_temp']) + celcius_low = int(weather_list[1]['low_temp']) + celcius_high = int(weather_list[1]['high_temp']) text = _me.string('tommorow_weather') + ". "\ + weather_list[1]['condition']\ + _me.string('temperatures')\ @@ -98,12 +98,18 @@ + "%s" % celcius_high\ + _me.string('degrees_c') else: + if lang == 'en': + fahrenheit_low = int(weather_list[1]['low_temp']) + fahrenheit_high = int(weather_list[1]['high_temp']) + else: + fahrenheit_low = int(((float(weather_list[1]['low_temp']) * 9) / 5) + 32) + fahrenheit_high = int(((float(weather_list[1]['high_temp']) * 9) / 5) + 32) text = _me.string('tommorow_weather') + ". "\ + weather_list[1]['condition']\ + _me.string('temperatures')\ - + weather_list[1]['low_temp']\ + + "%s" % fahrenheit_low\ + _me.string('and')\ - + weather_list[1]['high_temp']\ + + "%s" % fahrenheit_high\ + _me.string('degrees_f') tux.tts.select_voice(_me.get_var('speaker'), _me.get_var('pitch')) tux.tts.speak(text) Modified: software/gadgets/weather/trunk/Weather.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2008-01-24 14:37:29
|
Author: Paul_R Date: 2008-01-24 15:37:28 +0100 (Thu, 24 Jan 2008) New Revision: 878 Added: software/gadgets/weather/ software/gadgets/weather/branches/ software/gadgets/weather/tags/ software/gadgets/weather/trunk/ software/gadgets/weather/trunk/Weather.tgf software/gadgets/weather/trunk/Weather/ software/gadgets/weather/trunk/Weather/Pictures/ software/gadgets/weather/trunk/Weather/Pictures/Icons/ software/gadgets/weather/trunk/Weather/Pictures/Icons/gadget.png software/gadgets/weather/trunk/Weather/Scripts/ software/gadgets/weather/trunk/Weather/Scripts/Python/ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.glade software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.pyp software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.glade software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.pyp software/gadgets/weather/trunk/Weather/Scripts/Python/init.pyp software/gadgets/weather/trunk/Weather/Scripts/Python/main.pyp software/gadgets/weather/trunk/Weather/Scripts/Python/notify.pyp software/gadgets/weather/trunk/Weather/Strings/ software/gadgets/weather/trunk/Weather/Strings/fr_ALL.xml software/gadgets/weather/trunk/Weather/about.xml software/gadgets/weather/trunk/Weather/parts.xml software/gadgets/weather/trunk/Weather/settings.xml software/gadgets/weather/trunk/Weather/strings.xml Log: * Added the weather's gadget on SVN * Changes made by Bradbase : Fixed a bug with the temperature : The forecast temperature are in fahrenheit with the english google website, but the french website send them in celsius. Added: software/gadgets/weather/trunk/Weather/Pictures/Icons/gadget.png =================================================================== (Binary files differ) Property changes on: software/gadgets/weather/trunk/Weather/Pictures/Icons/gadget.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.glade =================================================================== --- software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.glade (rev 0) +++ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.glade 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,650 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="window1"> + <property name="height_request">314</property> + <property name="visible">True</property> + <property name="title" translatable="yes">Weather report parameters</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">False</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + + <child> + <widget class="GtkVBox" id="vbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">0</property> + + <child> + <widget class="GtkFrame" id="frame4"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment7"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed5"> + <property name="visible">True</property> + + <child> + <widget class="GtkButton" id="button_remote"> + <property name="width_request">62</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Set</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_button_remote_clicked" last_modification_time="Sat, 22 Sep 2007 00:55:36 GMT"/> + </widget> + <packing> + <property name="x">256</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label_remote"> + <property name="width_request">328</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Current : None</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label11"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Remote</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame5"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment8"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed6"> + <property name="visible">True</property> + + <child> + <widget class="GtkSpinButton" id="delay_spinbutton"> + <property name="width_request">120</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="climb_rate">1</property> + <property name="digits">0</property> + <property name="numeric">False</property> + <property name="update_policy">GTK_UPDATE_ALWAYS</property> + <property name="snap_to_ticks">False</property> + <property name="wrap">False</property> + <property name="adjustment">1 1 3600 1 10 10</property> + </widget> + <packing> + <property name="x">88</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label13"> + <property name="width_request">336</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Delay (sec) :</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Updates</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame1"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed1"> + <property name="visible">True</property> + + <child> + <widget class="GtkEntry" id="entry1"> + <property name="width_request">248</property> + <property name="height_request">25</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">•</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">16</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button1"> + <property name="width_request">62</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Set</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_set_clicked" last_modification_time="Wed, 11 Jul 2007 19:51:03 GMT"/> + </widget> + <packing> + <property name="x">255</property> + <property name="y">14</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label3"> + <property name="width_request">152</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Current location:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Localization</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame2"> + <property name="border_width">5</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed2"> + <property name="visible">True</property> + + <child> + <widget class="GtkRadioButton" id="radiobutton1"> + <property name="width_request">95</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Celsius</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">24</property> + </packing> + </child> + + <child> + <widget class="GtkRadioButton" id="radiobutton2"> + <property name="width_request">128</property> + <property name="height_request">22</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Fahrenheit</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + <property name="group">radiobutton1</property> + </widget> + <packing> + <property name="x">104</property> + <property name="y">24</property> + </packing> + </child> + + <child> + <widget class="GtkCheckButton" id="checkbutton1"> + <property name="width_request">208</property> + <property name="height_request">24</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Tomorrow's forecast</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <property name="active">False</property> + <property name="inconsistent">False</property> + <property name="draw_indicator">True</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Report</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + + <child> + <widget class="GtkFixed" id="fixed3"> + <property name="visible">True</property> + + <child> + <widget class="GtkButton" id="button2"> + <property name="width_request">96</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_accept_clicked" last_modification_time="Wed, 11 Jul 2007 19:53:32 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image2"> + <property name="visible">True</property> + <property name="stock">gtk-ok</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="label" translatable="yes">Accept</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">256</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button3"> + <property name="width_request">96</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_cancel_clicked" last_modification_time="Thu, 09 Aug 2007 13:50:03 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox3"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image3"> + <property name="visible">True</property> + <property name="stock">gtk-cancel</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="label" translatable="yes">Cancel</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">152</property> + <property name="y">0</property> + </packing> + </child> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">True</property> + <property name="fill">True</property> + </packing> + </child> + </widget> + </child> +</widget> + +</glade-interface> Added: software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.pyp (rev 0) +++ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/conf/other.pyp 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,117 @@ +bindtextdomain("params", "") + +class Window(SimpleGladeApp): + + def __init__(self, + path=_me.paths['root'] + '/Scripts/Python/GUI/conf/other.glade', + root="window1", + domain="params", **kwargs): + """ + Constructor + """ + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + + def new(self): + """ + On new window + """ + self.updates_commons() + self.updates_specifics() + + self.get_widget("checkbutton1").set_active(_me.get_param('read_tommorow')) + if _me.get_param('degrees_celcius'): + self.get_widget("radiobutton1").set_active(True) + else: + self.get_widget("radiobutton2").set_active(True) + + def updates_commons(self): + """ + Update common widgets + """ + # Window title + txt = "%s : %s" % (_me.string('name_to_read'), + _me.string('gui_conf_window_title')) + self.get_widget("window1").set_title(txt) + + # Remote Frame + txt = _me.string('gui_conf_remote_title') + self.get_widget("label11").set_text(txt) + + txt = "%s : None" % _me.string('gui_conf_current_bind_lb') + self.get_widget("label_remote").set_text(txt) + + txt = _me.string('gui_conf_remote_set_bt') + self.get_widget("button_remote").set_label(txt) + + # Update Frame + txt = _me.string('gui_conf_update_title') + self.get_widget("label12").set_text(txt) + + txt = "%s : " % _me.string('gui_conf_delay_lb') + self.get_widget("label13").set_text(txt) + + value = _me.get_var('notify_delay') + self.get_widget("delay_spinbutton").set_value(value) + + # Bottom buttons + txt = _me.string('gui_conf_cancel_bt') + self.get_widget("label6").set_text(txt) + + txt = _me.string('gui_conf_accept_bt') + self.get_widget("label5").set_text(txt) + + def updates_specifics(self): + + # Localization frame + txt = _me.string('gui_conf_localization_title') + self.get_widget("label1").set_text(txt) + + txt = "%s : " % _me.string('gui_conf_current_location_lb') + self.get_widget("label3").set_text(txt) + + self.get_widget("entry1").set_text(_me.get_param('city')) + + txt = _me.string('gui_conf_localization_set_bt') + self.get_widget("button1").set_label(txt) + + # Report frame + txt = _me.string('gui_conf_report_title') + self.get_widget("label2").set_text(txt) + + txt = _me.string('gui_conf_tommorow_cb') + self.get_widget("checkbutton1").set_label(txt) + + def on_button_remote_clicked(self, widget, *args): + """ + On button 'set' remote clicked + """ + def remote_set_caption(): + tux.sys.wait(0.1) + gadgets['Manager'].gui('remote').window.set_captions(gadgets[_me.get_name()]) + if gadgets.has_key('Manager'): + if not gadgets['Manager'].gui('remote').showed(): + gadgets['Manager'].gui('remote').show() + gadget_thread.start_new_thread(remote_set_caption, ()) + + def on_set_clicked(self, widget, *args): + """ + On button 'set' clicked + """ + _me.set_param('city', self.get_widget("entry1").get_text()) + + def on_accept_clicked(self, widget, *args): + """ + On button 'accept' clicked + """ + _me.set_var('notify_delay', int(self.get_widget("delay_spinbutton").get_value())) + _me.set_param('read_tommorow', self.get_widget("checkbutton1").get_active()) + _me.set_param('degrees_celcius', self.get_widget("radiobutton1").get_active()) + if _me.gui('widget').showed(): + _me.gui('widget').window.update() + self.get_widget("window1").destroy() + + def on_cancel_clicked(self, widget, *args): + """ + On button 'cancel' clicked + """ + self.get_widget("window1").destroy() Added: software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.glade (rev 0) +++ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.glade 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,205 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="window1"> + <property name="visible">True</property> + <property name="title" translatable="yes">Weather forcast</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">False</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + + <child> + <widget class="GtkFrame" id="frame1"> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed1"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="width_request">192</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">...</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="width_request">192</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">...</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">104</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="width_request">192</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">...</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">80</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label4"> + <property name="width_request">192</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">...</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">56</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label3"> + <property name="width_request">256</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">...</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">32</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b></b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + </child> +</widget> + +</glade-interface> Added: software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.pyp (rev 0) +++ software/gadgets/weather/trunk/Weather/Scripts/Python/GUI/widget/other.pyp 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,34 @@ +bindtextdomain("params", "") + +class Window(SimpleGladeApp): + + def __init__(self, + path=_me.paths['root'] + '/Scripts/Python/GUI/widget/other.glade', + root="window1", + domain="params", **kwargs): + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + + def new(self): + self.get_widget("window1").set_title(_me.string('name_to_read')) + gadget_thread.start_new_thread(self.update, ()) + + def update(self): + _me.update_informations() + if _me.get_param('last_state') != None: + if _me.get_param('last_state') != []: + w = _me.get_param('last_state') + city = _me.string('city_label') + _me.get_param('city') + condition = _me.string('condition_label') + w[0]['condition'] + if _me.get_param('degrees_celcius') == True: + temp = _me.string('temp_label') + w[0]['temp_c'] + '°c' + else: + temp = _me.string('temp_label') + w[0]['temp_f'] + '°f' + humidity = w[0]['humidity'] + wind = w[0]['wind_condition'] + else: + return + self.get_widget("label2").set_text(city) + self.get_widget("label3").set_text(condition) + self.get_widget("label4").set_text(temp) + self.get_widget("label5").set_text(humidity) + self.get_widget("label6").set_text(wind) Added: software/gadgets/weather/trunk/Weather/Scripts/Python/init.pyp =================================================================== Added: software/gadgets/weather/trunk/Weather/Scripts/Python/main.pyp =================================================================== --- software/gadgets/weather/trunk/Weather/Scripts/Python/main.pyp (rev 0) +++ software/gadgets/weather/trunk/Weather/Scripts/Python/main.pyp 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,115 @@ +def update_informations(): + import xml.dom.minidom + from xml.dom.minidom import Node + import tdrss + + lang = _me.string('lang') + city = _me.get_param('city') + _me.set_param('last_state', []) + url = "http://www.google.com/ig/api?hl=%s&weather=%s" % (lang, city) + + ret, rss_str = tdrss.rss_read_url(url, 2) + if not ret: + return + u=unicode(rss_str,"iso-8859-1") + text_to_send=u.encode('utf-8','replace') + + doc = xml.dom.minidom.parseString(text_to_send) + weather_node = doc.getElementsByTagName("weather")[0] + + for node in weather_node.getElementsByTagName("current_conditions"): + c_c = {} + condition = node.getElementsByTagName("condition")[0].getAttribute('data') + temp_f = node.getElementsByTagName("temp_f")[0].getAttribute('data') + temp_c = node.getElementsByTagName("temp_c")[0].getAttribute('data') + humidity = node.getElementsByTagName("humidity")[0].getAttribute('data') + wind_condition = node.getElementsByTagName("wind_condition")[0].getAttribute('data') + c_c['condition'] = condition + c_c['condition'] = c_c['condition'].encode('latin1','replace') + c_c['temp_f'] = temp_f + c_c['temp_f'] = c_c['temp_f'].encode('latin1','replace') + c_c['temp_c'] = temp_c + c_c['temp_c'] = c_c['temp_c'].encode('latin1','replace') + c_c['humidity'] = humidity + c_c['humidity'] = c_c['humidity'].encode('utf-8','replace') + c_c['wind_condition'] = wind_condition + c_c['wind_condition'] = c_c['wind_condition'].encode('utf-8','replace') + _me.get_param('last_state').append(c_c) + + for node in weather_node.getElementsByTagName("forecast_conditions"): + f_c = {} + low_temp = node.getElementsByTagName("low")[0].getAttribute('data') + high_temp = node.getElementsByTagName("high")[0].getAttribute('data') + day_of_week = node.getElementsByTagName("day_of_week")[0].getAttribute('data') + condition = node.getElementsByTagName("condition")[0].getAttribute('data') + f_c['condition'] = condition + f_c['condition'] = f_c['condition'].encode('latin1','replace') + f_c['day_of_week'] = day_of_week + f_c['day_of_week'] = f_c['day_of_week'].encode('latin1','replace') + f_c['low_temp'] = low_temp + f_c['low_temp'] = f_c['low_temp'].encode('latin1','replace') + f_c['high_temp'] = high_temp + f_c['high_temp'] = f_c['high_temp'].encode('latin1','replace') + _me.get_param('last_state').append(f_c) + +def speak_weather(): + _me.update_informations() + weather_list = _me.get_param('last_state') + if len(weather_list) == 0: + tux.tts.select_voice(_me.get_var('speaker'), _me.get_var('pitch')) + tux.tts.speak(_me.string('bad_conf')) + return + if _me.get_param('degrees_celcius') == True: + text = _me.string('current_weather')\ + + _me.get_param('city') + ". "\ + + weather_list[0]['condition']\ + + _me.string('temperature')\ + + weather_list[0]['temp_c']\ + + _me.string('degrees_c')\ + + weather_list[0]['humidity']\ + + _me.string('%') + else: + text = _me.string('current_weather')\ + + _me.get_param('city')\ + + ". "\ + + weather_list[0]['condition']\ + + _me.string('temperature')\ + + weather_list[0]['temp_f']\ + + _me.string('degrees_f')\ + + weather_list[0]['humidity']\ + + _me.string('%') + tux.tts.select_voice(_me.get_var('speaker'), _me.get_var('pitch')) + tux.tts.speak(text) + + if _me.get_param('read_tommorow'): + if _me.get_param('degrees_celcius') == True: + lang = _me.string('lang') + if lang == 'en': + celcius_low = int(((float(weather_list[1]['low_temp']) - 32) / 9) * 5) + celcius_high = int(((float(weather_list[1]['high_temp']) - 32) / 9) * 5) + else: + celcius_low = float(weather_list[1]['low_temp']) + celcius_high = float(weather_list[1]['high_temp']) + text = _me.string('tommorow_weather') + ". "\ + + weather_list[1]['condition']\ + + _me.string('temperatures')\ + + "%s" % celcius_low\ + + _me.string('and')\ + + "%s" % celcius_high\ + + _me.string('degrees_c') + else: + text = _me.string('tommorow_weather') + ". "\ + + weather_list[1]['condition']\ + + _me.string('temperatures')\ + + weather_list[1]['low_temp']\ + + _me.string('and')\ + + weather_list[1]['high_temp']\ + + _me.string('degrees_f') + tux.tts.select_voice(_me.get_var('speaker'), _me.get_var('pitch')) + tux.tts.speak(text) + +def on_k_stop(): + tux.tts.stop() + +tux.event.on_remote_bt[K_STOP] = on_k_stop +speak_weather() Added: software/gadgets/weather/trunk/Weather/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/weather/trunk/Weather/Scripts/Python/notify.pyp (rev 0) +++ software/gadgets/weather/trunk/Weather/Scripts/Python/notify.pyp 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,6 @@ +def notify_checker(): + if _me.gui('widget').showed(): + _me.gui('widget').window.update() + +def notify_actuator(): + pass Added: software/gadgets/weather/trunk/Weather/Strings/fr_ALL.xml =================================================================== --- software/gadgets/weather/trunk/Weather/Strings/fr_ALL.xml (rev 0) +++ software/gadgets/weather/trunk/Weather/Strings/fr_ALL.xml 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,39 @@ +<?xml version='1.0' encoding='UTF-8'?> +<strings> + <and type='str'>, et, </and> + <bad_conf type='str'> Mauvaise configuration.</bad_conf> + <city_label type='str'>Ville : </city_label> + <condition_label type='str'>Condition : </condition_label> + <current_weather type='str'>Voici la météo actuelle à </current_weather> + <degrees_c type='str'> degrés Celsius .</degrees_c> + <degrees_f type='str'> degrés Fahrenheit .</degrees_f> + <gui_conf_about_title type='str'>A propos</gui_conf_about_title> + <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> + <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> + <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> + <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> + <gui_conf_current_location_lb type='str'>Endroit courant</gui_conf_current_location_lb> + <gui_conf_delay_lb type='str'>Délai (sec)</gui_conf_delay_lb> + <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <gui_conf_localization_set_bt type='str'>Set</gui_conf_localization_set_bt> + <gui_conf_localization_title type='str'>Localisation</gui_conf_localization_title> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <gui_conf_remote_title type='str'>Télécommande</gui_conf_remote_title> + <gui_conf_report_title type='str'>Rapport</gui_conf_report_title> + <gui_conf_tommorow_cb type='str'>Météo pour demain</gui_conf_tommorow_cb> + <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> + <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> + <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> + <help_text type='str'>Gadget de prévisions météo pour Tux droid. + +Spécifiez votre région dans la partie paramètres. +Cochez/Décochez l'option de prévisions pour le lendemain. +Vous pouvez choisir entre la mesure Fahrenheit ou Celsius.</help_text> + <lang type='str'>fr</lang> + <name_to_read type='str'>Météo</name_to_read> + <speaker_name type='str'>Bruno8k</speaker_name> + <temp_label type='str'>Température : </temp_label> + <temperature type='str'>, température, </temperature> + <temperatures type='str'>, la température sera comprise entre, </temperatures> + <tommorow_weather type='str'>Voici les prévisions pour demain</tommorow_weather> +</strings> Added: software/gadgets/weather/trunk/Weather/about.xml =================================================================== --- software/gadgets/weather/trunk/Weather/about.xml (rev 0) +++ software/gadgets/weather/trunk/Weather/about.xml 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,12 @@ +<?xml version='1.0' encoding='UTF-8'?> +<about> + <gadget_author type='str'>rem...@c2... and tux...@br...</gadget_author> + <gadget_description type='str'>Weather forecast gadget for Tux Droid. + +bradbase has edited it 2007-01-20; +Fixed error in celsius for tomorrow weather. +Added humidity reading for today weather. +tu...@br...</gadget_description> + <gadget_name type='str'>Weather</gadget_name> + <gadget_version type='str'>0.0.5</gadget_version> +</about> Added: software/gadgets/weather/trunk/Weather/parts.xml =================================================================== --- software/gadgets/weather/trunk/Weather/parts.xml (rev 0) +++ software/gadgets/weather/trunk/Weather/parts.xml 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,6 @@ +<?xml version='1.0' encoding='UTF-8'?> +<parts> + <notifications type='bool'>True</notifications> + <parameters_GUI type='bool'>True</parameters_GUI> + <widget_GUI type='bool'>True</widget_GUI> +</parts> Added: software/gadgets/weather/trunk/Weather/settings.xml =================================================================== --- software/gadgets/weather/trunk/Weather/settings.xml (rev 0) +++ software/gadgets/weather/trunk/Weather/settings.xml 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,30 @@ +<?xml version='1.0' encoding='UTF-8'?> +<settings> + <general> + <framework_version type='str'>0.0.0</framework_version> + <gui_state> + <conf> + <visible type='bool'>False</visible> + </conf> + <widget> + <visible type='bool'>True</visible> + </widget> + </gui_state> + <have_main_part type='bool'>True</have_main_part> + <have_settings_part type='bool'>True</have_settings_part> + <have_widget_part type='bool'>False</have_widget_part> + <language type='str'>en_US</language> + <main_priority type='int'>4</main_priority> + <menu_active type='bool'>True</menu_active> + <notified type='bool'>True</notified> + <notify_delay type='int'>60</notify_delay> + <notify_priority type='int'>4</notify_priority> + <pitch type='int'>132</pitch> + <speaker type='int'>3</speaker> + </general> + <parameters> + <city type='str'>Brussels</city> + <degrees_celcius type='bool'>True</degrees_celcius> + <read_tommorow type='bool'>False</read_tommorow> + </parameters> +</settings> Added: software/gadgets/weather/trunk/Weather/strings.xml =================================================================== --- software/gadgets/weather/trunk/Weather/strings.xml (rev 0) +++ software/gadgets/weather/trunk/Weather/strings.xml 2008-01-24 14:37:28 UTC (rev 878) @@ -0,0 +1,39 @@ +<?xml version='1.0' encoding='UTF-8'?> +<strings> + <and type='str'>, and, </and> + <bad_conf type='str'> Bad configuration.</bad_conf> + <city_label type='str'>City : </city_label> + <condition_label type='str'>Condition : </condition_label> + <current_weather type='str'>Current weather at </current_weather> + <degrees_c type='str'> degrees Celsius .</degrees_c> + <degrees_f type='str'> degrees Fahrenheit .</degrees_f> + <gui_conf_about_title type='str'>About</gui_conf_about_title> + <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> + <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> + <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> + <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> + <gui_conf_current_location_lb type='str'>Current location</gui_conf_current_location_lb> + <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> + <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <gui_conf_localization_set_bt type='str'>Set</gui_conf_localization_set_bt> + <gui_conf_localization_title type='str'>Localization</gui_conf_localization_title> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <gui_conf_remote_title type='str'>Remote</gui_conf_remote_title> + <gui_conf_report_title type='str'>Report</gui_conf_report_title> + <gui_conf_tommorow_cb type='str'>Tomorrow's forecast</gui_conf_tommorow_cb> + <gui_conf_update_title type='str'>Update</gui_conf_update_title> + <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> + <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> + <help_text type='str'>Weather forecast gadget for Tux Droid. + +Specify your location in the settings window. +Disable/enable the option for tomorrow's forecast +and the degrees can be set to Fahrenheit or Celsius.</help_text> + <lang type='str'>en</lang> + <name_to_read type='str'>Weather</name_to_read> + <speaker_name type='str'>Ryan8k</speaker_name> + <temp_label type='str'>Temperature : </temp_label> + <temperature type='str'>, temperature, </temperature> + <temperatures type='str'>, the temperature will be between, </temperatures> + <tommorow_weather type='str'>Tomorrows weather </tommorow_weather> +</strings> Added: software/gadgets/weather/trunk/Weather.tgf =================================================================== (Binary files differ) Property changes on: software/gadgets/weather/trunk/Weather.tgf ___________________________________________________________________ Name: svn:mime-type + application/octet-stream |
From: Paul_R <c2m...@c2...> - 2008-01-24 13:54:47
|
Author: Paul_R Date: 2008-01-24 14:54:44 +0100 (Thu, 24 Jan 2008) New Revision: 877 Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/notify.pyp software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml Log: * Fixed a bug in the notification actuator. This bug cut the TTS and displayed 'NOTIFICATION ERROR' in the debugger * Incremented the version number. (0.0.1 -> 0.0.2) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf =================================================================== (Binary files differ) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/notify.pyp 2008-01-24 12:41:06 UTC (rev 876) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Scripts/Python/notify.pyp 2008-01-24 13:54:44 UTC (rev 877) @@ -1,26 +1,27 @@ def notify_checker(): + measure = _me.get_param('measure') + if measure.low_threshold_flag == True or measure.high_threshold_flag == True: return True if measure.end_of_charge_flag == True: return True - + if measure.GUI_on == False: for i in range(len(measure.event_tab)): temp = measure.event_tab[i][7] if temp == True: return True return False - elif measure.GUI_on == True: + else: for i in range(len(measure.test_tab)): temp = measure.test_tab[i][7] if temp == True: return True return False - else: - return False + def notify_actuator(): @@ -49,7 +50,6 @@ event = measure.test_tab else: event = measure.event_tab - for i in range(len(event)): #create text to speach for the default notification if event[i][1] == 0: @@ -67,16 +67,15 @@ elif event[i][2] == 1: text = _me.string('Decrease') elif event[i][2] == 2: - text = _me.string('Both') - - if event[i][7]: + text = _me.string('Both') + if event[i][7]: if event[i][5]: - path = event[i][6] + path = str(event[i][6]) path = path.replace('%20', ' ') if os.path.isfile(path) and os.path.exists(path): path = "'%s'" % path tux.sys.shell(path) - event[i][7] = False + event[i][7] = False else: tux.cmd.mouth_open() tux.tts.speak(text) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2008-01-24 12:41:06 UTC (rev 876) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2008-01-24 13:54:44 UTC (rev 877) @@ -4,5 +4,5 @@ <gadget_description type='str'> </gadget_description> <gadget_name type='str'>battery_monitor</gadget_name> - <gadget_version type='str'>0.0.1</gadget_version> + <gadget_version type='str'>0.0.2</gadget_version> </about> |
From: remi <c2m...@c2...> - 2008-01-24 12:41:08
|
Author: remi Date: 2008-01-24 13:41:06 +0100 (Thu, 24 Jan 2008) New Revision: 876 Modified: api/python/trunk/tux.py api/python/trunk/tuxapi_class.py Log: UPD: tts and wav objects are now binded to the new OSL library. (software/tuxosl) Modified: api/python/trunk/tux.py =================================================================== --- api/python/trunk/tux.py 2008-01-24 12:06:48 UTC (rev 875) +++ api/python/trunk/tux.py 2008-01-24 12:41:06 UTC (rev 876) @@ -23,7 +23,6 @@ tux=tuxapi_class.TUXTCPCommunicator() wavs=tuxapi_wav_merger.WavMerger(tux) tux.daemon.connect() -tux.tts.connect() tux.daemon.set_my_client_name("Py Client") tux.print_warnings=True tux.daemon.auto_connect(True) Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2008-01-24 12:06:48 UTC (rev 875) +++ api/python/trunk/tuxapi_class.py 2008-01-24 12:41:06 UTC (rev 876) @@ -34,6 +34,9 @@ import math from tuxapi_const import * from copy import deepcopy +sys.path.append("/opt/tuxdroid/apps/tuxosl") +from tux_osl_const import * +from tux_osl_api import TuxOSLAPI #============================================================================== # Constants @@ -181,10 +184,11 @@ self.sdaemon=self.daemon self.status=TUXStatus(self) self.hw=TUXhw(self) - self.tts=TUXtts(self) + self.__osl = TuxOSLAPI(self) + self.tts=self.__osl.tts + self.wav=self.__osl.wav self.misc=TUXmisc(self) self.monitoring = TUXmonitoring(self) - self.wav = TUXwav(self) self.micro = TUXmicro(self) self._switches = [] self.api_version = api_version @@ -194,9 +198,6 @@ t.setName('daemon._loop_auto_connect') t.start() self.main_thread_list.append(t) - t=threading.Thread(target=self.tts._loop_auto_connect) - t.setName('tts._loop_auto_connect') - t.start() self.main_thread_list.append(t) #-------------------------------------------------------------------------- @@ -210,7 +211,6 @@ self.tts.disconnect() self.tts.destroy() self.daemon._tcp_threads_join() - self.tts._tcp_threads_join() self.micro.destroy() self.wav.destroy() self.exit_flag=True |
Author: Paul_R Date: 2008-01-24 13:06:48 +0100 (Thu, 24 Jan 2008) New Revision: 875 Added: software/gadgets/shortcuts_manager/branches/ software/gadgets/shortcuts_manager/tags/ software/gadgets/shortcuts_manager/trunk/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager.tgf software/gadgets/shortcuts_manager/trunk/shortcuts_manager/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Data/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Data/rc_dict software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Pictures/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Pictures/Icons/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Pictures/Icons/gadget.png software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/add/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/add/other.glade software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/add/other.pyp software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/already_exists/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/already_exists/other.glade software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/already_exists/other.pyp software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/conf/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/conf/other.glade software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/conf/other.pyp software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/delete_confirm/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/delete_confirm/other.glade software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/delete_confirm/other.pyp software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/modify/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/modify/other.glade software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/modify/other.pyp software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/no_shortcut/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/no_shortcut/other.glade software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/no_shortcut/other.pyp software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/widget/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/widget/other.glade software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/widget/other.pyp software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/init.pyp software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/main.pyp software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/notify.pyp software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Strings/ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Strings/fr_ALL.xml software/gadgets/shortcuts_manager/trunk/shortcuts_manager/about.xml software/gadgets/shortcuts_manager/trunk/shortcuts_manager/parts.xml software/gadgets/shortcuts_manager/trunk/shortcuts_manager/settings.xml software/gadgets/shortcuts_manager/trunk/shortcuts_manager/strings.xml Log: * Added the shortcut manager gadget Added: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Data/rc_dict =================================================================== --- software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Data/rc_dict (rev 0) +++ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Data/rc_dict 2008-01-24 12:06:48 UTC (rev 875) @@ -0,0 +1 @@ +words=[] \ No newline at end of file Added: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Pictures/Icons/gadget.png =================================================================== (Binary files differ) Property changes on: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Pictures/Icons/gadget.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Added: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/add/other.glade =================================================================== --- software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/add/other.glade (rev 0) +++ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/add/other.glade 2008-01-24 12:06:48 UTC (rev 875) @@ -0,0 +1,521 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="window1"> + <property name="visible">True</property> + <property name="title" translatable="yes">Widget</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_CENTER</property> + <property name="modal">True</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + + <child> + <widget class="GtkFixed" id="fixed1"> + <property name="visible">True</property> + + <child> + <widget class="GtkFrame" id="frame1"> + <property name="width_request">326</property> + <property name="height_request">123</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed2"> + <property name="width_request">304</property> + <property name="height_request">55</property> + <property name="visible">True</property> + + <child> + <widget class="GtkEntry" id="entry1"> + <property name="width_request">160</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">132</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="entry2"> + <property name="width_request">160</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="editable">True</property> + <property name="visibility">True</property> + <property name="max_length">0</property> + <property name="text" translatable="yes"></property> + <property name="has_frame">True</property> + <property name="invisible_char">●</property> + <property name="activates_default">False</property> + </widget> + <packing> + <property name="x">132</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label3"> + <property name="width_request">128</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Name:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="width_request">160</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Command:</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">40</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button6"> + <property name="width_request">146</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">False</property> + <signal name="clicked" handler="on_btestsh_clicked" last_modification_time="Fri, 01 Jan 1988 01:46:06 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment9"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox6"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image6"> + <property name="visible">True</property> + <property name="stock">gtk-execute</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label12"> + <property name="visible">True</property> + <property name="label" translatable="yes">Test shortcut</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">80</property> + <property name="y">68</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Shortcut configuration</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="x">3</property> + <property name="y">4</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button2"> + <property name="width_request">78</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_button2_clicked" last_modification_time="Fri, 01 Jan 1988 01:43:18 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox2"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image2"> + <property name="visible">True</property> + <property name="stock">gtk-no</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label7"> + <property name="visible">True</property> + <property name="label" translatable="yes">Cancel</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">168</property> + <property name="y">208</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button1"> + <property name="width_request">78</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_button1_clicked" last_modification_time="Fri, 01 Jan 1988 01:43:32 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="stock">gtk-yes</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="label" translatable="yes">Ok</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">248</property> + <property name="y">208</property> + </packing> + </child> + + <child> + <widget class="GtkFrame" id="frame3"> + <property name="width_request">328</property> + <property name="height_request">64</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment3"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed4"> + <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="label8"> + <property name="width_request">144</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Assign a button : </property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">12</property> + </packing> + </child> + + <child> + <widget class="GtkComboBoxEntry" id="comboboxentry1"> + <property name="width_request">160</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="items" translatable="yes">Assigment</property> + <property name="add_tearoffs">False</property> + <property name="has_frame">True</property> + <property name="focus_on_click">True</property> + </widget> + <packing> + <property name="x">136</property> + <property name="y">8</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Remote control configuration</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="x">3</property> + <property name="y">136</property> + </packing> + </child> + </widget> + </child> +</widget> + +</glade-interface> Added: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/add/other.pyp =================================================================== --- software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/add/other.pyp (rev 0) +++ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/add/other.pyp 2008-01-24 12:06:48 UTC (rev 875) @@ -0,0 +1,119 @@ +bindtextdomain("params", "") + +class Window(SimpleGladeApp): + + def __init__(self, + path=_me.get_path('root') + '/Scripts/Python/GUI/add/other.glade', + root="window1", + domain="params", **kwargs): + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + + def new(self): + availables_buttons_en = {'0':'K_0', '1':'K_1', '2':'K_2', '3':'K_3', '4':'K_4',\ + '5':'K_5', '6':'K_6', '7':'K_7', '8':'K_8', '9':'K_9',\ + 'mute':'K_MUTE', 'volume plus':'K_VOLUMEPLUS', 'volume minus':'K_VOLUMEMINUS',\ + 'escape':'K_ESCAPE', 'yes':'K_YES', 'no':'K_NO', 'backspace':'K_BACKSPACE',\ + 'ip voice': 'K_STARTVOIP', 'receive call': 'K_RECEIVECALL', 'hang up':'K_HANGUP',\ + 'star':'K_START', 'sharp':'K_SHARP', 'red':'K_RED', 'green':'K_GREEN',\ + 'blue':'K_BLUE', 'yellow':'K_YELLOW', 'channel plus': 'K_CHANELPLUS',\ + 'channel minus':'K_CHANELMINUS', 'up':'K_UP', 'down': 'K_DOWN',\ + 'left':'K_LEFT', 'right': 'K_RIGHT', 'ok':'K_OK', 'fast rewind': 'K_FASTREWIND',\ + 'fast forward': 'K_FASTFORWARD', 'play/pause': 'K_PLAYPAUSE',\ + 'stop': 'K_STOP', 'recording': 'K_RECORDING', 'previous': 'K_PREVIOUS',\ + 'next': 'K_NEXT', 'menu': 'K_MENU', 'mouse': 'K_MOUSE', 'alt': 'K_ALT'} + + availables_buttons_fr = {'0':'K_0', '1':'K_1', '2':'K_2', '3':'K_3', '4':'K_4',\ + '5':'K_5', '6':'K_6', '7':'K_7', '8':'K_8', '9':'K_9',\ + 'mute':'K_MUTE', 'volume plus':'K_VOLUMEPLUS', 'volume moins':'K_VOLUMEMINUS',\ + 'espace':'K_ESCAPE', 'oui':'K_YES', 'non':'K_NO', 'espace arrière':'K_BACKSPACE',\ + 'voix ip': 'K_STARTVOIP', 'recevoir appel': 'K_RECEIVECALL', 'raccrocher':'K_HANGUP',\ + 'étoile':'K_START', 'dièse':'K_SHARP', 'rouge':'K_RED', 'vert':'K_GREEN',\ + 'bleu':'K_BLUE', 'jaune':'K_YELLOW', 'channel plus': 'K_CHANELPLUS',\ + 'channel moins':'K_CHANELMINUS', 'flèche haut':'K_UP', 'flèche bas': 'K_DOWN',\ + 'gauche':'K_LEFT', 'droite': 'K_RIGHT', 'ok':'K_OK', 'retour rapide': 'K_FASTREWIND',\ + 'avance rapide': 'K_FASTFORWARD', 'play/pause': 'K_PLAYPAUSE',\ + 'stop': 'K_STOP', 'enregistrer': 'K_RECORDING', 'précédent': 'K_PREVIOUS',\ + 'suivant': 'K_NEXT', 'menu': 'K_MENU', 'souris': 'K_MOUSE', 'alt': 'K_ALT'} + + list_of_shortcuts = _me.get_param('list_of_shortcuts') + temp = [] + i = 0 + while i != len(list_of_shortcuts): + temp.append(list_of_shortcuts[i][2]) + i += 1 + + + self.get_widget("window1").set_title(_me.string('at_gui_add_title')) + self.model = self.get_widget('comboboxentry1').get_model() + + langue = _me.get_var('language') + self.model.clear() + tmp_list = [] + if langue == 'fr_ALL': + for i in availables_buttons_fr.keys(): + if not (i in temp): + tmp_list.append(i) + + i = 0 + tmp_list.sort() + while i != len(tmp_list): + self.model.append([tmp_list[i]]) + i += 1 + + else: + for i in availables_buttons_en.keys(): + if not (i in temp): + tmp_list.append(i) + i = 0 + tmp_list.sort() + while i != len(tmp_list): + self.model.append([tmp_list[i]]) + i += 1 + + self.get_widget('comboboxentry1').set_active(0) + + + def on_button1_clicked(self, widget, *args): + """ + Event attached to the ok button. + """ + application, recognition, remote_key = ('', '', '') + application = self.get_widget('entry1').get_text() + recognition = self.get_widget('entry2').get_text() + remote_key = self.get_widget('comboboxentry1').get_active_text() + list = _me.get_param('list_of_shortcuts') + + if (application == '') or (recognition == ''): + thread.start_new_thread(_me.gui('already_exists').show_from_main, ()) + return + + for i in list: + if (i[0] == application) or (recognition == i[1]) or (remote_key == i[2]): + thread.start_new_thread(_me.gui('already_exists').show_from_main, ()) + return + + final_values = [application, recognition, remote_key] + list.append(final_values) + _me.set_param('list_of_shortcuts', list) + self.get_widget('window1').destroy() + #Refresh the TreeView. + if _me.gui('conf').showed(): + _me.gui('conf').window.update() + tux.tts.speak_free(_me.string('added') % recognition) + + + def on_button2_clicked(self, widget, *args): + """ + Event attached to the cancel button. + """ + self.get_widget('window1').destroy() + + + def on_btestsh_clicked(self, widget, *args): + """ + Event attached to the test button. + """ + _me.set_param('shortcut', self.get_widget('entry1').get_text()) + _me.set_param('name', self.get_widget('entry2').get_text()) + _me.get_funct('test_shortcut')() + Added: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/already_exists/other.glade =================================================================== --- software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/already_exists/other.glade (rev 0) +++ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/already_exists/other.glade 2008-01-24 12:06:48 UTC (rev 875) @@ -0,0 +1,91 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="window1"> + <property name="visible">True</property> + <property name="title" translatable="yes">Widget</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_CENTER</property> + <property name="modal">True</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + + <child> + <widget class="GtkFixed" id="fixed3"> + <property name="visible">True</property> + + <child> + <widget class="GtkButton" id="button1"> + <property name="width_request">72</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">Ok/Cancel</property> + <property name="use_underline">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_bokcancel_clicked" last_modification_time="Fri, 01 Jan 1988 00:12:41 GMT"/> + </widget> + <packing> + <property name="x">272</property> + <property name="y">57</property> + </packing> + </child> + + <child> + <widget class="GtkImage" id="image1"> + <property name="width_request">56</property> + <property name="height_request">48</property> + <property name="visible">True</property> + <property name="stock">gtk-dialog-warning</property> + <property name="icon_size">6</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="x">0</property> + <property name="y">14</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="width_request">272</property> + <property name="height_request">48</property> + <property name="visible">True</property> + <property name="label" translatable="yes">Sorry an error has been found trying to get values, make sure that you've entred corrects values and try again.</property> + <property name="use_underline">False</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">True</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="x">64</property> + <property name="y">14</property> + </packing> + </child> + </widget> + </child> +</widget> + +</glade-interface> Added: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/already_exists/other.pyp =================================================================== --- software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/already_exists/other.pyp (rev 0) +++ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/already_exists/other.pyp 2008-01-24 12:06:48 UTC (rev 875) @@ -0,0 +1,20 @@ +bindtextdomain("params", "") + +class Window(SimpleGladeApp): + + def __init__(self, + path=_me.get_path('root') + '/Scripts/Python/GUI/already_exists/other.glade', + root="window1", + domain="params", **kwargs): + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + + def new(self): + self.get_widget("window1").set_title(_me.string('name_to_read')) + + + + def on_bokcancel_clicked(self, widget, *args): + """ + Event attached to the ok/cancel button (Close the GUI) + """ + self.get_widget('window1').destroy() Added: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/conf/other.glade =================================================================== --- software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/conf/other.glade (rev 0) +++ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/conf/other.glade 2008-01-24 12:06:48 UTC (rev 875) @@ -0,0 +1,429 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="window1"> + <property name="visible">True</property> + <property name="title" translatable="yes">Widget</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_NONE</property> + <property name="modal">False</property> + <property name="resizable">True</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</property> + <property name="skip_pager_hint">False</property> + <property name="type_hint">GDK_WINDOW_TYPE_HINT_NORMAL</property> + <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> + <property name="focus_on_map">True</property> + <property name="urgency_hint">False</property> + <signal name="destroy" handler="on_window1_destroy" last_modification_time="Thu, 29 Nov 2007 09:25:49 GMT"/> + + <child> + <widget class="GtkFixed" id="fixed1"> + <property name="visible">True</property> + + <child> + <widget class="GtkFrame" id="frame1"> + <property name="width_request">429</property> + <property name="height_request">228</property> + <property name="visible">True</property> + <property name="label_xalign">0</property> + <property name="label_yalign">0.5</property> + <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property> + + <child> + <widget class="GtkAlignment" id="alignment1"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">1</property> + <property name="yscale">1</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">12</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkFixed" id="fixed2"> + <property name="visible">True</property> + + <child> + <widget class="GtkScrolledWindow" id="scrolledwindow1"> + <property name="width_request">406</property> + <property name="height_request">204</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property> + <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property> + <property name="shadow_type">GTK_SHADOW_NONE</property> + <property name="window_placement">GTK_CORNER_TOP_LEFT</property> + + <child> + <placeholder/> + </child> + </widget> + <packing> + <property name="x">0</property> + <property name="y">0</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + + <child> + <widget class="GtkLabel" id="label1"> + <property name="visible">True</property> + <property name="label" translatable="yes"><b>Shortcuts</b></property> + <property name="use_underline">False</property> + <property name="use_markup">True</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="type">label_item</property> + </packing> + </child> + </widget> + <packing> + <property name="x">3</property> + <property name="y">2</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button3"> + <property name="width_request">90</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_badd_clicked" last_modification_time="Fri, 01 Jan 1988 00:53:58 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment4"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox3"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image3"> + <property name="visible">True</property> + <property name="stock">gtk-add</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label4"> + <property name="visible">True</property> + <property name="label" translatable="yes">Add</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">0</property> + <property name="y">240</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button4"> + <property name="width_request">90</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">False</property> + <signal name="clicked" handler="on_bdelete_clicked" last_modification_time="Fri, 01 Jan 1988 00:27:37 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment5"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox4"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image4"> + <property name="visible">True</property> + <property name="stock">gtk-close</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label5"> + <property name="visible">True</property> + <property name="label" translatable="yes">Delete</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">90</property> + <property name="y">240</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button5"> + <property name="width_request">90</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_bmodify_clicked" last_modification_time="Fri, 01 Jan 1988 02:30:22 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment6"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox5"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image5"> + <property name="visible">True</property> + <property name="stock">gtk-refresh</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label6"> + <property name="visible">True</property> + <property name="label" translatable="yes">Modify</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">181</property> + <property name="y">240</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="button1"> + <property name="width_request">90</property> + <property name="height_request">32</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="relief">GTK_RELIEF_NORMAL</property> + <property name="focus_on_click">True</property> + <signal name="clicked" handler="on_bok_clicked" last_modification_time="Fri, 01 Jan 1988 00:26:12 GMT"/> + + <child> + <widget class="GtkAlignment" id="alignment2"> + <property name="visible">True</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xscale">0</property> + <property name="yscale">0</property> + <property name="top_padding">0</property> + <property name="bottom_padding">0</property> + <property name="left_padding">0</property> + <property name="right_padding">0</property> + + <child> + <widget class="GtkHBox" id="hbox1"> + <property name="visible">True</property> + <property name="homogeneous">False</property> + <property name="spacing">2</property> + + <child> + <widget class="GtkImage" id="image1"> + <property name="visible">True</property> + <property name="stock">gtk-yes</property> + <property name="icon_size">4</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label2"> + <property name="visible">True</property> + <property name="label" translatable="yes">Apply</property> + <property name="use_underline">True</property> + <property name="use_markup">False</property> + <property name="justify">GTK_JUSTIFY_LEFT</property> + <property name="wrap">False</property> + <property name="selectable">False</property> + <property name="xalign">0.5</property> + <property name="yalign">0.5</property> + <property name="xpad">0</property> + <property name="ypad">0</property> + <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property> + <property name="width_chars">-1</property> + <property name="single_line_mode">False</property> + <property name="angle">0</property> + </widget> + <packing> + <property name="padding">0</property> + <property name="expand">False</property> + <property name="fill">False</property> + </packing> + </child> + </widget> + </child> + </widget> + </child> + </widget> + <packing> + <property name="x">342</property> + <property name="y">240</property> + </packing> + </child> + </widget> + </child> +</widget> + +</glade-interface> Added: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/conf/other.pyp =================================================================== --- software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/conf/other.pyp (rev 0) +++ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/conf/other.pyp 2008-01-24 12:06:48 UTC (rev 875) @@ -0,0 +1,150 @@ +class Window(SimpleGladeApp): + + import gobject + import gtk + import threading + + + def __init__(self, + path=_me.get_path('root') + '/Scripts/Python/GUI/conf/other.glade', + root="window1", + domain="params", **kwargs): + SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + + + def set_treeView_values(self): + """ + Set saved values of shortcuts into the TreeView. + """ + self.list_store.clear() + #self.list_store.clear() + liste_shortcuts = _me.get_param('list_of_shortcuts') + applications = [] + words_to_recognize = [] + remote_keys = [] + #getting values from parameters of the gadget. + if len(liste_shortcuts) != 0: + for i in liste_shortcuts: + applications.append(i[1]) + words_to_recognize.append(i[0]) + remote_keys.append(i[2]) + j = 0 + while j != len(applications): + self.list_store.append([applications[j], remote_keys[j], words_to_recognize[j]]) + j += 1 + + + def new(self): + """ + Called function. + """ + self.list_store = gtk.ListStore(str, str, str) + self.get_widget("window1").set_title(_me.string('name_to_read')) + application = _me.string('shortcut_name') + shortcut = _me.string('Recognition_name') + remote = _me.string('remote_key_name') + + #Create TreeView object. + #Create a column for the shortcut name. + self.application_column = gtk.TreeViewColumn(application) + self.application_column.set_min_width(130) + self.application_cell = gtk.CellRendererText() + self.application_cell.set_property( 'editable', False ) + self.application_column.pack_start(self.application_cell, True) + self.application_column.add_attribute(self.application_cell, 'text', 0) + + #Create a column for the launcher name ( voice recognition). + self.shortcut_column = gtk.TreeViewColumn(shortcut) + self.shortcut_column.set_min_width(100) + self.shortcut_cell = gtk.CellRendererText() + self.shortcut_cell.set_property( 'editable', False ) + self.shortcut_column.pack_start(self.shortcut_cell, True) + self.shortcut_column.add_attribute(self.shortcut_cell, 'text', 2) + + #Create a column with the shortcut remote key. + self.remote_column = gtk.TreeViewColumn(remote) + self.remote_column.set_min_width(80) + self.remote_cell = gtk.CellRendererText() + self.remote_cell.set_property( 'editable', False ) + self.remote_column.pack_start(self.remote_cell, True) + self.remote_column.add_attribute(self.remote_cell, 'text', 1) + + #Create the TreeView object with the listStore model. + self.TreeV = gtk.TreeView(self.list_store) + #Add all columns. + self.TreeV.append_column(self.application_column) + self.TreeV.append_column(self.remote_column) + self.TreeV.append_column(self.shortcut_column) + # Insert the viewer in the scrolled panel + self.get_widget("scrolledwindow1").add(self.TreeV) + self.get_widget("scrolledwindow1").show_all() + #Set knowed values into the TreeView. + self.set_treeView_values() + + + def on_window1_destroy(self, widget, *args): + """ + """ + pass + + + + def on_badd_clicked(self, widget, *args): + """ + Event attached to the add button of the widget. + """ + thread.start_new_thread(_me.gui('add').show_from_main, ()) + + + def on_bdelete_clicked(self, widget, *args): + """ + Event attached to the delete button. + """ + selection = self.TreeV.get_selection() + result = selection.get_selected() + model, iter = result + if iter != None: + path = model.get_path(iter) + name_to_remove = model[path][0] + + _me.set_param('model', model) + _me.set_param('name_to_remove', name_to_remove) + _me.set_param('iter', iter) + thread.start_new_thread(_me.gui('delete_confirm').show_from_main, ()) + + + def on_bmodify_clicked(self, widget, *args): + """ + Event attached to the modiy button. + """ + res = self.TreeV.get_selection() + result = res.get_selected() + model, iter = result + if iter != None: + path = model.get_path(iter) + name_to_modify = model[path][0] + #getting actuals if matching with parameters. + values = _me.get_param('list_of_shortcuts') + for i in values: + if i[1] == name_to_modify: + recognition = i[0] + remote_key = i[2] + #Set params to modify. + _me.set_param('application', recognition) + _me.set_param('recognition', name_to_modify) + _me.set_param('remote_key', remote_key) + thread.start_new_thread(_me.gui('modify').show_from_main, ()) + break + + + def on_bok_clicked(self, widget, *args): + """ + Event attached to the ok button. + """ + self.get_widget('window1').destroy() + + def update(self): + """ + Event call when update frame needed. + """ + self.set_treeView_values() Added: software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/delete_confirm/other.glade =================================================================== --- software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/delete_confirm/other.glade (rev 0) +++ software/gadgets/shortcuts_manager/trunk/shortcuts_manager/Scripts/Python/GUI/delete_confirm/other.glade 2008-01-24 12:06:48 UTC (rev 875) @@ -0,0 +1,233 @@ +<?xml version="1.0" standalone="no"?> <!--*- mode: xml -*--> +<!DOCTYPE glade-interface SYSTEM "http://glade.gnome.org/glade-2.0.dtd"> + +<glade-interface> + +<widget class="GtkWindow" id="window1"> + <property name="visible">True</property> + <property name="title" translatable="yes">Widget</property> + <property name="type">GTK_WINDOW_TOPLEVEL</property> + <property name="window_position">GTK_WIN_POS_CENTER</property> + <property name="modal">True</property> + <property name="resizable">False</property> + <property name="destroy_with_parent">False</property> + <property name="decorated">True</property> + <property name="skip_taskbar_hint">False</proper... [truncated message content] |
From: remi <c2m...@c2...> - 2008-01-24 10:54:20
|
Author: remi Date: 2008-01-24 11:54:19 +0100 (Thu, 24 Jan 2008) New Revision: 874 Added: software/tuxosl/ software/tuxosl/branches/ software/tuxosl/tags/ software/tuxosl/trunk/ software/tuxosl/trunk/_TUX_OSL.so software/tuxosl/trunk/service_daemonizer.py software/tuxosl/trunk/tux_osl_api.py software/tuxosl/trunk/tux_osl_const.py software/tuxosl/trunk/tux_osl_daemon.py software/tuxosl/trunk/tux_osl_event_cmd_client.py software/tuxosl/trunk/tux_osl_event_cmd_server.py software/tuxosl/trunk/tux_osl_event_controler.py software/tuxosl/trunk/tux_osl_obj.py software/tuxosl/trunk/tux_osl_service_server.py software/tuxosl/trunk/tux_osl_wrapper.py Log: ADD Added: software/tuxosl/trunk/_TUX_OSL.so =================================================================== (Binary files differ) Property changes on: software/tuxosl/trunk/_TUX_OSL.so ___________________________________________________________________ Name: svn:executable + * Name: svn:mime-type + application/octet-stream Added: software/tuxosl/trunk/service_daemonizer.py =================================================================== --- software/tuxosl/trunk/service_daemonizer.py (rev 0) +++ software/tuxosl/trunk/service_daemonizer.py 2008-01-24 10:54:19 UTC (rev 874) @@ -0,0 +1,123 @@ +import os +import sys +import errno + +class PIDFile(object): + """ + Class to deal with the pidfile. + Their original version come from the sysklogd package, under GPL + Copyright (c) 1995 Martin Schulze <Mar...@Li...> + """ + def __init__(self, name, path = "/var/run"): + self.__PIDFILE = "%s/%s.pid" % (path, name) + + def read(self): + pid = 0 + try: + f = open(self.__PIDFILE, "r") + try: + pid = int(f.readline()) + finally: + f.close() + except: + pass + return pid + + def write(self): + pid = os.getpid() + result = False + try: + f = open(self.__PIDFILE, "w") + try: + f.write("%d\n" % pid) + finally: + f.close() + result = True + except: + print 'can not write file' + return result + + def check(self): + pid = os.getpid() + old_pid = self.read() + if (old_pid == pid) or (old_pid == 0): # pid is different + return False + try: + os.kill(old_pid, 0) + except OSError, why: + if why[0] == errno.ESRCH: + return False + return True + + def remove(self): + try: + os.remove(self.__PIDFILE) + except: + pass + +class ServiceDaemonizer(object): + + def __init__(self, name, log_path, service_funct, redirect_io = True): + log_filename = '%s/%s.log' % (log_path, name) + self.daemonize(redirect_io, '/dev/null', log_filename, log_filename) + self.__pidfile = PIDFile(name, '/tmp') + self.__service_funct = service_funct + + def start(self): + result = True + if not self.__pidfile.check(): + if not self.__pidfile.write(): + result = False + else: + result = False + if result: + self.__service_funct() + return result + + def destroy(self): + pass + #self.__pidfile.remove() + + def daemonize(self, redirect_io, stdin, stdout, stderr): + """ + References: + UNIX Programming FAQ + 1.7 How do I get my program to act like a daemon? + http://www.erlenstar.demon.co.uk/unix/faq_2.html#SEC16 + + Advanced Programming in the Unix Environment + W. Richard Stevens, 1992, Addison-Wesley, ISBN 0-201-56317-7. + """ + # Do first fork. + try: + pid = os.fork() + if pid > 0: + sys.exit(0) # Exit first parent. + except OSError, e: + sys.stderr.write ("fork #1 failed: (%d) %s\n" % (e.errno, e.strerror) ) + sys.exit(1) + + # Decouple from parent environment. + os.chdir("/") + os.umask(0) + os.setsid() + + # Do second fork. + try: + pid = os.fork() + if pid > 0: + sys.exit(0) # Exit second parent. + except OSError, e: + sys.stderr.write ("fork #2 failed: (%d) %s\n" % (e.errno, e.strerror) ) + sys.exit(1) + + # Now I am a daemon! + + # Redirect standard file descriptors. + if redirect_io: + si = file(stdin, 'r') + so = file(stdout, 'w') + se = file(stderr, 'w', 0) + os.dup2(si.fileno(), sys.stdin.fileno()) + os.dup2(so.fileno(), sys.stdout.fileno()) + os.dup2(se.fileno(), sys.stderr.fileno()) Added: software/tuxosl/trunk/tux_osl_api.py =================================================================== --- software/tuxosl/trunk/tux_osl_api.py (rev 0) +++ software/tuxosl/trunk/tux_osl_api.py 2008-01-24 10:54:19 UTC (rev 874) @@ -0,0 +1,254 @@ +#!/usr/bin/python +# -*- coding: latin1 -*- +# ----------------------------------------------------------------------------- +# Tux Droid - OSL - Bin to old API +# Copyright (C) 2007 C2ME Sa <rem...@c2...> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# ----------------------------------------------------------------------------- +# $Id: $ +# ----------------------------------------------------------------------------- +import os +import sys +import threading +import time +from tux_osl_obj import TuxOSLObjDistant, TuxOSLObjDirect +from tux_osl_const import * + +class TuxOSLVClass(object): + + def __getattribute__(self, name): + if name == 'authorized_voices_list': + return self._get_authorized_voices_list() + elif name == 'connected': + return self._get_connected() + return object.__getattribute__(self, name) + + def __setattr__(self, name, value): + if name == 'on_sound_on': + if value != None: + self._sound_on_event.connect(value, threaded = False, idx = 2) + elif name == 'on_sound_off': + if value != None: + self._sound_off_event.connect(value, threaded = True, idx = 2) + elif name == 'on_connected': + if value != None: + self._connected_event.connect(value, threaded = False, idx = 2) + elif name == 'on_disconnected': + if value != None: + self._disconnected_event.connect(value, threaded = False, idx = 2) + elif name == 'on_voice_list': + if value != None: + self._voice_list_event.connect(value, threaded = False, idx = 1) + object.__setattr__(self, name, value) + +class TuxOSLAPI(object): + + def __init__(self, parent = None): + self.__osl_obj = TuxOSLObjDistant() + self.__osl_obj.on_sound_on.connect(self._on_general_sound_on, threaded = False) + self.__osl_obj.on_sound_off.connect(self._on_general_sound_off, threaded = False) + self.__osl_obj.on_connected.connect(self._on_general_connected, threaded = False) + self.__osl_obj.on_disconnected.connect(self._on_general_disconnected, threaded = False) + self.__parent = parent + self.__tts_mutex = threading.Lock() + self.__wav_mutex = threading.Lock() + self.tts = TuxOSLVClass() + self.wav = TuxOSLVClass() + self.__decorate_tts_sub_object() + self.__decorate_wav_sub_object() + + def destroy(self): + self.__osl_obj.destroy() + + def connect(self, host = 'localhost', port = 5510): + self.__osl_obj.connect(host) + + def auto_connect(self, value, host = 'localhost', port = 5510): + self.__osl_obj.auto_connect(value, host) + + def disconnect(self): + self.__osl_obj.disconnect() + + def kill_daemon(self): + self.__osl_obj.kill() + + def _get_version(self): + return self.__osl_obj.get_version() + + def __decorate_tts_sub_object(self): + self.tts.print_status = False + self.tts.on_sound_on = None + self.tts._sound_on_event = self.__osl_obj.on_sound_on + self.tts.on_sound_off = None + self.tts._sound_off_event = self.__osl_obj.on_sound_off + self.tts.on_connected = None + self.tts._connected_event = self.__osl_obj.on_connected + self.tts.on_disconnected = None + self.tts._disconnected_event = self.__osl_obj.on_disconnected + self.tts.on_voice_list = None + self.tts._voice_list_event = self.__osl_obj.tts.on_voice_list_changed + self.tts.sound_on = False + self.tts.connected = False + self.tts.authorized_voices_list = [] + self.tts._get_authorized_voices_list = self._tts_get_authorized_voices_list + self.tts._get_connected = self._get_connected + self.tts._locutor = SPK_US_MALE_NAME + self.tts._pitch = 100 + self.tts.speak = self._tts_speak + self.tts.speak_free = self._tts_speak_free + self.tts.pause = self._tts_pause + self.tts.play = self._tts_play + self.tts.stop = self._tts_stop + self.tts.select_voice = self._tts_select_voice + self.tts.connect = self.connect + self.tts.auto_connect = self.auto_connect + self.tts.disconnect = self.disconnect + self.tts.destroy = self.destroy + self.tts.kill_daemon = self.kill_daemon + self.tts.get_version = self._get_version + + def __decorate_wav_sub_object(self): + self.wav.play = self._wav_play + self.wav.play_free = self._wav_play_free + self.wav.pause = self._wav_pause + self.wav._continue = self._wav__continue + self.wav.stop = self._wav_stop + self.wav.get_duration = self._wav_get_duration + self.wav.destroy = self.empty_funct + + def _on_general_sound_on(self, *args): + self.tts.sound_on = True + if self.__parent != None: + self.__parent.cmd.audio_channel_tts() + + def _on_general_sound_off(self, *args): + self.tts.sound_on = False + if self.__parent != None: + self.__parent.cmd.audio_channel_general() + + def _on_general_connected(self, *args): + print "CONNECTED to tux_osl_daemon" + + def _on_general_disconnected(self, *args): + print "DISCONNECTED from tux_osl_daemon" + + def empty_funct(self): + pass + + def _tts_speak(self, text): + self.__tts_mutex.acquire() + result = True + channel = self.__osl_obj.tts.speak(text, self.tts._locutor, self.tts._pitch) + if channel != -1: + self.__osl_obj.current_tts_channel = channel + else: + result = False + self.__tts_mutex.release() + if result: + if self.__osl_obj.tts.get_sound_state() == 1: + self.__osl_obj.tts.on_speak_stop.wait_condition(()) + return result + + def _tts_speak_free(self, text): + self.__tts_mutex.acquire() + result = True + channel = self.__osl_obj.tts.speak(text, self.tts._locutor, self.tts._pitch) + if channel != -1: + self.__osl_obj.current_tts_channel = channel + else: + result = False + self.__tts_mutex.release() + return result + + def __tts_speak_free(self, text): + t = threading.Thread(target = self.__tts_speak_free, args = (text,)) + t.start() + + def _tts_pause(self): + return self.__osl_obj.tts.set_pause(True) + + def _tts_play(self): + return self.__osl_obj.tts.set_pause(False) + + def _tts_stop(self): + return self.__osl_obj.tts.set_stop() + + def _tts_select_voice(self, locutor, pitch): + self.tts._pitch = pitch + if str(type(locutor)) != "<type 'str'>": + locutor = SPK_NAME_LIST[locutor] + if locutor not in SPK_NAME_LIST: + return False + self.tts._locutor = locutor + return True + + def _tts_get_authorized_voices_list(self): + avl = self.__osl_obj.tts.get_authorized_voices_list() + result = [] + for v in avl: + for i, name in enumerate(SPK_NAME_LIST): + if name == v: + result.append(i - 1) + return result + + def _wav_play(self, wav_path, begin = 0.0, end = 9999999.0): + self.__wav_mutex.acquire() + result = True + channel = self.__osl_obj.wav.play(wav_path, begin, end) + if channel != -1: + self.__osl_obj.current_wav_channel = channel + else: + result = False + self.__wav_mutex.release() + if result: + if self.__osl_obj.wav.get_sound_state(channel) == 1: + self.__osl_obj.wav.on_play_stop.wait_condition(()) + return result + + def _wav_play_free(self, wav_path, begin = 0.0, end = 9999999.0): + self.__wav_mutex.acquire() + result = True + channel = self.__osl_obj.wav.play(wav_path, begin, end) + if channel != -1: + self.__osl_obj.current_wav_channel = channel + else: + result = False + self.__wav_mutex.release() + return result + + def _wav_pause(self): + return self.__osl_obj.wav.set_pause(True) + + def _wav__continue(self): + return self.__osl_obj.wav.set_pause(False) + + def _wav_stop(self): + return self.__osl_obj.wav.set_stop() + + def _wav_get_duration(self, wav_path): + wav_length = 0.0 + if os.path.isfile(wav_path): + try: + size = os.stat(wav_path)[6] - 44 + wav_length = (float)(size) / 8000 + except: + pass + return wav_length + + def _get_connected(self): + return self.__osl_obj.get_connect_state() + Added: software/tuxosl/trunk/tux_osl_const.py =================================================================== --- software/tuxosl/trunk/tux_osl_const.py (rev 0) +++ software/tuxosl/trunk/tux_osl_const.py 2008-01-24 10:54:19 UTC (rev 874) @@ -0,0 +1,83 @@ +#!/usr/bin/python +# -*- coding: latin1 -*- +# ----------------------------------------------------------------------------- +# Tux Droid - OSL - Constants +# Copyright (C) 2007 C2ME Sa <rem...@c2...> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# ----------------------------------------------------------------------------- +# $Id: $ +# ----------------------------------------------------------------------------- +SPK_NO_VOICE = 0x00 +SPK_NO_VOICE_NAME = "None8k" +SPK_FR_MALE = 0x01 +SPK_FR_MALE_NAME = "Bruno8k" +SPK_FR_FEMALE = 0x02 +SPK_FR_FEMALE_NAME = "Julie8k" +SPK_US_MALE = 0x03 +SPK_US_MALE_NAME = "Ryan8k" +SPK_US_FEMALE = 0x04 +SPK_US_FEMALE_NAME = "Heather8k" +SPK_B_FEMALE = 0x05 +SPK_B_FEMALE_NAME = "Sofie8k" +SPK_D_MALE = 0x06 +SPK_D_MALE_NAME = "Klaus8k" +SPK_D_FEMALE = 0x07 +SPK_D_FEMALE_NAME = "Sarah8k" +SPK_GB_MALE = 0x08 +SPK_GB_MALE_NAME = "Graham8k" +SPK_GB_FEMALE = 0x09 +SPK_GB_FEMALE_NAME = "Lucy8k" +SPK_AR_FEMALE = 0x0A +SPK_AR_FEMALE_NAME = "Salma8k" +SPK_DK_FEMALE = 0x0B +SPK_DK_FEMALE_NAME = "Mette8k" +SPK_E_FEMALE = 0x0C +SPK_E_FEMALE_NAME = "Maria8k" +SPK_I_FEMALE = 0x0D +SPK_I_FEMALE_NAME = "Chiara8k" +SPK_NL_FEMALE = 0x0E +SPK_NL_FEMALE_NAME = "Femke8k" +SPK_N_FEMALE = 0x0F +SPK_N_FEMALE_NAME = "Kari8k" +SPK_P_FEMALE = 0x10 +SPK_P_FEMALE_NAME = "Celia8k" +SPK_S_MALE = 0x11 +SPK_S_MALE_NAME = "Erik8k" +SPK_S_FEMALE = 0x12 +SPK_S_FEMALE_NAME = "Emma8k" + +SPK_NAME_LIST = [ + SPK_NO_VOICE_NAME, + SPK_FR_MALE_NAME, + SPK_FR_FEMALE_NAME, + SPK_US_MALE_NAME, + SPK_US_FEMALE_NAME, + SPK_B_FEMALE_NAME, + SPK_D_MALE_NAME, + SPK_D_FEMALE_NAME, + SPK_GB_MALE_NAME, + SPK_GB_FEMALE_NAME, + SPK_AR_FEMALE_NAME, + SPK_DK_FEMALE_NAME, + SPK_E_FEMALE_NAME, + SPK_I_FEMALE_NAME, + SPK_NL_FEMALE_NAME, + SPK_N_FEMALE_NAME, + SPK_P_FEMALE_NAME, + SPK_S_MALE_NAME, + SPK_S_FEMALE_NAME +] Added: software/tuxosl/trunk/tux_osl_daemon.py =================================================================== --- software/tuxosl/trunk/tux_osl_daemon.py (rev 0) +++ software/tuxosl/trunk/tux_osl_daemon.py 2008-01-24 10:54:19 UTC (rev 874) @@ -0,0 +1,38 @@ +#!/usr/bin/python +# -*- coding: latin1 -*- +# ----------------------------------------------------------------------------- +# Tux Droid - OSL - Daemon +# Copyright (C) 2007 C2ME Sa <rem...@c2...> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# ----------------------------------------------------------------------------- +# $Id: $ +# ----------------------------------------------------------------------------- + +import time +from service_daemonizer import ServiceDaemonizer +from tux_osl_service_server import TuxOSLServiceServer + +def start_service(): + osl_ss = TuxOSLServiceServer() + osl_ss.start() + osl_ss.wait_stop() + osl_ss.destroy() + +if __name__ == "__main__": + daemonizer = ServiceDaemonizer("tuxosld", "/tmp", start_service, True) + daemonizer.start() + daemonizer.destroy() Property changes on: software/tuxosl/trunk/tux_osl_daemon.py ___________________________________________________________________ Name: svn:executable + * Added: software/tuxosl/trunk/tux_osl_event_cmd_client.py =================================================================== --- software/tuxosl/trunk/tux_osl_event_cmd_client.py (rev 0) +++ software/tuxosl/trunk/tux_osl_event_cmd_client.py 2008-01-24 10:54:19 UTC (rev 874) @@ -0,0 +1,194 @@ +#!/usr/bin/python +# -*- coding: latin1 -*- +# ----------------------------------------------------------------------------- +# Tux Droid - OSL - XMLRPC client of osl server +# Copyright (C) 2007 C2ME Sa <rem...@c2...> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# ----------------------------------------------------------------------------- +# $Id: $ +# ----------------------------------------------------------------------------- +import xmlrpclib +import time +import sys +import os +import threading + +from tux_osl_const import * +from tux_osl_event_controler import EventsHandler + +EVENT_CLIENT_DEFAULT_PORT = 5510 +CMD_CLIENT_DEFAULT_PORT = 5511 + + +class TuxOSLClientBase(object): + + def __init__(self): + self.__host = 'localhost' + self.__port = '5510' + self.__connected = False + self.__connected_mutex = threading.Lock() + self.__server = None + self.__auto_connect_flag = False + self.__auto_connect_mutex = threading.Lock() + self.__auto_connect_thread = None + self._events_hdl = EventsHandler() + self._events_hdl.insert('all') + self.on_event = self._events_hdl.event['all'] + + def destroy(self): + self.auto_connect(False) + self.disconnect() + self._events_hdl.destroy() + + def server(self): + return self.__server + + def get_connected(self): + self.__connected_mutex.acquire() + result = self.__connected + self.__connected_mutex.release() + return result + + def _set_connected(self, value): + self.__connected_mutex.acquire() + self.__connected = value + self.__connected_mutex.release() + if value: + self.on_event.notify('client', 'connected') + else: + self.on_event.notify('client', 'disconnected') + + def __get_auto_connect_flag(self): + self.__auto_connect_mutex.acquire() + result = self.__auto_connect_flag + self.__auto_connect_mutex.release() + return result + + def __set_auto_connect_flag(self, value): + self.__auto_connect_mutex.acquire() + self.__auto_connect_flag = value + self.__auto_connect_mutex.release() + + def connect(self, host = 'localhost', port = 5510): + if self.get_connected(): + # Error: Already connected + return False + self.__host = host + self.__port = port + proxy = "http://%s:%d" % (self.__host, self.__port) + try: + self.__server = xmlrpclib.Server(proxy) + self.__server.system.listMethods() + except: + # Error: Server not found + return False + self._set_connected(True) + #print 'Connected to [%s] server' % proxy + return True + + def disconnect(self): + if not self.get_connected(): + # Error: Already disconnected + return False + else: + self._events_hdl.clear_conditions() + return True + + def auto_connect(self, active, host = 'localhost', port = 5510): + def ac_async(host, port): + while self.__get_auto_connect_flag(): + if not self.get_connected(): + self.connect(host, port) + time.sleep(1.0) + + if active: # Enabling the auto-connect + # Disabling of the auto-connect + self.auto_connect(False) + # Disconnect the client + if self.get_connected(): + self.disconnect() + # Reconnect + self.__host = host + self.__port = port + self.__set_auto_connect_flag(True) + self.__auto_connect_thread = threading.Thread(target = ac_async, args = (host, port)) + self.__auto_connect_thread.start() + else: # Disabling the auto-connect + if self.__get_auto_connect_flag(): + # Stop the auto-connect loop + self.__set_auto_connect_flag(False) + # Wait + if self.__auto_connect_thread != None: + if self.__auto_connect_thread.isAlive(): + self.__auto_connect_thread.join() + +class TuxOSLEventClient(TuxOSLClientBase): + + def __init__(self, client_name): + TuxOSLClientBase.__init__(self) + self.__client_name = client_name + self.__client_id = -1 + self.__capture_thread = None + + def connect(self, host = 'localhost', port = EVENT_CLIENT_DEFAULT_PORT): + if not TuxOSLClientBase.connect(self, host, port): + return False + self.__client_id = self.server().register_me(self.__client_name) + if self.__client_id == -1: + return False + self.__capture_thread = threading.Thread(target = self.__capture_events) + self.__capture_thread.start() + return True + + def disconnect(self): + if self.get_connected(): + TuxOSLClientBase.disconnect(self) + try: + self.server().unregister_me(self.__client_id) + except: + pass # Server already disconnected + self._set_connected(False) + time.sleep(0.5) + if self.__capture_thread != None: + if self.__capture_thread.isAlive(): + self.__capture_thread._Thread__stop() + + def __capture_events(self): + while self.get_connected(): + try: + events = self.server().get_events(self.__client_id) + except: + self._set_connected(False) + self._events_hdl.clear_conditions() + break + if len(events) > 0: + for event in events: + self.on_event.notify(*event) + else: + time.sleep(0.05) + +class TuxOSLCmdClient(TuxOSLClientBase): + pass + +if __name__ == "__main__": + + def on_event(*args): + print args + + e = TuxOSLEventClient("Test") + e.on_event.connect(on_event) + e.auto_connect(True, 'localhost', EVENT_CLIENT_DEFAULT_PORT) Added: software/tuxosl/trunk/tux_osl_event_cmd_server.py =================================================================== --- software/tuxosl/trunk/tux_osl_event_cmd_server.py (rev 0) +++ software/tuxosl/trunk/tux_osl_event_cmd_server.py 2008-01-24 10:54:19 UTC (rev 874) @@ -0,0 +1,322 @@ +#!/usr/bin/python +# -*- coding: latin1 -*- +# ----------------------------------------------------------------------------- +# Tux Droid - OSL - XMLRPC server of osl object +# Copyright (C) 2007 C2ME Sa <rem...@c2...> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# ----------------------------------------------------------------------------- +# $Id: $ +# ----------------------------------------------------------------------------- +import time +import threading +import copy +import socket +from SimpleXMLRPCServer import SimpleXMLRPCServer, SimpleXMLRPCRequestHandler +from tux_osl_event_controler import EventsHandler + +EVENT_SERVER_DEFAULT_PORT = 5510 +CMD_SERVER_DEFAULT_PORT = 5511 + + +class TuxOSLEventServer(object): + + def __init__(self, port = EVENT_SERVER_DEFAULT_PORT): + self.__clients = [] + self.__client_mutex = threading.Lock() + self.__port = port + self.__server_can_start = True + try: + self.__server = SimpleXMLRPCServer(("localhost", self.__port), LogHandler) + self.__server.register_function(self.register_client, 'register_me') + self.__server.register_function(self.unregister_client, 'unregister_me') + self.__server.register_function(self.get_events, 'get_events') + self.__server.register_introspection_functions() + self.__server.register_multicall_functions() + except socket.error: + print '[TUXOSL] : Event server : Binding error' + self.__server_can_start = False + self.__connected = False + self.__connected_mutex = threading.Lock() + self.__server_thread = None + self.__stop_flag = False + + def destroy(self): + self.stop() + + def set_connected(self, value): + self.__connected_mutex.acquire() + self.__connected = value + self.__connected_mutex.release() + + def get_connected(self): + self.__connected_mutex.acquire() + result = self.__connected + self.__connected_mutex.release() + return result + + def __serve_forever(self): + print '[TUXOSL] : Event server started' + while not self.__stop_flag: + try: + self.__server.handle_request() + except: + pass + + def __start(self): + self.set_connected(True) + try: + self.__server.socket.settimeout(0.5) + self.__serve_forever() + except: + print "[TUXOSL] : Error on start the event server" + self.set_connected(False) + + def start(self): + if not self.__server_can_start: + return False + self.__server_thread = threading.Thread(target = self.__start) + self.__server_thread.start() + return True + + def stop(self): + self.__client_mutex.acquire() + self.__clients = [] + self.__client_mutex.release() + self.__stop_flag = True + if self.__server_thread != None: + if self.__server_thread.isAlive(): + self.__server_thread.join() + print '[TUXOSL] : Event server stopped' + self.__stop_flag = False + self.__server.socket.close() + self.__server.server_close() + + def get_events(self, client_id): + self.__client_mutex.acquire() + if client_id >= len(self.__clients): + self.__client_mutex.release() + return [] + my_client = self.__clients[client_id] + self.__client_mutex.release() + if my_client != None: + result = my_client.get_event_stack().pop(0.5) + else: + result = [] + return result + + def update_events(self, event): + self.__client_mutex.acquire() + for client in self.__clients: + if client != None: + client.get_event_stack().push([event,]) + self.__client_mutex.release() + + def register_client(self, client_name): + self.__client_mutex.acquire() + cli_id = len(self.__clients) + new_client = TuxOSLClientEventObj(client_name, cli_id) + self.__clients.append(new_client) + self.__client_mutex.release() + print '[TUXOSL] : Client (%s:%d) has been added' % (client_name, cli_id) + return cli_id + + def unregister_client(self, client_id): + self.__client_mutex.acquire() + if client_id >= len(self.__clients): + self.__client_mutex.release() + return False + client_name = self.__clients[client_id].get_name() + self.__clients[client_id] = None + self.__client_mutex.release() + print '[TUXOSL] : Client (%s:%d) has been removed' % (client_name, client_id) + return True + +class TuxOSLClientEventObj(object): + + def __init__(self, name, id): + self.__name = name + self.__id = id + self.__event_stack = TuxOSLClientEventStack() + + def get_event_stack(self): + return self.__event_stack + + def get_id(self): + return self.__id + + def get_name(self): + return self.__name + +class TuxOSLClientEventStack(object): + + def __init__(self): + self.__stack = [] + self.__stack_mutex = threading.Lock() + + def push(self, events = []): + if len(events) == 0: + return + self.__stack_mutex.acquire() + for event in events: + self.__stack.append(event) + self.__stack_mutex.release() + + def pop(self, timeout = 1.0): + tb = time.time() + result = [] + while True: + if (time.time() - tb) > timeout: + break + self.__stack_mutex.acquire() + if len(self.__stack) != 0: + result = copy.copy(self.__stack) + self.__stack = [] + self.__stack_mutex.release() + break + self.__stack_mutex.release() + time.sleep(0.005) + return result + +class LogHandler(SimpleXMLRPCRequestHandler): + def send_response(self, code, message=None): + try: + SimpleXMLRPCRequestHandler.send_response(self, code, message=None) + except: + pass + + def send_header(self, keyword, value): + try: + SimpleXMLRPCRequestHandler.send_header(self, keyword, value) + except: + pass + + def end_headers(self): + try: + SimpleXMLRPCRequestHandler.end_headers(self) + except: + pass + + def log_request(self, code='-', size='-'): + pass + + def handle_one_request(self): + try: + SimpleXMLRPCRequestHandler.handle_one_request(self) + except: + pass + + def handle(self): + try: + SimpleXMLRPCRequestHandler.handle(self) + except: + pass + +class TuxOSLCmdServer(object): + + def __init__(self, osl_obj, port = CMD_SERVER_DEFAULT_PORT): + self.__port = port + self.__osl_obj = osl_obj + self.__server_can_start = True + try: + self.__server = SimpleXMLRPCServer(("localhost", self.__port), LogHandler) + self.__server.register_function(self.__osl_obj._tts_speak, '_tts_speak') + self.__server.register_function(self.__osl_obj._tts_set_pause, '_tts_set_pause') + self.__server.register_function(self.__osl_obj._tts_set_stop, '_tts_set_stop') + self.__server.register_function(self.__osl_obj._tts_get_authorized_voices_list, '_tts_get_authorized_voices_list') + self.__server.register_function(self.__osl_obj._tts_get_sound_state, '_tts_get_sound_state') + self.__server.register_function(self.__osl_obj._tts_get_pause_state, '_tts_get_pause_state') + self.__server.register_function(self.__osl_obj._tts_get_pitch, '_tts_get_pitch') + self.__server.register_function(self.__osl_obj.kill, 'kill') + self.__server.register_function(self.__osl_obj._wav_play, '_wav_play') + self.__server.register_function(self.__osl_obj._wav_set_pause, '_wav_set_pause') + self.__server.register_function(self.__osl_obj._wav_set_stop, '_wav_set_stop') + self.__server.register_function(self.__osl_obj._wav_get_sound_state, '_wav_get_sound_state') + self.__server.register_function(self.__osl_obj._wav_get_pause_state, '_wav_get_pause_state') + self.__server.register_function(self.__osl_obj.get_version, 'get_version') + self.__server.register_function(self.__osl_obj.get_connect_state, 'get_connect_state') + self.__server.register_introspection_functions() + self.__server.register_multicall_functions() + except socket.error: + print '[TUXOSL] : Cmd server : Binding error' + self.__server_can_start = False + self.__connected = False + self.__connected_mutex = threading.Lock() + self.__server_thread = None + self.__stop_flag = False + + def destroy(self): + self.stop() + + def set_connected(self, value): + self.__connected_mutex.acquire() + self.__connected = value + self.__connected_mutex.release() + + def get_connected(self): + self.__connected_mutex.acquire() + result = self.__connected + self.__connected_mutex.release() + return result + + def __serve_forever(self): + print '[TUXOSL] : Cmd server started' + while not self.__stop_flag: + try: + self.__server.handle_request() + except: + pass + + def __start(self): + self.set_connected(True) + try: + self.__server.socket.settimeout(0.5) + self.__serve_forever() + except: + print "[TUXOSL] : Error on start the cmd server" + self.set_connected(False) + + def start(self): + if not self.__server_can_start: + return False + self.__server_thread = threading.Thread(target = self.__start) + self.__server_thread.start() + return True + + def stop(self): + if not self.__server_can_start: + return + self.__stop_flag = True + if self.__server_thread != None: + if self.__server_thread.isAlive(): + self.__server_thread.join() + print '[TUXOSL] : Cmd server stopped' + self.__stop_flag = False + self.__server.socket.close() + self.__server.server_close() + + +if __name__ == "__main__": + e = TuxOSLEventServer() + def send_dummy_event(): + time.sleep(0.5) + while e.get_connected(): + e.update_events(('coucou', 'Test', 1)) + time.sleep(1) + t = threading.Thread(target = send_dummy_event) + t.start() + e.start() + Added: software/tuxosl/trunk/tux_osl_event_controler.py =================================================================== --- software/tuxosl/trunk/tux_osl_event_controler.py (rev 0) +++ software/tuxosl/trunk/tux_osl_event_controler.py 2008-01-24 10:54:19 UTC (rev 874) @@ -0,0 +1,344 @@ +#!/usr/bin/python +# -*- coding: latin1 -*- +# ----------------------------------------------------------------------------- +# Tux Droid - OSL - Events handlers +# Copyright (C) 2007 C2ME Sa <rem...@c2...> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# ----------------------------------------------------------------------------- +# $Id: $ +# ----------------------------------------------------------------------------- +import threading +import time +import copy + +class EventsHandler(object): + + def __init__(self): + self.event = {} + + def destroy(self): + for event_hdler in self.event.keys(): + self.event[event_hdler].destroy() + self.event = {} + + def insert(self, event_name): + if event_name not in self.event.keys(): + self.event[event_name] = EventHandler() + return True + else: + return False + + def connect(self, event_name, funct, condition = None, threaded = True, idx = None): + if event_name not in self.event.keys(): + return -1 + return self.event[event_name].connect(funct, condition, threaded, idx) + + def disconnect(self, event_name, idx): + if event_name not in self.event.keys(): + return + self.event[event_name].disconnect(idx) + + def push(self): + for event_hdler in self.event.keys(): + self.event[event_hdler].push() + + def pop(self): + for event_hdler in self.event.keys(): + self.event[event_hdler].pop() + + def clear(self): + for event_hdler in self.event.keys(): + self.event[event_hdler].clear() + + def emit(self, event_name, args): + if event_name not in self.event.keys(): + return + self.event[event_name].emit(*args) + + def notify(self, event_name, args): + if event_name not in self.event.keys(): + return + self.event[event_name].emit(*args) + + def wait_condition(self, event_name, condition, timeout = 999999999.0): + if event_name not in self.event.keys(): + return False, [] + return self.event[event_name].wait_condition(condition, timeout) + + def clear_conditions(self): + for event_hdler in self.event.keys(): + self.event[event_hdler].clear_conditions() + +class EventHandler(object): + + def __init__(self): + self.__funct_struct_list = [] + self.__fifo_list = [] + self.__list_mutex = threading.Lock() + self.__threads_list = [] + self.__lock_list = [] + self.__lock_mutex = threading.Lock() + self.__run_flag = True + self.__run_mutex = threading.Lock() + self.connect(self.__lock_list_process) + + def __get_run_flag(self): + self.__run_mutex.acquire() + result = self.__run_flag + self.__run_mutex.release() + return result + + def __set_run_flag(self, value): + self.__run_mutex.acquire() + self.__run_flag = value + self.__run_mutex.release() + + def destroy(self): + self.clear_conditions() + self.__set_run_flag(False) + for my_thread in self.__threads_list: + if my_thread.isAlive(): + my_thread._Thread__stop() + + def connect(self, funct, condition = None, threaded = True, idx = None): + if idx == None: + result = self.__connect(funct, condition, threaded) + else: + ret = self.__update_connect(idx, funct, condition, threaded) + if not ret: + result = self.__connect(funct, condition, threaded) + else: + result = idx + return result + + def __connect(self, funct, condition = None, threaded = True): + self.__list_mutex.acquire() + idx = len(self.__funct_struct_list) + n_funct = { + 'funct' : funct, + 'condition' : condition, + 'threaded' : threaded + } + self.__funct_struct_list.append(n_funct) + self.__list_mutex.release() + return idx + + def __update_connect(self, idx, funct, condition = None, threaded = True): + self.__list_mutex.acquire() + if idx < len(self.__funct_struct_list): + n_funct = { + 'funct' : funct, + 'condition' : condition, + 'threaded' : threaded + } + self.__funct_struct_list[idx] = n_funct + result = True + else: + result = False + self.__list_mutex.release() + return result + + def push(self): + self.__list_mutex.acquire() + self.__fifo_list.append(self.__funct_struct_list) + self.__list_mutex.release() + self.clear() + + def pop(self): + if len(self.__fifo_list) > 0: + self.__list_mutex.acquire() + self.__funct_struct_list = self.__fifo_list.pop() + self.__list_mutex.release() + + def clear(self): + self.__list_mutex.acquire() + self.__funct_struct_list = [] + self.__list_mutex.release() + + def disconnect(self, idx): + self.__list_mutex.acquire() + if idx < len(self.__funct_struct_list): + self.__funct_struct_list[idx] = None + self.__list_mutex.release() + + def __refresh_threads_list(self): + nl = [] + for t in self.__threads_list: + if t.isAlive(): + nl.append(t) + self.__threads_list = nl + + def __run(self, funct_ptr, idx, fargs): + try: + funct_ptr(*fargs) + except: + self.__list_mutex.acquire() + self.__funct_struct_list[idx] == None + self.__list_mutex.release() + + def emit(self, *fargs): + self.notify(*fargs) + + def notify(self, *fargs): + m_fargs = copy.copy(fargs) + self.__list_mutex.acquire() + if len(self.__funct_struct_list) == 0: + self.__list_mutex.release() + return + try: + funct_struct_list = self.__funct_struct_list + except: + self.__list_mutex.release() + return + self.__list_mutex.release() + for idx, funct_struct in enumerate(funct_struct_list): + if not self.__get_run_flag(): + break + if funct_struct != None: + condition_matched = True + if funct_struct['condition'] != None: # funct entry have a condition + if len(funct_struct['condition']) != len(m_fargs): + condition_matched = False + for i, rule in enumerate(funct_struct['condition']): + if funct_struct['condition'][i] not in [None, m_fargs[i]]: + condition_matched = False + break + if condition_matched: + self.__refresh_threads_list() + if funct_struct['threaded']: + t=threading.Thread(target=self.__run, args=(funct_struct['funct'], idx, m_fargs)) + t.setName('Event_CallBack') + try: + t.start() + self.__threads_list.append(t) + except: + pass + else: + self.__run(funct_struct['funct'], idx, m_fargs) + + def __lock_list_process(self, *args): + self.__lock_mutex.acquire() + new_lock_list = [] + + for my_lock in self.__lock_list: + if my_lock['timeout'] <= (time.time() - my_lock['start_time']): + my_lock['result'].append((None,)) + my_lock['mutex'].acquire() + my_lock['mutex'].notify() + my_lock['mutex'].release() + continue + + rules = my_lock['rules'] + if len(rules) != len(args): + new_lock_list.append(my_lock) + continue + + matched_rule = True + for i, rule in enumerate(rules): + if not rule in [None, args[i]]: + matched_rule = False + break + + if not matched_rule: + new_lock_list.append(my_lock) + continue + else: + my_lock['result'].append(args) + my_lock['mutex'].acquire() + my_lock['mutex'].notify() + my_lock['mutex'].release() + + self.__lock_list = new_lock_list + self.__lock_mutex.release() + + + def wait_condition(self, condition, timeout = 999999999.0): + result = [] + condition_mutex = threading.Condition(threading.Lock()) + new_lock = { + 'rules' : condition, + 'result' : result, + 'mutex' : condition_mutex, + 'start_time' : time.time(), + 'timeout' : timeout + } + self.__lock_mutex.acquire() + self.__lock_list.append(new_lock) + self.__lock_mutex.release() + condition_mutex.acquire() + condition_mutex.wait(timeout) + condition_mutex.release() + if len(result) != 0: + return True, result[0] + else: + return False, [] + + def clear_conditions(self): + for my_lock in self.__lock_list: + my_lock['timeout'] = 0.0 + my_lock['result'].append((None,)) + my_lock['mutex'].acquire() + my_lock['mutex'].notify() + my_lock['mutex'].release() + +if __name__ == "__main__": + import time + import thread + + def on_ten_event(*args): + print '--> Ten event (%d)' % args[0] + + def on_unit_event(*args): + print 'Unit event (%d)' % args[0] + + def dummy_events_loop(events_handler): + for i in range (100): + events_handler.emit('unit_event', (i,)) + if (i % 10) == 0: + events_handler.emit('ten_event', (i,)) + time.sleep(0.1) + + # Create an events handler + my_events_handler = EventsHandler() + + # Add two events + my_events_handler.insert('unit_event') + my_events_handler.insert('ten_event') + + # Connect callback functions + u_idx = my_events_handler.connect('unit_event', on_unit_event, threaded = False) + t_idx = my_events_handler.connect('ten_event', on_ten_event, threaded = False) + + # Start a dummy events loop in a thread + thread.start_new_thread(dummy_events_loop, (my_events_handler,)) + + # Wait a specific event with a timeout of 10 seconds + print 'Wait that unit is equal to 45' + my_events_handler.wait_condition('unit_event', (45,), 10.0) + print 'Wait ok ! The number is equal to 45' + + # Wait a specific event with a timeout of 10 seconds + print 'Wait that the number is equal to 90' + my_events_handler.wait_condition('ten_event', (90,), 10.0) + print 'Wait ok ! The number is equal to 90' + + # Disconnect callback functions + my_events_handler.disconnect('unit_event', u_idx) + my_events_handler.disconnect('ten_event', t_idx) + + # Destroy the handler + my_events_handler.destroy() Added: software/tuxosl/trunk/tux_osl_obj.py =================================================================== --- software/tuxosl/trunk/tux_osl_obj.py (rev 0) +++ software/tuxosl/trunk/tux_osl_obj.py 2008-01-24 10:54:19 UTC (rev 874) @@ -0,0 +1,600 @@ +#!/usr/bin/python +# -*- coding: latin1 -*- +# ----------------------------------------------------------------------------- +# Tux Droid - OSL - OSL Object +# Copyright (C) 2007 C2ME Sa <rem...@c2...> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; either version 2, or (at your option) +# any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +# 02111-1307, USA. +# ----------------------------------------------------------------------------- +# $Id: $ +# ----------------------------------------------------------------------------- +import time +import sys +import threading +import os +from tux_osl_wrapper import TuxOSLWrapper +from tux_osl_const import * +from tux_osl_event_controler import EventsHandler +from tux_osl_event_cmd_client import TuxOSLEventClient, TuxOSLCmdClient + +TUX_OSL_OBJ_VERSION = '0.0.2-alpha' + +class TUXOSLVClass(object): + pass + +class TuxOSLObjAncestor(object): + + def __init__(self): + self.__version = TUX_OSL_OBJ_VERSION + self.__connect_state = False + self.__connect_mutex = threading.Lock() + self.current_wav_channel = 0 + self.current_tts_channel = 0 + self._events_hdl = EventsHandler() + self.__create_event_handlers() + self.on_event = self._events_hdl.event['all'] + self.on_connected = self._events_hdl.event['connected'] + self.on_disconnected = self._events_hdl.event['disconnected'] + self.on_sound_on = self._events_hdl.event['sound_on'] + self.on_sound_off = self._events_hdl.event['sound_off'] + self.on_kill = self._events_hdl.event['kill'] + self.tts = TUXOSLVClass() + self._bind_tts_functions() + self.wav = TUXOSLVClass() + self._bind_wav_functions() + + def destroy(self): + if self.get_connect_state(): + self.auto_connect(False) + self.disconnect() + self._events_hdl.destroy() + + def get_connect_state(self): + self.__connect_mutex.acquire() + result = self.__connect_state + self.__connect_mutex.release() + return result + + def set_connect_state(self, value): + self.__connect_mutex.acquire() + self.__connect_state = value + self.__connect_mutex.release() + + def connect(self, host = 'localhost', ports = [5510, 5511]): + pass + + def disconnect(self): + pass + + def auto_connect(self, value, host = 'localhost', ports = [5510, 5511]): + pass + + def get_version(self): + return self.__version + + def kill(self): + self._events_hdl.event['kill'].notify() + return True + + def update_events(self, *args): + self._events_hdl.event['all'].notify(*args) + if args[0] == 'text_to_speech': + if args[1] == self.current_tts_channel: + if args[2] == 'sound': + if args[3] == 'on': + self._events_hdl.event['tts_speak_start'].notify() + else: + self._events_hdl.event['tts_speak_stop'].notify() + if args[2] == 'pause': + if args[3] == 'on': + self._events_hdl.event['tts_pause_on'].notify() + else: + self._events_hdl.event['tts_pause_off'].notify() + if args[2] == 'voice_list': + self._events_hdl.event['voice_list_changed'].notify() + self._events_hdl.event['voice_list'].notify(args[3]) + if args[2] == 'speak_status': + self._events_hdl.event['speak_status'].notify(args[3]) + elif args[0] == 'wav_player': + if args[1] == self.current_wav_channel: + if args[2] == 'sound': + if args[3] == 'on': + self._events_hdl.event['wav_play_start'].notify() + else: + self._events_hdl.event['wav_play_stop'].notify() + if args[2] == 'pause': + if args[3] == 'on': + self._events_hdl.event['wav_pause_on'].notify() + else: + self._events_hdl.event['wav_pause_off'].notify() + elif args[0] == 'general': + if args[1] == 'sound': + if args[2] == 'on': + self._events_hdl.event['sound_on'].notify() + else: + self._events_hdl.event['sound_off'].notify() + elif args[1] == 'connected': + self._events_hdl.event['connected'].notify() + elif args[1] == 'disconnected': + self._events_hdl.event['disconnected'].notify() + + def __create_event_handlers(self): + self._events_hdl.insert('all') + self._events_hdl.insert('kill') + self._events_hdl.insert('sound_on') + self._events_hdl.insert('sound_off') + self._events_hdl.insert('connected') + self._events_hdl.insert('disconnected') + self._events_hdl.insert('voice_list_changed') + self._events_hdl.insert('voice_list') + self._events_hdl.insert('speak_status') + self._events_hdl.insert('tts_speak_start') + self._events_hdl.insert('tts_speak_stop') + self._events_hdl.insert('tts_pause_on') + self._events_hdl.insert('tts_pause_off') + self._events_hdl.insert('wav_play_start') + self._events_hdl.insert('wav_play_stop') + self._events_hdl.insert('wav_pause_on') + self._events_hdl.insert('wav_pause_off') + + def _bind_tts_functions(self): + self.tts.get_version = self.get_version + self.tts.get_connect_state = self.get_connect_state + self.tts.speak = self._tts_speak + self.tts.set_pause = self._tts_set_pause + self.tts.set_stop = self._tts_set_stop + self.tts.get_authorized_voices_list = self._tts_get_authorized_voices_list + self.tts.get_sound_state = self._tts_get_sound_state + self.tts.get_pause_state = self._tts_get_pause_state + self.tts.get_pitch = self._tts_get_pitch + self.tts._wait_speak_start = self._tts_wait_speak_start + self.tts.on_voice_list = self._events_hdl.event["voice_list"] + self.tts.on_voice_list_changed = self._events_hdl.event["voice_list_changed"] + self.tts.on_speak_start = self._events_hdl.event["tts_speak_start"] + self.tts.on_speak_stop = self._events_hdl.event["tts_speak_stop"] + self.tts.on_pause_on = self._events_hdl.event["tts_pause_on"] + self.tts.on_pause_off = self._events_hdl.event["tts_pause_off"] + self.tts.on_speak_status = self._events_hdl.event["speak_status"] + + def _bind_wav_functions(self): + self.wav.get_version = self.get_version + self.wav.get_connect_state = self.get_connect_state + self.wav.play = self._wav_play + self.wav.set_pause = self._wav_set_pause + self.wav.set_stop = self._wav_set_stop + self.wav.get_sound_state = self._wav_get_sound_state + self.wav.get_pause_state = self._wav_get_pause_state + self.wav._wait_play_start = self._wav_wait_play_start + self.wav.on_play_start = self._events_hdl.event["wav_play_start"] + self.wav.on_play_stop = sel... [truncated message content] |
From: jerome <c2m...@c2...> - 2008-01-24 10:46:50
|
Author: jerome Date: 2008-01-24 11:46:52 +0100 (Thu, 24 Jan 2008) New Revision: 873 Added: software/gadgets/shortcuts_manager/ Log: |
From: Paul_R <c2m...@c2...> - 2008-01-24 10:44:54
|
Author: Paul_R Date: 2008-01-24 11:44:51 +0100 (Thu, 24 Jan 2008) New Revision: 872 Modified: daemon/trunk/libs/USBDaemon_status_table.c Log: * Improved the LEDs status Modified: daemon/trunk/libs/USBDaemon_status_table.c =================================================================== --- daemon/trunk/libs/USBDaemon_status_table.c 2008-01-23 18:20:52 UTC (rev 871) +++ daemon/trunk/libs/USBDaemon_status_table.c 2008-01-24 10:44:51 UTC (rev 872) @@ -286,38 +286,38 @@ tcp_frame[1] = SS_DEFAULT; tcp_frame[2] = DATA_TP_RSP; tcp_frame[3] = SUBDATA_TP_STATUS; - - if ((left_led < 0x20) && (tux_status.led.left.on) - && tux_status.led.mask == false) + if (!(tux_status.led.mask)) { - tux_status.led.left.on = false; - tcp_frame[4] = DATA_STATUS_LED_LEFT_INTENSITY; - tcp_frame[5] = tux_status.led.left.on; - tcp_server_send_raw(tcp_frame); - } - else if (tux_status.led.left.on == false) - { - tux_status.led.left.on = true; - tcp_frame[4] = DATA_STATUS_LED_LEFT_INTENSITY; - tcp_frame[5] = tux_status.led.left.on; - tcp_server_send_raw(tcp_frame); - } + if ((left_led <= 0x20) && (tux_status.led.left.on)) + { + tux_status.led.left.on = false; + tcp_frame[4] = DATA_STATUS_LED_LEFT_INTENSITY; + tcp_frame[5] = tux_status.led.left.on; + tcp_server_send_raw(tcp_frame); + } + else if ((left_led > 0x20) && !(tux_status.led.left.on)) + { + tux_status.led.left.on = true; + tcp_frame[4] = DATA_STATUS_LED_LEFT_INTENSITY; + tcp_frame[5] = tux_status.led.left.on; + tcp_server_send_raw(tcp_frame); + } - if ((right_led < 0x20) && (tux_status.led.right.on) - && tux_status.led.mask == false) - { - tux_status.led.right.on = false; - tcp_frame[4] = DATA_STATUS_LED_RIGHT_INTENSITY; - tcp_frame[5] = tux_status.led.right.on; - tcp_server_send_raw(tcp_frame); + if ((right_led <= 0x20) && (tux_status.led.right.on)) + { + tux_status.led.right.on = false; + tcp_frame[4] = DATA_STATUS_LED_RIGHT_INTENSITY; + tcp_frame[5] = tux_status.led.right.on; + tcp_server_send_raw(tcp_frame); + } + else if ((right_led > 0x20) && !(tux_status.led.right.on)) + { + tux_status.led.right.on = true; + tcp_frame[4] = DATA_STATUS_LED_RIGHT_INTENSITY; + tcp_frame[5] = tux_status.led.right.on; + tcp_server_send_raw(tcp_frame); + } } - else if (tux_status.led.right.on == false) - { - tux_status.led.right.on = true; - tcp_frame[4] = DATA_STATUS_LED_RIGHT_INTENSITY; - tcp_frame[5] = tux_status.led.right.on; - tcp_server_send_raw(tcp_frame); - } } /* TODO Add functions to get the average battery voltage and status */ static void battery_changed(unsigned int const level, |
From: Paul_R <c2m...@c2...> - 2008-01-23 18:21:05
|
Author: Paul_R Date: 2008-01-23 19:20:52 +0100 (Wed, 23 Jan 2008) New Revision: 871 Modified: software/gadgets/tux_controller/trunk/TuxController.tgf software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml Log: * Fix a bug. Modified: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp 2008-01-23 18:17:10 UTC (rev 870) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp 2008-01-23 18:20:52 UTC (rev 871) @@ -357,7 +357,7 @@ tux.cmd.raw(0x3A, 0, 0, 0) def on_btnWingsRun_clicked(self, widget, *args): - if self.__wings_active == False:p + if self.__wings_active == False: self.__wings_active = True thread.start_new_thread(self.refresh_picture, ('imgWingsRun', self.stop)) value = self.get_widget('spinWings').get_value() Modified: software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml 2008-01-23 18:17:10 UTC (rev 870) +++ software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml 2008-01-23 18:20:52 UTC (rev 871) @@ -19,23 +19,23 @@ <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> - <help_text type='str'>-- Gadget Contrôler le robot -- - -Ce gadget permet de contrôler Tux. La fenêtre se compose de deux parties : -La partie de gauche permet de visualiser Tux, ainsi que de lui de faire des mouvements simples. -La partie de droite permet de paramétrer d'une manière plus évoluée des mouvements. Après avoir configurer le nombre de mouvements ainsi que la vitesse, les mouvements sont déclenchés grâce au bouton représenté par un engrenage. Cette partie peut être masquée en décochant la case 'Commande avancée'. - -Ce gadget permet également de paramétrer un texte qui sera dit par Tux. Cette partie se trouve en bas de l'écran, en activant la flèche 'TTS'. Il est également possible de changer de locuteur par le panneau de commandes avancées. - -Enfin, les mouvements peuvent être déclenchés grâce à la télécommande : - -Partie: Mv simple : Mv évolués : -Yeux Fleche haut Rouge -Bec OK Vert -Ailes Fleche bas Bleu -Rotation Gauche / droite Jaune - -Limitations : + <help_text type='str'>-- Gadget Contrôler le robot -- + +Ce gadget permet de contrôler Tux. La fenêtre se compose de deux parties : +La partie de gauche permet de visualiser Tux, ainsi que de lui de faire des mouvements simples. +La partie de droite permet de paramétrer d'une manière plus évoluée des mouvements. Après avoir configurer le nombre de mouvements ainsi que la vitesse, les mouvements sont déclenchés grâce au bouton représenté par un engrenage. Cette partie peut être masquée en décochant la case 'Commande avancée'. + +Ce gadget permet également de paramétrer un texte qui sera dit par Tux. Cette partie se trouve en bas de l'écran, en activant la flèche 'TTS'. Il est également possible de changer de locuteur par le panneau de commandes avancées. + +Enfin, les mouvements peuvent être déclenchés grâce à la télécommande : + +Partie: Mv simple : Mv évolués : +Yeux Fleche haut Rouge +Bec OK Vert +Ailes Fleche bas Bleu +Rotation Gauche / droite Jaune + +Limitations : Pour le moment, les LEDs ne sont pas représentées individuellement sur les images.</help_text> <lblBatteryL type='str'>Niveau des batteries</lblBatteryL> <lblConf type='str'>Divers</lblConf> Modified: software/gadgets/tux_controller/trunk/TuxController.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2008-01-23 18:17:18
|
Author: Paul_R Date: 2008-01-23 19:17:10 +0100 (Wed, 23 Jan 2008) New Revision: 870 Modified: daemon/trunk/libs/USBDaemon_status_table.c daemon/trunk/status.h Log: * Added a new function to control the LEDs status. With the fading functions, the port isn't a good indication. Now, the LEDs are on if the intensity is greater than 0x20. Else, they're off. Modified: daemon/trunk/libs/USBDaemon_status_table.c =================================================================== --- daemon/trunk/libs/USBDaemon_status_table.c 2008-01-23 15:28:39 UTC (rev 869) +++ daemon/trunk/libs/USBDaemon_status_table.c 2008-01-23 18:17:10 UTC (rev 870) @@ -275,6 +275,50 @@ tcp_server_send_raw(tcp_frame); } +static void leds_status_changed(uint8_t left_led, uint8_t right_led) +{ + //XXX find a better way to send the LEDs status + tcp_frame_t tcp_frame; + + tcp_frame_zero(&tcp_frame); + + tcp_frame[0] = SOURCE_TUX; + tcp_frame[1] = SS_DEFAULT; + tcp_frame[2] = DATA_TP_RSP; + tcp_frame[3] = SUBDATA_TP_STATUS; + + if ((left_led < 0x20) && (tux_status.led.left.on) + && tux_status.led.mask == false) + { + tux_status.led.left.on = false; + tcp_frame[4] = DATA_STATUS_LED_LEFT_INTENSITY; + tcp_frame[5] = tux_status.led.left.on; + tcp_server_send_raw(tcp_frame); + } + else if (tux_status.led.left.on == false) + { + tux_status.led.left.on = true; + tcp_frame[4] = DATA_STATUS_LED_LEFT_INTENSITY; + tcp_frame[5] = tux_status.led.left.on; + tcp_server_send_raw(tcp_frame); + } + + if ((right_led < 0x20) && (tux_status.led.right.on) + && tux_status.led.mask == false) + { + tux_status.led.right.on = false; + tcp_frame[4] = DATA_STATUS_LED_RIGHT_INTENSITY; + tcp_frame[5] = tux_status.led.right.on; + tcp_server_send_raw(tcp_frame); + } + else if (tux_status.led.right.on == false) + { + tux_status.led.right.on = true; + tcp_frame[4] = DATA_STATUS_LED_RIGHT_INTENSITY; + tcp_frame[5] = tux_status.led.right.on; + tcp_server_send_raw(tcp_frame); + } +} /* TODO Add functions to get the average battery voltage and status */ static void battery_changed(unsigned int const level, unsigned int const loaded) @@ -716,6 +760,7 @@ case STATUS_LED_CMD: update_leds(&new_status[1]); + leds_status_changed(new_status[1], new_status[2]); break; case PONG_CMD: Modified: daemon/trunk/status.h =================================================================== --- daemon/trunk/status.h 2008-01-23 15:28:39 UTC (rev 869) +++ daemon/trunk/status.h 2008-01-23 18:17:10 UTC (rev 870) @@ -185,6 +185,7 @@ int intensity; /**< Intensity of the led, from 0 (off) to 255 (on). */ bool fading; /**< Set when a fading effect is ongoing. */ bool pulsing; /**< Set when a pulsing effect is ongoing. */ + bool on; } left, right; /**< Indvidual LED status. */ bool mask; /**< When masked, the LEDs are not lit even though the intensity is non zero. The mask is used to turn off |
From: Paul_R <c2m...@c2...> - 2008-01-23 15:28:41
|
Author: Paul_R Date: 2008-01-23 16:28:39 +0100 (Wed, 23 Jan 2008) New Revision: 869 Modified: api/python/trunk/tuxapi_class.py api/python/trunk/tuxapi_const.py Log: * Changed all the LEDs functions to link them with the two new functions (tux.cmd.led_pulse && tux.cmd.led_set) I must create some new functions to use the LEDs effects Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2008-01-23 11:59:48 UTC (rev 868) +++ api/python/trunk/tuxapi_class.py 2008-01-23 15:28:39 UTC (rev 869) @@ -1788,14 +1788,6 @@ tux.cmd.led_pulse : General command to configure the LEDs effects - tux.cmd.ledl_during - tux.cmd.ledl_during_free - tux.cmd.ledl_off - tux.cmd.ledl_on - tux.cmd.ledr_during - tux.cmd.ledr_during_free - tux.cmd.ledr_off - tux.cmd.ledr_on tux.cmd.leds_blink tux.cmd.leds_during tux.cmd.leds_during_free @@ -1803,7 +1795,7 @@ tux.cmd.leds_on Audio commands : - TTS : + Channel selection : tux.cmd.audio_channel_general tux.cmd.audio_channel_tts @@ -2616,219 +2608,9 @@ TUX_CMD_STRUCT_SUB_SEND,address,command,0) #-------------------------------------------------------------------------- - # Send a command to tux for turning the leds on - #-------------------------------------------------------------------------- - def leds_on(self): - """ - Send a command to tux for turning the leds on - - Example: - >>> tux.cmd.leds_on() - """ - self.last_ack=self.structured(TUX_CMD_STRUCT_LEDS, \ - TUX_CMD_STRUCT_SUB_SET,3,255,3) - - #-------------------------------------------------------------------------- - # Send a command to tux for blinking the leds - #-------------------------------------------------------------------------- - def leds_blink(self,count,delay): - """ - Send a command to tux for blinking the leds - - Parameters: - "count" as integer : number of blink(0..255) - "delay" as integer : delay between 2 states (u=4msec) - - Example: - >>> tux.cmd.leds_blink(10,25) - """ - self.last_ack=self.estructured(TUX_CMD_STRUCT_LEDS, - TUX_CMD_STRUCT_SUB_PULSE, 3, 0, 255, - count, delay, 2, 0, 0) - - #-------------------------------------------------------------------------- - # Send a command to tux for turning the leds off - #-------------------------------------------------------------------------- - def leds_off(self): - """ - Send a command to tux for turning the leds off - - Example: - >>> tux.cmd.leds_off() - """ - self.last_ack=self.structured(TUX_CMD_STRUCT_LEDS, \ - TUX_CMD_STRUCT_SUB_SET,3,0,3) - - #-------------------------------------------------------------------------- - # Send a command to tux for turning the leds on during a specified time - #-------------------------------------------------------------------------- - def leds_during(self,seconds): - """ - Send a command to tux for turning the leds on during a specified time - - Parameters: - "seconds" as float : time to wait in seconds - - Example: - >>> tux.cmd.leds_during(2.5) - """ - self.leds_on() - time.sleep(seconds) - self.leds_off() - - #-------------------------------------------------------------------------- - # Send a command to tux for turning the leds on during a specified time - # in free mode - #-------------------------------------------------------------------------- - def leds_during_free(self,seconds): - """ - Send a command to tux for turning the leds on during a specified time - in free mode - - Parameters: - "seconds" as float : time to wait in seconds - - Example: - >>> tux.cmd.leds_during_free(2.5) - """ - t=threading.Thread(target=self.leds_during,args=(seconds,)) - t.setName('cmd.leds_during') - t.start() - self.parent.daemon.free_thread_list.append(t) - - #-------------------------------------------------------------------------- - # Send a command to tux for turning the left led on - #-------------------------------------------------------------------------- - def ledl_on(self): - """ - Send a command to tux for turning the left led on - - Example: - >>> tux.cmd.ledl_on() - """ - self.last_ack=self.structured(TUX_CMD_STRUCT_LEDS, \ - TUX_CMD_STRUCT_SUB_SET, 1, 255, 3) - - #-------------------------------------------------------------------------- - # Send a command to tux for turning the left led off - #-------------------------------------------------------------------------- - def ledl_off(self): - """ - Send a command to tux for turning the left led off - - Example: - >>> tux.cmd.ledl_off() - """ - self.last_ack=self.structured(TUX_CMD_STRUCT_LEDS, \ - TUX_CMD_STRUCT_SUB_SET, 1, 0, 3) - - #-------------------------------------------------------------------------- - # Send a command to tux for turning the left led on during a specified time - #-------------------------------------------------------------------------- - def ledl_during(self,seconds): - """ - Send a command to tux for turning the left led on during a specified - time - - Parameters: - "seconds" as float : time to wait in seconds - - Example: - >>> tux.cmd.ledl_during(2.5) - """ - self.ledl_on() - time.sleep(seconds) - self.ledl_off() - - #-------------------------------------------------------------------------- - # Send a command to tux for turning the left led on during a specified - # time in free mode - #-------------------------------------------------------------------------- - def ledl_during_free(self,seconds): - """ - Send a command to tux for turning the left led on during a specified - time in free mode - - Parameters: - "seconds" as float : time to wait in seconds - - Example: - >>> tux.cmd.ledl_during_free(2.5) - """ - t=threading.Thread(target=self.ledl_during,args=(seconds,)) - t.setName('cmd.ledl_during') - t.start() - self.parent.daemon.free_thread_list.append(t) - - #-------------------------------------------------------------------------- - # Send a command to tux for turning the right led on - #-------------------------------------------------------------------------- - def ledr_on(self): - """ - Send a command to tux for turning the right led on - - Example: - >>> tux.cmd.ledr_on() - """ - self.last_ack=self.structured(TUX_CMD_STRUCT_LEDS, \ - TUX_CMD_STRUCT_SUB_SET,2,255,3) - - #-------------------------------------------------------------------------- - # Send a command to tux for turning the right led off - #-------------------------------------------------------------------------- - def ledr_off(self): - """ - Send a command to tux for turning the right led off - - Example: - >>> tux.cmd.ledr_off() - """ - self.last_ack=self.structured(TUX_CMD_STRUCT_LEDS, \ - TUX_CMD_STRUCT_SUB_SET,2,0,3) - - #-------------------------------------------------------------------------- - # Send a command to tux for turning the right led on during a specified - # time - #-------------------------------------------------------------------------- - def ledr_during(self,seconds): - """ - Send a command to tux for turning the right led on during a specified - time - - Parameters: - "seconds" as float : time to wait in seconds - - Example: - >>> tux.cmd.ledr_during(2.5) - """ - self.ledr_on() - time.sleep(seconds) - self.ledr_off() - - #-------------------------------------------------------------------------- - # Send a command to tux for turning the right led on during a specified - # time in free mode - #-------------------------------------------------------------------------- - def ledr_during_free(self,seconds): - """ - Send a command to tux for turning the right led on during a specified - time in free mode - - Parameters: - "seconds" as float : time to wait in seconds - - Example: - >>> tux.cmd.ledr_during_free(2.5) - """ - t=threading.Thread(target=self.ledr_during,args=(seconds,)) - t.setName('cmd.ledr_during') - t.start() - self.parent.daemon.free_thread_list.append(t) - - #-------------------------------------------------------------------------- # Mapping of the daemon command to set the LEDs. #-------------------------------------------------------------------------- - def led_set(self, leds, intensity, effect_type, effect_speed, effect_step): + def led_set(self, leds=BOTH, intensity=0xFF, effect_type=NONE, effect_speed=0.2,effect_step=2): """ Set the LEDs intensity with an effect. This is the raw function provided by the daemon and is not the easiest to use. See the daemon @@ -2904,8 +2686,9 @@ #-------------------------------------------------------------------------- # Mapping of the daemon command to pulse the LEDs. #-------------------------------------------------------------------------- - def led_pulse(self, leds, min_intensity, max_intensity, pulse_count, - pulse_period, effect_type, effect_speed, effect_step): + def led_pulse(self, leds = BOTH, min_intensity = 0, max_intensity = 255, \ + pulse_count = 1, pulse_period = 0.3, effect_type = NONE, \ + effect_speed = 0.1, effect_step=3): """ Pulses the LEDs with an effect. This is the raw function provided by the daemon and is not the easiest to use. See the daemon API @@ -2997,6 +2780,109 @@ int(effect_speed*64), effect_step) #-------------------------------------------------------------------------- + # Send a command to tux for turning the leds on + #-------------------------------------------------------------------------- + def leds_on(self, intensity = 255, leds = BOTH): + """ + Send a command to tux for turning the leds on + + Parameters : + "intensity" as integer : The intensity of the LED. + 0 .. 255 (0x00 .. 0xFF) + + "leds" as enum : 1 - LEFT + 2 - RIGHT + 3 - BOTH + (default = BOTH) + + Examples: + >>> tux.cmd.leds_on() + >>> tux.cmd.leds_on(intensity = 0x80) + >>> tux.cmd.leds_on(leds = LEFT, intensity = 20) + """ + self.led_set(leds = leds, intensity = intensity) + #-------------------------------------------------------------------------- + # Send a command to tux for turning the leds off + #-------------------------------------------------------------------------- + def leds_off(self, leds = BOTH): + """ + Send a command to tux for turning the leds off + + Parameter : + "leds" as enum : 1 - LEFT + 2 - RIGHT + 3 - BOTH + (default = BOTH) + + Example: + >>> tux.cmd.leds_off() + >>> tux.cmd.leds_off(leds = RIGHT) + """ + self.led_set(leds = leds, intensity = 0, effect_type = NONE) + + #-------------------------------------------------------------------------- + # Send a command to tux for blinking the leds + #-------------------------------------------------------------------------- + def leds_blink(self,counter = 1,delay = 4, leds = BOTH): + """ + Send a command to tux for blinking the leds + + Parameters: + "counter" as integer : number of blink(0..255) + + "delay" as integer : delay between 2 states (u=4msec) + + "leds" as enum : 1 - LEFT + 2 - RIGHT + 3 - BOTH + (default = BOTH) + + Example: + >>> tux.cmd.leds_blink(10,25) + >>> tux.cmd.leds_blink(counter = 10, delay = 40, leds = BOTH) + + """ + self.led_pulse(leds = leds, min_intensity = 0, \ + max_intensity = 255, pulse_count = counter, \ + pulse_period = float(delay * 0.004)) + #-------------------------------------------------------------------------- + # Send a command to tux for turning the leds on during a specified time + #-------------------------------------------------------------------------- + def leds_during(self,seconds): + """ + Send a command to tux for turning the leds on during a specified time + + Parameters: + "seconds" as float : time to wait in seconds + + Example: + >>> tux.cmd.leds_during(2.5) + """ + self.leds_on() + time.sleep(seconds) + self.leds_off() + + #-------------------------------------------------------------------------- + # Send a command to tux for turning the leds on during a specified time + # in free mode + #-------------------------------------------------------------------------- + def leds_during_free(self,seconds): + """ + Send a command to tux for turning the leds on during a specified time + in free mode + + Parameters: + "seconds" as float : time to wait in seconds + + Example: + >>> tux.cmd.leds_during_free(2.5) + """ + t=threading.Thread(target=self.leds_during,args=(seconds,)) + t.setName('cmd.leds_during') + t.start() + self.parent.daemon.free_thread_list.append(t) + + #-------------------------------------------------------------------------- # Send a command to tux for playing a sound from the flash memory #-------------------------------------------------------------------------- def sound_play(self,index,volume=0): @@ -3236,6 +3122,97 @@ see tux.cmd.spin_off """ self.move(movement = SPIN_R, final_state = STOP) + + #-------------------------------------------------------------------------- + # Send a command to tux for turning the left led on + #-------------------------------------------------------------------------- + def ledl_on(self): + """ + Deprecated : + see tux.cmd.leds_on + """ + self.led_set(leds = LEFT, intensity = 255, effect_type = NONE) + #-------------------------------------------------------------------------- + # Send a command to tux for turning the left led off + #-------------------------------------------------------------------------- + def ledl_off(self): + """ + Deprecated : + see tux.cmd.leds_off + """ + self.led_set(leds = LEFT, intensity = 0, effect_type = NONE) + #-------------------------------------------------------------------------- + # Send a command to tux for turning the left led on during a specified time + #-------------------------------------------------------------------------- + def ledl_during(self,seconds): + """ + Deprecated : + see tux.cmd.leds_during + """ + self.ledl_on() + time.sleep(seconds) + self.ledl_off() + + #-------------------------------------------------------------------------- + # Send a command to tux for turning the left led on during a specified + # time in free mode + #-------------------------------------------------------------------------- + def ledl_during_free(self,seconds): + """ + Deprecated : + see tux.cmd.leds_during_free + """ + t=threading.Thread(target=self.ledl_during,args=(seconds,)) + t.setName('cmd.ledl_during') + t.start() + self.parent.daemon.free_thread_list.append(t) + + #-------------------------------------------------------------------------- + # Send a command to tux for turning the right led on + #-------------------------------------------------------------------------- + def ledr_on(self): + """ + Deprecated : + see tux.cmd.leds_on + """ + self.led_set(leds = RIGHT, intensity = 255, effect_type = NONE) + + #-------------------------------------------------------------------------- + # Send a command to tux for turning the right led off + #-------------------------------------------------------------------------- + def ledr_off(self): + """ + Deprecated : + see tux.cmd.leds_off + """ + self.led_set(leds = RIGHT, intensity = 0, effect_type = NONE) + + #-------------------------------------------------------------------------- + # Send a command to tux for turning the right led on during a specified + # time + #-------------------------------------------------------------------------- + def ledr_during(self,seconds): + """ + Deprecated : + see tux.cmd.leds_during + """ + self.ledr_on() + time.sleep(seconds) + self.ledr_off() + + #-------------------------------------------------------------------------- + # Send a command to tux for turning the right led on during a specified + # time in free mode + #-------------------------------------------------------------------------- + def ledr_during_free(self,seconds): + """ + Deprecated : + see tux.cmd.leds_during_free + """ + t=threading.Thread(target=self.ledr_during,args=(seconds,)) + t.setName('cmd.ledr_during') + t.start() + self.parent.daemon.free_thread_list.append(t) #============================================================================== # TUXTCPCommunicator - status - class #============================================================================== Modified: api/python/trunk/tuxapi_const.py =================================================================== --- api/python/trunk/tuxapi_const.py 2008-01-23 11:59:48 UTC (rev 868) +++ api/python/trunk/tuxapi_const.py 2008-01-23 15:28:39 UTC (rev 869) @@ -460,7 +460,7 @@ NONE_BT =0 NULL_BT =0xFF -## tux.cmd.move function constant +## tux.cmd.move function constants EYES = 0 MOUTH = 1 FLIPPERS = 2 @@ -480,6 +480,21 @@ MIDHIGH = 4 HIGH = 5 +## tux.cmd.led* constans +NONE = 0 +LEFT = 1 +RIGHT = 2 +BOTH = 3 + +UNAFFECTED = 0 +LAST = 1 +NONE = 2 +DEFAULT = 3 +FADE_DURATION = 4 +FADE_RATE = 5 +GRADIENT_NBR = 6 +GRADIENT_DELTA = 7 + HEAD_BUTTON_PUSHED =1 HEAD_BUTTON_RELEASED =2 LEFT_WING_PUSHED =3 |
From: Paul_R <c2m...@c2...> - 2008-01-23 11:59:45
|
Author: Paul_R Date: 2008-01-23 12:59:48 +0100 (Wed, 23 Jan 2008) New Revision: 868 Modified: firmware/tuxcore/trunk/motors.c Log: * Minor change on the flippers ISR Modified: firmware/tuxcore/trunk/motors.c =================================================================== --- firmware/tuxcore/trunk/motors.c 2008-01-23 11:52:32 UTC (rev 867) +++ firmware/tuxcore/trunk/motors.c 2008-01-23 11:59:48 UTC (rev 868) @@ -89,6 +89,8 @@ uint8_t flippers_timer; /** Period taken by the previous movement of the flippers. */ uint8_t flippers_revious_timer; + +uint8_t flippers_stop_timeout; /** Number of periods remaining before stopping the rotation. * Normally used when braking, to stop the motor after a short period of * inversion. */ @@ -756,8 +758,7 @@ /* This test prevents the toggle when the flippers are pushed. The * flippers motor must be switched on (flippers_PWM <> 0) to toggle the * position */ - if (flippers_PWM) - gStatus.pos ^= GSTATUS_POS_W0; /* toggle wigs position */ + gStatus.pos ^= GSTATUS_POS_W0; /* toggle wings position */ if (flippers_timer) /* if we need to reposition the flippers */ { |
From: Paul_R <c2m...@c2...> - 2008-01-23 11:52:40
|
Author: Paul_R Date: 2008-01-23 12:52:32 +0100 (Wed, 23 Jan 2008) New Revision: 867 Modified: api/python/trunk/tuxapi_class.py Log: * Created aliases of the tux.cmd.move function : - All existing functions have been linked to the tux.cmd.move function - Replaced all the tux.cmd.wings* function by tux.cmd.flippers*. The 'wings' functions have been deprecated. - For each movement type, I've added an 'on_during' function * Added the documentation for all the movements functions and reorganized the class's documentation Modified: api/python/trunk/tuxapi_class.py =================================================================== --- api/python/trunk/tuxapi_class.py 2008-01-22 08:30:36 UTC (rev 866) +++ api/python/trunk/tuxapi_class.py 2008-01-23 11:52:32 UTC (rev 867) @@ -1745,56 +1745,84 @@ "no_ack" as boolean : Allow to wait a ACK from tuxd Functions list for the users: - tux.cmd.audio_channel_general - tux.cmd.audio_channel_tts - tux.cmd.eyes_close - tux.cmd.eyes_off - tux.cmd.eyes_on - tux.cmd.eyes_on_free - tux.cmd.eyes_open - tux.cmd.ir_off - tux.cmd.ir_on - tux.cmd.ir_send - tux.cmd.ledl_during - tux.cmd.ledl_during_free - tux.cmd.ledl_off - tux.cmd.ledl_on - tux.cmd.ledr_during - tux.cmd.ledr_during_free - tux.cmd.ledr_off - tux.cmd.ledr_on - tux.cmd.leds_blink - tux.cmd.leds_during - tux.cmd.leds_during_free - tux.cmd.leds_off - tux.cmd.leds_on - tux.cmd.mouth_close - tux.cmd.mouth_off - tux.cmd.mouth_on - tux.cmd.mouth_on_free - tux.cmd.mouth_open - tux.cmd.move - tux.cmd.ping - tux.cmd.raw - tux.cmd.sleep_off - tux.cmd.sleep_on - tux.cmd.sound_play - tux.cmd.sound_confirm - tux.cmd.sound_storing - tux.cmd.sound_erase - tux.cmd.sound_test - tux.cmd.spinl_off - tux.cmd.spinl_on - tux.cmd.spinl_on_free - tux.cmd.spinr_off - tux.cmd.spinr_on - tux.cmd.spinr_on_free - tux.cmd.structured - tux.cmd.wings_off - tux.cmd.wings_on - tux.cmd.wings_on_free - tux.cmd.wings_up - tux.cmd.wings_down + + Movements commands : + tux.cmd.move : General command + + Eyes commands : + tux.cmd.eyes_close + tux.cmd.eyes_open + tux.cmd.eyes_off + tux.cmd.eyes_on + tux.cmd.eyes_on_free + tux.cmd.eyes_on_during + + Mouth commands : + tux.cmd.mouth_close + tux.cmd.mouth_open + tux.cmd.mouth_off + tux.cmd.mouth_on + tux.cmd.mouth_on_free + tux.cmd.mouth_on_during + + Flippers commands : + tux.cmd.flippers_up + tux.cmd.flippers_down + tux.cmd.flippers_off + tux.cmd.flippers_on + tux.cmd.flippers_on_free + tux.cmd.flippers_on_during + + Spinning commands : + tux.cmd.spin_speed + tux.cmd.spin_off + tux.cmd.spinl_on + tux.cmd.spinl_on_during + tux.cmd.spinl_on_free + tux.cmd.spinr_on + tux.cmd.spinr_on_during + tux.cmd.spinr_on_free + + LEDs commands : + tux.cmd.led_set : General command to set the LEDs + tux.cmd.led_pulse : General command to configure the + LEDs effects + + tux.cmd.ledl_during + tux.cmd.ledl_during_free + tux.cmd.ledl_off + tux.cmd.ledl_on + tux.cmd.ledr_during + tux.cmd.ledr_during_free + tux.cmd.ledr_off + tux.cmd.ledr_on + tux.cmd.leds_blink + tux.cmd.leds_during + tux.cmd.leds_during_free + tux.cmd.leds_off + tux.cmd.leds_on + + Audio commands : + TTS : + tux.cmd.audio_channel_general + tux.cmd.audio_channel_tts + + Sound flash : + tux.cmd.sound_play + tux.cmd.sound_confirm + tux.cmd.sound_storing + tux.cmd.sound_erase + tux.cmd.sound_test + + Misc : + tux.cmd.ir_off + tux.cmd.ir_on + tux.cmd.ir_send + tux.cmd.ping + tux.cmd.raw + tux.cmd.sleep_off + tux.cmd.sleep_on + tux.cmd.structured """ #-------------------------------------------------------------------------- @@ -2010,24 +2038,52 @@ #-------------------------------------------------------------------------- # Send a command to tux for moving the eyes #-------------------------------------------------------------------------- - def eyes_on(self,count=1): + def eyes_on(self,counter=1, final_state = 0): """ Send a command to tux for moving the eyes Parameters: "count" as integer : Number of movements (default = 1) - + + "final_state" as enum : 0 - UNDEFINED + 1 - OPEN + 2 - CLOSE + (default = 0) Example: >>> tux.cmd.eyes_on() >>> tux.cmd.eyes_on(2) + >>> tux.cmd.eyes_on(counter = 2, final_state = OPEN) """ - self.last_ack=self.structured(TUX_CMD_STRUCT_EYES, \ - TUX_CMD_STRUCT_SUB_ON,count,0,0) + self.move(movement = EYES, counter = counter, final_state = final_state) self.parent.event.wait_status(DATAS_STATUS_EYES_POSITION_COUNTER, \ - 0,(0.3*count)) + 0,(0.3*counter)) #-------------------------------------------------------------------------- + # Send a command to tux for moving the eyes during a defined time + #-------------------------------------------------------------------------- + def eyes_on_during(self, timeout = 0.5, final_state = 0): + ''' + Send a command to tux for moving the eyes during a defined time + + Parameters: + "timeout" as float : The movement duration + + "final_state" as enum : 0 - UNDEFINED + 1 - OPEN + 2 - CLOSE + (default = 0) + + The final state is ignored if timeout is + < 300ms (0.3) + + Examples : + >>> tux.cmd.eyes_on_during(0.5, 1) + or + >>> tux.cmd.eyes_on_during(timeout = 0.5, final_state = OPEN) + ''' + self.move(movement = EYES, timeout = timeout, final_state = final_state) + #-------------------------------------------------------------------------- # Send a command to tux for opening the eyes #-------------------------------------------------------------------------- def eyes_open(self): @@ -2037,9 +2093,7 @@ Example: >>> tux.cmd.eyes_open() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_EYES, \ - TUX_CMD_STRUCT_SUB_OPEN,0,0,0) - + self.move(movement = EYES, final_state = OPEN) #-------------------------------------------------------------------------- # Send a command to tux for closing the eyes #-------------------------------------------------------------------------- @@ -2050,13 +2104,11 @@ Example: >>> tux.cmd.eyes_close() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_EYES, \ - TUX_CMD_STRUCT_SUB_CLOSE,0,0,0) - + self.move(movement = EYES, final_state = CLOSE) #-------------------------------------------------------------------------- # Send a command to tux for moving the eyes in free mode #-------------------------------------------------------------------------- - def eyes_on_free(self,count=1): + def eyes_on_free(self,counter=1, final_state = 0): """ Send a command to tux for moving the eyes in free mode @@ -2064,11 +2116,17 @@ "count" as integer : number of movements (default = 1) + "final_state" as enum : 0 - UNDEFINED + 1 - OPEN + 2 - CLOSE + (default = 0) + Example: >>> tux.cmd.eyes_on_free() >>> tux.cmd.eyes_on_free(2) + >>> tux.cmd.eyes_on_free(counter = 2, final_state = OPEN) """ - t=threading.Thread(target=self.eyes_on,args=(count,)) + t=threading.Thread(target=self.eyes_on,args=(counter,final_state,)) t.setName('cmd.eyes_on') t.start() self.parent.daemon.free_thread_list.append(t) @@ -2079,17 +2137,16 @@ def eyes_off(self): """ Send a command to tux for stopping the eyes movement - + Example: >>> tux.cmd.eyes_off() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_EYES, \ - TUX_CMD_STRUCT_SUB_OFF,0,0,0) + self.move(movement = EYES, final_state = STOP) #-------------------------------------------------------------------------- # Send a command to tux for moving the mouth #-------------------------------------------------------------------------- - def mouth_on(self,count=1): + def mouth_on(self,counter=1, final_state = 0): """ Send a command to tux for moving the mouth @@ -2097,19 +2154,23 @@ "count" as integer : number of movements (default = 1) + "final_state" as enum : 0 - UNDEFINED + 1 - OPEN + 2 - CLOSE + (default = 0) Example: >>> tux.cmd.mouth_on() >>> tux.cmd.mouth_on(2) + >>> tux.cmd.mouth_on(counter = 2, final_state = CLOSE) """ - self.last_ack=self.structured(TUX_CMD_STRUCT_MOUTH, \ - TUX_CMD_STRUCT_SUB_ON,count,0,0) + self.move(movement = MOUTH, counter = counter, final_state = final_state) self.parent.event.wait_status(DATAS_STATUS_MOUTH_POSITION_COUNTER, \ - 0,(0.3*count)) + 0,(0.3*counter)) #-------------------------------------------------------------------------- # Send a command to tux for moving the mouth in free mode #-------------------------------------------------------------------------- - def mouth_on_free(self,count=1): + def mouth_on_free(self,counter=1, final_state = 0): """ Send a command to tux for moving the mouth in free mode @@ -2117,16 +2178,45 @@ "count" as integer : number of movements (default = 1) + "final_state" as enum : 0 - UNDEFINED + 1 - OPEN + 2 - CLOSE + (default = 0) Example: >>> tux.cmd.mouth_on_free() >>> tux.cmd.mouth_on_free(2) + >>> tux.cmd.mouth_on_free(counter = 2, final_state = CLOSE) """ - t=threading.Thread(target=self.mouth_on,args=(count,)) + t=threading.Thread(target=self.mouth_on,args=(counter,final_state,)) t.setName('cmd.mouth_on') t.start() self.parent.daemon.free_thread_list.append(t) #-------------------------------------------------------------------------- + # Send a command to tux for moving the mouth during a defined time + #-------------------------------------------------------------------------- + def mouth_on_during(self, timeout = 0.5, final_state = 0): + ''' + Send a command to tux for moving the mouth during a defined time + + Parameters: + "timeout" as float : The movement duration + "final_state" as enum : 0 - UNDEFINED + 1 - OPEN + 2 - CLOSE + (default = 0) + + The final state is ignored if timeout is + < 300ms (0.3) + + Examples : + >>> tux.cmd.mouth_on_during(0.5, 1) + or + >>> tux.cmd.mouth_on_during(timeout = 0.5, final_state = OPEN) + ''' + self.move(movement = MOUTH, timeout = timeout, final_state = final_state) + + #-------------------------------------------------------------------------- # Send a command to tux for opening the mouth #-------------------------------------------------------------------------- def mouth_open(self): @@ -2136,8 +2226,7 @@ Example: >>> tux.cmd.mouth_open() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_MOUTH, \ - TUX_CMD_STRUCT_SUB_OPEN,0,0,0) + self.move(movement = MOUTH, final_state = OPEN) #-------------------------------------------------------------------------- # Send a command to tux for closing the mouth #-------------------------------------------------------------------------- @@ -2148,8 +2237,7 @@ Example: >>> tux.cmd.mouth_close() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_MOUTH, \ - TUX_CMD_STRUCT_SUB_CLOSE,0,0,0) + self.move(movement = MOUTH, final_state = CLOSE) #-------------------------------------------------------------------------- # Send a command to tux for stopping the mouth movement #-------------------------------------------------------------------------- @@ -2160,15 +2248,13 @@ Example: >>> tux.cmd.mouth_off() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_MOUTH, \ - TUX_CMD_STRUCT_SUB_OFF,0,0,0) - + self.move(movement = MOUTH, final_state = STOP) #-------------------------------------------------------------------------- - # Send a command to tux for moving the wings + # Send a command to tux for moving the flippers #-------------------------------------------------------------------------- - def wings_on(self,count=1,speed=5): + def flippers_on(self,counter=1,speed=5, final_state = 0): """ - Send a command to tux for moving the wings + Send a command to tux for moving the flippers Parameters: "count" as integer : number of movements @@ -2176,82 +2262,179 @@ "speed" as integer : speed of the movement(1-5) (default = 5) + "final_state" as enum : 0 - UNDEFINED + 1 - UP + 2 - DOWN + (default = 0) Example: - >>> tux.cmd.wings_on() - >>> tux.cmd.wings_on(2) (2 movements) - >>> tux.cmd.wings_on(2,5) (2 movements and speed=5) + >>> tux.cmd.flippers_on() + >>> tux.cmd.flippers_on(2) (2 movements) + >>> tux.cmd.flippers_on(2,5) (2 movements and speed=5) + >>> tux.cmd.flippers_on(2,5,1) + >>> tux.cmd.flippers_on(counter = 2, speed = HIGH, final_state = UP) """ - self.last_ack=self.structured(TUX_CMD_STRUCT_WINGS, \ - TUX_CMD_STRUCT_SUB_ON,count,speed,0) + self.move(movement = FLIPPERS, counter = counter, speed = speed,\ + final_state = final_state) self.parent.event.wait_status(DATAS_STATUS_WINGS_POSITION_COUNTER, \ - 0,(0.6*count)) + 0,(0.6*counter)) #-------------------------------------------------------------------------- - # Send a command to tux for moving the wings in free mode + # Send a command to tux for moving the flippers in free mode #-------------------------------------------------------------------------- - def wings_on_free(self,count=1,speed=5): + def flippers_on_free(self,counter=1,speed=5, final_state = 0): """ - Send a command to tux for moving the wings in free mode + Send a command to tux for moving the flippers in free mode Parameters: "count" as integer : number of movements (default = 1) - "speed" as integer : speed of the movement(1..5) + "speed" as integer : speed of the movement(1-5) (default = 5) + "final_state" as enum : 0 - UNDEFINED + 1 - UP + 2 - DOWN + (default = 0) Example: - >>> tux.cmd.wings_on_free() - >>> tux.cmd.wings_on_free(2) (2 movements) - >>> tux.cmd.wings_on_free(2,5) (2 movements and speed=5) + >>> tux.cmd.flippers_on_free() + >>> tux.cmd.flippers_on_free(2) (2 movements) + >>> tux.cmd.flippers_on_free(2,5) (2 movements and speed=5) + >>> tux.cmd.flippers_on_free2,5,1) + >>> tux.cmd.flippers_on_free(counter = 2, speed = HIGH, final_state = UP) """ - t=threading.Thread(target=self.wings_on,args=(count,speed,)) - t.setName('cmd.wings_on') + t=threading.Thread(target=self.flippers_on,args=(counter,speed,final_state,)) + t.setName('cmd.flippers_on') t.start() self.parent.daemon.free_thread_list.append(t) #-------------------------------------------------------------------------- - # Send a command to tux for stopping the wings movement + # Send a command to tux for moving the flippers during a defined time #-------------------------------------------------------------------------- - def wings_off(self): + def flippers_on_during(self, timeout = 0.5, final_state = 0, speed = 5): + ''' + Send a command to tux for moving the flippers during a defined time + + Parameters: + "timeout" as float : The movement duration + "final_state" as enum : 0 - UNDEFINED + 1 - UP + 2 - DOWN + (default = 0) + + The final state is ignored if timeout is + < 300ms (0.3) + + "speed" as enum : speed of the movement + 1 - VERYLOW + 2 - LOW + 3 - MEDIUM + 4 - MIDHIGH + 5 - HIGH + (default = 5) + + Examples : + >>> tux.cmd.flippers_on_during(0.5, 1, 5) + or + >>> tux.cmd.flippers_on_during(timeout = 0.5, final_state = OPEN, speed = HIGH) + ''' + self.move(movement = FLIPPERS, timeout = timeout, \ + final_state = final_state, \ + speed = speed) + + #-------------------------------------------------------------------------- + # Send a command to tux to change the speed of the flippers + #-------------------------------------------------------------------------- + def flippers_speed(self, speed): + ''' + Send a command to tux to change the flippers speed + + Parameters: + "speed" as enum : speed of the movement + 1 - VERYLOW + 2 - LOW + 3 - MEDIUM + 4 - MIDHIGH + 5 - HIGH + + Examples : + >>> tux.cmd.flippers_speed(5) + or + >>> tux.cmd.flippers_speed(speed = HIGH) + ''' + self.move(movement = FLIPPERS, speed = speed, refresh = True) + #-------------------------------------------------------------------------- + # Send a command to tux for stopping the flippers movement + #-------------------------------------------------------------------------- + def flippers_off(self): """ - Send a command to tux for stopping the wings movement + Send a command to tux for stopping the flippers movement Example: - >>> tux.cmd.wings_off() + >>> tux.cmd.flippers_off() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_WINGS, \ - TUX_CMD_STRUCT_SUB_OFF,0,0,0) - + self.move(movement = FLIPPERS, final_state = STOP) #-------------------------------------------------------------------------- - # Send a command to tux for raise the wings + # Send a command to tux for raise the flippers #-------------------------------------------------------------------------- - def wings_up(self): + def flippers_up(self): """ - Send a command to tux for raise the wings + Send a command to tux for raise the flippers Example: - >>> tux.cmd.wings_up() + >>> tux.cmd.flippers_up() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_WINGS, \ - TUX_CMD_STRUCT_SUB_UP,0,0,0) + self.move(movement = FLIPPERS, final_state = UP) #-------------------------------------------------------------------------- - # Send a command to tux for raise the wings + # Send a command to tux for lower the flippers #-------------------------------------------------------------------------- - def wings_down(self): + def flippers_down(self): """ - Send a command to tux for lower the wings + Send a command to tux for lower the flippers Example: - >>> tux.cmd.wings_down() + >>> tux.cmd.flippers_down() """ - self.last_ack=self.structured(TUX_CMD_STRUCT_WINGS, \ - TUX_CMD_STRUCT_SUB_DOWN,0,0,0) + self.move(movement = FLIPPERS, final_state = DOWN) #-------------------------------------------------------------------------- + # Send a command to tux to spin to the right during a defined time + #-------------------------------------------------------------------------- + def spin_speed(self, speed): + ''' + Send a command to tux to change the spinning speed + + Parameters: + "speed" as enum : speed of the movement + 1 - VERYLOW + 2 - LOW + 3 - MEDIUM + 4 - MIDHIGH + 5 - HIGH + + Examples : + >>> tux.cmd.spin_speed(5) + or + >>> tux.cmd.spin_speed(speed = HIGH) + ''' + self.move(movement = SPIN_R, speed = speed, refresh = True) + + + #-------------------------------------------------------------------------- + # Send a command to tux to stop the spinning + #-------------------------------------------------------------------------- + def spin_off(self): + ''' + Send a command to tux to stop the spinning + + Example : + >>> tux.cmd.spin_off() + ''' + self.move(movement = SPIN_R, final_state = STOP) + #-------------------------------------------------------------------------- # Send a command to tux to spin to the left #-------------------------------------------------------------------------- - def spinl_on(self,count=4,speed=5): + def spinl_on(self,counter=4,speed=5): """ Send a command to tux to spin to the left @@ -2266,15 +2449,14 @@ >>> tux.cmd.spinl_on(2) (count = 2) >>> tux.cmd.spinl_on(2,5) (count = 2 and speed = 5) """ - self.last_ack=self.structured(TUX_CMD_STRUCT_SPINL, \ - TUX_CMD_STRUCT_SUB_ON,count,speed,0) + self.move(movement = SPIN_L, counter = counter, speed = speed) self.parent.event.wait_status(DATAS_STATUS_SPIN_POSITION_COUNTER, \ - 0,(0.5*count)) + 0,(0.5*counter)) #-------------------------------------------------------------------------- # Send a command to tux to spin to the left in free mode #-------------------------------------------------------------------------- - def spinl_on_free(self,count=4,speed=5): + def spinl_on_free(self,counter=4,speed=5): """ Send a command to tux to spin to the left in free mode @@ -2289,28 +2471,41 @@ >>> tux.cmd.spinl_on_free(2) (count = 2) >>> tux.cmd.spinl_on_free(2,5) (count = 2 and speed = 5) """ - t=threading.Thread(target=self.spinl_on,args=(count,speed,)) + t=threading.Thread(target=self.spinl_on,args=(counter,speed,)) t.setName('cmd.spinl_on') t.start() self.parent.daemon.free_thread_list.append(t) #-------------------------------------------------------------------------- - # Send a command to tux for stopping the spinning movement + # Send a command to tux to spin to the left during a defined time #-------------------------------------------------------------------------- - def spinl_off(self): - """ - Send a command to tux for stopping the spinning movement + def spinl_on_during(self, timeout = 0.5, speed = 5): + ''' + Send a command to tux to spin left during a defined time - Example: - >>> tux.cmd.spinl_off() - """ - self.last_ack=self.structured(TUX_CMD_STRUCT_SPINL, \ - TUX_CMD_STRUCT_SUB_OFF,0,0,0) + Parameters: + "timeout" as float : The movement duration + + "speed" as enum : speed of the movement + 1 - VERYLOW + 2 - LOW + 3 - MEDIUM + 4 - MIDHIGH + 5 - HIGH + (default = 5) + Examples : + >>> tux.cmd.spinl_on_during(0.5, 5) + or + >>> tux.cmd.spinl_on_during(timeout = 0.5, speed = HIGH) + ''' + self.move(movement = SPIN_L, timeout = timeout, speed = speed) + + #-------------------------------------------------------------------------- # Send a command to tux to spin to the right #-------------------------------------------------------------------------- - def spinr_on(self,count=4,speed=5): + def spinr_on(self,counter=4,speed=5): """ Send a command to tux to spin to the right @@ -2325,15 +2520,14 @@ >>> tux.cmd.spinr_on(2) (count = 2) >>> tux.cmd.spinr_on(2,5) (count = 2 and speed = 5) """ - self.last_ack=self.structured(TUX_CMD_STRUCT_SPINR, \ - TUX_CMD_STRUCT_SUB_ON,count,speed,0) + self.move(movement = SPIN_R, counter = counter, speed = speed) self.parent.event.wait_status(DATAS_STATUS_SPIN_POSITION_COUNTER,0, \ - (0.5*count)) + (0.5*counter)) #-------------------------------------------------------------------------- # Send a command to tux to spin to the right in free mode #-------------------------------------------------------------------------- - def spinr_on_free(self,count=4,speed=5): + def spinr_on_free(self,counter=4,speed=5): """ Send a command to tux to spin to the right in free mode @@ -2348,24 +2542,37 @@ >>> tux.cmd.spinr_on_free(2) (count = 2) >>> tux.cmd.spinr_on_free(2,5) (count = 2 and speed = 5) """ - t=threading.Thread(target=self.spinr_on,args=(count,speed,)) + t=threading.Thread(target=self.spinr_on,args=(counter,speed,)) t.setName('cmd.spinr_on') t.start() self.parent.daemon.free_thread_list.append(t) #-------------------------------------------------------------------------- - # Send a command to tux for stopping the spinning movement + # Send a command to tux to spin to the right during a defined time #-------------------------------------------------------------------------- - def spinr_off(self): - """ - Send a command to tux for stopping the spinning movement + def spinr_on_during(self, timeout = 0.5, speed = 5): + ''' + Send a command to tux to spin right during a defined time - Example: - >>> tux.cmd.spinr_off() - """ - self.last_ack=self.structured(TUX_CMD_STRUCT_SPINR, \ - TUX_CMD_STRUCT_SUB_OFF,0,0,0) + Parameters: + "timeout" as float : The movement duration + + "speed" as enum : speed of the movement + 1 - VERYLOW + 2 - LOW + 3 - MEDIUM + 4 - MIDHIGH + 5 - HIGH + (dafault = 5) + Examples : + >>> tux.cmd.spinr_on_during(0.5, 5) + or + >>> tux.cmd.spinr_on_during(timeout = 0.5, speed = HIGH) + ''' + self.move(movement = SPIN_R, timeout = timeout, speed = speed) + + #-------------------------------------------------------------------------- # Send a command to tux for turning the IR on #-------------------------------------------------------------------------- @@ -2949,6 +3156,86 @@ TUX_CMD_STRUCT_SUB_CH_TTS,0,0,0) self.no_ack=False +#-------------------------------------------------------------------------- +# Deprecated functions +#-------------------------------------------------------------------------- + + #-------------------------------------------------------------------------- + # Send a command to tux for moving the wings + #-------------------------------------------------------------------------- + def wings_on(self,counter=1,speed=5): + """ + Deprecated : + see tux.cmd.flippers_on + """ + self.move(movement = FLIPPERS, counter = counter, speed = speed) + self.parent.event.wait_status(DATAS_STATUS_WINGS_POSITION_COUNTER, \ + 0,(0.6*counter)) + + #-------------------------------------------------------------------------- + # Send a command to tux for moving the wings in free mode + #-------------------------------------------------------------------------- + def wings_on_free(self,counter=1,speed=5): + """ + Deprecated : + see tux.cmd.flippers_on_free + """ + t=threading.Thread(target=self.wings_on,args=(counter,speed,)) + t.setName('cmd.wings_on') + t.start() + self.parent.daemon.free_thread_list.append(t) + + #-------------------------------------------------------------------------- + # Send a command to tux for stopping the wings movement + #-------------------------------------------------------------------------- + def wings_off(self): + """ + Deprecated : + see tux.cmd.flippers_off + """ + self.move(movement = FLIPPERS, final_state = STOP) + #-------------------------------------------------------------------------- + # Send a command to tux for raise the wings + #-------------------------------------------------------------------------- + def wings_up(self): + """ + Deprecated : + see tux.cmd.flippers_up + """ + self.move(movement = FLIPPERS, final_state = UP) + #self.last_ack=self.structured(TUX_CMD_STRUCT_WINGS, \ + # TUX_CMD_STRUCT_SUB_UP,0,0,0) + + #-------------------------------------------------------------------------- + # Send a command to tux for lower the wings + #-------------------------------------------------------------------------- + def wings_down(self): + """ + Deprecated : + see tux.cmd.flippers_down + """ + self.move(movement = FLIPPERS, final_state = DOWN) + + + #-------------------------------------------------------------------------- + # Send a command to tux for stopping the spinning movement + #-------------------------------------------------------------------------- + def spinl_off(self): + """ + Deprecated : + see tux.cmd.spin_off + """ + self.move(movement = SPIN_L, final_state = STOP) + + #-------------------------------------------------------------------------- + # Send a command to tux for stopping the spinning movement + #-------------------------------------------------------------------------- + def spinr_off(self): + """ + Deprecated : + see tux.cmd.spin_off + """ + self.move(movement = SPIN_R, final_state = STOP) #============================================================================== # TUXTCPCommunicator - status - class #============================================================================== |
Author: Paul_R Date: 2008-01-22 09:30:36 +0100 (Tue, 22 Jan 2008) New Revision: 866 Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml software/gadgets/flash_management/trunk/flash_management.tgf software/gadgets/flash_management/trunk/flash_management/Strings/fr_ALL.xml software/gadgets/flash_management/trunk/flash_management/settings.xml software/gadgets/light_monitor/trunk/Light_monitor.tgf software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml software/gadgets/micro_monitor/trunk/micro_monitor.tgf software/gadgets/micro_monitor/trunk/micro_monitor/Strings/fr_ALL.xml software/gadgets/tux_controller/trunk/TuxController.tgf software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml Log: * Reviewed the french help files (orthography, grammar) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor.tgf =================================================================== (Binary files differ) Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2008-01-21 15:45:31 UTC (rev 865) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/Strings/fr_ALL.xml 2008-01-22 08:30:36 UTC (rev 866) @@ -1,18 +1,60 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> + <Both type='str'>Le niveau de la batterie a passé le seuil</Both> + <Change type='str'>Le niveau de la batterie a changé</Change> + <ChangeD type='str'>Le niveau de la batterie a chuté puis augmenté</ChangeD> + <ChangeU type='str'>Le niveau de la batterie a augmenté puis chuté</ChangeU> + <Decrease type='str'>Le niveau de la batterie est passé en dessous du seuil</Decrease> + <Drop type='str'>Le niveau de la batterie a chuté</Drop> + <Increase type='str'>Le niveau de la batterie est passé en dessus du seuil</Increase> + <MainBehavior type='str'>Comportement principal</MainBehavior> + <Raise type='str'>Le niveau de la batterie a augmenté</Raise> + <absolute_threshold type='str'>Batteries faibles</absolute_threshold> + <absolute_threshold_high type='str'>Batteries pleines</absolute_threshold_high> + <battery type='str'>Sur batteries</battery> + <charge type='str'>et les batteries sont en train d'être rechargée</charge> + <charging type='str'>En charge</charging> + <conf_btnAdd type='str'>Ajouter</conf_btnAdd> + <conf_btnBehavior type='str'>Supprimer</conf_btnBehavior> + <conf_btnModify type='str'>Modifier</conf_btnModify> + <conf_btnRemove type='str'>Enlever</conf_btnRemove> + <conf_lblBehavior type='str'>Comportement</conf_lblBehavior> + <conf_lblBoth type='str'>Deux directions</conf_lblBoth> + <conf_lblChange type='str'>Changement</conf_lblChange> + <conf_lblChangeD type='str'>Chute et augmente</conf_lblChangeD> + <conf_lblChangeU type='str'>Augmente et chute</conf_lblChangeU> + <conf_lblControl type='str'>Contrôle</conf_lblControl> + <conf_lblDecrease type='str'>Diminue</conf_lblDecrease> + <conf_lblDefaultBehavior type='str'>Comportement pas défaut</conf_lblDefaultBehavior> + <conf_lblDrop type='str'>Chute</conf_lblDrop> + <conf_lblEvent type='str'>Evènement</conf_lblEvent> <conf_lblIncrease type='str'>Augmente</conf_lblIncrease> + <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> + <conf_lblNotified type='str'>Notifié ?</conf_lblNotified> + <conf_lblNotifiedBehavior type='str'>Notifié</conf_lblNotifiedBehavior> + <conf_lblRaise type='str'>Accroissement</conf_lblRaise> + <conf_lblRate type='str'>Rafraichissement</conf_lblRate> + <conf_lblSample type='str'>Points</conf_lblSample> <conf_lblThreshold type='str'>Seuil</conf_lblThreshold> + <conf_lblTime type='str'>Temps (sec.)</conf_lblTime> + <conf_lblType type='str'>Type</conf_lblType> + <conf_lblValue type='str'>Valeur (V)</conf_lblValue> + <end_of_charge type='str'>La charge de la batterie est terminée</end_of_charge> + <full type='str'>Les batteries sont pleines</full> + <gui_conf_about_title type='str'>A propos</gui_conf_about_title> + <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> + <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> + <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> + <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> + <gui_conf_delay_lb type='str'>Délai (sec)</gui_conf_delay_lb> + <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> + <gui_conf_rate_lb type='str'>Rafraichissement :</gui_conf_rate_lb> + <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> <gui_conf_remote_title type='str'>Contrôle</gui_conf_remote_title> - <battery type='str'>Sur batteries</battery> - <conf_lblRaise type='str'>Accroissement</conf_lblRaise> - <widget_lblTest type='str'>Notifications</widget_lblTest> - <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> - <conf_lblEvent type='str'>Evènement</conf_lblEvent> - <widget_lblControl type='str'>Contrôle</widget_lblControl> - <Increase type='str'>Le niveau de la batterie est passé en dessus du seuil</Increase> - <full type='str'>Les batteries sont pleines</full> - <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> - <lblLowThreshold type='str'>Limite inférieure</lblLowThreshold> + <gui_conf_sample_lb type='str'>Nombre de points :</gui_conf_sample_lb> + <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> + <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> + <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> <help_text type='str'>-- Les évènements : Deux grands types d'évènements peuvent avoir lieu, contenant chacun diverses options : @@ -35,11 +77,11 @@ -- Les fenêtres : - La fenêtre de configuration : -Cette fenêtre reprend toutes les options de configuration du gadget, notamment le taux de rafraichissement ainsi que le nombre de points affichés sur le graphique peut être configuré. +Cette fenêtre reprend toutes les options de configuration du gadget, notamment le taux de rafraîchissement ainsi que le nombre de points affichés sur le graphique. Des évènements, pouvant entraîner une notification, peuvent également être enregistrés. Si aucun script externe n'est spécifié, un comportement de base se déclenchera. -Les évènements peuvent à tout moment être modifiés ou supprimés, par simple sélection de la ligne dans le tableau. +Les évènements peuvent à tous moment être modifiés ou supprimés, par simple sélection de la ligne dans le tableau. Une option permet de rejeter les mesures lorsque les moteurs fonctionnent. @@ -47,75 +89,33 @@ Cette fenêtre affiche le graphique de la batterie. Lorsque cette fenêtre est affichée, les évènements enregistrés dans la fenêtre de configuration ne sont plus notifiés. Cette fenêtre permet de tester diverses configurations et de les ajouter dans le tableau de configuration.</help_text> - <end_of_charge type='str'>La charge de la batterie est terminée</end_of_charge> - <conf_lblChange type='str'>Changement</conf_lblChange> - <conf_lblBoth type='str'>Deux directions</conf_lblBoth> - <widget_lblBtnApply type='str'>Appliquer</widget_lblBtnApply> - <widget_lblChangeU type='str'>Changement sup.</widget_lblChangeU> - <widget_lblNotified type='str'>Notifé</widget_lblNotified> - <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> - <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> - <conf_lblChangeU type='str'>Augmente et chute</conf_lblChangeU> - <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> - <widget_lblBoth type='str'>Deux directions</widget_lblBoth> - <gui_conf_rate_lb type='str'>Rafraichissement :</gui_conf_rate_lb> - <absolute_threshold_high type='str'>Batteries pleines</absolute_threshold_high> + <lblHighThreshold type='str'>Limite supérieure</lblHighThreshold> + <lblLowThreshold type='str'>Limite inférieure</lblLowThreshold> + <lblMotors type='str'>Rejeter les mesures lorsque les moteurs fonctionnent</lblMotors> + <low type='str'>Le niveau des batteries est faible</low> <mainscript type='str'>J'ai trouvé la lumière !</mainscript> - <conf_btnRemove type='str'>Enlever</conf_btnRemove> - <gui_conf_delay_lb type='str'>Délai (sec)</gui_conf_delay_lb> + <name_to_read type='str'>Moniteur de batteries</name_to_read> + <normal type='str'>Le niveau des batteries est bon</normal> + <on_battery type='str'>et je suis alimenté par les batteries</on_battery> + <plug type='str'>et l'alimentation est connectée</plug> <plugged type='str'>Connecté</plugged> - <ChangeU type='str'>Le niveau de la batterie a augmenté puis chuté</ChangeU> - <conf_btnBehavior type='str'>Supprimer</conf_btnBehavior> - <charge type='str'>et les batteries sont en train d'être rechargée</charge> - <gui_conf_about_title type='str'>A propos</gui_conf_about_title> - <conf_lblChangeD type='str'>Chute et augmente</conf_lblChangeD> - <low type='str'>Le niveau des batteries est faible</low> - <MainBehavior type='str'>Comportement principal</MainBehavior> <speaker_name type='str'>Bruno8k</speaker_name> - <conf_lblSample type='str'>Points</conf_lblSample> - <conf_lblType type='str'>Type</conf_lblType> - <Change type='str'>Le niveau de la batterie a changé</Change> - <Both type='str'>Le niveau de la batterie a passé le seuil</Both> - <conf_btnModify type='str'>Modifier</conf_btnModify> + <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> + <widget_lblBoth type='str'>Deux directions</widget_lblBoth> + <widget_lblBtnApply type='str'>Appliquer</widget_lblBtnApply> + <widget_lblChange type='str'>Changement</widget_lblChange> + <widget_lblChangeD type='str'>Changement inf.</widget_lblChangeD> + <widget_lblChangeU type='str'>Changement sup.</widget_lblChangeU> + <widget_lblControl type='str'>Contrôle</widget_lblControl> + <widget_lblDecrease type='str'>Decroissance</widget_lblDecrease> + <widget_lblDisplayThreshold type='str'>Afficher le seuil sur le graph.</widget_lblDisplayThreshold> + <widget_lblDrop type='str'>Chute</widget_lblDrop> <widget_lblEvent type='str'>Evènement</widget_lblEvent> - <normal type='str'>Le niveau des batteries est bon</normal> <widget_lblIncrease type='str'>Accroissement</widget_lblIncrease> + <widget_lblNotified type='str'>Notifé</widget_lblNotified> <widget_lblRaise type='str'>Augmentation</widget_lblRaise> - <conf_btnAdd type='str'>Ajouter</conf_btnAdd> - <on_battery type='str'>et je suis alimenté par les batteries</on_battery> - <widget_lblDecrease type='str'>Decroissance</widget_lblDecrease> - <gui_conf_sample_lb type='str'>Nombre de points :</gui_conf_sample_lb> - <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> - <conf_lblNotifiedBehavior type='str'>Notifié</conf_lblNotifiedBehavior> - <gui_conf_author_lb type='str'>Auteur</gui_conf_author_lb> - <widget_lblDrop type='str'>Chute</widget_lblDrop> - <ChangeD type='str'>Le niveau de la batterie a chuté puis augmenté</ChangeD> - <absolute_threshold type='str'>Batteries faibles</absolute_threshold> - <lblMotors type='str'>Rejeter les mesures lorsque les moteurs fonctionnent</lblMotors> - <conf_lblDecrease type='str'>Diminue</conf_lblDecrease> - <lblHighThreshold type='str'>Limite supérieure</lblHighThreshold> - <widget_lblValue type='str'>Valeur (V)</widget_lblValue> - <conf_lblDefaultBehavior type='str'>Comportement pas défaut</conf_lblDefaultBehavior> - <widget_lblDisplayThreshold type='str'>Afficher le seuil sur le graph.</widget_lblDisplayThreshold> - <conf_lblBehavior type='str'>Comportement</conf_lblBehavior> - <plug type='str'>et l'alimentation est connectée</plug> - <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> - <widget_lblChange type='str'>Changement</widget_lblChange> - <name_to_read type='str'>Moniteur de batteries</name_to_read> - <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> - <Drop type='str'>Le niveau de la batterie a chuté</Drop> - <conf_lblDrop type='str'>Chute</conf_lblDrop> - <conf_lblNotNotified type='str'>Non notifié</conf_lblNotNotified> - <Raise type='str'>Le niveau de la batterie a augmenté</Raise> - <charging type='str'>En charge</charging> <widget_lblSet type='str'>Ajouter a la config.</widget_lblSet> - <Decrease type='str'>Le niveau de la batterie est passé en dessous du seuil</Decrease> - <conf_lblValue type='str'>Valeur (V)</conf_lblValue> - <conf_lblRate type='str'>Rafraichissement</conf_lblRate> - <widget_lblBehavior type='str'>Activer le script</widget_lblBehavior> - <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> - <conf_lblTime type='str'>Temps (sec.)</conf_lblTime> - <conf_lblControl type='str'>Contrôle</conf_lblControl> - <conf_lblNotified type='str'>Notifié ?</conf_lblNotified> + <widget_lblTest type='str'>Notifications</widget_lblTest> <widget_lblThreshold type='str'>Seuil</widget_lblThreshold> + <widget_lblValue type='str'>Valeur (V)</widget_lblValue> </strings> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2008-01-21 15:45:31 UTC (rev 865) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/about.xml 2008-01-22 08:30:36 UTC (rev 866) @@ -1,8 +1,8 @@ <?xml version='1.0' encoding='UTF-8'?> <about> + <gadget_author type='str'>Paul Rathgeb</gadget_author> <gadget_description type='str'> </gadget_description> - <gadget_author type='str'>Paul Rathgeb</gadget_author> <gadget_name type='str'>battery_monitor</gadget_name> <gadget_version type='str'>0.0.1</gadget_version> </about> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2008-01-21 15:45:31 UTC (rev 865) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/settings.xml 2008-01-22 08:30:36 UTC (rev 866) @@ -1,35 +1,35 @@ <?xml version='1.0' encoding='UTF-8'?> <settings> - <parameters> - <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, None, False, 0]]</test_tab> - <chkMotors type='bool'>True</chkMotors> - <low_threshold type='float'>4.8</low_threshold> - <MainScript type='str'>None</MainScript> - <Sample type='float'>600.0</Sample> - <Rate type='float'>1.0</Rate> - <high_threshold type='float'>6.0</high_threshold> - <config type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, None, False, 0]]</config> - </parameters> <general> - <have_settings_part type='bool'>True</have_settings_part> + <framework_version type='str'>0.0.0</framework_version> <gui_state> + <conf> + <visible type='bool'>False</visible> + </conf> <widget> <visible type='bool'>False</visible> </widget> - <conf> - <visible type='bool'>False</visible> - </conf> </gui_state> + <have_main_part type='bool'>True</have_main_part> + <have_settings_part type='bool'>True</have_settings_part> + <have_widget_part type='bool'>True</have_widget_part> <language type='str'>en_US</language> + <main_priority type='int'>4</main_priority> + <menu_active type='bool'>True</menu_active> <notified type='bool'>True</notified> <notify_delay type='int'>1</notify_delay> - <framework_version type='str'>0.0.0</framework_version> - <menu_active type='bool'>True</menu_active> - <have_widget_part type='bool'>True</have_widget_part> + <notify_priority type='int'>4</notify_priority> + <pitch type='int'>100</pitch> <speaker type='int'>3</speaker> - <pitch type='int'>100</pitch> - <have_main_part type='bool'>True</have_main_part> - <main_priority type='int'>4</main_priority> - <notify_priority type='int'>4</notify_priority> </general> + <parameters> + <MainScript type='str'>None</MainScript> + <Rate type='float'>1.0</Rate> + <Sample type='float'>600.0</Sample> + <chkMotors type='bool'>True</chkMotors> + <config type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, None, False, 0]]</config> + <high_threshold type='float'>6.0</high_threshold> + <low_threshold type='float'>4.8</low_threshold> + <test_tab type='list'>[[1, 0, 0, 0.10000000000000001, 20.0, True, None, False, 0]]</test_tab> + </parameters> </settings> Modified: software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml =================================================================== --- software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2008-01-21 15:45:31 UTC (rev 865) +++ software/gadgets/battery_monitor/trunk/Battery_monitor_svn/strings.xml 2008-01-22 08:30:36 UTC (rev 866) @@ -1,22 +1,60 @@ <?xml version='1.0' encoding='UTF-8'?> <strings> + <Both type='str'>The battery level reached the threshold</Both> + <Change type='str'>The battery level changed</Change> + <ChangeD type='str'>The battery level dropped and raised</ChangeD> + <ChangeU type='str'>The battery level raised and dropped</ChangeU> + <Decrease type='str'>The battery level passed below the threshold</Decrease> + <Drop type='str'>The battery level dropped</Drop> + <Increase type='str'>The battery level exceeded the threshold</Increase> + <MainBehavior type='str'>Main behavior</MainBehavior> + <Raise type='str'>The battery level raised</Raise> + <absolute_threshold type='str'>Weak batteries </absolute_threshold> + <absolute_threshold_high type='str'>The batteries are full</absolute_threshold_high> + <battery type='str'>On battery</battery> + <charge type='str'>and the batteries are recharging</charge> + <charging type='str'>Charging</charging> + <conf_btnAdd type='str'>Add</conf_btnAdd> + <conf_btnBehavior type='str'>Clear path</conf_btnBehavior> + <conf_btnModify type='str'>Modify</conf_btnModify> + <conf_btnRemove type='str'>Remove</conf_btnRemove> + <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> + <conf_lblBoth type='str'>Both</conf_lblBoth> + <conf_lblChange type='str'>Change</conf_lblChange> + <conf_lblChangeD type='str'>Drop and raise</conf_lblChangeD> + <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> + <conf_lblControl type='str'>Control</conf_lblControl> + <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> + <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> + <conf_lblDrop type='str'>Drop</conf_lblDrop> + <conf_lblEvent type='str'>Event</conf_lblEvent> <conf_lblIncrease type='str'>Increase</conf_lblIncrease> + <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> + <conf_lblNotified type='str'>Notified ?</conf_lblNotified> + <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> + <conf_lblRaise type='str'>Raise</conf_lblRaise> + <conf_lblRate type='str'>Refresh rate</conf_lblRate> + <conf_lblSample type='str'>Samples</conf_lblSample> <conf_lblThreshold type='str'>Threshold</conf_lblThreshold> - <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> <conf_lblTime type='str'>Time (sec.)</conf_lblTime> - <battery type='str'>On battery</battery> + <conf_lblType type='str'>Type</conf_lblType> + <conf_lblValue type='str'>Value (V)</conf_lblValue> + <end_of_charge type='str'>The recharging of the battery is finished</end_of_charge> + <full type='str'>The level of the batteries is full</full> + <gui_conf_about_title type='str'>About</gui_conf_about_title> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> - <conf_lblRaise type='str'>Raise</conf_lblRaise> - <widget_lblTest type='str'>Notifications</widget_lblTest> + <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> + <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> + <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> + <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> - <conf_lblEvent type='str'>Event</conf_lblEvent> - <widget_lblControl type='str'>Control</widget_lblControl> - <Increase type='str'>The battery level exceeded the threshold</Increase> - <conf_btnModify type='str'>Modify</conf_btnModify> - <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> - <lblLowThreshold type='str'>Lower limit</lblLowThreshold> + <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> - <lblMotors type='str'>Disable measurement when the motors are running</lblMotors> + <gui_conf_remote_title type='str'>Control</gui_conf_remote_title> + <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> + <gui_conf_update_title type='str'>Update</gui_conf_update_title> + <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> + <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> <help_text type='str'>--The events: Two main types of events can take place, each containing various options: @@ -51,71 +89,33 @@ This window displays the battery voltage graph. When this window is displayed, the events stored in the settings window are not notified. This window makes it possible to try various configurations and to add them in the settings table.</help_text> - <end_of_charge type='str'>The recharging of the battery is finished</end_of_charge> - <conf_lblChange type='str'>Change</conf_lblChange> - <conf_lblBoth type='str'>Both</conf_lblBoth> + <lblHighThreshold type='str'>Upper limit</lblHighThreshold> + <lblLowThreshold type='str'>Lower limit</lblLowThreshold> + <lblMotors type='str'>Disable measurement when the motors are running</lblMotors> + <low type='str'>The level of the batteries is weak</low> + <mainscript type='str'>I've found the light !</mainscript> + <name_to_read type='str'>Battery monitor</name_to_read> + <normal type='str'>The level of the batteries is good</normal> + <on_battery type='str'>and I'm powered by the battery</on_battery> + <plug type='str'>and the power supply is plugged</plug> + <plugged type='str'>Plugged</plugged> + <speaker_name type='str'>Ryan8k</speaker_name> + <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> + <widget_lblBoth type='str'>Both direction</widget_lblBoth> <widget_lblBtnApply type='str'>Apply changes</widget_lblBtnApply> + <widget_lblChange type='str'>Change</widget_lblChange> + <widget_lblChangeD type='str'>Drop and raise</widget_lblChangeD> <widget_lblChangeU type='str'>Raise and drop</widget_lblChangeU> - <widget_lblNotified type='str'>Notified</widget_lblNotified> - <conf_lblNotNotified type='str'>Not notified</conf_lblNotNotified> - <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> - <gui_conf_update_title type='str'>Update</gui_conf_update_title> - <conf_lblChangeU type='str'>Raise and drop</conf_lblChangeU> - <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> - <absolute_threshold_high type='str'>The batteries are full</absolute_threshold_high> - <mainscript type='str'>I've found the light !</mainscript> - <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> - <plugged type='str'>Plugged</plugged> - <conf_btnBehavior type='str'>Clear path</conf_btnBehavior> - <charge type='str'>and the batteries are recharging</charge> - <gui_conf_about_title type='str'>About</gui_conf_about_title> - <conf_lblChangeD type='str'>Drop and raise</conf_lblChangeD> - <low type='str'>The level of the batteries is weak</low> - <conf_btnAdd type='str'>Add</conf_btnAdd> - <conf_lblBehavior type='str'>Behavior script</conf_lblBehavior> - <conf_lblSample type='str'>Samples</conf_lblSample> - <conf_lblType type='str'>Type</conf_lblType> - <Change type='str'>The battery level changed</Change> - <conf_lblValue type='str'>Value (V)</conf_lblValue> - <Both type='str'>The battery level reached the threshold</Both> - <full type='str'>The level of the batteries is full</full> + <widget_lblControl type='str'>Control</widget_lblControl> + <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> + <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> + <widget_lblDrop type='str'>Drop</widget_lblDrop> <widget_lblEvent type='str'>Event</widget_lblEvent> - <normal type='str'>The level of the batteries is good</normal> <widget_lblIncrease type='str'>Increasing</widget_lblIncrease> + <widget_lblNotified type='str'>Notified</widget_lblNotified> <widget_lblRaise type='str'>Raise</widget_lblRaise> - <gui_conf_rate_lb type='str'>Refresh rate :</gui_conf_rate_lb> - <on_battery type='str'>and I'm powered by the battery</on_battery> - <widget_lblDecrease type='str'>Decreasing</widget_lblDecrease> - <gui_conf_sample_lb type='str'>Sample :</gui_conf_sample_lb> - <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> - <conf_lblNotifiedBehavior type='str'>Notified</conf_lblNotifiedBehavior> - <gui_conf_author_lb type='str'>Author</gui_conf_author_lb> - <widget_lblDrop type='str'>Drop</widget_lblDrop> - <conf_lblNotified type='str'>Notified ?</conf_lblNotified> - <widget_lblBoth type='str'>Both direction</widget_lblBoth> - <conf_lblDecrease type='str'>Decrease</conf_lblDecrease> - <widget_lblValue type='str'>Value (V)</widget_lblValue> - <conf_lblDefaultBehavior type='str'>Default behavior</conf_lblDefaultBehavior> - <speaker_name type='str'>Ryan8k</speaker_name> - <plug type='str'>and the power supply is plugged</plug> - <absolute_threshold type='str'>Weak batteries </absolute_threshold> - <widget_lblChange type='str'>Change</widget_lblChange> - <name_to_read type='str'>Battery monitor</name_to_read> - <lblHighThreshold type='str'>Upper limit</lblHighThreshold> - <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> - <Drop type='str'>The battery level dropped</Drop> - <conf_lblDrop type='str'>Drop</conf_lblDrop> - <ChangeD type='str'>The battery level dropped and raised</ChangeD> - <Raise type='str'>The battery level raised</Raise> - <charging type='str'>Charging</charging> <widget_lblSet type='str'>Add to config</widget_lblSet> - <Decrease type='str'>The battery level passed below the threshold</Decrease> - <widget_lblDisplayThreshold type='str'>Display threshold on graph</widget_lblDisplayThreshold> - <conf_lblRate type='str'>Refresh rate</conf_lblRate> - <widget_lblBehavior type='str'>Enable behavior script</widget_lblBehavior> - <MainBehavior type='str'>Main behavior</MainBehavior> - <ChangeU type='str'>The battery level raised and dropped</ChangeU> - <conf_lblControl type='str'>Control</conf_lblControl> - <conf_btnRemove type='str'>Remove</conf_btnRemove> + <widget_lblTest type='str'>Notifications</widget_lblTest> <widget_lblThreshold type='str'>Threshold</widget_lblThreshold> + <widget_lblValue type='str'>Value (V)</widget_lblValue> </strings> Modified: software/gadgets/flash_management/trunk/flash_management/Strings/fr_ALL.xml =================================================================== --- software/gadgets/flash_management/trunk/flash_management/Strings/fr_ALL.xml 2008-01-21 15:45:31 UTC (rev 865) +++ software/gadgets/flash_management/trunk/flash_management/Strings/fr_ALL.xml 2008-01-22 08:30:36 UTC (rev 866) @@ -23,33 +23,32 @@ <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> - <help_text type='str'>--= Gestion de la mémoire flash =-- - -Ce gadget vous permet de changer les sons contenus dans la mémoire de Tux. -Les fichiers pouvant être enregistré dans la mémoire doivent être des fichiers waves, avec une fréquence d'échantillonnage de 8kHz et une résolution de 8 bits, en mono. - -Ce gadget se présente en deux sections. La première section permet de créer une liste de sons, et des les programmer dans Tux. -La case 'Fichiers originaux' permet le chargement automatiquement dans la liste des sons d'origines de Tux. Ces sons sont utilisés dans un bon nombre de gadgets, par le manager ainsi que par Tux lui-même. -Vous pouvez bien évidemment remplacer ces sons par les vôtres, ou simplement reprendre la liste par défaut. - -Il est également possible de charger un fichier directement dans la liste. Pour cela, il suffit de spécifier le fichier, et d'appuyer sur le bouton 'ajouter'. - -Tous les sons peuvent être réorganisés dans la liste, en les sélectionnant et en changeant leurs emplacements. -Vous pouvez également supprimer un fichier, en le selectionnant dans la liste et en appuyant sur le bouton 'enlever'. -Enfin, vous avez la possibilité de remplacer un son contenu dans la liste par celui que vous aurez spécifié. - -Lorsque la liste est configurée, vous pourrez programmer les sons dans Tux. Il vous suffira d'appuyer sur le bouton 'Ecrire'. -Cette opération nécessite un certain temps, dépendant du nombre de sons à programmer. - -La section 'Lire un wave local' permet d'écouter un son enregistrer dans la mémoire de Tux. Vous pourrez alors vérifier que la programmation s'est déroulée correctement. - - -Note : -Vous pouvez très facilement convertir vos fichiers afin de les rendrent compatibles avec Tux en utilisant le logiciel sox (http://sox.sourceforge.net/). - -Exemple de conversion avec Sox : -sox 'file.mp3' -c 1 -r 8000 -b 'file.wav' - + <help_text type='str'>--= Gestion de la mémoire flash =-- + +Ce gadget permet de changer les sons contenus dans la mémoire de Tux. +Les fichiers pouvant être enregistrés dans la mémoire doivent être des fichiers wavs mono, avec une fréquence d'échantillonnage de 8kHz et une résolution de 8 bits. + +Ce gadget se présente en deux sections. La première section permet de créer une liste de sons, et de les programmer dans Tux. +La case 'Fichiers originaux' permet le chargement automatiquement dans la liste des sons d'origines de Tux. Ces sons sont utilisés dans un bon nombre de gadgets, par le manager ainsi que par Tux lui-même. +Vous pouvez bien évidemment remplacer ces sons par les vôtres. + +Il est également possible de charger un fichier directement dans la liste. Pour cela, il suffit de spécifier l'emplacement du fichier, et d'appuyer sur le bouton 'ajouter'. + +Tous les sons peuvent être réorganisés dans la liste, en les sélectionnant et en changeant leurs emplacements. +Vous pouvez également supprimer un fichier, en le sélectionnant dans la liste et en appuyant sur le bouton 'enlever'. +Enfin, vous avez la possibilité de remplacer un son contenu dans la liste par celui que vous aurez spécifié. + +Lorsque la liste est configurée, vous pourrez programmer les sons dans Tux. Il vous suffira d'appuyer sur le bouton 'Ecrire'. +Cette opération nécessite un certain temps, dépendant du nombre et de la durée des sons à programmer. + +La section 'Lire un wave local' permet d'écouter un son enregistré dans la mémoire de Tux. Vous pourrez alors vérifier que la programmation s'est déroulée correctement. + + +Note : +Vous pouvez très facilement convertir vos fichiers afin qu'ils soient compatibles avec Tux en utilisant le logiciel sox (http://sox.sourceforge.net/). + +Exemple de conversion avec Sox : +sox 'file.mp3' -c 1 -r 8000 -b 'file.wav' </help_text> <lblSoundExternal type='str'>Lire un wave externe</lblSoundExternal> <lblSoundExternalFile type='str'>Fichier :</lblSoundExternalFile> Modified: software/gadgets/flash_management/trunk/flash_management/settings.xml =================================================================== --- software/gadgets/flash_management/trunk/flash_management/settings.xml 2008-01-21 15:45:31 UTC (rev 865) +++ software/gadgets/flash_management/trunk/flash_management/settings.xml 2008-01-22 08:30:36 UTC (rev 866) @@ -10,7 +10,9 @@ <visible type='bool'>False</visible> </selftest> <widget> - <visible type='bool'>False</visible> + <visible type='bool'>True</visible> + <x type='int'>839</x> + <y type='int'>50</y> </widget> </gui_state> <have_main_part type='bool'>True</have_main_part> Modified: software/gadgets/flash_management/trunk/flash_management.tgf =================================================================== (Binary files differ) Modified: software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml =================================================================== --- software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2008-01-21 15:45:31 UTC (rev 865) +++ software/gadgets/light_monitor/trunk/Light_monitor/Strings/fr_ALL.xml 2008-01-22 08:30:36 UTC (rev 866) @@ -55,42 +55,42 @@ <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> - <help_text type='str'>-- Les évènements : -Deux grands types d'évènements peuvent avoir lieu, contenant chacun diverses options : - -Les changements : -Les changements sont de évènements qui se produisent dans un laps de temps donné. -Les quatre types de changements sont : -- Chute -- Augmentation -- Une chute suivie d'une augmentation -- Une augmentation suivie d'une chute - -Par exemple, un évènement peut avoir lieu si le niveau lumineux diminue de 10% dans un laps de temps de deux secondes. - -Les seuils : -Les évènements de seuils se déclenche lorsque la lumière atteint un certain niveau. -Le passage du seuil peut se faire : -- par une augmentation (dépassement du seuil) -- par une diminution (passage en dessous du seuil) -- dans les deux directions. - --- Les fenêtres : -- La fenêtre de configuration : -Cette fenêtre reprend toutes les options de configuration du gadget, notamment le taux de rafraichissement ainsi que le nombre de points affichés sur le graphique peut être configuré. - -Des évènements, pouvant entraîner une notification, peuvent également être enregistrés. -Si aucun script externe n'est spécifié, un comportement de base se déclenchera. -Les évènements peuvent à tout moment être modifiés ou supprimés, par simple sélection de la ligne dans le tableau. - -- La fenêtre du gadget : -Cette fenêtre affiche le graphique de lumière. -Lorsque cette fenêtre est affichée, les évènements enregistrés dans la fenêtre de configuration ne sont plus notifiés. -Cette fenêtre permet de tester diverses configurations et de les ajouter dans le tableau de configuration. - -Une zone de test comportant deux boutons permettent à Tux de rechercher la direction la plus lumineuse, ou la plus sombre. - -Deux scripts de bases se trpouvent dans /tmp/Light_monitor/Data</help_text> + <help_text type='str'>-- Les évènements : +Deux grands types d'évènements peuvent avoir lieu, contenant chacun diverse option : + +Les changements : +Les changements sont de évènements qui se produisent dans un laps de temps donné. +Les quatre types de changements sont : +- Chute +- Augmentation +- Une chute suivie d'une augmentation +- Une augmentation suivie d'une chute + +Par exemple, un évènement peut avoir lieu si le niveau lumineux diminue de 10% dans un laps de temps de deux secondes. + +Les seuils : +Les évènements de seuils se déclenchent lorsque la lumière atteint un certain niveau. +Le passage du seuil peut se faire : +- par une augmentation (dépassement du seuil) +- par une diminution (passage en dessous du seuil) +- dans les deux directions. + +-- Les fenêtres : +- La fenêtre de configuration : +Cette fenêtre reprend toutes les options de configuration du gadget, notamment le taux de rafraîchissement ainsi que le nombre de points affichés sur le graphique. + +Des évènements, pouvant entraîner une notification peuvent également être enregistrés. +Si aucun script externe n'est spécifié, un comportement de base se déclenchera. +Les évènements peuvent à tous moment être modifiés ou supprimés, par simple sélection de la ligne dans le tableau. + +- La fenêtre du gadget : +Cette fenêtre affiche le graphique de lumière. +Lorsque cette fenêtre est affichée, les évènements enregistrés dans la fenêtre de configuration ne sont plus notifiés. +Cette fenêtre permet de tester diverses configurations et de les ajouter dans le tableau de configuration. + +Une zone de test comportant deux boutons permettent à Tux de rechercher la direction la plus lumineuse, ou la plus sombre. + +Deux scripts de bases se trouvent dans /tmp/Light_monitor/Data</help_text> <light1 type='str'>Je vois de la lumière ici...</light1> <light2 type='str'>J'en vois encore plus ici !</light2> <light3 type='str'>ou ici ?</light3> Modified: software/gadgets/light_monitor/trunk/Light_monitor.tgf =================================================================== (Binary files differ) Modified: software/gadgets/micro_monitor/trunk/micro_monitor/Strings/fr_ALL.xml =================================================================== --- software/gadgets/micro_monitor/trunk/micro_monitor/Strings/fr_ALL.xml 2008-01-21 15:45:31 UTC (rev 865) +++ software/gadgets/micro_monitor/trunk/micro_monitor/Strings/fr_ALL.xml 2008-01-22 08:30:36 UTC (rev 866) @@ -32,18 +32,17 @@ Le gadget 'Moniteur de micro' affiche l'énergie sonore perçue par le micro de Tux. Ce gadget a une priorité particulière. En effet, lorsque la fenêtre principale est affichée, les notifications des autres gadgets sont arrêtées. -Lorsque vous fermez le gadget, les paramêtres de notification des autres gadgets sont réstaurés, et les notification de ce gadget sont arrêtées. +Lorsque vous fermez le gadget, les paramètres de notification des autres gadgets sont restaurés, et les notifications du moniteur de micro sont arrétées. -Deux modes sont disponnibles : +Deux modes sont disponibles : - Mode 'Chien de garde' - Lorsque ce mode est activé, si l'énergie dépasse le seuil, une notification se produit. -Vous pouvez spécifié un script qui ser exécuté lors de la notification. Pour celà, il est nécessaire de cocher la case 'Utiliser un script'. Dans le cas contraire, le comportement par défaut sera utilisé. +Vous pouvez spécifié un script python qui sera exécuté lors de la notification. Pour cela, il est nécessaire de cocher la case 'Utiliser un script'. Si aucun fichier de script n'est spécifié, le comportement par défaut sera utilisé. - Mode espion - -Le mode espion permet d'enregistrer le son lorsqu'il dépasse le seuil. Les sons enregistrés peuvent être à tous moment écoutés par simple clic droit sur un son se trouvant dans le tableau, et en sélectionnant 'Lecture'. -Dans la fenêtre de configuration de ce gadget, accessible à partir du 'Manager', vous pouvez spécifier l'emplacement dans lequel les sons doivent être enregistrés. -</help_text> +Le mode espion permet d'enregistrer le son lorsqu'il dépasse le seuil. Les sons enregistrés peuvent être a tous moment écoutés par simple clic droit sur un son se trouvant dans le tableau, et en sélectionnant 'Lecture'. +Dans la fenêtre de configuration de ce gadget, accessible à partir du 'Manager', vous pouvez spécifier l'emplacement dans lequel les sons doivent être enregistrés.</help_text> <lblSample type='str'>Nombre de points : </lblSample> <name_to_read type='str'>Moniteur de micro</name_to_read> <speaker_name type='str'>Bruno8k</speaker_name> Modified: software/gadgets/micro_monitor/trunk/micro_monitor.tgf =================================================================== (Binary files differ) Modified: software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml 2008-01-21 15:45:31 UTC (rev 865) +++ software/gadgets/tux_controller/trunk/TuxController/Strings/fr_ALL.xml 2008-01-22 08:30:36 UTC (rev 866) @@ -19,24 +19,24 @@ <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> - <help_text type='str'>-- Gadget Contrôler le robot -- - -Ce gadget permet de contrôler Tux. La fenêtre se compose de deux parties : -La partie de gauche permet de visualiser Tux, ainsi que de lui de faire des mouvements simples. -La partie de droite permet de parametrer d'une manière plus évoluée des mouvements. Après avoir configurer le nombre de mouvements ainsi que la vitesse, les mouvements sont déclenché grâce au bouton représenté par un engrennage. Cette partie peut être masquée en décochant la case 'Commande avancée'. - -Ce gadget permet également de paramêtrer un texte qui sera dit par Tux. Cette partie se trouve en bas de l'écran, en activant la flèche 'TTS'. Il est également possible de changer de locuteur par le panneau de commandes avancées. - -Enfin, les mouvements peuvent être déclenchés grâce à la télécommande : - -Partie: Mv simple : Mv évolués : -Yeux Fleche haut Rouge -Bec OK Vert -Ailes Fleche bas Bleu -Rotation Gauche / droite Jaune - -Limitations : -Pour le moment, le LEDs ne sont pas représentées individuellement sur les images.</help_text> + <help_text type='str'>-- Gadget Contrôler le robot -- + +Ce gadget permet de contrôler Tux. La fenêtre se compose de deux parties : +La partie de gauche permet de visualiser Tux, ainsi que de lui de faire des mouvements simples. +La partie de droite permet de paramétrer d'une manière plus évoluée des mouvements. Après avoir configurer le nombre de mouvements ainsi que la vitesse, les mouvements sont déclenchés grâce au bouton représenté par un engrenage. Cette partie peut être masquée en décochant la case 'Commande avancée'. + +Ce gadget permet également de paramétrer un texte qui sera dit par Tux. Cette partie se trouve en bas de l'écran, en activant la flèche 'TTS'. Il est également possible de changer de locuteur par le panneau de commandes avancées. + +Enfin, les mouvements peuvent être déclenchés grâce à la télécommande : + +Partie: Mv simple : Mv évolués : +Yeux Fleche haut Rouge +Bec OK Vert +Ailes Fleche bas Bleu +Rotation Gauche / droite Jaune + +Limitations : +Pour le moment, les LEDs ne sont pas représentées individuellement sur les images.</help_text> <lblBatteryL type='str'>Niveau des batteries</lblBatteryL> <lblConf type='str'>Divers</lblConf> <lblEyes type='str'>Yeux</lblEyes> Modified: software/gadgets/tux_controller/trunk/TuxController.tgf =================================================================== (Binary files differ) |
From: jaguarondi <c2m...@c2...> - 2008-01-21 15:45:30
|
Author: jaguarondi Date: 2008-01-21 16:45:31 +0100 (Mon, 21 Jan 2008) New Revision: 865 Modified: firmware/tuxaudio/trunk/Makefile firmware/tuxcore/trunk/Makefile Log: * Oops, reverting 863. Modified: firmware/tuxaudio/trunk/Makefile =================================================================== --- firmware/tuxaudio/trunk/Makefile 2008-01-21 15:39:30 UTC (rev 864) +++ firmware/tuxaudio/trunk/Makefile 2008-01-21 15:45:31 UTC (rev 865) @@ -38,7 +38,11 @@ CINCS = # Compile options common for all C compilation units. +ifdef windir +CDEBUG = -gdwarf-2 +else CDEBUG = -g +endif CWARN = -Wall -Wstrict-prototypes CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums CFLAGS = $(COMMON) $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA) @@ -132,17 +136,29 @@ size: ${TARGET} @echo +ifdef windir + @avr-size -C --mcu=${MCU} ${TARGET} +else @avr-size ${TARGET} +endif bl_size: ${BOOTLOADER} @echo +ifdef windir + @avr-size -C --mcu=${MCU} ${BOOTLOADER} +else @avr-size ${BOOTLOADER} +endif ## Generate SVN info # We need to change the status each time a file changes, thus so many # dependencies svnrev.h: $(CSOURCE) $(HEADERS) +ifdef windir + SubWCRev . svnrev.tmpl.h svnrev.h +else svnwcrev . svnrev.tmpl.h svnrev.h +endif ## Clean target .PHONY: clean @@ -153,6 +169,16 @@ ## Other dependencies -include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*) +## Generate doxygen documentation +.PHONY: doc +doc: svnrev.h +ifdef windir + # XXX add windows version +else + @./doc/builddoc.sh +endif + + # Programming prog: $(PROJECT).hex tuxup $(PROJECT).hex $(PROJECT).eep Modified: firmware/tuxcore/trunk/Makefile =================================================================== --- firmware/tuxcore/trunk/Makefile 2008-01-21 15:39:30 UTC (rev 864) +++ firmware/tuxcore/trunk/Makefile 2008-01-21 15:45:31 UTC (rev 865) @@ -55,7 +55,11 @@ CINCS = # Compile options common for all C compilation units. +ifdef windir +CDEBUG = -gdwarf-2 +else CDEBUG = -g +endif CWARN = -Wall -Wstrict-prototypes CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums CFLAGS = $(COMMON) $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) \ @@ -140,7 +144,12 @@ # We need to change the status each time a file changes, thus so many # dependencies svnrev.h: $(CSOURCE) $(HEADERS) + +ifdef windir + SubWCRev . svnrev.tmpl.h svnrev.h +else svnwcrev . svnrev.tmpl.h svnrev.h +endif ##Link $(TARGET): $(OBJECTS) @@ -161,11 +170,19 @@ size: ${TARGET} @echo +ifdef windir + @avr-size -C --mcu=${MCU} ${TARGET} +else @avr-size ${TARGET} +endif bl_size: ${BOOTLOADER} @echo +ifdef windir + @avr-size -C --mcu=${MCU} ${BOOTLOADER} +else @avr-size ${BOOTLOADER} +endif ## Clean target .PHONY: clean @@ -178,6 +195,15 @@ ## Other dependencies -include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*) +## Generate doxygen documentation +.PHONY: doc +doc: svnrev.h +ifdef windir + # XXX add windows version +else + @./doc/builddoc.sh +endif + # Programming prog: $(PROJECT).hex tuxup $(PROJECT).hex $(PROJECT).eep |
From: Paul_R <c2m...@c2...> - 2008-01-21 15:39:30
|
Author: Paul_R Date: 2008-01-21 16:39:30 +0100 (Mon, 21 Jan 2008) New Revision: 864 Modified: software/gadgets/tux_controller/trunk/TuxController.tgf software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp Log: * Major review of this gadget : - Cleaned the code (removed not used functions, reorganized the functions, etc). - Improved the eyes - mouth - flippers - spinning 's functions to fix some bugs with the graphics (especially with the run / stop buttons's icons) Modified: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp 2008-01-21 15:37:48 UTC (rev 863) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp 2008-01-21 15:39:30 UTC (rev 864) @@ -3,10 +3,9 @@ import voice_cb except: print sys.exc_info() - + __led_toggled_by_event = False - class Window(SimpleGladeApp): def __init__(self, @@ -44,291 +43,12 @@ [['none', 'Show', 'Panel'], self.show_tab, ()], ] _me.voice_recognition.set_rules(rules) - - def update(self): - self.__eyes_active = False - self.__eyes_stop = False - self.__eyes_infinite = False - self.__mouth_active = False - self.__mouth_stop = False - self.__mouth_infinite = False - self.__wings_active = False - self.__wings_stop = False - self.__wings_infinite = False - self.__spin_active = False - self.__spin_stop = False - self.__spin_infinite = False - - _me.set_var('pitch', _me.get_param('pitch')) - _me.set_var('speaker', _me.get_param('speaker')) - - self.cb_voice = voice_cb.VoiceComboBoxAdd(tux, self.get_widget("comboboxentry1")) - self.cb_voice.set_spk(_me.get_var('speaker')) - self.get_widget('spinPitch').set_value(_me.get_param('pitch')) - self.cb_voice.update() - self.cb_voice.set_spk(_me.get_param('speaker')) - - self.update_labels() - self.update_pix() - - tux.cmd.raw(0x31, 0, 0, 0) - self.update_status() - - self.binding() - tux.sys.wait(1) - - - - def on_window1_destroy(self, widget, *args): - _me.get_funct('on_standby')() - - def binding(self): - ''' - This function 'connect' some Tux's events with local functions. - See the tux.event help for more informations. - - The light, battery and audio monitoring are also initialized here. - ''' - ### Correct the leds inversion on the next daemon - tux.event.on_left_blue_led_on = self.on_left_led_on - tux.event.on_left_blue_led_off = self.on_left_led_off - tux.event.on_right_blue_led_on = self.on_right_led_on - tux.event.on_right_blue_led_off = self.on_right_led_off - tux.event.on_eyes_open = self.on_eyes_open - tux.event.on_eyes_close = self.on_eyes_close - tux.event.on_mouth_open = self.on_mouth_open - tux.event.on_mouth_close = self.on_mouth_close - tux.event.on_spin_stop = self.on_spin_stop - - tux.event.on_remote_bt[K_UP] = self.on_key_up #eyes - tux.event.on_remote_bt[K_DOWN] = self.on_key_down #wings - tux.event.on_remote_bt[K_OK] = self.on_key_ok #mouth - tux.event.on_remote_bt[K_LEFT] = self.on_key_left #spin right - tux.event.on_remote_bt[K_RIGHT] = self.on_key_right #spin left - tux.event.on_remote_bt[K_RED] = self.on_key_red #Run eyes - tux.event.on_remote_bt[K_GREEN] = self.on_key_green #Run mouth - tux.event.on_remote_bt[K_BLUE] = self.on_key_blue #Run wings - tux.event.on_remote_bt[K_YELLOW] = self.on_key_yellow #Run spinning - tux.event.on_remote_bt[K_STOP] = self.StopAll - - - - battery_idx = tux.monitoring.insert(0x25, self.on_battery_level) - - light_idx = tux.monitoring.insert(0x1B, self.on_light_level) - - tux.micro.on() - sound_idx = tux.monitoring.insert(0xF0, self.on_microphone_energy) - tux.sys.wait(0.1) - _me.set_param('batt', battery_idx) - _me.set_param('light', light_idx) - _me.set_param('sound', sound_idx) - - - def update_status(self): - ''' - This function update the status when the gadget is starting. - ''' - global __toggled_by_event - __led_toggled_by_event = True - if tux.status.lled(): - self.get_widget('chkLEDLeft').set_active(True) - else: - self.get_widget('chkLEDLeft').set_active(False) - - if tux.status.rled(): - self.get_widget('chkLEDRight').set_active(True) - else: - self.get_widget('chkLEDRight').set_active(False) - - __led_toggled_by_event = False - - def update_pix(self): - self.path = _me.get_path('pictures')+'/Icons/' - self.get_widget('chkShow').set_active(True) - self.get_widget('chkShow').set_label(_me.string('chkShow')) - - self.get_widget('imgLight').set_from_file(self.path+'light.png') - self.get_widget('imgBattery').set_from_file(self.path+'battery.png') - self.get_widget('imgSound').set_from_file(self.path+'microphone.png') - - self.led_on = gtk.gdk.pixbuf_new_from_file(self.path+'led_on.png') - self.led_off = gtk.gdk.pixbuf_new_from_file(self.path+'led_off.png') - self.eyes_close = gtk.gdk.pixbuf_new_from_file(self.path+'eye_closed.png') - self.wings_down = gtk.gdk.pixbuf_new_from_file(self.path+'wings_down.png') - self.wings_up = gtk.gdk.pixbuf_new_from_file(self.path+'wings_up.png') - self.spin_left = gtk.gdk.pixbuf_new_from_file(self.path+'spin_left.png') - self.spin_right = gtk.gdk.pixbuf_new_from_file(self.path+'spin_right.png') - self.spin_off = gtk.gdk.pixbuf_new_from_file(self.path+'spin_off.png') - self.spin_transfo = gtk.gdk.pixbuf_new_from_file(self.path+'spin_off_charging.png') - self.beak_open = gtk.gdk.pixbuf_new_from_file(self.path+'beak_open.png') - self.beak_closed = gtk.gdk.pixbuf_new_from_file(self.path+'beak_closed.png') - self.up = gtk.gdk.pixbuf_new_from_file(self.path+'up.png') - self.down = gtk.gdk.pixbuf_new_from_file(self.path+'down.png') - self.right = gtk.gdk.pixbuf_new_from_file(self.path+'right.png') - self.left = gtk.gdk.pixbuf_new_from_file(self.path+'left.png') - self.run = gtk.gdk.pixbuf_new_from_file(self.path+'run.png') - self.stop = gtk.gdk.pixbuf_new_from_file(self.path+'gear-off.png') - - self.get_widget('imgLEDRun').set_from_pixbuf(self.run) - - self.get_widget('imgEyesOpen').set_from_pixbuf(self.up) - self.get_widget('imgEyesClose').set_from_pixbuf(self.down) - self.get_widget('imgEyesRun').set_from_pixbuf(self.run) - - self.get_widget('imgMouthClose').set_from_pixbuf(self.up) - self.get_widget('imgMouthOpen').set_from_pixbuf(self.down) - self.get_widget('imgMouthRun').set_from_pixbuf(self.run) - - self.get_widget('imgWingsUp').set_from_pixbuf(self.up) - self.get_widget('imgWingsDown').set_from_pixbuf(self.down) - self.get_widget('imgWingsRun').set_from_pixbuf(self.run) - - self.get_widget('imgSpinLeft').set_from_pixbuf(self.left) - self.get_widget('imgSpinRight').set_from_pixbuf(self.right) - self.get_widget('imgSpinRun').set_from_pixbuf(self.run) - - self.get_widget('imgStopAll').set_from_pixbuf(self.stop) - self.show_tab() - - if tux.status.rled(): - self.get_widget('imgLed').set_from_pixbuf(self.led_on) - else: - self.get_widget('imgLed').set_from_pixbuf(self.led_off) - - if tux.status.eyes_closed() == 0: - self.get_widget('imgLed').set_from_pixbuf(self.eyes_close) - - if tux.status.mouth_closed() == 0: - self.get_widget('imgMouth').set_from_pixbuf(self.beak_closed) - else: - self.get_widget('imgMouth').set_from_pixbuf(self.beak_open) - - self.get_widget('imgWings').set_from_pixbuf(self.wings_down) - - self.get_widget('imgSpin').set_from_pixbuf(self.spin_off) - - def create_tooltips(self): - self.get_widget('imgLEDRun').set_tooltip_text(_me.string('toolLEDRun')) - self.get_widget('slideLED').set_tooltip_text(_me.string('toolLEDslide')) - self.get_widget('spinLED').set_tooltip_text(_me.string('toolLEDspin')) - - self.get_widget('imgEyesRun').set_tooltip_text(_me.string('toolEyesRun')) - self.get_widget('spinEyes').set_tooltip_text(_me.string('toolMove')) - - self.get_widget('imgMouthRun').set_tooltip_text(_me.string('toolMouthRun')) - self.get_widget('spinMouth').set_tooltip_text(_me.string('toolMove')) - - self.get_widget('imgWingsRun').set_tooltip_text(_me.string('toolWingsRun')) - self.get_widget('spinWings').set_tooltip_text(_me.string('toolMove')) - self.get_widget('slideWings').set_tooltip_text(_me.string('toolPWM')) - - self.get_widget('imgSpinRun').set_tooltip_text(_me.string('toolSpinRun')) - self.get_widget('spinSpin').set_tooltip_text(_me.string('toolMove')) - self.get_widget('slideSpin').set_tooltip_text(_me.string('toolPWM')) - self.get_widget('radSpinDirLeft').set_tooltip_text(_me.string('toolSpinDir')) - self.get_widget('radSpinDirRight').set_tooltip_text(_me.string('toolSpinDir')) - - self.get_widget('imgStopAll').set_tooltip_text(_me.string('toolStopAll')) - - self.get_widget('chkShow').set_tooltip_text(_me.string('toolAdvanced')) - - self.get_widget('chkLEDRight').set_tooltip_text(_me.string('toolLEDRight')) - self.get_widget('chkLEDLeft').set_tooltip_text(_me.string('toolLEDLeft')) - - self.get_widget('btnEyesOpen').set_tooltip_text(_me.string('toolEyesOpen')) - self.get_widget('btnEyesClose').set_tooltip_text(_me.string('toolEyesClose')) - - self.get_widget('btnMouthOpen').set_tooltip_text(_me.string('toolMouthOpen')) - self.get_widget('btnMouthClose').set_tooltip_text(_me.string('toolMouthClose')) - - self.get_widget('btnWingsUp').set_tooltip_text(_me.string('toolWingsUp')) - self.get_widget('btnWingsDown').set_tooltip_text(_me.string('toolWingsDown')) - - self.get_widget('btnSpinRight').set_tooltip_text(_me.string('toolSpinRight')) - self.get_widget('btnSpinLeft').set_tooltip_text(_me.string('toolSpinLeft')) - - self.get_widget('imgLight').set_tooltip_text(_me.string('toolLight')) - self.get_widget('imgBattery').set_tooltip_text(_me.string('toolBattery')) - self.get_widget('imgSound').set_tooltip_text(_me.string('toolSound')) - - self.get_widget('comboboxentry1').set_tooltip_text(_me.string('toolLang')) - self.get_widget('spinPitch').set_tooltip_text(_me.string('toolPitch')) - - self.get_widget('btnTTS').set_tooltip_text(_me.string('toolTTS')) - self.get_widget('btnTTSClear').set_tooltip_text(_me.string('toolTTSClear')) - self.get_widget('scrolledwindow1').set_tooltip_text(_me.string('toolTTSText')) - - - def hide_tab(self): - self.get_widget('fix1').hide() - self.get_widget('fix1').set_size_request(2,0) - self.get_widget('fix2').hide() - self.get_widget('fix2').set_size_request(2,0) - self.get_widget('fix3').hide() - self.get_widget('fix3').set_size_request(2,0) - self.get_widget('fix4').hide() - self.get_widget('fix4').set_size_request(2,0) - self.get_widget('fix5').hide() - self.get_widget('fix5').set_size_request(2,0) - self.get_widget('fix6').hide() - self.get_widget('fix6').set_size_request(2,0) - self.get_widget('fix7').hide() - self.get_widget('fix7').set_size_request(2,0) - - def show_tab(self): - self.get_widget('fix1').show() - self.get_widget('fix1').set_size_request(330,0) - self.get_widget('fix2').show() - self.get_widget('fix2').set_size_request(330,0) - self.get_widget('fix3').show() - self.get_widget('fix3').set_size_request(330,0) - self.get_widget('fix4').show() - self.get_widget('fix4').set_size_request(330,0) - self.get_widget('fix5').show() - self.get_widget('fix5').set_size_request(330,0) - self.get_widget('fix6').show() - self.get_widget('fix6').set_size_request(330,0) - self.get_widget('fix7').show() - self.get_widget('fix7').set_size_request(330,0) - - - - def update_labels(self): - ## Update the radio button labels - self.get_widget('btnTTS').set_label(_me.string('TTS')) - self.get_widget('btnTTSClear').set_label(_me.string('TTSClear')) - self.get_widget('lblTTS').set_label(_me.string('lblTTS')) - - self.get_widget('lblStop').set_label(_me.string('lblStop')) - - self.get_widget('lblLED').set_label(_me.string('lblLED')) - self.get_widget('lblEyes').set_label(_me.string('lblEyes')) - self.get_widget('lblMouth').set_label(_me.string('lblMouth')) - self.get_widget('lblWings').set_label(_me.string('lblWings')) - self.get_widget('lblSpin').set_label(_me.string('lblSpin')) - self.get_widget('lblConf').set_label(_me.string('lblConf')) - self.get_widget('lblTTSConf').set_label(_me.string('lblTTSConf')) - self.get_widget('lblPitch').set_label(_me.string('lblPitch')) - - self.get_widget('lblFrequency').set_label(_me.string('lblFrequency')) - self.get_widget('lblWingsPWM').set_label(_me.string('lblPWM')) - self.get_widget('lblSpinPWM').set_label(_me.string('lblPWM')) - - self.get_widget('radSpinDirLeft').set_label(_me.string('radSpinDirLeft')) - self.get_widget('radSpinDirRight').set_label(_me.string('radSpinDirRight')) - - - -#################################################################### +############################################################################### # -# Widget items events +# TTS part # -# This section contains all the functions connected to the widgets -# signals. -# -#################################################################### +############################################################################### def set_spk(self, speaker): self.cb_voice.set_spk(speaker) @@ -339,7 +59,6 @@ _me.set_param('pitch', self.get_widget('spinPitch').get_value()) _me.set_var('speaker', spk_id) _me.set_var('pitch', self.get_widget('spinPitch').get_value()) - def on_spinPitch_changed(self, widget, *args): @@ -350,7 +69,26 @@ _me.set_var('speaker', spk_id) _me.set_var('pitch', self.get_widget('spinPitch').get_value()) - + def on_btnTTS_clicked(self, widget, *args): + textedit=self.get_widget('txtTTS') + buffer=textedit.get_buffer() + my_text=buffer.get_text(*buffer.get_bounds()) + tux.tts.speak_free(my_text) + + def on_btnTTSClear_clicked(self, widget, *args): + textedit=self.get_widget('txtTTS') + buffer=textedit.get_buffer() + buffer.set_text("") + + +############################################################################### +# +# Widget items events +# +# This section contains all the functions connected to the widgets +# signals. +# +############################################################################### def StopAll(self): thread.start_new_thread(self.__stop_all, ()) @@ -394,13 +132,18 @@ thread.start_new_thread(self.refresh_picture, ('imgSpin', self.spin_off)) tux.cmd.spinl_off() tux.cmd.spinr_off() - - - + def on_btnStopAll_clicked(self, widget, *args): thread.start_new_thread(self.__stop_all, ()) -## btnLEDrun + def refresh_picture(self, widget, picture): + self.get_widget(widget).set_from_pixbuf(picture) + +############################################################################### +# +# LEDs part +# +############################################################################### def on_btnLEDRun_clicked(self, widget, *args): freq = self.get_widget('slideLED').get_value() freq = 256 - freq @@ -408,52 +151,149 @@ value = value * 2 tux.cmd.leds_blink(int(value), int(freq)) - - def on_btnEyesOpen_released(self, widget, *args): + def on_chkLEDRight_toggled(self, widget, *args): + ''' + When the check box is toggled, the LED will be switched off/on. + This trig a LED event, which will toggle the checkbox, which + will trig a LED event, etc ... + + To prevent this bug, a global flag is used to indicate that the + LED has been toggled by an event, and not by the user. + ''' + global __led_toggled_by_event + if __led_toggled_by_event: + return + if widget.get_active(): + tux.cmd.ledr_on() + thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_on)) + else: + tux.cmd.ledr_off() + thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_off)) + +## chkLEDLeft + def on_chkLEDLeft_toggled(self, widget, *args): + global __led_toggled_by_event + if __led_toggled_by_event: + return + + if widget.get_active(): + tux.cmd.ledl_on() + thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_on)) + else: + tux.cmd.ledl_off() + thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_off)) + + def on_right_led_on(self): + global __led_toggled_by_event + __led_toggled_by_event = True + self.get_widget('chkLEDLeft').set_active(True) thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_on)) + + __led_toggled_by_event = False + + def on_right_led_off(self): + global __led_toggled_by_event + __led_toggled_by_event = True + self.get_widget('chkLEDLeft').set_active(False) + thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_off)) + + __led_toggled_by_event = False + + def on_left_led_on(self): + global __led_toggled_by_event + __led_toggled_by_event = True + self.get_widget('chkLEDRight').set_active(True) + thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_on)) + + __led_toggled_by_event = False + + def on_left_led_off(self): + global __led_toggled_by_event + __led_toggled_by_event = True + self.get_widget('chkLEDRight').set_active(False) + thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_off)) + + __led_toggled_by_event = False + + +############################################################################### +# +# Eyes part +# +############################################################################### + def on_btnEyesOpen_released(self, widget, *args): + #thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_on)) + if self.__eyes_active: + tux.cmd.eyes_off() + tux.sys.wait(0.2) self.__mouth_active = False + self.__eyes_active = False if tux.status.eyes_opened(): - thread.start_new_thread(self.refresh_picture, ('imgMouthRun', self.run)) - tux.cmd.eyes_open() + tux.cmd.eyes_open() def on_btnEyesClose_released(self, widget, *args): + if self.__eyes_active: + tux.cmd.eyes_off() + tux.sys.wait(0.2) self.__mouth_active = False + self.__eyes_active = False if tux.status.eyes_closed(): - thread.start_new_thread(self.refresh_picture, ('imgMouthRun', self.run)) - tux.cmd.eyes_close() + tux.cmd.eyes_close() def on_btnEyesRun_clicked(self, widget, *args): if self.__mouth_active: - tux.cmd.mouth_off() + tux.cmd.mouth_on(1) self.__mouth_active = False - self.__mouth_stop = True - self.__mouth_infinite = False - thread.start_new_thread(self.refresh_picture, ('imgMouthRun', self.run)) + thread.start_new_thread(self.refresh_picture, ('imgMouthRun', self.run)) if self.__eyes_active == False: self.__eyes_active = True thread.start_new_thread(self.refresh_picture, ('imgEyesRun', self.stop)) value = self.get_widget('spinEyes').get_value() value = value * 2 - if value == 0: - self.__eyes_infinite = True tux.cmd.eyes_on_free(int(value)) - tux.sys.looped_function(self.__update_eyes_buttons, 0.2) + if value != 0: + thread.start_new_thread(self.eyes_run, ()) else: tux.cmd.eyes_on(1) self.__eyes_active = False - self.__eyes_stop = True - self.__eyes_infinite = False thread.start_new_thread(self.refresh_picture, ('imgEyesRun', self.run)) + + def eyes_run(self): + tux.sys.wait(0.5) + while tux.status.eyes_counter() != 0 and self.__eyes_active: + tux.sys.wait(0.5) + self.get_widget('imgEyesRun').set_from_pixbuf(self.run) + self.__eyes_active = False + def on_eyes_close(self): + thread.start_new_thread(self.refresh_picture, ('imgLed', self.eyes_close)) + + def on_eyes_open(self): + tux.status.lled() + tux.status.rled() + +############################################################################### +# +# Mouth part +# +############################################################################### def on_btnMouthClose_released(self, widget, *args): + if self.__mouth_active: + tux.cmd.mouth_off() + tux.sys.wait(0.2) + self.__mouth_active = False self.__eyes_active = False if tux.status.mouth_closed(): thread.start_new_thread(self.refresh_picture, ('imgEyesRun', self.run)) tux.cmd.mouth_close() def on_btnMouthOpen_released(self, widget, *args): + if self.__mouth_active: + tux.cmd.mouth_off() + tux.sys.wait(0.2) + self.__mouth_active = False self.__eyes_active = False if tux.status.mouth_opened(): thread.start_new_thread(self.refresh_picture, ('imgEyesRun', self.run)) @@ -461,10 +301,8 @@ def on_btnMouthRun_clicked(self, widget, *args): if self.__eyes_active: - tux.cmd.eyes_off() + tux.cmd.eyes_on(1) self.__eyes_active = False - self.__eyes_stop = True - self.__eyes_infinite = False thread.start_new_thread(self.refresh_picture, ('imgEyesRun', self.run)) if self.__mouth_active == False: @@ -472,47 +310,83 @@ thread.start_new_thread(self.refresh_picture, ('imgMouthRun', self.stop)) value = self.get_widget('spinMouth').get_value() value = value * 2 - if value == 0: - self.__mouth_infinite = True tux.cmd.mouth_on_free(int(value)) - tux.sys.looped_function(self.__update_mouth_buttons, 0.2) + if value != 0: + thread.start_new_thread(self.mouth_run, ()) else: tux.cmd.mouth_on(1) self.__mouth_active = False - self.__mouth_stop = True - self.__mouth_infinite = False thread.start_new_thread(self.refresh_picture, ('imgMouthRun', self.run)) + + def mouth_run(self): + tux.sys.wait(0.5) + while tux.status.mouth_counter() != 0 and self.__mouth_active: + tux.sys.wait(0.5) + + self.get_widget('imgMouthRun').set_from_pixbuf(self.run) + self.__mouth_active = False + + def on_mouth_open(self): + thread.start_new_thread(self.refresh_picture, ('imgMouth', self.beak_open)) + + def on_mouth_close(self): + thread.start_new_thread(self.refresh_picture, ('imgMouth', self.beak_closed)) + +############################################################################### +# +# Wings part +# +############################################################################### def on_btnWingsUp_released(self, widget, *args): + if self.__wings_active: + tux.cmd.wings_off() + tux.sys.wait(0.3) + self.__wings_active = False thread.start_new_thread(self.refresh_picture, ('imgWings', self.wings_up)) + thread.start_new_thread(self.refresh_picture, ('imgWingsRun', self.run)) tux.cmd.raw(0x39, 0, 0, 0) def on_btnWingsDown_released(self, widget, *args): + if self.__wings_active: + tux.cmd.wings_off() + tux.sys.wait(0.3) + self.__wings_active = False thread.start_new_thread(self.refresh_picture, ('imgWings', self.wings_down)) + thread.start_new_thread(self.refresh_picture, ('imgWingsRun', self.run)) tux.cmd.raw(0x3A, 0, 0, 0) def on_btnWingsRun_clicked(self, widget, *args): - if self.__wings_active == False: + if self.__wings_active == False:p self.__wings_active = True thread.start_new_thread(self.refresh_picture, ('imgWingsRun', self.stop)) value = self.get_widget('spinWings').get_value() value = value * 2 - if value == 0: - self.__wings_infinite = True freq = self.get_widget('slideWings').get_value() tux.cmd.wings_on_free(int(value), int(freq)) - tux.sys.looped_function(self.__update_wings_buttons, 0.2) + if value != 0: + thread.start_new_thread(self.wings_run, ()) else: tux.cmd.wings_on(1) self.__wings_active = False - self.__wings_stop = True - self.__wings_infinite = False thread.start_new_thread(self.refresh_picture, ('imgWingsRun', self.run)) - #tux.sys.wait(0.2) thread.start_new_thread(self.refresh_picture, ('imgWings', self.wings_down)) tux.cmd.raw(0x3A, 0, 0, 0) + + def wings_run(self): + tux.sys.wait(0.5) + while tux.status.wings_counter() != 0 and self.__wings_active: + tux.sys.wait(0.5) - + self.get_widget('imgWingsRun').set_from_pixbuf(self.run) + self.__wings_active = False + + +############################################################################### +# +# Spinning part +# +############################################################################### def on_btnSpinLeft_pressed(self, widget, *args): if tux.status.power_plug(): thread.start_new_thread(self.refresh_picture, ('imgSpin', self.spin_transfo)) @@ -539,15 +413,11 @@ if tux.status.power_plug(): thread.start_new_thread(self.refresh_picture, ('imgSpin', self.spin_transfo)) thread.start_new_thread(self.__wait2, ()) - return + if self.__spin_active == False: self.__spin_active = True - value = self.get_widget('spinSpin').get_value() - if value == 0: - self.__spin_infite = True - freq = self.get_widget('slideSpin').get_value() if self.get_widget('radSpinDirLeft').get_active(): tux.cmd.spinl_on_free(int(value), int(freq)) @@ -562,121 +432,24 @@ tux.cmd.spinl_off() tux.cmd.spinr_off() self.__spin_active = False - self.__spin_stop = True - self.__spin_infinite = False thread.start_new_thread(self.refresh_picture, ('imgSpinRun', self.run)) + thread.start_new_thread(self.refresh_picture, ('imgSpin', self.spin_off)) - -## chkLEDRight - def on_chkLEDRight_toggled(self, widget, *args): - ''' - When the check box is toggled, the LED will be switched off/on. - This trig a LED event, which will toggle the checkbox, which - will trig a LED event, etc ... - - To prevent this bug, a global flag is used to indicate that the - LED has been toggled by an event, and not by the user. - ''' - global __led_toggled_by_event - if __led_toggled_by_event: - return - if widget.get_active(): - tux.cmd.ledr_on() - thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_on)) - else: - tux.cmd.ledr_off() - thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_off)) - -## chkLEDLeft - def on_chkLEDLeft_toggled(self, widget, *args): - global __led_toggled_by_event - if __led_toggled_by_event: - return - - if widget.get_active(): - tux.cmd.ledl_on() - thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_on)) - else: - tux.cmd.ledl_off() - thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_off)) - - - def on_btnTTS_clicked(self, widget, *args): - textedit=self.get_widget('txtTTS') - buffer=textedit.get_buffer() - my_text=buffer.get_text(*buffer.get_bounds()) - tux.tts.speak_free(my_text) - - def on_btnTTSClear_clicked(self, widget, *args): - textedit=self.get_widget('txtTTS') - buffer=textedit.get_buffer() - buffer.set_text("") - - -#################################################################### -# -# Tux events functions -# -# These functions are trigged when an Tux event occurs. -# All of these functions are declared in the 'binding' function. -# -#################################################################### - def on_right_led_on(self): - global __led_toggled_by_event - __led_toggled_by_event = True - self.get_widget('chkLEDLeft').set_active(True) - thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_on)) - - __led_toggled_by_event = False - - def on_right_led_off(self): - global __led_toggled_by_event - __led_toggled_by_event = True - self.get_widget('chkLEDLeft').set_active(False) - thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_off)) - - __led_toggled_by_event = False - - def on_left_led_on(self): - global __led_toggled_by_event - __led_toggled_by_event = True - self.get_widget('chkLEDRight').set_active(True) - thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_on)) - - __led_toggled_by_event = False - - def on_left_led_off(self): - global __led_toggled_by_event - __led_toggled_by_event = True - self.get_widget('chkLEDRight').set_active(False) - thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_off)) - - __led_toggled_by_event = False - - def on_eyes_close(self): - thread.start_new_thread(self.refresh_picture, ('imgLed', self.eyes_close)) - - def on_eyes_open(self): - tux.status.lled() - tux.status.rled() - - def on_mouth_open(self): - thread.start_new_thread(self.refresh_picture, ('imgMouth', self.beak_open)) - - def on_mouth_close(self): - thread.start_new_thread(self.refresh_picture, ('imgMouth', self.beak_closed)) - def on_spin_stop(self): thread.start_new_thread(self.refresh_picture, ('imgSpin', self.spin_off)) self.__spin_active = False thread.start_new_thread(self.refresh_picture, ('imgSpinRun', self.run)) - - def refresh_picture(self, widget, picture): - self.get_widget(widget).set_from_pixbuf(picture) -#-------------------------------- -# Remote events -#-------------------------------- + def __wait2(self): + tux.sys.wait(2) + thread.start_new_thread(self.refresh_picture, ('imgSpin', self.spin_off)) + + +############################################################################### +# +# Remote control events +# +############################################################################### def on_key_up(self): tux.cmd.eyes_on(2) @@ -713,7 +486,13 @@ def on_key_yellow(self): self.on_btnSpinRun_clicked(None) - + + +############################################################################### +# +# Monitoring functions +# +############################################################################### def on_light_level(self, args): level = args[0]*256 + args[1] level = level / 1124.0 * 100.0 @@ -743,57 +522,273 @@ self.get_widget('lblSound').set_text('%.1f%s'%(val*100, '%')) self.get_widget('SoundLevel').set_fraction(val) - - def __update_eyes_buttons(self): - if _me.get_param('generalStop'): - return False - tux.sys.wait(0.4) - if self.__eyes_stop: - self.__eyes_stop = False - return False + +############################################################################### +# +# General GUI functions +# +############################################################################### + def update(self): + self.__eyes_active = False + self.__mouth_active = False + self.__wings_active = False + self.__spin_active = False + self.__spin_right = False + self.__spin_left = False + + _me.set_var('pitch', _me.get_param('pitch')) + _me.set_var('speaker', _me.get_param('speaker')) + + self.cb_voice = voice_cb.VoiceComboBoxAdd(tux, self.get_widget("comboboxentry1")) + self.cb_voice.set_spk(_me.get_var('speaker')) + self.get_widget('spinPitch').set_value(_me.get_param('pitch')) + + self.cb_voice.update() + self.cb_voice.set_spk(_me.get_param('speaker')) + + self.update_labels() + self.update_pix() + + tux.cmd.raw(0x31, 0, 0, 0) + self.update_status() + + self.binding() + tux.sys.wait(1) + + + + def on_window1_destroy(self, widget, *args): + _me.get_funct('on_standby')() + + def binding(self): + ''' + This function 'connect' some Tux's events with local functions. + See the tux.event help for more informations. + + The light, battery and audio monitoring are also initialized here. + ''' + ### Correct the leds inversion on the next daemon + tux.event.on_left_blue_led_on = self.on_left_led_on + tux.event.on_left_blue_led_off = self.on_left_led_off + tux.event.on_right_blue_led_on = self.on_right_led_on + tux.event.on_right_blue_led_off = self.on_right_led_off + tux.event.on_eyes_open = self.on_eyes_open + tux.event.on_eyes_close = self.on_eyes_close + tux.event.on_mouth_open = self.on_mouth_open + tux.event.on_mouth_close = self.on_mouth_close + tux.event.on_spin_stop = self.on_spin_stop + + tux.event.on_remote_bt[K_UP] = self.on_key_up #eyes + tux.event.on_remote_bt[K_DOWN] = self.on_key_down #wings + tux.event.on_remote_bt[K_OK] = self.on_key_ok #mouth + tux.event.on_remote_bt[K_LEFT] = self.on_key_left #spin right + tux.event.on_remote_bt[K_RIGHT] = self.on_key_right #spin left + tux.event.on_remote_bt[K_RED] = self.on_key_red #Run eyes + tux.event.on_remote_bt[K_GREEN] = self.on_key_green #Run mouth + tux.event.on_remote_bt[K_BLUE] = self.on_key_blue #Run wings + tux.event.on_remote_bt[K_YELLOW] = self.on_key_yellow #Run spinning + tux.event.on_remote_bt[K_STOP] = self.StopAll + + battery_idx = tux.monitoring.insert(0x25, self.on_battery_level) + + light_idx = tux.monitoring.insert(0x1B, self.on_light_level) + + tux.micro.on() + sound_idx = tux.monitoring.insert(0xF0, self.on_microphone_energy) + tux.sys.wait(0.1) + _me.set_param('batt', battery_idx) + _me.set_param('light', light_idx) + _me.set_param('sound', sound_idx) + + + def update_status(self): + ''' + This function update the status when the gadget is starting. + ''' + global __toggled_by_event + __led_toggled_by_event = True + if tux.status.lled(): + self.get_widget('chkLEDLeft').set_active(True) + else: + self.get_widget('chkLEDLeft').set_active(False) - if tux.status.eyes_counter() == 0 and self.__eyes_active == True and self.__eyes_infinite == False: - self.__eyes_active = False - thread.start_new_thread(self.refresh_picture, ('imgEyesRun', self.run)) - return False + if tux.status.rled(): + self.get_widget('chkLEDRight').set_active(True) + else: + self.get_widget('chkLEDRight').set_active(False) - return True + __led_toggled_by_event = False + + def update_pix(self): + self.path = _me.get_path('pictures')+'/Icons/' + self.get_widget('chkShow').set_active(True) + self.get_widget('chkShow').set_label(_me.string('chkShow')) + self.get_widget('imgLight').set_from_file(self.path+'light.png') + self.get_widget('imgBattery').set_from_file(self.path+'battery.png') + self.get_widget('imgSound').set_from_file(self.path+'microphone.png') - def __update_mouth_buttons(self): - if _me.get_param('generalStop'): - return False - - tux.sys.wait(0.4) + self.led_on = gtk.gdk.pixbuf_new_from_file(self.path+'led_on.png') + self.led_off = gtk.gdk.pixbuf_new_from_file(self.path+'led_off.png') + self.eyes_close = gtk.gdk.pixbuf_new_from_file(self.path+'eye_closed.png') + self.wings_down = gtk.gdk.pixbuf_new_from_file(self.path+'wings_down.png') + self.wings_up = gtk.gdk.pixbuf_new_from_file(self.path+'wings_up.png') + self.spin_left = gtk.gdk.pixbuf_new_from_file(self.path+'spin_left.png') + self.spin_right = gtk.gdk.pixbuf_new_from_file(self.path+'spin_right.png') + self.spin_off = gtk.gdk.pixbuf_new_from_file(self.path+'spin_off.png') + self.spin_transfo = gtk.gdk.pixbuf_new_from_file(self.path+'spin_off_charging.png') + self.beak_open = gtk.gdk.pixbuf_new_from_file(self.path+'beak_open.png') + self.beak_closed = gtk.gdk.pixbuf_new_from_file(self.path+'beak_closed.png') + self.up = gtk.gdk.pixbuf_new_from_file(self.path+'up.png') + self.down = gtk.gdk.pixbuf_new_from_file(self.path+'down.png') + self.right = gtk.gdk.pixbuf_new_from_file(self.path+'right.png') + self.left = gtk.gdk.pixbuf_new_from_file(self.path+'left.png') + self.run = gtk.gdk.pixbuf_new_from_file(self.path+'run.png') + self.stop = gtk.gdk.pixbuf_new_from_file(self.path+'gear-off.png') - if self.__mouth_stop: - self.__mouth_stop = False - return False + self.get_widget('imgLEDRun').set_from_pixbuf(self.run) + + self.get_widget('imgEyesOpen').set_from_pixbuf(self.up) + self.get_widget('imgEyesClose').set_from_pixbuf(self.down) + self.get_widget('imgEyesRun').set_from_pixbuf(self.run) + + self.get_widget('imgMouthClose').set_from_pixbuf(self.up) + self.get_widget('imgMouthOpen').set_from_pixbuf(self.down) + self.get_widget('imgMouthRun').set_from_pixbuf(self.run) + + self.get_widget('imgWingsUp').set_from_pixbuf(self.up) + self.get_widget('imgWingsDown').set_from_pixbuf(self.down) + self.get_widget('imgWingsRun').set_from_pixbuf(self.run) + + self.get_widget('imgSpinLeft').set_from_pixbuf(self.left) + self.get_widget('imgSpinRight').set_from_pixbuf(self.right) + self.get_widget('imgSpinRun').set_from_pixbuf(self.run) + + self.get_widget('imgStopAll').set_from_pixbuf(self.stop) + self.show_tab() + + if tux.status.rled(): + self.get_widget('imgLed').set_from_pixbuf(self.led_on) + else: + self.get_widget('imgLed').set_from_pixbuf(self.led_off) - if tux.status.mouth_counter() == 0 and self.__mouth_active == True and self.__mouth_infinite == False: - self.__mouth_active = False - thread.start_new_thread(self.refresh_picture, ('imgMouthRun', self.run)) - return False + if tux.status.eyes_closed() == 0: + self.get_widget('imgLed').set_from_pixbuf(self.eyes_close) - return True + if tux.status.mouth_closed() == 0: + self.get_widget('imgMouth').set_from_pixbuf(self.beak_closed) + else: + self.get_widget('imgMouth').set_from_pixbuf(self.beak_open) + self.get_widget('imgWings').set_from_pixbuf(self.wings_down) + + self.get_widget('imgSpin').set_from_pixbuf(self.spin_off) - def __update_wings_buttons(self): - if _me.get_param('generalStop'): - return False - tux.sys.wait(0.4) - if self.__wings_stop: - self.__wings_stop = False - return False + def create_tooltips(self): + self.get_widget('imgLEDRun').set_tooltip_text(_me.string('toolLEDRun')) + self.get_widget('slideLED').set_tooltip_text(_me.string('toolLEDslide')) + self.get_widget('spinLED').set_tooltip_text(_me.string('toolLEDspin')) + + self.get_widget('imgEyesRun').set_tooltip_text(_me.string('toolEyesRun')) + self.get_widget('spinEyes').set_tooltip_text(_me.string('toolMove')) + + self.get_widget('imgMouthRun').set_tooltip_text(_me.string('toolMouthRun')) + self.get_widget('spinMouth').set_tooltip_text(_me.string('toolMove')) + + self.get_widget('imgWingsRun').set_tooltip_text(_me.string('toolWingsRun')) + self.get_widget('spinWings').set_tooltip_text(_me.string('toolMove')) + self.get_widget('slideWings').set_tooltip_text(_me.string('toolPWM')) + + self.get_widget('imgSpinRun').set_tooltip_text(_me.string('toolSpinRun')) + self.get_widget('spinSpin').set_tooltip_text(_me.string('toolMove')) + self.get_widget('slideSpin').set_tooltip_text(_me.string('toolPWM')) + self.get_widget('radSpinDirLeft').set_tooltip_text(_me.string('toolSpinDir')) + self.get_widget('radSpinDirRight').set_tooltip_text(_me.string('toolSpinDir')) + + self.get_widget('imgStopAll').set_tooltip_text(_me.string('toolStopAll')) + + self.get_widget('chkShow').set_tooltip_text(_me.string('toolAdvanced')) + + self.get_widget('chkLEDRight').set_tooltip_text(_me.string('toolLEDRight')) + self.get_widget('chkLEDLeft').set_tooltip_text(_me.string('toolLEDLeft')) + + self.get_widget('btnEyesOpen').set_tooltip_text(_me.string('toolEyesOpen')) + self.get_widget('btnEyesClose').set_tooltip_text(_me.string('toolEyesClose')) + + self.get_widget('btnMouthOpen').set_tooltip_text(_me.string('toolMouthOpen')) + self.get_widget('btnMouthClose').set_tooltip_text(_me.string('toolMouthClose')) + + self.get_widget('btnWingsUp').set_tooltip_text(_me.string('toolWingsUp')) + self.get_widget('btnWingsDown').set_tooltip_text(_me.string('toolWingsDown')) + + self.get_widget('btnSpinRight').set_tooltip_text(_me.string('toolSpinRight')) + self.get_widget('btnSpinLeft').set_tooltip_text(_me.string('toolSpinLeft')) + + self.get_widget('imgLight').set_tooltip_text(_me.string('toolLight')) + self.get_widget('imgBattery').set_tooltip_text(_me.string('toolBattery')) + self.get_widget('imgSound').set_tooltip_text(_me.string('toolSound')) + + self.get_widget('comboboxentry1').set_tooltip_text(_me.string('toolLang')) + self.get_widget('spinPitch').set_tooltip_text(_me.string('toolPitch')) + + self.get_widget('btnTTS').set_tooltip_text(_me.string('toolTTS')) + self.get_widget('btnTTSClear').set_tooltip_text(_me.string('toolTTSClear')) + self.get_widget('scrolledwindow1').set_tooltip_text(_me.string('toolTTSText')) + + + def hide_tab(self): + self.get_widget('fix1').hide() + self.get_widget('fix1').set_size_request(2,0) + self.get_widget('fix2').hide() + self.get_widget('fix2').set_size_request(2,0) + self.get_widget('fix3').hide() + self.get_widget('fix3').set_size_request(2,0) + self.get_widget('fix4').hide() + self.get_widget('fix4').set_size_request(2,0) + self.get_widget('fix5').hide() + self.get_widget('fix5').set_size_request(2,0) + self.get_widget('fix6').hide() + self.get_widget('fix6').set_size_request(2,0) + self.get_widget('fix7').hide() + self.get_widget('fix7').set_size_request(2,0) + + def show_tab(self): + self.get_widget('fix1').show() + self.get_widget('fix1').set_size_request(330,0) + self.get_widget('fix2').show() + self.get_widget('fix2').set_size_request(330,0) + self.get_widget('fix3').show() + self.get_widget('fix3').set_size_request(330,0) + self.get_widget('fix4').show() + self.get_widget('fix4').set_size_request(330,0) + self.get_widget('fix5').show() + self.get_widget('fix5').set_size_request(330,0) + self.get_widget('fix6').show() + self.get_widget('fix6').set_size_request(330,0) + self.get_widget('fix7').show() + self.get_widget('fix7').set_size_request(330,0) + - if tux.status.wings_counter() == 0 and self.__wings_active == True and self.__wings_infinite == False: - self.__wings_active = False - thread.start_new_thread(self.refresh_picture, ('imgWingsRun', self.run)) - return False - - return True - - def __wait2(self): - tux.sys.wait(2) - thread.start_new_thread(self.refresh_picture, ('imgSpin', self.spin_off)) + def update_labels(self): + self.get_widget('btnTTS').set_label(_me.string('TTS')) + self.get_widget('btnTTSClear').set_label(_me.string('TTSClear')) + self.get_widget('lblTTS').set_label(_me.string('lblTTS')) + + self.get_widget('lblStop').set_label(_me.string('lblStop')) + + self.get_widget('lblLED').set_label(_me.string('lblLED')) + self.get_widget('lblEyes').set_label(_me.string('lblEyes')) + self.get_widget('lblMouth').set_label(_me.string('lblMouth')) + self.get_widget('lblWings').set_label(_me.string('lblWings')) + self.get_widget('lblSpin').set_label(_me.string('lblSpin')) + self.get_widget('lblConf').set_label(_me.string('lblConf')) + self.get_widget('lblTTSConf').set_label(_me.string('lblTTSConf')) + self.get_widget('lblPitch').set_label(_me.string('lblPitch')) + + self.get_widget('lblFrequency').set_label(_me.string('lblFrequency')) + self.get_widget('lblWingsPWM').set_label(_me.string('lblPWM')) + self.get_widget('lblSpinPWM').set_label(_me.string('lblPWM')) + + self.get_widget('radSpinDirLeft').set_label(_me.string('radSpinDirLeft')) + self.get_widget('radSpinDirRight').set_label(_me.string('radSpinDirRight')) Modified: software/gadgets/tux_controller/trunk/TuxController.tgf =================================================================== (Binary files differ) |
From: jaguarondi <c2m...@c2...> - 2008-01-21 15:37:49
|
Author: jaguarondi Date: 2008-01-21 16:37:48 +0100 (Mon, 21 Jan 2008) New Revision: 863 Modified: firmware/tuxaudio/trunk/Makefile firmware/tuxcore/trunk/Makefile Log: * Removed unnecessary stuff from the Makefile. Modified: firmware/tuxaudio/trunk/Makefile =================================================================== --- firmware/tuxaudio/trunk/Makefile 2008-01-21 13:20:51 UTC (rev 862) +++ firmware/tuxaudio/trunk/Makefile 2008-01-21 15:37:48 UTC (rev 863) @@ -38,11 +38,7 @@ CINCS = # Compile options common for all C compilation units. -ifdef windir -CDEBUG = -gdwarf-2 -else CDEBUG = -g -endif CWARN = -Wall -Wstrict-prototypes CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums CFLAGS = $(COMMON) $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) $(CSTANDARD) $(CEXTRA) @@ -136,29 +132,17 @@ size: ${TARGET} @echo -ifdef windir - @avr-size -C --mcu=${MCU} ${TARGET} -else @avr-size ${TARGET} -endif bl_size: ${BOOTLOADER} @echo -ifdef windir - @avr-size -C --mcu=${MCU} ${BOOTLOADER} -else @avr-size ${BOOTLOADER} -endif ## Generate SVN info # We need to change the status each time a file changes, thus so many # dependencies svnrev.h: $(CSOURCE) $(HEADERS) -ifdef windir - SubWCRev . svnrev.tmpl.h svnrev.h -else svnwcrev . svnrev.tmpl.h svnrev.h -endif ## Clean target .PHONY: clean @@ -169,16 +153,6 @@ ## Other dependencies -include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*) -## Generate doxygen documentation -.PHONY: doc -doc: svnrev.h -ifdef windir - # XXX add windows version -else - @./doc/builddoc.sh -endif - - # Programming prog: $(PROJECT).hex tuxup $(PROJECT).hex $(PROJECT).eep Modified: firmware/tuxcore/trunk/Makefile =================================================================== --- firmware/tuxcore/trunk/Makefile 2008-01-21 13:20:51 UTC (rev 862) +++ firmware/tuxcore/trunk/Makefile 2008-01-21 15:37:48 UTC (rev 863) @@ -55,11 +55,7 @@ CINCS = # Compile options common for all C compilation units. -ifdef windir -CDEBUG = -gdwarf-2 -else CDEBUG = -g -endif CWARN = -Wall -Wstrict-prototypes CTUNING = -funsigned-char -funsigned-bitfields -fpack-struct -fshort-enums CFLAGS = $(COMMON) $(CDEBUG) $(CDEFS) $(CINCS) -O$(OPT) $(CWARN) \ @@ -144,12 +140,7 @@ # We need to change the status each time a file changes, thus so many # dependencies svnrev.h: $(CSOURCE) $(HEADERS) - -ifdef windir - SubWCRev . svnrev.tmpl.h svnrev.h -else svnwcrev . svnrev.tmpl.h svnrev.h -endif ##Link $(TARGET): $(OBJECTS) @@ -170,19 +161,11 @@ size: ${TARGET} @echo -ifdef windir - @avr-size -C --mcu=${MCU} ${TARGET} -else @avr-size ${TARGET} -endif bl_size: ${BOOTLOADER} @echo -ifdef windir - @avr-size -C --mcu=${MCU} ${BOOTLOADER} -else @avr-size ${BOOTLOADER} -endif ## Clean target .PHONY: clean @@ -195,15 +178,6 @@ ## Other dependencies -include $(shell mkdir dep 2>/dev/null) $(wildcard dep/*) -## Generate doxygen documentation -.PHONY: doc -doc: svnrev.h -ifdef windir - # XXX add windows version -else - @./doc/builddoc.sh -endif - # Programming prog: $(PROJECT).hex tuxup $(PROJECT).hex $(PROJECT).eep |
From: Paul_R <c2m...@c2...> - 2008-01-21 13:21:03
|
Author: Paul_R Date: 2008-01-21 14:20:51 +0100 (Mon, 21 Jan 2008) New Revision: 862 Modified: software/gadgets/micro_monitor/trunk/micro_monitor.tgf software/gadgets/micro_monitor/trunk/micro_monitor/about.xml Log: * Versionning : 0.0.3 --> 0.0.2 Modified: software/gadgets/micro_monitor/trunk/micro_monitor/about.xml =================================================================== --- software/gadgets/micro_monitor/trunk/micro_monitor/about.xml 2008-01-21 12:07:35 UTC (rev 861) +++ software/gadgets/micro_monitor/trunk/micro_monitor/about.xml 2008-01-21 13:20:51 UTC (rev 862) @@ -4,5 +4,5 @@ <gadget_description type='str'> </gadget_description> <gadget_name type='str'>micro_monitor</gadget_name> - <gadget_version type='str'>0.0.3</gadget_version> + <gadget_version type='str'>0.0.2</gadget_version> </about> Modified: software/gadgets/micro_monitor/trunk/micro_monitor.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2008-01-21 12:07:39
|
Author: Paul_R Date: 2008-01-21 13:07:35 +0100 (Mon, 21 Jan 2008) New Revision: 861 Modified: software/gadgets/tux_controller/trunk/TuxController.tgf software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/main.pyp software/gadgets/tux_controller/trunk/TuxController/about.xml software/gadgets/tux_controller/trunk/TuxController/settings.xml Log: * Fixed some bug with the graphics's refreshing functions. * Inc. the version Modified: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp 2008-01-21 11:22:16 UTC (rev 860) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/GUI/widget/other.pyp 2008-01-21 12:07:35 UTC (rev 861) @@ -411,10 +411,15 @@ def on_btnEyesOpen_released(self, widget, *args): thread.start_new_thread(self.refresh_picture, ('imgLed', self.led_on)) - #self.get_widget('imgLed').set_from_pixbuf(self.led_on) + self.__mouth_active = False + if tux.status.eyes_opened(): + thread.start_new_thread(self.refresh_picture, ('imgMouthRun', self.run)) tux.cmd.eyes_open() - def on_btnEyesClose_released(self, widget, *args): + def on_btnEyesClose_released(self, widget, *args): + self.__mouth_active = False + if tux.status.eyes_closed(): + thread.start_new_thread(self.refresh_picture, ('imgMouthRun', self.run)) tux.cmd.eyes_close() def on_btnEyesRun_clicked(self, widget, *args): @@ -443,9 +448,15 @@ def on_btnMouthClose_released(self, widget, *args): + self.__eyes_active = False + if tux.status.mouth_closed(): + thread.start_new_thread(self.refresh_picture, ('imgEyesRun', self.run)) tux.cmd.mouth_close() def on_btnMouthOpen_released(self, widget, *args): + self.__eyes_active = False + if tux.status.mouth_opened(): + thread.start_new_thread(self.refresh_picture, ('imgEyesRun', self.run)) tux.cmd.mouth_open() def on_btnMouthRun_clicked(self, widget, *args): @@ -645,12 +656,10 @@ def on_eyes_close(self): thread.start_new_thread(self.refresh_picture, ('imgLed', self.eyes_close)) - def on_eyes_open(self): tux.status.lled() tux.status.rled() - def on_mouth_open(self): thread.start_new_thread(self.refresh_picture, ('imgMouth', self.beak_open)) @@ -738,7 +747,7 @@ def __update_eyes_buttons(self): if _me.get_param('generalStop'): return False - tux.sys.wait(0.2) + tux.sys.wait(0.4) if self.__eyes_stop: self.__eyes_stop = False return False @@ -746,7 +755,6 @@ if tux.status.eyes_counter() == 0 and self.__eyes_active == True and self.__eyes_infinite == False: self.__eyes_active = False thread.start_new_thread(self.refresh_picture, ('imgEyesRun', self.run)) - #self.get_widget('imgEyesRun').set_from_pixbuf(self.run) return False return True @@ -755,7 +763,9 @@ def __update_mouth_buttons(self): if _me.get_param('generalStop'): return False - tux.sys.wait(0.2) + + tux.sys.wait(0.4) + if self.__mouth_stop: self.__mouth_stop = False return False @@ -763,16 +773,15 @@ if tux.status.mouth_counter() == 0 and self.__mouth_active == True and self.__mouth_infinite == False: self.__mouth_active = False thread.start_new_thread(self.refresh_picture, ('imgMouthRun', self.run)) - #self.get_widget('imgMouthRun').set_from_pixbuf(self.run) return False - + return True def __update_wings_buttons(self): if _me.get_param('generalStop'): return False - tux.sys.wait(0.2) + tux.sys.wait(0.4) if self.__wings_stop: self.__wings_stop = False return False @@ -780,7 +789,6 @@ if tux.status.wings_counter() == 0 and self.__wings_active == True and self.__wings_infinite == False: self.__wings_active = False thread.start_new_thread(self.refresh_picture, ('imgWingsRun', self.run)) - #self.get_widget('imgWingsRun').set_from_pixbuf(self.run) return False return True Modified: software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/main.pyp =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/main.pyp 2008-01-21 11:22:16 UTC (rev 860) +++ software/gadgets/tux_controller/trunk/TuxController/Scripts/Python/main.pyp 2008-01-21 12:07:35 UTC (rev 861) @@ -41,8 +41,6 @@ _me.gui('widget').hide_from_main() _me.exit_main_loop() - - def start_gadget(): tux.event.on_remote_bt[K_STANDBY] = on_standby Modified: software/gadgets/tux_controller/trunk/TuxController/about.xml =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/about.xml 2008-01-21 11:22:16 UTC (rev 860) +++ software/gadgets/tux_controller/trunk/TuxController/about.xml 2008-01-21 12:07:35 UTC (rev 861) @@ -1,7 +1,8 @@ <?xml version='1.0' encoding='UTF-8'?> <about> <gadget_author type='str'>Paul Rathgeb</gadget_author> - <gadget_description type='str'>Empty gadget for Tux Droid.</gadget_description> + <gadget_description type='str'> + </gadget_description> <gadget_name type='str'>tux_controller</gadget_name> - <gadget_version type='str'>0.1.0</gadget_version> + <gadget_version type='str'>0.1.1</gadget_version> </about> Modified: software/gadgets/tux_controller/trunk/TuxController/settings.xml =================================================================== --- software/gadgets/tux_controller/trunk/TuxController/settings.xml 2008-01-21 11:22:16 UTC (rev 860) +++ software/gadgets/tux_controller/trunk/TuxController/settings.xml 2008-01-21 12:07:35 UTC (rev 861) @@ -8,8 +8,6 @@ </conf> <widget> <visible type='bool'>True</visible> - <x type='int'>295</x> - <y type='int'>160</y> </widget> </gui_state> <have_main_part type='bool'>True</have_main_part> @@ -21,12 +19,12 @@ <notified type='bool'>False</notified> <notify_delay type='int'>60</notify_delay> <notify_priority type='int'>4</notify_priority> - <pitch type='int'>100</pitch> + <pitch type='float'>100.0</pitch> <speaker type='int'>3</speaker> </general> <parameters> <hidden_in_manager type='bool'>False</hidden_in_manager> - <pitch type='int'>100</pitch> + <pitch type='float'>100.0</pitch> <speaker type='int'>3</speaker> </parameters> </settings> Modified: software/gadgets/tux_controller/trunk/TuxController.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2008-01-21 11:22:14
|
Author: Paul_R Date: 2008-01-21 12:22:16 +0100 (Mon, 21 Jan 2008) New Revision: 860 Modified: software/gadgets/micro_monitor/trunk/micro_monitor.tgf software/gadgets/micro_monitor/trunk/micro_monitor/about.xml Log: * Increment the version number Modified: software/gadgets/micro_monitor/trunk/micro_monitor/about.xml =================================================================== --- software/gadgets/micro_monitor/trunk/micro_monitor/about.xml 2008-01-21 11:19:43 UTC (rev 859) +++ software/gadgets/micro_monitor/trunk/micro_monitor/about.xml 2008-01-21 11:22:16 UTC (rev 860) @@ -4,5 +4,5 @@ <gadget_description type='str'> </gadget_description> <gadget_name type='str'>micro_monitor</gadget_name> - <gadget_version type='str'>0.0.2</gadget_version> + <gadget_version type='str'>0.0.3</gadget_version> </about> Modified: software/gadgets/micro_monitor/trunk/micro_monitor.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2008-01-21 11:19:52
|
Author: Paul_R Date: 2008-01-21 12:19:43 +0100 (Mon, 21 Jan 2008) New Revision: 859 Modified: software/gadgets/micro_monitor/trunk/micro_monitor.tgf software/gadgets/micro_monitor/trunk/micro_monitor/Scripts/Python/notify.pyp Log: * Corrected an error in my last commit ... Modified: software/gadgets/micro_monitor/trunk/micro_monitor/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/micro_monitor/trunk/micro_monitor/Scripts/Python/notify.pyp 2008-01-21 11:14:11 UTC (rev 858) +++ software/gadgets/micro_monitor/trunk/micro_monitor/Scripts/Python/notify.pyp 2008-01-21 11:19:43 UTC (rev 859) @@ -19,10 +19,10 @@ for i in range(5): tux.cmd.sound_play(14) try: - while tux.status.sound_play()[1] != 0 or timeout < time.time(): + while tux.status.sound_play()[1] != 0 and timeout < time.time(): tux.sys.wait(0.1) except: - while tux.status.flash_status()[0] != 0 or timeout < time.time(): + while tux.status.flash_status()[0] != 0 and timeout < time.time(): tux.sys.wait(0.1) tux.sys.wait(1) else: Modified: software/gadgets/micro_monitor/trunk/micro_monitor.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2008-01-21 11:14:18
|
Author: Paul_R Date: 2008-01-21 12:14:11 +0100 (Mon, 21 Jan 2008) New Revision: 858 Modified: software/gadgets/micro_monitor/trunk/micro_monitor.tgf software/gadgets/micro_monitor/trunk/micro_monitor/Scripts/Python/GUI/widget/other.pyp software/gadgets/micro_monitor/trunk/micro_monitor/Scripts/Python/notify.pyp software/gadgets/micro_monitor/trunk/micro_monitor/about.xml Log: * Fixed some bug with the notifications functions. Sometimes, the notification's actuator don't quit... But I don't know why. I've added a timeout to quit the actuator after 15s. I've also reviewed the functions which determine if the threshold has been reached, etc... * Increased the recording time. Now, the level must be under the threshold for 2 seconds before the recording stops. Modified: software/gadgets/micro_monitor/trunk/micro_monitor/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/micro_monitor/trunk/micro_monitor/Scripts/Python/GUI/widget/other.pyp 2008-01-18 15:53:27 UTC (rev 857) +++ software/gadgets/micro_monitor/trunk/micro_monitor/Scripts/Python/GUI/widget/other.pyp 2008-01-21 11:14:11 UTC (rev 858) @@ -410,6 +410,7 @@ self.__time = '' self.__duration = 0.0 self.__start_flag = False + self.TIMEOUT = 2 ########################################################### @@ -426,18 +427,25 @@ self.__timer = time.time() + 0.5 self.__notify = True self.actuator = True - + ## if no notification is running ... if self.__notify: val_act = ((self.val_table_pos[len(self.val_table_pos)-1])*100) / (self.RANGE/2) - if val_act < self.threshold and self.__dog_stop == False: - self.__timer = time.time() + 0.1 + ## Only verify these values if the spy mode is enabled + if self.spy_enabled: + if val_act < self.threshold and self.__dog_stop == False: + self.__timer = time.time() + self.TIMEOUT + self.__dog_stop = True + elif val_act > self.threshold and self.__dog_stop == True: + self.__dog_stop = False + ##else __dog_stop = True + else: self.__dog_stop = True - elif val_act > self.threshold and self.__dog_stop == True: - self.__dog_stop = False - + + if self.__timer <= time.time() and self.__dog_stop: - self.__notify = False - self.notify = True + if _me.get_var('notified') == True: + self.__notify = False + self.notify = True if self.__start_timeout: if self.__start_delay < time.time(): @@ -508,7 +516,7 @@ val_act = ((self.val_table_pos[len(self.val_table_pos)-1])*100) / (self.RANGE/2) if val_act < self.threshold and self.__stop == False: - self.__delay_to_stop = time.time() + 0.1 + self.__delay_to_stop = time.time() + self.TIMEOUT self.__stop = True elif val_act > self.threshold and self.__stop: self.__stop = False Modified: software/gadgets/micro_monitor/trunk/micro_monitor/Scripts/Python/notify.pyp =================================================================== --- software/gadgets/micro_monitor/trunk/micro_monitor/Scripts/Python/notify.pyp 2008-01-18 15:53:27 UTC (rev 857) +++ software/gadgets/micro_monitor/trunk/micro_monitor/Scripts/Python/notify.pyp 2008-01-21 11:14:11 UTC (rev 858) @@ -1,3 +1,5 @@ +import time + def notify_checker(): if _me.get_param('measure'): measure = _me.get_param('measure') @@ -10,18 +12,19 @@ return False def notify_actuator(): + timeout = time.time() + 15 measure = _me.get_param('measure') if _me.get_param('chkDogDefault') == False: tux.cmd.wings_on_free(8) for i in range(5): tux.cmd.sound_play(14) try: - while tux.status.sound_play()[1] != 0: + while tux.status.sound_play()[1] != 0 or timeout < time.time(): tux.sys.wait(0.1) except: - while tux.status.flash_status()[0] != 0: + while tux.status.flash_status()[0] != 0 or timeout < time.time(): tux.sys.wait(0.1) - tux.sys.wait(1) + tux.sys.wait(1) else: path = _me.get_param('dogBehavior') path = path.replace('%20', ' ') Modified: software/gadgets/micro_monitor/trunk/micro_monitor/about.xml =================================================================== --- software/gadgets/micro_monitor/trunk/micro_monitor/about.xml 2008-01-18 15:53:27 UTC (rev 857) +++ software/gadgets/micro_monitor/trunk/micro_monitor/about.xml 2008-01-21 11:14:11 UTC (rev 858) @@ -4,5 +4,5 @@ <gadget_description type='str'> </gadget_description> <gadget_name type='str'>micro_monitor</gadget_name> - <gadget_version type='str'>0.0.1</gadget_version> + <gadget_version type='str'>0.0.2</gadget_version> </about> Modified: software/gadgets/micro_monitor/trunk/micro_monitor.tgf =================================================================== (Binary files differ) |
From: Paul_R <c2m...@c2...> - 2008-01-18 15:53:28
|
Author: Paul_R Date: 2008-01-18 16:53:27 +0100 (Fri, 18 Jan 2008) New Revision: 857 Modified: software/gadgets/micro_monitor/trunk/micro_monitor.tgf Log: * Increment the version Modified: software/gadgets/micro_monitor/trunk/micro_monitor.tgf =================================================================== (Binary files differ) |