added support of udisks2 (only init stage)
authorJean-Philippe Orsini <jeanfi@gmail.com>
Mon, 15 Sep 2014 20:23:25 +0000 (22:23 +0200)
committerJean-Philippe Orsini <jeanfi@gmail.com>
Mon, 15 Sep 2014 20:23:25 +0000 (22:23 +0200)
31 files changed:
Makefile.in
NEWS
config.h.in
configure
configure.ac
doc/Makefile.in
icons/hicolor/14x14/Makefile.in
icons/hicolor/16x16/Makefile.in
icons/hicolor/22x22/Makefile.in
icons/hicolor/24x24/Makefile.in
icons/hicolor/32x32/Makefile.in
icons/hicolor/48x48/Makefile.in
icons/hicolor/64x64/Makefile.in
icons/hicolor/scalable/Makefile.in
icons/ubuntu-mono-dark/apps/22/Makefile.in
icons/ubuntu-mono-dark/status/22/Makefile.in
icons/ubuntu-mono-light/status/22/Makefile.in
po/Makefile.in
src/Makefile.am
src/Makefile.in
src/glade/Makefile.in
src/lib/Makefile.am
src/lib/Makefile.in
src/lib/psensor.c
src/lib/psensor.h
src/lib/temperature.c
src/lib/temperature.h
src/main.c
src/server/Makefile.in
tests/Makefile.in
www/Makefile.in

index f45bf33..e387bb1 100644 (file)
@@ -286,6 +286,8 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
diff --git a/NEWS b/NEWS
index a5502eb..4f38795 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -20,10 +20,11 @@ v1.1.2
 * Added alarm support of sensors expressed as percent.
 * Smoother curves (using Bezier algo).
 * Added translator credits in the about dialog.
-* Added Crotian translation from LP (gogo).
+* Added Croatian translation from LP (gogo).
 * Merged all translations from LP.
 * Included the full list of contributors from LP, available throw the
   about dialog.
+* Support of disk temperature using udisks2.
 
 v1.1.1
 ------
index 1f671a6..28426c2 100644 (file)
@@ -67,6 +67,9 @@
 /* Define to 1 if you have the `sensors' library (-lsensors). */
 #undef HAVE_LIBSENSORS
 
+/* Use libudisks */
+#undef HAVE_LIBUDISKS2
+
 /* Define to 1 if your system has a GNU libc compatible `malloc' function, and
    to 0 otherwise. */
 #undef HAVE_MALLOC
index 70dac4a..338ac30 100755 (executable)
--- a/configure
+++ b/configure
@@ -673,6 +673,10 @@ ATASMART_FALSE
 ATASMART_TRUE
 ATASMART_LIBS
 ATASMART_CFLAGS
+LIBUDISKS2_FALSE
+LIBUDISKS2_TRUE
+LIBUDISKS2_LIBS
+LIBUDISKS2_CFLAGS
 GTK_FALSE
 GTK_TRUE
 GTK_LIBS
@@ -842,6 +846,8 @@ XEXT_CFLAGS
 XEXT_LIBS
 GTK_CFLAGS
 GTK_LIBS
+LIBUDISKS2_CFLAGS
+LIBUDISKS2_LIBS
 ATASMART_CFLAGS
 ATASMART_LIBS
 LIBNOTIFY_CFLAGS
@@ -1525,6 +1531,10 @@ Some influential environment variables:
   XEXT_LIBS   linker flags for XEXT, overriding pkg-config
   GTK_CFLAGS  C compiler flags for GTK, overriding pkg-config
   GTK_LIBS    linker flags for GTK, overriding pkg-config
+  LIBUDISKS2_CFLAGS
+              C compiler flags for LIBUDISKS2, overriding pkg-config
+  LIBUDISKS2_LIBS
+              linker flags for LIBUDISKS2, overriding pkg-config
   ATASMART_CFLAGS
               C compiler flags for ATASMART, overriding pkg-config
   ATASMART_LIBS
@@ -7695,7 +7705,93 @@ GTK_CFLAGS+=" -DGSEAL_ENABLE "
 
 
 
