Diff of /trunk/src/cache.c

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

revision 55 by harbaum, Thu Aug 13 12:01:52 2009 UTC revision 66 by harbaum, Wed Aug 19 20:03:28 2009 UTC
# Line 290  static GtkWidget *cache_hint(appdata_t * Line 290  static GtkWidget *cache_hint(appdata_t *
290    free(hint);    free(hint);
291    
292    GtkWidget *button = gtk_button_new_with_label(_("Encrypt/Decrypt"));    GtkWidget *button = gtk_button_new_with_label(_("Encrypt/Decrypt"));
293    #if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR == 5)
294      hildon_gtk_widget_set_theme_size(button,
295               (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH));
296    #endif
297    gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);    gtk_box_pack_start(GTK_BOX(vbox), button, FALSE, FALSE, 0);
298    gtk_signal_connect(GTK_OBJECT(button), "clicked",    gtk_signal_connect(GTK_OBJECT(button), "clicked",
299             GTK_SIGNAL_FUNC(on_decrypt), gtk_bin_get_child(GTK_BIN(view)));             GTK_SIGNAL_FUNC(on_decrypt), gtk_bin_get_child(GTK_BIN(view)));
# Line 470  static GtkWidget *cache_tbs(appdata_t *a Line 473  static GtkWidget *cache_tbs(appdata_t *a
473  #endif  #endif
474  }  }
475    
476  static GtkWidget *cache_logs(appdata_t *appdata, log_t *log, int is_html) {  #ifdef ENABLE_BROWSER_INTERFACE
477    static void on_gclink_clicked(GtkButton *button, gpointer data) {
478      cache_context_t *context = (cache_context_t*)data;
479      char *url = g_strdup_printf("http://www.geocaching.com/seek/log.aspx?wp=%s", context->cache->id);
480      browser_url(context->appdata, url);
481      g_free(url);
482    }
483    #endif
484    
485    static GtkWidget *cache_logs(appdata_t *appdata, cache_context_t *context, log_t *log, int is_html) {
486  #ifndef  USE_PANNABLE_AREA  #ifndef  USE_PANNABLE_AREA
487    /* put this inside a scrolled view */    /* put this inside a scrolled view */
488    GtkWidget *scrolled_window = gtk_scrolled_window_new(NULL, NULL);    GtkWidget *scrolled_window = gtk_scrolled_window_new(NULL, NULL);
# Line 480  static GtkWidget *cache_logs(appdata_t * Line 492  static GtkWidget *cache_logs(appdata_t *
492    GtkWidget *pannable_area = hildon_pannable_area_new();    GtkWidget *pannable_area = hildon_pannable_area_new();
493  #endif  #endif
494    
495    GtkWidget *table = gtk_table_new(4*gpx_number_of_logs(log), 3, FALSE);  #ifdef ENABLE_BROWSER_INTERFACE
496      gboolean gc_link = strncmp(context->cache->id, "GC", 2) == 0;
497    #else
498    #define gc_link (FALSE)
499    #endif
500    
501      GtkWidget *table = gtk_table_new(4*gpx_number_of_logs(log)+(gc_link?1:0), 3, FALSE);
502    int cnt = 0;    int cnt = 0;
503    
504    #ifdef ENABLE_BROWSER_INTERFACE
505      if(gc_link) {
506        GtkWidget *but = gtk_button_new_with_label(_("Post a new log entry for this geocache"));
507    #if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR == 5)
508      hildon_gtk_widget_set_theme_size(but,
509               (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH));
510    #endif
511        gtk_signal_connect(GTK_OBJECT(but), "clicked",
512                           GTK_SIGNAL_FUNC(on_gclink_clicked), context);
513    
514        gtk_table_attach_defaults(GTK_TABLE(table), but, 0, 3, 0, 1);
515        cnt++;
516      }
517    #endif
518    
519    /* add all logs to the vbox */    /* add all logs to the vbox */
520    while(log) {    while(log) {
# Line 631  GtkWidget *cache_view(appdata_t *appdata Line 664  GtkWidget *cache_view(appdata_t *appdata
664    
665    if(cache->log)    if(cache->log)
666      gtk_notebook_append_page(GTK_NOTEBOOK(notebook),      gtk_notebook_append_page(GTK_NOTEBOOK(notebook),
667             cache_logs(appdata, cache->log, cache->logs_are_html),       cache_logs(appdata, cache_context, cache->log, cache->logs_are_html),
668             gtk_label_new(_("Logs")));             gtk_label_new(_("Logs")));
669    
670    if(cache->wpt)    if(cache->wpt)

Legend:
Removed from v.55  
changed lines
  Added in v.66