Make the commit message box hypertext

So that commentlinks run on it.

Change-Id: Iab75f35807a6978ddad6f2c0b485f9aa953fec6d
This commit is contained in:
James E. Blair 2014-08-17 15:00:45 -07:00
parent 98f94be285
commit 3d93f7a13a
2 changed files with 15 additions and 2 deletions

View File

@ -120,7 +120,7 @@ class HyperText(urwid.Text):
self._mouse_press_item = None
self.selectable_items = []
self.focused_index = None
self.last_focused_index = None
self.last_focused_index = 0
super(HyperText, self).__init__(markup, align, wrap, layout)
def focusFirstItem(self):

View File

@ -269,6 +269,17 @@ class ChangeMessageBox(mywid.HyperText):
comment_text = commentlink.run(app, comment_text)
self.set_text(text+comment_text)
class CommitMessageBox(mywid.HyperText):
def __init__(self, app, message):
self.app = app
super(CommitMessageBox, self).__init__(message)
def set_text(self, text):
text = [text]
for commentlink in self.app.config.commentlinks:
text = commentlink.run(self.app, text)
super(CommitMessageBox, self).set_text(text)
class ChangeView(urwid.WidgetWrap):
_help = """
<c> Checkout the most recent revision into the local repo.
@ -319,7 +330,7 @@ class ChangeView(urwid.WidgetWrap):
row = urwid.Columns([(12, urwid.Text(('change-header', l), wrap='clip')), v])
change_info.append(row)
change_info = urwid.Pile(change_info)
self.commit_message = urwid.Text(u'')
self.commit_message = CommitMessageBox(app, u'')
votes = mywid.Table([])
self.depends_on = urwid.Pile([])
self.depends_on_rows = {}
@ -344,6 +355,8 @@ class ChangeView(urwid.WidgetWrap):
self.checkGitRepo()
self.refresh()
self.listbox.set_focus(0)
top.set_focus(0)
def checkGitRepo(self):
missing_revisions = set()