Diff of /trunk/src/goto.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 51 by harbaum, Wed Aug 12 12:16:05 2009 UTC revision 53 by harbaum, Wed Aug 12 19:18:53 2009 UTC
# Line 436  static gboolean goto_update(gpointer dat Line 436  static gboolean goto_update(gpointer dat
436      gtk_label_set_text(GTK_LABEL(context->gotoc.bearing_label), "-----");      gtk_label_set_text(GTK_LABEL(context->gotoc.bearing_label), "-----");
437    }    }
438    
439    float epe = gps_get_epe(context->appdata);    float eph = gps_get_eph(context->appdata);
440    if(isnan(epe))    if(isnan(eph))
441      gtk_label_set_text(GTK_LABEL(context->gotoc.epe_label), "-----");      gtk_label_set_text(GTK_LABEL(context->gotoc.eph_label), "-----");
442    else {    else {
443      char str[16];      char str[16];
444      distance_str(str, sizeof(str), epe, context->appdata->imperial);      /* distance needs to be given in km */
445      gtk_label_set_text(GTK_LABEL(context->gotoc.epe_label), str);      if(context->appdata->imperial)
446          eph /= (6371.0/3959.0);  // km to miles
447    
448        distance_str(str, sizeof(str), eph/1000.0, context->appdata->imperial);
449        gtk_label_set_text(GTK_LABEL(context->gotoc.eph_label), str);
450    }    }
451    
452    return TRUE;   // fire again    return TRUE;   // fire again
# Line 682  GtkWidget *goto_cache(cache_context_t *c Line 686  GtkWidget *goto_cache(cache_context_t *c
686    gtk_table_attach_defaults(GTK_TABLE(table),    gtk_table_attach_defaults(GTK_TABLE(table),
687              gtk_label_new(_("Est. error:")), 0,1,6,7);              gtk_label_new(_("Est. error:")), 0,1,6,7);
688    gtk_table_attach_defaults(GTK_TABLE(table),    gtk_table_attach_defaults(GTK_TABLE(table),
689              (context->gotoc.epe_label = gtk_label_new("-----")), 1,2,6,7);              (context->gotoc.eph_label = gtk_label_new("-----")), 1,2,6,7);
690    
691    gtk_table_set_row_spacing(GTK_TABLE(table), 6, 16);    gtk_table_set_row_spacing(GTK_TABLE(table), 6, 16);
692    

Legend:
Removed from v.51  
changed lines
  Added in v.53