def _add_where_is_it_commandline(self, pkgname):
cmdfinder = CmdFinder(self.cache)
cmds = cmdfinder.find_cmds_from_pkgname(pkgname)
if not cmds:
return
vb = Gtk.VBox()
vb.set_spacing(12)
self.installed_where_hbox.pack_start(vb, False, False, 0)
msg = gettext.ngettext(
_('This program is run from a terminal: '),
_('These programs are run from a terminal: '),
len(cmds))
title = Gtk.Label()
title.set_alignment(0, 0)
title.set_markup(msg)
title.set_line_wrap(True)
#~ title.set_size_request(self.get_allocation().width-24, -1)
vb.pack_start(title, False, False, 0)
cmds_str = ", ".join(cmds)
cmd_label = Gtk.Label(
label='<span font_desc="monospace bold 9">%s</span>' % cmds_str)
cmd_label.set_selectable(True)
cmd_label.set_use_markup(True)
cmd_label.set_alignment(0, 0.5)
cmd_label.set_padding(12, 0)
cmd_label.set_line_wrap(True)
vb.pack_start(cmd_label, False, False, 0)
self.installed_where_hbox.show_all()
评论列表
文章目录