示例#1
0
    def treeview_mounted_images_drag_data_recieved(self, widget, context, x, y,
                                                   sel, ttype, time):
        files = sel.data.split('\n')
        for file in files:
            if not file:
                continue

            file = file.strip()
            file = file.replace('%20', ' ')
            if file.startswith('file:///') and os.path.isfile(file[7:]):
                if self.verify_image(file[7:]):
                    try:
                        imageaction.mount(
                            self.interface.get_widget(
                                'label_selected_image').get_label(),
                            self.image_storage, self.history_storage,
                            self.history_array,
                            self.interface.get_widget(
                                'radiobutton_fuse').get_active())
                    except OSError, (errno, strerror):
                        messagebox.show(
                            self.interface.get_widget('main_window'),
                            _('Error mounting image.\nOS error(%s): %s' %
                              (errno, strerror)), gtk.MESSAGE_ERROR)
                    except IOError, (errno, strerror):
                        messagebox.show(
                            self.interface.get_widget('main_window'),
                            _('Error mounting image.\nIO error(%s): %s' %
                              (errno, strerror)), gtk.MESSAGE_ERROR)
                    except:
示例#2
0
    def __init__(self, parameter):

        # Localization
        locale.setlocale(locale.LC_ALL, '')
        gettext.textdomain(globals.assembly_name)
        gettext.bindtextdomain(globals.assembly_name, globals.locale_directory)

        #Set the Glade file
        self.interface = gtk.glade.XML(globals.application_interface,
                                       'main_window')
        self.create_settings_directory()
        self.create_settings_file()
        log.write(globals.mount_log, _('Application started...'))
        self.set_storage_lists()
        self.set_history_entry()
        self.set_mounted_image_treeview()
        self.set_icons_and_text()
        self.load_mount_history()
        self.load_previously_mounted_images()

        HANDLERS_AND_METHODS = {
            'button_checksum_clicked': self.button_checksum_clicked,
            'button_browse_clicked': self.button_browse_clicked,
            'button_about_clicked': self.button_about_clicked,
            'button_view_log_clicked': self.button_view_log_clicked,
            'button_delete_log_clicked': self.button_delete_log_clicked,
            'button_mount_clicked': self.button_mount_clicked,
            'comboentry_image_key_release': self.comboentry_image_key_release,
            'comboentry_image_changed': self.comboentry_image_changed,
            'treeview_mounted_images_cursor_changed':
            self.treeview_mounted_images_cursor_changed,
            'button_unmount_clicked': self.button_unmount_clicked,
            'button_burn_clicked': self.button_burn_clicked,
            'treeview_mounted_images_drag_data_recieved':
            self.treeview_mounted_images_drag_data_recieved,
            'treeview_mounted_images_row_activated':
            self.treeview_mounted_images_row_activated,
            'destroy': self.destroy
        }
        self.interface.signal_autoconnect(HANDLERS_AND_METHODS)
        if (parameter != ''):
            try:
                imageaction.mount(
                    parameter, self.image_storage, self.history_storage,
                    self.history_array,
                    self.interface.get_widget('radiobutton_fuse').get_active())
            except OSError, (errno, strerror):
                messagebox.show(
                    self.interface.get_widget('main_window'),
                    _('Error mounting image.\nOS error(%s): %s' %
                      (errno, strerror)), gtk.MESSAGE_ERROR)
            except IOError, (errno, strerror):
                messagebox.show(
                    self.interface.get_widget('main_window'),
                    _('Error mounting image.\nIO error(%s): %s' %
                      (errno, strerror)), gtk.MESSAGE_ERROR)
示例#3
0
 def button_mount_clicked(self, data):
     try:
         imageaction.mount(
             self.interface.get_widget('label_selected_image').get_label(),
             self.image_storage, self.history_storage, self.history_array,
             self.interface.get_widget('radiobutton_fuse').get_active())
     except OSError, (errno, strerror):
         messagebox.show(
             self.interface.get_widget('main_window'),
             _('Error mounting image.\nOS error(%s): %s' %
               (errno, strerror)), gtk.MESSAGE_ERROR)
