[tuxdroid-svn] r268 - svnlook: warning: cannot set LC_CTYPE locale svnlook: warning: environment va
Status: Beta
Brought to you by:
ks156
From: svnlook:warning@affinitic.be:cannot s. L. l. <c2m...@c2...> - 2007-04-20 12:17:56
|
Author: svnlook: warning: cannot set LC_CTYPE locale Date: svnlook: warning: environment variable LANG is EN New Revision: 268 Modified: software/gtdi/trunk/gtdi.py software/gtdi/trunk/gtdi2.glade Log: remi 2007-04-20 14:17:52 +0200 (Fri, 20 Apr 2007) 186 UPD GUI has been modified. (Un/)Pluging functionnality has been added. A function for restoring the original memory soundbank has been added. Realtime RF state has been added in the GUI svnlook: warning: cannot set LC_CTYPE locale svnlook: warning: environment variable LANG is EN svnlook: warning: please check that your locale name is correct Modified: software/gtdi/trunk/gtdi.py =================================================================== --- software/gtdi/trunk/gtdi.py 2007-04-20 11:56:28 UTC (rev 267) +++ software/gtdi/trunk/gtdi.py 2007-04-20 12:17:52 UTC (rev 268) @@ -163,11 +163,13 @@ def on_status(self): global status_list_st global status_list_changed - status_list_changed=True - status_list_st.append(tux.explicit_status()) - if len(status_list_st)==50: - for i in range(1): - status_list_st.pop(0) + explicite_status=tux.explicit_status() + if explicite_status.find("RF connected->") != 0: + status_list_changed=True + status_list_st.append(explicite_status) + if len(status_list_st)==50: + for i in range(1): + status_list_st.pop(0) #-------------------------------------------------------------------------- # Status viewer refreshing thread @@ -175,8 +177,11 @@ def status_viewer_thread(self): global status_list_st global status_list_changed + global onpause + global onplay last_tuxdaemon_connect=False last_tuxttsdaemon_connect=False + last_rf_state=False while True: if status_list_changed: status_list_changed=False @@ -193,6 +198,15 @@ if tux.daemon.connected!=last_tuxdaemon_connect: last_tuxdaemon_connect=tux.daemon.connected if tux.daemon.connected: + onpause=False + onplay=False + global toggled_by_event + toggled_by_event=True + global soundcard + tux.hw.alsa_devices_select(0) + soundcard = tux.hw.alsa_device + self.get_widget("togglebutton3").set_active(False) + toggled_by_event=False self.get_widget("image2").set_from_stock(gtk.STOCK_APPLY\ ,gtk.ICON_SIZE_BUTTON) self.on_mouth_stop() @@ -201,6 +215,7 @@ else: self.get_widget("image2").set_from_stock(gtk.STOCK_CANCEL\ ,gtk.ICON_SIZE_BUTTON) + tux.status.rf_connected = False if tux.tts.connected!=last_tuxttsdaemon_connect: last_tuxttsdaemon_connect=tux.tts.connected if tux.tts.connected: @@ -209,7 +224,15 @@ else: self.get_widget("image3").set_from_stock(gtk.STOCK_CANCEL\ ,gtk.ICON_SIZE_BUTTON) - tux.sys.wait(0.2) + if tux.status.rf_state()!=last_rf_state: + last_rf_state = tux.status.rf_connected + if last_rf_state: + self.get_widget("image4").set_from_stock(gtk.STOCK_APPLY\ + ,gtk.ICON_SIZE_BUTTON) + else: + self.get_widget("image4").set_from_stock(gtk.STOCK_CANCEL\ + ,gtk.ICON_SIZE_BUTTON) + tux.sys.wait(0.5) # ----------------------------------------------------------------------------- # Tab "main" events # ----------------------------------------------------------------------------- @@ -240,8 +263,11 @@ # On flash leds button clicked #-------------------------------------------------------------------------- def on_flash_bt_clicked(self, widget, *args): - num_sb=self.get_widget("spinbutton1") - tux.cmd.leds_blink(int(num_sb.get_value()),15) + def _funct(): + num_sb=self.get_widget("spinbutton1") + tux.cmd.leds_blink(int(num_sb.get_value()),15) + + thread.start_new_thread(_funct,()) #-------------------------------------------------------------------------- # On eyes open radiobutton toggled @@ -297,29 +323,35 @@ # On flippers up radiobutton toggled #-------------------------------------------------------------------------- def on_flippers_up_toggled(self, widget, *args): - global toggled_by_event - if toggled_by_event: return - if widget.get_active(): - tux.cmd.raw(0x31,0,0,0) - tux.event.wait_status(DATAS_STATUS_WINGS_POSITION_COUNTER,0,5) - tux.cmd.wings_on(1) + def _funct(): + global toggled_by_event + if toggled_by_event: return + if widget.get_active(): + tux.cmd.raw(0x31,0,0,0) + tux.event.wait_status(DATAS_STATUS_WINGS_POSITION_COUNTER,0,5) + tux.cmd.wings_on(1) + + thread.start_new_thread(_funct,()) #-------------------------------------------------------------------------- # On flippers down radiobutton toggled #-------------------------------------------------------------------------- def on_flippers_down_toggled(self, widget, *args): - global toggled_by_event - if toggled_by_event: return - if widget.get_active(): - tux.cmd.raw(0x31,0,0,0) - tux.event.wait_status(DATAS_STATUS_WINGS_POSITION_COUNTER,0,5) + def _funct(): + global toggled_by_event + if toggled_by_event: return + if widget.get_active(): + tux.cmd.raw(0x31,0,0,0) + tux.event.wait_status(DATAS_STATUS_WINGS_POSITION_COUNTER,0,5) + + thread.start_new_thread(_funct,()) #-------------------------------------------------------------------------- # On flippers flap button clicked #-------------------------------------------------------------------------- def on_flippers_flap_bt_clicked(self, widget, *args): num_sb=self.get_widget("spinbutton4") - tux.cmd.wings_on_free(int(num_sb.get_value())*2) + tux.cmd.wings_on_free(int(num_sb.get_value())) #-------------------------------------------------------------------------- # On rotation button clicked @@ -348,13 +380,13 @@ # On "Get light level" button clicked #-------------------------------------------------------------------------- def on_cversion_bt_clicked(self, widget, *args): - tux.status.get_light_level() + thread.start_new_thread(tux.status.get_light_level,()) #-------------------------------------------------------------------------- # On "Ping" button clicked #-------------------------------------------------------------------------- def on_ping_bt_clicked(self, widget, *args): - tux.cmd.ping(200) + thread.start_new_thread(tux.cmd.ping,(200,)) # ----------------------------------------------------------------------------- # Tab "TTS" events @@ -450,8 +482,30 @@ if str(self.get_widget("filechooserbutton1").get_filename())=="None": return tux.sys.shell_free("aplay -D %s %s"% (soundcard,\ self.get_widget("filechooserbutton1").get_filename())) - + #-------------------------------------------------------------------------- + # On select original sounds + #-------------------------------------------------------------------------- + def on_incl_orig_toggled(self, widget, *args): + st_wav_paths = wavs.wav_paths + if widget.get_active(): + wavs.wav_paths=[] + wavs.wav_sizes=[] + for i in range(9): + wavs.add_wav_path('/opt/tuxdroid/apps/gtdi/sounds/%d.wav'%(i+1)) + for path in st_wav_paths: + wavs.add_wav_path(path) + else: + if len(st_wav_paths) > 9: + for i in range(9): + wavs.wav_sizes.pop(0) + wavs.wav_paths.pop(0) + else: + wavs.wav_paths=[] + wavs.wav_sizes=[] + self.refresh_wav_list() + + #-------------------------------------------------------------------------- # On select internal wave file event #-------------------------------------------------------------------------- def on_wave_internal_changed(self, widget, *args): @@ -497,6 +551,7 @@ def on_wave_internal_clist_bt_clicked(self, widget, *args): wavs.wav_sizes=[] wavs.wav_paths=[] + self.get_widget("checkbutton4").set_active(False) self.refresh_wav_list() #-------------------------------------------------------------------------- @@ -509,6 +564,7 @@ # Store sound function #-------------------------------------------------------------------------- def sound_storing(self): + if tux.status.rf_state() == 0: return if len(wavs.wav_sizes)==0: return wav_te=self.get_widget("textview3") wav_buffer=wav_te.get_buffer() @@ -540,68 +596,71 @@ # On "play" flash sound button clicked #-------------------------------------------------------------------------- def on_wave_internal_play_bt_clicked(self, widget, *args): - index=self.get_widget("spinbutton7").get_value() - tux.cmd.sound_play(int(index),0) + def _funct(): + index=self.get_widget("spinbutton7").get_value() + tux.cmd.sound_play(int(index),0) + + thread.start_new_thread(_funct,()) #-------------------------------------------------------------------------- # On "play flash sound number 1" button clicked #-------------------------------------------------------------------------- def on_wave_internal_play1_clicked(self, widget, *args): - tux.cmd.sound_play(1,0) + thread.start_new_thread(tux.cmd.sound_play,(1,0,)) #-------------------------------------------------------------------------- # On "play flash sound number 2" button clicked #-------------------------------------------------------------------------- def on_wave_internal_play2_clicked(self, widget, *args): - tux.cmd.sound_play(2,0) + thread.start_new_thread(tux.cmd.sound_play,(2,0,)) #-------------------------------------------------------------------------- # On "play flash sound number 3" button clicked #-------------------------------------------------------------------------- def on_wave_internal_play3_clicked(self, widget, *args): - tux.cmd.sound_play(3,0) + thread.start_new_thread(tux.cmd.sound_play,(3,0,)) #-------------------------------------------------------------------------- # On "play flash sound number 4" button clicked #-------------------------------------------------------------------------- def on_wave_internat_play4_clicked(self, widget, *args): - tux.cmd.sound_play(4,0) + thread.start_new_thread(tux.cmd.sound_play,(4,0,)) #-------------------------------------------------------------------------- # On "play flash sound number 5" button clicked #-------------------------------------------------------------------------- def on_wave_internal_play5_clicked(self, widget, *args): - tux.cmd.sound_play(5,0) + thread.start_new_thread(tux.cmd.sound_play,(5,0,)) #-------------------------------------------------------------------------- # On "play flash sound number 6" button clicked #-------------------------------------------------------------------------- def on_wave_internal_play6_clicked(self, widget, *args): - tux.cmd.sound_play(6,0) + thread.start_new_thread(tux.cmd.sound_play,(6,0,)) #-------------------------------------------------------------------------- # On "play flash sound number 7" button clicked #-------------------------------------------------------------------------- def on_wave_internal_play7_clicked(self, widget, *args): - tux.cmd.sound_play(7,0) + thread.start_new_thread(tux.cmd.sound_play,(7,0,)) #-------------------------------------------------------------------------- # On "play flash sound number 8" button clicked #-------------------------------------------------------------------------- def on_wave_internal_play8_clicked(self, widget, *args): - tux.cmd.sound_play(8,0) + thread.start_new_thread(tux.cmd.sound_play,(8,0,)) #-------------------------------------------------------------------------- # On "play flash sound number 9" button clicked #-------------------------------------------------------------------------- def on_wave_internal_play9_clicked(self, widget, *args): - tux.cmd.sound_play(9,0) + thread.start_new_thread(tux.cmd.sound_play,(9,0,)) #-------------------------------------------------------------------------- # On "play flash sound number 10" button clicked #-------------------------------------------------------------------------- def on_wave_internal_play10_clicked(self, widget, *args): - tux.cmd.sound_play(10,0) + thread.start_new_thread(tux.cmd.sound_play,(10,0,)) #-------------------------------------------------------------------------- # On "Play recorded wave file" button clicked Modified: software/gtdi/trunk/gtdi2.glade =================================================================== --- software/gtdi/trunk/gtdi2.glade 2007-04-20 11:56:28 UTC (rev 267) +++ software/gtdi/trunk/gtdi2.glade 2007-04-20 12:17:52 UTC (rev 268) @@ -69,11 +69,29 @@ <property name="visible">True</property> <child> - <widget class="GtkLabel" id="label10"> - <property name="width_request">166</property> + <widget class="GtkImage" id="image2"> + <property name="width_request">21</property> + <property name="height_request">21</property> + <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="x">192</property> + <property name="y">0</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="label9"> + <property name="width_request">136</property> <property name="height_request">20</property> <property name="visible">True</property> - <property name="label" translatable="yes">Text To Speech Daemon</property> + <property name="label" translatable="yes">Tux Droid Daemon</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -90,34 +108,42 @@ </widget> <packing> <property name="x">0</property> - <property name="y">36</property> + <property name="y">0</property> </packing> </child> <child> - <widget class="GtkImage" id="image3"> - <property name="width_request">21</property> - <property name="height_request">21</property> + <widget class="GtkLabel" id="label27"> + <property name="width_request">166</property> + <property name="height_request">20</property> <property name="visible">True</property> - <property name="stock">gtk-cancel</property> - <property name="icon_size">4</property> + <property name="label" translatable="yes">RF state</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">192</property> - <property name="y">34</property> + <property name="x">0</property> + <property name="y">48</property> </packing> </child> <child> - <widget class="GtkImage" id="image2"> + <widget class="GtkImage" id="image3"> <property name="width_request">21</property> <property name="height_request">21</property> <property name="visible">True</property> - <property name="stock">gtk-apply</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> @@ -126,16 +152,16 @@ </widget> <packing> <property name="x">192</property> - <property name="y">0</property> + <property name="y">24</property> </packing> </child> <child> - <widget class="GtkLabel" id="label9"> - <property name="width_request">136</property> + <widget class="GtkLabel" id="label10"> + <property name="width_request">166</property> <property name="height_request">20</property> <property name="visible">True</property> - <property name="label" translatable="yes">Tux Droid Daemon</property> + <property name="label" translatable="yes">Text To Speech Daemon</property> <property name="use_underline">False</property> <property name="use_markup">False</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -152,9 +178,27 @@ </widget> <packing> <property name="x">0</property> - <property name="y">4</property> + <property name="y">24</property> </packing> </child> + + <child> + <widget class="GtkImage" id="image4"> + <property name="width_request">21</property> + <property name="height_request">21</property> + <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="x">192</property> + <property name="y">48</property> + </packing> + </child> </widget> </child> </widget> @@ -163,7 +207,7 @@ <child> <widget class="GtkLabel" id="label4"> <property name="visible">True</property> - <property name="label" translatable="yes"><b>Daemon status</b></property> + <property name="label" translatable="yes"><b>Tuxdroid status</b></property> <property name="use_underline">False</property> <property name="use_markup">True</property> <property name="justify">GTK_JUSTIFY_LEFT</property> @@ -587,7 +631,7 @@ <child> <widget class="GtkRadioButton" id="radiobutton1"> - <property name="width_request">56</property> + <property name="width_request">58</property> <property name="height_request">24</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -608,7 +652,7 @@ <child> <widget class="GtkRadioButton" id="radiobutton2"> - <property name="width_request">57</property> + <property name="width_request">59</property> <property name="height_request">24</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -648,7 +692,7 @@ <child> <widget class="GtkRadioButton" id="radiobutton3"> - <property name="width_request">56</property> + <property name="width_request">58</property> <property name="height_request">24</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -669,7 +713,7 @@ <child> <widget class="GtkRadioButton" id="radiobutton4"> - <property name="width_request">57</property> + <property name="width_request">59</property> <property name="height_request">24</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -709,7 +753,7 @@ <child> <widget class="GtkRadioButton" id="radiobutton5"> - <property name="width_request">41</property> + <property name="width_request">43</property> <property name="height_request">24</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -730,7 +774,7 @@ <child> <widget class="GtkRadioButton" id="radiobutton6"> - <property name="width_request">57</property> + <property name="width_request">60</property> <property name="height_request">24</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -770,7 +814,7 @@ <child> <widget class="GtkRadioButton" id="radiobutton8"> - <property name="width_request">61</property> + <property name="width_request">62</property> <property name="height_request">24</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -809,7 +853,7 @@ <child> <widget class="GtkRadioButton" id="radiobutton7"> - <property name="width_request">46</property> + <property name="width_request">48</property> <property name="height_request">24</property> <property name="visible">True</property> <property name="can_focus">True</property> @@ -1581,14 +1625,14 @@ <signal name="clicked" handler="on_wave_external_play_bt_clicked"/> </widget> <packing> - <property name="x">520</property> + <property name="x">289</property> <property name="y">1</property> </packing> </child> <child> <widget class="GtkFileChooserButton" id="filechooserbutton1"> - <property name="width_request">440</property> + <property name="width_request">200</property> <property name="height_request">27</property> <property name="visible">True</property> <property name="title" translatable="yes">Sélectionner un fichier</property> @@ -1810,6 +1854,27 @@ <property name="y">0</property> </packing> </child> + + <child> + <widget class="GtkCheckButton" id="checkbutton4"> + <property name="width_request">170</property> + <property name="height_request">27</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">include original</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> + <signal name="toggled" handler="on_incl_orig_toggled" last_modification_time="Mon, 16 Apr 2007 10:51:02 GMT"/> + </widget> + <packing> + <property name="x">476</property> + <property name="y">32</property> + </packing> + </child> </widget> </child> </widget> |