Exemplo n.º 1
0
 def clean_up(self, model, path, iter):
     if messagebox.show(
             self.interface.get_widget('main_window'),
             _('%s is still mounted.\nDo you wish to unmount it before exiting?'
               % (model.get_value(iter, 1))), gtk.MESSAGE_QUESTION,
             gtk.BUTTONS_YES_NO) == gtk.RESPONSE_YES:
         try:
             imageaction.unmount(model.get_value(iter, 0),
                                 model.get_value(iter, 2),
                                 self.image_storage, iter, True)
         except:
             log.write(
                 globals.mount_log,
                 _('Error unmounting image.\nUnexpected error: %s' %
                   (sys.exc_info()[0])))
     else:  #write the history to file for loading later
         try:
             mount_file = open(globals.mount_list, 'a')
             string = '%s,%s,%s' % (model.get_value(
                 iter, 0), model.get_value(iter, 1), model.get_value(
                     iter, 2))
             mount_file.write('%s\n' % (string))
         except IOError, (errno, strerror):
             log.write(
                 globals.mount_log,
                 _('Error saving unmounted images to file.\nOS error(%s): %s'
                   % (errno, strerror)))
         except:
Exemplo n.º 2
0
 def button_unmount_clicked(self, data):
     try:
         imageaction.unmount(self.interface.get_widget('label_selected_mount_point').get_label(), self.is_mounted_image_fuse, self.image_storage, self.iter)
         self.interface.get_widget('label_selected_mount_point').set_label(_('No Mount Point Selected'))
         self.interface.get_widget('button_unmount').set_sensitive(False)
     except:
         messagebox.show(self.interface.get_widget('main_window'), _('Error unmounting image.\nUnexpected error: %s' % (sys.exc_info()[0])), gtk.MESSAGE_ERROR)
Exemplo n.º 3
0
 def clean_up(self, model, path, iter):
     if messagebox.show(self.interface.get_widget('main_window'), _('%s is still mounted.\nDo you wish to unmount it before exiting?' % (model.get_value(iter, 1))), gtk.MESSAGE_QUESTION, gtk.BUTTONS_YES_NO) == gtk.RESPONSE_YES:
         try:
             imageaction.unmount(model.get_value(iter, 0), model.get_value(iter, 2), self.image_storage, iter, True)
         except:
             log.write(globals.mount_log, _('Error unmounting image.\nUnexpected error: %s' % (sys.exc_info()[0])))
     else: #write the history to file for loading later
         try:
             mount_file = open(globals.mount_list, 'a')
             string = '%s,%s,%s' % (model.get_value(iter, 0), model.get_value(iter, 1), model.get_value(iter, 2))
             mount_file.write('%s\n' % (string))
         except IOError, (errno, strerror):
             log.write(globals.mount_log, _('Error saving unmounted images to file.\nOS error(%s): %s' % (errno, strerror)))
         except:
Exemplo n.º 4
0
 def button_unmount_clicked(self, data):
     try:
         imageaction.unmount(
             self.interface.get_widget(
                 'label_selected_mount_point').get_label(),
             self.is_mounted_image_fuse, self.image_storage, self.iter)
         self.interface.get_widget('label_selected_mount_point').set_label(
             _('No Mount Point Selected'))
         self.interface.get_widget('button_unmount').set_sensitive(False)
     except:
         messagebox.show(
             self.interface.get_widget('main_window'),
             _('Error unmounting image.\nUnexpected error: %s' %
               (sys.exc_info()[0])), gtk.MESSAGE_ERROR)