From: Linus Torvalds Date: Thu, 28 Jun 2012 01:09:26 +0000 (-0700) Subject: Make it possible to do "Add Dive" from just the main dive menu X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=162b36f4a5007d9c267743bb2f09ac5adc8da408;p=ext%2Fsubsurface.git Make it possible to do "Add Dive" from just the main dive menu No need for right-clicks. It's inconvenient on lots of laptops etc, so allow just using the Dive menu as an alternative. Signed-off-by: Linus Torvalds --- diff --git a/display-gtk.h b/display-gtk.h index efbf3fd..4ce0546 100644 --- a/display-gtk.h +++ b/display-gtk.h @@ -54,6 +54,7 @@ extern const char *divelist_font; extern void set_divelist_font(const char *); extern void import_dialog(GtkWidget *, gpointer); +extern void add_dive_cb(GtkWidget *, gpointer); extern void report_error(GError* error); extern int process_ui_events(void); extern void update_progressbar(progressbar_t *progress, double value); diff --git a/divelist.c b/divelist.c index c67e42a..21f343f 100644 --- a/divelist.c +++ b/divelist.c @@ -687,7 +687,7 @@ static void row_activated_cb(GtkTreeView *tree_view, edit_dive_info(get_dive(index)); } -static void add_dive_cb(GtkWidget *menuitem, GtkTreeModel *model) +void add_dive_cb(GtkWidget *menuitem, gpointer data) { struct dive *dive; diff --git a/gtk-gui.c b/gtk-gui.c index 679b1e4..45aa212 100644 --- a/gtk-gui.c +++ b/gtk-gui.c @@ -626,6 +626,7 @@ static GtkActionEntry menu_items[] = { { "SaveFile", GTK_STOCK_SAVE, NULL, CTRLCHAR "S", NULL, G_CALLBACK(file_save) }, { "Print", GTK_STOCK_PRINT, NULL, CTRLCHAR "P", NULL, G_CALLBACK(do_print) }, { "Import", NULL, "Import", NULL, NULL, G_CALLBACK(import_dialog) }, + { "AddDive", NULL, "Add Dive", NULL, NULL, G_CALLBACK(add_dive_cb) }, { "Preferences", NULL, "Preferences", PREFERENCE_ACCEL, NULL, G_CALLBACK(preferences_dialog) }, { "Renumber", NULL, "Renumber", NULL, NULL, G_CALLBACK(renumber_dialog) }, { "SelectEvents", NULL, "SelectEvents", NULL, NULL, G_CALLBACK(selectevents_dialog) }, @@ -652,6 +653,7 @@ static const gchar* ui_string = " \ \ \ \ + \ \ \ \