1010 |
if(new) gpxlist_add(appdata, new); |
if(new) gpxlist_add(appdata, new); |
1011 |
} |
} |
1012 |
|
|
|
static void |
|
|
cb_menu_geomath(GtkWidget *window, gpointer data) { |
|
|
geomath_dialog((appdata_t *)data); |
|
|
} |
|
|
|
|
|
static void |
|
|
cb_menu_geotext(GtkWidget *window, gpointer data) { |
|
|
geotext_dialog((appdata_t *)data); |
|
|
} |
|
|
|
|
|
static void |
|
|
cb_menu_precpos(GtkWidget *window, gpointer data) { |
|
|
precise_position((appdata_t *)data); |
|
|
} |
|
|
|
|
1013 |
#ifndef USE_PANNABLE_AREA |
#ifndef USE_PANNABLE_AREA |
1014 |
static void |
static void |
1015 |
cb_menu_close(GtkWidget *window, gpointer data) { |
cb_menu_close(GtkWidget *window, gpointer data) { |
1415 |
} |
} |
1416 |
#endif |
#endif |
1417 |
|
|
1418 |
static void |
#ifdef USE_STACKABLE_WINDOW |
1419 |
cb_menu_export_log(GtkWidget *widget, gpointer data) { |
typedef struct { |
1420 |
appdata_t *appdata = (appdata_t*)data; |
appdata_t *appdata; |
1421 |
notes_log_export(appdata); |
GtkWidget *dialog; |
1422 |
|
} appmenu_context_t; |
1423 |
|
|
1424 |
|
void on_export_mmpoi_clicked(appmenu_context_t *context) { |
1425 |
|
gtk_widget_destroy(context->dialog); |
1426 |
|
while(gtk_events_pending()) |
1427 |
|
gtk_main_iteration(); |
1428 |
|
|
1429 |
|
mmpoi_export(context->appdata); |
1430 |
} |
} |
1431 |
|
|
1432 |
#ifdef USE_MAEMO |
void on_export_garmin_clicked(appmenu_context_t *context) { |
1433 |
static void |
gtk_widget_destroy(context->dialog); |
1434 |
cb_menu_export_mmpoi(GtkWidget *widget, gpointer data) { |
while(gtk_events_pending()) |
1435 |
appdata_t *appdata = (appdata_t*)data; |
gtk_main_iteration(); |
1436 |
mmpoi_export(appdata); |
|
1437 |
|
garmin_export(context->appdata); |
1438 |
} |
} |
|
#endif |
|
1439 |
|
|
1440 |
static void |
void on_export_notes_log_clicked(appmenu_context_t *context) { |
1441 |
cb_menu_export_garmin(GtkWidget *widget, gpointer data) { |
gtk_widget_destroy(context->dialog); |
1442 |
appdata_t *appdata = (appdata_t*)data; |
while(gtk_events_pending()) |
1443 |
garmin_export(appdata); |
gtk_main_iteration(); |
1444 |
|
|
1445 |
|
notes_log_export(context->appdata); |
1446 |
} |
} |
1447 |
|
|
|
#ifdef USE_STACKABLE_WINDOW |
|
1448 |
void on_export_clicked(GtkButton *button, appdata_t *appdata) { |
void on_export_clicked(GtkButton *button, appdata_t *appdata) { |
1449 |
GtkWidget *but, *dialog = gtk_dialog_new(); |
GtkWidget *but; |
1450 |
|
appmenu_context_t context; |
1451 |
|
|
1452 |
|
context.appdata = appdata; |
1453 |
|
context.dialog = gtk_dialog_new(); |
1454 |
|
|
1455 |
gtk_window_set_title(GTK_WINDOW(dialog), _("Export")); |
gtk_window_set_decorated(GTK_WINDOW(context.dialog), FALSE); |
1456 |
|
|
1457 |
but = hildon_button_new_with_text(HILDON_SIZE_AUTO, |
but = hildon_button_new_with_text(HILDON_SIZE_AUTO, |
1458 |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1459 |
_("Export to Maemo Mapper"), |
_("Export to Maemo Mapper"), |
1460 |
_("Write a Maemo Mapper POI file")); |
_("Save a Maemo Mapper POI file")); |
1461 |
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), but); |
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(context.dialog)->vbox), but); |
1462 |
|
g_signal_connect_swapped(but, "clicked", |
1463 |
|
G_CALLBACK(on_export_mmpoi_clicked), &context); |
1464 |
|
|
1465 |
but = hildon_button_new_with_text(HILDON_SIZE_AUTO, |
but = hildon_button_new_with_text(HILDON_SIZE_AUTO, |
1466 |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1467 |
_("Export Field Notes"), |
_("Export Field Notes"), |
1468 |
_("Write a Garmin Field Notes file")); |
_("Save a Garmin Field Notes file")); |
1469 |
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), but); |
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(context.dialog)->vbox), but); |
1470 |
|
g_signal_connect_swapped(but, "clicked", |
1471 |
|
G_CALLBACK(on_export_notes_log_clicked), &context); |
1472 |
|
|
1473 |
|
|
1474 |
but = hildon_button_new_with_text(HILDON_SIZE_AUTO, |
but = hildon_button_new_with_text(HILDON_SIZE_AUTO, |
1475 |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1476 |
_("Export Garmin GPX"), |
_("Export Garmin GPX"), |
1477 |
_("Write GPX file of modified points")); |
_("Save a GPX file of modified points")); |
1478 |
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), but); |
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(context.dialog)->vbox), but); |
1479 |
|
g_signal_connect_swapped(but, "clicked", |
1480 |
|
G_CALLBACK(on_export_garmin_clicked), &context); |
1481 |
|
|
1482 |
#if 0 |
gtk_widget_show_all(context.dialog); |
1483 |
g_signal_connect_swapped (dialog, |
gint result = gtk_dialog_run(GTK_DIALOG(context.dialog)); |
1484 |
"response", |
|
1485 |
G_CALLBACK (gtk_widget_destroy), |
/* user clicked outside dialog */ |
1486 |
dialog); |
if(result == GTK_RESPONSE_DELETE_EVENT) |
1487 |
#endif |
gtk_widget_destroy(context.dialog); |
1488 |
|
} |
1489 |
|
|
1490 |
|
void on_tools_geomath_clicked(appmenu_context_t *context) { |
1491 |
|
gtk_widget_destroy(context->dialog); |
1492 |
|
while(gtk_events_pending()) |
1493 |
|
gtk_main_iteration(); |
1494 |
|
|
1495 |
|
geomath_dialog(context->appdata); |
1496 |
|
} |
1497 |
|
|
1498 |
|
void on_tools_geotext_clicked(appmenu_context_t *context) { |
1499 |
|
gtk_widget_destroy(context->dialog); |
1500 |
|
while(gtk_events_pending()) |
1501 |
|
gtk_main_iteration(); |
1502 |
|
|
1503 |
|
geotext_dialog(context->appdata); |
1504 |
|
} |
1505 |
|
|
1506 |
|
void on_tools_precpos_clicked(appmenu_context_t *context) { |
1507 |
|
gtk_widget_destroy(context->dialog); |
1508 |
|
while(gtk_events_pending()) |
1509 |
|
gtk_main_iteration(); |
1510 |
|
|
1511 |
|
precise_position(context->appdata); |
1512 |
|
} |
1513 |
|
|
1514 |
|
void on_tools_clicked(GtkButton *button, appdata_t *appdata) { |
1515 |
|
GtkWidget *but; |
1516 |
|
appmenu_context_t context; |
1517 |
|
|
1518 |
|
context.appdata = appdata; |
1519 |
|
context.dialog = gtk_dialog_new(); |
1520 |
|
|
1521 |
|
gtk_window_set_decorated(GTK_WINDOW(context.dialog), FALSE); |
1522 |
|
|
1523 |
|
but = hildon_button_new_with_text(HILDON_SIZE_AUTO, |
1524 |
|
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1525 |
|
_("Geomath"), |
1526 |
|
_("Geocoordinate calculation")); |
1527 |
|
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(context.dialog)->vbox), but); |
1528 |
|
g_signal_connect_swapped(but, "clicked", |
1529 |
|
G_CALLBACK(on_tools_geomath_clicked), &context); |
1530 |
|
|
1531 |
|
but = hildon_button_new_with_text(HILDON_SIZE_AUTO, |
1532 |
|
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1533 |
|
_("Geotext"), |
1534 |
|
_("Text analysis, letter counting etc")); |
1535 |
|
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(context.dialog)->vbox), but); |
1536 |
|
g_signal_connect_swapped(but, "clicked", |
1537 |
|
G_CALLBACK(on_tools_geotext_clicked), &context); |
1538 |
|
|
1539 |
|
|
1540 |
gtk_widget_show_all (dialog); |
but = hildon_button_new_with_text(HILDON_SIZE_AUTO, |
1541 |
gint result = gtk_dialog_run(GTK_DIALOG(dialog)); |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1542 |
gtk_widget_destroy(dialog); |
_("Precise Position"), |
1543 |
|
_("Calculate a very precise GPS posotions")); |
1544 |
|
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(context.dialog)->vbox), but); |
1545 |
|
g_signal_connect_swapped(but, "clicked", |
1546 |
|
G_CALLBACK(on_tools_precpos_clicked), &context); |
1547 |
|
|
1548 |
|
gtk_widget_show_all(context.dialog); |
1549 |
|
gint result = gtk_dialog_run(GTK_DIALOG(context.dialog)); |
1550 |
|
|
1551 |
|
/* user clicked outside dialog */ |
1552 |
|
if(result == GTK_RESPONSE_DELETE_EVENT) |
1553 |
|
gtk_widget_destroy(context.dialog); |
1554 |
} |
} |
1555 |
|
|
1556 |
HildonAppMenu *menu_create(appdata_t *appdata, int mode) { |
HildonAppMenu *menu_create(appdata_t *appdata, int mode) { |
1575 |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1576 |
} |
} |
1577 |
|
|
|
#if 0 |
|
|
if(mode == MENU_GPXLIST || mode == MENU_CACHELIST) { |
|
|
button = gtk_button_new_with_label(_("Export to Mapper")); |
|
|
g_signal_connect_after(button, "clicked", |
|
|
G_CALLBACK(cb_menu_export_mmpoi), appdata); |
|
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
|
|
} |
|
|
|
|
|
if(mode == MENU_GPXLIST) { |
|
|
button = gtk_button_new_with_label(_("Export Field Notes")); |
|
|
g_signal_connect_after(button, "clicked", |
|
|
G_CALLBACK(cb_menu_export_log), appdata); |
|
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
|
|
|
|
|
button = gtk_button_new_with_label(_("Export Garmin GPX")); |
|
|
g_signal_connect_after(button, "clicked", |
|
|
G_CALLBACK(cb_menu_export_garmin), appdata); |
|
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
|
|
|
|
|
button = gtk_button_new_with_label(_("Search")); |
|
|
g_signal_connect_after(button, "clicked", |
|
|
G_CALLBACK(cb_menu_search), appdata); |
|
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
|
|
} |
|
|
#else |
|
|
|
|
1578 |
if(mode == MENU_GPXLIST) { |
if(mode == MENU_GPXLIST) { |
1579 |
button = gtk_button_new_with_label(_("Export")); |
button = gtk_button_new_with_label(_("Export")); |
1580 |
g_signal_connect_after(button, "clicked", |
g_signal_connect_after(button, "clicked", |
1587 |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1588 |
} |
} |
1589 |
|
|
1590 |
#endif |
button = gtk_button_new_with_label(_("Tools")); |
1591 |
|
g_signal_connect_after(button, "clicked", |
1592 |
|
G_CALLBACK(on_tools_clicked), appdata); |
1593 |
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1594 |
|
|
1595 |
button = gtk_button_new_with_label(_("About")); |
button = gtk_button_new_with_label(_("About")); |
1596 |
g_signal_connect_after(button, "clicked", |
g_signal_connect_after(button, "clicked", |
1602 |
return menu; |
return menu; |
1603 |
} |
} |
1604 |
#else |
#else |
1605 |
|
static void |
1606 |
|
cb_menu_export_log(GtkWidget *widget, gpointer data) { |
1607 |
|
appdata_t *appdata = (appdata_t*)data; |
1608 |
|
notes_log_export(appdata); |
1609 |
|
} |
1610 |
|
|
1611 |
|
#ifdef USE_MAEMO |
1612 |
|
static void |
1613 |
|
cb_menu_export_mmpoi(GtkWidget *widget, gpointer data) { |
1614 |
|
appdata_t *appdata = (appdata_t*)data; |
1615 |
|
mmpoi_export(appdata); |
1616 |
|
} |
1617 |
|
#endif |
1618 |
|
|
1619 |
|
static void |
1620 |
|
cb_menu_export_garmin(GtkWidget *widget, gpointer data) { |
1621 |
|
appdata_t *appdata = (appdata_t*)data; |
1622 |
|
garmin_export(appdata); |
1623 |
|
} |
1624 |
|
|
1625 |
|
static void |
1626 |
|
cb_menu_geomath(GtkWidget *window, gpointer data) { |
1627 |
|
geomath_dialog((appdata_t *)data); |
1628 |
|
} |
1629 |
|
|
1630 |
|
static void |
1631 |
|
cb_menu_geotext(GtkWidget *window, gpointer data) { |
1632 |
|
geotext_dialog((appdata_t *)data); |
1633 |
|
} |
1634 |
|
|
1635 |
|
static void |
1636 |
|
cb_menu_precpos(GtkWidget *window, gpointer data) { |
1637 |
|
precise_position((appdata_t *)data); |
1638 |
|
} |
1639 |
|
|
1640 |
void menu_create(appdata_t *appdata) { |
void menu_create(appdata_t *appdata) { |
1641 |
GtkWidget *menu, *item; |
GtkWidget *menu, *item; |
1642 |
menu = gtk_menu_new(); |
menu = gtk_menu_new(); |