diff options
author | Lubomir I. Ivanov <neolit123@gmail.com> | 2013-01-18 03:05:48 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2013-01-17 22:29:24 -0800 |
commit | a5ee2b66e1cc9b1b7b0b7437517a30bee5b0054f (patch) | |
tree | 662228fd671ab5ffb4c83fe59af426088c5bdd09 /gtk-gui.c | |
parent | d0d4bbece7e0a304a3e1f1fcea3608f3d741e8fa (diff) | |
download | subsurface-a5ee2b66e1cc9b1b7b0b7437517a30bee5b0054f.tar.gz |
Added client side communication to the Subsurface Web Service
A couple of new files webservice.c and webservice.h are added.
webservice.h exposes two methods at the moment:
- webservice_download_dialog():
this function creates the user interface for the download dialog
from the web service.
- webservice_request_user_xml()
this function is a direct call to retrieve XML for a specific
user identifier. the actual data, data length and error codes
are stored in passed pointers.
A menu entry is added in the Log menu:
"Download From Web Service"
The used backend for communication at the moment is provided
by libsoup.
Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r-- | gtk-gui.c | 3 |
1 files changed, 3 insertions, 0 deletions
@@ -21,6 +21,7 @@ #include "callbacks-gtk.h" #include "uemis.h" #include "device.h" +#include "webservice.h" #include "libdivecomputer.h" @@ -1058,6 +1059,7 @@ static GtkActionEntry menu_items[] = { { "Print", GTK_STOCK_PRINT, N_("Print..."), CTRLCHAR "P", NULL, G_CALLBACK(do_print) }, { "ImportFile", GTK_STOCK_GO_BACK, N_("Import XML File(s)..."), CTRLCHAR "I", NULL, G_CALLBACK(import_files) }, { "DownloadLog", GTK_STOCK_GO_DOWN, N_("Download From Dive Computer..."), CTRLCHAR "D", NULL, G_CALLBACK(download_dialog) }, + { "DownloadWeb", GTK_STOCK_CONNECT, N_("Download From Web Service..."), NULL, NULL, G_CALLBACK(webservice_download_dialog) }, { "AddDive", GTK_STOCK_ADD, N_("Add Dive..."), NULL, NULL, G_CALLBACK(add_dive_cb) }, { "Preferences", GTK_STOCK_PREFERENCES, N_("Preferences..."), PREFERENCE_ACCEL, NULL, G_CALLBACK(preferences_dialog) }, { "Renumber", NULL, N_("Renumber..."), NULL, NULL, G_CALLBACK(renumber_dialog) }, @@ -1104,6 +1106,7 @@ static const gchar* ui_string = " \ </menu> \ <menu name=\"LogMenu\" action=\"LogMenuAction\"> \ <menuitem name=\"Download From Dive Computer\" action=\"DownloadLog\" /> \ + <menuitem name=\"Download From Web Service\" action=\"DownloadWeb\" /> \ <separator name=\"Separator1\"/> \ <menuitem name=\"Add Dive\" action=\"AddDive\" /> \ <separator name=\"Separator2\"/> \ |