+static void menu_copy_centre_cb ( GtkAction *a, VikWindow *vw )
+{
+ const VikCoord* coord;
+ struct UTM utm;
+ gchar *lat = NULL, *lon = NULL;
+
+ coord = vik_viewport_get_center ( vw->viking_vvp );
+ vik_coord_to_utm ( coord, &utm );
+
+ gboolean full_format = FALSE;
+ a_settings_get_boolean ( VIK_SETTINGS_WIN_COPY_CENTRE_FULL_FORMAT, &full_format );
+
+ if ( full_format )
+ // Bells & Whistles - may include degrees, minutes and second symbols
+ get_location_strings ( vw, utm, &lat, &lon );
+ else {
+ // Simple x.xx y.yy format
+ struct LatLon ll;
+ a_coords_utm_to_latlon ( &utm, &ll );
+ lat = g_strdup_printf ( "%.6f", ll.lat );
+ lon = g_strdup_printf ( "%.6f", ll.lon );
+ }
+
+ gchar *msg = g_strdup_printf ( "%s %s", lat, lon );
+ g_free (lat);
+ g_free (lon);
+
+ a_clipboard_copy ( VIK_CLIPBOARD_DATA_TEXT, 0, 0, 0, msg, NULL );
+
+ g_free ( msg );
+}
+