diff options
author | papoteur-mga <yves.brungard_git@gadz.org> | 2013-11-01 08:02:17 +0100 |
---|---|---|
committer | papoteur-mga <yves.brungard_git@gadz.org> | 2013-11-01 08:02:17 +0100 |
commit | 708485b5cfd4f994ae0ebf7903542f8bc3c2e72d (patch) | |
tree | e81360c284fd24263f630ec09d1bdc385fa78ed5 | |
parent | f304fbd3889313d0facc190d4dfe5bc79bec7193 (diff) | |
download | isodumper-708485b5cfd4f994ae0ebf7903542f8bc3c2e72d.tar isodumper-708485b5cfd4f994ae0ebf7903542f8bc3c2e72d.tar.gz isodumper-708485b5cfd4f994ae0ebf7903542f8bc3c2e72d.tar.bz2 isodumper-708485b5cfd4f994ae0ebf7903542f8bc3c2e72d.tar.xz isodumper-708485b5cfd4f994ae0ebf7903542f8bc3c2e72d.zip |
Added a button to retry in the nodev dialog box.
-rwxr-xr-x | lib/isodumper.py | 33 | ||||
-rw-r--r-- | share/isodumper/isodumper.glade | 19 |
2 files changed, 32 insertions, 20 deletions
diff --git a/lib/isodumper.py b/lib/isodumper.py index 3d6e814..3dcd803 100755 --- a/lib/isodumper.py +++ b/lib/isodumper.py @@ -25,7 +25,6 @@ import gtk.glade import gobject from subprocess import Popen,PIPE,call import os -import signal import gettext from gettext import gettext as _ @@ -53,7 +52,6 @@ class IsoDumper: #bgcol = gtk.gdk.color_parse("white") #eventbox.modify_bg(gtk.STATE_NORMAL, bgcol) self.log = self.logview.get_buffer() - self.ddpid = 0 # define size of the selected device self.deviceSize=0 @@ -74,24 +72,23 @@ class IsoDumper: "on_filechooserbutton_file_set" : self.activate_devicelist, "on_detail_expander_activate" : self.expander_control, "on_device_combobox_changed" : self.device_selected, - "on_button1_clicked" : self.close, + "on_nodev_close_clicked" : self.close, "on_write_button_clicked" : self.do_write} self.wTree.signal_autoconnect(dict) self.window.show_all() # make sure we have a target device self.get_devices() - def get_devices(self): dialog = self.wTree.get_widget("nodev_dialog") list = Popen(["/usr/lib/isodumper/find_devices"], stdout=PIPE).communicate()[0] - if not len(list): - dialog.run() - list = Popen(["/usr/lib/isodumper/find_devices"], stdout=PIPE).communicate()[0] - if not len(list): - dialog.destroy() - self.close - exit(0) + while not len(list): + exit_dialog=dialog.run() + list = Popen(["/usr/lib/isodumper/find_devices"], stdout=PIPE).communicate()[0] + if (exit_dialog==2) : + dialog.destroy() + #self.close('dummy') + exit(0) self.combo = self.wTree.get_widget("device_combobox") list = list.strip().split('\n') for item in list: @@ -217,7 +214,11 @@ class IsoDumper: progress.set_fraction(1.0) self.logger(_('Image ')+source.split('/')[-1]+_(' successfully written to')+target) self.logger(_('Bytes written: ')+str(written)) - ofc.close() + try: + ofc.close() + except: + self.logger(_("Writing error.")) + self.emergency() self.success() ifc.close() yield False @@ -251,13 +252,7 @@ class IsoDumper: def close(self, widget): self.write_logfile() - if self.ddpid > 0: - try: - os.killpg(os.getpgid(self.ddpid), signal.SIGKILL) - except: - gtk.main_quit() - else: - gtk.main_quit() + gtk.main_quit() def write_logfile(self): start = self.log.get_start_iter() diff --git a/share/isodumper/isodumper.glade b/share/isodumper/isodumper.glade index 2d7b0c4..47eb2bb 100644 --- a/share/isodumper/isodumper.glade +++ b/share/isodumper/isodumper.glade @@ -487,8 +487,9 @@ <property name="can_focus">False</property> <property name="layout_style">end</property> <child> - <widget class="GtkButton" id="button1"> + <widget class="GtkButton" id="nodev_close"> <property name="label">gtk-close</property> + <property name="response_id">2</property> <property name="visible">True</property> <property name="can_focus">True</property> <property name="receives_default">True</property> @@ -500,6 +501,22 @@ <property name="position">0</property> </packing> </child> + <child> + <widget class="GtkButton" id="retry"> + <property name="label">gtk-refresh</property> + <property name="response_id">1</property> + <property name="visible">True</property> + <property name="can_focus">True</property> + <property name="receives_default">True</property> + <property name="use_stock">True</property> + <signal name="clicked" handler="on_retry_clicked" swapped="no"/> + </widget> + <packing> + <property name="expand">False</property> + <property name="fill">False</property> + <property name="position">1</property> + </packing> + </child> </widget> <packing> <property name="expand">False</property> |