[Goodies-commits] r5596 - in xfce4-sensors-plugin/trunk: . include lib panel-plugin src

Fabian Nowak timystery at xfce.org
Sun Oct 12 23:14:39 CEST 2008


Author: timystery
Date: 2008-10-12 21:14:39 +0000 (Sun, 12 Oct 2008)
New Revision: 5596

Modified:
   xfce4-sensors-plugin/trunk/configure.in.in
   xfce4-sensors-plugin/trunk/include/lmsensors.h
   xfce4-sensors-plugin/trunk/lib/Makefile.am
   xfce4-sensors-plugin/trunk/lib/acpi.c
   xfce4-sensors-plugin/trunk/lib/configuration.c
   xfce4-sensors-plugin/trunk/lib/hddtemp.c
   xfce4-sensors-plugin/trunk/lib/lmsensors.c
   xfce4-sensors-plugin/trunk/lib/middlelayer.c
   xfce4-sensors-plugin/trunk/lib/sensors-interface-common.c
   xfce4-sensors-plugin/trunk/lib/sensors-interface.c
   xfce4-sensors-plugin/trunk/panel-plugin/sensors-plugin.c
   xfce4-sensors-plugin/trunk/src/actions.c
   xfce4-sensors-plugin/trunk/src/callbacks.c
   xfce4-sensors-plugin/trunk/src/interface.c
Log:
- added libnotify
- removed bug caused by development: crash when trying to write
- first preparations for netcat in configure and hddtemp



Modified: xfce4-sensors-plugin/trunk/configure.in.in
===================================================================
--- xfce4-sensors-plugin/trunk/configure.in.in	2008-10-12 20:45:21 UTC (rev 5595)
+++ xfce4-sensors-plugin/trunk/configure.in.in	2008-10-12 21:14:39 UTC (rev 5596)
@@ -146,10 +146,12 @@
     AC_DEFINE_UNQUOTED([NETCAT_PATH], ["$NETCAT_PATH"], [Complete path to netcat])
     AC_SUBST([NETCAT_PATH])
 
-    AC_DEFINE_UNQUOTED([NETCAT_HOST], ["localhost"], [Host for netcat])
+    NETCAT_HOST=localhost
+    AC_DEFINE_UNQUOTED([NETCAT_HOST], ["$NETCAT_HOST"], [Host for netcat])
     AC_SUBST([NETCAT_HOST])
 
-    AC_DEFINE_UNQUOTED([HDDTEMP_PORT], ["7634"], [Port for hddtemp with netcat])
+    HDDTEMP_PORT=7634
+    AC_DEFINE_UNQUOTED([HDDTEMP_PORT], ["$HDDTEMP_PORT"], [Port for hddtemp with netcat])
     AC_SUBST([HDDTEMP_PORT])
 fi
 
@@ -244,18 +246,38 @@
 LIBXFCE4SENSORS_VERINFO=libxfce4sensors_verinfo()
 AC_SUBST([LIBXFCE4SENSORS_VERINFO])
 
+dnl **************************************
+dnl *** Check for Gtk/Glib packages  ***
+dnl **************************************
 XDT_CHECK_PACKAGE([GTK], [gtk+-2.0], [2.10.0])
 XDT_CHECK_PACKAGE([GLIB], [glib-2.0], [2.6.0])
 dnl XDT_CHECK_PACKAGE([GTHREAD], [gthread-2.0], [2.12.0])
+
+
+dnl **************************************
+dnl *** Check for notification library ***
+dnl **************************************
+dnl XDT_CHECK_PACKAGE([LIBNOTIFY], [libnotify], [0.4.0])
+XDT_CHECK_OPTIONAL_PACKAGE([LIBNOTIFY],
+                           [libnotify],
+                           [0.4], [notification],
+                           [notification message library])
+
+
+dnl **************************************
+dnl *** Check for Xfce packages ***
+dnl **************************************
 XDT_CHECK_PACKAGE([LIBXFCE4UTIL], [libxfce4util-1.0], [4.4.0])
 XDT_CHECK_PACKAGE([LIBXFCEGUI4], [libxfcegui4-1.0], [4.4.0])
 
 dnl configure the panel plugin
 XDT_CHECK_PACKAGE([LIBXFCE4PANEL], [libxfce4panel-1.0], [4.4.0])
 