-### Optional
+# udisks2
+
+
+pkg_failed=no
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for LIBUDISKS2" >&5
+$as_echo_n "checking for LIBUDISKS2... " >&6; }
+
+if test -n "$LIBUDISKS2_CFLAGS"; then
+    pkg_cv_LIBUDISKS2_CFLAGS="$LIBUDISKS2_CFLAGS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"udisks2\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "udisks2") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBUDISKS2_CFLAGS=`$PKG_CONFIG --cflags "udisks2" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+if test -n "$LIBUDISKS2_LIBS"; then
+    pkg_cv_LIBUDISKS2_LIBS="$LIBUDISKS2_LIBS"
+ elif test -n "$PKG_CONFIG"; then
+    if test -n "$PKG_CONFIG" && \
+    { { $as_echo "$as_me:${as_lineno-$LINENO}: \$PKG_CONFIG --exists --print-errors \"udisks2\""; } >&5
+  ($PKG_CONFIG --exists --print-errors "udisks2") 2>&5
+  ac_status=$?
+  $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5
+  test $ac_status = 0; }; then
+  pkg_cv_LIBUDISKS2_LIBS=`$PKG_CONFIG --libs "udisks2" 2>/dev/null`
+                     test "x$?" != "x0" && pkg_failed=yes
+else
+  pkg_failed=yes
+fi
+ else
+    pkg_failed=untried
+fi
+
+
+
+if test $pkg_failed = yes; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
+        _pkg_short_errors_supported=yes
+else
+        _pkg_short_errors_supported=no
+fi
+        if test $_pkg_short_errors_supported = yes; then
+               LIBUDISKS2_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "udisks2" 2>&1`
+        else
+               LIBUDISKS2_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "udisks2" 2>&1`
+        fi
+       # Put the nasty error message in config.log where it belongs
+       echo "$LIBUDISKS2_PKG_ERRORS" >&5
+
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Library udisks2 not present\"" >&5
+$as_echo "$as_me: WARNING: \"Library udisks2 not present\"" >&2;}
+elif test $pkg_failed = untried; then
+       { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+       { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: \"Library udisks2 not present\"" >&5
+$as_echo "$as_me: WARNING: \"Library udisks2 not present\"" >&2;}
+else
+       LIBUDISKS2_CFLAGS=$pkg_cv_LIBUDISKS2_CFLAGS
+       LIBUDISKS2_LIBS=$pkg_cv_LIBUDISKS2_LIBS
+        { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
+
+$as_echo "#define HAVE_LIBUDISKS2 1" >>confdefs.h
+
+fi
+ if test -n "$LIBUDISKS2_LIBS"; then
+  LIBUDISKS2_TRUE=
+  LIBUDISKS2_FALSE='#'
+else
+  LIBUDISKS2_TRUE='#'
+  LIBUDISKS2_FALSE=
+fi
+
+
+
 
 # check libatasmart
 
@@ -9114,6 +9210,10 @@ if test -z "${GTK_TRUE}" && test -z "${GTK_FALSE}"; then
   as_fn_error $? "conditional \"GTK\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
 fi
+if test -z "${LIBUDISKS2_TRUE}" && test -z "${LIBUDISKS2_FALSE}"; then
+  as_fn_error $? "conditional \"LIBUDISKS2\" was never defined.
+Usually this means the macro was only invoked conditionally." "$LINENO" 5
+fi
 if test -z "${ATASMART_TRUE}" && test -z "${ATASMART_FALSE}"; then
   as_fn_error $? "conditional \"ATASMART\" was never defined.
 Usually this means the macro was only invoked conditionally." "$LINENO" 5
index b3a0c99..5e95bf2 100644 (file)
@@ -83,7 +83,15 @@ GTK_CFLAGS+=" -DGSEAL_ENABLE "
 AC_SUBST(GTK_CFLAGS)
 AC_SUBST(GTK_LIBS)
 
-### Optional
+# udisks2
+
+PKG_CHECK_MODULES(LIBUDISKS2,
+                 udisks2,
+                 [AC_DEFINE([HAVE_LIBUDISKS2],[1],[Use libudisks])],
+                 [AC_MSG_WARN("Library udisks2 not present")])
+AM_CONDITIONAL(LIBUDISKS2, test -n "$LIBUDISKS2_LIBS")
+AC_SUBST(LIBUDISKS2_CFLAGS)
+AC_SUBST(LIBUDISKS2_LIBS)
 
 # check libatasmart
 PKG_CHECK_MODULES(ATASMART, libatasmart,
index 78d74a9..7d71d4c 100644 (file)
@@ -202,6 +202,8 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
index 397cd9c..7bd0a08 100644 (file)
@@ -201,6 +201,8 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
index 897d839..4148855 100644 (file)
@@ -201,6 +201,8 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
index 897481a..7b2b13a 100644 (file)
@@ -201,6 +201,8 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
index c477aec..25e88f4 100644 (file)
@@ -201,6 +201,8 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
index 0962c12..530450f 100644 (file)
@@ -201,6 +201,8 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
index f21011d..ca6ce55 100644 (file)
@@ -201,6 +201,8 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
index bfb3d67..0660305 100644 (file)
@@ -201,6 +201,8 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
index 44e0e57..3d3706c 100644 (file)
@@ -201,6 +201,8 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
index 63b9a6f..f156ce5 100644 (file)
@@ -201,6 +201,8 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
index 76d9ea6..a72a4e7 100644 (file)
@@ -201,6 +201,8 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
index 88e49ea..2ac509c 100644 (file)
@@ -201,6 +201,8 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
index ac38b05..9bee9bc 100644 (file)
@@ -21,7 +21,7 @@ srcdir = .
 top_srcdir = ..
 
 
-prefix = /usr/local
+prefix = /tmp
 exec_prefix = ${prefix}
 datarootdir = ${prefix}/share
 datadir = ${datarootdir}
@@ -34,12 +34,12 @@ INSTALL_DATA = ${INSTALL} -m 644
 # We use $(mkdir_p).
 # In automake <= 1.9.x, $(mkdir_p) is defined either as "mkdir -p --" or as
 # "$(mkinstalldirs)" or as "$(install_sh) -d". For these automake versions,
-# ${SHELL} /home/jporsini/work.local/psensor/install-sh does not start with $(SHELL), so we add it.
+# ${SHELL} /home/jporsini/work/psensor/install-sh does not start with $(SHELL), so we add it.
 # In automake >= 1.10, /bin/mkdir -p is derived from ${MKDIR_P}, which is defined
 # either as "/path/to/mkdir -p" or ".../install-sh -c -d". For these automake
 # versions, $(mkinstalldirs) and $(install_sh) are unused.
-mkinstalldirs = $(SHELL) ${SHELL} /home/jporsini/work.local/psensor/install-sh -d
-install_sh = $(SHELL) ${SHELL} /home/jporsini/work.local/psensor/install-sh
+mkinstalldirs = $(SHELL) ${SHELL} /home/jporsini/work/psensor/install-sh -d
+install_sh = $(SHELL) ${SHELL} /home/jporsini/work/psensor/install-sh
 MKDIR_P = /bin/mkdir -p
 mkdir_p = /bin/mkdir -p
 
index 34741e8..3ddb1e7 100644 (file)
@@ -84,6 +84,10 @@ AM_CPPFLAGS += $(ATASMART_CFLAGS)
 LIBS += $(ATASMART_LIBS)
 endif
 
+if LIBUDISKS2
+LIBS += $(LIBUDISKS2_LIBS)
+endif
+
 if UNITY
 psensor_SOURCES += ui_unity.h ui_unity.c
 AM_CPPFLAGS += $(UNITY_CFLAGS)
index 519d709..40b3dcd 100644 (file)
@@ -94,12 +94,13 @@ host_triplet = @host@
 @LIBATIADL_TRUE@am__append_13 = $(LIBATIADL_LIBS)
 @ATASMART_TRUE@am__append_14 = $(ATASMART_CFLAGS)
 @ATASMART_TRUE@am__append_15 = $(ATASMART_LIBS)
-@UNITY_TRUE@am__append_16 = ui_unity.h ui_unity.c
-@UNITY_TRUE@am__append_17 = $(UNITY_CFLAGS)
-@UNITY_TRUE@am__append_18 = $(UNITY_LIBS) 
-@CURL_TRUE@@JSON_TRUE@am__append_19 = rsensor.h rsensor.c
-@CURL_TRUE@@JSON_TRUE@am__append_20 = $(CURL_LIBS) $(JSON_LIBS)
-@CURL_TRUE@@JSON_TRUE@am__append_21 = $(CURL_CFLAGS) $(JSON_CFLAGS)
+@LIBUDISKS2_TRUE@am__append_16 = $(LIBUDISKS2_LIBS)
+@UNITY_TRUE@am__append_17 = ui_unity.h ui_unity.c
+@UNITY_TRUE@am__append_18 = $(UNITY_CFLAGS)
+@UNITY_TRUE@am__append_19 = $(UNITY_LIBS) 
+@CURL_TRUE@@JSON_TRUE@am__append_20 = rsensor.h rsensor.c
+@CURL_TRUE@@JSON_TRUE@am__append_21 = $(CURL_LIBS) $(JSON_LIBS)
+@CURL_TRUE@@JSON_TRUE@am__append_22 = $(CURL_CFLAGS) $(JSON_CFLAGS)
 subdir = src
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
        $(top_srcdir)/depcomp $(dist_man_MANS)
@@ -324,7 +325,9 @@ LIBOBJS = @LIBOBJS@
 LIBS = lib/libpsensor.a $(GTK_LIBS) $(PTHREAD_LIBS) $(SENSORS_LIBS) \
        -lm $(am__append_3) $(am__append_5) $(am__append_8) \
        $(am__append_11) $(am__append_13) $(am__append_15) \
-       $(am__append_18) $(am__append_20)
+       $(am__append_16) $(am__append_19) $(am__append_21)
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
@@ -427,16 +430,16 @@ AM_CPPFLAGS = -Wall -Werror -DDEFAULT_WWW_DIR=\""$(pkgdatadir)/www"\" \
        -I$(top_srcdir)/src/lib -I$(top_srcdir)/src/unity \
        $(GTK_CFLAGS) $(SENSORS_CFLAGS) $(am__append_2) \
        $(am__append_6) $(am__append_9) $(am__append_10) \
-       $(am__append_12) $(am__append_14) $(am__append_17) \
-       $(am__append_21)
+       $(am__append_12) $(am__append_14) $(am__append_18) \
+       $(am__append_22)
 @GTK_TRUE@@X11_TRUE@@XEXT_TRUE@dist_man_MANS = psensor.1
 psensor_SOURCES = cfg.h cfg.c notify_cmd.c notify_cmd.h graph.h \
        graph.c main.c ui.h ui.c ui_appindicator.h ui_color.h \
        ui_color.c ui_graph.h ui_graph.c ui_pref.h ui_pref.c \
        ui_sensorlist.h ui_sensorlist.c ui_sensorpref.h \
        ui_sensorpref.c ui_status.h ui_status.c pxdg.h pxdg.c \
-       $(am__append_4) $(am__append_7) $(am__append_16) \
-       $(am__append_19)
+       $(am__append_4) $(am__append_7) $(am__append_17) \
+       $(am__append_20)
 gsettings_SCHEMAS = psensor.gschema.xml
 EXTRA_DIST = description.txt $(gsettings_SCHEMAS)
 all: all-recursive
index 2fdbf6b..a6076fd 100644 (file)
@@ -201,6 +201,8 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
index 4fc188c..9674353 100644 (file)
@@ -48,8 +48,15 @@ LIBS += $(JSON_LIBS)
 AM_CPPFLAGS += $(JSON_CFLAGS)
 endif
 
+if LIBUDISKS2
+libpsensor_a_SOURCES += pudisks2.c pudisks2.h
+LIBS += $(LIBUDISKS2_LIBS)
+AM_CPPFLAGS += $(LIBUDISKS2_CFLAGS)
+endif
+
 EXTRA_DIST=$(libpsensor_a_SOURCES) \
        amd.c \
        cpu.c \
        nvidia.c \
-       pmem.c pmem.h
+       pmem.c pmem.h \
+       pudisks2.c pudisks2.h
index 8ba10d1..a1caa25 100644 (file)
@@ -91,6 +91,9 @@ host_triplet = @host@
 @JSON_TRUE@am__append_11 = psensor_json.h psensor_json.c
 @JSON_TRUE@am__append_12 = $(JSON_LIBS)
 @JSON_TRUE@am__append_13 = $(JSON_CFLAGS)
+@LIBUDISKS2_TRUE@am__append_14 = pudisks2.c pudisks2.h
+@LIBUDISKS2_TRUE@am__append_15 = $(LIBUDISKS2_LIBS)
+@LIBUDISKS2_TRUE@am__append_16 = $(LIBUDISKS2_CFLAGS)
 subdir = src/lib
 DIST_COMMON = $(srcdir)/Makefile.in $(srcdir)/Makefile.am \
        $(top_srcdir)/depcomp
@@ -119,18 +122,21 @@ am__libpsensor_a_SOURCES_DIST = amd.h bool.h color.h color.c cpu.h \
        nvidia.h plog.h plog.c pmutex.h pmutex.c psensor.h psensor.c \
        ptime.h ptime.c pio.h pio.c slog.c slog.h temperature.c \
        temperature.h url.c url.h hdd_atasmart.c nvidia.c amd.c cpu.c \
-       pmem.c pmem.h psensor_json.h psensor_json.c
+       pmem.c pmem.h psensor_json.h psensor_json.c pudisks2.c \
+       pudisks2.h
 @ATASMART_TRUE@am__objects_1 = hdd_atasmart.$(OBJEXT)
 @NVIDIA_TRUE@am__objects_2 = nvidia.$(OBJEXT)
 @LIBATIADL_TRUE@am__objects_3 = amd.$(OBJEXT)
 @GTOP_TRUE@am__objects_4 = cpu.$(OBJEXT) pmem.$(OBJEXT)
 @JSON_TRUE@am__objects_5 = psensor_json.$(OBJEXT)
+@LIBUDISKS2_TRUE@am__objects_6 = pudisks2.$(OBJEXT)
 am_libpsensor_a_OBJECTS = color.$(OBJEXT) hdd_hddtemp.$(OBJEXT) \
        lmsensor.$(OBJEXT) measure.$(OBJEXT) plog.$(OBJEXT) \
        pmutex.$(OBJEXT) psensor.$(OBJEXT) ptime.$(OBJEXT) \
        pio.$(OBJEXT) slog.$(OBJEXT) temperature.$(OBJEXT) \
        url.$(OBJEXT) $(am__objects_1) $(am__objects_2) \
-       $(am__objects_3) $(am__objects_4) $(am__objects_5)
+       $(am__objects_3) $(am__objects_4) $(am__objects_5) \
+       $(am__objects_6)
 libpsensor_a_OBJECTS = $(am_libpsensor_a_OBJECTS)
 AM_V_P = $(am__v_P_@AM_V@)
 am__v_P_ = $(am__v_P_@AM_DEFAULT_V@)
@@ -246,7 +252,9 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@ $(am__append_2) $(am__append_5) $(am__append_9) \
-       $(am__append_12)
+       $(am__append_12) $(am__append_15)
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
@@ -345,14 +353,16 @@ libpsensor_a_SOURCES = amd.h bool.h color.h color.c cpu.h hdd.h \
        nvidia.h plog.h plog.c pmutex.h pmutex.c psensor.h psensor.c \
        ptime.h ptime.c pio.h pio.c slog.c slog.h temperature.c \
        temperature.h url.c url.h $(am__append_1) $(am__append_4) \
-       $(am__append_7) $(am__append_8) $(am__append_11)
+       $(am__append_7) $(am__append_8) $(am__append_11) \
+       $(am__append_14)
 AM_CPPFLAGS = -Wall -Werror $(am__append_3) $(am__append_6) \
-       $(am__append_10) $(am__append_13)
+       $(am__append_10) $(am__append_13) $(am__append_16)
 EXTRA_DIST = $(libpsensor_a_SOURCES) \
        amd.c \
        cpu.c \
        nvidia.c \
-       pmem.c pmem.h
+       pmem.c pmem.h \
+       pudisks2.c pudisks2.h
 
 all: all-am
 
@@ -418,6 +428,7 @@ distclean-compile:
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psensor.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/psensor_json.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/ptime.Po@am__quote@
+@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/pudisks2.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/slog.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/temperature.Po@am__quote@
 @AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/url.Po@am__quote@
index b589c03..d7119ab 100644 (file)
@@ -69,6 +69,10 @@ struct psensor *psensor_create(char *id,
        psensor->graph_enabled = 1;
        psensor->appindicator_enabled = 0;
 
+#ifdef HAVE_LIBUDISKS2
+       psensor->udisks2_path = NULL;
+#endif
+
        return psensor;
 }
 
@@ -113,6 +117,10 @@ void psensor_free(struct psensor *sensor)
 
                free(sensor->url);
 
+#ifdef HAVE_LIBUDISKS2
+               free(sensor->udisks2_path);
+#endif
+
                free(sensor);
        }
 }
index 9ff5a64..3ab5d94 100644 (file)
@@ -47,6 +47,7 @@ enum psensor_type {
        SENSOR_TYPE_ATIADL = 0x00800,
        SENSOR_TYPE_ATASMART = 0x01000,
        SENSOR_TYPE_HDDTEMP = 0x02000,
+       SENSOR_TYPE_UDISKS2 = 0x800000,
 
        /* Type of HW component */
        SENSOR_TYPE_HDD = 0x04000,
@@ -125,6 +126,9 @@ struct psensor {
 #ifdef HAVE_ATASMART
        SkDisk *disk;
 #endif
+#ifdef HAVE_LIBUDISKS2
+       char *udisks2_path;
+#endif
        char *url;
 
        bool appindicator_enabled;
index 3e74898..0ad5a43 100644 (file)
@@ -28,3 +28,7 @@ double fahrenheit_to_celsius(double f)
        return (f - 32) * (5.0/9.0);
 }
 
+double kelvin_to_celsius(double k)
+{
+       return k - 273.5;
+}
index b36c90e..591b39b 100644 (file)
@@ -21,5 +21,6 @@
 
 double celsius_to_fahrenheit(double c);
 double fahrenheit_to_celsius(double c);
+double kelvin_to_celsius(double k);
 
 #endif
index a8e3f61..50c1bac 100644 (file)
@@ -39,6 +39,7 @@
 #include "lmsensor.h"
 #include "notify_cmd.h"
 #include <pmutex.h>
+#include <pudisks2.h>
 #include "slog.h"
 #include "ui_pref.h"
 #include "ui_graph.h"
@@ -462,6 +463,7 @@ static struct psensor **create_sensors_list(const char *url,
 #ifdef HAVE_GTOP
                sensors = cpu_psensor_list_add(sensors, 600);
 #endif
+               udisks2_psensor_list_add(&sensors, 600);
        }
 
        associate_preferences(sensors);
index f0cc41e..fa57f23 100644 (file)
@@ -253,6 +253,8 @@ LIBOBJS = @LIBOBJS@
 LIBS = ../lib/libpsensor.a $(SENSORS_LIBS) $(JSON_LIBS) \
        $(LIBMICROHTTPD_LIBS) $(PTHREAD_LIBS) $(am__append_2) \
        $(am__append_5)
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
index 46bc0cf..f4f77ff 100644 (file)
@@ -455,6 +455,8 @@ LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@ ../src/lib/libpsensor.a $(SENSORS_LIBS) $(am__append_1) \
        $(am__append_2)
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@
index 1bab6e6..5d9a836 100644 (file)
@@ -201,6 +201,8 @@ LIBNOTIFY_CFLAGS = @LIBNOTIFY_CFLAGS@
 LIBNOTIFY_LIBS = @LIBNOTIFY_LIBS@
 LIBOBJS = @LIBOBJS@
 LIBS = @LIBS@
+LIBUDISKS2_CFLAGS = @LIBUDISKS2_CFLAGS@
+LIBUDISKS2_LIBS = @LIBUDISKS2_LIBS@
 LTLIBICONV = @LTLIBICONV@
 LTLIBINTL = @LTLIBINTL@
 LTLIBOBJS = @LTLIBOBJS@