+static void populate(struct ui_psensor *ui)
+{
+ GtkTreeIter iter;
+ GtkListStore *store;
+ GdkColor color;
+ char *scolor;
+ struct psensor **ordered_sensors, **s_cur, *s;
+
+ ordered_sensors = ui_get_sensors_ordered_by_position(ui);
+ store = ui->sensors_store;
+
+ gtk_list_store_clear(store);
+
+ for (s_cur = ordered_sensors; *s_cur; s_cur++) {
+ s = *s_cur;
+
+ gtk_list_store_append(store, &iter);
+
+ color.red = s->color->red;
+ color.green = s->color->green;
+ color.blue = s->color->blue;
+
+ scolor = gdk_color_to_string(&color);
+
+ gtk_list_store_set(store, &iter,
+ COL_NAME, s->name,
+ COL_COLOR_STR, scolor,
+ COL_ENABLED, s->graph_enabled,
+ COL_SENSOR, s,
+ -1);
+ free(scolor);
+ }
+ free(ordered_sensors);
+}
+