+
 dnl I18n support
 XDT_I18N([@LINGUAS@])
 
+
 dnl Check for debugging support
 XDT_FEATURE_DEBUG()
 
@@ -285,9 +307,9 @@
 echo "==============================================================="
 echo "Build Configuration"
 echo "==============================================================="
+dnl echo
+dnl echo "Host system:  $OS"
 echo
-echo "Host system:  $OS"
-echo
 echo "The following sensor interfaces will be built into the plugin:"
 if test x"$enable_hddtemp" = x"yes"; then
 echo "*  hddtemp: $HDDTEMP (Make sure it is user-executable with UID bit set "
@@ -295,7 +317,7 @@
 fi
 
 if test x"$enable_netcat" = x"yes"; then
-echo "   netcat: $NETCAT_PATH on $HDDTEMP_HOST:$HDDTEMP_PORT"
+echo "   netcat: $NETCAT_PATH on $NETCAT_HOST:$HDDTEMP_PORT"
 fi
 
 if test x"$enable_libsensors" = x"yes"; then
@@ -305,6 +327,10 @@
 echo "*  /proc/acpi"
 fi
 echo
+if test x"$LIBNOTIFY_FOUND" = x"yes"; then
+echo "Support for libnotify will be built in."
+echo
+fi
 if test x"$enable_debug" = x"yes"; then
 echo "Full debug is enabled"
 else

Modified: xfce4-sensors-plugin/trunk/include/lmsensors.h
===================================================================
--- xfce4-sensors-plugin/trunk/include/lmsensors.h	2008-10-12 20:45:21 UTC (rev 5595)
+++ xfce4-sensors-plugin/trunk/include/lmsensors.h	2008-10-12 21:14:39 UTC (rev 5596)
@@ -23,7 +23,7 @@
 #define XFCE4_SENSORS_LMSENSORS_H
 
 #ifdef HAVE_CONFIG_H
-  #include "config.h"
+# include "config.h"
 #endif
 
 /* Gtk/Glib includes */

Modified: xfce4-sensors-plugin/trunk/lib/Makefile.am
===================================================================
--- xfce4-sensors-plugin/trunk/lib/Makefile.am	2008-10-12 20:45:21 UTC (rev 5595)
+++ xfce4-sensors-plugin/trunk/lib/Makefile.am	2008-10-12 21:14:39 UTC (rev 5596)
@@ -44,6 +44,10 @@
 	@LIBSENSORS_CFLAGS@										\
 	@LIBXFCE4PANEL_CFLAGS@
 
+if HAVE_LIBNOTIFY
+libxfce4sensors_la_CFLAGS += @LIBNOTIFY_CFLAGS@
+endif
+
 #	@LIBXFCE4UTIL_CFLAGS@							\
 #	@LIBXFCEGUI4_CFLAGS@
 
@@ -64,6 +68,10 @@
 	@LIBSENSORS_LDFLAGS@									\
 	@LIBXFCE4PANEL_LIBS@
 
+if HAVE_LIBNOTIFY
+libxfce4sensors_la_LIBADD += @LIBNOTIFY_LIBS@
+endif
+
 #	@LIBXFCE4UTIL_LIBS@								\
 #	@LIBXFCEGUI4_LIBS@
 

Modified: xfce4-sensors-plugin/trunk/lib/acpi.c
===================================================================
--- xfce4-sensors-plugin/trunk/lib/acpi.c	2008-10-12 20:45:21 UTC (rev 5595)
+++ xfce4-sensors-plugin/trunk/lib/acpi.c	2008-10-12 21:14:39 UTC (rev 5596)
@@ -17,6 +17,10 @@
 
 /* Note for programmers and editors: Try to use 4 spaces instead of Tab! */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 /* Package includes */
 #include <acpi.h>
 #include <types.h>

