Diff of /trunk/src/goto.c

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

revision 47 by harbaum, Thu Aug 6 20:23:12 2009 UTC revision 189 by harbaum, Tue Nov 17 09:07:17 2009 UTC
# Line 88  static void compass_draw(GtkWidget *widg Line 88  static void compass_draw(GtkWidget *widg
88    /* draw the locked/unlocked icon */    /* draw the locked/unlocked icon */
89    gdk_draw_pixbuf(context->gotoc.compass_pixmap,    gdk_draw_pixbuf(context->gotoc.compass_pixmap,
90                    widget->style->fg_gc[GTK_STATE_NORMAL],                    widget->style->fg_gc[GTK_STATE_NORMAL],
91                    icon_get(ICON_MISC, context->appdata->compass_locked?2:3),                    icon_get(ICON_MISC, context->appdata->compass_locked?1:2),
92                    0, 0, (width-diameter)/2 + diameter/32,                    0, 0, (width-diameter)/2 + diameter/32,
93                    (height+diameter)/2 - 16 - diameter/32 , 16, 16,                    (height+diameter)/2 - 16 - diameter/32 , 16, 16,
94                    GDK_RGB_DITHER_NONE,0,0);                    GDK_RGB_DITHER_NONE,0,0);
# 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      if(context->appdata->imperial) {      /* distance needs to be given in km */
445        epe *= 3.2808;      if(context->appdata->imperial)
446        snprintf(str, sizeof(str), "%.1f ft", epe);        eph /= (6371.0/3959.0);  // km to miles
     } else  
       snprintf(str, sizeof(str), "%.1f m", epe);  
447    
448      gtk_label_set_text(GTK_LABEL(context->gotoc.epe_label), str);      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 553  static gint radio_changed_event(GtkWidge Line 552  static gint radio_changed_event(GtkWidge
552    return FALSE;    return FALSE;
553  }  }
554    
555  #ifdef USE_MAEMO  #ifdef ENABLE_MAEMO_MAPPER
556  static void on_mm_button_clicked(GtkButton *button, gpointer data) {  static void on_mm_button_clicked(GtkButton *button, gpointer data) {
557    cache_context_t *context = (cache_context_t*)data;    cache_context_t *context = (cache_context_t*)data;
558    
# Line 687  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    
# Line 707  GtkWidget *goto_cache(cache_context_t *c Line 706  GtkWidget *goto_cache(cache_context_t *c
706    
707    gtk_box_pack_start(GTK_BOX(ihbox), context->gotoc.sat_area, 1,0,0);    gtk_box_pack_start(GTK_BOX(ihbox), context->gotoc.sat_area, 1,0,0);
708    
709  #ifdef USE_MAEMO  #ifdef ENABLE_MAEMO_MAPPER
710    GtkWidget *mm_button = gtk_button_new();    GtkWidget *mm_button = gtk_button_new();
711    gtk_button_set_image(GTK_BUTTON(mm_button), icon_get_widget(ICON_MISC, 0));    gtk_button_set_image(GTK_BUTTON(mm_button), icon_get_widget(ICON_MISC, 0));
712    gtk_signal_connect(GTK_OBJECT(mm_button), "clicked",    gtk_signal_connect(GTK_OBJECT(mm_button), "clicked",

Legend:
Removed from v.47  
changed lines
  Added in v.189