示例#4
0
    def treeview_mounted_images_drag_data_recieved(self, widget, context, x, y, sel, ttype, time):
        files = sel.data.split('\n')
        for file in files:
            if not file:
                continue

            file = file.strip()
            file = file.replace('%20', ' ')
            if file.startswith('file:///') and os.path.isfile(file[7:]):
                if self.verify_image(file[7:]):
                    try:
                        imageaction.mount(self.interface.get_widget('label_selected_image').get_label(), self.image_storage, self.history_storage, self.history_array, self.interface.get_widget('radiobutton_fuse').get_active())
                    except OSError, (errno, strerror):
                        messagebox.show(self.interface.get_widget('main_window'), _('Error mounting image.\nOS error(%s): %s' % (errno, strerror)), gtk.MESSAGE_ERROR)
                    except IOError, (errno, strerror):
                        messagebox.show(self.interface.get_widget('main_window'), _('Error mounting image.\nIO error(%s): %s' % (errno, strerror)), gtk.MESSAGE_ERROR)
                    except:
示例#5
0
    def __init__(self, parameter):
        
        # Localization
        locale.setlocale(locale.LC_ALL, '')
        gettext.textdomain(globals.assembly_name)
        gettext.bindtextdomain(globals.assembly_name, globals.locale_directory)

        #Set the Glade file
        self.interface = gtk.glade.XML(globals.application_interface, 'main_window')
        self.create_settings_directory()
        self.create_settings_file()
        log.write(globals.mount_log, _('Application started...'))
        self.set_storage_lists()
        self.set_history_entry()
        self.set_mounted_image_treeview()
        self.set_icons_and_text()
        self.load_mount_history()
        self.load_previously_mounted_images()

        HANDLERS_AND_METHODS = {
            'button_checksum_clicked': self.button_checksum_clicked,
            'button_browse_clicked': self.button_browse_clicked,
            'button_about_clicked': self.button_about_clicked,
            'button_view_log_clicked': self.button_view_log_clicked,
            'button_delete_log_clicked': self.button_delete_log_clicked,
            'button_mount_clicked': self.button_mount_clicked,
            'comboentry_image_key_release': self.comboentry_image_key_release,
            'comboentry_image_changed': self.comboentry_image_changed,
            'treeview_mounted_images_cursor_changed': self.treeview_mounted_images_cursor_changed,
            'button_unmount_clicked': self.button_unmount_clicked,
            'button_burn_clicked': self.button_burn_clicked,
            'treeview_mounted_images_drag_data_recieved': self.treeview_mounted_images_drag_data_recieved,
            'treeview_mounted_images_row_activated': self.treeview_mounted_images_row_activated,
            'destroy': self.destroy}
        self.interface.signal_autoconnect(HANDLERS_AND_METHODS)
        if (parameter != ''):
            try:
                imageaction.mount(parameter, self.image_storage, self.history_storage, self.history_array, self.interface.get_widget('radiobutton_fuse').get_active())
            except OSError, (errno, strerror):
                messagebox.show(self.interface.get_widget('main_window'), _('Error mounting image.\nOS error(%s): %s' % (errno, strerror)), gtk.MESSAGE_ERROR)
            except IOError, (errno, strerror):
                messagebox.show(self.interface.get_widget('main_window'), _('Error mounting image.\nIO error(%s): %s' % (errno, strerror)), gtk.MESSAGE_ERROR)
示例#6
0
 def button_mount_clicked(self, data):
     try:
         imageaction.mount(self.interface.get_widget('label_selected_image').get_label(), self.image_storage, self.history_storage, self.history_array, self.interface.get_widget('radiobutton_fuse').get_active())
     except OSError, (errno, strerror):
         messagebox.show(self.interface.get_widget('main_window'), _('Error mounting image.\nOS error(%s): %s' % (errno, strerror)), gtk.MESSAGE_ERROR)