/*
- * Copyright (C) 2010-2012 jeanfi@gmail.com
+ * Copyright (C) 2010-2013 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
#include "ui_appindicator.h"
#endif
+enum {
+ COL_NAME = 0
+};
+
struct sensor_pref {
struct psensor *sensor;
char *name;
GError *error = NULL;
GtkTreeView *w_sensors_list;
guint ok;
- GtkCellRenderer *renderer;
GtkListStore *store;
struct psensor **s_cur;
GtkTreeSelection *selection;
= GTK_TREE_VIEW(gtk_builder_get_object(builder,
"sensors_list"));
- renderer = gtk_cell_renderer_text_new();
- gtk_tree_view_insert_column_with_attributes(w_sensors_list,
- -1,
- _("Sensor Name"),
- renderer,
- "text", 0, NULL);
-
- store = GTK_LIST_STORE(gtk_tree_view_get_model(w_sensors_list));
+ store = GTK_LIST_STORE(gtk_builder_get_object(builder,
+ "sensors_liststore"));
s_cur = ui->sensors;
while (*s_cur) {
struct psensor *s = *s_cur;
gtk_list_store_append(store, &iter);
- gtk_list_store_set(store, &iter, 0, s->name, -1);
+ gtk_list_store_set(store, &iter, COL_NAME, s->name, -1);
s_cur++;
}
if (result == GTK_RESPONSE_ACCEPT) {
apply_prefs(cbdata.prefs, ui->sensors, ui->config);
- ui_sensorlist_update_sensors_preferences(ui);
+ ui_sensorlist_update(ui, 1);
#if defined(HAVE_APPINDICATOR) || defined(HAVE_APPINDICATOR_029)
ui_appindicator_update_menu(ui);
#endif