dltd->vdl = vdl;
dltd->vdl->files = data.sl;
- a_background_thread ( VIK_GTK_WINDOW_FROM_WIDGET(vp),
+ a_background_thread ( BACKGROUND_POOL_LOCAL,
+ VIK_GTK_WINDOW_FROM_WIDGET(vp),
_("DEM Loading"),
(vik_thr_func) dem_layer_load_list_thread,
dltd,
ABS(intlon) );
static DownloadMapOptions options = { FALSE, FALSE, NULL, 0, a_check_map_file, NULL, NULL };
- a_http_download_get_url ( SRTM_HTTP_SITE, src_fn, p->dest, &options, NULL );
+ DownloadResult_t result = a_http_download_get_url ( SRTM_HTTP_SITE, src_fn, p->dest, &options, NULL );
+ switch ( result ) {
+ case DOWNLOAD_CONTENT_ERROR:
+ case DOWNLOAD_HTTP_ERROR: {
+ gchar *msg = g_strdup_printf ( _("DEM download failure for %f, %f"), p->lat, p->lon );
+ vik_window_statusbar_update ( (VikWindow*)VIK_GTK_WINDOW_FROM_LAYER(p->vdl), msg, VIK_STATUSBAR_INFO );
+ g_free ( msg );
+ break;
+ }
+ case DOWNLOAD_FILE_WRITE_ERROR: {
+ gchar *msg = g_strdup_printf ( _("DEM write failure for %s"), p->dest );
+ vik_window_statusbar_update ( (VikWindow*)VIK_GTK_WINDOW_FROM_LAYER(p->vdl), msg, VIK_STATUSBAR_INFO );
+ g_free ( msg );
+ break;
+ }
+ case DOWNLOAD_SUCCESS:
+ case DOWNLOAD_NOT_REQUIRED:
+ default:
+ break;
+ }
g_free ( src_fn );
}
static void free_dem_download_params ( DEMDownloadParams *p )
{
- g_mutex_free ( p->mutex );
+ vik_mutex_free ( p->mutex );
g_free ( p->dest );
g_free ( p );
}
p->lat = ll.lat;
p->lon = ll.lon;
p->vdl = vdl;
- p->mutex = g_mutex_new();
+ p->mutex = vik_mutex_new();
p->source = vdl->source;
g_object_weak_ref(G_OBJECT(p->vdl), weak_ref_cb, p );
- a_background_thread ( VIK_GTK_WINDOW_FROM_LAYER(vdl), tmp,
+ a_background_thread ( BACKGROUND_POOL_REMOTE,
+ VIK_GTK_WINDOW_FROM_LAYER(vdl), tmp,
(vik_thr_func) dem_download_thread, p,
(vik_thr_free_func) free_dem_download_params, NULL, 1 );