Skip to content

Commit

Permalink
Make it possible to do "Add Dive" from just the main dive menu
Browse files Browse the repository at this point in the history
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 <torvalds@linux-foundation.org>
  • Loading branch information
torvalds committed Jun 28, 2012
1 parent a2c2c7e commit 162b36f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions display-gtk.h
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion divelist.c
Expand Up @@ -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;

Expand Down
2 changes: 2 additions & 0 deletions gtk-gui.c
Expand Up @@ -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) },
Expand All @@ -652,6 +653,7 @@ static const gchar* ui_string = " \
</menu> \
<menu name=\"LogMenu\" action=\"LogMenuAction\"> \
<menuitem name=\"Import\" action=\"Import\" /> \
<menuitem name=\"Add Dive\" action=\"AddDive\" /> \
<separator name=\"Separator\"/> \
<menuitem name=\"Renumber\" action=\"Renumber\" /> \
<menu name=\"View\" action=\"ViewMenuAction\"> \
Expand Down

0 comments on commit 162b36f

Please sign in to comment.