Diff of /trunk/src/main.c

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

revision 6 by harbaum, Wed Jun 24 19:20:21 2009 UTC revision 120 by harbaum, Sat Sep 19 19:19:42 2009 UTC
# Line 120  gpx_t *choose_file(appdata_t *appdata, g Line 120  gpx_t *choose_file(appdata_t *appdata, g
120                   HELP_ID_IMPORT, appdata->osso_context);                   HELP_ID_IMPORT, appdata->osso_context);
121  #endif  #endif
122  #else  #else
123    dialog = gtk_file_chooser_dialog_new (whole_dir?_("Open Directory"):    dialog = gtk_file_chooser_dialog_new (whole_dir?_("Import directory"):
124                                          _("Open File"),                                          _("Import file"),
125                          GTK_WINDOW(appdata->window),                          GTK_WINDOW(appdata->window),
126                          whole_dir?GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER :                          whole_dir?GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER :
127                                          GTK_FILE_CHOOSER_ACTION_OPEN,                                          GTK_FILE_CHOOSER_ACTION_OPEN,
# Line 138  gpx_t *choose_file(appdata_t *appdata, g Line 138  gpx_t *choose_file(appdata_t *appdata, g
138    gtk_widget_show_all (GTK_WIDGET(dialog));    gtk_widget_show_all (GTK_WIDGET(dialog));
139    if (gtk_dialog_run (GTK_DIALOG(dialog)) == GTK_FM_OK) {    if (gtk_dialog_run (GTK_DIALOG(dialog)) == GTK_FM_OK) {
140      char *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));      char *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
141    
142        if(filename) {
143          gpx_dialog_t *dialog = gpx_busy_dialog_new(GTK_WIDGET(appdata->window));
144    
145      gpx_dialog_t *dialog = gpx_busy_dialog_new(GTK_WIDGET(appdata->window));        if(!whole_dir)
146            gpx = gpx_parse(dialog, filename);
147      if(!whole_dir)        else {
148        gpx = gpx_parse(dialog, filename);          /* cur trailing '/' if present */
149      else {          if(strlastchr(filename) == '/')
150        /* cur trailing '/' if present */            filename[strlen(filename)] = 0;
151        if(strlastchr(filename) == '/')  
152          filename[strlen(filename)] = 0;          gpx = gpx_parse_dir(dialog, filename);
   
       gpx = gpx_parse_dir(dialog, filename);  
     }  
   
     gpx_busy_dialog_destroy(dialog);  
   
     /* save path if gpx was successfully loaded */  
     if(gpx) {  
       char *r = strrchr(filename, '/');  
   
       /* there is a delimiter, use everything left of it as path */  
       if(r && !whole_dir) {  
         *r = 0;  
         if(appdata->path) free(appdata->path);  
         appdata->path = strdup(filename);  
         /* restore path ... just in case ... */  
         *r = '/';  
153        }        }
154    
155          gpx_busy_dialog_destroy(dialog);
156    
157          /* save path if gpx was successfully loaded */
158          if(gpx) {
159            char *r = strrchr(filename, '/');
160    
161            /* there is a delimiter, use everything left of it as path */
162            if(r && !whole_dir) {
163              *r = 0;
164              if(appdata->path) free(appdata->path);
165              appdata->path = strdup(filename);
166              /* restore path ... just in case ... */
167              *r = '/';
168            }
169    
170            if(whole_dir)
171              appdata->path = strdup(filename);
172          } else
173            errorf(_("Load error"));
174    
175        if(whole_dir)        g_free (filename);
176          appdata->path = strdup(filename);      } else {
177    #ifndef USE_MAEMO
178          errorf(_("Error accessing the file."));
179    #else
180          errorf(_("Error accessing the file. This may happen if the file "
181                   "resides on a remote file system. Please copy the file onto "
182                   "the device (e.g. onto the memory card) and try again."));
183    #endif
184      }      }
   
     g_free (filename);  
185    }    }
186    
187    gtk_widget_destroy (dialog);    gtk_widget_destroy (dialog);
# Line 202  void cachelist_view_onRowActivated(GtkTr Line 213  void cachelist_view_onRowActivated(GtkTr
213    GtkTreeIter   iter;    GtkTreeIter   iter;
214    GtkTreeModel *model = gtk_tree_view_get_model(treeview);    GtkTreeModel *model = gtk_tree_view_get_model(treeview);
215    
216    #ifdef USE_MAEMO
217      /* check if a cache is already selected and ignore click if yes */
218      /* (was probably a double click) */
219      if(appdata->cur_cache) return;
220    #endif
221    
222    if(gtk_tree_model_get_iter(model, &iter, path)) {    if(gtk_tree_model_get_iter(model, &iter, path)) {
223      cache_t *cache;      cache_t *cache;
224      gtk_tree_model_get(model, &iter, CACHELIST_COL_DATA, &cache, -1);      gtk_tree_model_get(model, &iter, CACHELIST_COL_DATA, &cache, -1);
# Line 264  void cachelist_redraw(appdata_t *appdata Line 281  void cachelist_redraw(appdata_t *appdata
281    // gtk_widget_show_all(appdata->vbox);    // gtk_widget_show_all(appdata->vbox);
282  #else  #else
283    
284      if(!appdata->cur_view) {
285        printf("cachelist redraw: no active view\n");
286        return;
287      }
288    
289    g_assert(!appdata->cur_cache);    g_assert(!appdata->cur_cache);
290    int redraw = 0;    int redraw = 0;
291    if(appdata->search_results)    if(appdata->search_results)
# Line 274  void cachelist_redraw(appdata_t *appdata Line 296  void cachelist_redraw(appdata_t *appdata
296    }    }
297    
298    if(redraw) {    if(redraw) {
299      gtk_container_remove(GTK_CONTAINER(appdata->vbox), appdata->cur_view);      GtkWidget *container = appdata->vbox;
300    
301        printf("redraw %d\n", redraw);
302    
303    #ifdef USE_STACKABLE_WINDOW
304        HildonWindowStack *stack = hildon_window_stack_get_default();
305        container = hildon_window_stack_peek(stack);
306    #endif
307    
308        gtk_container_remove(GTK_CONTAINER(container), appdata->cur_view);
309      switch(redraw) {      switch(redraw) {
310      case 1:      case 1:
311        appdata->cur_view = cachelist_create(appdata,        appdata->cur_view = cachelist_create(appdata,
# Line 286  void cachelist_redraw(appdata_t *appdata Line 317  void cachelist_redraw(appdata_t *appdata
317        break;        break;
318      }      }
319    
320      gtk_box_pack_start_defaults(GTK_BOX(appdata->vbox), appdata->cur_view);  #ifdef USE_STACKABLE_WINDOW
321      gtk_widget_show_all(appdata->vbox);      if(container != appdata->vbox)
322          gtk_container_add(GTK_CONTAINER(container), appdata->cur_view);
323        else
324    #endif
325          gtk_box_pack_start_defaults(GTK_BOX(container), appdata->cur_view);
326    
327        gtk_widget_show_all(container);
328    }    }
329  #endif  #endif
330  }  }
# Line 300  static gboolean cachelist_update(gpointe Line 337  static gboolean cachelist_update(gpointe
337  #ifdef USE_MAEMO  #ifdef USE_MAEMO
338    appdata_t *appdata = (appdata_t*)data;    appdata_t *appdata = (appdata_t*)data;
339    
340      if(appdata->cur_cache)
341        return TRUE;
342    
343    if(appdata->cachelist_disable_screensaver)    if(appdata->cachelist_disable_screensaver)
344      if (osso_display_blanking_pause(appdata->osso_context) != OSSO_OK)      if (osso_display_blanking_pause(appdata->osso_context) != OSSO_OK)
345        fprintf(stderr, "error with display blank\n");        fprintf(stderr, "error with display blank\n");
# Line 312  static gboolean cachelist_update(gpointe Line 352  static gboolean cachelist_update(gpointe
352  }  }
353    
354  static void cachelist_timer_reset(appdata_t *appdata) {  static void cachelist_timer_reset(appdata_t *appdata) {
355      printf("cachelist timer reset\n");
356    g_assert(appdata->cachelist_handler_id);    g_assert(appdata->cachelist_handler_id);
357    gtk_timeout_remove(appdata->cachelist_handler_id);    gtk_timeout_remove(appdata->cachelist_handler_id);
358    appdata->cachelist_handler_id =    appdata->cachelist_handler_id =
# Line 543  void cachelist_dialog(appdata_t *appdata Line 584  void cachelist_dialog(appdata_t *appdata
584  }  }
585  #else  #else
586  #ifdef USE_STACKABLE_WINDOW  #ifdef USE_STACKABLE_WINDOW
587    static void search_result_free(gpx_t *result);
588    
589    void on_cachelist_destroy(GtkWidget *widget, appdata_t *appdata) {
590      if(appdata->search_results) {
591        search_result_free(appdata->search_results);
592        appdata->search_results = NULL;
593      }
594      appdata->cur_gpx = NULL;
595    
596      /* restore cur_view */
597      appdata->cur_view = g_object_get_data(G_OBJECT(widget), "cur_view");
598    }
599    
600  void cachelist_dialog(appdata_t *appdata, gpx_t *gpx) {  void cachelist_dialog(appdata_t *appdata, gpx_t *gpx) {
601    GtkWidget *window = hildon_stackable_window_new();    GtkWidget *window = hildon_stackable_window_new();
602    
603    gtk_window_set_title(GTK_WINDOW(window), gpx->name);    /* store last "cur_view" in window */
604      g_object_set_data(G_OBJECT(window), "cur_view", appdata->cur_view);
605    
606    gtk_container_add(GTK_CONTAINER(window),    appdata->cur_gpx = gpx;
607                      cachelist_create(appdata, gpx, NULL));    char *title = g_strdup_printf("%s - GPXView", gpx->name);
608      gtk_window_set_title(GTK_WINDOW(window), title);
609      g_free(title);
610    
611      appdata->cur_view = cachelist_create(appdata, gpx, NULL);
612      gtk_container_add(GTK_CONTAINER(window), appdata->cur_view);
613    
614    
615    hildon_window_set_app_menu(HILDON_WINDOW(window),    hildon_window_set_app_menu(HILDON_WINDOW(window),
616                               menu_create(appdata, MENU_CACHELIST));                               menu_create(appdata, MENU_CACHELIST));
617    
618      g_signal_connect(G_OBJECT(window), "destroy",
619                       G_CALLBACK(on_cachelist_destroy), appdata);
620    
621    gtk_widget_show_all(window);    gtk_widget_show_all(window);
622  }  }
623  #endif  #endif
# Line 666  static void gpxlist_view_onRowActivated( Line 730  static void gpxlist_view_onRowActivated(
730    GtkTreeIter   iter;    GtkTreeIter   iter;
731    GtkTreeModel *model = gtk_tree_view_get_model(treeview);    GtkTreeModel *model = gtk_tree_view_get_model(treeview);
732    
733    #ifdef USE_MAEMO
734      /* check if a cache is already selected and ignore click if yes */
735      /* (was probably a double click) */
736      if(appdata->cur_gpx) return;
737    #endif
738    
739    if (gtk_tree_model_get_iter(model, &iter, path)) {    if (gtk_tree_model_get_iter(model, &iter, path)) {
740      gpx_t *gpx;      gpx_t *gpx;
741      gtk_tree_model_get(model, &iter, GPXLIST_COL_DATA, &gpx, -1);      gtk_tree_model_get(model, &iter, GPXLIST_COL_DATA, &gpx, -1);
# Line 764  static void gpxlist_view_onRowActivated( Line 834  static void gpxlist_view_onRowActivated(
834          gpx_busy_dialog_destroy(dialog);          gpx_busy_dialog_destroy(dialog);
835        }        }
836  #ifndef USE_BREAD_CRUMB_TRAIL  #ifndef USE_BREAD_CRUMB_TRAIL
837        cachelist_dialog(appdata, gpx);  #ifdef USE_STACKABLE_WINDOW
838          if(!appdata->cur_gpx)
839    #endif
840            cachelist_dialog(appdata, gpx);
841    #ifdef USE_STACKABLE_WINDOW
842          else
843            printf("selected gpx, but cachelist window already present\n");
844    #endif
845  #else  #else
846        gtk_container_remove(GTK_CONTAINER(appdata->vbox), appdata->cur_view);        gtk_container_remove(GTK_CONTAINER(appdata->vbox), appdata->cur_view);
847        appdata->cur_view = cachelist_create(appdata, gpx, NULL);        appdata->cur_view = cachelist_create(appdata, gpx, NULL);
# Line 903  static GtkWidget *gpxlist_create_view_an Line 980  static GtkWidget *gpxlist_create_view_an
980      GtkTreeIter         iter;      GtkTreeIter         iter;
981      gtk_list_store_append(appdata->gpxstore, &iter);      gtk_list_store_append(appdata->gpxstore, &iter);
982      gpxlist_set(appdata->gpxstore, &iter, gpx);      gpxlist_set(appdata->gpxstore, &iter, gpx);
983    
984      if(gpx == sel_gpx) {      if(gpx == sel_gpx) {
985        sel_iter = iter;        sel_iter = iter;
986        sel_iter_valid = TRUE;        sel_iter_valid = TRUE;
# Line 963  static void gpxlist_add(appdata_t *appda Line 1040  static void gpxlist_add(appdata_t *appda
1040    
1041  /******************** begin of menu *********************/  /******************** begin of menu *********************/
1042    
1043    typedef struct {
1044      appdata_t *appdata;
1045      GtkWidget *dialog;
1046    } about_context_t;
1047    
1048    #ifdef ENABLE_BROWSER_INTERFACE
1049    void on_paypal_button_clicked(GtkButton *button, about_context_t *context) {
1050      gtk_dialog_response(GTK_DIALOG(context->dialog), GTK_RESPONSE_ACCEPT);
1051      browser_url(context->appdata,
1052                  "https://www.paypal.com/cgi-bin/webscr"
1053                  "?cmd=_s-xclick&hosted_button_id=7400558");
1054    }
1055    #endif
1056    
1057  static void  static void
1058  cb_menu_about(GtkWidget *window, gpointer data) {  cb_menu_about(GtkWidget *window, gpointer data) {
1059    GtkAboutDialog *about = GTK_ABOUT_DIALOG(gtk_about_dialog_new());    about_context_t context;
1060    
1061      context.appdata = (appdata_t *)data;
1062    
1063    #ifdef ENABLE_LIBLOCATION
1064      char *uses = "uses liblocation";
1065    #elif defined(ENABLE_GPSBT)
1066      char *uses = "uses gpsbt and gpsd";
1067    #else
1068      char *uses = "uses gpsd";
1069    #endif
1070    
1071      const gchar *authors[] = {
1072        "Till Harbaum <till@harbaum.org>",
1073        "John Stowers <john.stowers@gmail.com>",
1074        NULL };
1075    
1076      context.dialog = g_object_new(GTK_TYPE_ABOUT_DIALOG,
1077                            "name", "GPXView",
1078                            "version", VERSION,
1079                            "copyright", _("Copyright 2008-2009"),
1080                            "authors", authors,
1081                            "website", _("http://www.harbaum.org/till/maemo"),
1082                            "comments", _(uses),
1083                            NULL);
1084    
1085    #ifdef ENABLE_BROWSER_INTERFACE
1086      /* add a way to donate to the project */
1087      GtkWidget *alignment = gtk_alignment_new(0.5, 0, 0, 0);
1088    
1089      GtkWidget *hbox = gtk_hbox_new(FALSE, 8);
1090      gtk_box_pack_start(GTK_BOX(hbox),
1091                         gtk_label_new(_("Do you like GPXView?")),
1092                         FALSE, FALSE, 0);
1093    
1094      GtkWidget *button = gtk_button_new();
1095      gtk_button_set_image(GTK_BUTTON(button),
1096                           icon_get_widget(ICON_MISC, 8));
1097      gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE);
1098      g_signal_connect(button, "clicked",
1099                       G_CALLBACK(on_paypal_button_clicked), &context);
1100      gtk_box_pack_start(GTK_BOX(hbox), button, FALSE, FALSE, 0);
1101    
1102      gtk_container_add(GTK_CONTAINER(alignment), hbox);
1103      gtk_box_pack_start_defaults(GTK_BOX((GTK_DIALOG(context.dialog))->vbox),
1104                                  alignment);
1105    
1106      gtk_widget_show_all(alignment);
1107    #endif
1108    
1109    gtk_about_dialog_set_name(about, "GPXView");    gtk_dialog_run(GTK_DIALOG(context.dialog));
1110    gtk_about_dialog_set_version(about, VERSION);    gtk_widget_destroy(context.dialog);
   gtk_about_dialog_set_copyright(about,  
          _("GPXView (c) 2008 by\n"  
          "Till Harbaum <till@harbaum.org>\n"  
          "Geocaching.com: Tantil"));  
   
   gtk_about_dialog_set_website(about,  
        _("http://www.harbaum.org/till/maemo"));  
   
   gtk_about_dialog_set_comments(about,  
        _("Geocaching.com GPX file viewer"));  
   
   gtk_widget_show_all(GTK_WIDGET(about));  
   gtk_dialog_run(GTK_DIALOG(about));  
   gtk_widget_destroy(GTK_WIDGET(about));  
1111  }  }
1112    
1113  #if defined(USE_MAEMO) && defined(HILDON_HELP)  #if defined(USE_MAEMO) && defined(HILDON_HELP)
# Line 1328  cb_menu_search(GtkWidget *window, gpoint Line 1453  cb_menu_search(GtkWidget *window, gpoint
1453      /* don't search if we are asked to search for nothing */      /* don't search if we are asked to search for nothing */
1454      if(((appdata->search & (SEARCH_ID|SEARCH_NAME|SEARCH_DESC|SEARCH_OWNER)) &&      if(((appdata->search & (SEARCH_ID|SEARCH_NAME|SEARCH_DESC|SEARCH_OWNER)) &&
1455          strlen(p) > 0) || (appdata->search & SEARCH_FINDS)) {          strlen(p) > 0) || (appdata->search & SEARCH_FINDS)) {
       gpx_t *found = NULL;  
1456    
1457        printf("Search for %s (flags = %x)...\n", p, appdata->search);        printf("Search for %s (flags = %x)...\n", p, appdata->search);
1458    
1459  #ifndef USE_BREAD_CRUMB_TRAIL  #ifndef USE_BREAD_CRUMB_TRAIL
1460        found = search_do(appdata, appdata->gpx, p, appdata->search, FALSE);        gpx_t *found =
1461            search_do(appdata, appdata->gpx, p, appdata->search, FALSE);
1462    
1463        /* do search result dialog here ... */        /* do search result dialog here ... */
1464        cachelist_dialog(appdata, found);        cachelist_dialog(appdata, found);
1465    #ifndef USE_STACKABLE_WINDOW
1466        search_result_free(found);        search_result_free(found);
1467  #else  #else
1468          appdata->search_results = found;
1469    #endif
1470    #else
1471          gpx_t *found = NULL;
1472    
1473        if(appdata->cur_gpx)        if(appdata->cur_gpx)
1474          found = search_do(appdata, appdata->cur_gpx, p, appdata->search, TRUE);          found = search_do(appdata, appdata->cur_gpx, p, appdata->search, TRUE);
1475        else        else
# Line 1359  cb_menu_search(GtkWidget *window, gpoint Line 1490  cb_menu_search(GtkWidget *window, gpoint
1490      gtk_widget_destroy(dialog);      gtk_widget_destroy(dialog);
1491  }  }
1492    
1493  void on_window_destroy (GtkWidget *widget, gpointer data);  static void on_window_destroy (GtkWidget *widget, gpointer data);
1494    
1495  #ifndef USE_MAEMO  #ifndef USE_MAEMO
1496  static void  static void
# Line 1435  cb_menu_export_garmin(GtkWidget *widget, Line 1566  cb_menu_export_garmin(GtkWidget *widget,
1566    garmin_export(appdata);    garmin_export(appdata);
1567  }  }
1568    
1569    #ifdef ENABLE_OSM_GPS_MAP
1570    static void
1571    cb_menu_map(GtkWidget *window, gpointer data) {
1572      map((appdata_t *)data);
1573    }
1574    #endif
1575    
1576  static void  static void
1577  cb_menu_geomath(GtkWidget *window, gpointer data) {  cb_menu_geomath(GtkWidget *window, gpointer data) {
1578    geomath_dialog((appdata_t *)data);    geomath_dialog((appdata_t *)data);
# Line 1451  cb_menu_precpos(GtkWidget *window, gpoin Line 1589  cb_menu_precpos(GtkWidget *window, gpoin
1589  }  }
1590    
1591  #ifdef USE_STACKABLE_WINDOW  #ifdef USE_STACKABLE_WINDOW
1592    typedef struct {
1593      char *label, *desc;
1594      GtkSignalFunc activate_cb;
1595    } menu_entry_t;
1596    
1597  void on_export_clicked(GtkButton *button, appdata_t *appdata) {  typedef struct {
1598    HildonStackableWindow *view_window;    const char *title;
1599    GtkWidget *but;    const menu_entry_t *menu;
1600      int len;
1601    } submenu_t;
1602    
1603    view_window = HILDON_STACKABLE_WINDOW (hildon_stackable_window_new ());  #define COLUMNS  1
   gtk_window_set_title (GTK_WINDOW (view_window), "Export");  
1604    
1605    GtkVBox *contents = GTK_VBOX(gtk_vbox_new (12, FALSE));  void on_submenu_entry_clicked(GtkButton *button, GtkWidget *menu) {
1606    
1607    but = hildon_button_new_with_text(    /* force closing of submenu dialog */
1608              HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH,    gtk_dialog_response(GTK_DIALOG(menu), GTK_RESPONSE_NONE);
1609              HILDON_BUTTON_ARRANGEMENT_VERTICAL,    gtk_widget_hide(menu);
1610              _("Export to Maemo Mapper"),  
1611              _("Save a Maemo Mapper POI file"));    /* let gtk clean up */
1612    g_signal_connect(but, "clicked",    while(gtk_events_pending())
1613                     G_CALLBACK(cb_menu_export_mmpoi), appdata);      gtk_main_iteration();
1614    gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0);  }
1615    
1616    static GtkWidget *app_submenu_create(appdata_t *appdata,
1617                                         const submenu_t *submenu) {
1618    
1619    but = hildon_button_new_with_text(    /* create a oridinary dialog box */
1620              HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH,    GtkWidget *dialog = gtk_dialog_new();
1621              HILDON_BUTTON_ARRANGEMENT_VERTICAL,    gtk_window_set_title(GTK_WINDOW(dialog), _(submenu->title));
1622              _("Export Field Notes"),    gtk_window_set_modal(GTK_WINDOW(dialog), TRUE);
1623              _("Save a Garmin Field Notes file"));    gtk_window_set_transient_for(GTK_WINDOW(dialog),
1624    g_signal_connect(but, "clicked",                                 GTK_WINDOW(appdata->window));
1625                     G_CALLBACK(cb_menu_export_log), appdata);    gtk_dialog_set_has_separator(GTK_DIALOG(dialog), FALSE);
   gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0);  
   
