[tuxdroid-svn] r833 - in software/gadgets/flash_management/trunk: . flash_management/Scripts/Python
Status: Beta
Brought to you by:
ks156
From: Paul_R <c2m...@c2...> - 2008-01-07 11:57:28
|
Author: Paul_R Date: 2008-01-07 12:57:28 +0100 (Mon, 07 Jan 2008) New Revision: 833 Modified: software/gadgets/flash_management/trunk/flash_management.tgf software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.glade software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp software/gadgets/flash_management/trunk/flash_management/Scripts/Python/main.pyp Log: * Added a protection to disable to close the window ([X] or key STB) while the programming isn't finished. Modified: software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.glade =================================================================== --- software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.glade 2008-01-07 10:56:31 UTC (rev 832) +++ software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.glade 2008-01-07 11:57:28 UTC (rev 833) @@ -639,6 +639,7 @@ <property name="gravity">GDK_GRAVITY_NORTH_WEST</property> <property name="focus_on_map">True</property> <property name="urgency_hint">False</property> + <signal name="delete_event" handler="on_window1_delete_event" last_modification_time="Mon, 07 Jan 2008 11:24:04 GMT"/> <child> <widget class="GtkVBox" id="vbox4"> Modified: software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp =================================================================== --- software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp 2008-01-07 10:56:31 UTC (rev 832) +++ software/gadgets/flash_management/trunk/flash_management/Scripts/Python/GUI/widget/other.pyp 2008-01-07 11:57:28 UTC (rev 833) @@ -15,6 +15,7 @@ root="window1", domain="params", **kwargs): SimpleGladeApp.__init__(self, path, root, domain, **kwargs) + _me.set_param('programming', False) self.prev = False self.flag = True self.__sound_mutex = threading.Lock() @@ -28,10 +29,14 @@ wavs.wav_paths=[] wavs.wav_sizes=[] thread.start_new_thread(self.update, ()) + + + def on_window1_delete_event(self, widget, *args): + if _me.get_param('programming') == True: + return True + else: + _me.exit_main_loop() - def on_window1_destroy(self, widget, *args): - pass - #------------------------------------------------------------ # This function update all labels and create the GUI #------------------------------------------------------------ @@ -197,8 +202,6 @@ if str(self.get_widget("soundInternalChooser").get_filename())=="None": return path = str(self.get_widget("soundInternalChooser").get_filename()) wavfile = wave.open(path, 'r') - print wavfile.getsampwidth() - print wavfile.getframerate() if wavfile.getsampwidth() != 1 or wavfile.getframerate() != 8000: dialog = GdgDialog(_me.string('Warning'), _me.string('FileSample')) wavfile.close() @@ -287,7 +290,7 @@ def sound_storing(self): if self.__sound_mutex.locked(): return - + _me.set_param('programming', True) self.__sound_mutex.acquire() behavior = True audio = True @@ -412,7 +415,7 @@ self.get_widget('progressbar1').set_fraction(1) self.get_widget('lblSoundState').set_text(_me.string('Succeeded')) - + _me.set_param('programming', False) self.__sound_mutex.release() def on_disconnected(self): @@ -421,6 +424,7 @@ self.get_widget('progressbar1').set_fraction(1) self.get_widget('lblSoundState').set_text(_me.string('norf')) if self.__sound_mutex.locked(): + _me.set_param('programming', False) self.__sound_mutex.release() #-------------------------------------------------------------------------- Modified: software/gadgets/flash_management/trunk/flash_management/Scripts/Python/main.pyp =================================================================== --- software/gadgets/flash_management/trunk/flash_management/Scripts/Python/main.pyp 2008-01-07 10:56:31 UTC (rev 832) +++ software/gadgets/flash_management/trunk/flash_management/Scripts/Python/main.pyp 2008-01-07 11:57:28 UTC (rev 833) @@ -2,6 +2,8 @@ import time def on_standby(): + if _me.get_param('programming') == True: + return _me.gui('widget').hide_from_main() _me.exit_main_loop() Modified: software/gadgets/flash_management/trunk/flash_management.tgf =================================================================== (Binary files differ) |