Diff of /trunk/src/settings.c

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

revision 12 by harbaum, Fri Jun 26 20:07:33 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 617  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 624  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 698  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.12  
changed lines
  Added in v.129