#ifndef _PSENSOR_HDD_H_
#define _PSENSOR_HDD_H_
+#include <bool.h>
#include <config.h>
#include <psensor.h>
-#ifdef HAVE_ATASMART
-void atasmart_psensor_list_append(struct psensor ***sensors, int values_length);
-void atasmart_psensor_list_update(struct psensor **sensors);
+#if defined(HAVE_ATASMART) && HAVE_ATASMART
+
+static inline bool atasmart_is_supported(void) { return true; }
+
+void atasmart_psensor_list_append(struct psensor ***, int);
+void atasmart_psensor_list_update(struct psensor **);
+
+#else
+
+static inline bool atasmart_is_supported(void) { return false; }
+
+static inline void atasmart_psensor_list_append(struct psensor ***s, int n) {}
+static inline void atasmart_psensor_list_update(struct psensor **s) {}
+
#endif
void hddtemp_psensor_list_append(struct psensor ***sensors, int values_length);
#include <string.h>
#include <amd.h>
+#include <hdd.h>
#include <ui.h>
#include <cfg.h>
#include <graph.h>
w_libatasmart
= GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder,
"libatasmart"));
-#if !HAVE_ATASMART
- gtk_widget_set_sensitive(GTK_WIDGET(w_libatasmart), 0);
- gtk_widget_set_has_tooltip(GTK_WIDGET(w_libatasmart), TRUE);
-#else
- gtk_widget_set_has_tooltip(GTK_WIDGET(w_libatasmart), FALSE);
-#endif
+
+ if (atasmart_is_supported()) {
+ gtk_widget_set_has_tooltip(GTK_WIDGET(w_libatasmart), FALSE);
+ } else {
+ gtk_widget_set_sensitive(GTK_WIDGET(w_libatasmart), 0);
+ gtk_widget_set_has_tooltip(GTK_WIDGET(w_libatasmart), TRUE);
+ }
+
gtk_toggle_button_set_active(w_libatasmart,
config_is_libatasmart_enabled());