summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefano Karapetsas <[email protected]>2013-02-27 13:14:29 +0100
committerStefano Karapetsas <[email protected]>2013-02-27 13:14:29 +0100
commit9a2a46d3622863c8d83aa46a884d1cc1f90bfb84 (patch)
tree8202e84dd227d9377e3b2e507e76f84568450f17
parent4381df30054f853298a5b081e260893b5279cb6a (diff)
downloadmate-sensors-applet-9a2a46d3622863c8d83aa46a884d1cc1f90bfb84.tar.bz2
mate-sensors-applet-9a2a46d3622863c8d83aa46a884d1cc1f90bfb84.tar.xz
Use libnotify instead of libmatenofity
-rw-r--r--README2
-rw-r--r--configure.ac34
-rw-r--r--sensors-applet/Makefile.am14
-rw-r--r--sensors-applet/active-sensor-libnotify.c (renamed from sensors-applet/active-sensor-libmatenotify.c)18
-rw-r--r--sensors-applet/active-sensor-libnotify.h (renamed from sensors-applet/active-sensor-libmatenotify.h)13
-rw-r--r--sensors-applet/active-sensor.h8
-rw-r--r--sensors-applet/config.h.in134
-rw-r--r--sensors-applet/prefs-dialog.c8
-rw-r--r--sensors-applet/prefs-dialog.h2
-rw-r--r--sensors-applet/sensors-applet.c47
-rw-r--r--sensors-applet/sensors-applet.h8
11 files changed, 66 insertions, 222 deletions
diff --git a/README b/README
index ef74c2e..e151266 100644
--- a/README
+++ b/README
@@ -31,7 +31,7 @@ given command at given repeated intervals.
MATE HIG v2.0 compliant
-libmatenotify[8] support for alarm conditions
+libnotify[8] support for alarm conditions
The icons bundled as part of MATE Sensors Applet were created by
epicbard[9], and are released under the Creative Commons Attribution
diff --git a/configure.ac b/configure.ac
index 97dd65f..0000bb4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,7 +49,7 @@ AC_CHECK_HEADERS(
GLIB_REQUIRED=2.26.0
GTK_REQUIRED=2.14.0
LIBPANEL_REQUIRED=1.1.0
-LIBMATENOTIFY_REQUIRED=1.1.0
+LIBNOTIFY_REQUIRED=0.7.0
LIBCAIRO_REQUIRED=1.0.4
LIBDBUSGLIB_REQUIRED=0.80
LIBATASMART_REQUIRED=0.16
@@ -92,34 +92,34 @@ fi
AM_CONDITIONAL(UDISKS, test -n "$DBUSGLIB_CFLAGS" -a -n "$LIBATASMART_CFLAGS")
-# support for libmatenotify
-LIBMATENOTIFY_CFLAGS=
-LIBMATENOTIFY_LIBS=
+# support for libnotify
+LIBNOTIFY_CFLAGS=
+LIBNOTIFY_LIBS=
# enable support even if not specifically asked for
-AC_ARG_ENABLE(libmatenotify,
-[ --enable-libmatenotify Enable libmatenotify support], [
- enable_libmatenotify=$enableval], [
- enable_libmatenotify="yes"
+AC_ARG_ENABLE(libnotify,
+[ --enable-libnotify Enable libnotify support], [
+ enable_libnotify=$enableval], [
+ enable_libnotify="yes"
])
-if test "x$enable_libmatenotify" = "xno"
+if test "x$enable_libnotify" = "xno"
then
- echo "Disabling libmatenotify support"
+ echo "Disabling libnotify support"
else
- PKG_CHECK_MODULES(LIBMATENOTIFY, libmatenotify >= $LIBMATENOTIFY_REQUIRED,
- HAVE_LIBMATENOTIFY="yes", HAVE_LIBMATENOTIFY="no")
+ PKG_CHECK_MODULES(LIBNOTIFY, libnotify >= $LIBNOTIFY_REQUIRED,
+ HAVE_LIBNOTIFY="yes", HAVE_LIBNOTIFY="no")
- if test "x$HAVE_LIBMATENOTIFY" = "xyes"
+ if test "x$HAVE_LIBNOTIFY" = "xyes"
then
- AC_DEFINE(HAVE_LIBMATENOTIFY, 1, [libmatenotify available])
+ AC_DEFINE(HAVE_LIBNOTIFY, 1, [libnotify available])
fi
fi
-AM_CONDITIONAL(LIBMATENOTIFY, test -n "$LIBMATENOTIFY_LIBS")
+AM_CONDITIONAL(LIBNOTIFY, test -n "$LIBNOTIFY_LIBS")
-AC_SUBST(LIBMATENOTIFY_CFLAGS)
-AC_SUBST(LIBMATENOTIFY_LIBS)
+AC_SUBST(LIBNOTIFY_CFLAGS)
+AC_SUBST(LIBNOTIFY_LIBS)
# allow user to specify libsensors support, but support it anyway if possible
diff --git a/sensors-applet/Makefile.am b/sensors-applet/Makefile.am
index 367f96c..4bc2fe3 100644
--- a/sensors-applet/Makefile.am
+++ b/sensors-applet/Makefile.am
@@ -12,16 +12,16 @@ INCLUDES = -DMATELOCALEDIR=\""$(datadir)/locale/"\" \
-DSYSCONFDIR=\""$(sysconfdir)"\" \
-DPREFIX=\""$(prefix)"\" \
-I$(top_srcdir) \
- $(GLIB_CFLAGS) $(GTK_CFLAGS) $(MATE_CFLAGS) $(CAIRO_CFLAGS) $(LIBMATENOTIFY_CFLAGS)
+ $(GLIB_CFLAGS) $(GTK_CFLAGS) $(MATE_CFLAGS) $(CAIRO_CFLAGS) $(LIBNOTIFY_CFLAGS)
-LIBS = $(GLIB_LIBS) $(GTK_LIBS) $(MATE_LIBS) $(CAIRO_LIBS) $(LIBMATENOTIFY_LIBS)
+LIBS = $(GLIB_LIBS) $(GTK_LIBS) $(MATE_LIBS) $(CAIRO_LIBS) $(LIBNOTIFY_LIBS)
-if LIBMATENOTIFY
-libmatenotify_SRC = active-sensor-libmatenotify.c \
- active-sensor-libmatenotify.h
+if LIBNOTIFY
+libnotify_SRC = active-sensor-libnotify.c \
+ active-sensor-libnotify.h
else
-libmatenotify_SRC =
+libnotify_SRC =
endif
libexec_PROGRAMS = mate-sensors-applet
@@ -41,7 +41,7 @@ mate_sensors_applet_SOURCES = main.c \
sensors-applet-plugins.h \
sensors-applet-settings.c \
sensors-applet-settings.h \
- $(libmatenotify_SRC)
+ $(libnotify_SRC)
mate_sensors_applet_LDADD = -ldl
diff --git a/sensors-applet/active-sensor-libmatenotify.c b/sensors-applet/active-sensor-libnotify.c
index fafc500..a0a5981 100644
--- a/sensors-applet/active-sensor-libmatenotify.c
+++ b/sensors-applet/active-sensor-libnotify.c
@@ -20,11 +20,11 @@
#include "config.h"
#endif /* HAVE_CONFIG_H */
-#ifdef HAVE_LIBMATENOTIFY
-#include <libmatenotify/notify.h>
+#ifdef HAVE_LIBNOTIFY
+#include <libnotify/notify.h>
#endif
-#include "active-sensor-libmatenotify.h"
+#include "active-sensor-libnotify.h"
static void notif_closed_cb(NotifyNotification *notification,
ActiveSensor *active_sensor)
@@ -45,7 +45,7 @@ static void notif_closed_cb(NotifyNotification *notification,
}
-void active_sensor_libmatenotify_notify_end(ActiveSensor *active_sensor,
+void active_sensor_libnotify_notify_end(ActiveSensor *active_sensor,
NotifType notif_type) {
GError *error = NULL;
if (active_sensor->notification[notif_type]) {
@@ -60,13 +60,12 @@ void active_sensor_libmatenotify_notify_end(ActiveSensor *active_sensor,
}
}
-void active_sensor_libmatenotify_notify(ActiveSensor *active_sensor,
+void active_sensor_libnotify_notify(ActiveSensor *active_sensor,
NotifType notif_type,
const gchar *summary,
const gchar *message,
const gchar *icon_filename,
- gint timeout_msecs,
- GtkWidget *attach) {
+ gint timeout_msecs) {
GError *error = NULL;
if (!notify_is_initted()) {
@@ -79,15 +78,14 @@ void active_sensor_libmatenotify_notify(ActiveSensor *active_sensor,
/* leave any existing notification since most likely hasn't changed */
if (active_sensor->notification[notif_type] != NULL) {
return;
-/* active_sensor_libmatenotify_notify_end(active_sensor, notif_type); */
+/* active_sensor_libnotify_notify_end(active_sensor, notif_type); */
}
/* now create a new one */
g_debug("Creating new notification");
active_sensor->notification[notif_type] = notify_notification_new(summary,
message,
- icon_filename,
- attach);
+ icon_filename);
g_signal_connect(active_sensor->notification[notif_type], "closed",
G_CALLBACK(notif_closed_cb),
active_sensor);
diff --git a/sensors-applet/active-sensor-libmatenotify.h b/sensors-applet/active-sensor-libnotify.h
index 6587dea..d2c2173 100644
--- a/sensors-applet/active-sensor-libmatenotify.h
+++ b/sensors-applet/active-sensor-libnotify.h
@@ -16,20 +16,19 @@
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
-#ifndef ACTIVE_SESNOR_LIBMATENOTIFY_H
-#define ACTIVE_SENSOR_LIBMATENOTIFY_H
+#ifndef ACTIVE_SESNOR_LIBNOTIFY_H
+#define ACTIVE_SENSOR_LIBNOTIFY_H
#include "sensors-applet.h"
#include "active-sensor.h"
-void active_sensor_libmatenotify_notify(ActiveSensor *active_sensor,
+void active_sensor_libnotify_notify(ActiveSensor *active_sensor,
NotifType notif_type,
const gchar *summary,
const gchar *message,
const gchar *icon_filename,
- gint timeout_msecs,
- GtkWidget *attach);
-void active_sensor_libmatenotify_notify_end(ActiveSensor *active_sensor,
+ gint timeout_msecs);
+void active_sensor_libnotify_notify_end(ActiveSensor *active_sensor,
NotifType notif_type);
-#endif /* SENSORS_APPLET_LIBMATENOTIFY_H */
+#endif /* SENSORS_APPLET_LIBNOTIFY_H */
diff --git a/sensors-applet/active-sensor.h b/sensors-applet/active-sensor.h
index ba4e01f..7258515 100644
--- a/sensors-applet/active-sensor.h
+++ b/sensors-applet/active-sensor.h
@@ -19,9 +19,9 @@
#ifndef ACTIVE_SENSOR_H
#define ACTIVE_SENSOR_H
-#ifdef HAVE_LIBMATENOTIFY
-#include <libmatenotify/notify.h>
-#include "active-sensor-libmatenotify.h"
+#ifdef HAVE_LIBNOTIFY
+#include <libnotify/notify.h>
+#include "active-sensor-libnotify.h"
#endif
#include "sensors-applet.h"
@@ -40,7 +40,7 @@ struct _ActiveSensor {
GtkTreeRowReference *sensor_row;
-#ifdef HAVE_LIBMATENOTIFY
+#ifdef HAVE_LIBNOTIFY
NotifyNotification *notification[NUM_NOTIFS];
#endif
diff --git a/sensors-applet/config.h.in b/sensors-applet/config.h.in
deleted file mode 100644
index a5d04de..0000000
--- a/sensors-applet/config.h.in
+++ /dev/null
@@ -1,134 +0,0 @@
-/* sensors-applet/config.h.in. Generated from configure.ac by autoheader. */
-
-/* aticonfig executable */
-#undef ATICONFIG_EXE
-
-/* always defined to indicate that i18n is enabled */
-#undef ENABLE_NLS
-
-/* Package name for gettext */
-#undef GETTEXT_PACKAGE
-
-/* Define to 1 if you have the <arpa/inet.h> header file. */
-#undef HAVE_ARPA_INET_H
-
-/* using aticonfig */
-#undef HAVE_ATICONFIG
-
-/* Define to 1 if you have the `bind_textdomain_codeset' function. */
-#undef HAVE_BIND_TEXTDOMAIN_CODESET
-
-/* Define to 1 if you have the `dcgettext' function. */
-#undef HAVE_DCGETTEXT
-
-/* Define to 1 if you have the <dlfcn.h> header file. */
-#undef HAVE_DLFCN_H
-
-/* Define to 1 if you have the <fcntl.h> header file. */
-#undef HAVE_FCNTL_H
-
-/* Define if the GNU gettext() function is already present or preinstalled. */
-#undef HAVE_GETTEXT
-
-/* Define to 1 if you have the <inttypes.h> header file. */
-#undef HAVE_INTTYPES_H
-
-/* Define if your <locale.h> file defines LC_MESSAGES. */
-#undef HAVE_LC_MESSAGES
-
-/* libmatenotify available */
-#undef HAVE_LIBMATENOTIFY
-
-/* libsensors is available */
-#undef HAVE_LIBSENSORS
-
-/* Define to 1 if you have the <locale.h> header file. */
-#undef HAVE_LOCALE_H
-
-/* Define to 1 if you have the <memory.h> header file. */
-#undef HAVE_MEMORY_H
-
-/* Define to 1 if you have the <netinet/in.h> header file. */
-#undef HAVE_NETINET_IN_H
-
-/* Define to 1 if you have the <NVCtrl/NVCtrlLib.h> header file. */
-#undef HAVE_NVCTRL_NVCTRLLIB_H
-
-/* Define to 1 if you have the <NVCtrl/NVCtrl.h> header file. */
-#undef HAVE_NVCTRL_NVCTRL_H
-
-/* nvidia sensors available */
-#undef HAVE_NVIDIA
-
-/* Define to 1 if you have the <regex.h> header file. */
-#undef HAVE_REGEX_H
-
-/* Define to 1 if you have the <sensors/sensors.h> header file. */
-#undef HAVE_SENSORS_SENSORS_H
-
-/* Define to 1 if you have the <stdint.h> header file. */
-#undef HAVE_STDINT_H
-
-/* Define to 1 if you have the <stdio.h> header file. */
-#undef HAVE_STDIO_H
-
-/* Define to 1 if you have the <stdlib.h> header file. */
-#undef HAVE_STDLIB_H
-
-/* Define to 1 if you have the <strings.h> header file. */
-#undef HAVE_STRINGS_H
-
-/* Define to 1 if you have the <string.h> header file. */
-#undef HAVE_STRING_H
-
-/* Define to 1 if you have the <sys/ioctl.h> header file. */
-#undef HAVE_SYS_IOCTL_H
-
-/* Define to 1 if you have the <sys/socket.h> header file. */
-#undef HAVE_SYS_SOCKET_H
-
-/* Define to 1 if you have the <sys/stat.h> header file. */
-#undef HAVE_SYS_STAT_H
-
-/* Define to 1 if you have the <sys/types.h> header file. */
-#undef HAVE_SYS_TYPES_H
-
-/* Define to 1 if you have the <unistd.h> header file. */
-#undef HAVE_UNISTD_H
-
-/* Define to 1 if you have the <X11/Xlib.h> header file. */
-#undef HAVE_X11_XLIB_H
-
-/* Define to 1 if you have the <\> header file. */
-#undef HAVE__
-
-/* Define to the sub-directory in which libtool stores uninstalled libraries.
- */
-#undef LT_OBJDIR
-
-/* Name of package */
-#undef PACKAGE
-
-/* Define to the address where bug reports for this package should be sent. */
-#undef PACKAGE_BUGREPORT
-
-/* Define to the full name of this package. */
-#undef PACKAGE_NAME
-
-/* Define to the full name and version of this package. */
-#undef PACKAGE_STRING
-
-/* Define to the one symbol short name of this package. */
-#undef PACKAGE_TARNAME
-
-/* Define to the home page for this package. */
-#undef PACKAGE_URL
-
-/* Define to the version of this package. */
-#undef PACKAGE_VERSION
-
-/* Define to 1 if you have the ANSI C header files. */
-#undef STDC_HEADERS
-
-/* Version number of package */
-#undef VERSION
diff --git a/sensors-applet/prefs-dialog.c b/sensors-applet/prefs-dialog.c
index 386af34..89e4b49 100644
--- a/sensors-applet/prefs-dialog.c
+++ b/sensors-applet/prefs-dialog.c
@@ -193,7 +193,7 @@ static void prefs_dialog_temperature_scale_changed(GtkComboBox *temperature_scal
}
-#ifdef HAVE_LIBMATENOTIFY
+#ifdef HAVE_LIBNOTIFY
static void prefs_dialog_display_notifications_toggled(GtkCheckButton *display_notifications,
PrefsDialog *prefs_dialog) {
@@ -610,7 +610,7 @@ void prefs_dialog_open(SensorsApplet *sensors_applet) {
G_CALLBACK(prefs_dialog_timeout_changed),
prefs_dialog);
-#ifdef HAVE_LIBMATENOTIFY
+#ifdef HAVE_LIBNOTIFY
header_text = g_markup_printf_escaped("<b>%s</b>", _("Notifications"));
prefs_dialog->notifications_header = g_object_new(GTK_TYPE_LABEL,
"use-markup", TRUE,
@@ -654,7 +654,7 @@ void prefs_dialog_open(SensorsApplet *sensors_applet) {
prefs_dialog->globals_table = g_object_new(GTK_TYPE_TABLE,
"homogeneous", FALSE,
"n-columns", 3,
-#ifdef HAVE_LIBMATENOTIFY
+#ifdef HAVE_LIBNOTIFY
"n-rows", 9,
#else
"n-rows", 7,
@@ -774,7 +774,7 @@ void prefs_dialog_open(SensorsApplet *sensors_applet) {
0);
-#ifdef HAVE_LIBMATENOTIFY
+#ifdef HAVE_LIBNOTIFY
gtk_table_attach(prefs_dialog->globals_table,
GTK_WIDGET(prefs_dialog->notifications_header),
0, 2,
diff --git a/sensors-applet/prefs-dialog.h b/sensors-applet/prefs-dialog.h
index beb0db6..9ff6525 100644
--- a/sensors-applet/prefs-dialog.h
+++ b/sensors-applet/prefs-dialog.h
@@ -38,7 +38,7 @@ typedef struct {
GtkLabel *timeout_label, *display_mode_label, *layout_mode_label, *temperature_scale_label, *graph_size_label, *update_header, *display_header;
GtkAdjustment *timeout_adjust, *graph_size_adjust;
-#ifdef HAVE_LIBMATENOTIFY
+#ifdef HAVE_LIBNOTIFY
GtkCheckButton *display_notifications;
GtkLabel *notifications_header;
#endif
diff --git a/sensors-applet/sensors-applet.c b/sensors-applet/sensors-applet.c
index 9dcea39..ae5616d 100644
--- a/sensors-applet/sensors-applet.c
+++ b/sensors-applet/sensors-applet.c
@@ -36,8 +36,8 @@
#include "sensors-applet-settings.h"
#include "sensors-applet-plugins.h"
-#ifdef HAVE_LIBMATENOTIFY
-#include "active-sensor-libmatenotify.h"
+#ifdef HAVE_LIBNOTIFY
+#include "active-sensor-libnotify.h"
#define DEFAULT_NOTIFY_TIMEOUT 3000
#endif
@@ -268,7 +268,7 @@ static const GtkActionEntry sensors_applet_menu_actions[] = {
G_CALLBACK(about_cb) }
};
-#ifdef HAVE_LIBMATENOTIFY
+#ifdef HAVE_LIBNOTIFY
static void notif_closed_cb(NotifyNotification *notification,
SensorsApplet *sensors_applet)
{
@@ -276,14 +276,12 @@ static void notif_closed_cb(NotifyNotification *notification,
sensors_applet->notification = NULL;
}
-#endif // HAVE_LIBMATENOTIFY
+#endif // HAVE_LIBNOTIFY
void sensors_applet_notify_active_sensor(ActiveSensor *active_sensor, NotifType notif_type) {
-#ifdef HAVE_LIBMATENOTIFY
+#ifdef HAVE_LIBNOTIFY
SensorsApplet *sensors_applet;
- GList *table_children;
- GtkWidget *attach = NULL;
gchar *summary, *message;
gint timeout_msecs;
gchar *sensor_label;
@@ -305,23 +303,7 @@ void sensors_applet_notify_active_sensor(ActiveSensor *active_sensor, NotifType
g_debug("Wanted to display notification, but user has disabled them");
return;
}
-
- table_children = gtk_container_get_children(GTK_CONTAINER(sensors_applet->table));
-
- if (g_list_find(table_children, active_sensor->icon)) {
- attach = GTK_WIDGET(active_sensor->icon);
- } else if (g_list_find(table_children, active_sensor->label)) {
- attach = GTK_WIDGET(active_sensor->label);
- } else if (g_list_find(table_children, active_sensor->value)) {
- attach = GTK_WIDGET(active_sensor->value);
- } else if (g_list_find(table_children, active_sensor->graph)) {
- attach = GTK_WIDGET(active_sensor->graph);
- } else {
- g_warning("Wanted to do notify for a sensor which has no elements in the table!!!");
- return;
- }
- g_list_free(table_children);
-
+
path = gtk_tree_row_reference_get_path(active_sensor->sensor_row);
if (gtk_tree_model_get_iter(GTK_TREE_MODEL(sensors_applet->sensors),
&iter, path)) {
@@ -415,13 +397,12 @@ void sensors_applet_notify_active_sensor(ActiveSensor *active_sensor, NotifType
g_assert_not_reached();
}
- active_sensor_libmatenotify_notify(active_sensor,
+ active_sensor_libnotify_notify(active_sensor,
notif_type,
summary,
message,
GTK_STOCK_DIALOG_WARNING,
- timeout_msecs,
- attach);
+ timeout_msecs);
g_free(sensor_path);
g_free(sensor_label);
@@ -432,21 +413,21 @@ void sensors_applet_notify_active_sensor(ActiveSensor *active_sensor, NotifType
void sensors_applet_notify_end(ActiveSensor *active_sensor,
NotifType notif_type) {
-#ifdef HAVE_LIBMATENOTIFY
- active_sensor_libmatenotify_notify_end(active_sensor, notif_type);
+#ifdef HAVE_LIBNOTIFY
+ active_sensor_libnotify_notify_end(active_sensor, notif_type);
#endif
}
-#ifdef HAVE_LIBMATENOTIFY
+#ifdef HAVE_LIBNOTIFY
static void sensors_applet_notify_end_all_gfunc(ActiveSensor *active_sensor,
gpointer data) {
- active_sensor_libmatenotify_notify_end(active_sensor, LOW_ALARM);
- active_sensor_libmatenotify_notify_end(active_sensor, HIGH_ALARM);
+ active_sensor_libnotify_notify_end(active_sensor, LOW_ALARM);
+ active_sensor_libnotify_notify_end(active_sensor, HIGH_ALARM);
}
#endif
void sensors_applet_notify_end_all(SensorsApplet *sensors_applet) {
-#ifdef HAVE_LIBMATENOTIFY
+#ifdef HAVE_LIBNOTIFY
g_list_foreach(sensors_applet->active_sensors,
(GFunc)sensors_applet_notify_end_all_gfunc,
NULL);
diff --git a/sensors-applet/sensors-applet.h b/sensors-applet/sensors-applet.h
index 0cd35ec..fda92b5 100644
--- a/sensors-applet/sensors-applet.h
+++ b/sensors-applet/sensors-applet.h
@@ -27,8 +27,8 @@
#include "config.h"
#endif /* HAVE_CONFIG_H */
-#ifdef HAVE_LIBMATENOTIFY
-#include <libmatenotify/notify.h>
+#ifdef HAVE_LIBNOTIFY
+#include <libnotify/notify.h>
#endif
typedef struct _ActiveSensor ActiveSensor;
@@ -138,9 +138,9 @@ struct _SensorsApplet {
GSettings *settings;
-#ifdef HAVE_LIBMATENOTIFY
+#ifdef HAVE_LIBNOTIFY
NotifyNotification *notification;
-#endif // HAVE_LIBMATENOTIFY
+#endif // HAVE_LIBNOTIFY
};