138 |
gtk_widget_show_all (GTK_WIDGET(dialog)); |
gtk_widget_show_all (GTK_WIDGET(dialog)); |
139 |
if (gtk_dialog_run (GTK_DIALOG(dialog)) == GTK_FM_OK) { |
if (gtk_dialog_run (GTK_DIALOG(dialog)) == GTK_FM_OK) { |
140 |
char *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); |
char *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog)); |
141 |
|
|
142 |
|
if(filename) { |
143 |
|
gpx_dialog_t *dialog = gpx_busy_dialog_new(GTK_WIDGET(appdata->window)); |
144 |
|
|
145 |
gpx_dialog_t *dialog = gpx_busy_dialog_new(GTK_WIDGET(appdata->window)); |
if(!whole_dir) |
146 |
|
gpx = gpx_parse(dialog, filename); |
147 |
if(!whole_dir) |
else { |
148 |
gpx = gpx_parse(dialog, filename); |
/* cur trailing '/' if present */ |
149 |
else { |
if(strlastchr(filename) == '/') |
150 |
/* cur trailing '/' if present */ |
filename[strlen(filename)] = 0; |
151 |
if(strlastchr(filename) == '/') |
|
152 |
filename[strlen(filename)] = 0; |
gpx = gpx_parse_dir(dialog, filename); |
|
|
|
|
gpx = gpx_parse_dir(dialog, filename); |
|
|
} |
|
|
|
|
|
gpx_busy_dialog_destroy(dialog); |
|
|
|
|
|
/* save path if gpx was successfully loaded */ |
|
|
if(gpx) { |
|
|
char *r = strrchr(filename, '/'); |
|
|
|
|
|
/* there is a delimiter, use everything left of it as path */ |
|
|
if(r && !whole_dir) { |
|
|
*r = 0; |
|
|
if(appdata->path) free(appdata->path); |
|
|
appdata->path = strdup(filename); |
|
|
/* restore path ... just in case ... */ |
|
|
*r = '/'; |
|
153 |
} |
} |
154 |
|
|
155 |
|
gpx_busy_dialog_destroy(dialog); |
156 |
|
|
157 |
|
/* save path if gpx was successfully loaded */ |
158 |
|
if(gpx) { |
159 |
|
char *r = strrchr(filename, '/'); |
160 |
|
|
161 |
|
/* there is a delimiter, use everything left of it as path */ |
162 |
|
if(r && !whole_dir) { |
163 |
|
*r = 0; |
164 |
|
if(appdata->path) free(appdata->path); |
165 |
|
appdata->path = strdup(filename); |
166 |
|
/* restore path ... just in case ... */ |
167 |
|
*r = '/'; |
168 |
|
} |
169 |
|
|
170 |
|
if(whole_dir) |
171 |
|
appdata->path = strdup(filename); |
172 |
|
} else |
173 |
|
errorf(_("Load error")); |
174 |
|
|
175 |
if(whole_dir) |
g_free (filename); |
176 |
appdata->path = strdup(filename); |
} else { |
177 |
|
#ifndef USE_MAEMO |
178 |
|
errorf(_("Error accessing the file.")); |
179 |
|
#else |
180 |
|
errorf(_("Error accessing the file. This may happen if the file " |
181 |
|
"resides on a remote file system. Please copy the file onto " |
182 |
|
"the device (e.g. onto the memory card) and try again.")); |
183 |
|
#endif |
184 |
} |
} |
|
|
|
|
g_free (filename); |
|
185 |
} |
} |
186 |
|
|
187 |
gtk_widget_destroy (dialog); |
gtk_widget_destroy (dialog); |
346 |
|
|
347 |
if(appdata->cachelist_update) |
if(appdata->cachelist_update) |
348 |
cachelist_redraw(appdata); |
cachelist_redraw(appdata); |
349 |
|
|
350 |
#endif |
#endif |
351 |
|
|
352 |
return TRUE; |
return TRUE; |
981 |
GtkTreeIter iter; |
GtkTreeIter iter; |
982 |
gtk_list_store_append(appdata->gpxstore, &iter); |
gtk_list_store_append(appdata->gpxstore, &iter); |
983 |
gpxlist_set(appdata->gpxstore, &iter, gpx); |
gpxlist_set(appdata->gpxstore, &iter, gpx); |
984 |
|
|
985 |
if(gpx == sel_gpx) { |
if(gpx == sel_gpx) { |
986 |
sel_iter = iter; |
sel_iter = iter; |
987 |
sel_iter_valid = TRUE; |
sel_iter_valid = TRUE; |
1089 |
|
|
1090 |
GtkWidget *hbox = gtk_hbox_new(FALSE, 8); |
GtkWidget *hbox = gtk_hbox_new(FALSE, 8); |
1091 |
gtk_box_pack_start(GTK_BOX(hbox), |
gtk_box_pack_start(GTK_BOX(hbox), |
1092 |
gtk_label_new(_("Do you you ĺike GPXView?")), |
gtk_label_new(_("Do you like GPXView?")), |
1093 |
FALSE, FALSE, 0); |
FALSE, FALSE, 0); |
1094 |
|
|
1095 |
GtkWidget *button = gtk_button_new(); |
GtkWidget *button = gtk_button_new(); |
1553 |
notes_log_export(appdata); |
notes_log_export(appdata); |
1554 |
} |
} |
1555 |
|
|
1556 |
#ifdef USE_MAEMO |
#ifdef ENABLE_MAEMO_MAPPER |
1557 |
static void |
static void |
1558 |
cb_menu_export_mmpoi(GtkWidget *widget, gpointer data) { |
cb_menu_export_mmpoi(GtkWidget *widget, gpointer data) { |
1559 |
appdata_t *appdata = (appdata_t*)data; |
appdata_t *appdata = (appdata_t*)data; |
1672 |
} |
} |
1673 |
|
|
1674 |
static const menu_entry_t submenu_export_entries[] = { |
static const menu_entry_t submenu_export_entries[] = { |
1675 |
|
#ifdef ENABLE_MAEMO_MAPPER |
1676 |
{ "Export to Maemo Mapper" , "Save a Maemo Mapper POI file", |
{ "Export to Maemo Mapper" , "Save a Maemo Mapper POI file", |
1677 |
G_CALLBACK(cb_menu_export_mmpoi) }, |
G_CALLBACK(cb_menu_export_mmpoi) }, |
1678 |
|
#endif |
1679 |
{ "Export Field Notes", "Save a Garmin Field Notes file", |
{ "Export Field Notes", "Save a Garmin Field Notes file", |
1680 |
G_CALLBACK(cb_menu_export_log) }, |
G_CALLBACK(cb_menu_export_log) }, |
1681 |
{ "Export Garmin GPX", "Save modified waypoints in GPX file", |
{ "Export Garmin GPX", "Save modified waypoints in GPX file", |
1762 |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
1763 |
|
|
1764 |
#ifdef ENABLE_OSM_GPS_MAP |
#ifdef ENABLE_OSM_GPS_MAP |
|
if((mode == MENU_GPXLIST) || (mode == MENU_CACHELIST)) { |
|
1765 |
button = gtk_button_new_with_label(_("Map")); |
button = gtk_button_new_with_label(_("Map")); |
1766 |
g_signal_connect_after(button, "clicked", |
g_signal_connect_after(button, "clicked", |
1767 |
G_CALLBACK(cb_menu_map), appdata); |
G_CALLBACK(cb_menu_map), appdata); |
1768 |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
hildon_app_menu_append(menu, GTK_BUTTON(button)); |
|
} |
|
1769 |
#endif |
#endif |
1770 |
|
|
1771 |
#ifdef HILDON_HELP |
#ifdef HILDON_HELP |
1823 |
submenu = gtk_menu_new(); |
submenu = gtk_menu_new(); |
1824 |
gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu); |
gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu); |
1825 |
|
|
1826 |
#ifdef USE_MAEMO |
#ifdef ENABLE_MAEMO_MAPPER |
1827 |
item = gtk_menu_item_new_with_label( _("Maemo Mapper POI") ); |
item = gtk_menu_item_new_with_label( _("Maemo Mapper POI") ); |
1828 |
gtk_menu_append(GTK_MENU_SHELL(submenu), item); |
gtk_menu_append(GTK_MENU_SHELL(submenu), item); |
1829 |
g_signal_connect(item, "activate", |
g_signal_connect(item, "activate", |
1880 |
|
|
1881 |
gtk_menu_append(GTK_MENU_SHELL(menu), gtk_separator_menu_item_new()); |
gtk_menu_append(GTK_MENU_SHELL(menu), gtk_separator_menu_item_new()); |
1882 |
|
|
|
item = gtk_menu_item_new_with_label(_("Tools")); |
|
|
gtk_menu_append(GTK_MENU_SHELL(menu), item); |
|
|
submenu = gtk_menu_new(); |
|
|
gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu); |
|
|
|
|
1883 |
#ifdef ENABLE_OSM_GPS_MAP |
#ifdef ENABLE_OSM_GPS_MAP |
1884 |
item = gtk_menu_item_new_with_label( _("Map") ); |
item = gtk_menu_item_new_with_label( _("Map") ); |
1885 |
gtk_menu_append(GTK_MENU_SHELL(submenu), item); |
gtk_menu_append(GTK_MENU_SHELL(menu), item); |
1886 |
g_signal_connect(item, "activate", |
g_signal_connect(item, "activate", |
1887 |
GTK_SIGNAL_FUNC(cb_menu_map), appdata); |
GTK_SIGNAL_FUNC(cb_menu_map), appdata); |
1888 |
#endif |
#endif |
1889 |
|
|
1890 |
|
item = gtk_menu_item_new_with_label(_("Tools")); |
1891 |
|
gtk_menu_append(GTK_MENU_SHELL(menu), item); |
1892 |
|
submenu = gtk_menu_new(); |
1893 |
|
gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu); |
1894 |
|
|
1895 |
item = gtk_menu_item_new_with_label( _("Geomath") ); |
item = gtk_menu_item_new_with_label( _("Geomath") ); |
1896 |
gtk_menu_append(GTK_MENU_SHELL(submenu), item); |
gtk_menu_append(GTK_MENU_SHELL(submenu), item); |
1897 |
g_signal_connect(item, "activate", |
g_signal_connect(item, "activate", |
2287 |
fprintf(stderr, "error initiating osso context\n"); |
fprintf(stderr, "error initiating osso context\n"); |
2288 |
} |
} |
2289 |
|
|
2290 |
|
#ifdef ENABLE_MAEMO_MAPPER |
2291 |
dbus_register(&appdata); |
dbus_register(&appdata); |
2292 |
#endif |
#endif |
2293 |
|
#endif |
2294 |
|
|
2295 |
icons_init(); |
icons_init(); |
2296 |
|
|