551 |
gtk_container_add(GTK_CONTAINER(window), |
gtk_container_add(GTK_CONTAINER(window), |
552 |
cachelist_create(appdata, gpx, NULL)); |
cachelist_create(appdata, gpx, NULL)); |
553 |
|
|
554 |
|
hildon_window_set_app_menu(HILDON_WINDOW(window), |
555 |
|
menu_create(appdata, MENU_CACHELIST)); |
556 |
|
|
557 |
gtk_widget_show_all(window); |
gtk_widget_show_all(window); |
558 |
} |
} |
559 |
#endif |
#endif |
1450 |
garmin_export(appdata); |
garmin_export(appdata); |
1451 |
} |
} |
1452 |
|
|
1453 |
|
#ifdef USE_STACKABLE_WINDOW |
1454 |
|
void on_export_clicked(GtkButton *button, appdata_t *appdata) { |
1455 |
|
GtkWidget *but, *dialog = gtk_dialog_new(); |
1456 |
|
|
1457 |
|
gtk_window_set_title(GTK_WINDOW(dialog), _("Export")); |
1458 |
|
|
1459 |
|
but = hildon_button_new_with_text(HILDON_SIZE_AUTO, |
1460 |
|
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1461 |
|
_("Export to Maemo Mapper"), |
1462 |
|
_("Write a Maemo Mapper POI file")); |
1463 |
|
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), but); |
1464 |
|
|
1465 |
|
|
1466 |
|
but = hildon_button_new_with_text(HILDON_SIZE_AUTO, |
1467 |
|
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1468 |
|
_("Export Field Notes"), |
1469 |
|
_("Write a Garmin Field Notes file")); |
1470 |
|
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), but); |
1471 |
|
|
1472 |
|
|
1473 |
|
but = hildon_button_new_with_text(HILDON_SIZE_AUTO, |
1474 |
|
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1475 |
|
_("Export Garmin GPX"), |
1476 |
|
_("Write GPX file of modified points")); |
1477 |
|
gtk_container_add(GTK_CONTAINER(GTK_DIALOG(dialog)->vbox), but); |
1478 |
|
|
1479 |
|
|
1480 |
|
#if 0 |
1481 |
|
g_signal_connect_swapped (dialog, |
1482 |
|
"response", |
1483 |
|
G_CALLBACK (gtk_widget_destroy), |
1484 |
|
dialog); |
1485 |
|
#endif |
1486 |
|
|
1487 |
|
gtk_widget_show_all (dialog); |
1488 |
|
gint result = gtk_dialog_run(GTK_DIALOG(dialog)); |
1489 |
|
gtk_widget_destroy(dialog); |
1490 |
|
} |
1491 |
|
|
1492 |
|
HildonAppMenu *menu_create(appdata_t *appdata, int mode) { |
1493 |
|
GtkWidget *button; |
1494 |
|
HildonAppMenu *menu = HILDON_APP_MENU(hildon_app_menu_new()); |
1495 |
|
|
1496 |
|
/* ------- */ |
1497 |
|
button = gtk_button_new_with_label(_("Settings")); |
1498 |
|
g_signal_connect_after(button, "clicked", G_CALLBACK(cb_menu_settings), |
1499 |
|
appdata); |
1500 |
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1501 |
|
|
1502 |
|
if(mode == MENU_GPXLIST) { |
1503 |
|
button = gtk_button_new_with_label(_("Import file")); |
1504 |
|
g_signal_connect_after(button, "clicked", |
1505 |
|
G_CALLBACK(cb_menu_add), appdata); |
1506 |
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1507 |
|
|
1508 |
|
button = gtk_button_new_with_label(_("Import dir")); |
1509 |
|
g_signal_connect_after(button, "clicked", |
1510 |
|
G_CALLBACK(cb_menu_adddir), appdata); |
1511 |
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1512 |
|
} |
1513 |
|
|
1514 |
|
#if 0 |
1515 |
|
if(mode == MENU_GPXLIST || mode == MENU_CACHELIST) { |
1516 |
|
button = gtk_button_new_with_label(_("Export to Mapper")); |
1517 |
|
g_signal_connect_after(button, "clicked", |
1518 |
|
G_CALLBACK(cb_menu_export_mmpoi), appdata); |
1519 |
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1520 |
|
} |
1521 |
|
|
1522 |
|
if(mode == MENU_GPXLIST) { |
1523 |
|
button = gtk_button_new_with_label(_("Export Field Notes")); |
1524 |
|
g_signal_connect_after(button, "clicked", |
1525 |
|
G_CALLBACK(cb_menu_export_log), appdata); |
1526 |
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1527 |
|
|
1528 |
|
button = gtk_button_new_with_label(_("Export Garmin GPX")); |
1529 |
|
g_signal_connect_after(button, "clicked", |
1530 |
|
G_CALLBACK(cb_menu_export_garmin), appdata); |
1531 |
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1532 |
|
|
1533 |
|
button = gtk_button_new_with_label(_("Search")); |
1534 |
|
g_signal_connect_after(button, "clicked", |
1535 |
|
G_CALLBACK(cb_menu_search), appdata); |
1536 |
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1537 |
|
} |
1538 |
|
#else |
1539 |
|
|
1540 |
|
if(mode == MENU_GPXLIST) { |
1541 |
|
button = gtk_button_new_with_label(_("Export")); |
1542 |
|
g_signal_connect_after(button, "clicked", |
1543 |
|
G_CALLBACK(on_export_clicked), appdata); |
1544 |
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1545 |
|
|
1546 |
|
button = gtk_button_new_with_label(_("Search")); |
1547 |
|
g_signal_connect_after(button, "clicked", |
1548 |
|
G_CALLBACK(cb_menu_search), appdata); |
1549 |
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1550 |
|
} |
1551 |
|
|
1552 |
|
#endif |
1553 |
|
|
1554 |
|
button = gtk_button_new_with_label(_("About")); |
1555 |
|
g_signal_connect_after(button, "clicked", |
1556 |
|
G_CALLBACK(cb_menu_about), appdata); |
1557 |
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1558 |
|
|
1559 |
|
gtk_widget_show(GTK_WIDGET(menu)); |
1560 |
|
|
1561 |
|
return menu; |
1562 |
|
} |
1563 |
|
#else |
1564 |
void menu_create(appdata_t *appdata) { |
void menu_create(appdata_t *appdata) { |
1565 |
GtkWidget *menu, *item; |
GtkWidget *menu, *item; |
1566 |
menu = gtk_menu_new(); |
menu = gtk_menu_new(); |
1567 |
|
|
1568 |
#ifdef USE_MAEMO |
#ifdef USE_BREAD_CRUMB_TRAIL |
1569 |
appdata->menu_import = |
appdata->menu_import = |
1570 |
#endif |
#endif |
1571 |
item = gtk_menu_item_new_with_label(_("Import")); |
item = gtk_menu_item_new_with_label(_("Import")); |
1595 |
g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_remove), appdata); |
g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_remove), appdata); |
1596 |
#endif |
#endif |
1597 |
|
|
1598 |
#ifdef USE_MAEMO |
#ifdef USE_BREAD_CRUMB_TRAIL |
1599 |
appdata->menu_export = |
appdata->menu_export = |
1600 |
#endif |
#endif |
1601 |
item = gtk_menu_item_new_with_label(_("Export")); |
item = gtk_menu_item_new_with_label(_("Export")); |
1620 |
g_signal_connect(item, "activate", |
g_signal_connect(item, "activate", |
1621 |
GTK_SIGNAL_FUNC(cb_menu_export_garmin), appdata); |
GTK_SIGNAL_FUNC(cb_menu_export_garmin), appdata); |
1622 |
|
|
1623 |
#ifdef USE_MAEMO |
#ifdef USE_BREAD_CRUMB_TRAIL |
1624 |
appdata->menu_search = |
appdata->menu_search = |
1625 |
#endif |
#endif |
1626 |
item = gtk_menu_item_new_with_label( _("Search...") ); |
item = gtk_menu_item_new_with_label( _("Search...") ); |
1653 |
g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_paste), appdata); |
g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_paste), appdata); |
1654 |
#endif |
#endif |
1655 |
|
|
1656 |
item = gtk_menu_item_new_with_label( _("Settings...") ); |
item = gtk_menu_item_new_with_label( _("Settings") ); |
1657 |
gtk_menu_append(GTK_MENU_SHELL(menu), item); |
gtk_menu_append(GTK_MENU_SHELL(menu), item); |
1658 |
g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_settings), |
g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_settings), |
1659 |
appdata); |
appdata); |
1714 |
gtk_box_pack_start(GTK_BOX(appdata->vbox), menu_bar, 0, 0, 0); |
gtk_box_pack_start(GTK_BOX(appdata->vbox), menu_bar, 0, 0, 0); |
1715 |
#endif |
#endif |
1716 |
} |
} |
1717 |
|
#endif |
1718 |
|
|
1719 |
/********************* end of menu **********************/ |
/********************* end of menu **********************/ |
1720 |
|
|
2083 |
appdata.vbox = gtk_vbox_new(FALSE, 2); |
appdata.vbox = gtk_vbox_new(FALSE, 2); |
2084 |
gtk_container_add(GTK_CONTAINER(appdata.window), appdata.vbox); |
gtk_container_add(GTK_CONTAINER(appdata.window), appdata.vbox); |
2085 |
|
|
2086 |
|
#ifndef USE_STACKABLE_WINDOW |
2087 |
menu_create(&appdata); |
menu_create(&appdata); |
2088 |
|
#else |
2089 |
|
hildon_window_set_app_menu(HILDON_WINDOW(appdata.window), |
2090 |
|
menu_create(&appdata, MENU_GPXLIST)); |
2091 |
|
#endif |
2092 |
|
|
2093 |
#ifdef USE_BREAD_CRUMB_TRAIL |
#ifdef USE_BREAD_CRUMB_TRAIL |
2094 |
appdata.bct = hildon_bread_crumb_trail_new(); |
appdata.bct = hildon_bread_crumb_trail_new(); |