Opened 10 years ago

Closed 10 years ago

#4372 closed Enhancement (fixed)

make notification and system sounds configurable

Reported by: jordan Owned by: jordan
Priority: Normal Milestone: 2.50
Component: GTK+ Client Version: 2.32
Severity: Normal Keywords:
Cc: biru.ionut@…

Description

Instead of compiling against libnotify and libcanberra, we could provide a settings.json entry to let users customize their desktop settings and to reduce our external library dependencies.

For playing sounds, we could use

canberra-gtk-play --id="complete-download" --description="Transmission download"

For desktop notification, we could use

notify-send "header" "secondary text" --category="transfer.complete" --urgency=low --icon=transmission

Attachments (2)

tools.diff (20.0 KB) - added by jordan 10 years ago.
0001-Use-Notification-DBus-API-instead-of-notify-send.patch (11.3 KB) - added by fmuellner 10 years ago.
Restore the original notification behavior without libnotify

Download all attachments as: .zip

Change History (10)

Changed 10 years ago by jordan

comment:1 Changed 10 years ago by jordan

  • Resolution set to fixed
  • Status changed from new to closed

comment:2 Changed 10 years ago by Username3

  • Resolution fixed deleted
  • Status changed from closed to reopened

This change seems to cause some troubles on my KDE machine running GTK version of T (and I really prefer it over Qt version since GTK version is more convenient in terms of compilation for me). The problem is that while machine haves all GTK+ libs and headers and standard libnotify library, which has worked for me, there is no "canberra-gtk-play" or "notify-send" programs at all and as for me, I have a very little idea why the ... I have to rely on some strange utilities rather than on, say, freedesktop.org notifications specifications.

comment:3 Changed 10 years ago by jordan

  • Resolution set to fixed
  • Status changed from reopened to closed

You can change "canberra-gtk-play" or "notify-send" to fit your needs in settings.json.

comment:4 Changed 10 years ago by Username3

You can change "canberra-gtk-play" or "notify-send" to fit your needs in settings.json.

Sure, but I think that's somewhat overcomplicated and looks like overkill or so (never thought I would tell something like this to T devs, yikes!). As far as I know, there was already hook to call script when torrent completes, so this option looks somewhat redundant to me? While feature which has worked "by default" for years has stopped working so I have to fix it. I can deal with it but average Joe would fail to do this I guess, while T attempts to be simple to use. Well, not a big deal anyway, just a minor annoyance.

comment:5 Changed 10 years ago by wonder

i pretty much hate this change, especially dropping libnotify support and use notify-send.

with this change you made notifications on gnome 3 ugly.

in the past the notification was show directly from the icon tray and you could open the directory from there and when more notifications were send, you had a pretty counter(gnome 3.2 feature)

now you have two two icons, one the transmission tray and one with a "notify-send" name having the transmission icon, you cannot open directories, you cannot count them.

basically dropping libnotify is a regression and should be reverted.

comment:6 Changed 10 years ago by wonder

  • Cc biru.ionut@… added
  • Resolution fixed deleted
  • Status changed from closed to reopened

Changed 10 years ago by fmuellner

Restore the original notification behavior without libnotify

comment:7 Changed 10 years ago by fmuellner

I have to agree with wonder that replacing libnotify with notify-send is a feature regression, in particular when using transmission in gnome3. Fortunately there is an alternative to reverting the patch - libnotify is just a small wrapper around the org.freedesktop.Notifications DBus API, and as GIO has gained native DBus support in version 2.26 (which coincidentally is the minimum version as required by transmission), the old functionality can be implemented by using the DBus API directly.

(The attached patch is rather verbose - I estimate that it could be trimmed down to about the original code size by removing overzealous type checks and using synchronous API; but then, the former should be a good safeguard against changes in the DBus API, and blocking functions in GUI apps are evil :) (though libnotify *does* indeed use the sync variants).

comment:8 Changed 10 years ago by jordan

  • Milestone changed from 2.40 to 2.50
  • Resolution set to fixed
  • Status changed from reopened to closed

Patch added in r13107. Thanks fmuellner!

Note: See TracTickets for help on using tickets.