style
[psensor.git] / src / ui_sensorlist.c
index af830ae..3cfe8b0 100644 (file)
@@ -1,23 +1,21 @@
 /*
-    Copyright (C) 2010-2011 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 published by
-    the Free Software Foundation; either version 2 of the License, or
-    (at your option) any later version.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-    GNU General Public License for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with this program; if not, write to the Free Software
-    Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-    02110-1301 USA
-*/
-
-
+ * Copyright (C) 2010-2011 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
+ * published by the Free Software Foundation; either version 2 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful, but
+ * WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
 #include <stdlib.h>
 #include <string.h>
 
@@ -72,7 +70,8 @@ void ui_sensorlist_update(struct ui_psensor *ui)
 
                str = psensor_value_to_string(s->type,
                                              s->measures[s->values_max_length -
-                                                         1].value);
+                                                         1].value.d_num);
+
                gtk_list_store_set(GTK_LIST_STORE(model), &iter, COL_TEMP, str,
                                   -1);
                free(str);
@@ -129,10 +128,11 @@ static int get_col_index_at_pos(GtkTreeView *view, int x)
        for (node = columns; node; node = node->next) {
                GtkTreeViewColumn *checkcol = (GtkTreeViewColumn *) node->data;
 
-               if (x >= colx && x < (colx + checkcol->width))
+               if (x >= colx &&
+                   x < (colx + gtk_tree_view_column_get_width(checkcol)))
                        return coli;
                else
-                       colx += checkcol->width;
+                       colx += gtk_tree_view_column_get_width(checkcol);
 
                coli++;
        }
@@ -311,7 +311,7 @@ static void create_widget(struct ui_psensor *ui)
 
        gtk_tree_view_insert_column_with_attributes(ui_sl->treeview,
                                                    -1,
-                                                   _("Current"),
+                                                   _("Value"),
                                                    renderer,
                                                    "text", COL_TEMP, NULL);