[Goodies-commits] r5622 - in xfce4-sensors-plugin/trunk: . lib

Fabian Nowak timystery at xfce.org
Tue Oct 14 22:23:17 CEST 2008


Author: timystery
Date: 2008-10-14 20:23:17 +0000 (Tue, 14 Oct 2008)
New Revision: 5622

Modified:
   xfce4-sensors-plugin/trunk/configure.in.in
   xfce4-sensors-plugin/trunk/lib/sensors-interface.c
Log:
- modified configure.in.in to check for non-empty intltool-update
- some changes in sensor interfaces to display very unlikely error messages via libnotify


Modified: xfce4-sensors-plugin/trunk/configure.in.in
===================================================================
--- xfce4-sensors-plugin/trunk/configure.in.in	2008-10-14 19:47:09 UTC (rev 5621)
+++ xfce4-sensors-plugin/trunk/configure.in.in	2008-10-14 20:23:17 UTC (rev 5622)
@@ -34,8 +34,8 @@
 dnl *** Intltool-update hack ***
 dnl ****************************
 AC_CONFIG_COMMANDS([intltool-update],
-    [(sed -e 's/^\("desktop.*".*\)/\1\n"rc(?:\\\\.in)+|"\./' intltool-update > intltool-update-tmp &&
-      mv intltool-update-tmp intltool-update && chmod 755 intltool-update)])
+    [(if test `stat --printf "%s" intltool-update` != "0"; then sed -e 's/^\("desktop.*".*\)/\1\n"rc(?:\\\\.in)+|"\./' intltool-update > intltool-update-tmp &&
+      mv intltool-update-tmp intltool-update && chmod 755 intltool-update; fi)])
 
 dnl Check for standard header files
 AC_HEADER_STDC

Modified: xfce4-sensors-plugin/trunk/lib/sensors-interface.c
===================================================================
--- xfce4-sensors-plugin/trunk/lib/sensors-interface.c	2008-10-14 19:47:09 UTC (rev 5621)
+++ xfce4-sensors-plugin/trunk/lib/sensors-interface.c	2008-10-14 20:23:17 UTC (rev 5622)
@@ -23,6 +23,7 @@
 #endif
 
 /* Global includes */
+#include <libnotify/notify.h>
 /* #include <stdlib.h> */
 
 /* Glib/Gtk includes */
@@ -45,7 +46,16 @@
     double sensorFeature;
     t_chipfeature *chipfeature;
     GtkTreeIter *iter;
+    NotifyNotification *nn;
+    gchar *summary, *body, *icon;
+    GError *error = NULL;
 
+    summary = "Xfce 4 Sensors Plugin Failure";
+    body = _("Seems like there was a problem reading a sensor "
+                    "feature value.\nProper proceeding cannot be "
+                    "guaranteed.");
+    icon = "xfce-sensors";
+
     TRACE ("enters fill_gtkTreeStore");
 
     for (featureindex=0; featureindex < chip->num_features; featureindex++)
@@ -59,10 +69,13 @@
             res = sensor_get_value
                     (chip, chipfeature->address, &sensorFeature);
             if ( res!=0) {
-                DBG ( _("Xfce Hardware Sensors Plugin:\n"
-                    "Seems like there was a problem reading a sensor "
-                    "feature value.\nProper proceeding cannot be "
-                    "guaranteed.\n") );
+
+                if (!notify_is_initted())
+                    notify_init(PACKAGE); /* NOTIFY_APPNAME */
+
+                nn = notify_notification_new(summary, body, icon, NULL);
+                notify_notification_show(nn, &error);
+
                 /* FIXME: Better popup a window or DBG message or quit plugin. */
                 break;
             }




More information about the Goodies-commits mailing list