Exemple #1
0
    def __init__(self, window):
        super(_EditArchiveDialog, self).__init__(_('Edit archive'), window, gtk.DIALOG_MODAL,
            (gtk.STOCK_CANCEL, gtk.RESPONSE_CANCEL))

        self._accept_changes_button = self.add_button(gtk.STOCK_APPLY, gtk.RESPONSE_APPLY)

        self.kill = False # Dialog is killed.
        self.file_handler = window.filehandler
        self._window = window
        self._imported_files = []

        self._save_button = self.add_button(gtk.STOCK_SAVE_AS, constants.RESPONSE_SAVE_AS)

        self._import_button = self.add_button(_('_Import'), constants.RESPONSE_IMPORT)
        self._import_button.set_image(gtk.image_new_from_stock(gtk.STOCK_ADD,
            gtk.ICON_SIZE_BUTTON))

        self.set_border_width(4)
        self.resize(min(gtk.gdk.screen_get_default().get_width() - 50, 750),
            min(gtk.gdk.screen_get_default().get_height() - 50, 600))

        self.connect('response', self._response)

        self._image_area = edit_image_area._ImageArea(self, window)
        self._comment_area = edit_comment_area._CommentArea(self)

        notebook = gtk.Notebook()
        notebook.set_border_width(6)
        notebook.append_page(self._image_area, gtk.Label(_('Images')))
        notebook.append_page(self._comment_area, gtk.Label(_('Comment files')))
        self.vbox.pack_start(notebook)

        self.show_all()

        gobject.idle_add(self._load_original_files)
Exemple #2
0
    def __init__(self, window):
        super(_EditArchiveDialog, self).__init__(title=_('Edit archive'),
                                                 modal=True)
        self.set_transient_for(window)
        self.add_buttons(Gtk.STOCK_CANCEL, Gtk.ResponseType.CANCEL)

        self._accept_changes_button = self.add_button(Gtk.STOCK_APPLY,
                                                      Gtk.ResponseType.APPLY)

        self.kill = False  # Dialog is killed.
        self.file_handler = window.filehandler
        self._window = window
        self._imported_files = []

        self._save_button = self.add_button(Gtk.STOCK_SAVE_AS,
                                            constants.RESPONSE_SAVE_AS)

        self._import_button = self.add_button(_('_Import'),
                                              constants.RESPONSE_IMPORT)
        self._import_button.set_image(
            Gtk.Image.new_from_stock(Gtk.STOCK_ADD, Gtk.IconSize.BUTTON))

        self.set_border_width(4)
        self.resize(min(Gdk.Screen.get_default().get_width() - 50, 750),
                    min(Gdk.Screen.get_default().get_height() - 50, 600))

        self.connect('response', self._response)

        self._image_area = edit_image_area._ImageArea(self, window)
        self._comment_area = edit_comment_area._CommentArea(self)

        notebook = Gtk.Notebook()
        notebook.set_border_width(6)
        notebook.append_page(self._image_area, Gtk.Label(label=_('Images')))
        notebook.append_page(self._comment_area,
                             Gtk.Label(label=_('Comment files')))
        self.vbox.pack_start(notebook, True, True, 0)

        self.show_all()

        GLib.idle_add(self._load_original_files)