----------------------------------------
> Date: Sun, 13 Feb 2011 11:27:50 -0800
> From: miker...@lacklustre.net
> To: viking-devel@lists.sourceforge.net
> Subject: Re: [Viking-devel] Request for comment for Bing maps support
>
> Quickie: the copyright notice is displayed twice if you enable
> auto-downloading of maps after you add the layer.
>
> To reproduce:
>
> 1) add a new bing map layer
> 2) copyright notice appears, click OK
> 3) right click map, go to properties
> 4) check "autodownload maps", click OK
> 5) copyright notice reappears
>
I think you might mean the 'map license dialog' is shown more than once.
This is not just in the Bing maps effort - in fact it is shown any time one
changes the map layer properties, and thus is unfortunately in the 1.1 release
:(
The attached quick hack should solve the issue by maintaining an internal flag
per map layer about whether the license has been shown.
May need to consider if this is best way to resolve this problem...
diff --git a/src/vikmapslayer.c b/src/vikmapslayer.c
index b72bad6..b415c89 100644
--- a/src/vikmapslayer.c
+++ b/src/vikmapslayer.c
@@ -211,6 +211,9 @@ struct _VikMapsLayer {
GtkMenu *dl_right_click_menu;
VikCoord redownload_ul, redownload_br; /* right click menu only */
VikViewport *redownload_vvp;
+
+ gboolean license_notice_shown; // FALSE for new maps only, otherwise
+ // TRUE for saved maps & other layer changes as we don't need to show it again
};
enum { REDOWNLOAD_NONE = 0, /* download only missing maps */
@@ -455,6 +458,10 @@ static guint map_uniq_id_to_index ( guint uniq_id )
static gboolean maps_layer_set_param ( VikMapsLayer *vml, guint16 id, VikLayerParamData data, VikViewport *vvp, gboolean is_file_operation )
{
+ // When loading from a file don't need the license reminder
+ if ( is_file_operation )
+ vml->license_notice_shown = TRUE;
+
switch ( id )
{
case PARAM_CACHE_DIR: maps_layer_set_cache_dir ( vml, data.s ); break;
@@ -510,6 +517,7 @@ static VikMapsLayer *maps_layer_new ( VikViewport *vvp )
vml->last_ympp = 0.0;
vml->dl_right_click_menu = NULL;
+ vml->license_notice_shown = FALSE;
return vml;
}
@@ -545,8 +553,11 @@ static void maps_layer_post_read (VikLayer *vl, VikViewport *vp, gboolean from_f
}
if (vik_map_source_get_license (map) != NULL) {
- a_dialog_license (VIK_GTK_WINDOW_FROM_WIDGET(vp), vik_map_source_get_label (map),
- vik_map_source_get_license (map), vik_map_source_get_license_url (map) );
+ if ( ! vml->license_notice_shown ) {
+ a_dialog_license (VIK_GTK_WINDOW_FROM_WIDGET(vp), vik_map_source_get_label (map),
+ vik_map_source_get_license (map), vik_map_source_get_license_url (map) );
+ vml->license_notice_shown = TRUE;
+ }
}
}
}
------------------------------------------------------------------------------
The ultimate all-in-one performance toolkit: Intel(R) Parallel Studio XE:
Pinpoint memory and threading errors before they happen.
Find and fix more than 250 security defects in the development cycle.
Locate bottlenecks in serial and parallel code that limit performance.
http://p.sf.net/sfu/intel-dev2devfeb
_______________________________________________
Viking-devel mailing list
Viking-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/viking-devel
Viking home page: http://viking.sf.net/