[Pkg-bazaar-commits] ./bzr-gtk/unstable r582: Disable the ability to click on tags that are not available in the current view (Jelmer Vernooij)
Martin Albisetti
argentina at gmail.com
Fri Apr 10 07:50:46 UTC 2009
------------------------------------------------------------
revno: 582
committer: Martin Albisetti <argentina at gmail.com>
branch nick: gtk.dev
timestamp: Sat 2008-08-02 17:44:17 -0300
message:
Disable the ability to click on tags that are not available in the current view (Jelmer Vernooij)
modified:
branchview/treeview.py
viz/branchwin.py
------------------------------------------------------------
revno: 576.5.1
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Sat 2008-07-26 21:23:11 +0200
message:
Disable the ability to click on tags that are not available in the current view.
modified:
branchview/treeview.py
viz/branchwin.py
-------------- next part --------------
=== modified file 'branchview/treeview.py'
--- a/branchview/treeview.py 2008-07-25 22:23:54 +0000
+++ b/branchview/treeview.py 2008-08-02 20:44:17 +0000
@@ -93,7 +93,9 @@
(gobject.TYPE_PYOBJECT, gobject.TYPE_PYOBJECT)),
'tag-added': (gobject.SIGNAL_RUN_FIRST,
gobject.TYPE_NONE,
- (gobject.TYPE_STRING, gobject.TYPE_STRING))
+ (gobject.TYPE_STRING, gobject.TYPE_STRING)),
+ 'refreshed': (gobject.SIGNAL_RUN_FIRST, gobject.TYPE_NONE,
+ ())
}
def __init__(self, branch, start, maxnum, compact=True):
@@ -125,6 +127,7 @@
self.iter = None
self.branch = branch
self.revision = None
+ self.index = {}
self.start = start
self.maxnum = maxnum
@@ -180,6 +183,9 @@
"""Return revision id of currently selected revision, or None."""
return self.get_property('revision')
+ def has_revision_id(self, revision_id):
+ return (revision_id in self.index)
+
def set_revision(self, revision):
self.set_property('revision', revision)
@@ -311,6 +317,7 @@
else:
self.set_revision(revision)
+ self.emit('refreshed')
return False
finally:
self.progress_bar.finished()
=== modified file 'viz/branchwin.py'
--- a/viz/branchwin.py 2008-07-25 13:32:06 +0000
+++ b/viz/branchwin.py 2008-07-26 19:23:11 +0000
@@ -230,7 +230,6 @@
tag_image.set_from_file(icon_path("tag-16.png"))
self.go_menu_tags = gtk.ImageMenuItem("_Tags")
self.go_menu_tags.set_image(tag_image)
- self._update_tags()
go_menu.add(go_menu_next)
go_menu.add(go_menu_prev)
@@ -294,6 +293,7 @@
self.treeview.connect('revision-activated',
self._tree_revision_activated)
+ self.treeview.connect('refreshed', lambda w: self._update_tags())
self.treeview.connect('tag-added', lambda w, t, r: self._update_tags())
for col in ["revno", "date"]:
@@ -572,14 +572,14 @@
if self.branch.supports_tags():
tags = self.branch.tags.get_tag_dict().items()
- tags.sort()
- tags.reverse()
+ tags.sort(reverse=True)
for tag, revid in tags:
tag_image = gtk.Image()
tag_image.set_from_file(icon_path('tag-16.png'))
tag_item = gtk.ImageMenuItem(tag.replace('_', '__'))
tag_item.set_image(tag_image)
tag_item.connect('activate', self._tag_selected_cb, revid)
+ tag_item.set_sensitive(self.treeview.has_revision_id(revid))
menu.add(tag_item)
self.go_menu_tags.set_submenu(menu)
More information about the Pkg-bazaar-commits
mailing list