1626    
1627    but = hildon_button_new_with_text(    GtkWidget *table = gtk_table_new(submenu->len/COLUMNS, COLUMNS, TRUE);
1628      int x = 0, y = 0;
1629    
1630      const menu_entry_t *menu_entries = submenu->menu;
1631      while(menu_entries->label) {
1632        GtkWidget *button = NULL;
1633    
1634        button = hildon_button_new_with_text(
1635              HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH,              HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH,
1636              HILDON_BUTTON_ARRANGEMENT_VERTICAL,              HILDON_BUTTON_ARRANGEMENT_VERTICAL,
1637              _("Export Garmin GPX"),              _(menu_entries->label), _(menu_entries->desc));
1638              _("Save a GPX file containing modified waypoints"));  
1639    g_signal_connect(but, "clicked",      /* try to center both texts */
1640                     G_CALLBACK(cb_menu_export_garmin), appdata);      hildon_button_set_title_alignment(HILDON_BUTTON(button), 0.5, 0.5);
1641    gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0);      hildon_button_set_value_alignment(HILDON_BUTTON(button), 0.5, 0.5);
1642    
1643        g_signal_connect(button, "clicked",
1644                         G_CALLBACK(on_submenu_entry_clicked), dialog);
1645    
1646        g_signal_connect(button, "clicked",
1647                         menu_entries->activate_cb, appdata);
1648    
1649        gtk_table_attach_defaults(GTK_TABLE(table),  button, x, x+1, y, y+1);
1650    
1651        x++;
1652        if(x == COLUMNS) { x = 0; y++; }
1653    
1654        menu_entries++;
1655      }
1656    
1657      gtk_box_pack_start_defaults(GTK_BOX(GTK_DIALOG(dialog)->vbox), table);
1658    
1659    gtk_container_add (GTK_CONTAINER (view_window), GTK_WIDGET (contents));    return dialog;
   gtk_widget_show_all (GTK_WIDGET (view_window));  
