X-Git-Url: http://git.wpitchoune.net/gitweb/?a=blobdiff_plain;f=src%2Fui_sensorpref.c;h=90326330166716277345de7390785b0c2ab26562;hb=ad6ea372fc3673d6b9dcc08f9edac8558e6eb5c9;hp=2135769c15a93008e60d8b6df5971d5216ea5ff8;hpb=b01d095d6b123bcc7ed221cccf2c04295834cc84;p=psensor.git diff --git a/src/ui_sensorpref.c b/src/ui_sensorpref.c index 2135769..9032633 100644 --- a/src/ui_sensorpref.c +++ b/src/ui_sensorpref.c @@ -1,5 +1,5 @@ /* - * 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 @@ -30,6 +30,10 @@ #include "ui_appindicator.h" #endif +enum { + COL_NAME = 0 +}; + struct sensor_pref { struct psensor *sensor; char *name; @@ -486,7 +490,6 @@ void ui_sensorpref_dialog_run(struct psensor *sensor, struct ui_psensor *ui) GError *error = NULL; GtkTreeView *w_sensors_list; guint ok; - GtkCellRenderer *renderer; GtkListStore *store; struct psensor **s_cur; GtkTreeSelection *selection; @@ -517,14 +520,8 @@ void ui_sensorpref_dialog_run(struct psensor *sensor, struct ui_psensor *ui) = 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) { @@ -532,7 +529,7 @@ void ui_sensorpref_dialog_run(struct psensor *sensor, struct ui_psensor *ui) 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++; } @@ -546,7 +543,7 @@ void ui_sensorpref_dialog_run(struct psensor *sensor, struct ui_psensor *ui) 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