Warning: Can't synchronize with the repository (Unsupported version control system "svn": "/usr/lib64/libsvn_ra_neon-1.so.0: undefined symbol: svn_compat_wrap_file_rev_handler" ). Look in the Trac log for more information.

Ticket #150 (new enhancement)

Opened 22 months ago

Last modified 21 months ago

use libnotify to display notifications

Reported by: Killarny Owned by: ekilfoil
Priority: minor Milestone: Unscheduled
Component: gui Version:
Keywords: Cc:

Description

Use libnotify to display information that would trigger a notification sound (login, logout, user starts transmitting, user joins/leaves channel) or whatever would be shown on the overlay osd.

Attachments

libnotify.patch Download (10.4 KB) - added by x87bliss 21 months ago.
Initial patch for libnotify support
libnotify.2.patch Download (24.1 KB) - added by x87bliss 21 months ago.
Fix small memory leak on my end; and remove icon to avoid memory leak in Ubuntu

Change History

Changed 21 months ago by x87bliss

I was really excited by this idea and decided to do some work myself. I'll be submitting a patch after writing this explanation. The patch is made against r832.

First I added the '--disable-notify' option to configure, and added two new source files (/src/manglernotify[.cpp+.h]). Consequently, after applying the patch you must run "autoreconf" to update ./configure and all the makefiles.

Configure will check for libnotify as an optional dependency. You'll need the 'libnotify-dev' package to compile with libnotify support. If this package is not installed, Mangler will still compile just w/o libnotify support.

I made a new class "ManglerNotify?" which is very similar to ManglerG15.

I also added a "getUserName" function to ChannelTree? (the function is a modified copy pasta of getLastTransmit). This function is used to get the name of a user who is disconnecting from the server, but before they are removed from the tree (since you can't use the v3 function to get the user name at this point).

Currently I have the following notifications:
"You connected to: (server lobby name)"
"You disconnected from server"
"(Some user name) connected to server"
"(Some user name) disconnected from server"
"Switched to: (some channel name)"
"Switched to the lobby"
"(Some user name) joined the channel"
"(Some user name) left the channel"

The messages are shown at most 5 at a time, with the newest at the top of the list. Each time an event is added, all events which are at least 10 seconds old are removed from the list.

This patch probably isn't ready to go as it is. I'm hoping whoever does implement this feature can at least use this patch as a starting point (or at least as reference). I will conclude with some things to consider about the patch.

What probably still needs to be done:
1) Adding an option somewhere in the GUI to turn off the notifications (they may annoy some users).
2) Maybe adding options for toggling notification types (i.e. when people join/leave server, channel, etc..)
3) Maybe adding another function in addition to 'addevent' which would list the users currently transmitting. This list should probably be displayed above the list of events.

What needs to be tested:
1) What happens if Mangler is compiled with libnotify, but is run on a PC that doesn't have libnotify installed? Will it cause Mangler to not run?
2) Probably other things.

Changed 21 months ago by x87bliss

Initial patch for libnotify support

Changed 21 months ago by Haxar

tl;dr

Just join us on IRC.

irc.freenode.net #mangler

Changed 21 months ago by x87bliss

Fixed some gobject existence error when closing Mangler if no notifications were shown during Mangler's run.

Fixed when you log onto a server, you no longer get a bunch of "(User name) joined the channel" notifications for each existing user.

Added optional "transmit" notifications. It displays a notification when people start/stop transmitting which lists who is currently transmitting.

Added two options to the "Settings" window. One to enable notifications, and another to enable to "transmit notifications" (currently dependent on notifications being turned on as well).

Changed 21 months ago by x87bliss

Fix small memory leak on my end; and remove icon to avoid memory leak in Ubuntu

Note: See TracTickets for help on using tickets.