1660  }  }
1661    
1662  void on_tools_clicked(GtkButton *button, appdata_t *appdata) {  /* popup the dialog shaped submenu */
1663    HildonStackableWindow *view_window;  static void submenu_popup(GtkWidget *menu) {
1664    GtkWidget *but;    gtk_widget_show_all(menu);
1665      gtk_dialog_run(GTK_DIALOG(menu));
1666      gtk_widget_hide(menu);
1667    }
1668    
1669    view_window = HILDON_STACKABLE_WINDOW (hildon_stackable_window_new ());  static void submenu_cleanup(GtkWidget *menu) {
1670    gtk_window_set_title (GTK_WINDOW (view_window), "Export");    gtk_widget_destroy(menu);
1671    }
1672    
1673    GtkVBox *contents = GTK_VBOX(gtk_vbox_new (12, FALSE));  static const menu_entry_t submenu_export_entries[] = {
1674      { "Export to Maemo Mapper" , "Save a Maemo Mapper POI file",
1675        G_CALLBACK(cb_menu_export_mmpoi)  },
1676      { "Export Field Notes",      "Save a Garmin Field Notes file",
1677        G_CALLBACK(cb_menu_export_log)    },
1678      { "Export Garmin GPX",       "Save modified waypoints in GPX file",
1679        G_CALLBACK(cb_menu_export_garmin) },
1680      { NULL, NULL, NULL }
1681    };
1682    
1683    but = hildon_button_new_with_text(  static const submenu_t submenu_export = {
1684              HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH,    "Export", submenu_export_entries,
1685              HILDON_BUTTON_ARRANGEMENT_VERTICAL,    sizeof(submenu_export_entries)/sizeof(menu_entry_t)-1
1686              _("Geomath"),  };
             _("Geocoordinate calculation"));  
   g_signal_connect(but, "clicked",  
                    G_CALLBACK(cb_menu_geomath), appdata);  
   gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0);  
