19 |
#include <string.h> |
#include <string.h> |
20 |
#include <math.h> |
#include <math.h> |
21 |
|
|
22 |
|
#include <curl/curl.h> |
23 |
|
|
24 |
#include <time.h> |
#include <time.h> |
25 |
#include <sys/time.h> |
#include <sys/time.h> |
26 |
|
|
211 |
CACHELIST_NUM_COLS |
CACHELIST_NUM_COLS |
212 |
} ; |
} ; |
213 |
|
|
214 |
void cachelist_view_onRowActivated(GtkTreeView *treeview, |
void cachelist_goto_cache(appdata_t *appdata, cache_t *cache) { |
215 |
|
#if !defined(USE_BREAD_CRUMB_TRAIL) && !defined(BCT) |
216 |
|
cache_dialog(appdata, cache); |
217 |
|
#else |
218 |
|
gtk_container_remove(GTK_CONTAINER(appdata->vbox), appdata->cur_view); |
219 |
|
appdata->cur_view = cache_view(appdata, cache); |
220 |
|
gtk_box_pack_start_defaults(GTK_BOX(appdata->vbox), appdata->cur_view); |
221 |
|
gtk_widget_show_all(appdata->vbox); |
222 |
|
|
223 |
|
crumb_add(appdata, cache->name, CRUMB_CACHE, cache); |
224 |
|
#endif |
225 |
|
} |
226 |
|
|
227 |
|
static void cachelist_view_onRowActivated(GtkTreeView *treeview, |
228 |
GtkTreePath *path, |
GtkTreePath *path, |
229 |
GtkTreeViewColumn *col, |
GtkTreeViewColumn *col, |
230 |
gpointer userdata) { |
gpointer userdata) { |
241 |
if(gtk_tree_model_get_iter(model, &iter, path)) { |
if(gtk_tree_model_get_iter(model, &iter, path)) { |
242 |
cache_t *cache; |
cache_t *cache; |
243 |
gtk_tree_model_get(model, &iter, CACHELIST_COL_DATA, &cache, -1); |
gtk_tree_model_get(model, &iter, CACHELIST_COL_DATA, &cache, -1); |
244 |
#if !defined(USE_BREAD_CRUMB_TRAIL) && !defined(BCT) |
cachelist_goto_cache(appdata, cache); |
|
cache_dialog(appdata, cache); |
|
|
#else |
|
|
gtk_container_remove(GTK_CONTAINER(appdata->vbox), appdata->cur_view); |
|
|
appdata->cur_view = cache_view(appdata, cache); |
|
|
gtk_box_pack_start_defaults(GTK_BOX(appdata->vbox), appdata->cur_view); |
|
|
gtk_widget_show_all(appdata->vbox); |
|
|
|
|
|
crumb_add(appdata, cache->name, CRUMB_CACHE, cache); |
|
|
#endif |
|
245 |
} |
} |
246 |
} |
} |
247 |
|
|
730 |
gconf_save_closed_name(appdata, gpx->filename, gpx->name); |
gconf_save_closed_name(appdata, gpx->filename, gpx->name); |
731 |
} |
} |
732 |
|
|
733 |
|
void gpxlist_goto_cachelist(appdata_t *appdata, gpx_t *gpx) { |
734 |
|
#if !defined(USE_BREAD_CRUMB_TRAIL) && !defined(BCT) |
735 |
|
#ifdef USE_STACKABLE_WINDOW |
736 |
|
if(!appdata->cur_gpx) |
737 |
|
#endif |
738 |
|
cachelist_dialog(appdata, gpx); |
739 |
|
#ifdef USE_STACKABLE_WINDOW |
740 |
|
else |
741 |
|
printf("selected gpx, but cachelist window already present\n"); |
742 |
|
#endif |
743 |
|
#else |
744 |
|
gtk_container_remove(GTK_CONTAINER(appdata->vbox), appdata->cur_view); |
745 |
|
appdata->cur_view = cachelist_create(appdata, gpx, NULL); |
746 |
|
gtk_box_pack_start_defaults(GTK_BOX(appdata->vbox), appdata->cur_view); |
747 |
|
gtk_widget_show_all(appdata->vbox); |
748 |
|
|
749 |
|
crumb_add(appdata, gpx->name, CRUMB_CACHELIST, gpx); |
750 |
|
#endif |
751 |
|
} |
752 |
|
|
753 |
static void gpxlist_view_onRowActivated(GtkTreeView *treeview, |
static void gpxlist_view_onRowActivated(GtkTreeView *treeview, |
754 |
GtkTreePath *path, |
GtkTreePath *path, |
755 |
GtkTreeViewColumn *col, |
GtkTreeViewColumn *col, |
780 |
GtkWidget *dialog = gtk_message_dialog_new( |
GtkWidget *dialog = gtk_message_dialog_new( |
781 |
GTK_WINDOW(appdata->window), |
GTK_WINDOW(appdata->window), |
782 |
GTK_DIALOG_DESTROY_WITH_PARENT, |
GTK_DIALOG_DESTROY_WITH_PARENT, |
783 |
GTK_MESSAGE_QUESTION, GTK_BUTTONS_CANCEL, |
/* this doesn't fix the text selection issues ... */ |
784 |
|
#if defined(USE_MAEMO) && (MAEMO_VERSION_MAJOR >=5) |
785 |
|
GTK_MESSAGE_OTHER, |
786 |
|
#else |
787 |
|
GTK_MESSAGE_QUESTION, |
788 |
|
#endif |
789 |
|
GTK_BUTTONS_CANCEL, |
790 |
_("Do you want to close this entry only or do " |
_("Do you want to close this entry only or do " |
791 |
"you want to remove it completely from the list?")); |
"you want to remove it completely from the list?")); |
792 |
|
|
798 |
if(gpx->closed) |
if(gpx->closed) |
799 |
gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), 2, FALSE); |
gtk_dialog_set_response_sensitive(GTK_DIALOG(dialog), 2, FALSE); |
800 |
|
|
801 |
gtk_window_set_title(GTK_WINDOW(dialog), _("Remove entry?")); |
gtk_window_set_title(GTK_WINDOW(dialog), _("Close or remove entry?")); |
802 |
|
|
803 |
/* set the active flag again if the user answered "no" */ |
/* set the active flag again if the user answered "no" */ |
804 |
switch(gtk_dialog_run(GTK_DIALOG(dialog))) { |
switch(gtk_dialog_run(GTK_DIALOG(dialog))) { |
867 |
|
|
868 |
gpx_busy_dialog_destroy(dialog); |
gpx_busy_dialog_destroy(dialog); |
869 |
} |
} |
870 |
#if !defined(USE_BREAD_CRUMB_TRAIL) && !defined(BCT) |
|
871 |
#ifdef USE_STACKABLE_WINDOW |
gpxlist_goto_cachelist(appdata, gpx); |
|
if(!appdata->cur_gpx) |
|
|
#endif |
|
|
cachelist_dialog(appdata, gpx); |
|
|
#ifdef USE_STACKABLE_WINDOW |
|
|
else |
|
|
printf("selected gpx, but cachelist window already present\n"); |
|
|
#endif |
|
|
#else |
|
|
gtk_container_remove(GTK_CONTAINER(appdata->vbox), appdata->cur_view); |
|
|
appdata->cur_view = cachelist_create(appdata, gpx, NULL); |
|
|
gtk_box_pack_start_defaults(GTK_BOX(appdata->vbox), appdata->cur_view); |
|
|
gtk_widget_show_all(appdata->vbox); |
|
|
|
|
|
crumb_add(appdata, gpx->name, CRUMB_CACHELIST, gpx); |
|
|
#endif |
|
872 |
} |
} |
873 |
} |
} |
874 |
} |
} |
923 |
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(appdata->gpxview), |
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(appdata->gpxview), |
924 |
-1, "Icon", renderer, |
-1, "Icon", renderer, |
925 |
"pixbuf", GPXLIST_COL_ICON, |
"pixbuf", GPXLIST_COL_ICON, |
926 |
// "sensitive", GPXLIST_COL_OPEN, |
#ifdef USE_PANNABLE_AREA |
927 |
|
/* at least one entry needs to be sensitive. */ |
928 |
|
/* This is the delete icon if the PANNABLE_AREA is used */ |
929 |
|
"sensitive", GPXLIST_COL_OPEN, |
930 |
|
#endif |
931 |
NULL); |
NULL); |
932 |
|
|
933 |
/* --- "FileName" column --- */ |
/* --- "FileName" column --- */ |
983 |
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(appdata->gpxview), |
gtk_tree_view_insert_column_with_attributes(GTK_TREE_VIEW(appdata->gpxview), |
984 |
-1, "Del", renderer, |
-1, "Del", renderer, |
985 |
"pixbuf", GPXLIST_COL_DELETE, |
"pixbuf", GPXLIST_COL_DELETE, |
986 |
"sensitive", GPXLIST_COL_OPEN, |
// "sensitive", GPXLIST_COL_OPEN, |
987 |
NULL); |
NULL); |
988 |
#endif |
#endif |
989 |
|
|
1094 |
const gchar *authors[] = { |
const gchar *authors[] = { |
1095 |
"Till Harbaum <till@harbaum.org>", |
"Till Harbaum <till@harbaum.org>", |
1096 |
"John Stowers <john.stowers@gmail.com>", |
"John Stowers <john.stowers@gmail.com>", |
1097 |
|
"GCVote: Guido Wegener <guido.wegener@gmx.de>", |
1098 |
NULL }; |
NULL }; |
1099 |
|
|
1100 |
context.dialog = g_object_new(GTK_TYPE_ABOUT_DIALOG, |
context.dialog = g_object_new(GTK_TYPE_ABOUT_DIALOG, |
1303 |
else if(cache->long_description && (what & SEARCH_DESC) && |
else if(cache->long_description && (what & SEARCH_DESC) && |
1304 |
strcasestr(cache->long_description, phrase)) |
strcasestr(cache->long_description, phrase)) |
1305 |
hit = 1; |
hit = 1; |
1306 |
else if(cache->owner && (what & SEARCH_OWNER) && |
else if(cache->owner && cache->owner->name && (what & SEARCH_OWNER) && |
1307 |
strcasestr(cache->owner, phrase)) |
strcasestr(cache->owner->name, phrase)) |
1308 |
hit = 1; |
hit = 1; |
1309 |
|
|
1310 |
if(hit) { |
if(hit) { |
1872 |
|
|
1873 |
gtk_menu_append(GTK_MENU_SHELL(menu), gtk_separator_menu_item_new()); |
gtk_menu_append(GTK_MENU_SHELL(menu), gtk_separator_menu_item_new()); |
1874 |
|
|
|
#ifndef NO_COPY_N_PASTE |
|
1875 |
/* ----------- copy'n paste submenu ----------------- */ |
/* ----------- copy'n paste submenu ----------------- */ |
1876 |
appdata->clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); |
#ifndef NO_COPY_N_PASTE |
|
gtk_clipboard_set_can_store(appdata->clipboard, NULL, 0); |
|
|
|
|
1877 |
item = gtk_menu_item_new_with_label(_("Edit")); |
item = gtk_menu_item_new_with_label(_("Edit")); |
1878 |
gtk_menu_append(GTK_MENU_SHELL(menu), item); |
gtk_menu_append(GTK_MENU_SHELL(menu), item); |
1879 |
submenu = gtk_menu_new(); |
submenu = gtk_menu_new(); |
2298 |
|
|
2299 |
gtk_init (&argc, &argv); |
gtk_init (&argc, &argv); |
2300 |
|
|
2301 |
|
curl_global_init(CURL_GLOBAL_ALL); |
2302 |
|
|
2303 |
#ifdef USE_MAEMO |
#ifdef USE_MAEMO |
2304 |
printf("Installing osso context for \"org.harbaum." APP "\"\n"); |
printf("Installing osso context for \"org.harbaum." APP "\"\n"); |
2305 |
appdata.osso_context = osso_initialize("org.harbaum."APP, |
appdata.osso_context = osso_initialize("org.harbaum."APP, |
2348 |
g_signal_connect(G_OBJECT(appdata.window), "key_press_event", |
g_signal_connect(G_OBJECT(appdata.window), "key_press_event", |
2349 |
G_CALLBACK(on_window_key_press), &appdata); |
G_CALLBACK(on_window_key_press), &appdata); |
2350 |
|
|
2351 |
|
/* prepare clipboard */ |
2352 |
|
appdata.clipboard = gtk_clipboard_get(GDK_SELECTION_CLIPBOARD); |
2353 |
|
gtk_clipboard_set_can_store(appdata.clipboard, NULL, 0); |
2354 |
|
|
2355 |
appdata.vbox = gtk_vbox_new(FALSE, 2); |
appdata.vbox = gtk_vbox_new(FALSE, 2); |
2356 |
gtk_container_add(GTK_CONTAINER(appdata.window), appdata.vbox); |
gtk_container_add(GTK_CONTAINER(appdata.window), appdata.vbox); |
2357 |
#ifndef USE_STACKABLE_WINDOW |
#ifndef USE_STACKABLE_WINDOW |