Skip to content

Commit

Permalink
Use libnotify instead of libmatenotify
Browse files Browse the repository at this point in the history
  • Loading branch information
stefano-k committed Feb 28, 2013
1 parent 286f8ea commit 41389eb
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 31 deletions.
2 changes: 1 addition & 1 deletion README
Expand Up @@ -30,7 +30,7 @@ You need at least:

Some extras that improve functionality:

libmatenotify
libnotify
dbus-0.34
hal-0.5.3

Expand Down
4 changes: 2 additions & 2 deletions battstat/Makefile.am
Expand Up @@ -25,7 +25,7 @@ DIST_SUBDIRS = docs sounds apmlib

INCLUDES = \
$(MATE_APPLETS4_CFLAGS) \
$(LIBMATENOTIFY_CFLAGS) \
$(LIBNOTIFY_CFLAGS) \
$(HAL_CFLAGS) \
$(UPOWER_CFLAGS) \
$(APMINC) \
Expand Down Expand Up @@ -55,7 +55,7 @@ battstat_applet_2_SOURCES = \

battstat_applet_2_LDADD = \
$(MATE_APPLETS4_LIBS) \
$(LIBMATENOTIFY_LIBS) \
$(LIBNOTIFY_LIBS) \
$(HAL_LIBS) \
$(APMLIB) \
$(UPOWER_LIBS) \
Expand Down
10 changes: 5 additions & 5 deletions battstat/battstat_applet.c
Expand Up @@ -40,8 +40,8 @@
#include <mate-panel-applet.h>
#include <mate-panel-applet-gsettings.h>

#ifdef HAVE_LIBMATENOTIFY
#include <libmatenotify/notify.h>
#ifdef HAVE_LIBNOTIFY
#include <libnotify/notify.h>
#endif

#include "battstat.h"
Expand Down Expand Up @@ -420,7 +420,7 @@ get_remaining (BatteryStatus *info)
static gboolean
battery_full_notify (GtkWidget *applet)
{
#ifdef HAVE_LIBMATENOTIFY
#ifdef HAVE_LIBNOTIFY
GError *error = NULL;
GdkPixbuf *icon;
gboolean result;
Expand All @@ -435,7 +435,7 @@ battery_full_notify (GtkWidget *applet)
GTK_ICON_LOOKUP_USE_BUILTIN,
NULL);

NotifyNotification *n = notify_notification_new (_("Your battery is now fully recharged"), "", /* "battery" */ NULL, applet);
NotifyNotification *n = notify_notification_new (_("Your battery is now fully recharged"), "", /* "battery" */ NULL);

