Diff of /trunk/src/settings.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 7 by harbaum, Thu Jun 25 15:24:24 2009 UTC revision 129 by harbaum, Tue Sep 29 14:30:16 2009 UTC
# Line 71  static void location_select(location_con Line 71  static void location_select(location_con
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 {
# Line 140  static void on_location_edit(GtkWidget * Line 140  static void on_location_edit(GtkWidget *
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;
# Line 159  static void on_location_edit(GtkWidget * Line 159  static void on_location_edit(GtkWidget *
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",
# Line 176  static void on_location_edit(GtkWidget * Line 181  static void on_location_edit(GtkWidget *
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",
# Line 193  static void on_location_edit(GtkWidget * Line 198  static void on_location_edit(GtkWidget *
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;
# Line 225  static void on_location_edit(GtkWidget * Line 230  static void on_location_edit(GtkWidget *
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
# Line 492  static GtkWidget *location_widget(locati Line 497  static GtkWidget *location_widget(locati
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"),
# Line 548  void cb_menu_settings(GtkWidget *window, Line 553  void cb_menu_settings(GtkWidget *window,
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    
# Line 624  void cb_menu_settings(GtkWidget *window, Line 622  void cb_menu_settings(GtkWidget *window,
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"));
# Line 631  void cb_menu_settings(GtkWidget *window, Line 630  void cb_menu_settings(GtkWidget *window,
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")));
# Line 678  void cb_menu_settings(GtkWidget *window, Line 676  void cb_menu_settings(GtkWidget *window,
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    
# Line 707  void cb_menu_settings(GtkWidget *window, Line 703  void cb_menu_settings(GtkWidget *window,
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 */

Legend:
Removed from v.7  
changed lines
  Added in v.129