Example #1
0
    def _create_technical(self):
        vbox = Gtk.VBox()
        vbox.props.spacing = style.DEFAULT_SPACING

        if 'filesize' in self._metadata:
            filesize = self._metadata['filesize']
        else:
            filesize = model.get_file_size(self._metadata['uid'])

        lines = [
            _('Kind: %s') % (self._metadata.get('mime_type') or _('Unknown'),),
            _('Date: %s') % (self._format_date(),),
            _('Size: %s') % (format_size(int(filesize)))
        ]

        for line in lines:
            linebox = Gtk.HBox()
            vbox.pack_start(linebox, False, False, 0)

            text = Gtk.Label()
            text.set_markup('<span foreground="%s">%s</span>' % (
                style.COLOR_BUTTON_GREY.get_html(), line))
            linebox.pack_start(text, False, False, 0)

        return vbox
Example #2
0
    def _create_technical(self):
        vbox = Gtk.VBox()
        vbox.props.spacing = style.DEFAULT_SPACING

        if 'filesize' in self._metadata:
            filesize = self._metadata['filesize']
        else:
            filesize = model.get_file_size(self._metadata['uid'])

        lines = [
            _('Kind: %s') %
            (self._metadata.get('mime_type') or _('Unknown'), ),
            _('Date: %s') % (self._format_date(), ),
            _('Size: %s') % (format_size(int(filesize)))
        ]

        for line in lines:
            linebox = Gtk.HBox()
            vbox.pack_start(linebox, False, False, 0)

            text = Gtk.Label()
            text.set_markup('<span foreground="%s">%s</span>' %
                            (style.COLOR_BUTTON_GREY.get_html(), line))
            linebox.pack_start(text, False, False, 0)

        return vbox
Example #3
0
    def _create_technical(self):
        vbox = hippo.CanvasBox()
        vbox.props.spacing = style.DEFAULT_SPACING

        lines = [
            _('Kind: %s') %
            (self._metadata.get('mime_type') or _('Unknown'), ),
            _('Date: %s') % (self._format_date(), ),
            _('Size: %s') % (format_size(
                int(
                    self._metadata.get(
                        'filesize', model.get_file_size(
                            self._metadata['uid']))))),
        ]

        for line in lines:
            text = hippo.CanvasText(
                text=line, font_desc=style.FONT_NORMAL.get_pango_desc())
            text.props.color = style.COLOR_BUTTON_GREY.get_int()

            if gtk.widget_get_default_direction() == gtk.TEXT_DIR_RTL:
                text.props.xalign = hippo.ALIGNMENT_END
            else:
                text.props.xalign = hippo.ALIGNMENT_START

            vbox.append(text)

        return vbox
Example #4
0
    def _create_technical(self):
        vbox = Gtk.VBox()
        vbox.props.spacing = style.DEFAULT_SPACING
        hbox = Gtk.HBox()

        kind = _('Kind: ')
        kindlabel = Gtk.Label()
        kindlabel.set_markup('<span foreground="%s">%s</span>' % (
            style.COLOR_BUTTON_GREY.get_html(), kind))

        lines = [
            _('Date: %s') % (self._format_date(),),
            _('Size: %s') % (format_size(
                             int(self._metadata.get(
                                 'filesize',
                                 model.get_file_size(self._metadata['uid'])))))
        ]

        mimelist = Gtk.ListStore(str)
        generic_types = mime.get_all_generic_types()
        mimescombo = Gtk.ComboBox.new_with_model(mimelist)

        for sub_types in generic_types:
            for mime_type in sub_types.mime_types:
                mimelist.append([mime_type])

        for index, element in enumerate(mimelist):
            if element[0] == self._metadata['mime_type']:
                mimescombo.set_active(index)
                break

        mimescombo.connect("changed", self._mime_activated_cb)
        cell = Gtk.CellRendererText()
        cell.set_property("xalign", 0.5)
        cell.set_fixed_size(150, 18)
        mimescombo.pack_start(cell, True)
        mimescombo.add_attribute(cell, "text", 0)

        vbox.pack_start(hbox, False, False, 0)
        hbox.pack_start(kindlabel, False, False, 0)
        hbox.pack_start(mimescombo, False, False, 0)

        for line in lines:
            linebox = Gtk.HBox()
            vbox.pack_start(linebox, False, False, 0)

            text = Gtk.Label()
            text.set_markup('<span foreground="%s">%s</span>' % (
                style.COLOR_BUTTON_GREY.get_html(), line))
            linebox.pack_start(text, False, False, 0)

        return vbox
    def _create_technical(self):
        vbox = hippo.CanvasBox()
        vbox.props.spacing = style.DEFAULT_SPACING

        lines = [
            _('Kind: %s') % (self._metadata.get('mime_type') or _('Unknown'),),
            _('Date: %s') % (self._format_date(),),
            _('Size: %s') % (format_size(int(self._metadata.get('filesize',
                                model.get_file_size(self._metadata['uid']))))),
            ]

        for line in lines:
            text = hippo.CanvasText(text=line,
                font_desc=style.FONT_NORMAL.get_pango_desc())
            text.props.color = style.COLOR_BUTTON_GREY.get_int()

            if gtk.widget_get_default_direction() == gtk.TEXT_DIR_RTL:
                text.props.xalign = hippo.ALIGNMENT_END
            else:
                text.props.xalign = hippo.ALIGNMENT_START

            vbox.append(text)

        return vbox