129
128
tabswin=self.wTree.get_widget("window1")
130
129
tabs=self.wTree.get_widget("treeview"+str(index))
131
130
tabswin.show_all()
132
#tabsnote=self.wTree.get_widget("notebook1")
133
#tabsnote.set_current_page(1)
134
131
if not tabs.get_model():
135
132
#Create the model if it doesn't already exist
136
133
self.treestore[index]=gtk.TreeStore(str,str)
180
177
self.progress.hide_all()
181
178
md5info=self.md5proc.stdout.read()
182
179
md5split=md5info.split(" ")
183
dialog = gtk.MessageDialog(self.win,
184
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
185
gtk.MESSAGE_INFO, gtk.BUTTONS_OK, None)
186
dialog.set_markup('md5sum is: <big><b>'+md5split[0]+'</b></big>')
187
dialog.connect("destroy", lambda w: self.win.set_sensitive(True))
180
displayMessage(self,'md5sum is: <big><b>'+md5split[0]+'</b></big>',gtk.MESSAGE_INFO)
193
183
def progress_update(self):
294
284
mount=self.ac_mount(entry.get_text(),fileMount)
297
dialog = gtk.MessageDialog(self.win,
298
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
299
gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, None)
300
dialog.set_markup("<big><b>Mounted:</b></big>"+str(self.isos[index].info.vollabel)+"\n<big><b>Creation date:</b></big>"+str(self.isos[index].info.volcreate))
301
dialog.connect("destroy", lambda w: self.win.set_sensitive(True))
305
287
info=os.stat(entry.get_text())
306
288
icon=self.wTree.get_widget("icon"+str(index))
307
289
if info.st_size<729217000:
348
330
#Locks a mount slot on the gui
349
331
entry=self.wTree.get_widget("entry"+str(slot))
350
332
entry.set_sensitive(False)
351
#mount=self.wTree.get_widget("mount"+str(slot))
352
#mount.set_sensitive(False)
353
#umount=self.wTree.get_widget("umount"+str(slot))
354
#umount.set_sensitive(True)
355
333
browse=self.wTree.get_widget("browse"+str(slot))
356
334
browse.set_sensitive(False)
359
337
#Unlocks a mount slot on the gui
360
338
entry=self.wTree.get_widget("entry"+str(slot))
361
339
entry.set_sensitive(True)
362
#mount=self.wTree.get_widget("mount"+str(slot))
363
#mount.set_sensitive(True)
364
#umount=self.wTree.get_widget("umount"+str(slot))
365
#umount.set_sensitive(False)
366
340
browse=self.wTree.get_widget("browse"+str(slot))
367
341
browse.set_sensitive(True)
370
344
mountproc=subprocess.Popen("mount -o loop,ro -t iso9660 "+filename+" \""+mountpoint+"\"", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
371
345
mountoutput=mountproc.stderr.read()
372
346
if mountoutput != "":
373
self.win.set_sensitive(False)
374
dialog = gtk.MessageDialog(self.win,
375
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
376
gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, None)
377
dialog.set_markup('<big><b>'+mountoutput+'</b></big>')
378
dialog.connect("destroy", lambda w: self.win.set_sensitive(True))
347
displayMessage(self,'<big><b>'+mountoutput+'</b></big>',gtk.MESSAGE_ERROR)
387
353
mountproc=subprocess.Popen("umount \""+mountpoint+"\"", shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
388
354
mountoutput=mountproc.stderr.read()
389
355
if mountoutput != "":
390
self.win.set_sensitive(False)
391
dialog = gtk.MessageDialog(self.win,
392
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
393
gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, None)
394
dialog.set_markup('<big><b>'+mountoutput+'</b></big>')
395
dialog.connect("destroy", lambda w: self.win.set_sensitive(True))
356
displayMessage(self,'<big><b>'+mountoutput+'</b></big>',gtk.MESSAGE_ERROR)
429
387
#Checks to see if an iso is valid
430
388
if filename == "":
431
389
#Dude, select a file first you idiot
432
self.win.set_sensitive(False)
433
dialog = gtk.MessageDialog(self.win,
434
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
435
gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, None)
436
dialog.set_markup('<big><b>You must input an iso image</b></big>')
437
dialog.connect("destroy", lambda w: self.win.set_sensitive(True))
390
displayMessage(self,'<big><b>You must input an iso image</b></big>',gtk.MESSAGE_ERROR)
442
392
process=subprocess.Popen("file "+filename, shell=True, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
443
393
output=process.stdout.read()
444
394
if output.find("ISO") == -1:
445
395
#File is clearly not an iso, dummy :p
446
self.win.set_sensitive(False)
447
dialog = gtk.MessageDialog(self.win,
448
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
449
gtk.MESSAGE_ERROR, gtk.BUTTONS_OK, None)
450
dialog.set_markup('<big><b>File selected is not an ISO</b></big>')
451
dialog.connect("destroy", lambda w: self.win.set_sensitive(True))
396
displayMessage(self,'<big><b>File selected is not an ISO</b></big>',gtk.MESSAGE_ERROR)
522
464
self.datprepareid=""
467
def displayMessage(mclass,mtext,mtype):
468
mclass.win.set_sensitive(False)
469
dialog = gtk.MessageDialog(mclass.win,
470
gtk.DIALOG_MODAL | gtk.DIALOG_DESTROY_WITH_PARENT,
471
mtype, gtk.BUTTONS_OK, None)
472
dialog.set_markup(mtext)
473
dialog.connect("destroy", lambda w: mclass.win.set_sensitive(True))