g_object_weak_ref(G_OBJECT(mdi->vml), weak_ref_cb, mdi);
/* launch the thread */
- a_background_thread ( VIK_GTK_WINDOW_FROM_LAYER(vml), /* parent window */
+ a_background_thread ( BACKGROUND_POOL_REMOTE,
+ VIK_GTK_WINDOW_FROM_LAYER(vml), /* parent window */
tmp, /* description string */
(vik_thr_func) map_download_thread, /* function to call within thread */
mdi, /* pass along data */
tmp = g_strdup_printf ( fmt, mdi->mapstoget, MAPS_LAYER_NTH_LABEL(vml->maptype) );
g_object_weak_ref(G_OBJECT(mdi->vml), weak_ref_cb, mdi);
- /* launch the thread */
- a_background_thread ( VIK_GTK_WINDOW_FROM_LAYER(vml), /* parent window */
- tmp, /* description string */
- (vik_thr_func) map_download_thread, /* function to call within thread */
- mdi, /* pass along data */
- (vik_thr_free_func) mdi_free, /* function to free pass along data */
- (vik_thr_free_func) mdi_cancel_cleanup,
- mdi->mapstoget );
+
+ // launch the thread
+ a_background_thread ( BACKGROUND_POOL_REMOTE,
+ VIK_GTK_WINDOW_FROM_LAYER(vml), /* parent window */
+ tmp, /* description string */
+ (vik_thr_func) map_download_thread, /* function to call within thread */
+ mdi, /* pass along data */
+ (vik_thr_free_func) mdi_free, /* function to free pass along data */
+ (vik_thr_free_func) mdi_cancel_cleanup,
+ mdi->mapstoget );
g_free ( tmp );
}
else
}
}
+/**
+ *
+ */
+static void maps_layer_flush ( menu_array_values values )
+{
+ VikMapsLayer *vml = VIK_MAPS_LAYER(values[MA_VML]);
+ a_mapcache_flush_type ( vik_map_source_get_uniq_id(MAPS_LAYER_NTH_TYPE(vml->maptype)) );
+}
+
static void maps_layer_add_menu_items ( VikMapsLayer *vml, GtkMenu *menu, VikLayersPanel *vlp )
{
GtkWidget *item;
g_signal_connect_swapped ( G_OBJECT(item), "activate", G_CALLBACK(maps_layer_about), values );
gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
gtk_widget_show ( item );
+
+ // Typical users shouldn't need to use this functionality - so debug only ATM
+ if ( vik_debug ) {
+ item = gtk_image_menu_item_new_with_mnemonic ( _("Flush Map Cache") );
+ gtk_image_menu_item_set_image ( (GtkImageMenuItem*)item, gtk_image_new_from_stock (GTK_STOCK_REMOVE, GTK_ICON_SIZE_MENU) );
+ g_signal_connect_swapped ( G_OBJECT(item), "activate", G_CALLBACK(maps_layer_flush), values );
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ gtk_widget_show ( item );
+ }
}
/**