Changeset fb20dc4e763b…
Parent b65003fd7e25…
by
Changes to 2 files · Browse files at fb20dc4e763b Showing diff from parent b65003fd7e25 Diff from another changeset...
@@ -365,10 +365,10 @@ str) # file path (utf-8)
treeview.set_model(results)
treeview.set_search_equal_func(self.search_in_grep)
- for title, width, col, emode in (
- (_('Rev'), 10, GCOL_REVID, pango.ELLIPSIZE_NONE),
- (_('File'), 25, GCOL_PATH, pango.ELLIPSIZE_START),
- (_('Matches'), 80, GCOL_LINE, pango.ELLIPSIZE_END)):
+ for title, width, ttype, col, emode in (
+ (_('Rev'), 10, 'text', GCOL_REVID, pango.ELLIPSIZE_NONE),
+ (_('File'), 25, 'text', GCOL_PATH, pango.ELLIPSIZE_START),
+ (_('Matches'), 80, 'markup', GCOL_LINE, pango.ELLIPSIZE_END)):
cell = gtk.CellRendererText()
cell.set_property('width-chars', width)
cell.set_property('ellipsize', emode)
@@ -378,7 +378,7 @@ column.set_sizing(gtk.TREE_VIEW_COLUMN_FIXED)
column.set_fixed_width(cell.get_size(treeview)[2])
column.pack_start(cell, expand=True)
- column.add_attribute(cell, 'text', col)
+ column.add_attribute(cell, ttype, col)
treeview.append_column(column)
if hasattr(treeview, 'set_tooltip_column'):
treeview.set_tooltip_column(GCOL_DESC)
@@ -461,7 +461,7 @@
def threadfunc(q, *args):
try:
- hglib.hgcmd_toq(q, *args)
+ hglib.hgcmd_toq(q, *args, label=True)
except (util.Abort, error.LookupError), e:
self.stbar.set_text(_('Abort: %s') % str(e))
@@ -492,7 +492,11 @@ """
text = ''
while q.qsize():
- text += q.get(0)
+ data, label = q.get(0)
+ if label == 'grep.match':
+ text += '<span foreground="red"><b>%s</b></span>' % data
+ else:
+ text += data
for line in text.splitlines():
try:
|
@@ -310,11 +310,12 @@ return tools
-def hgcmd_toq(q, *args):
+def hgcmd_toq(q, *args, **opts):
'''
Run an hg command in a background thread, pipe all output to a Queue
object. Assumes command is completely noninteractive.
'''
+ label = opts.get('label', False)
class Qui(ui.ui):
def __init__(self, src=None):
super(Qui, self).__init__(src)
@@ -325,7 +326,10 @@ self._buffers[-1].extend([str(a) for a in args])
else:
for a in args:
- q.put(str(a))
+ if label:
+ q.put((str(a), opts.get('label', '')))
+ else:
+ q.put(str(a))
def plain(self):
return True
|
Loading...