Diff of /trunk/src/main.c

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

revision 128 by harbaum, Tue Sep 29 07:31:18 2009 UTC revision 129 by harbaum, Tue Sep 29 14:30:16 2009 UTC
# Line 278  static GtkWidget *cachelist_create(appda Line 278  static GtkWidget *cachelist_create(appda
278                                     cache_t *sel_cache);                                     cache_t *sel_cache);
279    
280  void cachelist_redraw(appdata_t *appdata) {  void cachelist_redraw(appdata_t *appdata) {
 #ifndef USE_MAEMO  
   //  gtk_container_remove(GTK_CONTAINER(appdata->vbox), appdata->cur_view);  
   //  appdata->cur_view = gpxlist_create_view_and_model(appdata, NULL);  
   //  gtk_box_pack_start_defaults(GTK_BOX(appdata->vbox), appdata->cur_view);  
   // gtk_widget_show_all(appdata->vbox);  
 #else  
   
281    if(!appdata->cur_view) {    if(!appdata->cur_view) {
282      printf("cachelist redraw: no active view\n");      printf("cachelist redraw: no active view\n");
283      return;      return;
# Line 302  void cachelist_redraw(appdata_t *appdata Line 295  void cachelist_redraw(appdata_t *appdata
295    if(redraw) {    if(redraw) {
296      GtkWidget *container = appdata->vbox;      GtkWidget *container = appdata->vbox;
297    
     printf("redraw %d\n", redraw);  
   
298  #ifdef USE_STACKABLE_WINDOW  #ifdef USE_STACKABLE_WINDOW
299      HildonWindowStack *stack = hildon_window_stack_get_default();      HildonWindowStack *stack = hildon_window_stack_get_default();
300      container = hildon_window_stack_peek(stack);      container = hildon_window_stack_peek(stack);
# Line 330  void cachelist_redraw(appdata_t *appdata Line 321  void cachelist_redraw(appdata_t *appdata
321    
322      gtk_widget_show_all(container);      gtk_widget_show_all(container);
323    }    }
 #endif  
324  }  }
325    
326    
# Line 338  static gboolean cachelist_update(gpointe Line 328  static gboolean cachelist_update(gpointe
328    
329    printf("cachelist timer fired!\n");    printf("cachelist timer fired!\n");
330    
 #ifdef USE_MAEMO  
331    appdata_t *appdata = (appdata_t*)data;    appdata_t *appdata = (appdata_t*)data;
332    
333    if(appdata->cur_cache)    if(appdata->cur_cache)
334      return TRUE;      return TRUE;
335    
336    #ifdef USE_MAEMO
337    if(appdata->cachelist_disable_screensaver)    if(appdata->cachelist_disable_screensaver)
338      if (osso_display_blanking_pause(appdata->osso_context) != OSSO_OK)      if (osso_display_blanking_pause(appdata->osso_context) != OSSO_OK)
339        fprintf(stderr, "error with display blank\n");        fprintf(stderr, "error with display blank\n");
340    #endif
341    
342    if(appdata->cachelist_update)    if(appdata->cachelist_update)
343      cachelist_redraw(appdata);      cachelist_redraw(appdata);
344    
 #endif  
   
345    return TRUE;    return TRUE;
346  }  }
347    
# Line 546  static GtkWidget *cachelist_create(appda Line 535  static GtkWidget *cachelist_create(appda
535    appdata->cachelist_handler_id =    appdata->cachelist_handler_id =
536      gtk_timeout_add(CACHELIST_UPDATE_TIMEOUT, cachelist_update, appdata);      gtk_timeout_add(CACHELIST_UPDATE_TIMEOUT, cachelist_update, appdata);
537    
538    #ifdef ENABLE_OSM_GPS_MAP
539      map_update(appdata);
540    #endif
541    
542    /* update timer is being reset if the user scrolls or selects */    /* update timer is being reset if the user scrolls or selects */
543    g_signal_connect(view, "button-press-event",    g_signal_connect(view, "button-press-event",
544                     (GCallback)cachelist_update_reset0, appdata);                     (GCallback)cachelist_update_reset0, appdata);
# Line 2200  void main_after_settings_redraw(appdata_ Line 2193  void main_after_settings_redraw(appdata_
2193      return;      return;
2194    }    }
2195    
 #ifndef USE_MAEMO  
   // in non-maemo setup this can only affect the main screen as  
   // the menu is blocked while a dialog is open. also the main  
   // screen is always present  
   if(appdata->gpxlist_items != appdata->cur_items) {  
     /* re-do the main screen */  
     gtk_container_remove(GTK_CONTAINER(appdata->vbox), appdata->cur_view);  
     appdata->cur_view = gpxlist_create_view_and_model(appdata, NULL);  
     gtk_box_pack_start_defaults(GTK_BOX(appdata->vbox), appdata->cur_view);  
     gtk_widget_show_all(appdata->vbox);  
   }  
 #else  
2196    /* a cache screen cannot be changed from the settings and thus doesn't */    /* a cache screen cannot be changed from the settings and thus doesn't */
2197    /* need to be redrawn */    /* need to be redrawn */
2198    if(appdata->cur_cache) {    if(appdata->cur_cache) {
# Line 2266  void main_after_settings_redraw(appdata_ Line 2247  void main_after_settings_redraw(appdata_
2247    
2248      gtk_widget_show_all(container);      gtk_widget_show_all(container);
2249    }    }
 #endif // USE_MAEMO  
2250  }  }
2251    
2252  int main(int argc, char *argv[]) {  int main(int argc, char *argv[]) {
# Line 2322  int main(int argc, char *argv[]) { Line 2302  int main(int argc, char *argv[]) {
2302    /* Create a Window. */    /* Create a Window. */
2303    appdata.window = gtk_window_new(GTK_WINDOW_TOPLEVEL);    appdata.window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
2304    /* Set a decent default size for the window. */    /* Set a decent default size for the window. */
2305    gtk_window_set_default_size(GTK_WINDOW(appdata.window), 500, 300);    gtk_window_set_default_size(GTK_WINDOW(appdata.window), 640, 480);
2306  #endif  #endif
2307    
2308  #if MAEMO_VERSION_MAJOR == 5  #if MAEMO_VERSION_MAJOR == 5

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