Diff of /trunk/src/main.c

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

revision 204 by harbaum, Mon Nov 23 18:32:06 2009 UTC revision 214 by harbaum, Thu Nov 26 10:05:23 2009 UTC
# Line 15  Line 15 
15   * along with GPXView.  If not, see <http://www.gnu.org/licenses/>.   * along with GPXView.  If not, see <http://www.gnu.org/licenses/>.
16   */   */
17    
18  #include <stdio.h>  #define __USE_GNU
19  #include <string.h>  #include <string.h>
20    
21    #include <stdio.h>
22  #include <math.h>  #include <math.h>
23    
24  #include <curl/curl.h>  #include <curl/curl.h>
# Line 221  void cachelist_goto_cache(appdata_t *app Line 223  void cachelist_goto_cache(appdata_t *app
223  #if !defined(USE_BREAD_CRUMB_TRAIL) && !defined(BCT)  #if !defined(USE_BREAD_CRUMB_TRAIL) && !defined(BCT)
224      cache_dialog(appdata, cache);      cache_dialog(appdata, cache);
225  #else  #else
226        crumb_add(appdata, cache->name, CRUMB_CACHE, cache);
227    
228      gtk_container_remove(GTK_CONTAINER(appdata->vbox), appdata->cur_view);      gtk_container_remove(GTK_CONTAINER(appdata->vbox), appdata->cur_view);
229      appdata->cur_view = cache_view(appdata, cache);      appdata->cur_view = cache_view(appdata, cache);
230      gtk_box_pack_start_defaults(GTK_BOX(appdata->vbox), appdata->cur_view);      gtk_box_pack_start_defaults(GTK_BOX(appdata->vbox), appdata->cur_view);
231      gtk_widget_show_all(appdata->vbox);      gtk_widget_show_all(appdata->vbox);
   
     crumb_add(appdata, cache->name, CRUMB_CACHE, cache);  
232  #endif  #endif
233  }  }
234    
# Line 474  static GtkWidget *cachelist_create(appda Line 476  static GtkWidget *cachelist_create(appda
476      if(tint > 8) tint = 8;      if(tint > 8) tint = 8;
477    
478      /* cache type includes "solved" flag in lowest bit */      /* cache type includes "solved" flag in lowest bit */
479      int type = (cache->type<<8) +      int type = cache->type<<8;
480        (cache->notes?4:0) +      if(cache->notes) type |= 4;
481        ((cache->notes && cache->notes->override)?1:0) +      if(cache->notes && cache->notes->override) type |= 1;
482        (((cache->notes && cache->notes->found)||cache->found)?2:0);      if(cache->notes && cache->notes->found) type |= 2;
483        if(cache->found) type |= 2;
484        if(cache->mine) type |= 8;
485    
486      if((!(type & 2)) || !appdata->cachelist_hide_found) {      if((!(type & 2)) || !appdata->cachelist_hide_found) {
487    
# Line 593  void cachelist_dialog(appdata_t *appdata Line 597  void cachelist_dialog(appdata_t *appdata
597  static void search_result_free(gpx_t *result);  static void search_result_free(gpx_t *result);
598    
599  void on_cachelist_destroy(GtkWidget *widget, appdata_t *appdata) {  void on_cachelist_destroy(GtkWidget *widget, appdata_t *appdata) {
600      printf("cachelist destroy\n");
601    
602    if(appdata->search_results) {    if(appdata->search_results) {
603      search_result_free(appdata->search_results);      search_result_free(appdata->search_results);
604      appdata->search_results = NULL;      appdata->search_results = NULL;
# Line 665  static GdkPixbuf *gpx_icon_get(gpx_t *gp Line 671  static GdkPixbuf *gpx_icon_get(gpx_t *gp
671    return icon_get(ICON_FILE, 0);    return icon_get(ICON_FILE, 0);
672  }  }
673    
674  static void gpxlist_set(GtkListStore *store, GtkTreeIter *iter, gpx_t *gpx) {  void gpxlist_set(GtkListStore *store, GtkTreeIter *iter, gpx_t *gpx) {
675    char date_str[32], cnum[32];    char date_str[32], cnum[32];
676    
677    if(gpx->year && gpx->month && gpx->day) {    if(gpx->year && gpx->month && gpx->day) {
# Line 908  static void gpxlist_view_onRowActivated( Line 914  static void gpxlist_view_onRowActivated(
914    }    }
915  }  }
916    
917    /* search gpx file in gpx list */
918    gboolean gpxlist_find(appdata_t *appdata, GtkTreeIter *iter, gpx_t *gpx) {
919      GtkTreeModel *model =
920        gtk_tree_view_get_model(GTK_TREE_VIEW(appdata->gpxview));
921    
922      gboolean found =
923        gtk_tree_model_get_iter_first(model, iter);
924    
925      while(found) {
926        gpx_t *this_gpx;
927        gtk_tree_model_get(model, iter, GPXLIST_COL_DATA, &this_gpx, -1);
928    
929        if(gpx == this_gpx)
930          return TRUE;
931    
932        found = gtk_tree_model_iter_next(model, iter);
933      }
934    
935      return FALSE;
936    }
937    
938    
939  #ifndef USE_PANNABLE_AREA  #ifndef USE_PANNABLE_AREA
940  static gboolean  static gboolean
941  view_selection_func(GtkTreeSelection *selection, GtkTreeModel *model,  view_selection_func(GtkTreeSelection *selection, GtkTreeModel *model,
# Line 1451  cb_menu_search(GtkWidget *window, gpoint Line 1479  cb_menu_search(GtkWidget *window, gpoint
1479    
1480    gtk_box_pack_start_defaults(GTK_BOX(GTK_DIALOG(dialog)->vbox),    gtk_box_pack_start_defaults(GTK_BOX(GTK_DIALOG(dialog)->vbox),
1481                                gtk_label_new(_("Search for:")));                                gtk_label_new(_("Search for:")));
1482  #if !defined(USE_MAEMO) || (MAEMO_VERSION_MAJOR < 5)    context.entry = entry_new();
   context.entry = gtk_entry_new();  
 #else  
   context.entry = hildon_entry_new(HILDON_SIZE_AUTO);  
 #endif  
   
1483    gtk_box_pack_start_defaults(GTK_BOX(GTK_DIALOG(dialog)->vbox),    gtk_box_pack_start_defaults(GTK_BOX(GTK_DIALOG(dialog)->vbox),
1484                                context.entry);                                context.entry);
1485    

Legend:
Removed from v.204  
changed lines
  Added in v.214