static gdouble last_page_number = 0;
-static gpointer datasource_osm_init( );
+static gpointer datasource_osm_init ( acq_vik_t *avt );
static void datasource_osm_add_setup_widgets ( GtkWidget *dialog, VikViewport *vvp, gpointer user_data );
-static void datasource_osm_get_cmd_string ( datasource_osm_widgets_t *widgets, gchar **cmd, gchar **input_file_type );
+static void datasource_osm_get_cmd_string ( datasource_osm_widgets_t *widgets, gchar **cmd, gchar **input_file_type, DownloadMapOptions *options );
static void datasource_osm_cleanup ( gpointer data );
VikDataSourceInterface vik_datasource_osm_interface = {
N_("OSM traces"),
N_("OSM traces"),
- VIK_DATASOURCE_URL,
- VIK_DATASOURCE_ADDTOLAYER,
+ VIK_DATASOURCE_AUTO_LAYER_MANAGEMENT,
VIK_DATASOURCE_INPUTTYPE_NONE,
TRUE,
TRUE,
+ TRUE,
(VikDataSourceInitFunc) datasource_osm_init,
(VikDataSourceCheckExistenceFunc) NULL,
(VikDataSourceAddSetupWidgetsFunc) datasource_osm_add_setup_widgets,
(VikDataSourceGetCmdStringFunc) datasource_osm_get_cmd_string,
+ (VikDataSourceProcessFunc) a_babel_convert_from_url,
(VikDataSourceProgressFunc) NULL,
(VikDataSourceAddProgressWidgetsFunc) NULL,
(VikDataSourceCleanupFunc) datasource_osm_cleanup,
(VikDataSourceOffFunc) NULL,
+
+ NULL,
+ 0,
+ NULL,
+ NULL,
+ 0
};
-static gpointer datasource_osm_init ( )
+static gpointer datasource_osm_init ( acq_vik_t *avt )
{
datasource_osm_widgets_t *widgets = g_malloc(sizeof(*widgets));
+ /* Keep reference to viewport */
+ widgets->vvp = avt->vvp;
return widgets;
}
page_number_label = gtk_label_new (_("Page number:"));
widgets->page_number = gtk_spin_button_new_with_range(0, 100, 1);
gtk_spin_button_set_value(GTK_SPIN_BUTTON(widgets->page_number), last_page_number);
- gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), page_number_label, FALSE, FALSE, 5 );
- gtk_box_pack_start ( GTK_BOX(GTK_DIALOG(dialog)->vbox), widgets->page_number, FALSE, FALSE, 5 );
+
+ /* Packing all widgets */
+ GtkBox *box = GTK_BOX(gtk_dialog_get_content_area(GTK_DIALOG(dialog)));
+ gtk_box_pack_start ( box, page_number_label, FALSE, FALSE, 5 );
+ gtk_box_pack_start ( box, widgets->page_number, FALSE, FALSE, 5 );
gtk_widget_show_all(dialog);
- /* Keep reference to viewport */
- widgets->vvp = vvp;
}
-static void datasource_osm_get_cmd_string ( datasource_osm_widgets_t *widgets, gchar **cmd, gchar **input_file_type )
+static void datasource_osm_get_cmd_string ( datasource_osm_widgets_t *widgets, gchar **cmd, gchar **input_file_type, DownloadMapOptions *options )
{
int page = 0;
gdouble min_lat, max_lat, min_lon, max_lon;
page = last_page_number;
*cmd = g_strdup_printf( DOWNLOAD_URL_FMT, sminlon, sminlat, smaxlon, smaxlat, page );
- *input_file_type = g_strdup("gpx");
+ *input_file_type = NULL;
+ options = NULL;
}
static void datasource_osm_cleanup ( gpointer data )