71 |
gtk_widget_set_sensitive(context->but_remove, FALSE); |
gtk_widget_set_sensitive(context->but_remove, FALSE); |
72 |
} |
} |
73 |
|
|
74 |
#ifdef USE_MAEMO |
#ifdef ENABLE_MAEMO_MAPPER |
75 |
#include "dbus.h" |
#include "dbus.h" |
76 |
|
|
77 |
typedef struct { |
typedef struct { |
140 |
} else |
} else |
141 |
printf("location edit for Home\n"); |
printf("location edit for Home\n"); |
142 |
|
|
143 |
#ifdef USE_MAEMO |
#ifdef ENABLE_MAEMO_MAPPER |
144 |
mm_context_t mm_context; |
mm_context_t mm_context; |
145 |
#else |
#else |
146 |
GtkWidget *lat, *lon; |
GtkWidget *lat, *lon; |
159 |
if(loc) pos = loc->pos; |
if(loc) pos = loc->pos; |
160 |
else pos = context->appdata->home; |
else pos = context->appdata->home; |
161 |
|
|
162 |
|
/* avoid to use "nan" as the user will then not be displayed a nice */ |
163 |
|
/* preset value to alter */ |
164 |
|
if(isnan(pos.lat)) pos.lat = 0; |
165 |
|
if(isnan(pos.lon)) pos.lon = 0; |
166 |
|
|
167 |
gtk_table_attach_defaults(GTK_TABLE(table), |
gtk_table_attach_defaults(GTK_TABLE(table), |
168 |
label = gtk_label_new(_("Latitude:")), 0, 1, 1, 2); |
label = gtk_label_new(_("Latitude:")), 0, 1, 1, 2); |
169 |
gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); |
gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); |
170 |
#ifdef USE_MAEMO |
#ifdef ENABLE_MAEMO_MAPPER |
171 |
gtk_table_attach_defaults(GTK_TABLE(table), |
gtk_table_attach_defaults(GTK_TABLE(table), |
172 |
mm_context.lat = lat_entry_new(pos.lat), 1, 2, 1, 2); |
mm_context.lat = lat_entry_new(pos.lat), 1, 2, 1, 2); |
173 |
g_signal_connect(G_OBJECT(mm_context.lat), "changed", |
g_signal_connect(G_OBJECT(mm_context.lat), "changed", |
181 |
gtk_table_attach_defaults(GTK_TABLE(table), |
gtk_table_attach_defaults(GTK_TABLE(table), |
182 |
label = gtk_label_new(_("Longitude:")), 0, 1, 2, 3); |
label = gtk_label_new(_("Longitude:")), 0, 1, 2, 3); |
183 |
gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); |
gtk_misc_set_alignment(GTK_MISC(label), 1.f, 0.5f); |
184 |
#ifdef USE_MAEMO |
#ifdef ENABLE_MAEMO_MAPPER |
185 |
gtk_table_attach_defaults(GTK_TABLE(table), |
gtk_table_attach_defaults(GTK_TABLE(table), |
186 |
mm_context.lon = lon_entry_new(pos.lon), 1, 2, 2, 3); |
mm_context.lon = lon_entry_new(pos.lon), 1, 2, 2, 3); |
187 |
g_signal_connect(G_OBJECT(mm_context.lon), "changed", |
g_signal_connect(G_OBJECT(mm_context.lon), "changed", |
198 |
gtk_widget_set_sensitive(GTK_WIDGET(name), FALSE); |
gtk_widget_set_sensitive(GTK_WIDGET(name), FALSE); |
199 |
} |
} |
200 |
|
|
201 |
#ifdef USE_MAEMO |
#ifdef ENABLE_MAEMO_MAPPER |
202 |
mm_context.appdata = context->appdata; |
mm_context.appdata = context->appdata; |
203 |
if(loc) mm_context.pos = loc->pos; |
if(loc) mm_context.pos = loc->pos; |
204 |
else mm_context.pos = context->appdata->home; |
else mm_context.pos = context->appdata->home; |
230 |
if(GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) { |
if(GTK_RESPONSE_ACCEPT == gtk_dialog_run(GTK_DIALOG(dialog))) { |
231 |
pos_t pos; |
pos_t pos; |
232 |
|
|
233 |
#ifdef USE_MAEMO |
#ifdef ENABLE_MAEMO_MAPPER |
234 |
pos.lat = lat_get(mm_context.lat); |
pos.lat = lat_get(mm_context.lat); |
235 |
pos.lon = lon_get(mm_context.lon); |
pos.lon = lon_get(mm_context.lon); |
236 |
#else |
#else |
473 |
/* ------- button box ------------ */ |
/* ------- button box ------------ */ |
474 |
|
|
475 |
GtkWidget *hbox = gtk_hbox_new(TRUE,3); |
GtkWidget *hbox = gtk_hbox_new(TRUE,3); |
476 |
context->but_add = gtk_button_new_with_label(_("Add...")); |
context->but_add = gtk_button_new_with_label(_("Add")); |
477 |
gtk_box_pack_start_defaults(GTK_BOX(hbox), context->but_add); |
gtk_box_pack_start_defaults(GTK_BOX(hbox), context->but_add); |
478 |
gtk_signal_connect(GTK_OBJECT(context->but_add), "clicked", |
gtk_signal_connect(GTK_OBJECT(context->but_add), "clicked", |
479 |
GTK_SIGNAL_FUNC(on_location_add), context); |
GTK_SIGNAL_FUNC(on_location_add), context); |
480 |
|
|
481 |
context->but_edit = gtk_button_new_with_label(_("Edit...")); |
context->but_edit = gtk_button_new_with_label(_("Edit")); |
482 |
gtk_box_pack_start_defaults(GTK_BOX(hbox), context->but_edit); |
gtk_box_pack_start_defaults(GTK_BOX(hbox), context->but_edit); |
483 |
gtk_signal_connect(GTK_OBJECT(context->but_edit), "clicked", |
gtk_signal_connect(GTK_OBJECT(context->but_edit), "clicked", |
484 |
GTK_SIGNAL_FUNC(on_location_edit), context); |
GTK_SIGNAL_FUNC(on_location_edit), context); |
497 |
void cb_menu_settings(GtkWidget *window, gpointer data) { |
void cb_menu_settings(GtkWidget *window, gpointer data) { |
498 |
appdata_t *appdata = (appdata_t *)data; |
appdata_t *appdata = (appdata_t *)data; |
499 |
GtkWidget *table, *label, *hbox, *notebook; |
GtkWidget *table, *label, *hbox, *notebook; |
500 |
GtkWidget *cbox_imperial, *cbox_load_images; |
GtkWidget *cbox_imperial; |
501 |
settings_dialog_state_t hstate; |
settings_dialog_state_t hstate; |
502 |
|
|
503 |
GtkWidget *dialog = gtk_dialog_new_with_buttons(_("Settings"), |
GtkWidget *dialog = gtk_dialog_new_with_buttons(_("Settings"), |
553 |
cbox_imperial, 0, 2, 0, 1, GTK_FILL, 0, 2, 0); |
cbox_imperial, 0, 2, 0, 1, GTK_FILL, 0, 2, 0); |
554 |
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cbox_imperial), |
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cbox_imperial), |
555 |
appdata->imperial); |
appdata->imperial); |
|
cbox_load_images = gtk_check_button_new_with_label( |
|
|
_("Load images")); |
|
|
gtk_table_attach(GTK_TABLE(table), |
|
|
cbox_load_images, 0, 2, 1, 2, GTK_FILL, 0, 2, 0); |
|
|
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(cbox_load_images), |
|
|
appdata->load_images); |
|
|
|
|
556 |
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, |
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, |
557 |
gtk_label_new(_("Misc"))); |
gtk_label_new(_("Misc"))); |
558 |
|
|
622 |
appdata->cachelist_disable_screensaver); |
appdata->cachelist_disable_screensaver); |
623 |
gtk_table_attach(GTK_TABLE(table), cbox_cachelist_dss, |
gtk_table_attach(GTK_TABLE(table), cbox_cachelist_dss, |
624 |
0, 2, 2, 3, GTK_FILL, 0, 2, 0); |
0, 2, 2, 3, GTK_FILL, 0, 2, 0); |
625 |
|
#endif |
626 |
|
|
627 |
GtkWidget *cbox_update = |
GtkWidget *cbox_update = |
628 |
gtk_check_button_new_with_label(_("Update every 30 sec")); |
gtk_check_button_new_with_label(_("Update every 30 sec")); |
630 |
appdata->cachelist_update); |
appdata->cachelist_update); |
631 |
gtk_table_attach(GTK_TABLE(table), cbox_update, |
gtk_table_attach(GTK_TABLE(table), cbox_update, |
632 |
0, 2, 3, 4, GTK_FILL, 0, 2, 0); |
0, 2, 3, 4, GTK_FILL, 0, 2, 0); |
|
#endif |
|
633 |
|
|
634 |
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, |
gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table, |
635 |
gtk_label_new(_("Cache list"))); |
gtk_label_new(_("Cache list"))); |
676 |
GTK_TOGGLE_BUTTON(hstate.cbox_gps)); |
GTK_TOGGLE_BUTTON(hstate.cbox_gps)); |
677 |
appdata->imperial = gtk_toggle_button_get_active( |
appdata->imperial = gtk_toggle_button_get_active( |
678 |
GTK_TOGGLE_BUTTON(cbox_imperial)); |
GTK_TOGGLE_BUTTON(cbox_imperial)); |
|
appdata->load_images = gtk_toggle_button_get_active( |
|
|
GTK_TOGGLE_BUTTON(cbox_load_images)); |
|
679 |
|
|
680 |
appdata->compass_damping = 0.5 + gtk_range_get_value(GTK_RANGE(scale)); |
appdata->compass_damping = 0.5 + gtk_range_get_value(GTK_RANGE(scale)); |
681 |
|
|
703 |
GTK_TOGGLE_BUTTON(cbox_goto_dss)); |
GTK_TOGGLE_BUTTON(cbox_goto_dss)); |
704 |
appdata->cachelist_disable_screensaver = gtk_toggle_button_get_active( |
appdata->cachelist_disable_screensaver = gtk_toggle_button_get_active( |
705 |
GTK_TOGGLE_BUTTON(cbox_cachelist_dss)); |
GTK_TOGGLE_BUTTON(cbox_cachelist_dss)); |
706 |
|
#endif |
707 |
appdata->cachelist_update = gtk_toggle_button_get_active( |
appdata->cachelist_update = gtk_toggle_button_get_active( |
708 |
GTK_TOGGLE_BUTTON(cbox_update)); |
GTK_TOGGLE_BUTTON(cbox_update)); |
|
#endif |
|
709 |
|
|
710 |
/* build some additional flags that are used to decide whether a */ |
/* build some additional flags that are used to decide whether a */ |
711 |
/* redraw is necessary */ |
/* redraw is necessary */ |