After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 650533 - Make notifications less annoying
Make notifications less annoying
Status: RESOLVED FIXED
Product: jhbuild
Classification: Infrastructure
Component: general
unspecified
Other All
: Normal enhancement
: ---
Assigned To: Jhbuild maintainers
Jhbuild QA
Depends on:
Blocks:
 
 
Reported: 2011-05-18 22:59 UTC by Jasper St. Pierre (not reading bugmail)
Modified: 2011-11-28 11:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Use pynotify instead of notify-send (2.52 KB, patch)
2011-05-18 22:59 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
Clear the current notification at the start of a phase (1.49 KB, patch)
2011-05-18 22:59 UTC, Jasper St. Pierre (not reading bugmail)
needs-work Details | Review
Use raw DBus instead of notify-send (2.55 KB, patch)
2011-05-23 19:49 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
Use raw DBus instead of notify-send (2.64 KB, patch)
2011-07-29 13:55 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
Use raw DBus instead of notify-send (2.74 KB, patch)
2011-08-03 23:53 UTC, Jasper St. Pierre (not reading bugmail)
none Details | Review
Use raw DBus instead of notify-send (2.74 KB, patch)
2011-08-04 00:00 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review
Clear the current notification at the start of a phase (1.46 KB, patch)
2011-11-26 10:55 UTC, Jasper St. Pierre (not reading bugmail)
committed Details | Review

Description Jasper St. Pierre (not reading bugmail) 2011-05-18 22:59:53 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.
Comment 1 Jasper St. Pierre (not reading bugmail) 2011-05-18 22:59:55 UTC
Created attachment 188085 [details] [review]
Use pynotify instead of notify-send

Additionally, update notifications instead of creating new ones every time.
Comment 2 Jasper St. Pierre (not reading bugmail) 2011-05-18 22:59:58 UTC
Created attachment 188086 [details] [review]
Clear the current notification at the start of a phase
Comment 3 Colin Walters 2011-05-18 23:01:14 UTC
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.
Comment 4 Colin Walters 2011-05-18 23:01:34 UTC
(And have the gtk frontend install a .desktop file, be application tracked etc. for GNOME 3 integration)
Comment 5 Craig Keogh 2011-05-23 05:03:20 UTC
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):
  • File "/usr/lib64/python2.7/site-packages/gtk-2.0/gi/importer.py", line 52 in find_module
    repository.require(namespace)
RepositoryError: 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
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):
  • File "/usr/lib64/python2.7/site-packages/gtk-2.0/gi/importer.py", line 52 in find_module
    repository.require(namespace)
RepositoryError: 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
/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 .
Comment 6 Jasper St. Pierre (not reading bugmail) 2011-05-23 05:40:01 UTC
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.
Comment 7 Frederic Peters 2011-05-23 07:17:32 UTC
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).
Comment 8 Jasper St. Pierre (not reading bugmail) 2011-05-23 19:49:44 UTC
Created attachment 188418 [details] [review]
Use raw DBus instead of notify-send

Additionally, update notifications instead of creating new ones every time.
Comment 9 Thomas Andersen 2011-07-12 22:46:34 UTC
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")
Comment 10 Jasper St. Pierre (not reading bugmail) 2011-07-29 13:55:31 UTC
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.
Comment 11 Jasper St. Pierre (not reading bugmail) 2011-08-03 23:53:50 UTC
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.
Comment 12 Jasper St. Pierre (not reading bugmail) 2011-08-04 00:00:40 UTC
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 13 Craig Keogh 2011-08-10 12:05:22 UTC
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
Comment 14 Jasper St. Pierre (not reading bugmail) 2011-11-26 10:24:43 UTC
(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?
Comment 15 Craig Keogh 2011-11-26 10:42:24 UTC
Review of attachment 188086 [details] [review]:

Sorry, I missed it because the bug is closed. Can you update the patch for git master please?
Comment 16 Jasper St. Pierre (not reading bugmail) 2011-11-26 10:55:09 UTC
Created attachment 202174 [details] [review]
Clear the current notification at the start of a phase

Sure thing.
Comment 17 Craig Keogh 2011-11-28 11:26:55 UTC
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