GNOME Bugzilla – Bug 650533
Make notifications less annoying
Last modified: 2011-11-28 11:26:55 UTC
While we disabled notifications, I actually find them quite useful, but with some caveats. You don't have to re-enable them by default, but I've hopefully made them less irritating.
Created attachment 188085 [details] [review] Use pynotify instead of notify-send Additionally, update notifications instead of creating new ones every time.
Created attachment 188086 [details] [review] Clear the current notification at the start of a phase
Personally, I think it would make some sense to work on having the jhbuild GTK frontend use the notifications by default, and the terminal one not.
(And have the gtk frontend install a .desktop file, be application tracked etc. for GNOME 3 integration)
Comment on attachment 188085 [details] [review] Use pynotify instead of notify-send Thank you for the patches. With both attachment 188085 [details] [review] and attachment 188086 [details] [review] applied I get the following: jhbuild buildone opal E: Failed to load typelib file '/opt/gnome/lib64/girepository-1.0/GObject-2.0.typelib' for namespace 'GObject': Typelib version mismatch; expected 3, found 4 Traceback (most recent call last):
+ Trace 227217
repository.require(namespace)
E: Failed to load typelib file '/opt/gnome/lib64/girepository-1.0/GObject-2.0.typelib' for namespace 'GObject': Typelib version mismatch; expected 3, found 4 Traceback (most recent call last):
/usr/lib64/python2.7/site-packages/gtk-2.0/gtk/__init__.py:40: RuntimeWarning: tp_compare didn't return -1 or -2 for exception from gtk import _gtk Traceback (most recent call last): File "/usr/lib64/python2.7/site-packages/gtk-2.0/gi/__init__.py", line 27, in <module> from gi.repository import GObject ImportError: cannot import name GObject *** Checking out opal *** [1/1] svn update --accept postpone .
I have no idea what's importing gi. Closest thing I can think of is this F15 patch: http://pkgs.fedoraproject.org/gitweb/?p=notify-python.git;a=blob;f=notify-python-0.1.1-fix-GTK-symbols.patch Does 'import gtk' pull in gi? In that case, see if changing "except ImportError" to a bare "except" fixes it.
I would prefer not to depend on an external python module for notifications; if notify-send doesn't cut it anymore, perhaps you could try to use straight dbus, (fwiw it's already used by trayicon.py to check for persistence support).
Created attachment 188418 [details] [review] Use raw DBus instead of notify-send Additionally, update notifications instead of creating new ones every time.
Review of attachment 188418 [details] [review]: ::: jhbuild/utils/notify.py @@ +41,3 @@ + return dbus.Interface(proxy, dbus_interface='org.freedesktop.Notifications') + + def notify(self, summary, body, icon = None, expire = 0): icon = None does not work here. It must be a string. Maybe icon = "" ? @@ +52,3 @@ + if self.notif_id != 0: + self.iface.CloseNotification(self.notif_id) + self.notif_id = 0 It would be nice to include some test code like: if __name__ == '__main__': n = Notify() n.notify("A summary", "A body text")
Created attachment 192876 [details] [review] Use raw DBus instead of notify-send Additionally, update notifications instead of creating new ones every time. OK, that works.
Created attachment 193209 [details] [review] Use raw DBus instead of notify-send Additionally, update notifications instead of creating new ones every time. Don't throw up if the Notifications isn't available.
Created attachment 193210 [details] [review] Use raw DBus instead of notify-send Additionally, update notifications instead of creating new ones every time. Don't throw up if org.fd.Notifications has gone missing.
Comment on attachment 193210 [details] [review] Use raw DBus instead of notify-send Thank you for the patch. Committed. http://git.gnome.org/browse/jhbuild/commit/?id=1ef01d23ab93f5b0e75b1c4ac99d128edfcaf6a1
(In reply to comment #2) > Created an attachment (id=188086) [details] [review] > Clear the current notification at the start of a phase Can I have a ping on this patch?
Review of attachment 188086 [details] [review]: Sorry, I missed it because the bug is closed. Can you update the patch for git master please?
Created attachment 202174 [details] [review] Clear the current notification at the start of a phase Sure thing.
Comment on attachment 202174 [details] [review] Clear the current notification at the start of a phase Thank you. Committed. http://git.gnome.org/browse/jhbuild/commit/?id=f6c04b77244bed314183f6899079575adbb52ab3