Modified: xfce4-sensors-plugin/trunk/lib/configuration.c
===================================================================
--- xfce4-sensors-plugin/trunk/lib/configuration.c	2008-10-12 20:45:21 UTC (rev 5595)
+++ xfce4-sensors-plugin/trunk/lib/configuration.c	2008-10-12 21:14:39 UTC (rev 5596)
@@ -19,6 +19,10 @@
 
 /* Note for programmers and editors: Try to use 4 spaces instead of Tab! */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 /* Global includes */
 #include <stdlib.h>
 #include <unistd.h>
@@ -78,7 +82,6 @@
     unlink (file);
 
     rc = xfce_rc_simple_open (file, FALSE);
-    g_free (file);
 
     if (!rc) {
         TRACE ("leaves sensors_write_config: No rc file opened");

Modified: xfce4-sensors-plugin/trunk/lib/hddtemp.c
===================================================================
--- xfce4-sensors-plugin/trunk/lib/hddtemp.c	2008-10-12 20:45:21 UTC (rev 5595)
+++ xfce4-sensors-plugin/trunk/lib/hddtemp.c	2008-10-12 21:14:39 UTC (rev 5596)
@@ -17,8 +17,11 @@
 
 /* Note for programmers and editors: Try to use 4 spaces instead of Tab! */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 /* Package includes */
-#include <config.h>
 #include <hddtemp.h>
 #include <middlelayer.h>
 #include <types.h>
@@ -40,6 +43,7 @@
 #include <gtk/gtkstock.h> */
 
 /* Global includes */
+#include <libnotify/notify.h>
 /* #include <stdio.h> */
 #include <stdlib.h>
 #include <string.h>
@@ -48,9 +52,27 @@
 
 #include <unistd.h>
 
+#ifdef HAVE_LIBNOTIFY
+void quick_message_notify (gchar *message)
+{
+    NotifyNotification *nn;
+    gchar *summary, *body, *icon;
+    GError *error = NULL;
 
-void quick_message (gchar *message) {
+    summary = "Hddtemp Information";
+    body = message;
+    icon = "xfce-sensors";
 
+    if (!notify_is_initted())
+        notify_init(PACKAGE); /* NOTIFY_APPNAME */
+
+    nn = notify_notification_new(summary, body, icon, NULL);
+    notify_notification_show(nn, &error);
+}
+#else
+void quick_message_dialog (gchar *message)
+{
+
     GtkWidget *dialog;  /*, *label; */
 
     TRACE ("enters quick_message");
@@ -79,8 +101,20 @@
 
     TRACE ("leaves quick_message");
 }
+#endif
 
 
+void quick_message (gchar *message)
+{
+#ifdef HAVE_LIBNOTIFY
+    quick_message_notify (message);
+#else
+    quick_message_dialog (message);
+#endif
+}
+
+
+
 gboolean quick_message_with_checkbox (gchar *message, gchar *checkboxtext) {
 
     GtkWidget *dialog, *checkbox;  /*, *label; */
@@ -365,8 +399,8 @@
                             "Calling \"%s\" gave the following error:\n%s\nwith a return value of %d.\n"),
                             PATH_HDDTEMP, cmd_line, standard_error, exit_status);
             checktext = g_strdup(_("Suppress this message in future"));
-            /* quick_message (msg_text); */
-            nevershowagain = quick_message_with_checkbox(msg_text, checktext);
+            quick_message (msg_text);
+            nevershowagain = FALSE; //quick_message_with_checkbox(msg_text, checktext);
 
             if (suppressmessage!=NULL)
                 *suppressmessage = nevershowagain;

Modified: xfce4-sensors-plugin/trunk/lib/lmsensors.c
===================================================================
--- xfce4-sensors-plugin/trunk/lib/lmsensors.c	2008-10-12 20:45:21 UTC (rev 5595)
+++ xfce4-sensors-plugin/trunk/lib/lmsensors.c	2008-10-12 21:14:39 UTC (rev 5596)
@@ -19,6 +19,10 @@
 
 /* Note for programmers and editors: Try to use 4 spaces instead of Tab! */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 /* Package includes */
 #include <lmsensors.h>
 #include <middlelayer.h>
@@ -31,7 +35,6 @@
 #include <glib/gmem.h> */
 #include <glib/gprintf.h>
 
-
 /* Global includes */
 #include <errno.h>
 #include <stdio.h>

Modified: xfce4-sensors-plugin/trunk/lib/middlelayer.c
===================================================================
--- xfce4-sensors-plugin/trunk/lib/middlelayer.c	2008-10-12 20:45:21 UTC (rev 5595)
+++ xfce4-sensors-plugin/trunk/lib/middlelayer.c	2008-10-12 21:14:39 UTC (rev 5596)
@@ -18,9 +18,9 @@
  *      Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  */
 
-/* #ifdef HAVE_CONFIG_H */
-  #include <config.h>
-/* #endif */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
 
 
 #ifdef HAVE_LINUX

Modified: xfce4-sensors-plugin/trunk/lib/sensors-interface-common.c
===================================================================
--- xfce4-sensors-plugin/trunk/lib/sensors-interface-common.c	2008-10-12 20:45:21 UTC (rev 5595)
+++ xfce4-sensors-plugin/trunk/lib/sensors-interface-common.c	2008-10-12 21:14:39 UTC (rev 5596)
@@ -17,6 +17,10 @@
 
 /* Note for programmers and editors: Try to use 4 spaces instead of Tab! */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 /* Xfce includes */
 #include <libxfce4panel/xfce-panel-plugin.h>
 

Modified: xfce4-sensors-plugin/trunk/lib/sensors-interface.c
===================================================================
--- xfce4-sensors-plugin/trunk/lib/sensors-interface.c	2008-10-12 20:45:21 UTC (rev 5595)
+++ xfce4-sensors-plugin/trunk/lib/sensors-interface.c	2008-10-12 21:14:39 UTC (rev 5596)
@@ -18,6 +18,9 @@
 /* Note for programmers and editors: Try to use 4 spaces instead of Tab! */
 
 /* Definitions */
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
 
 /* Global includes */
 /* #include <stdlib.h> */

Modified: xfce4-sensors-plugin/trunk/panel-plugin/sensors-plugin.c
===================================================================
--- xfce4-sensors-plugin/trunk/panel-plugin/sensors-plugin.c	2008-10-12 20:45:21 UTC (rev 5595)
+++ xfce4-sensors-plugin/trunk/panel-plugin/sensors-plugin.c	2008-10-12 21:14:39 UTC (rev 5596)
@@ -24,6 +24,9 @@
 
 /* Note for programmers and editors: Try to use 4 spaces instead of Tab! */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
 
 /* Global includes */
 #include <math.h>

Modified: xfce4-sensors-plugin/trunk/src/actions.c
===================================================================
--- xfce4-sensors-plugin/trunk/src/actions.c	2008-10-12 20:45:21 UTC (rev 5595)
+++ xfce4-sensors-plugin/trunk/src/actions.c	2008-10-12 21:14:39 UTC (rev 5596)
@@ -19,5 +19,9 @@
 
 /* Note for programmers and editors: Try to use 4 spaces instead of Tab! */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 /* Local includes */
 #include "actions.h"

Modified: xfce4-sensors-plugin/trunk/src/callbacks.c
===================================================================
--- xfce4-sensors-plugin/trunk/src/callbacks.c	2008-10-12 20:45:21 UTC (rev 5595)
+++ xfce4-sensors-plugin/trunk/src/callbacks.c	2008-10-12 21:14:39 UTC (rev 5596)
@@ -19,6 +19,10 @@
 
 /* Note for programmers and editors: Try to use 4 spaces instead of Tab! */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 /* Global includes */
 #include <stdlib.h>
 

Modified: xfce4-sensors-plugin/trunk/src/interface.c
===================================================================
--- xfce4-sensors-plugin/trunk/src/interface.c	2008-10-12 20:45:21 UTC (rev 5595)
+++ xfce4-sensors-plugin/trunk/src/interface.c	2008-10-12 21:14:39 UTC (rev 5596)
@@ -19,6 +19,10 @@
 
 /* Note for programmers and editors: Try to use 4 spaces instead of Tab! */
 
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
 /* Xfce includes */
 #include <libxfcegui4/libxfcegui4.h>
 




More information about the Goodies-commits mailing list