1687    
1688    /* the export submenu */
1689    void on_export_clicked(GtkButton *button, appdata_t *appdata) {
1690      if(!appdata->export_menu)
1691        appdata->export_menu = app_submenu_create(appdata, &submenu_export);
1692    
1693    but = hildon_button_new_with_text(    submenu_popup(appdata->export_menu);
1694              HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH,  }
             HILDON_BUTTON_ARRANGEMENT_VERTICAL,  
             _("Geotext"),  
             _("Text analysis, letter counting etc"));  
   g_signal_connect(but, "clicked",  
                    G_CALLBACK(cb_menu_geotext), appdata);  
   gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0);  
   
1695    
1696    but = hildon_button_new_with_text(  static const menu_entry_t submenu_tools_entries[] = {
1697              HILDON_SIZE_FINGER_HEIGHT | HILDON_SIZE_AUTO_WIDTH,    { "Geomath",          "Geocoordinate calculation",
1698              HILDON_BUTTON_ARRANGEMENT_VERTICAL,      G_CALLBACK(cb_menu_geomath) },
1699              _("Precise Position"),    { "Geotext",          "Text analysis",
1700              _("Calculate a very precise GPS posotions"));      G_CALLBACK(cb_menu_geotext) },
1701    g_signal_connect(but, "clicked",    { "Precise Position", "Calculate a precise GPS position",
1702                     G_CALLBACK(cb_menu_precpos), appdata);      G_CALLBACK(cb_menu_precpos) },
1703    gtk_box_pack_start(GTK_BOX(contents), but, FALSE, FALSE, 0);    { NULL, NULL, NULL }
1704    };
1705    
1706    static const submenu_t submenu_tools = {
1707      "Tools", submenu_tools_entries,
1708      sizeof(submenu_tools_entries)/sizeof(menu_entry_t)-1
1709    };
1710    
1711    /* the tools submenu */
1712    void on_tools_clicked(GtkButton *button, appdata_t *appdata) {
1713      if(!appdata->tools_menu)
1714        appdata->tools_menu = app_submenu_create(appdata, &submenu_tools);
1715    
1716    gtk_container_add (GTK_CONTAINER (view_window), GTK_WIDGET (contents));    submenu_popup(appdata->tools_menu);
   gtk_widget_show_all (GTK_WIDGET (view_window));  
1717  }  }
1718    
1719  HildonAppMenu *menu_create(appdata_t *appdata, int mode) {  HildonAppMenu *menu_create(appdata_t *appdata, int mode) {
# Line 1541  HildonAppMenu *menu_create(appdata_t *ap Line 1721  HildonAppMenu *menu_create(appdata_t *ap
1721    HildonAppMenu *menu = HILDON_APP_MENU(hildon_app_menu_new());    HildonAppMenu *menu = HILDON_APP_MENU(hildon_app_menu_new());
1722    
1723    /* ------- */    /* ------- */
1724      button = gtk_button_new_with_label(_("About"));
1725      g_signal_connect_after(button, "clicked",
1726                             G_CALLBACK(cb_menu_about), appdata);
1727      hildon_app_menu_append(menu, GTK_BUTTON(button));
1728    
1729    button = gtk_button_new_with_label(_("Settings"));    button = gtk_button_new_with_label(_("Settings"));
1730    g_signal_connect_after(button, "clicked", G_CALLBACK(cb_menu_settings),    g_signal_connect_after(button, "clicked", G_CALLBACK(cb_menu_settings),
1731                           appdata);                           appdata);
# Line 1552  HildonAppMenu *menu_create(appdata_t *ap Line 1737  HildonAppMenu *menu_create(appdata_t *ap
1737                             G_CALLBACK(cb_menu_add), appdata);                             G_CALLBACK(cb_menu_add), appdata);
1738      hildon_app_menu_append(menu, GTK_BUTTON(button));      hildon_app_menu_append(menu, GTK_BUTTON(button));
1739    
1740      button = gtk_button_new_with_label(_("Import dir"));      button = gtk_button_new_with_label(_("Import directory"));
1741      g_signal_connect_after(button, "clicked",      g_signal_connect_after(button, "clicked",
1742                             G_CALLBACK(cb_menu_adddir), appdata);                             G_CALLBACK(cb_menu_adddir), appdata);
1743      hildon_app_menu_append(menu, GTK_BUTTON(button));      hildon_app_menu_append(menu, GTK_BUTTON(button));
   }  
