Diff of /trunk/src/cache.c

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

revision 178 by harbaum, Thu Nov 12 19:58:26 2009 UTC revision 185 by harbaum, Sat Nov 14 16:55:33 2009 UTC
# Line 179  static GtkWidget *cache_overview(cache_c Line 179  static GtkWidget *cache_overview(cache_c
179    
180    if(cache->type != CACHE_TYPE_UNKNOWN) {    if(cache->type != CACHE_TYPE_UNKNOWN) {
181      gtk_table_attach(GTK_TABLE(table),      gtk_table_attach(GTK_TABLE(table),
182    
183  #if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR >= 5)  #if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR >= 5)
184               tip = icon_get_widget(ICON_CACHE_TYPE_2X, cache->type),               tip = icon_get_widget(ICON_CACHE_TYPE_2X, cache->type),
185  #else  #else
186               tip = icon_get_widget(ICON_CACHE_TYPE_1_5X, cache->type),               tip = icon_get_widget(ICON_CACHE_TYPE_1_5X, cache->type),
187  #endif  #endif
188                       0,1,0,1, GTK_FILL, 0, GTK_FILL, 0);                       0,1,0,1, GTK_FILL, 0, GTK_FILL, 0);
189    
190  #ifndef USE_MAEMO  #ifndef USE_MAEMO
191      gtk_tooltips_set_tip(tips, tip, _(cache_type_tip[cache->type]), NULL);      gtk_tooltips_set_tip(tips, tip, _(cache_type_tip[cache->type]), NULL);
192  #endif  #endif
# Line 282  static GtkWidget *cache_overview(cache_c Line 284  static GtkWidget *cache_overview(cache_c
284      /* fill with vote if present on disk (will also free vote) */      /* fill with vote if present on disk (will also free vote) */
285      if(vote)      if(vote)
286        gcvote_set(context, vote);        gcvote_set(context, vote);
   
     gtk_table_attach_defaults(GTK_TABLE(table), ratebox, 2,3,0,2);  
287    }    }
288    
289      gtk_table_attach_defaults(GTK_TABLE(table), ratebox, 2,3,0,2);
290    
291    /* ----------------------------------------------------- */    /* ----------------------------------------------------- */
292    
293    
# Line 438  static GtkWidget *cache_wpts(appdata_t * Line 440  static GtkWidget *cache_wpts(appdata_t *
440                        pos_lon(wpt->pos.lon, SIZE_BIG, STRIKETHROUGH_NONE),                        pos_lon(wpt->pos.lon, SIZE_BIG, STRIKETHROUGH_NONE),
441                        2,3, wpt_row, wpt_row+1);                        2,3, wpt_row, wpt_row+1);
442    
443      ihbox = gtk_hbox_new(FALSE, 0);      if(refpos && !isnan(refpos->lat) && !isnan(refpos->lon)) {
444      gtk_box_pack_start(GTK_BOX(ihbox), gtk_image_new_from_pixbuf(        ihbox = gtk_hbox_new(FALSE, 0);
445          gtk_box_pack_start(GTK_BOX(ihbox), gtk_image_new_from_pixbuf(
446                             icon_bearing(*refpos, wpt->pos)),1,0,0);                             icon_bearing(*refpos, wpt->pos)),1,0,0);
447      gtk_box_pack_start_defaults(GTK_BOX(ihbox),        gtk_box_pack_start_defaults(GTK_BOX(ihbox),
448            GTK_LABEL_SMALL((char*)pos_get_bearing_str(*refpos, wpt->pos)));            GTK_LABEL_SMALL((char*)pos_get_bearing_str(*refpos, wpt->pos)));
449      snprintf(str, sizeof(str), _("%.1f°"),        snprintf(str, sizeof(str), _("%.1f°"),
450             gpx_pos_get_bearing(*refpos, wpt->pos));                 gpx_pos_get_bearing(*refpos, wpt->pos));
451      gtk_box_pack_start_defaults(GTK_BOX(ihbox), GTK_LABEL_SMALL(str));        gtk_box_pack_start_defaults(GTK_BOX(ihbox), GTK_LABEL_SMALL(str));
452      gpx_pos_get_distance_str(str, sizeof(str),  
453                               *refpos, wpt->pos, appdata->imperial);        gpx_pos_get_distance_str(str, sizeof(str),
454      gtk_box_pack_start(GTK_BOX(ihbox), GTK_LABEL_SMALL(str),1,0,0);                                 *refpos, wpt->pos, appdata->imperial);
455          gtk_box_pack_start(GTK_BOX(ihbox), GTK_LABEL_SMALL(str),1,0,0);
456    
457          gtk_table_attach_defaults(GTK_TABLE(table), ihbox, 3,4,
458                                    wpt_row+0, wpt_row+1);
459        }
460    
     gtk_table_attach_defaults(GTK_TABLE(table), ihbox, 3,4,  
                               wpt_row+0, wpt_row+1);  
   
