int alarm_low_threshold;
unsigned int appindicator_enabled;
unsigned int appindicator_label_enabled;
+ unsigned int display_enabled;
};
struct cb_data {
p->graph_enabled = s->graph_enabled;
p->alarm_enabled = s->alarm_enabled;
p->color = color_dup(s->color);
+ p->display_enabled = config_is_sensor_enabled(s->id);
if (cfg->temperature_unit == CELSIUS) {
p->alarm_high_threshold = s->alarm_high_threshold;
p->graph_enabled = gtk_toggle_button_get_active(btn);
}
+void ui_sensorpref_display_toggled_cb(GtkToggleButton *btn, gpointer data)
+{
+ struct sensor_pref *p;
+
+ p = get_selected_sensor_pref(GTK_TREE_VIEW(data));
+
+ if (p)
+ p->display_enabled = gtk_toggle_button_get_active(btn);
+}
+
void ui_sensorpref_alarm_toggled_cb(GtkToggleButton *btn, gpointer data)
{
struct sensor_pref *p;
*w_chipname;
GtkEntry *w_name;
GtkToggleButton *w_draw, *w_alarm, *w_appindicator_enabled,
- *w_appindicator_label_enabled;
+ *w_appindicator_label_enabled, *w_display;
GtkColorButton *w_color;
GtkSpinButton *w_high_threshold, *w_low_threshold;
GdkColor *color;
"sensor_draw"));
gtk_toggle_button_set_active(w_draw, p->graph_enabled);
+ w_display = GTK_TOGGLE_BUTTON(gtk_builder_get_object
+ (builder,
+ "sensor_enable_checkbox"));
+ gtk_toggle_button_set_active(w_display, p->display_enabled);
+
color = color_to_gdkcolor(p->color);
w_color = GTK_COLOR_BUTTON(gtk_builder_get_object(builder,
"sensor_color"));
p->appindicator_label_enabled);
config_set_sensor_position(s->id, pos);
+
+ config_set_sensor_enabled(s->id, p->display_enabled);
}
static void apply_prefs(GtkTreeModel *model, struct config *cfg)