aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorpapoteur-mga <yves.brungard_git@gadz.org>2013-11-01 08:02:17 +0100
committerpapoteur-mga <yves.brungard_git@gadz.org>2013-11-01 08:02:17 +0100
commit708485b5cfd4f994ae0ebf7903542f8bc3c2e72d (patch)
treee81360c284fd24263f630ec09d1bdc385fa78ed5 /lib
parentf304fbd3889313d0facc190d4dfe5bc79bec7193 (diff)
downloadisodumper-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.
Diffstat (limited to 'lib')
-rwxr-xr-xlib/isodumper.py33
1 files changed, 14 insertions, 19 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()