92 |
(GtkCallback)gtk_widget_destroy, NULL); |
(GtkCallback)gtk_widget_destroy, NULL); |
93 |
|
|
94 |
/* update distance/etc */ |
/* update distance/etc */ |
95 |
bearing_fill_hbox(context->bearing_hbox, context->appdata, |
if(!isnan(context->cache->pos.lat) && |
96 |
*get_pos(context->appdata), notes_get_pos(context)); |
!isnan(context->cache->pos.lon)) |
97 |
|
bearing_fill_hbox(context->bearing_hbox, context->appdata, |
98 |
|
*get_pos(context->appdata), notes_get_pos(context)); |
99 |
|
|
100 |
gtk_widget_show_all(context->bearing_hbox); |
gtk_widget_show_all(context->bearing_hbox); |
101 |
} |
} |
102 |
|
|
215 |
context->pos_lon_label = pos_lon(cache->pos.lon, SIZE_BIG, strike)); |
context->pos_lon_label = pos_lon(cache->pos.lon, SIZE_BIG, strike)); |
216 |
|
|
217 |
/* but calculations may be done with respect to the overriden one */ |
/* but calculations may be done with respect to the overriden one */ |
218 |
context->bearing_hbox = gtk_hbox_new(FALSE, 0); |
if(!isnan(cache->pos.lat) && !isnan(cache->pos.lon)) { |
219 |
bearing_fill_hbox(context->bearing_hbox, appdata, *refpos, |
context->bearing_hbox = gtk_hbox_new(FALSE, 0); |
220 |
gpx_cache_pos(cache)); |
bearing_fill_hbox(context->bearing_hbox, appdata, *refpos, |
221 |
gtk_box_pack_start_defaults(GTK_BOX(ivbox), context->bearing_hbox); |
gpx_cache_pos(cache)); |
222 |
|
gtk_box_pack_start_defaults(GTK_BOX(ivbox), context->bearing_hbox); |
223 |
|
} |
224 |
|
|
225 |
gtk_table_attach_defaults(GTK_TABLE(table), ivbox, 3,4,0,2); |
gtk_table_attach_defaults(GTK_TABLE(table), ivbox, 3,4,0,2); |
226 |
|
|
354 |
GtkTextBuffer *buffer = gtk_text_buffer_new(NULL); |
GtkTextBuffer *buffer = gtk_text_buffer_new(NULL); |
355 |
gtk_text_buffer_set_text(buffer, wpt->desc, strlen(wpt->desc)); |
gtk_text_buffer_set_text(buffer, wpt->desc, strlen(wpt->desc)); |
356 |
|
|
357 |
#ifndef USE_MAEMO |
#ifndef USE_HILDON_TEXT_VIEW |
358 |
GtkWidget *textview = gtk_text_view_new_with_buffer(buffer); |
GtkWidget *textview = gtk_text_view_new_with_buffer(buffer); |
359 |
#else |
#else |
360 |
GtkWidget *textview = hildon_text_view_new(); |
GtkWidget *textview = hildon_text_view_new(); |
373 |
if(wpt->cmt) { |
if(wpt->cmt) { |
374 |
GtkTextBuffer *buffer = gtk_text_buffer_new(NULL); |
GtkTextBuffer *buffer = gtk_text_buffer_new(NULL); |
375 |
gtk_text_buffer_set_text(buffer, wpt->cmt, strlen(wpt->cmt)); |
gtk_text_buffer_set_text(buffer, wpt->cmt, strlen(wpt->cmt)); |
376 |
#ifndef USE_MAEMO |
#ifndef USE_HILDON_TEXT_VIEW |
377 |
GtkWidget *textview = gtk_text_view_new_with_buffer(buffer); |
GtkWidget *textview = gtk_text_view_new_with_buffer(buffer); |
378 |
#else |
#else |
379 |
GtkWidget *textview = hildon_text_view_new(); |
GtkWidget *textview = hildon_text_view_new(); |
670 |
|
|
671 |
#else |
#else |
672 |
#ifdef USE_STACKABLE_WINDOW |
#ifdef USE_STACKABLE_WINDOW |
673 |
|
static void on_cache_destroy (GtkWidget *widget, appdata_t *appdata) { |
674 |
|
appdata->cur_cache = NULL; |
675 |
|
|
676 |
|
/* restore cur_view */ |
677 |
|
appdata->cur_view = g_object_get_data(G_OBJECT(widget), "cur_view"); |
678 |
|
} |
679 |
|
|
680 |
void cache_dialog(appdata_t *appdata, cache_t *cache) { |
void cache_dialog(appdata_t *appdata, cache_t *cache) { |
681 |
GtkWidget *window = hildon_stackable_window_new(); |
GtkWidget *window = hildon_stackable_window_new(); |
682 |
|
|
683 |
|
/* store last "cur_view" in window */ |
684 |
|
g_object_set_data(G_OBJECT(window), "cur_view", appdata->cur_view); |
685 |
|
|
686 |
|
appdata->cur_cache = cache; |
687 |
char *title = g_strdup_printf("GPXView - %s", cache->name); |
char *title = g_strdup_printf("GPXView - %s", cache->name); |
688 |
gtk_window_set_title(GTK_WINDOW(window), title); |
gtk_window_set_title(GTK_WINDOW(window), title); |
689 |
g_free(title); |
g_free(title); |
690 |
|
|
691 |
/* create cache visualization widget */ |
/* create cache visualization widget */ |
692 |
gtk_container_add(GTK_CONTAINER(window), |
appdata->cur_view = cache_view(appdata, cache); |
693 |
cache_view(appdata, cache)); |
gtk_container_add(GTK_CONTAINER(window), appdata->cur_view); |
694 |
|
|
695 |
hildon_window_set_app_menu(HILDON_WINDOW(window), |
hildon_window_set_app_menu(HILDON_WINDOW(window), |
696 |
menu_create(appdata, MENU_CACHE)); |
menu_create(appdata, MENU_CACHE)); |
697 |
|
|
698 |
|
g_signal_connect(G_OBJECT(window), "destroy", |
699 |
|
G_CALLBACK(on_cache_destroy), appdata); |
700 |
|
|
701 |
gtk_widget_show_all(window); |
gtk_widget_show_all(window); |
702 |
} |
} |
703 |
#endif // USE_STACKABLE_WINDOW |
#endif // USE_STACKABLE_WINDOW |