Diff of /trunk/src/cache.c

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

revision 11 by harbaum, Fri Jun 26 12:24:24 2009 UTC revision 34 by harbaum, Wed Jul 29 19:24:15 2009 UTC
# Line 53  void bearing_fill_hbox(GtkWidget *hbox, Line 53  void bearing_fill_hbox(GtkWidget *hbox,
53      gtk_box_pack_start(GTK_BOX(hbox), gtk_image_new_from_pixbuf(      gtk_box_pack_start(GTK_BOX(hbox), gtk_image_new_from_pixbuf(
54                                          icon_bearing(refpos, pos)),1,0,0);                                          icon_bearing(refpos, pos)),1,0,0);
55    
56      if(refpos.lat && refpos.lon) {      if(!isnan(refpos.lat) && !isnan(refpos.lon)) {
57        gtk_box_pack_start_defaults(GTK_BOX(hbox),        gtk_box_pack_start_defaults(GTK_BOX(hbox),
58                     GTK_LABEL_SMALL((char*)pos_get_bearing_str(refpos, pos)));                     GTK_LABEL_SMALL((char*)pos_get_bearing_str(refpos, pos)));
59        snprintf(str, sizeof(str), _("%.1f°"),        snprintf(str, sizeof(str), _("%.1f°"),
# Line 92  void overview_coordinate_update(cache_co Line 92  void overview_coordinate_update(cache_co
92                          (GtkCallback)gtk_widget_destroy, NULL);                          (GtkCallback)gtk_widget_destroy, NULL);
93    
94    /* update distance/etc */    /* update distance/etc */
95    bearing_fill_hbox(context->bearing_hbox, context->appdata,    if(!isnan(context->cache->pos.lat) &&
96                      *get_pos(context->appdata), notes_get_pos(context));       !isnan(context->cache->pos.lon))
97        bearing_fill_hbox(context->bearing_hbox, context->appdata,
98                          *get_pos(context->appdata), notes_get_pos(context));
99    
100    gtk_widget_show_all(context->bearing_hbox);    gtk_widget_show_all(context->bearing_hbox);
101  }  }
102    
# Line 212  static GtkWidget *cache_overview(cache_c Line 215  static GtkWidget *cache_overview(cache_c
215         context->pos_lon_label = pos_lon(cache->pos.lon, SIZE_BIG, strike));         context->pos_lon_label = pos_lon(cache->pos.lon, SIZE_BIG, strike));
216    
217    /* but calculations may be done with respect to the overriden one */    /* but calculations may be done with respect to the overriden one */
218    context->bearing_hbox = gtk_hbox_new(FALSE, 0);    if(!isnan(cache->pos.lat) && !isnan(cache->pos.lon)) {
219    bearing_fill_hbox(context->bearing_hbox, appdata, *refpos,      context->bearing_hbox = gtk_hbox_new(FALSE, 0);
220                      gpx_cache_pos(cache));      bearing_fill_hbox(context->bearing_hbox, appdata, *refpos,
221    gtk_box_pack_start_defaults(GTK_BOX(ivbox), context->bearing_hbox);                        gpx_cache_pos(cache));
222        gtk_box_pack_start_defaults(GTK_BOX(ivbox), context->bearing_hbox);
223      }
224    
225    gtk_table_attach_defaults(GTK_TABLE(table), ivbox, 3,4,0,2);    gtk_table_attach_defaults(GTK_TABLE(table), ivbox, 3,4,0,2);
226    
# Line 679  void cache_dialog(appdata_t *appdata, ca Line 684  void cache_dialog(appdata_t *appdata, ca
684    g_object_set_data(G_OBJECT(window), "cur_view", appdata->cur_view);    g_object_set_data(G_OBJECT(window), "cur_view", appdata->cur_view);
685    
686    appdata->cur_cache = cache;    appdata->cur_cache = cache;
687    char *title = g_strdup_printf("GPXView - %s", cache->name);    char *title = g_strdup_printf("%s - GPXView", cache->name);
688    gtk_window_set_title(GTK_WINDOW(window), title);    gtk_window_set_title(GTK_WINDOW(window), title);
689    g_free(title);    g_free(title);
690    

Legend:
Removed from v.11  
changed lines
  Added in v.34