Diff of /trunk/src/cache.c

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

revision 66 by harbaum, Wed Aug 19 20:03:28 2009 UTC revision 136 by harbaum, Mon Oct 19 13:02:41 2009 UTC
# Line 156  static GtkWidget *cache_overview(cache_c Line 156  static GtkWidget *cache_overview(cache_c
156      else {      else {
157        /* add Go button */        /* add Go button */
158        lbl = gtk_button_attrib(cache->id, SIZE_BIG, strike);        lbl = gtk_button_attrib(cache->id, SIZE_BIG, strike);
       //      gtk_button_set_relief(GTK_BUTTON(button),GTK_RELIEF_NONE);  
159        gtk_signal_connect(GTK_OBJECT(lbl), "clicked",        gtk_signal_connect(GTK_OBJECT(lbl), "clicked",
160                           (GtkSignalFunc)on_www_clicked, context);                           (GtkSignalFunc)on_www_clicked, context);
161      }      }
# Line 169  static GtkWidget *cache_overview(cache_c Line 168  static GtkWidget *cache_overview(cache_c
168    if(cache->owner) {    if(cache->owner) {
169      ivbox = gtk_vbox_new(FALSE, 0);      ivbox = gtk_vbox_new(FALSE, 0);
170      gtk_box_pack_start_defaults(GTK_BOX(ivbox), GTK_LABEL_SMALL(_("by")));      gtk_box_pack_start_defaults(GTK_BOX(ivbox), GTK_LABEL_SMALL(_("by")));
171      gtk_box_pack_start_defaults(GTK_BOX(ivbox), GTK_LABEL_SMALL(cache->owner));      gtk_box_pack_start_defaults(GTK_BOX(ivbox), GTK_LABEL_SMALL(cache->owner->name));
172      gtk_table_attach_defaults(GTK_TABLE(table), ivbox, 1,2,1,2);      gtk_table_attach_defaults(GTK_TABLE(table), ivbox, 1,2,1,2);
173    }    }
174    
# Line 422  static GtkWidget *cache_wpts(appdata_t * Line 421  static GtkWidget *cache_wpts(appdata_t *
421  #endif  #endif
422  }  }
423    
424    #ifdef ENABLE_BROWSER_INTERFACE
425    static void on_tbref_clicked(GtkButton *button, gpointer data) {
426      appdata_t *appdata = (appdata_t *)data;
427    
428      unsigned int id = (unsigned int)g_object_get_data(G_OBJECT(button), "id");
429      if(id) {
430        printf("clicked tb id %u\n", id);
431        char *url =
432          g_strdup_printf("http://www.geocaching.com/track/details.aspx?id=%u", id);
433        browser_url(appdata, url);
434        g_free(url);
435      }
436    }
437    #endif
438    
439  static GtkWidget *cache_tbs(appdata_t *appdata, tb_t *tb) {  static GtkWidget *cache_tbs(appdata_t *appdata, tb_t *tb) {
440    pos_t *refpos = NULL;    pos_t *refpos = NULL;
441    
# Line 445  static GtkWidget *cache_tbs(appdata_t *a Line 459  static GtkWidget *cache_tbs(appdata_t *a
459      /* --------------------- icon/ref/name -------------------------*/      /* --------------------- icon/ref/name -------------------------*/
460      gtk_table_attach_defaults(GTK_TABLE(table), icon_get_widget(ICON_TB, 0),      gtk_table_attach_defaults(GTK_TABLE(table), icon_get_widget(ICON_TB, 0),
461                                0, 1, tb_row+0, tb_row+1);                                0, 1, tb_row+0, tb_row+1);
462      if(tb->ref)  
463        gtk_table_attach_defaults(GTK_TABLE(table), GTK_LABEL_BIG(tb->ref),      if(tb->ref) {
464    #ifdef ENABLE_BROWSER_INTERFACE
465          GtkWidget *ref = gtk_button_new_with_label(tb->ref);
466    #if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR == 5)
467          hildon_gtk_widget_set_theme_size(ref,
468                                           (HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH));
469    #endif
470          g_object_set_data(G_OBJECT(ref), "id", (gpointer)tb->id);
471          gtk_signal_connect(GTK_OBJECT(ref), "clicked",
472                           GTK_SIGNAL_FUNC(on_tbref_clicked), appdata);
473    #else
474          GtkWidget *ref = GTK_LABEL_BIG(tb->ref);
475    #endif
476          gtk_table_attach_defaults(GTK_TABLE(table), ref,
477                                  1, 2, tb_row+0, tb_row+1);                                  1, 2, tb_row+0, tb_row+1);
478        }
479    
480      if(tb->name)      if(tb->name)
481        gtk_table_attach_defaults(GTK_TABLE(table), GTK_LABEL_BIG(tb->name),        gtk_table_attach_defaults(GTK_TABLE(table), GTK_LABEL_BIG(tb->name),
482                                  2, 3, tb_row+0, tb_row+1);                                  2, 3, tb_row+0, tb_row+1);
# Line 590  static void on_notebook_page_change(GtkN Line 619  static void on_notebook_page_change(GtkN
619    
620    /* this is a workaround, around some bug in the gtktextwidget or so ... */    /* this is a workaround, around some bug in the gtktextwidget or so ... */
621    /* i tried to get info on this and everybody agreed that this is a bug */    /* i tried to get info on this and everybody agreed that this is a bug */
622    /* in gtk but noone had a read fix. so i came up with this. */    /* in gtk but noone had a fix ready. so i came up with this. */
623    /* seems to work ... */    /* seems to work ... */
624    if(strcasecmp(name, _("Logs")) == 0) {    if(strcasecmp(name, _("Logs")) == 0) {
625      gtk_widget_queue_resize(w);      gtk_widget_queue_resize(w);
626    }    } else if(strcasecmp(name, _("TBs")) == 0) {
627        gtk_widget_queue_resize(w);
628    if(strcasecmp(name, _("Goto")) == 0) {    } else if(strcasecmp(name, _("Goto")) == 0) {
629  #ifdef USE_MAEMO  #ifdef USE_MAEMO
630      context->handler_id = gtk_timeout_add(1000, screensaver_update,      context->handler_id = gtk_timeout_add(1000, screensaver_update,
631                                            context->appdata);                                            context->appdata);
# Line 644  GtkWidget *cache_view(appdata_t *appdata Line 673  GtkWidget *cache_view(appdata_t *appdata
673  #endif  #endif
674    
675    notebook =  gtk_notebook_new();    notebook =  gtk_notebook_new();
676    
677  #ifdef USE_MAEMO  #ifdef USE_MAEMO
678  #if MAEMO_VERSION_MAJOR >= 5  #if MAEMO_VERSION_MAJOR >= 5
679    /* prevents user from accidentially touching the breadcrumb trail */    /* prevents user from accidentially touching the breadcrumb trail */

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