811 |
gpx_busy_dialog_destroy(dialog); |
gpx_busy_dialog_destroy(dialog); |
812 |
} |
} |
813 |
#ifndef USE_BREAD_CRUMB_TRAIL |
#ifndef USE_BREAD_CRUMB_TRAIL |
814 |
|
#ifdef USE_STACKABLE_WINDOW |
815 |
if(!appdata->cur_gpx) |
if(!appdata->cur_gpx) |
816 |
|
#endif |
817 |
cachelist_dialog(appdata, gpx); |
cachelist_dialog(appdata, gpx); |
818 |
|
#ifdef USE_STACKABLE_WINDOW |
819 |
else |
else |
820 |
printf("selected gpx, but cachelist window already present\n"); |
printf("selected gpx, but cachelist window already present\n"); |
821 |
|
#endif |
822 |
#else |
#else |
823 |
gtk_container_remove(GTK_CONTAINER(appdata->vbox), appdata->cur_view); |
gtk_container_remove(GTK_CONTAINER(appdata->vbox), appdata->cur_view); |
824 |
appdata->cur_view = cachelist_create(appdata, gpx, NULL); |
appdata->cur_view = cachelist_create(appdata, gpx, NULL); |
1023 |
|
|
1024 |
gtk_about_dialog_set_name(about, "GPXView"); |
gtk_about_dialog_set_name(about, "GPXView"); |
1025 |
gtk_about_dialog_set_version(about, VERSION); |
gtk_about_dialog_set_version(about, VERSION); |
1026 |
gtk_about_dialog_set_copyright(about, |
|
1027 |
_("GPXView (c) 2008 by\n" |
#ifdef ENABLE_LIBLOCATION |
1028 |
"Till Harbaum <till@harbaum.org>\n" |
char *uses = "uses liblocation"; |
1029 |
"Geocaching.com: Tantil")); |
#elif defined(ENABLE_GPSBT) |
1030 |
|
char *uses = "uses gpsbt and gpsd"; |
1031 |
|
#else |
1032 |
|
char *uses = "uses gpsd"; |
1033 |
|
#endif |
1034 |
|
|
1035 |
|
char *str = g_strdup_printf("%s\n\n(%s)", |
1036 |
|
_("GPXView (c) 2008-2009 by\n" |
1037 |
|
"Till Harbaum <till@harbaum.org>\n" |
1038 |
|
"Mailing list: gpxview-users@garage.maemo.org"), |
1039 |
|
_(uses) |
1040 |
|
); |
1041 |
|
|
1042 |
|
gtk_about_dialog_set_copyright(about, str); |
1043 |
|
g_free(str); |
1044 |
|
|
1045 |
gtk_about_dialog_set_website(about, |
gtk_about_dialog_set_website(about, |
1046 |
_("http://www.harbaum.org/till/maemo")); |
_("http://www.harbaum.org/till/maemo")); |
1400 |
printf("Search for %s (flags = %x)...\n", p, appdata->search); |
printf("Search for %s (flags = %x)...\n", p, appdata->search); |
1401 |
|
|
1402 |
#ifndef USE_BREAD_CRUMB_TRAIL |
#ifndef USE_BREAD_CRUMB_TRAIL |
1403 |
appdata->search_results = |
gpx_t *found = |
1404 |
search_do(appdata, appdata->gpx, p, appdata->search, FALSE); |
search_do(appdata, appdata->gpx, p, appdata->search, FALSE); |
1405 |
|
|
1406 |
/* do search result dialog here ... */ |
/* do search result dialog here ... */ |
1407 |
cachelist_dialog(appdata, appdata->search_results); |
cachelist_dialog(appdata, found); |
1408 |
#ifndef USE_STACKABLE_WINDOW |
#ifndef USE_STACKABLE_WINDOW |
1409 |
search_result_free(appdata->search_results); |
search_result_free(found); |
1410 |
appdata->search_results = NULL; |
#else |
1411 |
|
appdata->search_results = found; |
1412 |
#endif |
#endif |
1413 |
#else |
#else |
1414 |
gpx_t *found = NULL; |
gpx_t *found = NULL; |
1525 |
} |
} |
1526 |
|
|
1527 |
#ifdef USE_STACKABLE_WINDOW |
#ifdef USE_STACKABLE_WINDOW |
1528 |
static void on_export_destroy(GtkWidget *widget, appdata_t *appdata) { |
static GtkWidget *export_menu_create(appdata_t *appdata) { |
1529 |
appdata->cur_view = g_object_get_data(G_OBJECT(widget), "cur_view"); |
GtkWidget *button; |
1530 |
} |
HildonAppMenu *menu = HILDON_APP_MENU(hildon_app_menu_new()); |
|
|
|
|
void on_export_clicked(GtkButton *button, appdata_t *appdata) { |
|
|
HildonStackableWindow *view_window; |
|
|
GtkWidget *but; |
|
|
|
|
|
view_window = HILDON_STACKABLE_WINDOW (hildon_stackable_window_new ()); |
|
|
gtk_window_set_title (GTK_WINDOW (view_window), "GPXView - Export"); |
|
|
|
|
|
/* store last "cur_view" in window */ |
|
|
g_object_set_data(G_OBJECT(view_window), "cur_view", appdata->cur_view); |
|
|
appdata->cur_view = NULL; |
|
|
|
|
|
g_signal_connect(G_OBJECT(view_window), "destroy", |
|
|
G_CALLBACK(on_export_destroy), appdata); |
|
|
|
|
|
GtkVBox *contents = GTK_VBOX(gtk_vbox_new (12, FALSE)); |
|
1531 |
|
|
1532 |
but = hildon_button_new_with_text( |
button = hildon_button_new_with_text( |
1533 |
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
1534 |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1535 |
_("Export to Maemo Mapper"), |
_("Export to Maemo Mapper"), |
1536 |
_("Save a Maemo Mapper POI file")); |
_("Save a Maemo Mapper POI file")); |
1537 |
g_signal_connect(but, "clicked", |
g_signal_connect_after(button, "clicked", |
1538 |
G_CALLBACK(cb_menu_export_mmpoi), appdata); |
G_CALLBACK(cb_menu_export_mmpoi), appdata); |
1539 |
gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0); |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
|
|
|
1540 |
|
|
1541 |
but = hildon_button_new_with_text( |
button = hildon_button_new_with_text( |
1542 |
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
1543 |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1544 |
_("Export Field Notes"), |
_("Export Field Notes"), |
1545 |
_("Save a Garmin Field Notes file")); |
_("Save a Garmin Field Notes file")); |
1546 |
g_signal_connect(but, "clicked", |
g_signal_connect_after(button, "clicked", |
1547 |
G_CALLBACK(cb_menu_export_log), appdata); |
G_CALLBACK(cb_menu_export_log), appdata); |
1548 |
gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0); |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
|
|
|
1549 |
|
|
1550 |
but = hildon_button_new_with_text( |
button = hildon_button_new_with_text( |
1551 |
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
1552 |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1553 |
_("Export Garmin GPX"), |
_("Export Garmin GPX"), |
1554 |
_("Save a GPX file containing modified waypoints")); |
_("Save modified waypoints in GPX file")); |
1555 |
g_signal_connect(but, "clicked", |
g_signal_connect_after(button, "clicked", |
1556 |
G_CALLBACK(cb_menu_export_garmin), appdata); |
G_CALLBACK(cb_menu_export_garmin), appdata); |
1557 |
gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0); |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1558 |
|
|
1559 |
gtk_container_add (GTK_CONTAINER (view_window), GTK_WIDGET (contents)); |
gtk_widget_show_all(GTK_WIDGET(menu)); |
|
gtk_widget_show_all (GTK_WIDGET (view_window)); |
|
|
} |
|
1560 |
|
|
1561 |
static void on_tools_destroy(GtkWidget *widget, appdata_t *appdata) { |
return GTK_WIDGET(menu); |
|
appdata->cur_view = g_object_get_data(G_OBJECT(widget), "cur_view"); |
|
1562 |
} |
} |
1563 |
|
|
1564 |
void on_tools_clicked(GtkButton *button, appdata_t *appdata) { |
/* the export submenu */ |
1565 |
HildonStackableWindow *view_window; |
void on_export_clicked(GtkButton *button, appdata_t *appdata) { |
1566 |
GtkWidget *but; |
if(!appdata->export_menu) |
1567 |
|
appdata->export_menu = export_menu_create(appdata); |
|
view_window = HILDON_STACKABLE_WINDOW (hildon_stackable_window_new ()); |
|
|
gtk_window_set_title (GTK_WINDOW (view_window), "GPXView - Tools"); |
|
1568 |
|
|
1569 |
/* store last "cur_view" in window */ |
/* draw a popup menu */ |
1570 |
g_object_set_data(G_OBJECT(view_window), "cur_view", appdata->cur_view); |
hildon_app_menu_popup(HILDON_APP_MENU(appdata->export_menu), |
1571 |
appdata->cur_view = NULL; |
GTK_WINDOW(hildon_window_stack_peek( |
1572 |
|
hildon_window_stack_get_default()))); |
1573 |
|
} |
1574 |
|
|
1575 |
g_signal_connect(G_OBJECT(view_window), "destroy", |
static GtkWidget *tools_menu_create(appdata_t *appdata) { |
1576 |
G_CALLBACK(on_tools_destroy), appdata); |
GtkWidget *button; |
1577 |
|
HildonAppMenu *menu = HILDON_APP_MENU(hildon_app_menu_new()); |
1578 |
|
|
1579 |
GtkVBox *contents = GTK_VBOX(gtk_vbox_new (12, FALSE)); |
/* the following doesn't have an effect */ |
1580 |
|
// gtk_window_set_title(GTK_WINDOW(menu), "Tools"); |
1581 |
|
|
1582 |
but = hildon_button_new_with_text( |
button = hildon_button_new_with_text( |
1583 |
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
1584 |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1585 |
_("Geomath"), |
_("Geomath"), |
1586 |
_("Geocoordinate calculation")); |
_("Geocoordinate calculation")); |
1587 |
g_signal_connect(but, "clicked", |
g_signal_connect_after(button, "clicked", |
1588 |
G_CALLBACK(cb_menu_geomath), appdata); |
G_CALLBACK(cb_menu_geomath), appdata); |
1589 |
gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0); |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1590 |
|
|
1591 |
|
|
1592 |
but = hildon_button_new_with_text( |
button = hildon_button_new_with_text( |
1593 |
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
1594 |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1595 |
_("Geotext"), |
_("Geotext"), |
1596 |
_("Text analysis, letter counting etc")); |
_("Text analysis")); |
1597 |
g_signal_connect(but, "clicked", |
g_signal_connect_after(button, "clicked", |
1598 |
G_CALLBACK(cb_menu_geotext), appdata); |
G_CALLBACK(cb_menu_geotext), appdata); |
1599 |
gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0); |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1600 |
|
|
1601 |
|
|
1602 |
but = hildon_button_new_with_text( |
button = hildon_button_new_with_text( |
1603 |
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH, |
1604 |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
HILDON_BUTTON_ARRANGEMENT_VERTICAL, |
1605 |
_("Precise Position"), |
_("Precise Position"), |
1606 |
_("Calculate a very precise GPS position")); |
_("Calculate a precise GPS position")); |
1607 |
g_signal_connect(but, "clicked", |
g_signal_connect_after(button, "clicked", |
1608 |
G_CALLBACK(cb_menu_precpos), appdata); |
G_CALLBACK(cb_menu_precpos), appdata); |
1609 |
gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0); |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1610 |
|
|
1611 |
|
gtk_widget_show_all(GTK_WIDGET(menu)); |
1612 |
|
|
1613 |
gtk_container_add (GTK_CONTAINER (view_window), GTK_WIDGET (contents)); |
return GTK_WIDGET(menu); |
|
gtk_widget_show_all (GTK_WIDGET (view_window)); |
|
1614 |
} |
} |
1615 |
|
|
1616 |
|
/* the tools submenu */ |
1617 |
|
void on_tools_clicked(GtkButton *button, appdata_t *appdata) { |
1618 |
|
if(!appdata->tools_menu) |
1619 |
|
appdata->tools_menu = tools_menu_create(appdata); |
1620 |
|
|
1621 |
|
/* draw a popup menu */ |
1622 |
|
hildon_app_menu_popup(HILDON_APP_MENU(appdata->tools_menu), |
1623 |
|
GTK_WINDOW(hildon_window_stack_peek( |
1624 |
|
hildon_window_stack_get_default()))); |
1625 |
|
} |
1626 |
|
|
1627 |
|
|
1628 |
HildonAppMenu *menu_create(appdata_t *appdata, int mode) { |
HildonAppMenu *menu_create(appdata_t *appdata, int mode) { |
1629 |
GtkWidget *button; |
GtkWidget *button; |
1630 |
HildonAppMenu *menu = HILDON_APP_MENU(hildon_app_menu_new()); |
HildonAppMenu *menu = HILDON_APP_MENU(hildon_app_menu_new()); |
1669 |
G_CALLBACK(on_tools_clicked), appdata); |
G_CALLBACK(on_tools_clicked), appdata); |
1670 |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1671 |
|
|
1672 |
gtk_widget_show(GTK_WIDGET(menu)); |
#ifdef HILDON_HELP |
1673 |
|
button = gtk_button_new_with_label(_("Help")); |
1674 |
|
g_signal_connect_after(button, "clicked", |
1675 |
|
G_CALLBACK(cb_menu_help), appdata); |
1676 |
|
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1677 |
|
#endif |
1678 |
|
|
1679 |
|
gtk_widget_show_all(GTK_WIDGET(menu)); |
1680 |
|
|
1681 |
return menu; |
return menu; |
1682 |
} |
} |
2204 |
gtk_window_set_default_size(GTK_WINDOW(appdata.window), 500, 300); |
gtk_window_set_default_size(GTK_WINDOW(appdata.window), 500, 300); |
2205 |
#endif |
#endif |
2206 |
|
|
2207 |
|
#if MAEMO_VERSION_MAJOR == 5 |
2208 |
gtk_window_set_title(GTK_WINDOW(appdata.window), "GPXView"); |
gtk_window_set_title(GTK_WINDOW(appdata.window), "GPXView"); |
2209 |
|
#endif |
2210 |
|
|
2211 |
g_signal_connect(G_OBJECT(appdata.window), "destroy", |
g_signal_connect(G_OBJECT(appdata.window), "destroy", |
2212 |
G_CALLBACK(on_window_destroy), &appdata); |
G_CALLBACK(on_window_destroy), &appdata); |
2213 |
|
|