Пример #1
0
    def init(self, nodes):
        #############################################################
        # # IN in self.nodes:
        # #  - a list of PhotoNodes()
        # #
        # #
        # # OUT in self.reponse:
        # #  - boolean False : operation abandonned
        # #  - string : one comment for all the pictures
        # #  - [string,] : multi comments
        #############################################################
        self.main_widget.set_modal(True)
        self.main_widget.set_position(gtk.WIN_POS_CENTER)

        self.nodes = nodes

        self.selector = PictureSelector(self.nodes)
        self.hbox1.pack_start(self.selector)
        self.selector.connect("value_changed", self.on_selector_value_changed)
        self.selector.show()

        self.list = []
        for i in self.nodes:
            b = gtk.TextBuffer()
            b.set_text(i.comment)
            self.list.append((i, b))

        self.lbl_all.set_text(_("%d photo(s)") % len(self.list))
        if len(self.nodes) == 1:
            self.tv_all_comment.get_buffer().set_text(self.nodes[0].comment)
            self.notebook1.remove_page(1)
            self.tv_all_comment.grab_focus()
        else:
            self.setPhoto(0)
Пример #2
0
    def init(self, nodes):
        #############################################################
        # # IN in self.nodes:
        # #  - a list of PhotoNodes()
        #############################################################
        self.main_widget.set_modal(True)
        self.main_widget.set_position(gtk.WIN_POS_CENTER)

        self.nodes = nodes

        self.ignoredPattern = '.*0x.*'
        self.ignoredKeys = ['Exif.Photo.MakerNote']

        # # Set-up the Picture selector
        self.selector = PictureSelector(self.nodes)
        self.vbox2.pack_start
        self.vbox2.pack_start(self.selector)
        self.selector.connect("value_changed", self.on_selector_value_changed)
        self.selector.show()

        self.exifList = gtk.ListStore(str, str)

        self.treeview = gtk.TreeView(self.exifList)

        self.tagColumn = gtk.TreeViewColumn(_('Tag'))
        self.valueColumn = gtk.TreeViewColumn(_('Value'))

        self.treeview.append_column(self.tagColumn)
        self.treeview.append_column(self.valueColumn)

        self.cell = gtk.CellRendererText()

        self.tagColumn.pack_start(self.cell, True)
        self.valueColumn.pack_start(self.cell, True)

        self.tagColumn.add_attribute(self.cell, 'text', 0)
        self.valueColumn.add_attribute(self.cell, 'text', 1)

        # Gridlines commented out as libries shipped with current windows
        # jbrout pack do not support this, need new libs to enable.
        try:
            self.treeview.set_grid_lines(gtk.TREE_VIEW_GRID_LINES_BOTH)
        except:
            pass

        self.scrolledwindow1.add(self.treeview)

        self.scrolledwindow1.show_all()

        # Call set-photo to populate the table with the values for the
        # first picture
        self.setPhoto(0)