/* XXX: it would be nice to pass this as a named icon */
notify_notification_set_icon_from_pixbuf (n, icon);
Expand All @@ -462,7 +462,7 @@ battery_full_notify (GtkWidget *applet)
static void
battery_full_dialog (GtkWidget *applet)
{
/* first attempt to use libmatenotify */
/* first attempt to use libnotify */
if (battery_full_notify (applet))
return;

Expand Down
2 changes: 1 addition & 1 deletion battstat/docs/C/mate-battstat.xml
Expand Up @@ -382,7 +382,7 @@
</guilabel></para>
<para>
Selecting this option notifies when your battery is fully
recharged. If you have compiled the &applet; with libmatenotify
recharged. If you have compiled the &applet; with libnotify
support a non-intrusive notification will popup from the monitor on
the panel.
</para>
Expand Down
21 changes: 11 additions & 10 deletions configure.in
Expand Up @@ -19,7 +19,7 @@ LIBGTOP_REQUIRED=2.11.92
LIBXKLAVIER_REQUIRED=4.0
LIBMATEWNCK_REQUIRED=1.3.0
LIBMATE_DESKTOP_REQUIRED=1.1.0
LIBMATENOTIFY_REQUIRED=1.1.0
LIBNOTIFY_REQUIRED=0.7.0
HAL_REQUIRED=0.5.3
UPOWER_REQUIRED=0.9.4
DBUS_REQUIRED=1.1.2
Expand Down Expand Up @@ -149,18 +149,18 @@ PKG_CHECK_MODULES(LIBMATEWNCK, libmatewnck >= $LIBMATEWNCK_REQUIRED,,
AC_SUBST(LIBMATEWNCK_CFLAGS)
AC_SUBST(LIBMATEWNCK_LIBS)

dnl -- check for libmatenotify (optional) -----------------------------------------
LIBMATENOTIFY_CFLAGS=
LIBMATENOTIFY_LIBS=
PKG_CHECK_MODULES(LIBMATENOTIFY, libmatenotify >= $LIBMATENOTIFY_REQUIRED,
HAVE_LIBMATENOTIFY="yes", HAVE_LIBMATENOTIFY="no")
dnl -- check for libnotify (optional) -----------------------------------------
LIBNOTIFY_CFLAGS=
LIBNOTIFY_LIBS=
PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED,
HAVE_LIBNOTIFY="yes", HAVE_LIBNOTIFY="no")

if test "x$HAVE_LIBMATENOTIFY" = "xyes"; then
AC_DEFINE(HAVE_LIBMATENOTIFY, 1, [libmatenotify available])
if test "x$HAVE_LIBNOTIFY" = "xyes"; then
AC_DEFINE(HAVE_LIBNOTIFY, 1, [libnotify available])
fi

AC_SUBST(LIBMATENOTIFY_CFLAGS)
AC_SUBST(LIBMATENOTIFY_LIBS)
AC_SUBST(LIBNOTIFY_CFLAGS)
AC_SUBST(LIBNOTIFY_LIBS)

dnl -- check for glib/gobject (required) --------------------------------------
PKG_CHECK_MODULES(CPUFREQ_SELECTOR, glib-2.0 >= $GLIB_REQUIRED gobject-2.0 >= $GLIB_REQUIRED)
Expand Down Expand Up @@ -734,5 +734,6 @@ mate-applets-$VERSION configure summary:
Using NetworkManager: $HAVE_NETWORKMANAGER
Using HAL: $HAVE_HAL
Using UPOWER: $HAVE_UPOWER
Using libnotify: $HAVE_LIBNOTIFY
Enabling IPv6: $have_ipv6
" >&2
12 changes: 7 additions & 5 deletions mateweather/Makefile.am
Expand Up @@ -7,9 +7,10 @@ INCLUDES = \
-I$(top_srcdir) \
-DMATEWEATHER_MENU_UI_DIR=\""$(uidir)"\" \
$(MATE_APPLETS4_CFLAGS) \
$(LIBMATENOTIFY_CFLAGS) \
$(LIBNOTIFY_CFLAGS) \
$(LIBMATEWEATHER_CFLAGS) \
$(NETWORKMANAGER_CFLAGS)
$(NETWORKMANAGER_CFLAGS) \
$(DBUS_CFLAGS)

libexec_PROGRAMS = mateweather-applet-2

Expand All @@ -22,11 +23,12 @@ mateweather_applet_2_SOURCES = \
mateweather-applet.c mateweather-applet.h

mateweather_applet_2_LDADD = \
$(LIBMATENOTIFY_LIBS) \
$(LIBNOTIFY_LIBS) \
$(MATE_APPLETS4_LIBS) \
$(MATE_LIBS2_LIBS) \
$(LIBMATEWEATHER_LIBS) \
$(NETWORKMANAGER_LIBS)
$(LIBMATEWEATHER_LIBS) \
$(NETWORKMANAGER_LIBS) \
$(DBUS_LIBS)

uidir = $(datadir)/mate-2.0/ui
ui_DATA = mateweather-applet-menu.xml
Expand Down
12 changes: 5 additions & 7 deletions mateweather/mateweather-applet.c
Expand Up @@ -27,9 +27,8 @@

#include <gdk/gdkkeysyms.h>

#ifdef HAVE_LIBMATENOTIFY
#include <libmatenotify/notify.h>
#include <libmatenotify/notification.h>
#ifdef HAVE_LIBNOTIFY
#include <libnotify/notify.h>
#endif

#define MATEWEATHER_I_KNOW_THIS_IS_UNSTABLE
Expand Down Expand Up @@ -393,7 +392,7 @@ static void
update_finish (WeatherInfo *info, gpointer data)
{
static int gw_fault_counter = 0;
#ifdef HAVE_LIBMATENOTIFY
#ifdef HAVE_LIBNOTIFY
char *message, *detail;
#endif
char *s;
Expand Down Expand Up @@ -442,7 +441,7 @@ update_finish (WeatherInfo *info, gpointer data)
/* update applet */
place_widgets(gw_applet);

#ifdef HAVE_LIBMATENOTIFY
#ifdef HAVE_LIBNOTIFY
NotifyNotification *n;

/* Show notifications if possible */
Expand All @@ -468,8 +467,7 @@ update_finish (WeatherInfo *info, gpointer data)
if (icon == NULL)
icon = "stock-unknown";

n = notify_notification_new (message, detail, icon,
gw_applet->container);
n = notify_notification_new (message, detail, icon);

notify_notification_show (n, &error);
if (error)
Expand Down

0 comments on commit 41389eb

Please sign in to comment.