Changeset 7393e9edfcd8…
Parent 428e88a2cdd2…
by
Changes to one file · Browse files at 7393e9edfcd8 Showing diff from parent 428e88a2cdd2 Diff from another changeset...
|
|
@@ -22,24 +22,22 @@ from tortoisehg.hgtk.logview.colormap import AnnotateColorSaturation
from tortoisehg.hgtk.logview.treeview import TreeView as LogTreeView
from tortoisehg.hgtk.logview import treemodel as LogTreeModelModule
-from tortoisehg.hgtk import gtklib, gdialog, changeset, statusbar
+from tortoisehg.hgtk import gtklib, gdialog, changeset, statusbar, csinfo
# Column indexes for grep
GCOL_REVID = 0
GCOL_LINE = 1 # matched line
-GCOL_EDESC = 2 # escaped summary
-GCOL_DESC = 3 # summary
-GCOL_PATH = 4
+GCOL_DESC = 2 # utf-8, escaped summary
+GCOL_PATH = 3
# Column indexes for annotation
ACOL_REVID = 0
ACOL_LINE = 1 # file line
-ACOL_EDESC = 2 # escaped summary
-ACOL_DESC = 3 # summary
-ACOL_PATH = 4
-ACOL_COLOR = 5
-ACOL_USER = 6
-ACOL_LNUM = 7 # line number
+ACOL_DESC = 2 # utf-8, escaped summary
+ACOL_PATH = 3
+ACOL_COLOR = 4
+ACOL_USER = 5
+ACOL_LNUM = 6 # line number
class DataMineDialog(gdialog.GWindow):
@@ -101,6 +99,8 @@ self.notebook = notebook
vbox.pack_start(self.notebook, True, True, 2)
+ self.stop_button.set_sensitive(False)
+
accelgroup = gtk.AccelGroup()
self.add_accel_group(accelgroup)
mod = gtklib.get_thg_modifier()
@@ -113,9 +113,16 @@ modifier, gtk.ACCEL_VISIBLE)
notebook.connect('thg-new', self.new_notebook)
+ # status bar
+ hbox = gtk.HBox()
+ style = csinfo.labelstyle(contents=('%(shortuser)s@%(revnum)s '
+ '%(dateage)s "%(summary)s"',), selectable=True)
+ self.cslabel = csinfo.create(self.repo, style=style)
+ hbox.pack_start(self.cslabel, False, False, 4)
self.stbar = statusbar.StatusBar()
- vbox.pack_start(self.stbar, False, False, 2)
- self.stop_button.set_sensitive(False)
+ hbox.pack_start(self.stbar)
+ vbox.pack_start(hbox, False, False)
+
return vbox
def _destroying(self, gtkobj):
@@ -258,9 +265,9 @@ text = hglib.tounicode(ctx.description()).replace(u'\0', '')
lines = text.splitlines()
summary = hglib.toutf(lines and lines[0] or '')
- desc = '%s@%s %s "%s"' % (author, rev, date, summary)
- desc_esc = gtklib.markup_escape_text(desc)
- self.changedesc[rev] = (desc, desc_esc, author)
+ desc = gtklib.markup_escape_text('%s@%s %s "%s"' % \
+ (author, rev, date, summary))
+ self.changedesc[rev] = (desc, author)
return self.changedesc[rev]
def search_clicked(self, button, data):
@@ -355,7 +362,6 @@ results = gtk.ListStore(str, # revision id
str, # matched line (utf-8)
str, # description (utf-8, escaped)
- str, # description (utf-8)
str) # file path (utf-8)
treeview.set_model(results)
treeview.set_search_equal_func(self.search_in_grep)
@@ -375,7 +381,7 @@ column.add_attribute(cell, 'text', col)
treeview.append_column(column)
if hasattr(treeview, 'set_tooltip_column'):
- treeview.set_tooltip_column(GCOL_EDESC)
+ treeview.set_tooltip_column(GCOL_DESC)
scroller = gtk.ScrolledWindow()
scroller.set_policy(gtk.POLICY_AUTOMATIC, gtk.POLICY_AUTOMATIC)
scroller.add(treeview)
@@ -490,11 +496,11 @@ (path, revid, text) = line.split(':', 2)
except ValueError:
continue
- desc, desc_esc, user = self.get_rev_desc(long(revid))
+ desc, user = self.get_rev_desc(long(revid))
if self.tabwidth:
text = text.expandtabs(self.tabwidth)
- model.append((revid, hglib.toutf(text[:512]), desc_esc,
- desc, hglib.toutf(path)))
+ model.append((revid, hglib.toutf(text[:512]), desc,
+ hglib.toutf(path)))
if thread.isAlive():
return True
else:
@@ -516,7 +522,7 @@ iter = model.get_iter(path)
self.currev = model[iter][GCOL_REVID]
self.curpath = hglib.fromutf(model[iter][GCOL_PATH])
- self.stbar.set_text(model[iter][GCOL_DESC])
+ self.cslabel.update(model[iter][GCOL_REVID])
def close_current_page(self):
num = self.notebook.get_current_page()
@@ -629,7 +635,6 @@ results = gtk.ListStore(str, # revision id
str, # file line (utf-8)
str, # description (utf-8, escaped)
- str, # description (utf-8)
str, # file path (utf-8)
str, # color
str, # author (utf-8)
@@ -660,7 +665,7 @@ self.add_header_context_menu(column, context_menu)
treeview.set_headers_clickable(True)
if hasattr(treeview, 'set_tooltip_column'):
- treeview.set_tooltip_column(ACOL_EDESC)
+ treeview.set_tooltip_column(ACOL_DESC)
results.path = path
results.rev = revid
scroller = gtk.ScrolledWindow()
@@ -808,12 +813,12 @@ rowrev = long(revid)
except ValueError:
continue
- desc, desc_esc, user = self.get_rev_desc(rowrev)
+ desc, user = self.get_rev_desc(rowrev)
ctx = self.repo[rowrev]
color = colormap.get_color(ctx, curdate)
if self.tabwidth:
text = text.expandtabs(self.tabwidth)
- model.append((revid, hglib.toutf(text[:512]), desc_esc, desc,
+ model.append((revid, hglib.toutf(text[:512]), desc,
hglib.toutf(path.strip()), color, user, len(model)+1))
if thread.isAlive():
return True
@@ -839,7 +844,7 @@ anniter = model.get_iter(path)
self.currev = model[anniter][ACOL_REVID]
self.path = model.path
- self.stbar.set_text(model[anniter][ACOL_DESC])
+ self.cslabel.update(model[anniter][ACOL_REVID])
def ann_button_release(self, widget, event, objs):
if event.button == 3 and not (event.state & (gtk.gdk.SHIFT_MASK |
|
Loading...