diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-19 10:11:56 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2011-11-19 10:11:56 -0500 |
commit | 1efcf4538b8a034e8b288d5b9c375ba99b1d845f (patch) | |
tree | 71f9227a97e3311fd2cc1e32033f33b7d1a04fed /divelist.c | |
parent | 842b05415fac862e73cdbf3446dc801dbd2c156a (diff) | |
download | subsurface-1efcf4538b8a034e8b288d5b9c375ba99b1d845f.tar.gz |
Make double-clicking on the dive list bring up the dive editor
Now that the dive info window is read-only, we need to edit the dives
some other way. We bring up a dive info edit dialog when you
double-click on the dive list entry for that dive.
I do want to have an "edit" button or keyboard shortcut or something
too, though.
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'divelist.c')
-rw-r--r-- | divelist.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/divelist.c b/divelist.c index 60ad16a7f..48a9ea99a 100644 --- a/divelist.c +++ b/divelist.c @@ -506,6 +506,20 @@ static void realize_cb(GtkWidget *tree_view, gpointer userdata) gtk_widget_grab_focus(tree_view); } +static void row_activated_cb(GtkTreeView *tree_view, + GtkTreePath *path, + GtkTreeViewColumn *column, + GtkTreeModel *model) +{ + int index; + GtkTreeIter iter; + + if (!gtk_tree_model_get_iter(model, &iter, path)) + return; + gtk_tree_model_get(model, &iter, DIVE_INDEX, &index, -1); + edit_dive_info(get_dive(index)); +} + GtkWidget *dive_list_create(void) { GtkTreeSelection *selection; @@ -551,6 +565,7 @@ GtkWidget *dive_list_create(void) NULL); g_signal_connect_after(dive_list.tree_view, "realize", G_CALLBACK(realize_cb), NULL); + g_signal_connect(dive_list.tree_view, "row-activated", G_CALLBACK(row_activated_cb), dive_list.model); g_signal_connect(selection, "changed", G_CALLBACK(selection_cb), dive_list.model); dive_list.container_widget = gtk_scrolled_window_new(NULL, NULL); |