From: Jean-Philippe Orsini Date: Wed, 24 Sep 2014 19:05:39 +0000 (+0200) Subject: avoid cpp usage X-Git-Tag: v1.2.0~131 X-Git-Url: http://git.wpitchoune.net/gitweb/?p=psensor.git;a=commitdiff_plain;h=7fe35c5f020a37c5b54676b98af44cc73fbe48df avoid cpp usage --- diff --git a/src/ui_sensorpref.c b/src/ui_sensorpref.c index e71492c..ff93a02 100644 --- a/src/ui_sensorpref.c +++ b/src/ui_sensorpref.c @@ -22,14 +22,12 @@ #include #include +#include #include #include #include #include -#if defined(HAVE_APPINDICATOR) -#include -#endif enum { COL_NAME = 0, @@ -290,18 +288,21 @@ update_pref(struct sensor_pref *p, struct config *cfg, GtkBuilder *builder) (gtk_builder_get_object(builder, "indicator_label_checkbox")); -#if !HAVE_APPINDICATOR - gtk_widget_set_sensitive(GTK_WIDGET(w_appindicator_label_enabled), - FALSE); - gtk_widget_set_sensitive(GTK_WIDGET(w_appindicator_enabled), FALSE); - gtk_widget_set_has_tooltip(GTK_WIDGET(w_appindicator_label_enabled), - TRUE); - gtk_widget_set_has_tooltip(GTK_WIDGET(w_appindicator_enabled), TRUE); -#else - gtk_widget_set_has_tooltip(GTK_WIDGET(w_appindicator_label_enabled), - FALSE); - gtk_widget_set_has_tooltip(GTK_WIDGET(w_appindicator_enabled), FALSE); -#endif + if (is_appindicator_supported()) { + gtk_widget_set_has_tooltip + (GTK_WIDGET(w_appindicator_label_enabled), FALSE); + gtk_widget_set_has_tooltip + (GTK_WIDGET(w_appindicator_enabled), FALSE); + } else { + gtk_widget_set_sensitive + (GTK_WIDGET(w_appindicator_label_enabled), FALSE); + gtk_widget_set_has_tooltip + (GTK_WIDGET(w_appindicator_label_enabled), TRUE); + gtk_widget_set_sensitive + (GTK_WIDGET(w_appindicator_enabled), FALSE); + gtk_widget_set_has_tooltip + (GTK_WIDGET(w_appindicator_enabled), TRUE); + } gtk_toggle_button_set_active(w_alarm, p->alarm_enabled); gtk_spin_button_set_value(w_high_threshold, p->alarm_high_threshold);