[Pkg-bazaar-commits] ./bzr-gtk/unstable r614: Hide notify icon when not notifying.

Jelmer Vernooij jelmer at samba.org
Fri Apr 10 07:50:54 UTC 2009


------------------------------------------------------------
revno: 614
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Wed 2008-10-22 17:50:24 +0200
message:
  Hide notify icon when not notifying.
modified:
  bzr-notify
-------------- next part --------------
=== modified file 'bzr-notify'
--- a/bzr-notify	2008-07-18 20:01:12 +0000
+++ b/bzr-notify	2008-10-22 15:50:24 +0000
@@ -16,6 +16,7 @@
 menu = NotifyPopupMenu()
 icon = gtk.status_icon_new_from_file(icon_path("bzr-icon-64.png"))
 icon.connect('popup-menu', menu.display)
+icon.set_visible(False)
 
 import cgi
 import dbus
@@ -30,6 +31,9 @@
 BROADCAST_INTERFACE = "org.bazaarvcs.plugins.dbus.Broadcast"
 bus = dbus.SessionBus()
 
+def hide_icon():
+	icon.set_visible(False)
+
 def catch_branch(revision_id, urls):
 	# TODO: show all the urls, or perhaps choose the 'best'.
 	url = urls[0]
@@ -60,6 +64,8 @@
 			bd.run()
 		nw.add_action("inspect", "Inspect", start_viz, None)
 		nw.add_action("branch", "Branch", start_branch, None)
+		icon.set_visible(True)
+		gobject.timeout_add(5000, hide_icon)
 		nw.set_timeout(5000)
 		nw.show()
 	except Exception, e:



More information about the Pkg-bazaar-commits mailing list