diff options
-rw-r--r-- | AUTHORS | 2 | ||||
-rw-r--r-- | ChangeLog | 106 | ||||
-rwxr-xr-x | configure | 56 | ||||
-rw-r--r-- | configure.ac | 18 | ||||
-rw-r--r-- | debian/changelog | 25 | ||||
-rw-r--r-- | debian/control | 2 | ||||
-rw-r--r-- | debian/copyright | 2 | ||||
-rw-r--r-- | src/gen-messages-service.xml.c | 4 | ||||
-rw-r--r-- | src/indicator-messages.c | 27 | ||||
-rw-r--r-- | src/messages-service-dbus.c | 9 | ||||
-rw-r--r-- | src/messages-service.c | 39 | ||||
-rw-r--r-- | src/messages-service.xml | 4 |
12 files changed, 239 insertions, 55 deletions
@@ -1,12 +1,14 @@ # Generated by Makefile. Do not edit. Andrea Cimitan + Chris Coulson cody David Barth James Westby Kees Cook Ken VanDine Luke Yelavich + Marco Trevisan (Treviño) Michael Terry Sebstien Bacher Ted Gould @@ -1,5 +1,111 @@ # Generated by Makefile. Do not edit. +2011-08-11 Ted Gould <ted@gould.cx> + + 0.4.93 + +2011-08-11 Ted Gould <ted@gould.cx> + + Migrating to libindicate 0.6 API + +2011-07-22 Ted Gould <ted@gould.cx> + + Add a clear attention menu item and attach it to middle click + +2011-07-22 Ted Gould <ted@gould.cx> + + Make sure clear attention stays at the end + +2011-07-22 Ted Gould <ted@gould.cx> + + No need to track the last separator as we now have a menu item below it. + +2011-07-22 Ted Gould <ted@gould.cx> + + Adding in the clear attention menu item + +2011-07-21 Ted Gould <ted@gould.cx> + + Removing the menu item from the indicator + +2011-07-21 Ted Gould <ted@gould.cx> + + Responding to clear attention method by clearing the dot + +2011-07-21 Ted Gould <ted@gould.cx> + + Switching to calling a method instead of clearing in the indictor. + +2011-07-21 Ted Gould <ted@gould.cx> + + Removing Watch method as that's been moved to libindicator (for a while) + +2011-07-21 Ted Gould <ted@gould.cx> + + Adding a method to clear the attention + +2011-07-21 Marco Trevisan (Treviño) <mail@3v1n0.net> + + Don't use g_return_if_fail in middle-click cb function + + We don't need an assertion there. + +2011-07-21 Marco Trevisan (Treviño) <mail@3v1n0.net> + + X and Y pointer position aren't supported anymore by libindicator + + Dropping them! + +2011-07-19 Marco Trevisan (Treviño) <mail@3v1n0.net> + + Added a "Clear notifications" menu as well... + +2011-07-19 Marco Trevisan (Treviño) <mail@3v1n0.net> + + Merge with upstream + +2011-07-11 Marco Trevisan (Treviño) <mail@3v1n0.net> + + Reset the un-attention icon on secondary-activate over indicator + + When the messaging menu is in the "attention" state, middle-clicking + over the indicator-messages will clear the attention icon. + +2011-07-11 Marco Trevisan (Treviño) <mail@3v1n0.net> + + configure.ac: Use the "--with-gtk" option flag. + + Use this flag, as all other projects in unity and indicators land + +2011-07-22 Ted Gould <ted@gould.cx> + + Making mail applications based on the default mail client not a hardcoded desktop file. + +2011-07-22 Ted Gould <ted@gould.cx> + + Use the G_N_ELEMENTS macro + +2011-07-22 Ted Gould <ted@gould.cx> + + Reworking found slightly to make clean up code nicer + +2011-07-21 Chris Coulson <chrisccoulson@ubuntu.com> + + Honour the default mail client rather than hardcoding the Mail entry to point to Evolution + +2011-07-22 Ted Gould <ted@gould.cx> + + Make sure to insert in the right locations + +2011-07-22 Chris Coulson <chrisccoulson@ubuntu.com> + + Make all indicator entries appear after an applications shortcuts + + Currently, indicator_added and resort_menu have different ideas of where they should go. + indicator_added puts them before shortcuts, whereas resort_menu will move the shortcuts + before them. This leads to a situation where shortcut entries end up inbetween an applications + indicator entries (and this happens a lot with Thunderbird) + 2011-07-14 Ted Gould <ted@gould.cx> 0.4.92 @@ -799,7 +799,7 @@ with_sysroot enable_libtool_lock enable_silent_rules enable_deprecations -with_indicator_gtk +with_gtk enable_localinstall ' ac_precious_vars='build_alias @@ -1466,7 +1466,7 @@ Optional Packages: --with-gnu-ld assume the C compiler uses GNU ld [default=no] --with-sysroot=DIR Search for dependent libraries within DIR (or the compiler's sysroot if not specified). - --with-indicator-gtk Which version of gtk to use for the indicator + --with-gtk Which version of gtk to use for the indicator [default=3] Some influential environment variables: @@ -2758,7 +2758,7 @@ fi # Define the identity of the package. PACKAGE=indicator-messages - VERSION=0.4.92 + VERSION=0.4.93 cat >>confdefs.h <<_ACEOF @@ -12794,11 +12794,11 @@ INDICATOR_REQUIRED_VERSION=0.3.19 DBUSMENUGTK_REQUIRED_VERSION=0.3.94 -# Check whether --with-indicator-gtk was given. -if test "${with_indicator_gtk+set}" = set; then : - withval=$with_indicator_gtk; +# Check whether --with-gtk was given. +if test "${with_gtk+set}" = set; then : + withval=$with_gtk; else - with_indicator_gtk=3 + with_gtk=3 fi @@ -12922,7 +12922,7 @@ $as_echo "no" >&6; } PKG_CONFIG="" fi fi -if test "x$with_indicator_gtk" = x3; then : +if test "x$with_gtk" = x3; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for APPLET" >&5 @@ -12935,12 +12935,12 @@ if test -n "$APPLET_CFLAGS"; then { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 >= \$GTK3_REQUIRED_VERSION gio-unix-2.0 >= \$GIO_UNIX_REQUIRED_VERSION indicator3-0.4 >= \$INDICATOR_REQUIRED_VERSION - indicate-0.5 >= \$INDICATE_REQUIRED_VERSION + indicate-0.6 >= \$INDICATE_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= \$DBUSMENUGTK_REQUIRED_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= $GTK3_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 @@ -12948,7 +12948,7 @@ if test -n "$APPLET_CFLAGS"; then pkg_cv_APPLET_CFLAGS=`$PKG_CONFIG --cflags "gtk+-3.0 >= $GTK3_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else @@ -12964,12 +12964,12 @@ if test -n "$APPLET_LIBS"; then { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-3.0 >= \$GTK3_REQUIRED_VERSION gio-unix-2.0 >= \$GIO_UNIX_REQUIRED_VERSION indicator3-0.4 >= \$INDICATOR_REQUIRED_VERSION - indicate-0.5 >= \$INDICATE_REQUIRED_VERSION + indicate-0.6 >= \$INDICATE_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= \$DBUSMENUGTK_REQUIRED_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-3.0 >= $GTK3_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 @@ -12977,7 +12977,7 @@ if test -n "$APPLET_LIBS"; then pkg_cv_APPLET_LIBS=`$PKG_CONFIG --libs "gtk+-3.0 >= $GTK3_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else @@ -13002,13 +13002,13 @@ fi APPLET_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-3.0 >= $GTK3_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION" 2>&1` else APPLET_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-3.0 >= $GTK3_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION" 2>&1` fi # Put the nasty error message in config.log where it belongs @@ -13017,7 +13017,7 @@ fi as_fn_error $? "Package requirements (gtk+-3.0 >= $GTK3_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION) were not met: $APPLET_PKG_ERRORS @@ -13051,7 +13051,7 @@ $as_echo "yes" >&6; } fi -elif test "x$with_indicator_gtk" = x2; then : +elif test "x$with_gtk" = x2; then : pkg_failed=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for APPLET" >&5 @@ -13064,12 +13064,12 @@ if test -n "$APPLET_CFLAGS"; then { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= \$GTK_REQUIRED_VERSION gio-unix-2.0 >= \$GIO_UNIX_REQUIRED_VERSION indicator-0.4 >= \$INDICATOR_REQUIRED_VERSION - indicate-0.5 >= \$INDICATE_REQUIRED_VERSION + indicate-0.6 >= \$INDICATE_REQUIRED_VERSION dbusmenu-gtk-0.4 >= \$DBUSMENUGTK_REQUIRED_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= $GTK_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 @@ -13077,7 +13077,7 @@ if test -n "$APPLET_CFLAGS"; then pkg_cv_APPLET_CFLAGS=`$PKG_CONFIG --cflags "gtk+-2.0 >= $GTK_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else @@ -13093,12 +13093,12 @@ if test -n "$APPLET_LIBS"; then { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"gtk+-2.0 >= \$GTK_REQUIRED_VERSION gio-unix-2.0 >= \$GIO_UNIX_REQUIRED_VERSION indicator-0.4 >= \$INDICATOR_REQUIRED_VERSION - indicate-0.5 >= \$INDICATE_REQUIRED_VERSION + indicate-0.6 >= \$INDICATE_REQUIRED_VERSION dbusmenu-gtk-0.4 >= \$DBUSMENUGTK_REQUIRED_VERSION\""; } >&5 ($PKG_CONFIG --exists --print-errors "gtk+-2.0 >= $GTK_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION") 2>&5 ac_status=$? $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 @@ -13106,7 +13106,7 @@ if test -n "$APPLET_LIBS"; then pkg_cv_APPLET_LIBS=`$PKG_CONFIG --libs "gtk+-2.0 >= $GTK_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION" 2>/dev/null` test "x$?" != "x0" && pkg_failed=yes else @@ -13131,13 +13131,13 @@ fi APPLET_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "gtk+-2.0 >= $GTK_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION" 2>&1` else APPLET_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "gtk+-2.0 >= $GTK_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION" 2>&1` fi # Put the nasty error message in config.log where it belongs @@ -13146,7 +13146,7 @@ fi as_fn_error $? "Package requirements (gtk+-2.0 >= $GTK_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION) were not met: $APPLET_PKG_ERRORS @@ -13600,7 +13600,7 @@ fi if test "x$with_localinstall" = "xyes"; then INDICATORDIR="${libdir}/indicators/2/" INDICATORICONSDIR="${datadir}/libindicate/icons/" -elif test "x$with_indicator_gtk" = x2; then +elif test "x$with_gtk" = x2; then INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator-0.4` INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator-0.4` else diff --git a/configure.ac b/configure.ac index 92f5c88..45bccf0 100644 --- a/configure.ac +++ b/configure.ac @@ -4,7 +4,7 @@ AC_INIT(src/indicator-messages.c) AC_PREREQ(2.53) AM_CONFIG_HEADER(config.h) -AM_INIT_AUTOMAKE(indicator-messages, 0.4.92) +AM_INIT_AUTOMAKE(indicator-messages, 0.4.93) AM_MAINTAINER_MODE @@ -43,24 +43,24 @@ INDICATE_REQUIRED_VERSION=0.4.90 INDICATOR_REQUIRED_VERSION=0.3.19 DBUSMENUGTK_REQUIRED_VERSION=0.3.94 -AC_ARG_WITH([indicator-gtk], - [AS_HELP_STRING([--with-indicator-gtk], +AC_ARG_WITH([gtk], + [AS_HELP_STRING([--with-gtk], [Which version of gtk to use for the indicator @<:@default=3@:>@])], [], - [with_indicator_gtk=3]) + [with_gtk=3]) -AS_IF([test "x$with_indicator_gtk" = x3], +AS_IF([test "x$with_gtk" = x3], [PKG_CHECK_MODULES(APPLET, gtk+-3.0 >= $GTK3_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator3-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk3-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION) ], - [test "x$with_indicator_gtk" = x2], + [test "x$with_gtk" = x2], [PKG_CHECK_MODULES(APPLET, gtk+-2.0 >= $GTK_REQUIRED_VERSION gio-unix-2.0 >= $GIO_UNIX_REQUIRED_VERSION indicator-0.4 >= $INDICATOR_REQUIRED_VERSION - indicate-0.5 >= $INDICATE_REQUIRED_VERSION + indicate-0.6 >= $INDICATE_REQUIRED_VERSION dbusmenu-gtk-0.4 >= $DBUSMENUGTK_REQUIRED_VERSION) ], [AC_MSG_FAILURE([Value for --with-indicator-gtk was neither 2 nor 3])] @@ -104,7 +104,7 @@ AC_ARG_ENABLE(localinstall, AS_HELP_STRING([--enable-localinstall], [install all if test "x$with_localinstall" = "xyes"; then INDICATORDIR="${libdir}/indicators/2/" INDICATORICONSDIR="${datadir}/libindicate/icons/" -elif test "x$with_indicator_gtk" = x2; then +elif test "x$with_gtk" = x2; then INDICATORDIR=`$PKG_CONFIG --variable=indicatordir indicator-0.4` INDICATORICONSDIR=`$PKG_CONFIG --variable=iconsdir indicator-0.4` else diff --git a/debian/changelog b/debian/changelog index b0db608..d1530ee 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,12 @@ +indicator-messages (0.4.93-0ubuntu1~ppa1) UNRELEASED; urgency=low + + * New upstream release. + * Add an item to clear the alert + * Choose mail applications based on the default application + * Clear based on middle click + + -- Ted Gould <ted@ubuntu.com> Thu, 11 Aug 2011 09:28:30 -0500 + indicator-messages (0.4.92-0ubuntu4) oneiric; urgency=low * debian/control @@ -79,6 +88,13 @@ indicator-messages (0.4.90-0ubuntu1) oneiric; urgency=low -- Ken VanDine <ken.vandine@canonical.com> Wed, 22 Jun 2011 12:34:43 -0400 +indicator-messages (0.4.0-1) unstable; urgency=low + + * Merge new upstream from Ubuntu. + * Standards-Version: 3.9.2 + + -- Evgeni Golov <evgeni@debian.org> Sun, 05 Jun 2011 13:16:03 +0200 + indicator-messages (0.4.0-0ubuntu1) natty; urgency=low * New upstream release. @@ -89,6 +105,15 @@ indicator-messages (0.4.0-0ubuntu1) natty; urgency=low -- Ted Gould <ted@ubuntu.com> Thu, 07 Apr 2011 12:35:36 -0500 +indicator-messages (0.3.92-1) unstable; urgency=low + + * Merge new upstream from Ubuntu. + * Fix 0.3.11-0ubuntu3 changelog entry (missed a space), so that + bzr builddeb won't go crazy (see Debian Bug #620242) + * Fix debian/copyright, was refering to libdbusmenu by mistake. + + -- Evgeni Golov <evgeni@debian.org> Sun, 03 Apr 2011 13:37:33 +0200 + indicator-messages (0.3.92-0ubuntu3) natty; urgency=low * debian/patches/lp_690668.patch diff --git a/debian/control b/debian/control index b336742..a05ecff 100644 --- a/debian/control +++ b/debian/control @@ -1,7 +1,7 @@ Source: indicator-messages Section: gnome Priority: optional -Maintainer: Ubuntu Core Developers <ubuntu-devel-discuss@lists.ubuntu.com> +Maintainer: Ubuntu Developers <ubuntu-devel-discuss@lists.ubuntu.com> XSBC-Original-Maintainer: The Ayatana Packagers <pkg-ayatana-devel@lists.alioth.debian.org> Uploaders: Evgeni Golov <evgeni@debian.org> Build-Depends: debhelper (>= 5.0), diff --git a/debian/copyright b/debian/copyright index 8bb99ba..ba41392 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,5 +1,5 @@ Format-Specification: http://svn.debian.org/wsvn/dep/web/deps/dep5.mdwn?op=file&rev=135 -Name: libdbusmenu +Name: indicator-messages Maintainer: Ted Gould <ted@canonical.com> Source: https://launchpad.net/indicator-messages diff --git a/src/gen-messages-service.xml.c b/src/gen-messages-service.xml.c index 0a1c0d1..4e94dc3 100644 --- a/src/gen-messages-service.xml.c +++ b/src/gen-messages-service.xml.c @@ -4,15 +4,13 @@ const char * _messages_service = " <interface name=\"com.canonical.indicator.messages.service\">\n" "\n" "<!-- Methods -->\n" -" <method name=\"Watch\">\n" -" <annotation name=\"org.freedesktop.DBus.GLib.Async\" value=\"true\" />\n" -" </method>\n" " <method name=\"AttentionRequested\">\n" " <arg type=\"b\" name=\"dot\" direction=\"out\" />\n" " </method>\n" " <method name=\"IconShown\">\n" " <arg type=\"b\" name=\"hidden\" direction=\"out\" />\n" " </method>\n" +" <method name=\"ClearAttention\" />\n" "\n" "<!-- Signals -->\n" " <signal name=\"AttentionChanged\">\n" diff --git a/src/indicator-messages.c b/src/indicator-messages.c index bb88c57..82a9315 100644 --- a/src/indicator-messages.c +++ b/src/indicator-messages.c @@ -89,7 +89,10 @@ static void indicator_messages_dispose (GObject *object); static void indicator_messages_finalize (GObject *object); static GtkImage * get_icon (IndicatorObject * io); static GtkMenu * get_menu (IndicatorObject * io); -static const gchar * get_accessible_desc (IndicatorObject * io); +static void indicator_messages_middle_click (IndicatorObject * io, + IndicatorObjectEntry * entry, + guint time, gpointer data); +static const gchar * get_accessible_desc (IndicatorObject * io); static void connection_change (IndicatorServiceManager * sm, gboolean connected, gpointer user_data); @@ -131,6 +134,7 @@ indicator_messages_class_init (IndicatorMessagesClass *klass) io_class->get_image = get_icon; io_class->get_menu = get_menu; io_class->get_accessible_desc = get_accessible_desc; + io_class->secondary_activate = indicator_messages_middle_click; if (bus_node_info == NULL) { GError * error = NULL; @@ -755,3 +759,24 @@ get_accessible_desc (IndicatorObject * io) { return accessible_desc; } + +/* Hide the notifications on middle-click over the indicator-messages */ +static void +indicator_messages_middle_click (IndicatorObject * io, IndicatorObjectEntry * entry, + guint time, gpointer data) +{ + if (icon_proxy == NULL) { + return; + } + + g_dbus_proxy_call(icon_proxy, + "ClearAttention", + NULL, /* params */ + G_DBUS_CALL_FLAGS_NONE, + -1, /* timeout */ + NULL, /* cancel */ + NULL, + NULL); + + return; +} diff --git a/src/messages-service-dbus.c b/src/messages-service-dbus.c index 6cc33e0..1585ac0 100644 --- a/src/messages-service-dbus.c +++ b/src/messages-service-dbus.c @@ -200,7 +200,10 @@ message_service_dbus_new (void) static void bus_method_call (GDBusConnection * connection, const gchar * sender, const gchar * path, const gchar * interface, const gchar * method, GVariant * params, GDBusMethodInvocation * invocation, gpointer user_data) { - MessageServiceDbusPrivate * priv = MESSAGE_SERVICE_DBUS_GET_PRIVATE(user_data); + MessageServiceDbus * ms = MESSAGE_SERVICE_DBUS(user_data); + if (ms == NULL) { return; } + + MessageServiceDbusPrivate * priv = MESSAGE_SERVICE_DBUS_GET_PRIVATE(ms); if (g_strcmp0("AttentionRequested", method) == 0) { g_dbus_method_invocation_return_value(invocation, g_variant_new("(b)", priv->dot)); @@ -208,6 +211,10 @@ bus_method_call (GDBusConnection * connection, const gchar * sender, const gchar } else if (g_strcmp0("IconShown", method) == 0) { g_dbus_method_invocation_return_value(invocation, g_variant_new("(b)", priv->hidden)); return; + } else if (g_strcmp0("ClearAttention", method) == 0) { + message_service_dbus_set_attention(ms, FALSE); + g_dbus_method_invocation_return_value(invocation, NULL); + return; } else { g_warning("Unknown function call '%s'", method); } diff --git a/src/messages-service.c b/src/messages-service.c index c891f88..43e79d3 100644 --- a/src/messages-service.c +++ b/src/messages-service.c @@ -28,6 +28,7 @@ with this program. If not, see <http://www.gnu.org/licenses/>. #include <libindicate/listener.h> #include <libindicator/indicator-service.h> #include <gio/gio.h> +#include <glib/gi18n.h> #include <libdbusmenu-glib/client.h> #include <libdbusmenu-glib/server.h> @@ -49,6 +50,7 @@ static GList * launcherList = NULL; static DbusmenuMenuitem * root_menuitem = NULL; static DbusmenuMenuitem * status_separator = NULL; +static DbusmenuMenuitem * clear_attention = NULL; static GMainLoop * mainloop = NULL; static MessageServiceDbus * dbus_interface = NULL; @@ -837,7 +839,6 @@ resort_menu (DbusmenuMenuitem * menushell) guint position = 0; GList * serverentry; GList * launcherentry = launcherList; - DbusmenuMenuitem * last_separator = NULL; g_debug("Reordering Menu:"); @@ -874,7 +875,6 @@ resort_menu (DbusmenuMenuitem * menushell) if (!launcher_menu_item_get_eclipsed(li->menuitem)) { /* Only clear the visiblity if we're not eclipsed */ dbusmenu_menuitem_property_set_bool(li->separator, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); - last_separator = li->separator; } position++; @@ -930,7 +930,6 @@ resort_menu (DbusmenuMenuitem * menushell) /* Note, this isn't the last if we can't see it */ } else { dbusmenu_menuitem_property_set_bool(si->separator, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); - last_separator = si->separator; } dbusmenu_menuitem_child_reorder(DBUSMENU_MENUITEM(menushell), DBUSMENU_MENUITEM(si->separator), position); @@ -962,17 +961,15 @@ resort_menu (DbusmenuMenuitem * menushell) if (!launcher_menu_item_get_eclipsed(li->menuitem)) { /* Only clear the visiblity if we're not eclipsed */ dbusmenu_menuitem_property_set_bool(li->separator, DBUSMENU_MENUITEM_PROP_VISIBLE, TRUE); - last_separator = li->separator; } position++; launcherentry = launcherentry->next; } - if (last_separator != NULL) { - dbusmenu_menuitem_property_set_bool(last_separator, DBUSMENU_MENUITEM_PROP_VISIBLE, FALSE); - } else { - g_warning("No last separator on resort"); + if (clear_attention != NULL) { + dbusmenu_menuitem_child_reorder(DBUSMENU_MENUITEM(menushell), clear_attention, position); + position++; /* Not needed, but reduce bugs on code tacked on here, compiler will remove */ } return; @@ -1441,12 +1438,31 @@ service_shutdown (IndicatorService * service, gpointer user_data) return; } +/* Respond to changing status by updating the icon that + is on the panel */ static void status_update_callback (void) { return; } +/* The clear attention item has been clicked on, what to do? */ +static void +clear_attention_activate (DbusmenuMenuitem * mi, guint timestamp, MessageServiceDbus * dbus) +{ + message_service_dbus_set_attention(dbus, FALSE); + return; +} + +/* Handle an update of the active state to ensure that we're + only enabled when we could do something. */ +static void +clear_attention_handler (MessageServiceDbus * msd, gboolean attention, DbusmenuMenuitem * clearitem) +{ + dbusmenu_menuitem_property_set_bool(clearitem, DBUSMENU_MENUITEM_PROP_ENABLED, attention); + return; +} + /* Oh, if you don't know what main() is for we really shouldn't be talking. */ int @@ -1486,6 +1502,13 @@ main (int argc, char ** argv) dbusmenu_menuitem_property_set(status_separator, DBUSMENU_MENUITEM_PROP_TYPE, DBUSMENU_CLIENT_TYPES_SEPARATOR); dbusmenu_menuitem_child_append(root_menuitem, status_separator); + /* Add in the clear attention item */ + clear_attention = dbusmenu_menuitem_new(); + dbusmenu_menuitem_property_set(clear_attention, DBUSMENU_MENUITEM_PROP_LABEL, _("Clear Attention")); + dbusmenu_menuitem_child_append(root_menuitem, clear_attention); + g_signal_connect(G_OBJECT(dbus_interface), MESSAGE_SERVICE_DBUS_SIGNAL_ATTENTION_CHANGED, G_CALLBACK(clear_attention_handler), clear_attention); + g_signal_connect(G_OBJECT(clear_attention), DBUSMENU_MENUITEM_SIGNAL_ITEM_ACTIVATED, G_CALLBACK(clear_attention_activate), dbus_interface); + /* Start up the libindicate listener */ listener = indicate_listener_ref_default(); serverList = NULL; diff --git a/src/messages-service.xml b/src/messages-service.xml index 8a592db..d79049e 100644 --- a/src/messages-service.xml +++ b/src/messages-service.xml @@ -3,15 +3,13 @@ <interface name="com.canonical.indicator.messages.service"> <!-- Methods --> - <method name="Watch"> - <annotation name="org.freedesktop.DBus.GLib.Async" value="true" /> - </method> <method name="AttentionRequested"> <arg type="b" name="dot" direction="out" /> </method> <method name="IconShown"> <arg type="b" name="hidden" direction="out" /> </method> + <method name="ClearAttention" /> <!-- Signals --> <signal name="AttentionChanged"> |