- *cmd = g_strdup_printf( "gcget -u %s -p %s %s %d %.2lf", safe_user, safe_pass, safe_string,
- gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON(widgets->num_spin) ),
- gtk_spin_button_get_value_as_float ( GTK_SPIN_BUTTON(widgets->miles_radius_spin) ) );
+ gdouble lat, lon;
+ if ( 2 != sscanf ( gtk_entry_get_text ( GTK_ENTRY(widgets->center_entry) ), "%lf,%lf", &lat, &lon ) ) {
+ g_warning (_("Broken input - using some defaults"));
+ lat = a_vik_get_default_lat();
+ lon = a_vik_get_default_long();
+ }
+
+ // Unix specific shell commands
+ // 1. Remove geocache webpages (maybe be from different location)
+ // 2, Gets upto n geocaches as webpages for the specified user in radius r Miles
+ // 3. Converts webpages into a single waypoint file, ignoring zero location waypoints '-z'
+ // Probably as they are premium member only geocaches and user is only a basic member
+ // Final output is piped into GPSbabel - hence removal of *html is done at beginning of the command sequence
+ *cmd = g_strdup_printf( "rm -f ~/.geo/caches/*html ; %s -P -n%d -r%.1fM -u %s -p %s %.4f %.4f ; %s -z ~/.geo/caches/*html ",
+ GC_PROGRAM1,
+ gtk_spin_button_get_value_as_int ( GTK_SPIN_BUTTON(widgets->num_spin) ),
+ gtk_spin_button_get_value_as_float ( GTK_SPIN_BUTTON(widgets->miles_radius_spin) ),
+ safe_user,
+ safe_pass,
+ lat, lon,
+ GC_PROGRAM2 );