#include <stdlib.h>
#include <string.h>
+#include <hdd.h>
#include <amd.h>
-#include <ui.h>
#include <cfg.h>
#include <graph.h>
+#include <lmsensor.h>
#include <nvidia.h>
#include <pgtop2.h>
#include <pudisks2.h>
#include <pxdg.h>
-#include <ui_pref.h>
+#include <ui.h>
#include <ui_color.h>
+#include <ui_pref.h>
+#include <ui_unity.h>
GdkRGBA color_to_GdkRGBA(struct color *color)
{
gtk_toggle_button_set_active(w_enable_launcher_counter,
!cfg->unity_launcher_count_disabled);
-#if !HAVE_UNITY
- gtk_widget_set_sensitive(GTK_WIDGET(w_enable_launcher_counter), FALSE);
- gtk_widget_set_has_tooltip(GTK_WIDGET(w_enable_launcher_counter), TRUE);
-#else
- gtk_widget_set_has_tooltip(GTK_WIDGET(w_enable_launcher_counter),
- FALSE);
-#endif
+ if (ui_unity_is_supported()) {
+ gtk_widget_set_has_tooltip
+ (GTK_WIDGET(w_enable_launcher_counter), FALSE);
+ } else {
+ gtk_widget_set_sensitive
+ (GTK_WIDGET(w_enable_launcher_counter), FALSE);
+ gtk_widget_set_has_tooltip
+ (GTK_WIDGET(w_enable_launcher_counter), TRUE);
+ }
w_smooth_curves = GTK_TOGGLE_BUTTON
(gtk_builder_get_object(builder, "graph_smooth_curves"));
"lmsensors"));
gtk_toggle_button_set_active(w_lmsensors, config_is_lmsensor_enabled());
+ if (lmsensor_is_supported()) {
+ gtk_widget_set_has_tooltip(GTK_WIDGET(w_lmsensors), FALSE);
+ } else {
+ gtk_widget_set_sensitive(GTK_WIDGET(w_lmsensors), 0);
+ gtk_widget_set_has_tooltip(GTK_WIDGET(w_lmsensors), TRUE);
+ }
+
w_nvctrl
= GTK_TOGGLE_BUTTON(gtk_builder_get_object(builder,
"nvctrl"));
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());