#include "viking.h"
#include "acquire.h"
#include "babel.h"
+#include "ui_util.h"
// Initially was just going to be a URL and always in GPX format
// But might as well specify the file type as per datasource_file.c
static gpointer datasource_url_init ( acq_vik_t *avt );
static void datasource_url_add_setup_widgets ( GtkWidget *dialog, VikViewport *vvp, gpointer user_data );
-static void datasource_url_get_process_options ( datasource_url_widgets_t *widgets, ProcessOptions *po, DownloadMapOptions *download_options, const gchar *not_used2, const gchar *not_used3 );
+static void datasource_url_get_process_options ( datasource_url_widgets_t *widgets, ProcessOptions *po, DownloadFileOptions *download_options, const gchar *not_used2, const gchar *not_used3 );
static void datasource_url_cleanup ( gpointer data );
VikDataSourceInterface vik_datasource_url_interface = {
{
datasource_url_widgets_t *widgets = (datasource_url_widgets_t *)user_data;
GtkWidget *label = gtk_label_new (_("URL:"));
- widgets->url = gtk_entry_new ( );
+ widgets->url = ui_entry_new ( NULL, GTK_ENTRY_ICON_SECONDARY );
+ // 'ok' when press return in the entry
+ g_signal_connect_swapped ( widgets->url, "activate", G_CALLBACK(a_dialog_response_accept), dialog );
GtkWidget *type_label = gtk_label_new (_("File type:"));
gtk_widget_show_all(dialog);
}
-static void datasource_url_get_process_options ( datasource_url_widgets_t *widgets, ProcessOptions *po, DownloadMapOptions *download_options, const gchar *not_used2, const gchar *not_used3 )
+static void datasource_url_get_process_options ( datasource_url_widgets_t *widgets, ProcessOptions *po, DownloadFileOptions *download_options, const gchar *not_used2, const gchar *not_used3 )
{
// Retrieve the user entered value
const gchar *value = gtk_entry_get_text ( GTK_ENTRY(widgets->url) );
po->input_file_type = g_strdup ( ((BabelFile*)g_list_nth_data (a_babel_file_list, last_type))->name );
po->url = g_strdup ( value );
- download_options = NULL;
+
+ // Support .zip + bzip2 files directly
+ download_options->convert_file = a_try_decompress_file;
+ download_options->follow_location = 5;
}
static void datasource_url_cleanup ( gpointer data )