summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-06-27 18:09:26 -0700
committerGravatar Linus Torvalds <torvalds@linux-foundation.org>2012-06-27 18:09:26 -0700
commit162b36f4a5007d9c267743bb2f09ac5adc8da408 (patch)
treec8b4811013b3ae105b9f7d34c7f15226a0b69644
parenta2c2c7e1a84a98bd05505f699c3c17baf50304ce (diff)
downloadsubsurface-162b36f4a5007d9c267743bb2f09ac5adc8da408.tar.gz
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 <torvalds@linux-foundation.org>
-rw-r--r--display-gtk.h1
-rw-r--r--divelist.c2
-rw-r--r--gtk-gui.c2
3 files changed, 4 insertions, 1 deletions
diff --git a/display-gtk.h b/display-gtk.h
index efbf3fd87..4ce05468c 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 c67e42a4f..21f343f7f 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 679b1e4db..45aa21263 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 = " \
</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\"> \