483 |
cache_context_t *context = (cache_context_t*)data; |
cache_context_t *context = (cache_context_t*)data; |
484 |
|
|
485 |
/* extract position from entries */ |
/* extract position from entries */ |
486 |
context->gotoc.pos.lat = lat_get(context->gotoc.lat_entry); |
context->gotoc.pos.lat = lat_entry_get(context->gotoc.lat_entry); |
487 |
context->gotoc.pos.lon = lon_get(context->gotoc.lon_entry); |
context->gotoc.pos.lon = lon_entry_get(context->gotoc.lon_entry); |
488 |
|
|
489 |
goto_update(context); |
goto_update(context); |
490 |
} |
} |
534 |
g_signal_connect(G_OBJECT(context->gotoc.lon_entry), "changed", |
g_signal_connect(G_OBJECT(context->gotoc.lon_entry), "changed", |
535 |
G_CALLBACK(pos_modified), context); |
G_CALLBACK(pos_modified), context); |
536 |
|
|
537 |
GtkWidget *popup = coo_popup(context->appdata, |
context->gotoc.coo_popup = preset_coordinate_picker(context->appdata, |
538 |
context->gotoc.lat_entry, context->gotoc.lon_entry); |
context->gotoc.lat_entry, context->gotoc.lon_entry); |
539 |
gtk_table_attach_defaults(GTK_TABLE(table), popup, 2,3,0,1); |
gtk_table_attach_defaults(GTK_TABLE(table), |
540 |
|
context->gotoc.coo_popup, 2,3,0,1); |
541 |
|
|
542 |
gtk_table_set_row_spacing(GTK_TABLE(table), 1, 16); |
gtk_table_set_row_spacing(GTK_TABLE(table), 1, 16); |
543 |
gtk_table_set_col_spacing(GTK_TABLE(table), 0, 16); |
gtk_table_set_col_spacing(GTK_TABLE(table), 0, 16); |
597 |
|
|
598 |
void goto_coordinate_update(cache_context_t *context) { |
void goto_coordinate_update(cache_context_t *context) { |
599 |
static pos_t pos = { 0.0, 0.0 }; |
static pos_t pos = { 0.0, 0.0 }; |
|
char str[32]; |
|
600 |
|
|
601 |
if(!context->notes.modified) |
if(!context->notes.modified) |
602 |
return; |
return; |
605 |
if(pos_differ(&npos, &pos)) { |
if(pos_differ(&npos, &pos)) { |
606 |
pos = npos; |
pos = npos; |
607 |
|
|
608 |
pos_lat_str(str, sizeof(str)-1, npos.lat); |
lat_entry_set(context->gotoc.lat_entry, npos.lat); |
609 |
gtk_entry_set_text(GTK_ENTRY(context->gotoc.lat_entry), str); |
lon_entry_set(context->gotoc.lon_entry, npos.lon); |
|
pos_lon_str(str, sizeof(str)-1, npos.lon); |
|
|
gtk_entry_set_text(GTK_ENTRY(context->gotoc.lon_entry), str); |
|
610 |
} |
} |
611 |
} |
} |