/*
- * Copyright (C) 2010-2013 jeanfi@gmail.com
+ * Copyright (C) 2010-2014 jeanfi@gmail.com
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License as
p->sensor = s;
p->name = strdup(s->name);
- p->enabled = s->enabled;
+ p->enabled = s->graph_enabled;
p->alarm_enabled = s->alarm_enabled;
p->color = color_dup(s->color);
static void
select_sensor(struct psensor *s, struct psensor **sensors, GtkTreeView *tree)
{
- struct psensor **s_cur = sensors;
- int i = 0;
- GtkTreePath *p = NULL;
+ struct psensor **s_cur;
+ int i;
+ GtkTreePath *p;
- while (*s_cur) {
+ p = NULL;
+ for (s_cur = sensors, i = 0; *s_cur; s_cur++, i++)
if (s == *s_cur) {
p = gtk_tree_path_new_from_indices(i, -1);
break;
}
- i++;
- s_cur++;
- }
-
if (p) {
GtkTreeSelection *s = gtk_tree_view_get_selection(tree);
config_set_sensor_name(s->id, s->name);
}
- if (s->enabled != p->enabled) {
- s->enabled = p->enabled;
- config_set_sensor_enabled(s->id, s->enabled);
+ if (s->graph_enabled != p->enabled) {
+ s->graph_enabled = p->enabled;
+ config_set_sensor_enabled(s->id, s->graph_enabled);
}
if (is_temp_type(s->type) && cfg->temperature_unit == FAHRENHEIT) {