1744    
   if(mode == MENU_GPXLIST) {  
1745      button = gtk_button_new_with_label(_("Export"));      button = gtk_button_new_with_label(_("Export"));
1746      g_signal_connect_after(button, "clicked",      g_signal_connect_after(button, "clicked",
1747                             G_CALLBACK(on_export_clicked), appdata);                             G_CALLBACK(on_export_clicked), appdata);
# Line 1575  HildonAppMenu *menu_create(appdata_t *ap Line 1758  HildonAppMenu *menu_create(appdata_t *ap
1758                           G_CALLBACK(on_tools_clicked), appdata);                           G_CALLBACK(on_tools_clicked), appdata);
1759    hildon_app_menu_append(menu, GTK_BUTTON(button));    hildon_app_menu_append(menu, GTK_BUTTON(button));
1760    
1761    button = gtk_button_new_with_label(_("About"));  #ifdef ENABLE_OSM_GPS_MAP
1762        button = gtk_button_new_with_label(_("Map"));
1763        g_signal_connect_after(button, "clicked",
1764                               G_CALLBACK(cb_menu_map), appdata);
1765        hildon_app_menu_append(menu, GTK_BUTTON(button));
1766    #endif
1767    
1768    #ifdef HILDON_HELP
1769      button = gtk_button_new_with_label(_("Help"));
1770    g_signal_connect_after(button, "clicked",    g_signal_connect_after(button, "clicked",
1771                           G_CALLBACK(cb_menu_about), appdata);                           G_CALLBACK(cb_menu_help), appdata);
1772    hildon_app_menu_append(menu, GTK_BUTTON(button));    hildon_app_menu_append(menu, GTK_BUTTON(button));
1773    #endif
1774    
1775    gtk_widget_show(GTK_WIDGET(menu));    gtk_widget_show_all(GTK_WIDGET(menu));
1776    
1777    return menu;    return menu;
1778  }  }
# Line 1598  void menu_create(appdata_t *appdata) { Line 1790  void menu_create(appdata_t *appdata) {
1790    GtkWidget *submenu = gtk_menu_new();    GtkWidget *submenu = gtk_menu_new();
1791    gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu);    gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu);
1792    
1793    item = gtk_menu_item_new_with_label( _("File...") );    item = gtk_menu_item_new_with_label( _("File") );
1794    gtk_menu_append(GTK_MENU_SHELL(submenu), item);    gtk_menu_append(GTK_MENU_SHELL(submenu), item);
1795    g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_add), appdata);    g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_add), appdata);
1796    
1797    item = gtk_menu_item_new_with_label( _("Directory...") );    item = gtk_menu_item_new_with_label( _("Directory") );
1798    gtk_menu_append(GTK_MENU_SHELL(submenu), item);    gtk_menu_append(GTK_MENU_SHELL(submenu), item);
1799    g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_adddir), appdata);    g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_adddir), appdata);
1800    
# Line 1629  void menu_create(appdata_t *appdata) { Line 1821  void menu_create(appdata_t *appdata) {
1821    gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu);    gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu);
1822    
1823  #ifdef USE_MAEMO  #ifdef USE_MAEMO
1824    item = gtk_menu_item_new_with_label( _("Maemo Mapper POI...") );    item = gtk_menu_item_new_with_label( _("Maemo Mapper POI") );
1825    gtk_menu_append(GTK_MENU_SHELL(submenu), item);    gtk_menu_append(GTK_MENU_SHELL(submenu), item);
1826    g_signal_connect(item, "activate",    g_signal_connect(item, "activate",
1827                     GTK_SIGNAL_FUNC(cb_menu_export_mmpoi), appdata);                     GTK_SIGNAL_FUNC(cb_menu_export_mmpoi), appdata);
1828  #endif  #endif
1829    
1830    item = gtk_menu_item_new_with_label( _("Garmin Field Notes...") );    item = gtk_menu_item_new_with_label( _("Garmin Field Notes") );
1831    gtk_menu_append(GTK_MENU_SHELL(submenu), item);    gtk_menu_append(GTK_MENU_SHELL(submenu), item);
1832    g_signal_connect(item, "activate",    g_signal_connect(item, "activate",
1833                     GTK_SIGNAL_FUNC(cb_menu_export_log), appdata);                     GTK_SIGNAL_FUNC(cb_menu_export_log), appdata);
1834    
1835    item = gtk_menu_item_new_with_label( _("Garmin GPX...") );    item = gtk_menu_item_new_with_label( _("Garmin GPX") );
1836    gtk_menu_append(GTK_MENU_SHELL(submenu), item);    gtk_menu_append(GTK_MENU_SHELL(submenu), item);
1837    g_signal_connect(item, "activate",    g_signal_connect(item, "activate",
1838                     GTK_SIGNAL_FUNC(cb_menu_export_garmin), appdata);                     GTK_SIGNAL_FUNC(cb_menu_export_garmin), appdata);
# Line 1648  void menu_create(appdata_t *appdata) { Line 1840  void menu_create(appdata_t *appdata) {
1840  #ifdef USE_BREAD_CRUMB_TRAIL  #ifdef USE_BREAD_CRUMB_TRAIL
1841    appdata->menu_search =    appdata->menu_search =
1842  #endif  #endif
1843    item = gtk_menu_item_new_with_label( _("Search...") );    item = gtk_menu_item_new_with_label( _("Search") );
1844    gtk_menu_append(GTK_MENU_SHELL(menu), item);    gtk_menu_append(GTK_MENU_SHELL(menu), item);
1845    g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_search), appdata);    g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_search), appdata);
1846    
# Line 1685  void menu_create(appdata_t *appdata) { Line 1877  void menu_create(appdata_t *appdata) {
1877    
1878    gtk_menu_append(GTK_MENU_SHELL(menu), gtk_separator_menu_item_new());    gtk_menu_append(GTK_MENU_SHELL(menu), gtk_separator_menu_item_new());
1879    
1880    #ifdef ENABLE_OSM_GPS_MAP
1881      item = gtk_menu_item_new_with_label( _("Map") );
1882      gtk_menu_append(GTK_MENU_SHELL(menu), item);
1883      g_signal_connect(item, "activate",
1884                       GTK_SIGNAL_FUNC(cb_menu_map), appdata);
1885    #endif
1886    
1887    item = gtk_menu_item_new_with_label(_("Tools"));    item = gtk_menu_item_new_with_label(_("Tools"));
1888    gtk_menu_append(GTK_MENU_SHELL(menu), item);    gtk_menu_append(GTK_MENU_SHELL(menu), item);
1889    submenu = gtk_menu_new();    submenu = gtk_menu_new();
1890    gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu);    gtk_menu_item_set_submenu(GTK_MENU_ITEM(item), submenu);
1891    
1892    item = gtk_menu_item_new_with_label( _("Geomath...") );    item = gtk_menu_item_new_with_label( _("Geomath") );
1893    gtk_menu_append(GTK_MENU_SHELL(submenu), item);    gtk_menu_append(GTK_MENU_SHELL(submenu), item);
1894    g_signal_connect(item, "activate",    g_signal_connect(item, "activate",
1895                     GTK_SIGNAL_FUNC(cb_menu_geomath), appdata);                     GTK_SIGNAL_FUNC(cb_menu_geomath), appdata);
1896    
1897    item = gtk_menu_item_new_with_label( _("Geotext...") );    item = gtk_menu_item_new_with_label( _("Geotext") );
1898    gtk_menu_append(GTK_MENU_SHELL(submenu), item);    gtk_menu_append(GTK_MENU_SHELL(submenu), item);
1899    g_signal_connect(item, "activate",    g_signal_connect(item, "activate",
1900                     GTK_SIGNAL_FUNC(cb_menu_geotext), appdata);                     GTK_SIGNAL_FUNC(cb_menu_geotext), appdata);
1901    
1902    item = gtk_menu_item_new_with_label( _("Precise Position...") );    item = gtk_menu_item_new_with_label( _("Precise Position") );
1903    gtk_menu_append(GTK_MENU_SHELL(submenu), item);    gtk_menu_append(GTK_MENU_SHELL(submenu), item);
1904    g_signal_connect(item, "activate",    g_signal_connect(item, "activate",
1905                     GTK_SIGNAL_FUNC(cb_menu_precpos), appdata);                     GTK_SIGNAL_FUNC(cb_menu_precpos), appdata);
# Line 1708  void menu_create(appdata_t *appdata) { Line 1907  void menu_create(appdata_t *appdata) {
1907    gtk_menu_append(GTK_MENU_SHELL(menu), gtk_separator_menu_item_new());    gtk_menu_append(GTK_MENU_SHELL(menu), gtk_separator_menu_item_new());
1908    
1909  #if defined(USE_MAEMO) && defined(HILDON_HELP)  #if defined(USE_MAEMO) && defined(HILDON_HELP)
1910    item = gtk_menu_item_new_with_label( _("Help...") );    item = gtk_menu_item_new_with_label( _("Help") );
1911    gtk_menu_append(GTK_MENU_SHELL(menu), item);    gtk_menu_append(GTK_MENU_SHELL(menu), item);
1912    g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_help), appdata);    g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_help), appdata);
1913  #endif  #endif
1914    
1915    item = gtk_menu_item_new_with_label( _("About...") );    item = gtk_menu_item_new_with_label( _("About") );
1916    gtk_menu_append(GTK_MENU_SHELL(menu), item);    gtk_menu_append(GTK_MENU_SHELL(menu), item);
1917    g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_about), appdata);    g_signal_connect(item, "activate", GTK_SIGNAL_FUNC(cb_menu_about), appdata);
1918    
# Line 1749  void cleanup(appdata_t *appdata) { Line 1948  void cleanup(appdata_t *appdata) {
1948    if(appdata->image_path) free(appdata->image_path);    if(appdata->image_path) free(appdata->image_path);
1949    if(appdata->search_str) free(appdata->search_str);    if(appdata->search_str) free(appdata->search_str);
1950    
1951    #ifdef USE_STACKABLE_WINDOW
1952      if(appdata->export_menu) submenu_cleanup(appdata->export_menu);
1953      if(appdata->tools_menu)  submenu_cleanup(appdata->tools_menu);
1954    #endif
1955    
1956    gnome_vfs_shutdown();    gnome_vfs_shutdown();
1957    icons_free();    icons_free();
1958    gps_release(appdata);    gps_release(appdata);
# Line 1777  void cleanup(appdata_t *appdata) { Line 1981  void cleanup(appdata_t *appdata) {
1981    puts("everything is gone");    puts("everything is gone");
1982  }  }
1983    
1984  void on_window_destroy (GtkWidget *widget, gpointer data) {  static void on_window_destroy (GtkWidget *widget, gpointer data) {
1985    appdata_t *appdata = (appdata_t*)data;    appdata_t *appdata = (appdata_t*)data;
1986    
1987    gconf_save_state(appdata);    gconf_save_state(appdata);
# Line 1786  void on_window_destroy (GtkWidget *widge Line 1990  void on_window_destroy (GtkWidget *widge
1990  }  }
1991    
1992  gboolean on_window_key_press(GtkWidget *widget,  gboolean on_window_key_press(GtkWidget *widget,
1993                           GdkEventKey *event, gpointer data) {                           GdkEventKey *event, appdata_t *appdata) {
   appdata_t *appdata = (appdata_t*)data;  
1994    int handled = FALSE;    int handled = FALSE;
1995    
1996    //  printf("key event %d\n", event->keyval);    //  printf("key event %d\n", event->keyval);
# Line 1795  gboolean on_window_key_press(GtkWidget * Line 1998  gboolean on_window_key_press(GtkWidget *
1998    switch(event->keyval) {    switch(event->keyval) {
1999  #ifdef USE_MAEMO  #ifdef USE_MAEMO
2000    
 #if 0  /* don't do this as it interferes with gtkentry fields */  
   case HILDON_HARDKEY_SELECT:  
     /* remove as long as we haven't reached the main gpx list */  
     if(appdata->cur_gpx)  
       hildon_bread_crumb_trail_pop(HILDON_BREAD_CRUMB_TRAIL(appdata->bct));  
     handled = TRUE;  
     break;  
 #endif  
   
2001  #ifdef HILDON_HARDKEY_INCREASE  #ifdef HILDON_HARDKEY_INCREASE
2002    case HILDON_HARDKEY_INCREASE:    case HILDON_HARDKEY_INCREASE:
2003      html_zoom(appdata, TRUE);      html_zoom(appdata, TRUE);
# Line 1988  static void crumb_add(appdata_t *appdata Line 2182  static void crumb_add(appdata_t *appdata
2182  #endif // USE_BREAD_CRUMB_TRAIL  #endif // USE_BREAD_CRUMB_TRAIL
2183    
2184  void main_after_settings_redraw(appdata_t *appdata, int flags) {  void main_after_settings_redraw(appdata_t *appdata, int flags) {
2185      printf("main after settings redraw\n");
2186    
2187      if(!appdata->cur_view) {
2188        printf("no active view\n");
2189        return;
2190      }
2191    
2192  #ifndef USE_MAEMO  #ifndef USE_MAEMO
2193    // in non-maemo setup this can only affect the main screen as    // in non-maemo setup this can only affect the main screen as
2194    // the menu is blocked while a dialog is open. also the main    // the menu is blocked while a dialog is open. also the main
# Line 2023  void main_after_settings_redraw(appdata_ Line 2224  void main_after_settings_redraw(appdata_
2224    }    }
2225    
2226    if(redraw) {    if(redraw) {
2227      gtk_container_remove(GTK_CONTAINER(appdata->vbox), appdata->cur_view);      GtkWidget *container = appdata->vbox;
2228    
2229    #ifdef USE_STACKABLE_WINDOW
2230        HildonWindowStack *stack = hildon_window_stack_get_default();
2231        container = hildon_window_stack_peek(stack);
2232    #endif
2233    
2234        gtk_container_remove(GTK_CONTAINER(container), appdata->cur_view);
2235      switch(redraw) {      switch(redraw) {
2236      case 1:      case 1:
2237        appdata->cur_view = cachelist_create(appdata,        appdata->cur_view = cachelist_create(appdata,
# Line 2038  void main_after_settings_redraw(appdata_ Line 2246  void main_after_settings_redraw(appdata_
2246        break;        break;
2247      }      }
2248    
2249      gtk_box_pack_start_defaults(GTK_BOX(appdata->vbox), appdata->cur_view);  #ifdef USE_STACKABLE_WINDOW
2250      gtk_widget_show_all(appdata->vbox);      if(container != appdata->vbox)
2251    }        gtk_container_add(GTK_CONTAINER(container), appdata->cur_view);
2252        else
2253  #endif  #endif
2254          gtk_box_pack_start_defaults(GTK_BOX(container), appdata->cur_view);
2255    
2256        gtk_widget_show_all(container);
2257      }
2258    #endif // USE_MAEMO
2259  }  }
2260    
2261  int main(int argc, char *argv[]) {  int main(int argc, char *argv[]) {
# Line 2098  int main(int argc, char *argv[]) { Line 2312  int main(int argc, char *argv[]) {
2312    gtk_window_set_default_size(GTK_WINDOW(appdata.window), 500, 300);    gtk_window_set_default_size(GTK_WINDOW(appdata.window), 500, 300);
2313  #endif  #endif
2314    
2315    #if MAEMO_VERSION_MAJOR == 5
2316    gtk_window_set_title(GTK_WINDOW(appdata.window), "GPXView");    gtk_window_set_title(GTK_WINDOW(appdata.window), "GPXView");
2317    #endif
2318    
2319    g_signal_connect(G_OBJECT(appdata.window), "destroy",    g_signal_connect(G_OBJECT(appdata.window), "destroy",
2320                     G_CALLBACK(on_window_destroy), &appdata);                     G_CALLBACK(on_window_destroy), &appdata);
2321    
# Line 2107  int main(int argc, char *argv[]) { Line 2324  int main(int argc, char *argv[]) {
2324    
2325    appdata.vbox = gtk_vbox_new(FALSE, 2);    appdata.vbox = gtk_vbox_new(FALSE, 2);
2326    gtk_container_add(GTK_CONTAINER(appdata.window), appdata.vbox);    gtk_container_add(GTK_CONTAINER(appdata.window), appdata.vbox);
   
2327  #ifndef USE_STACKABLE_WINDOW  #ifndef USE_STACKABLE_WINDOW
2328    menu_create(&appdata);    menu_create(&appdata);
2329  #else  #else

Legend:
Removed from v.6  
changed lines
  Added in v.120