]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Select the first dive after filling the dive list
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 22 Sep 2011 15:19:34 +0000 (08:19 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 22 Sep 2011 15:19:34 +0000 (08:19 -0700)
We should always strive to have a dive selected, so pick the first one
(that was how the dive list logic worked anyway, it just wasn't truly
selected at the tree-view level, so it wasn't *visibly* the selected
dive).

Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
divelist.c

index f1af80cea240c64a41b73f7eea7e5ac906871cd3..8967d3612436a8eaefe08acf8f8a49d5feb38dc5 100644 (file)
@@ -403,6 +403,11 @@ static void fill_dive_list(void)
        }
 
        update_dive_list_units();
+       if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(dive_list.model), &iter)) {
+               GtkTreeSelection *selection;
+               selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(dive_list.tree_view));
+               gtk_tree_selection_select_iter(selection, &iter);
+       }
 }
 
 void dive_list_update_dives(void)