[tuxdroid-svn] r692 - in software/gadgets/settings/trunk: . settings settings/Pictures/Icons setti
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2007-11-13 08:57:03
|
Author: Paul_R Date: 2007-11-13 09:56:49 +0100 (Tue, 13 Nov 2007) New Revision: 692 Modified: software/gadgets/settings/trunk/settings.tgf software/gadgets/settings/trunk/settings/Pictures/Icons/gadget.png software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.glade software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml software/gadgets/settings/trunk/settings/about.xml software/gadgets/settings/trunk/settings/settings.xml software/gadgets/settings/trunk/settings/strings.xml Log: * Added the ID configuration frame (hidden for now) * Added a new class to display the Cchangelog and the firmwares descriptions. Modified: software/gadgets/settings/trunk/settings/Pictures/Icons/gadget.png =================================================================== (Binary files differ) Modified: software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.glade 2007-11-13 08:40:35 UTC (rev 691) +++ software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.glade 2007-11-13 08:56:49 UTC (rev 692) @@ -423,6 +423,168 @@ <child> <widget class="GtkFixed" id="fixed15"> <property name="visible">True</property> + + <child> + <widget class="GtkLabel" id="lblIDNum"> + <property name="width_request">144</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">label3</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="lblIDName"> + <property name="width_request">144</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">label4</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">37</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="txtIDNum"> + <property name="width_request">72</property> + <property name="height_request">24</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">168</property> + <property name="y">4</property> + </packing> + </child> + + <child> + <widget class="GtkEntry" id="txtIDName"> + <property name="width_request">72</property> + <property name="height_request">24</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">168</property> + <property name="y">32</property> + </packing> + </child> + + <child> + <widget class="GtkButton" id="btnID"> + <property name="width_request">160</property> + <property name="height_request">28</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="label" translatable="yes">button1</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_btnID_clicked" last_modification_time="Mon, 12 Nov 2007 11:35:46 GMT"/> + </widget> + <packing> + <property name="x">8</property> + <property name="y">64</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lblCurrentIDNum"> + <property name="width_request">224</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">label3</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">264</property> + <property name="y">8</property> + </packing> + </child> + + <child> + <widget class="GtkLabel" id="lblCurrentIDName"> + <property name="width_request">224</property> + <property name="height_request">17</property> + <property name="visible">True</property> + <property name="label" translatable="yes">label4</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">264</property> + <property name="y">36</property> + </packing> + </child> </widget> </child> </widget> @@ -1156,6 +1318,32 @@ <property name="y">32</property> </packing> </child> + + <child> + <widget class="GtkLabel" id="lblSoundState"> + <property name="width_request">360</property> + <property name="height_request">16</property> + <property name="visible">True</property> + <property name="label" translatable="yes">label5</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">184</property> + </packing> + </child> </widget> </child> </widget> Modified: software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp 2007-11-13 08:40:35 UTC (rev 691) +++ software/gadgets/settings/trunk/settings/Scripts/Python/GUI/widget/other.pyp 2007-11-13 08:56:49 UTC (rev 692) @@ -17,8 +17,18 @@ self.flag = True def new(self): + self.widget_window = True + _me.set_param('widget_window', True) self.get_widget("window1").set_title(_me.string('name_to_read')) thread.start_new_thread(self.update, ()) + + def on_window1_destroy(self, widget, *args): + self.widget_window = False + _me.set_param('widget_window', False) + +#------------------------------------------------------------ +# This function update all labels and create the GUI +#------------------------------------------------------------ def update(self): self.avoidedchannel = _me.get_param('AvoidChannel') @@ -34,7 +44,9 @@ self.VersionsLabelUpdate() self.SoundLabelUpdate() - +#------------------------------------------------------------ +# Config Tab labels +#------------------------------------------------------------ def ConfigLabelUpdate(self): #Frame labels self.get_widget('lblConfigWifi').set_text(_me.string('lblConfigWifi')) @@ -55,16 +67,30 @@ self.get_widget('lblSleepDelay').set_text(_me.string('lblSleepDelay')) self.get_widget('spinSleepDelay').set_text(str(_me.get_param('SleepDelay'))) + #Check if tux is sleeping ... txt = _me.string('lblSleepStateWork') self.get_widget('lblSleepState').set_text(txt) self.get_widget('btnSleep').set_label(_me.string('btnSleepSleep')) self.get_widget('progressbar2').hide() + # ID labels + self.get_widget('lblCurrentIDNum').hide() + #thread.start_new_thread(self.id_request,()) + #request the name + + self.get_widget('frame16').hide() + self.get_widget('lblIDNum').set_text(_me.string('lblIDNum')) + self.get_widget('lblIDName').set_text(_me.string('lblIDName')) + self.get_widget('btnID').set_label(_me.string('btnID')) + #Tests labels self.get_widget('btnSelfTest').set_label(_me.string('btnSelfTest')) - + +#------------------------------------------------------------ +# Version tab labels +#------------------------------------------------------------ def VersionsLabelUpdate(self): # Hide the check for update button while the function is not implemented # in the firmware updater gadget @@ -112,6 +138,10 @@ self.get_widget("scrolledwindow3").show_all() self.searchFiles() + +#------------------------------------------------------------ +# Sound tab labels +#------------------------------------------------------------ def SoundLabelUpdate(self): self.get_widget('btnSoundAdd').set_label(_me.string('btnSoundAdd')) self.get_widget('btnSoundClear').set_label(_me.string('btnSoundClear')) @@ -131,6 +161,7 @@ self.get_widget('lblSoundLocalSelect').set_text(_me.string('lblSoundLocalSelect')) self.get_widget('lblSoundMic').set_text(_me.string('lblSoundMic')) self.get_widget('lblSoundStore').set_text(_me.string('lblSoundStore')) + self.get_widget('lblSoundState').hide() self.SoundTreeviewUpdate() self.get_widget('progressbar1').hide() @@ -157,11 +188,14 @@ self.get_widget("scrolledwindow1").add(self.gadget_viewer) self.get_widget("scrolledwindow1").show_all() -#--------------------------------------------------------------------------- -# -# CONFIG TAB -# -#--------------------------------------------------------------------------- + +#================================================================== +# CONFIG TAB FUNCTIONS +#================================================================== + +#------------------------------------------------------------ +# on combo box choose wifi channel +#------------------------------------------------------------ def on_cbbWifiChannel_changed(self, widget, *args): #Reject the first signal if self.flag == True: @@ -171,7 +205,9 @@ _me.set_param('AvoidChannel', self.avoidedchannel) self.avoidchannel() - +#------------------------------------------------------------ +# AVoid a specific channel number +#------------------------------------------------------------ def avoidchannel(self): self.get_widget('cbbWifiChannel').set_active(self.avoidedchannel) if self.channel == -1: @@ -182,8 +218,17 @@ else: tux.connect.avoid_wifi(self.avoidedchannel) +#------------------------------------------------------------ +# This function search the current wifi channel +# If iwlist command isn't found, an error message occur. +#------------------------------------------------------------ def searchWifiChannel(self): - a = commands.getoutput('iwlist channel') + try: + a = commands.getoutput('iwlist channel') + except: + thread.start_new_thread(self.popup, (_me.string('Warning'), _me.string('Iwlist'), False)) + return + if a.rfind('Current Channel') != -1: self.get_widget('lblUsedChannel').set_text(_me.string('lblNoChannel')) self.get_widget('lblChannel').set_text('') @@ -197,16 +242,25 @@ self.get_widget('lblUsedChannel').set_text(_me.string('lblUsedChannel')) self.get_widget('lblChannel').set_text(str(self.channel)) +#------------------------------------------------------------ +# on sleep enable checkbox +#------------------------------------------------------------ def on_chkSleepEnable_toggled(self, widget, *args): _me.set_param('EnableSleep', widget.get_active()) self.enablesleep = widget.get_active() ## Send the active sleep command +#------------------------------------------------------------ +# on sleep delay spin button +#------------------------------------------------------------ def on_spinSleepDelay_changed(self, widget, *args): self.sleepdelay = self.get_widget('spinSleepDelay').get_text() _me.set_param('SleepDelay', self.sleepdelay) ## Send the delay +#------------------------------------------------------------ +# on sleep button clicked +#------------------------------------------------------------ def on_btnSleep_clicked(self, widget, *args): #if sleeping -> change label and send the wakeup command @@ -214,22 +268,56 @@ self.get_widget('btnSleep').set_label(_me.string('btnSleepWakeup')) self.get_widget('lblSleepState').set_text(_me.string('lblSleepStateSleep')) +#------------------------------------------------------------ +# on self test button clicked +#------------------------------------------------------------ def on_btnSelfTest_clicked(self, widget, *args): thread.start_new_thread(self.testmode,()) + ''' +#------------------------------------------------------------ +# On ID button clicked +#------------------------------------------------------------ + def on_btnID_clicked(self, widget, *args): + error = '' + try: + ID = int(self.get_widget('txtIDNum').get_text()) + print ID + if ID == 0 or ID >= 65535: + thread.start_new_thread(self.popup, (_me.string('Warning'), _me.string('IDErrorOverflow'), False)) + else: + thread.start_new_thread(tux.connect.change_id, (ID,)) + except: + thread.start_new_thread(self.popup, (_me.string('Warning'), _me.string('IDErrorOverflow'), False)) + + Name = self.get_widget('txtIDName').get_text() + # Send the name + + thread.start_new_thread(self.id_request, ()) +#------------------------------------------------------------ +# Request the ID +#------------------------------------------------------------ + def id_request(self): + ID = tux.connect.id_request() + if ID == False: + self.get_widget('lblCurrentIDNum').set_text(_me.string('lblCurrentIDNumError')) + self.get_widget('txtIDNum').set_text('1') + else: + self.get_widget('lblCurrentIDNum').set_text(_me.string('lblCurrentIDNum')+str(ID)) + self.get_widget('txtIDNum').set_text(str(ID)) + self.get_widget('lblCurrentIDNum').show() + ''' + +#================================================================== +# VERSION TAB FUNCTIONS +#================================================================== -#--------------------------------------------------------------------------- -# -# VERSION TAB -# -#--------------------------------------------------------------------------- - - #-------------------------------------------------------------------------- - # Search for local files - #-------------------------------------------------------------------------- +#------------------------------------------------------------ +# Search local tar.gz file on /opt/tuxdroid/firmware +#------------------------------------------------------------ def searchFiles(self): filelist = os.listdir('/opt/tuxdroid/firmware') tmppath = [] @@ -242,15 +330,19 @@ if flag != -1: self.refresh_files() +#------------------------------------------------------------ +# refresh the tree view +#------------------------------------------------------------ def refresh_files(self): self.file_tree_store.clear() versions = [] for i in range(len(self.filepath)): + ver = [] proc = subprocess.Popen("tar -C '/tmp' -xvf '/opt/tuxdroid/firmware/%s'"%self.filepath[i][0], shell = True, stdout = subprocess.PIPE) proc.wait() - version, tux_core, tux_audio, tux_rf, fux_rf, fux_usb, change = self.get_new_version_infos() - self.filepath[i][1] = str(version) - versions.append([tux_core, tux_audio, tux_rf, fux_rf, fux_usb]) + ver = self.get_new_version_infos() + self.filepath[i][1] = str(ver[0]) + versions.append(ver) os.system('rm -rf /tmp/tuxdroid-firmware*') for i in range(len(self.filepath)): @@ -262,6 +354,9 @@ self.file_tree_store.append(tmp, ('Fux RF',versions[i][3])) self.file_tree_store.append(tmp, ('Fux USB',versions[i][4])) +#------------------------------------------------------------ +# XML parser +#------------------------------------------------------------ def get_new_version_infos(self): filelist = os.listdir('/tmp') tmppath = '' @@ -281,14 +376,25 @@ tux_rf = str(tux_rf).replace('\n','').replace('\t', '') fux_usb = version[0].getElementsByTagName('fux_usb')[0].childNodes[0].nodeValue fux_usb = str(fux_usb).replace('\n','').replace('\t', '') - change = racine[0].getElementsByTagName('release_notes')[0].childNodes[0].nodeValue ver = version[0].attributes['tuxdroid_firmware_version'].nodeValue - return ver, tux_core, tux_audio, tux_rf, fux_rf, fux_usb, change + + description = racine[0].getElementsByTagName('description') + + desc = racine[0].getElementsByTagName('description')[0].childNodes[0].nodeValue + change = racine[0].getElementsByTagName('changes') + ch_tuxcore = change[0].getElementsByTagName('tux_core')[0].childNodes[0].nodeValue + ch_tuxaudio = change[0].getElementsByTagName('tux_audio')[0].childNodes[0].nodeValue + ch_fuxrf = change[0].getElementsByTagName('fux_rf')[0].childNodes[0].nodeValue + ch_tuxrf = change[0].getElementsByTagName('tux_rf')[0].childNodes[0].nodeValue + ch_fuxusb = change[0].getElementsByTagName('fux_usb')[0].childNodes[0].nodeValue + + return [ver, tux_core, tux_audio, tux_rf, fux_rf, fux_usb, desc, ch_tuxcore, ch_tuxaudio, ch_tuxrf, ch_fuxrf, ch_fuxusb] - #-------------------------------------------------------------------------- - # Retreive tux HW and SW versions - #-------------------------------------------------------------------------- +#------------------------------------------------------------ +# Retreive the current tux versions and display them in +# a treeview +#------------------------------------------------------------ def refresh_version(self): self.cpu_tree_store.clear() @@ -338,9 +444,9 @@ version_table.append([name,version]) self.cpu_tree_store.append( tmp,(name, version)) - #-------------------------------------------------------------------------- - # On right click & Menu functions - #-------------------------------------------------------------------------- +#------------------------------------------------------------ +# On right click on a treeview +#------------------------------------------------------------ def on_tree_button_pressed(self, widget, event): def show_popup(p, button, time): tux.sys.wait(0.1) @@ -348,8 +454,16 @@ if event.button == 3: # right click thread.start_new_thread(show_popup, (None, event.button, event.time)) +#------------------------------------------------------------ +# Treeview menu +#------------------------------------------------------------ def show_gadget_popup(self, status_icon, button, activate_time): menu = gtk.Menu() + + item = gtk.CheckMenuItem(_me.string('itemDescription')) + item.connect("activate", self.showDescription) + menu.append(item) + item = gtk.CheckMenuItem(_me.string('itemChangeLog')) item.connect("activate", self.showChangeLog) menu.append(item) @@ -361,17 +475,41 @@ menu.show_all() menu.popup(None, None, None, button, activate_time) +#------------------------------------------------------------ +# Show the description +#------------------------------------------------------------ + def showDescription(self, widget): + proc = subprocess.Popen("tar -C '/tmp' -xvf '/opt/tuxdroid/firmware/%s'"%self.selectedfile, shell = True, stdout = subprocess.PIPE) + proc.wait() + xml = [] + xml = self.get_new_version_infos() + + title = _me.string('itemChangeLog') + message = str(xml[6]) + dialog = GdgText(title, message, True) + os.system('rm -rf /tmp/tuxdroid-firmware*') +#------------------------------------------------------------ +# Show the changelog +#------------------------------------------------------------ def showChangeLog(self, widget): proc = subprocess.Popen("tar -C '/tmp' -xvf '/opt/tuxdroid/firmware/%s'"%self.selectedfile, shell = True, stdout = subprocess.PIPE) proc.wait() - version, tux_core, tux_audio, tux_rf, fux_rf, fux_usb, change = self.get_new_version_infos() + xml = [] + xml = self.get_new_version_infos() title = _me.string('itemChangeLog') - message = change - dialog = GdgDialog(title, message, True) + message = '======= Tuxcore =======\n' + xml[7] + '\n \n' + message = message + '======= Tuxaudio =======\n' + xml[8] + '\n \n' + message = message + '======= Tux RF =======\n' + xml[9] + '\n \n' + message = message + '======= Fux RF =======\n' + xml[10] + '\n \n' + message = message + '======= Fux USB =======\n' + xml[11] + '\n \n' + dialog = GdgText(title, message, True) os.system('rm -rf /tmp/tuxdroid-firmware*') +#------------------------------------------------------------ +# Flash the CPU with selected tar.gz +#------------------------------------------------------------ def flashCPU(self, widget): path = '/opt/tuxdroid/firmware/%s'%self.selectedfile try: @@ -385,14 +523,16 @@ path = obj.get_selected_rows() self.selectedfile = self.filepath[path[1][0][0]][0] - +#------------------------------------------------------------ +# Check for update +#------------------------------------------------------------ def on_btnUpdate_clicked(self, widget, *args): print ' clicked' -#--------------------------------------------------------------------------- -# -# SOUND TAB -# -#--------------------------------------------------------------------------- + + +#================================================================== +# SOUND TAB FUNCTIONS +#================================================================== #-------------------------------------------------------------------------- # On select external wave file event @@ -532,16 +672,18 @@ return self.get_widget('progressbar1').show() + self.get_widget('lblSoundState').show() self.get_widget('progressbar1').set_fraction(0) - print "Sound storing : Erase flash" + self.get_widget('lblSoundState').set_text(_me.string('SoundErase')) self.get_widget('progressbar1').set_fraction(0.25) tux.cmd.sound_storing(len(wavs.wav_sizes)) - while tux.status.flash_status()[1] != 3: - pass + #tux.sys.wait(10) + while tux.status.flash_status()[1] <= 3: + tux.sys.wait(0.1) current_pos=0x0400 tux.sys.wait(0.1) - print "Sound storing : Indexes" + self.get_widget('lblSoundState').set_text(_me.string('SoundTOC')) self.get_widget('progressbar1').set_fraction(0.5) tux.cmd.sound_store_index(0x00,0x04,0x00) @@ -550,11 +692,11 @@ tux.sys.wait(0.1) tux.cmd.sound_store_index((current_pos & 0xFF0000)>>16, (current_pos & 0x00FF00)>>8,current_pos & 0x0000FF) - + self.get_widget('lblSoundState').set_text(_me.string('SoundProg')) self.get_widget('progressbar1').set_fraction(0.75) tux.sys.shell("aplay -D %s merged.wav"%soundcard) self.get_widget('progressbar1').hide() - print "Sound storing : Storage done." + self.get_widget('lblSoundState').hide() tux.sys.wait(0.3) @@ -645,17 +787,14 @@ tux.cmd.mouth_close() -#======================================================================================= -# -# Test function -# -#======================================================================================= +#================================================================== +# SELF TEST FUNCTIONS +#================================================================== def testmode(self): self.get_widget('progressbar2').show() self.get_widget('progressbar2').set_fraction(0) STEPS = 28.0 fraction = float(1.0 / STEPS) - print fraction actual_fraction = 0 path = commands.getoutput('echo $USER') #Get the local time to create the file @@ -687,7 +826,6 @@ f.write('%s : Power plug detected\n'%time.asctime()) actual_fraction += fraction - print actual_fraction self.get_widget('progressbar2').set_fraction(actual_fraction) tux.sys.wait(2) @@ -843,6 +981,8 @@ f.write('%s : The sound flash is empty\n'%time.asctime()) else: tux.cmd.sound_play(1) + while tux.status.flash_status()[0] != 0: + tux.sys.wait(0.5) self.OK = False self.popupQuestion(_me.string('Warning'), _me.string('Sound'), self.btnOK, True) self.popup_wait() @@ -851,6 +991,8 @@ self.popup(_me.string('Warning'), _me.string('Sound1'), True) self.wait() tux.cmd.sound_play(1) + while tux.status.flash_status()[0] != 0: + tux.sys.wait(0.5) self.OK = False self.popupQuestion(_me.string('Warning'), _me.string('Sound'), self.btnOK, True) self.popup_wait() @@ -867,9 +1009,11 @@ self.popup(_me.string('Warning'), _me.string('Mic'), True) self.wait() + tux.micro.on() tux.cmd.mouth_open() tux.micro.capture_start('/tmp/capture.wav', 3) tux.cmd.mouth_close() + tux.micro.off() actual_fraction += fraction self.get_widget('progressbar2').set_fraction(actual_fraction) @@ -886,7 +1030,8 @@ actual_fraction += fraction self.get_widget('progressbar2').set_fraction(actual_fraction) - + + self.OK = False self.popupQuestion(_me.string('Warning'), _me.string('Out'), self.btnOK, True) self.popup_wait() tux.sys.wait(0.5) @@ -905,11 +1050,11 @@ actual_fraction += fraction self.get_widget('progressbar2').set_fraction(actual_fraction) - + + self.OK = False self.popupQuestion(_me.string('Warning'), _me.string('In'), self.btnOK, True) self.popup_wait() tux.sys.wait(0.5) - print 'OK' if self.OK == True: tux.sys.wait(5) self.OK = False @@ -1059,7 +1204,6 @@ self.popup_open = False def popup_wait(self): - self.OK = False tux.sys.wait(0.5) while self.popup_open == True: tux.sys.wait(0.5) @@ -1101,4 +1245,65 @@ self.wait = True +class GdgText(object): + def __init__(self, title, message, block = False, center_justify = False): + self.message = message + self.title = title + self.__center_justify = center_justify + if block: + self.__show() + else: + thread.start_new_thread(self.__show_async, ()) + + def __show_async(self): + gtk.gdk.threads_enter() + self.__show() + gtk.gdk.threads_leave() + + def __show(self): + dialogue = gtk.Dialog(self.title, None, gtk.DIALOG_MODAL, ()) + dialogue.set_property("width-request", 600) + dialogue.set_property("height-request", 400) + if gadgets.has_key('Manager'): + dialogue.set_icon_from_file(gadgets['Manager'].icons['gadget.png']) + bt_alone = dialogue.add_button("Close", gtk.RESPONSE_APPLY) + + def on_click_close(obj): + dialogue.destroy() + + bt_alone.connect("clicked", on_click_close) + + box = gtk.HBox(spacing = 5) + box.set_border_width(5) + box.show() + dialogue.vbox.pack_start(box) + + scroll = gtk.ScrolledWindow() + scroll.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_ALWAYS) + + index_column = gtk.TreeViewColumn('') + index_column.set_min_width(50) + index_column.set_property("clickable", False) + index_cell = gtk.CellRendererText() + index_cell.set_property("editable", False) + index_cell.set_property("background", 'white') + index_column.pack_start(index_cell, True) + index_column.add_attribute(index_cell, 'text', 0) + index_column.set_clickable(False) + + + + text = gtk.TreeStore(str) + text_viewer = gtk.TreeView(text) + text_viewer.append_column(index_column) + text_viewer.set_headers_visible(False) + text.append(None, [self.message]) + + + scroll.add(text_viewer) + scroll.show_all() + + box.pack_start(scroll) + dialogue.run() + Modified: software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml =================================================================== --- software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml 2007-11-13 08:40:35 UTC (rev 691) +++ software/gadgets/settings/trunk/settings/Strings/fr_ALL.xml 2007-11-13 08:56:49 UTC (rev 692) @@ -9,18 +9,24 @@ <btnSleepSleep type='str'>Mettre en veille</btnSleepSleep> <lblSoundExternalFile type='str'>Fichier :</lblSoundExternalFile> <btnSoundAdd type='str'>Ajouter</btnSoundAdd> + <lblUsedChannel type='str'>Votre wifi utilise le cannal :</lblUsedChannel> <treeFile type='str'>Fichier</treeFile> <gui_conf_accept_bt type='str'>Valider</gui_conf_accept_bt> + <lblCurrentIDNum type='str'>L'ID actuel est : </lblCurrentIDNum> <help_text type='str'> </help_text> + <soundErase type='str'>Effacement de la mémoire ...</soundErase> <lblWifiAvoidance type='str'>Eviter le canal wifi n° :</lblWifiAvoidance> <itemCPU type='str'>Flasher les processeurs</itemCPU> <btnSoundPlayMic type='str'>Lire</btnSoundPlayMic> <lblSoundLocal type='str'>Lire un wave local</lblSoundLocal> + <IDErrorOverflow type='str'>L'ID doit être compris entre 1 et 65534</IDErrorOverflow> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Mise à jour</gui_conf_update_title> <lblTabConfig type='str'>Configuration</lblTabConfig> <gui_conf_cancel_bt type='str'>Annuler</gui_conf_cancel_bt> + <soundTOC type='str'>Ecriture des indexes</soundTOC> + <btnID type='str'>Changer l'ID</btnID> <btnUpdate type='str'>Verifier les mises à jour</btnUpdate> <lblNoChannel type='str'>Pas de connexion wifi trouvée</lblNoChannel> <gui_conf_delay_lb type='str'>Délai (sec)</gui_conf_delay_lb> @@ -28,16 +34,22 @@ <lblConfigSleep type='str'>Configuration de la veille</lblConfigSleep> <btnSleepWakeup type='str'>Reveiller</btnSleepWakeup> <btnSoundClear type='str'>Purger</btnSoundClear> + <lblIDName type='str'>Nom du Tux : </lblIDName> <Sound1 type='str'>Assurez vous que le réglage de volume soit au maximum</Sound1> <lblSleepStateSleep type='str'>Tux est actuellement en veille</lblSleepStateSleep> <lblSoundMic type='str'>Microphone</lblSoundMic> + <lblIDNum type='str'>ID de Tux : </lblIDNum> <Sound type='str'>Avez vous correctement entendu le son ?</Sound> <itemChangeLog type='str'>Voir les changements</itemChangeLog> <lblSoundLocalSelect type='str'>Selectionner un son :</lblSoundLocalSelect> + <In type='str'>Voulez-vous tester l'entrée son de Tux? +Vous devez connecter un périphérique d'entrée dans le connecteur bleu.</In> <lblSoundExternal type='str'>Lire un wave externe</lblSoundExternal> <IR type='str'>Après avoir fermer cette fenêtre, trois touches de la télécommande. Vous vez 15 secondes pour realiser cette opération.</IR> + <lblCurrentIDNumError type='str'>Pas d'ID trouvé.</lblCurrentIDNumError> <gui_conf_about_title type='str'>A propos</gui_conf_about_title> + <itemDescription type='str'>Voir la description</itemDescription> <btnSelfTest type='str'>Démarrer les tests</btnSelfTest> <lblSleepStateWork type='str'>Tux n'est pas en veille pour le moment</lblSleepStateWork> <Switch type='str'>Après avoir fermer cette fenêtre, pressez successivement sur les ailes puis sur la tête. @@ -47,28 +59,30 @@ <treeVersionVer type='str'>Version</treeVersionVer> <lblConfigWifi type='str'>Configuration wifi</lblConfigWifi> <treeVersionProg type='str'>Composant</treeVersionProg> - <lblSoundExternalPlay type='str'>Lecture</lblSoundExternalPlay> + <lblSoundStore type='str'>Enregistrer des fichiers wave</lblSoundStore> <gui_conf_current_bind_lb type='str'>Assignation</gui_conf_current_bind_lb> <speaker_name type='str'>Bruno8k</speaker_name> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <lblSoundExternalPlay type='str'>Lecture</lblSoundExternalPlay> <name_to_read type='str'>Parametres de Tux</name_to_read> <gui_conf_window_title type='str'>Paramètres</gui_conf_window_title> - <lblUsedChannel type='str'>Votre wifi utilise le cannal :</lblUsedChannel> + <soundProg type='str'>Ecriture du son ...</soundProg> <lblSleepDelay type='str'>Activer la veille après une période d'inactivité de </lblSleepDelay> <lblTabSound type='str'>Audio</lblTabSound> <btnSoundStore type='str'>Ecrire</btnSoundStore> <lblVersions type='str'>Versions installées</lblVersions> <chkSoundOriginal type='str'>Fichier originaux</chkSoundOriginal> <btnSoundModify type='str'>Modifier</btnSoundModify> + <Iwlist type='str'>iwlist n'a pas été trouvée. +Assurez-vous que le paquet 'wireless tools' est correctement installé sur votre ordinateur. +(http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html#latest)</Iwlist> <Warning type='str'>Attention</Warning> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> <Connect type='str'>Connectez l'alimentation de tux puis fermez cette fenêtre.</Connect> - <In type='str'>Voulez-vous tester l'entrée son de Tux? -Vous devez connecter un périphérique d'entrée dans le connecteur bleu.</In> + <lblCurrentIDName type='str'>Le nom acteul est : </lblCurrentIDName> <lblConfigID type='str'>Configuration de l'ID</lblConfigID> + <lblTabVersion type='str'>Versions</lblTabVersion> + <btnSoundPlayNum type='str'>Lire</btnSoundPlayNum> <Out type='str'>Voulez-vous tester la sortie son de Tux? Vous devez connecter des haut-parleurs dans la prise verte.</Out> - <lblTabVersion type='str'>Versions</lblTabVersion> - <btnSoundPlayNum type='str'>Lire</btnSoundPlayNum> - <lblSoundStore type='str'>Enregistrer des fichiers wave</lblSoundStore> </strings> Modified: software/gadgets/settings/trunk/settings/about.xml =================================================================== (Binary files differ) Modified: software/gadgets/settings/trunk/settings/settings.xml =================================================================== --- software/gadgets/settings/trunk/settings/settings.xml 2007-11-13 08:40:35 UTC (rev 691) +++ software/gadgets/settings/trunk/settings/settings.xml 2007-11-13 08:56:49 UTC (rev 692) @@ -3,20 +3,17 @@ <parameters> <AvoidChannel type='int'>0</AvoidChannel> <hidden_in_manager type='bool'>False</hidden_in_manager> - <SleepDelay type='int'>10</SleepDelay> + <SleepDelay type='str'>10</SleepDelay> <EnableSleep type='bool'>True</EnableSleep> </parameters> <general> + <have_settings_part type='bool'>True</have_settings_part> <gui_state> <widget> - <y type='int'>147</y> - <visible type='bool'>True</visible> - <x type='int'>417</x> + <visible type='bool'>False</visible> </widget> <conf> - <y type='int'>50</y> - <visible type='bool'>True</visible> - <x type='int'>5</x> + <visible type='bool'>False</visible> </conf> </gui_state> <language type='str'>en_US</language> @@ -24,9 +21,11 @@ <notify_delay type='int'>60</notify_delay> <framework_version type='str'>0.0.0</framework_version> <menu_active type='bool'>True</menu_active> - <main_priority type='int'>4</main_priority> + <have_widget_part type='bool'>True</have_widget_part> <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> </settings> Modified: software/gadgets/settings/trunk/settings/strings.xml =================================================================== --- software/gadgets/settings/trunk/settings/strings.xml 2007-11-13 08:40:35 UTC (rev 691) +++ software/gadgets/settings/trunk/settings/strings.xml 2007-11-13 08:56:49 UTC (rev 692) @@ -6,38 +6,47 @@ <gui_conf_remote_title type='str'>Remote</gui_conf_remote_title> <btnSoundRemove type='str'>Remove</btnSoundRemove> <Mic type='str'>After closing this window, say anything to Tux.</Mic> - <treeVersionProg type='str'>Component</treeVersionProg> + <btnSleepSleep type='str'>Sleep</btnSleepSleep> <lblSoundExternalFile type='str'>File :</lblSoundExternalFile> <btnSoundAdd type='str'>Add</btnSoundAdd> <treeFile type='str'>Fichier</treeFile> <gui_conf_accept_bt type='str'>Accept</gui_conf_accept_bt> + <lblCurrentIDNum type='str'>The current ID is : </lblCurrentIDNum> + <Connect type='str'>Please connect the power plug, and press the 'OK' button</Connect> <help_text type='str'> </help_text> + <soundErase type='str'>Erasing flash ...</soundErase> <lblWifiAvoidance type='str'>Avoid the wifi channel number :</lblWifiAvoidance> <itemCPU type='str'>Flash the CPUs</itemCPU> <btnSoundPlayMic type='str'>Play</btnSoundPlayMic> <lblSoundLocal type='str'>Play local wave files</lblSoundLocal> + <IDErrorOverflow type='str'>The ID must be included between 1 and 65534.</IDErrorOverflow> <gui_conf_version_lb type='str'>Version</gui_conf_version_lb> <gui_conf_update_title type='str'>Update</gui_conf_update_title> <lblTabConfig type='str'>Configuration</lblTabConfig> <gui_conf_cancel_bt type='str'>Cancel</gui_conf_cancel_bt> + <btnSoundModify type='str'>Modify</btnSoundModify> <btnUpdate type='str'>Check for updates</btnUpdate> <lblNoChannel type='str'>No wifi connection found</lblNoChannel> <gui_conf_delay_lb type='str'>Delay (sec)</gui_conf_delay_lb> + <btnSoundPlayNum type='str'>Play</btnSoundPlayNum> <btnSoundRecordMic type='str'>Record</btnSoundRecordMic> <lblConfigSleep type='str'>Sleep configuration</lblConfigSleep> <btnSleepWakeup type='str'>Wakeup</btnSleepWakeup> <btnSoundClear type='str'>Clear list</btnSoundClear> <Sound1 type='str'>Be sure that the sound volume control is at the maximum.</Sound1> <lblSleepStateSleep type='str'>Tux is currently sleeping</lblSleepStateSleep> - <speaker_name type='str'>Ryan8k</speaker_name> + <lblSoundMic type='str'>Microphone</lblSoundMic> + <lblIDNum type='str'>Tux's ID : </lblIDNum> <Sound type='str'>Have you heard the sound ?</Sound> <itemChangeLog type='str'>Show ChangeLog</itemChangeLog> <lblSoundLocalSelect type='str'>Select sound</lblSoundLocalSelect> <lblSoundExternal type='str'>Play external wave file</lblSoundExternal> <IR type='str'>After closing this window, press the keys '1', '2' and '3' of the remote control. You've 15 seconds to perform this task.</IR> + <lblCurrentIDNumError type='str'>Unable to read the current ID.</lblCurrentIDNumError> <gui_conf_about_title type='str'>About</gui_conf_about_title> + <itemDescription type='str'>Show the description</itemDescription> <btnSelfTest type='str'>Start self test</btnSelfTest> <lblSleepStateWork type='str'>Tux isn't in sleep mode</lblSleepStateWork> <Switch type='str'>After closing this window, press on the wings and on the head. @@ -46,29 +55,34 @@ <lblConfigTest type='str'>Self tests</lblConfigTest> <treeVersionVer type='str'>Version</treeVersionVer> <lblConfigWifi type='str'>Wifi configuration</lblConfigWifi> - <btnSleepSleep type='str'>Sleep</btnSleepSleep> - <lblSoundExternalPlay type='str'>Play</lblSoundExternalPlay> + <treeVersionProg type='str'>Component</treeVersionProg> + <lblSoundStore type='str'>Store wave files locally</lblSoundStore> <gui_conf_current_bind_lb type='str'>Current</gui_conf_current_bind_lb> - <lblSoundMic type='str'>Microphone</lblSoundMic> + <speaker_name type='str'>Ryan8k</speaker_name> <gui_conf_remote_set_bt type='str'>Set</gui_conf_remote_set_bt> + <lblSoundExternalPlay type='str'>Play</lblSoundExternalPlay> <name_to_read type='str'>Tux settings</name_to_read> + <btnID type='str'>Change ID</btnID> <gui_conf_window_title type='str'>Parameters</gui_conf_window_title> - <lblUsedChannel type='str'>Your wifi use the channel :</lblUsedChannel> + <soundProg type='str'>Sound programming ...</soundProg> <lblSleepDelay type='str'>Active the sleep mode after a inactivity period of</lblSleepDelay> <lblTabSound type='str'>Audio</lblTabSound> <btnSoundStore type='str'>Store</btnSoundStore> <lblVersions type='str'>Installed versions</lblVersions> <chkSoundOriginal type='str'>Include originals</chkSoundOriginal> - <btnSoundModify type='str'>Modify</btnSoundModify> + <soundTOC type='str'>TOC programming ...</soundTOC> + <Iwlist type='str'>iwlist package isn't found. +Be sure that wireless tools package is instelled on your computer. +(http://www.hpl.hp.com/personal/Jean_Tourrilhes/Linux/Tools.html#latest)</Iwlist> <Warning type='str'>Warning</Warning> <gui_conf_description_lb type='str'>Description</gui_conf_description_lb> - <Connect type='str'>Please connect the power plug, and press the 'OK' button</Connect> - <In type='str'>Would you like to test the sound input interface? -To do this, you need to connect an input device in the blue connector and then click 'Yes'.</In> + <lblIDName type='str'>Tux's name : </lblIDName> + <lblCurrentIDName type='str'>The current name is : </lblCurrentIDName> <lblConfigID type='str'>ID configuration</lblConfigID> <Out type='str'>Would you like to test the sound output interface? To do this, you need to connect loudspeakers in the green connector, and press the 'Yes' button.</Out> <lblTabVersion type='str'>Versions</lblTabVersion> - <btnSoundPlayNum type='str'>Play</btnSoundPlayNum> - <lblSoundStore type='str'>Store wave files locally</lblSoundStore> + <lblUsedChannel type='str'>Your wifi use the channel :</lblUsedChannel> + <In type='str'>Would you like to test the sound input interface? +To do this, you need to connect an input device in the blue connector and then click 'Yes'.</In> </strings> Modified: software/gadgets/settings/trunk/settings.tgf =================================================================== (Binary files differ) |