24
25
from bzrlib.osutils import format_date
25
26
from bzrlib.util.bencode import bdecode
28
def _open_link(widget, uri):
29
subprocess.Popen(['sensible-browser', uri], close_fds=True)
31
gtk.link_button_set_uri_hook(_open_link)
33
class BugsTab(gtk.Table):
35
super(BugsTab, self).__init__(rows=5, columns=2)
36
self.set_row_spacings(6)
37
self.set_col_spacings(6)
41
for c in self.get_children():
44
self.hide_all() # Only shown when there are bugs
46
def add_bug(self, url, status):
47
button = gtk.LinkButton(url, url)
48
self.attach(button, 0, 1, self.count, self.count + 1,
49
gtk.EXPAND | gtk.FILL, gtk.FILL)
50
status_label = gtk.Label(status)
51
self.attach(status_label, 1, 2, self.count, self.count + 1,
52
gtk.EXPAND | gtk.FILL, gtk.FILL)
27
57
class RevisionView(gtk.Notebook):
28
58
""" Custom widget for commit log details.
177
208
self.file_info_box.hide()
210
self.bugs_table.clear()
211
bugs_text = revision.properties.get('bugs', None)
213
for bugline in bugs_text.splitlines():
214
(url, status) = bugline.split(" ")
215
self.bugs_table.add_bug(url, status)
179
217
def update_tags(self):
180
218
if self._branch is not None and self._branch.supports_tags():
181
219
self._tagdict = self._branch.tags.get_reverse_tag_dict()
470
def _create_bugs(self):
471
self.bugs_table = BugsTab()
472
self.append_page(self.bugs_table, tab_label=gtk.Label('Bugs'))
432
474
def _create_file_info_view(self):
433
475
self.file_info_box = gtk.VBox(False, 6)
434
476
self.file_info_box.set_border_width(6)