461      /* ------------------ description ------------------------- */      /* ------------------ description ------------------------- */
462      if(wpt->desc)      if(wpt->desc)
463        gtk_table_attach_defaults(GTK_TABLE(table),        gtk_table_attach_defaults(GTK_TABLE(table),
# Line 514  static GtkWidget *cache_tbs(appdata_t *a Line 519  static GtkWidget *cache_tbs(appdata_t *a
519    
520      /* --------------------- icon/ref/name -------------------------*/      /* --------------------- icon/ref/name -------------------------*/
521      GtkWidget *icon = NULL;      GtkWidget *icon = NULL;
522      if(strcasestr(tb->name, "coin") != 0)      if((strcasestr(tb->name, "coin") != 0) ||
523           (strcasestr(tb->name, "muenze") != 0) ||
524           (strcasestr(tb->name, "münze") != 0))
525        icon = icon_get_widget(ICON_TB, 1);   /* coin icon */        icon = icon_get_widget(ICON_TB, 1);   /* coin icon */
526      else      else
527        icon = icon_get_widget(ICON_TB, 0);   /* tb icon */        icon = icon_get_widget(ICON_TB, 0);   /* tb icon */
# Line 592  static GtkWidget *cache_logs(appdata_t * Line 599  static GtkWidget *cache_logs(appdata_t *
599      gtk_signal_connect(GTK_OBJECT(but), "clicked",      gtk_signal_connect(GTK_OBJECT(but), "clicked",
600                         GTK_SIGNAL_FUNC(on_gclink_clicked), context);                         GTK_SIGNAL_FUNC(on_gclink_clicked), context);
601    
602      gtk_box_pack_start_defaults(GTK_BOX(vbox), but);      gtk_box_pack_start(GTK_BOX(vbox), but, FALSE, FALSE, 0);
603    }    }
604  #endif  #endif
605    
# Line 641  static GtkWidget *cache_logs(appdata_t * Line 648  static GtkWidget *cache_logs(appdata_t *
648    
649      gtk_box_pack_start(GTK_BOX(ivbox), ihbox, FALSE, FALSE, 0);      gtk_box_pack_start(GTK_BOX(ivbox), ihbox, FALSE, FALSE, 0);
650    
651      gtk_table_attach_defaults(GTK_TABLE(table), ivbox, 0, 1,      gtk_table_attach(GTK_TABLE(table), ivbox, 0, 1,
652                                2*log_cnt, 2*log_cnt+1);                       2*log_cnt, 2*log_cnt+1, 0, GTK_EXPAND | GTK_FILL, 0, 0);
653    
654      if(log->text) {      if(log->text) {
655        gtk_table_attach_defaults(GTK_TABLE(table),        gtk_table_attach_defaults(GTK_TABLE(table),
656          html_view(appdata, log->text,          html_view(appdata, log->text,
# Line 664  static GtkWidget *cache_logs(appdata_t * Line 671  static GtkWidget *cache_logs(appdata_t *
671      log_cnt++;      log_cnt++;
672    }    }
673    
674    gtk_box_pack_start_defaults(GTK_BOX(vbox), table);    gtk_box_pack_start(GTK_BOX(vbox), table, FALSE, FALSE, 0);
675    
676  #ifndef  USE_PANNABLE_AREA  #ifndef  USE_PANNABLE_AREA
677    gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),    gtk_scrolled_window_add_with_viewport(GTK_SCROLLED_WINDOW(scrolled_window),
# Line 785  static GtkWidget *notebook_new(void) { Line 792  static GtkWidget *notebook_new(void) {
792  #endif  #endif
793  }  }
794    
795    #ifdef CUSTOM_NOTEBOOK
796  static void on_notebook_button_clicked(GtkWidget *button, gpointer data) {  static void on_notebook_button_clicked(GtkWidget *button, gpointer data) {
797    GtkNotebook *nb =    GtkNotebook *nb =
798      GTK_NOTEBOOK(g_object_get_data(G_OBJECT(data), "notebook"));      GTK_NOTEBOOK(g_object_get_data(G_OBJECT(data), "notebook"));
# Line 792  static void on_notebook_button_clicked(G Line 800  static void on_notebook_button_clicked(G
800    gint page = (gint)g_object_get_data(G_OBJECT(button), "page");    gint page = (gint)g_object_get_data(G_OBJECT(button), "page");
801    gtk_notebook_set_current_page(nb, page);    gtk_notebook_set_current_page(nb, page);
802  }  }
803    #endif
804    
805  static void notebook_append_page(GtkWidget *notebook,  static void notebook_append_page(GtkWidget *notebook,
806                                   GtkWidget *page, char *label) {                                   GtkWidget *page, char *label) {

Legend:
Removed from v.178  
changed lines
  Added in v.185