#include <ui_sensorpref.h>
#include <ui_color.h>
-
-#if defined(HAVE_APPINDICATOR) || defined(HAVE_APPINDICATOR_029)
-#include "ui_appindicator.h"
+#if defined(HAVE_APPINDICATOR)
+#include <ui_appindicator.h>
#endif
enum {
static void sensor_pref_free(struct sensor_pref *p)
{
if (!p)
- return ;
+ return;
free(p->name);
free(p->color);
w_appindicator_label_enabled = GTK_TOGGLE_BUTTON
(gtk_builder_get_object(builder, "indicator_label_checkbox"));
- if (is_temp_type(s->type) || is_fan_type(s->type)) {
- gtk_toggle_button_set_active(w_alarm, p->alarm_enabled);
- gtk_spin_button_set_value(w_high_threshold,
- p->alarm_high_threshold);
- gtk_spin_button_set_value(w_low_threshold,
- p->alarm_low_threshold);
- gtk_widget_set_sensitive(GTK_WIDGET(w_alarm), TRUE);
- gtk_widget_set_sensitive(GTK_WIDGET(w_high_threshold), TRUE);
- gtk_widget_set_sensitive(GTK_WIDGET(w_low_threshold), TRUE);
- } else {
- gtk_toggle_button_set_active(w_alarm, 0);
- gtk_spin_button_set_value(w_high_threshold, 0);
- gtk_spin_button_set_value(w_low_threshold, 0);
- gtk_widget_set_sensitive(GTK_WIDGET(w_alarm), FALSE);
- gtk_widget_set_sensitive(GTK_WIDGET(w_high_threshold), FALSE);
- gtk_widget_set_sensitive(GTK_WIDGET(w_low_threshold), FALSE);
- }
+
+#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
+
+ gtk_toggle_button_set_active(w_alarm, p->alarm_enabled);
+ gtk_spin_button_set_value(w_high_threshold, p->alarm_high_threshold);
+ gtk_spin_button_set_value(w_low_threshold, p->alarm_low_threshold);
+ gtk_widget_set_sensitive(GTK_WIDGET(w_alarm), TRUE);
+ gtk_widget_set_sensitive(GTK_WIDGET(w_high_threshold), TRUE);
+ gtk_widget_set_sensitive(GTK_WIDGET(w_low_threshold), TRUE);
gtk_toggle_button_set_active(w_appindicator_enabled,
p->appindicator_enabled);
struct psensor **s_cur;
int i;
GtkTreePath *p;
+ GtkTreeSelection *sel;
p = NULL;
for (s_cur = sensors, i = 0; *s_cur; s_cur++, i++)
}
if (p) {
- GtkTreeSelection *s = gtk_tree_view_get_selection(tree);
+ sel = gtk_tree_view_get_selection(tree);
- gtk_tree_selection_select_path(s, p);
+ gtk_tree_selection_select_path(sel, p);
gtk_tree_path_free(p);
}
}
if (!ok) {
log_printf(LOG_ERR, error->message);
g_error_free(error);
- return ;
+ return;
}
w_sensors_list
if (result == GTK_RESPONSE_ACCEPT) {
apply_prefs(model, ui->config);
ui_sensorlist_update(ui, 1);
-#if defined(HAVE_APPINDICATOR) || defined(HAVE_APPINDICATOR_029)
+#if defined(HAVE_APPINDICATOR)
ui_appindicator_update_menu(ui);
#endif
}