summaryrefslogtreecommitdiffstats
path: root/divelist-gtk.c
diff options
context:
space:
mode:
authorGravatar Henrik Brautaset Aronsen <subsurface@henrik.synth.no>2013-04-09 22:18:43 +0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-04-09 13:27:36 -0700
commit5f03a6f63134ea82ea2713563868d3b6b0d0db23 (patch)
treec3fde03b7d48a905a5dd359349322661b45ebfc4 /divelist-gtk.c
parent9e4f9fad19bd4696bf08da67b60ed9d2eb29b446 (diff)
downloadsubsurface-5f03a6f63134ea82ea2713563868d3b6b0d0db23.tar.gz
Add menu entry for divelogs.de upload
The menu entry for upload to divelogs.de was missing. Also renamed the divelogs context menu entry to something less generic. Signed-off-by: Henrik Brautaset Aronsen <subsurface@henrik.synth.no> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'divelist-gtk.c')
-rw-r--r--divelist-gtk.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/divelist-gtk.c b/divelist-gtk.c
index e5702db97..f5ed73eb6 100644
--- a/divelist-gtk.c
+++ b/divelist-gtk.c
@@ -1382,7 +1382,7 @@ static void delete_dive_cb(GtkWidget *menuitem, GtkTreePath *path)
}
#if defined(LIBZIP) && defined(XSLT)
-static void export_selected_dives_cb(GtkWidget *menuitem, GtkTreePath *path)
+static void upload_dives_divelogs(const gboolean selected)
{
int i;
struct dive *dive;
@@ -1419,7 +1419,7 @@ static void export_selected_dives_cb(GtkWidget *menuitem, GtkTreePath *path)
dive = get_dive(i);
if (!dive)
continue;
- if (!dive->selected)
+ if (selected && !dive->selected)
continue;
f = tmpfile();
@@ -1472,6 +1472,16 @@ static void export_selected_dives_cb(GtkWidget *menuitem, GtkTreePath *path)
fprintf(stderr,"upload of %s failed\n", tempfile);
g_free(tempfile);
}
+
+void upload_selected_dives_divelogs_cb(GtkWidget *menuitem, GtkTreePath *path)
+{
+ upload_dives_divelogs(TRUE);
+}
+
+void upload_all_dives_divelogs_cb()
+{
+ upload_dives_divelogs(FALSE);
+}
#endif
#if defined(XSLT)
@@ -1616,7 +1626,7 @@ static void popup_divelist_menu(GtkTreeView *tree_view, GtkTreeModel *model, int
char exportuddflabel[] = N_("Export dive(s) to UDDF");
#endif
#if defined(LIBZIP) && defined(XSLT)
- char exportlabel[] = N_("Export dive(s)");
+ char uploaddivelogslabel[] = N_("Upload dive(s) to divelogs.de");
#endif
GtkTreePath *path, *prevpath, *nextpath;
GtkTreeIter iter, previter, nextiter;
@@ -1697,8 +1707,8 @@ static void popup_divelist_menu(GtkTreeView *tree_view, GtkTreeModel *model, int
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
#if defined(LIBZIP) && defined(XSLT)
- menuitem = gtk_menu_item_new_with_label(exportlabel);
- g_signal_connect(menuitem, "activate", G_CALLBACK(export_selected_dives_cb), path);
+ menuitem = gtk_menu_item_new_with_label(uploaddivelogslabel);
+ g_signal_connect(menuitem, "activate", G_CALLBACK(upload_selected_dives_divelogs_cb), path);
gtk_menu_shell_append(GTK_MENU_SHELL(menu), menuitem);
#endif