{
GtkTreeIter iter;
GtkListStore *store;
- GdkRGBA color;
+ GdkRGBA *color;
char *scolor;
struct psensor **ordered_sensors, **s_cur, *s;
unsigned int enabled;
- ordered_sensors = ui_get_sensors_ordered_by_position(ui);
+ ordered_sensors = ui_get_sensors_ordered_by_position(ui->sensors);
store = ui->sensors_store;
gtk_list_store_clear(store);
gtk_list_store_append(store, &iter);
- color.red = s->color->red;
- color.green = s->color->green;
- color.blue = s->color->blue;
- color.alpha = 1.0;
+ color = config_get_sensor_color(s->id);
- scolor = gdk_rgba_to_string(&color);
+ scolor = gdk_rgba_to_string(color);
enabled = config_is_sensor_enabled(s->id);
-
gtk_list_store_set(store, &iter,
COL_NAME, s->name,
COL_COLOR_STR, scolor,
COL_DISPLAY_ENABLED, enabled,
-1);
free(scolor);
+ gdk_rgba_free(color);
}
free(ordered_sensors);
}
value = psensor_value_to_str(s->type,
psensor_get_current_value(s),
use_celsius);
- min = psensor_value_to_str(s->type, s->min, use_celsius);
- max = psensor_value_to_str(s->type, s->max, use_celsius);
+ min = psensor_value_to_str(s->type,
+ s->sess_lowest,
+ use_celsius);
+ max = psensor_value_to_str(s->type,
+ s->sess_highest,
+ use_celsius);
gtk_list_store_set(store, &iter,
COL_TEMP, value,
GtkTreeView *view;
struct psensor *s;
int coli;
+ GdkRGBA *color;
ui = (struct ui_psensor *)data;
view = ui->sensors_tree;
coli = col_index_to_col(get_col_index_at_pos(view, event->x));
if (coli == COL_COLOR) {
+ color = config_get_sensor_color(s->id);
if (ui_change_color(_("Select sensor color"),
- s->color,
+ color,
GTK_WINDOW(ui->main_window))) {
+ config_set_sensor_color(s->id, color);
ui_sensorlist_update(ui, 1);
- config_set_sensor_color(s->id, s->color);
config_sync();
}
+ gdk_rgba_free(color);
return TRUE;
} else if (coli >= 0 && coli != COL_GRAPH_ENABLED) {
menu = create_sensor_popup(ui, s);