projects
/
psensor.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
defined the tree in the glade file
[psensor.git]
/
src
/
ui_sensorpref.c
diff --git
a/src/ui_sensorpref.c
b/src/ui_sensorpref.c
index
2135769
..
9032633
100644
(file)
--- a/
src/ui_sensorpref.c
+++ b/
src/ui_sensorpref.c
@@
-1,5
+1,5
@@
/*
/*
- * Copyright (C) 2010-201
2
jeanfi@gmail.com
+ * Copyright (C) 2010-201
3
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
*
* 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
#include "ui_appindicator.h"
#endif
+enum {
+ COL_NAME = 0
+};
+
struct sensor_pref {
struct psensor *sensor;
char *name;
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;
GError *error = NULL;
GtkTreeView *w_sensors_list;
guint ok;
- GtkCellRenderer *renderer;
GtkListStore *store;
struct psensor **s_cur;
GtkTreeSelection *selection;
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"));
= 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) {
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);
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++;
}
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);
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
#if defined(HAVE_APPINDICATOR) || defined(HAVE_APPINDICATOR_029)
ui_appindicator_update_menu(ui);
#endif