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) { |
1435 |
garmin_export(appdata); |
garmin_export(appdata); |
1436 |
} |
} |
1437 |
|
|
1438 |
|
static void |
1439 |
|
cb_menu_geomath(GtkWidget *window, gpointer data) { |
1440 |
|
geomath_dialog((appdata_t *)data); |
1441 |
|
} |
1442 |
|
|
1443 |
|
static void |
1444 |
|
cb_menu_geotext(GtkWidget *window, gpointer data) { |
1445 |
|
geotext_dialog((appdata_t *)data); |
1446 |
|
} |
1447 |
|
|
1448 |
|
static void |
1449 |
|
cb_menu_precpos(GtkWidget *window, gpointer data) { |
1450 |
|
precise_position((appdata_t *)data); |
1451 |
|
} |
1452 |
|
|
1453 |
#ifdef USE_STACKABLE_WINDOW |
#ifdef USE_STACKABLE_WINDOW |
1454 |
|
|
1455 |
void on_export_clicked(GtkButton *button, appdata_t *appdata) { |
void on_export_clicked(GtkButton *button, appdata_t *appdata) { |
1456 |
GtkWidget *but, *dialog = gtk_dialog_new(); |
HildonStackableWindow *view_window; |
1457 |
|
GtkWidget *but; |
1458 |
|
|
1459 |
gtk_window_set_title(GTK_WINDOW(dialog), _("Export")); |
view_window = HILDON_STACKABLE_WINDOW (hildon_stackable_window_new ()); |
1460 |
|
gtk_window_set_title (GTK_WINDOW (view_window), "Export"); |
1461 |
|
|
1462 |
but = hildon_button_new_with_text(HILDON_SIZE_AUTO, |
GtkVBox *contents = GTK_VBOX(gtk_vbox_new (12, FALSE)); |
|
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
|
|
_("Export to Maemo Mapper"), |
|
|
_("Write a Maemo Mapper POI file")); |
|
|
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), but); |
|
|
|
|
1463 |
|
|
1464 |
but = hildon_button_new_with_text(HILDON_SIZE_AUTO, |
but = hildon_button_new_with_text( |
1465 |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
1466 |
_("Export Field Notes"), |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1467 |
_("Write a Garmin Field Notes file")); |
_("Export to Maemo Mapper"), |
1468 |
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), but); |
_("Save a Maemo Mapper POI file")); |
1469 |
|
g_signal_connect(but, "clicked", |
1470 |
|
G_CALLBACK(cb_menu_export_mmpoi), appdata); |
1471 |
|
gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0); |
1472 |
|
|
1473 |
|
|
1474 |
|
but = hildon_button_new_with_text( |
1475 |
|
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
1476 |
|
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1477 |
|
_("Export Field Notes"), |
1478 |
|
_("Save a Garmin Field Notes file")); |
1479 |
|
g_signal_connect(but, "clicked", |
1480 |
|
G_CALLBACK(cb_menu_export_log), appdata); |
1481 |
|
gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0); |
1482 |
|
|
1483 |
|
|
1484 |
but = hildon_button_new_with_text(HILDON_SIZE_AUTO, |
but = hildon_button_new_with_text( |
1485 |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
1486 |
_("Export Garmin GPX"), |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1487 |
_("Write GPX file of modified points")); |
_("Export Garmin GPX"), |
1488 |
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), but); |
_("Save a GPX file containing modified waypoints")); |
1489 |
|
g_signal_connect(but, "clicked", |
1490 |
|
G_CALLBACK(cb_menu_export_garmin), appdata); |
1491 |
|
gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0); |
1492 |
|
|
1493 |
|
gtk_container_add (GTK_CONTAINER (view_window), GTK_WIDGET (contents)); |
1494 |
|
gtk_widget_show_all (GTK_WIDGET (view_window)); |
1495 |
|
} |
1496 |
|
|
1497 |
|
void on_tools_clicked(GtkButton *button, appdata_t *appdata) { |
1498 |
|
HildonStackableWindow *view_window; |
1499 |
|
GtkWidget *but; |
1500 |
|
|
1501 |
|
view_window = HILDON_STACKABLE_WINDOW (hildon_stackable_window_new ()); |
1502 |
|
gtk_window_set_title (GTK_WINDOW (view_window), "Export"); |
1503 |
|
|
1504 |
|
GtkVBox *contents = GTK_VBOX(gtk_vbox_new (12, FALSE)); |
1505 |
|
|
1506 |
|
but = hildon_button_new_with_text( |
1507 |
|
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
1508 |
|
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1509 |
|
_("Geomath"), |
1510 |
|
_("Geocoordinate calculation")); |
1511 |
|
g_signal_connect(but, "clicked", |
1512 |
|
G_CALLBACK(cb_menu_geomath), appdata); |
1513 |
|
gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0); |
1514 |
|
|
1515 |
|
|
1516 |
|
but = hildon_button_new_with_text( |
1517 |
|
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
1518 |
|
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1519 |
|
_("Geotext"), |
1520 |
|
_("Text analysis, letter counting etc")); |
1521 |
|
g_signal_connect(but, "clicked", |
1522 |
|
G_CALLBACK(cb_menu_geotext), appdata); |
1523 |
|
gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0); |
1524 |
|
|
1525 |
|
|
1526 |
#if 0 |
but = hildon_button_new_with_text( |
1527 |
g_signal_connect_swapped (dialog, |
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
1528 |
"response", |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1529 |
G_CALLBACK (gtk_widget_destroy), |
_("Precise Position"), |
1530 |
dialog); |
_("Calculate a very precise GPS posotions")); |
1531 |
#endif |
g_signal_connect(but, "clicked", |
1532 |
|
G_CALLBACK(cb_menu_precpos), appdata); |
1533 |
|
gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0); |
1534 |
|
|
1535 |
gtk_widget_show_all (dialog); |
gtk_container_add (GTK_CONTAINER (view_window), GTK_WIDGET (contents)); |
1536 |
gint result = gtk_dialog_run(GTK_DIALOG(dialog)); |
gtk_widget_show_all (GTK_WIDGET (view_window)); |
|
gtk_widget_destroy(dialog); |
|
1537 |
} |
} |
1538 |
|
|
1539 |
HildonAppMenu *menu_create(appdata_t *appdata, int mode) { |
HildonAppMenu *menu_create(appdata_t *appdata, int mode) { |
1558 |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1559 |
} |
} |
1560 |
|
|
|
#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 |
|
|
|
|
1561 |
if(mode == MENU_GPXLIST) { |
if(mode == MENU_GPXLIST) { |
1562 |
button = gtk_button_new_with_label(_("Export")); |
button = gtk_button_new_with_label(_("Export")); |
1563 |
g_signal_connect_after(button, "clicked", |
g_signal_connect_after(button, "clicked", |
1570 |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1571 |
} |
} |
1572 |
|
|
1573 |
#endif |
button = gtk_button_new_with_label(_("Tools")); |
1574 |
|
g_signal_connect_after(button, "clicked", |
1575 |
|
G_CALLBACK(on_tools_clicked), appdata); |
1576 |
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1577 |
|
|
1578 |
button = gtk_button_new_with_label(_("About")); |
button = gtk_button_new_with_label(_("About")); |
1579 |
g_signal_connect_after(button, "clicked", |
g_signal_connect_after(button, "clicked", |
1585 |
return menu; |
return menu; |
1586 |
} |
} |
1587 |
#else |
#else |
1588 |
|
|
1589 |
void menu_create(appdata_t *appdata) { |
void menu_create(appdata_t *appdata) { |
1590 |
GtkWidget *menu, *item; |
GtkWidget *menu, *item; |
1591 |
menu = gtk_menu_new(); |
menu = gtk_menu_new(); |