Diff of /trunk/src/cache.c

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

revision 288 by harbaum, Mon Jun 7 19:19:50 2010 UTC revision 303 by harbaum, Tue Sep 14 09:28:57 2010 UTC
# Line 21  Line 21 
21  #include <math.h>  #include <math.h>
22  #include <string.h>  #include <string.h>
23    
24    #if MAEMO_VERSION_MAJOR == 5
25    #include <gdk/gdkx.h>
26    #include <X11/Xatom.h>
27    #endif
28    
29  static GtkWidget *cache_description(appdata_t *appdata, cache_t *cache) {  static GtkWidget *cache_description(appdata_t *appdata, cache_t *cache) {
30    return html_view(appdata, cache->long_description,    return html_view(appdata, cache->long_description,
31             cache->long_is_html?HTML_HTML:HTML_PLAIN_TEXT, TRUE, cache, NULL);             cache->long_is_html?HTML_HTML:HTML_PLAIN_TEXT, TRUE, cache, NULL);
# Line 337  static GtkWidget *cache_overview(cache_c Line 342  static GtkWidget *cache_overview(cache_c
342    
343    /* ----------------------------------------------------- */    /* ----------------------------------------------------- */
344    
345      if(cache->attribute) {
346        GtkWidget *thbox = gtk_hbox_new(FALSE, 0);
347        ihbox = gtk_hbox_new(FALSE, 0);
348    
349        attribute_t *att = cache->attribute;
350        while(att) {
351          if(att->inc)
352            tip = icon_get_widget(ICON_ATT, att->id+1);
353          else
354            tip = icon_get_widget_ovl(ICON_ATT, att->id+1, 0);
355    
356          gtk_box_pack_start(GTK_BOX(ihbox), tip, FALSE, FALSE, 4);
357    
358    #ifndef USE_MAEMO
359          gtk_tooltips_set_tip(tips, tip, _(att->name), NULL);
360    #endif
361    
362          att = att->next;
363        }
364    
365        gtk_box_pack_start(GTK_BOX(thbox), ihbox, TRUE, FALSE, 0);
366        gtk_box_pack_start(GTK_BOX(vbox), thbox, FALSE, FALSE, 0);
367        gtk_box_pack_start(GTK_BOX(vbox), gtk_hseparator_new(), FALSE, FALSE, 0);
368      }
369    
370      /* ----------------------------------------------------- */
371    
372    if(cache->short_description)    if(cache->short_description)
373      gtk_box_pack_start_defaults(GTK_BOX(vbox),      gtk_box_pack_start_defaults(GTK_BOX(vbox),
374          html_view(appdata, cache->short_description,          html_view(appdata, cache->short_description,
# Line 579  static void on_gclink_clicked(GtkButton Line 611  static void on_gclink_clicked(GtkButton
611    char *url = g_strdup_printf("http://www.geocaching.com/seek/log.aspx?wp=%s", context->cache->id);    char *url = g_strdup_printf("http://www.geocaching.com/seek/log.aspx?wp=%s", context->cache->id);
612    browser_url(context->appdata, url);    browser_url(context->appdata, url);
613    g_free(url);    g_free(url);
614    
615      notes_logged(context);
616  }  }
617  #endif  #endif
618    
# Line 872  void cache_dialog(appdata_t *appdata, ca Line 906  void cache_dialog(appdata_t *appdata, ca
906    
907  #else  #else
908  #ifdef USE_STACKABLE_WINDOW  #ifdef USE_STACKABLE_WINDOW
909    
910    #if !defined(__i386__)
911    /* get access to zoom buttons */
912    static void
913    on_window_realize(GtkWidget *widget, gpointer data) {
914      if (widget->window) {
915        unsigned char value = 1;
916        Atom hildon_zoom_key_atom =
917          gdk_x11_get_xatom_by_name("_HILDON_ZOOM_KEY_ATOM"),
918          integer_atom = gdk_x11_get_xatom_by_name("INTEGER");
919        Display *dpy =
920          GDK_DISPLAY_XDISPLAY(gdk_drawable_get_display(widget->window));
921        Window w = GDK_WINDOW_XID(widget->window);
922    
923        XChangeProperty(dpy, w, hildon_zoom_key_atom,
924                        integer_atom, 8, PropModeReplace, &value, 1);
925      }
926    }
927    #endif
928    
929  static void on_cache_destroy (GtkWidget *widget, appdata_t *appdata) {  static void on_cache_destroy (GtkWidget *widget, appdata_t *appdata) {
930    appdata->cur_cache = NULL;    appdata->cur_cache = NULL;
931    
# Line 886  void cache_dialog(appdata_t *appdata, ca Line 940  void cache_dialog(appdata_t *appdata, ca
940    GtkWidget *window = hildon_stackable_window_new();    GtkWidget *window = hildon_stackable_window_new();
941    appdata->window = HILDON_WINDOW(window);    appdata->window = HILDON_WINDOW(window);
942    
943    #if !defined(__i386__)
944      g_signal_connect(G_OBJECT(appdata->window), "realize",
945                       G_CALLBACK(on_window_realize), NULL);
946    #endif
947    
948      g_signal_connect(G_OBJECT(appdata->window), "key_press_event",
949                       G_CALLBACK(on_window_key_press), appdata);
950    
951    /* store last "cur_view" in window */    /* store last "cur_view" in window */
952    g_object_set_data(G_OBJECT(window), "cur_view", appdata->cur_view);    g_object_set_data(G_OBJECT(window), "cur_view", appdata->cur_view);
953    

Legend:
Removed from v.288  
changed lines
  Added in v.303