]> git.tdb.fi Git - ext/subsurface.git/commitdiff
Make it possible to do "Add Dive" from just the main dive menu
authorLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Jun 2012 01:09:26 +0000 (18:09 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Thu, 28 Jun 2012 01:09:26 +0000 (18:09 -0700)
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>
display-gtk.h
divelist.c
gtk-gui.c

index efbf3fd87d09814d5845edd677fbfe8df9161e67..4ce05468c7ba7d673014f2202d43d33f4f62d1a5 100644 (file)
@@ -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);
index c67e42a4f23c9b8d06726f7e99dbbb4c62e698ac..21f343f7f0d2d0f6d98685eacd5a65be460c961e 100644 (file)
@@ -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;
 
index 679b1e4dbd41f969d38584797831491a694e4441..45aa212638716e4550aa3c399436af1cfb7464dd 100644 (file)
--- 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 = " \
                        </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\"> \