summaryrefslogtreecommitdiffstats
path: root/divelist.c
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-19 12:56:37 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2011-09-19 12:56:37 -0700
commitde721d98106569ccf74d4bcc35619e281df00e5e (patch)
tree66b8bf0fa71e416814aebe097e63378df712cf6d /divelist.c
parent69ff164afc3450ad44f7e923326c51fd1981a892 (diff)
downloadsubsurface-de721d98106569ccf74d4bcc35619e281df00e5e.tar.gz
Add temp/nitrox/sac entries to divelist
This doesn't really fill them, it just adds them to the possible entries. I'll get to it later. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'divelist.c')
-rw-r--r--divelist.c44
1 files changed, 42 insertions, 2 deletions
diff --git a/divelist.c b/divelist.c
index b724f9239..e4b381279 100644
--- a/divelist.c
+++ b/divelist.c
@@ -19,6 +19,13 @@ enum {
DIVE_DEPTH, /* int: dive->maxdepth in mm */
DIVE_DURATIONSTR, /* "47" in minutes */
DIVE_DURATION, /* int: in seconds */
+ DIVE_TEMPSTR, /* "78" in fahrenheit or whatever */
+ DIVE_TEMP, /* int: in mkelvin */
+ DIVE_NITROXSTR, /* "32.5" in percent */
+ DIVE_NITROX, /* int: in permille */
+ DIVE_SACSTR, /* "0.49" in cuft/min */
+ DIVE_SAC, /* int: in ml/min or something */
+ DIVELIST_COLUMNS
};
@@ -160,11 +167,14 @@ struct DiveList dive_list_create(void)
GtkCellRenderer *renderer;
GtkTreeViewColumn *col;
- dive_list.model = gtk_list_store_new(7,
+ dive_list.model = gtk_list_store_new(DIVELIST_COLUMNS,
G_TYPE_INT, /* index */
G_TYPE_STRING, G_TYPE_INT, /* Date */
G_TYPE_STRING, G_TYPE_INT, /* Depth */
- G_TYPE_STRING, G_TYPE_INT /* Duration */
+ G_TYPE_STRING, G_TYPE_INT, /* Duration */
+ G_TYPE_STRING, G_TYPE_INT, /* Temperature */
+ G_TYPE_STRING, G_TYPE_INT, /* Nitrox */
+ G_TYPE_STRING, G_TYPE_INT /* SAC */
);
dive_list.tree_view = gtk_tree_view_new_with_model(GTK_TREE_MODEL(dive_list.model));
selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dive_list.tree_view));
@@ -201,6 +211,36 @@ struct DiveList dive_list_create(void)
gtk_object_set(GTK_OBJECT(renderer), "alignment", PANGO_ALIGN_RIGHT, NULL);
gtk_cell_renderer_set_alignment(GTK_CELL_RENDERER(renderer), 1.0, 0.5);
+ renderer = gtk_cell_renderer_text_new();
+ dive_list.temperature = col = gtk_tree_view_column_new();
+ gtk_tree_view_column_set_title(col, "deg");
+ gtk_tree_view_column_set_sort_column_id(col, DIVE_TEMP);
+ gtk_tree_view_column_pack_start(col, renderer, FALSE);
+ gtk_tree_view_column_add_attribute(col, renderer, "text", DIVE_TEMPSTR);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(dive_list.tree_view), col);
+ gtk_object_set(GTK_OBJECT(renderer), "alignment", PANGO_ALIGN_RIGHT, NULL);
+ gtk_cell_renderer_set_alignment(GTK_CELL_RENDERER(renderer), 1.0, 0.5);
+
+ renderer = gtk_cell_renderer_text_new();
+ dive_list.nitrox = col = gtk_tree_view_column_new();
+ gtk_tree_view_column_set_title(col, "EAD");
+ gtk_tree_view_column_set_sort_column_id(col, DIVE_NITROX);
+ gtk_tree_view_column_pack_start(col, renderer, FALSE);
+ gtk_tree_view_column_add_attribute(col, renderer, "text", DIVE_NITROXSTR);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(dive_list.tree_view), col);
+ gtk_object_set(GTK_OBJECT(renderer), "alignment", PANGO_ALIGN_RIGHT, NULL);
+ gtk_cell_renderer_set_alignment(GTK_CELL_RENDERER(renderer), 1.0, 0.5);
+
+ renderer = gtk_cell_renderer_text_new();
+ dive_list.sac = col = gtk_tree_view_column_new();
+ gtk_tree_view_column_set_title(col, "SAC");
+ gtk_tree_view_column_set_sort_column_id(col, DIVE_SAC);
+ gtk_tree_view_column_pack_start(col, renderer, FALSE);
+ gtk_tree_view_column_add_attribute(col, renderer, "text", DIVE_SACSTR);
+ gtk_tree_view_append_column(GTK_TREE_VIEW(dive_list.tree_view), col);
+ gtk_object_set(GTK_OBJECT(renderer), "alignment", PANGO_ALIGN_RIGHT, NULL);
+ gtk_cell_renderer_set_alignment(GTK_CELL_RENDERER(renderer), 1.0, 0.5);
+
fill_dive_list(&dive_list);
g_object_set(G_OBJECT(dive_list.tree_view), "headers-visible", TRUE,