</para>
</section>
+<section>
+<title>From URL</title>
+<para>
+<menuchoice><guimenu>File</guimenu><guimenuitem>Acquire</guimenuitem><guimenuitem>From URL</guimenuitem></menuchoice>
+</para>
+<para>
+This gets a file from the entered URL.
+File formats that can be opened are those supported by GPSBabel.
+</para>
+<note>
+<para>
+You need to select the type of the file that is going to be returned, since there is no automatic detection of the file kind.
+</para>
+</note>
+</section>
+
</section> <!-- End Acquire -->
<section><title>Print</title>
datasource_gc.c \
datasource_bfilter.c \
datasource_wikipedia.c \
+ datasource_url.c \
datasources.h \
googlesearch.c googlesearch.h \
dem.c dem.h \
/**
* BabelFile:
- * @name: gpsbabel's identifier of the device
+ * @name: gpsbabel's identifier of the format
* @ext: file's extension for this format
* @label: human readable label
*
#ifdef VIK_CONFIG_GEONAMES
extern VikDataSourceInterface vik_datasource_wikipedia_interface;
#endif
+extern VikDataSourceInterface vik_datasource_url_interface;
G_END_DECLS
#ifdef VIK_CONFIG_GEOTAG
" <menuitem action='AcquireGeotag'/>"
#endif
+ " <menuitem action='AcquireURL'/>"
#ifdef VIK_CONFIG_GEONAMES
" <menuitem action='AcquireWikipedia'/>"
#endif
#endif
static void trw_layer_acquire_gps_cb ( gpointer lav[2] );
static void trw_layer_acquire_routing_cb ( gpointer lav[2] );
+static void trw_layer_acquire_url_cb ( gpointer lav[2] );
#ifdef VIK_CONFIG_OPENSTREETMAP
static void trw_layer_acquire_osm_cb ( gpointer lav[2] );
static void trw_layer_acquire_osm_my_traces_cb ( gpointer lav[2] );
a_acquire ( vw, vlp, vvp, &vik_datasource_routing_interface, NULL, NULL );
}
+/*
+ * Acquire into this TRW Layer from an entered URL
+ */
+static void trw_layer_acquire_url_cb ( gpointer lav[2] )
+{
+ VikTrwLayer *vtl = VIK_TRW_LAYER(lav[0]);
+ VikLayersPanel *vlp = VIK_LAYERS_PANEL(lav[1]);
+ VikWindow *vw = (VikWindow *)(VIK_GTK_WINDOW_FROM_LAYER(vtl));
+ VikViewport *vvp = vik_window_viewport(vw);
+
+ vik_datasource_url_interface.mode = VIK_DATASOURCE_ADDTOLAYER;
+ a_acquire ( vw, vlp, vvp, &vik_datasource_url_interface, NULL, NULL );
+}
+
#ifdef VIK_CONFIG_OPENSTREETMAP
/*
* Acquire into this TRW Layer from OSM
gtk_widget_show ( item );
#endif
+ item = gtk_menu_item_new_with_mnemonic ( _("From _URL...") );
+ g_signal_connect_swapped ( G_OBJECT(item), "activate", G_CALLBACK(trw_layer_acquire_url_cb), pass_along );
+ gtk_menu_shell_append (GTK_MENU_SHELL (acquire_submenu), item);
+ gtk_widget_show ( item );
+
#ifdef VIK_CONFIG_GEONAMES
GtkWidget *wikipedia_submenu = gtk_menu_new();
item = gtk_image_menu_item_new_with_mnemonic ( _("From _Wikipedia Waypoints") );
}
#endif
+static void acquire_from_url ( GtkAction *a, VikWindow *vw )
+{
+ vik_datasource_url_interface.mode = VIK_DATASOURCE_CREATENEWLAYER;
+ a_acquire(vw, vw->viking_vlp, vw->viking_vvp, &vik_datasource_url_interface, NULL, NULL );
+}
+
static void goto_default_location( GtkAction *a, VikWindow *vw)
{
struct LatLon ll;
#ifdef VIK_CONFIG_GEOTAG
{ "AcquireGeotag", NULL, N_("From Geotagged _Images..."), NULL, N_("Create waypoints from geotagged images"), (GCallback)acquire_from_geotag },
#endif
+ { "AcquireURL", NULL, N_("From _URL..."), NULL, N_("Get a file from a URL"), (GCallback)acquire_from_url },
#ifdef VIK_CONFIG_GEONAMES
{ "AcquireWikipedia", NULL, N_("From _Wikipedia Waypoints"), NULL, N_("Create waypoints from Wikipedia items in the current view"), (GCallback)acquire_from_wikipedia },
#endif