static void trw_layer_draw_track_cb ( const gpointer id, VikTrack *track, struct DrawingParams *dp );
static void trw_layer_draw_waypoint ( const gpointer id, VikWaypoint *wp, struct DrawingParams *dp );
-static void trw_layer_calculate_bounds_waypoints ( VikTrwLayer *vtl );
-
static void goto_coord ( gpointer *vlp, gpointer vvp, gpointer vl, const VikCoord *coord );
static void trw_layer_goto_track_startpoint ( gpointer pass_along[6] );
static void trw_layer_goto_track_endpoint ( gpointer pass_along[6] );
vtl->has_verified_thumbnails = FALSE;
trw_layer_geotag_dialog ( VIK_GTK_WINDOW_FROM_LAYER(vtl),
- vtl,
- track,
- track->name );
+ vtl,
+ NULL,
+ track );
+}
+
+static void trw_layer_geotagging_waypoint ( gpointer pass_along[6] )
+{
+ VikTrwLayer *vtl = VIK_TRW_LAYER(pass_along[0]);
+ VikWaypoint *wpt = g_hash_table_lookup ( VIK_TRW_LAYER(pass_along[0])->waypoints, pass_along[3] );
+
+ trw_layer_geotag_dialog ( VIK_GTK_WINDOW_FROM_LAYER(vtl),
+ vtl,
+ wpt,
+ NULL );
}
static void trw_layer_geotagging ( gpointer lav[2] )
vtl->has_verified_thumbnails = FALSE;
trw_layer_geotag_dialog ( VIK_GTK_WINDOW_FROM_LAYER(vtl),
- vtl,
- NULL,
- NULL);
+ vtl,
+ NULL,
+ NULL );
}
#endif
/**
* Rename waypoint and maintain corresponding name of waypoint in the treeview
*/
-static void trw_layer_waypoint_rename ( VikTrwLayer *vtl, VikWaypoint *wp, const gchar *new_name )
+void trw_layer_waypoint_rename ( VikTrwLayer *vtl, VikWaypoint *wp, const gchar *new_name )
{
vik_waypoint_set_name ( wp, new_name );
}
}
+/**
+ * Maintain icon of waypoint in the treeview
+ */
+void trw_layer_waypoint_reset_icon ( VikTrwLayer *vtl, VikWaypoint *wp )
+{
+ // update the treeview
+ wpu_udata udataU;
+ udataU.wp = wp;
+ udataU.uuid = NULL;
+
+ // Need key of it for treeview update
+ gpointer *wpf = g_hash_table_find ( vtl->waypoints, (GHRFunc) trw_layer_waypoint_find_uuid, &udataU );
+
+ if ( wpf && udataU.uuid ) {
+ GtkTreeIter *it = g_hash_table_lookup ( vtl->waypoints_iters, udataU.uuid );
+
+ if ( it ) {
+ vik_treeview_item_set_icon ( VIK_LAYER(vtl)->vt, it, get_wp_sym_small (wp->symbol) );
+ }
+ }
+}
+
static void trw_layer_properties_item ( gpointer pass_along[7] )
{
VikTrwLayer *vtl = VIK_TRW_LAYER(pass_along[0]);
if ( subtype == VIK_TRW_LAYER_SUBLAYER_WAYPOINT )
{
- gboolean separator_created = FALSE;
+ // Always create separator as now there is always at least the transform menu option
+ item = gtk_menu_item_new ();
+ gtk_menu_shell_append ( GTK_MENU_SHELL(menu), item );
+ gtk_widget_show ( item );
/* could be a right-click using the tool */
if ( vlp != NULL ) {
- item = gtk_menu_item_new ();
- gtk_menu_shell_append ( GTK_MENU_SHELL(menu), item );
- gtk_widget_show ( item );
-
- separator_created = TRUE;
-
item = gtk_image_menu_item_new_with_mnemonic ( _("_Goto") );
- gtk_image_menu_item_set_image ( (GtkImageMenuItem*)item, gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_MENU) );
+ gtk_image_menu_item_set_image ( (GtkImageMenuItem*)item, gtk_image_new_from_stock (GTK_STOCK_JUMP_TO, GTK_ICON_SIZE_MENU) );
g_signal_connect_swapped ( G_OBJECT(item), "activate", G_CALLBACK(trw_layer_goto_waypoint), pass_along );
gtk_menu_shell_append ( GTK_MENU_SHELL(menu), item );
gtk_widget_show ( item );
if ( wp && wp->name ) {
if ( is_valid_geocache_name ( wp->name ) ) {
-
- if ( !separator_created ) {
- item = gtk_menu_item_new ();
- gtk_menu_shell_append ( GTK_MENU_SHELL(menu), item );
- gtk_widget_show ( item );
- separator_created = TRUE;
- }
-
item = gtk_menu_item_new_with_mnemonic ( _("_Visit Geocache Webpage") );
g_signal_connect_swapped ( G_OBJECT(item), "activate", G_CALLBACK(trw_layer_waypoint_gc_webpage), pass_along );
gtk_menu_shell_append ( GTK_MENU_SHELL(menu), item );
gtk_widget_show ( item );
}
+#ifdef VIK_CONFIG_GEOTAG
+ item = gtk_menu_item_new_with_mnemonic ( _("Geotag _Images...") );
+ g_signal_connect_swapped ( G_OBJECT(item), "activate", G_CALLBACK(trw_layer_geotagging_waypoint), pass_along );
+ gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
+ gtk_widget_set_tooltip_text (item, _("Geotag multiple images against this waypoint"));
+ gtk_widget_show ( item );
+#endif
}
if ( wp && wp->image )
{
- if ( !separator_created ) {
- item = gtk_menu_item_new ();
- gtk_menu_shell_append ( GTK_MENU_SHELL(menu), item );
- gtk_widget_show ( item );
- separator_created = TRUE;
- }
-
// Set up image paramater
pass_along[5] = wp->image;
gtk_widget_show ( item );
}
}
-
}
}
* (Re)Calculate the bounds of the waypoints in this layer,
* This should be called whenever waypoints are changed
*/
-static void trw_layer_calculate_bounds_waypoints ( VikTrwLayer *vtl )
+void trw_layer_calculate_bounds_waypoints ( VikTrwLayer *vtl )
{
struct LatLon topleft = { 0.0, 0.0 };
struct LatLon bottomright = { 0.0, 0.0 };