|
|
1 | /** |
|
|
2 | * ZANavi, Zoff Android Navigation system. |
|
|
3 | * Copyright (C) 2011-2012 Zoff <zoff@zoff.cc> |
|
|
4 | * |
|
|
5 | * This program is free software; you can redistribute it and/or |
|
|
6 | * modify it under the terms of the GNU General Public License |
|
|
7 | * version 2 as published by the Free Software Foundation. |
|
|
8 | * |
|
|
9 | * This program is distributed in the hope that it will be useful, |
|
|
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
|
|
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
|
|
12 | * GNU General Public License for more details. |
|
|
13 | * |
|
|
14 | * You should have received a copy of the GNU General Public License |
|
|
15 | * along with this program; if not, write to the |
|
|
16 | * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
|
|
17 | * Boston, MA 02110-1301, USA. |
|
|
18 | */ |
|
|
19 | |
1 | /** |
20 | /** |
2 | * Navit, a modular navigation system. |
21 | * Navit, a modular navigation system. |
3 | * Copyright (C) 2005-2010 Navit Team |
22 | * Copyright (C) 2005-2010 Navit Team |
4 | * |
23 | * |
5 | * This program is free software; you can redistribute it and/or |
24 | * This program is free software; you can redistribute it and/or |
… | |
… | |
1583 | width=this->root.w-w->bl; |
1602 | width=this->root.w-w->bl; |
1584 | if (! (this->flags & 2)) { |
1603 | if (! (this->flags & 2)) { |
1585 | wm=gui_internal_button_new_with_callback(this, NULL, |
1604 | wm=gui_internal_button_new_with_callback(this, NULL, |
1586 | image_new_s(this, "gui_map"), gravity_center|orientation_vertical, |
1605 | image_new_s(this, "gui_map"), gravity_center|orientation_vertical, |
1587 | gui_internal_cmd_return, NULL); |
1606 | gui_internal_cmd_return, NULL); |
1588 | wm->speech=g_strdup(_("Back to map")); |
1607 | wm->speech=g_strdup("Back to map"); |
1589 | gui_internal_widget_pack(this, wm); |
1608 | gui_internal_widget_pack(this, wm); |
1590 | gui_internal_widget_append(w, wm); |
1609 | gui_internal_widget_append(w, wm); |
1591 | width-=wm->w; |
1610 | width-=wm->w; |
1592 | } |
1611 | } |
1593 | if (! (this->flags & 4)) { |
1612 | if (! (this->flags & 4)) { |
1594 | wh=gui_internal_button_new_with_callback(this, NULL, |
1613 | wh=gui_internal_button_new_with_callback(this, NULL, |
1595 | image_new_s(this, "gui_home"), gravity_center|orientation_vertical, |
1614 | image_new_s(this, "gui_home"), gravity_center|orientation_vertical, |
1596 | gui_internal_cmd_main_menu, NULL); |
1615 | gui_internal_cmd_main_menu, NULL); |
1597 | wh->speech=g_strdup(_("Main Menu")); |
1616 | wh->speech=g_strdup("Main Menu"); |
1598 | gui_internal_widget_pack(this, wh); |
1617 | gui_internal_widget_pack(this, wh); |
1599 | gui_internal_widget_append(w, wh); |
1618 | gui_internal_widget_append(w, wh); |
1600 | width-=wh->w; |
1619 | width-=wh->w; |
1601 | } |
1620 | } |
1602 | if (!(this->flags & 6)) |
1621 | if (!(this->flags & 6)) |
… | |
… | |
2031 | static void |
2050 | static void |
2032 | gui_internal_cmd_add_bookmark2(struct gui_priv *this, struct widget *wm, void *data) |
2051 | gui_internal_cmd_add_bookmark2(struct gui_priv *this, struct widget *wm, void *data) |
2033 | { |
2052 | { |
2034 | struct widget *w,*wb,*wk,*wl,*we,*wnext; |
2053 | struct widget *w,*wb,*wk,*wl,*we,*wnext; |
2035 | char *name=data; |
2054 | char *name=data; |
2036 | wb=gui_internal_menu(this,_("Add Bookmark")); |
2055 | wb=gui_internal_menu(this,"Add Bookmark"); |
2037 | w=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill); |
2056 | w=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill); |
2038 | gui_internal_widget_append(wb, w); |
2057 | gui_internal_widget_append(wb, w); |
2039 | we=gui_internal_box_new(this, gravity_left_center|orientation_horizontal|flags_fill); |
2058 | we=gui_internal_box_new(this, gravity_left_center|orientation_horizontal|flags_fill); |
2040 | gui_internal_widget_append(w, we); |
2059 | gui_internal_widget_append(w, we); |
2041 | gui_internal_widget_append(we, wk=gui_internal_label_new(this, name)); |
2060 | gui_internal_widget_append(we, wk=gui_internal_label_new(this, name)); |
… | |
… | |
2058 | static void |
2077 | static void |
2059 | gui_internal_cmd_add_bookmark_folder2(struct gui_priv *this, struct widget *wm, void *data) |
2078 | gui_internal_cmd_add_bookmark_folder2(struct gui_priv *this, struct widget *wm, void *data) |
2060 | { |
2079 | { |
2061 | struct widget *w,*wb,*wk,*wl,*we,*wnext; |
2080 | struct widget *w,*wb,*wk,*wl,*we,*wnext; |
2062 | char *name=data; |
2081 | char *name=data; |
2063 | wb=gui_internal_menu(this,_("Add Bookmark folder")); |
2082 | wb=gui_internal_menu(this,"Add Bookmark folder"); |
2064 | w=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill); |
2083 | w=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill); |
2065 | gui_internal_widget_append(wb, w); |
2084 | gui_internal_widget_append(wb, w); |
2066 | we=gui_internal_box_new(this, gravity_left_center|orientation_horizontal|flags_fill); |
2085 | we=gui_internal_box_new(this, gravity_left_center|orientation_horizontal|flags_fill); |
2067 | gui_internal_widget_append(w, we); |
2086 | gui_internal_widget_append(w, we); |
2068 | gui_internal_widget_append(we, wk=gui_internal_label_new(this, name)); |
2087 | gui_internal_widget_append(we, wk=gui_internal_label_new(this, name)); |
… | |
… | |
2085 | static void |
2104 | static void |
2086 | gui_internal_cmd_rename_bookmark(struct gui_priv *this, struct widget *wm, void *data) |
2105 | gui_internal_cmd_rename_bookmark(struct gui_priv *this, struct widget *wm, void *data) |
2087 | { |
2106 | { |
2088 | struct widget *w,*wb,*wk,*wl,*we,*wnext; |
2107 | struct widget *w,*wb,*wk,*wl,*we,*wnext; |
2089 | char *name=wm->text; |
2108 | char *name=wm->text; |
2090 | wb=gui_internal_menu(this,_("Rename")); |
2109 | wb=gui_internal_menu(this,"Rename"); |
2091 | w=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill); |
2110 | w=gui_internal_box_new(this, gravity_left_top|orientation_vertical|flags_expand|flags_fill); |
2092 | gui_internal_widget_append(wb, w); |
2111 | gui_internal_widget_append(wb, w); |
2093 | we=gui_internal_box_new(this, gravity_left_center|orientation_horizontal|flags_fill); |
2112 | we=gui_internal_box_new(this, gravity_left_center|orientation_horizontal|flags_fill); |
2094 | gui_internal_widget_append(w, we); |
2113 | gui_internal_widget_append(w, we); |
2095 | gui_internal_widget_append(we, wk=gui_internal_label_new(this, name)); |
2114 | gui_internal_widget_append(we, wk=gui_internal_label_new(this, name)); |
… | |
… | |
2403 | struct table_data *td; |
2422 | struct table_data *td; |
2404 | int width=wm->w; |
2423 | int width=wm->w; |
2405 | dbg(2, "Params: sel = %i, selnb = %i, pagenb = %i, dist = %i\n", |
2424 | dbg(2, "Params: sel = %i, selnb = %i, pagenb = %i, dist = %i\n", |
2406 | param.p.sel, param.p.selnb, param.p.pagenb, param.p.dist); |
2425 | param.p.sel, param.p.selnb, param.p.pagenb, param.p.dist); |
2407 | |
2426 | |
2408 | wb=gui_internal_menu(this, isel ? isel->name : _("POIs")); |
2427 | wb=gui_internal_menu(this, isel ? isel->name : "POIs"); |
2409 | w=gui_internal_box_new(this, gravity_top_center|orientation_vertical|flags_expand|flags_fill); |
2428 | w=gui_internal_box_new(this, gravity_top_center|orientation_vertical|flags_expand|flags_fill); |
2410 | gui_internal_widget_append(wb, w); |
2429 | gui_internal_widget_append(wb, w); |
2411 | if (!isel) |
2430 | if (!isel) |
2412 | gui_internal_widget_append(w, gui_internal_cmd_pois_selector(this,&wm->c,pagenb)); |
2431 | gui_internal_widget_append(w, gui_internal_cmd_pois_selector(this,&wm->c,pagenb)); |
2413 | w2=gui_internal_box_new(this, gravity_top_center|orientation_vertical|flags_expand|flags_fill); |
2432 | w2=gui_internal_box_new(this, gravity_top_center|orientation_vertical|flags_expand|flags_fill); |
… | |
… | |
2596 | default: |
2615 | default: |
2597 | break; |
2616 | break; |
2598 | } |
2617 | } |
2599 | if (url) { |
2618 | if (url) { |
2600 | gui_internal_widget_append(w, |
2619 | gui_internal_widget_append(w, |
2601 | wb=gui_internal_button_new_with_callback(this, _("View in Browser"), |
2620 | wb=gui_internal_button_new_with_callback(this, "View in Browser", |
2602 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2621 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2603 | gui_internal_cmd_view_in_browser, NULL)); |
2622 | gui_internal_cmd_view_in_browser, NULL)); |
2604 | wb->name=url; |
2623 | wb->name=url; |
2605 | } |
2624 | } |
2606 | } |
2625 | } |
… | |
… | |
2733 | if (item) { |
2752 | if (item) { |
2734 | if (item_attr_get(item, attr_description, &attr)) |
2753 | if (item_attr_get(item, attr_description, &attr)) |
2735 | gui_internal_widget_append(w, gui_internal_label_new(this, attr.u.str)); |
2754 | gui_internal_widget_append(w, gui_internal_label_new(this, attr.u.str)); |
2736 | if (item_attr_get(item, attr_url_local, &attr)) { |
2755 | if (item_attr_get(item, attr_url_local, &attr)) { |
2737 | gui_internal_widget_append(w, |
2756 | gui_internal_widget_append(w, |
2738 | wb=gui_internal_button_new_with_callback(this, _("View in Browser"), |
2757 | wb=gui_internal_button_new_with_callback(this, "View in Browser", |
2739 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2758 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2740 | gui_internal_cmd_view_in_browser, NULL)); |
2759 | gui_internal_cmd_view_in_browser, NULL)); |
2741 | wb->item=wm->item; |
2760 | wb->item=wm->item; |
2742 | } |
2761 | } |
2743 | gui_internal_widget_append(w, |
2762 | gui_internal_widget_append(w, |
2744 | wb=gui_internal_button_new_with_callback(this, _("View Attributes"), |
2763 | wb=gui_internal_button_new_with_callback(this, "View Attributes", |
2745 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2764 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2746 | gui_internal_cmd_view_attributes, NULL)); |
2765 | gui_internal_cmd_view_attributes, NULL)); |
2747 | wb->item=wm->item; |
2766 | wb->item=wm->item; |
2748 | } |
2767 | } |
2749 | map_rect_destroy(mr); |
2768 | map_rect_destroy(mr); |
2750 | } |
2769 | } |
2751 | if (flags & 8) { |
2770 | if (flags & 8) { |
2752 | gui_internal_widget_append(w, |
2771 | gui_internal_widget_append(w, |
2753 | wbc=gui_internal_button_new_with_callback(this, _("Set as destination"), |
2772 | wbc=gui_internal_button_new_with_callback(this, "Set as destination", |
2754 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2773 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2755 | gui_internal_cmd_set_destination, g_strdup(name))); |
2774 | gui_internal_cmd_set_destination, g_strdup(name))); |
2756 | wbc->data_free=g_free_func; |
2775 | wbc->data_free=g_free_func; |
2757 | wbc->c=pc; |
2776 | wbc->c=pc; |
2758 | } |
2777 | } |
2759 | if (flags & 16) { |
2778 | if (flags & 16) { |
2760 | gui_internal_widget_append(w, |
2779 | gui_internal_widget_append(w, |
2761 | wbc=gui_internal_button_new_with_callback(this, _("Set as position"), |
2780 | wbc=gui_internal_button_new_with_callback(this, "Set as position", |
2762 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2781 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2763 | gui_internal_cmd_set_position, wm)); |
2782 | gui_internal_cmd_set_position, wm)); |
2764 | wbc->c=pc; |
2783 | wbc->c=pc; |
2765 | } |
2784 | } |
2766 | if (flags & 32) { |
2785 | if (flags & 32) { |
2767 | gui_internal_widget_append(w, |
2786 | gui_internal_widget_append(w, |
2768 | wbc=gui_internal_button_new_with_callback(this, _("Add as bookmark"), |
2787 | wbc=gui_internal_button_new_with_callback(this, "Add as bookmark", |
2769 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2788 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2770 | gui_internal_cmd_add_bookmark2, g_strdup(name))); |
2789 | gui_internal_cmd_add_bookmark2, g_strdup(name))); |
2771 | wbc->data_free=g_free_func; |
2790 | wbc->data_free=g_free_func; |
2772 | wbc->c=pc; |
2791 | wbc->c=pc; |
2773 | } |
2792 | } |
2774 | #ifndef _MSC_VER |
2793 | #ifndef _MSC_VER |
2775 | //POIs are not operational under MSVC yet |
2794 | //POIs are not operational under MSVC yet |
2776 | if (flags & 64) { |
2795 | if (flags & 64) { |
2777 | gui_internal_widget_append(w, |
2796 | gui_internal_widget_append(w, |
2778 | wbc=gui_internal_button_new_with_callback(this, _("POIs"), |
2797 | wbc=gui_internal_button_new_with_callback(this, "POIs", |
2779 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2798 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2780 | gui_internal_cmd_pois, NULL)); |
2799 | gui_internal_cmd_pois, NULL)); |
2781 | wbc->c=pc; |
2800 | wbc->c=pc; |
2782 | } |
2801 | } |
2783 | #endif /* _MSC_VER */ |
2802 | #endif /* _MSC_VER */ |
… | |
… | |
2786 | gui_internal_button_new(this, "Add to tour", |
2805 | gui_internal_button_new(this, "Add to tour", |
2787 | image_new_o(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill)); |
2806 | image_new_o(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill)); |
2788 | #endif |
2807 | #endif |
2789 | if (flags & 128) { |
2808 | if (flags & 128) { |
2790 | gui_internal_widget_append(w, |
2809 | gui_internal_widget_append(w, |
2791 | wbc=gui_internal_button_new_with_callback(this, _("View on map"), |
2810 | wbc=gui_internal_button_new_with_callback(this, "View on map", |
2792 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2811 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2793 | gui_internal_cmd_view_on_map, NULL)); |
2812 | gui_internal_cmd_view_on_map, NULL)); |
2794 | wbc->c=pc; |
2813 | wbc->c=pc; |
2795 | if ((flags & 4) && wm) |
2814 | if ((flags & 4) && wm) |
2796 | wbc->item=wm->item; |
2815 | wbc->item=wm->item; |
… | |
… | |
2853 | } |
2872 | } |
2854 | mapset_close(h); |
2873 | mapset_close(h); |
2855 | } |
2874 | } |
2856 | if (flags & 512) { |
2875 | if (flags & 512) { |
2857 | gui_internal_widget_append(w, |
2876 | gui_internal_widget_append(w, |
2858 | wbc=gui_internal_button_new_with_callback(this, _("Cut Bookmark"), |
2877 | wbc=gui_internal_button_new_with_callback(this, "Cut Bookmark", |
2859 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2878 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2860 | gui_internal_cmd_cut_bookmark, NULL)); |
2879 | gui_internal_cmd_cut_bookmark, NULL)); |
2861 | wbc->text=g_strdup(wm->text); |
2880 | wbc->text=g_strdup(wm->text); |
2862 | gui_internal_widget_append(w, |
2881 | gui_internal_widget_append(w, |
2863 | wbc=gui_internal_button_new_with_callback(this, _("Copy Bookmark"), |
2882 | wbc=gui_internal_button_new_with_callback(this, "Copy Bookmark", |
2864 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2883 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2865 | gui_internal_cmd_copy_bookmark, NULL)); |
2884 | gui_internal_cmd_copy_bookmark, NULL)); |
2866 | wbc->text=g_strdup(wm->text); |
2885 | wbc->text=g_strdup(wm->text); |
2867 | gui_internal_widget_append(w, |
2886 | gui_internal_widget_append(w, |
2868 | wbc=gui_internal_button_new_with_callback(this, _("Rename Bookmark"), |
2887 | wbc=gui_internal_button_new_with_callback(this, "Rename Bookmark", |
2869 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2888 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2870 | gui_internal_cmd_rename_bookmark, NULL)); |
2889 | gui_internal_cmd_rename_bookmark, NULL)); |
2871 | wbc->text=g_strdup(wm->text); |
2890 | wbc->text=g_strdup(wm->text); |
2872 | gui_internal_widget_append(w, |
2891 | gui_internal_widget_append(w, |
2873 | wbc=gui_internal_button_new_with_callback(this, _("Paste Bookmark"), |
2892 | wbc=gui_internal_button_new_with_callback(this, "Paste Bookmark", |
2874 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2893 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2875 | gui_internal_cmd_paste_bookmark, NULL)); |
2894 | gui_internal_cmd_paste_bookmark, NULL)); |
2876 | gui_internal_widget_append(w, |
2895 | gui_internal_widget_append(w, |
2877 | wbc=gui_internal_button_new_with_callback(this, _("Delete Bookmark"), |
2896 | wbc=gui_internal_button_new_with_callback(this, "Delete Bookmark", |
2878 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2897 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
2879 | gui_internal_cmd_delete_bookmark, NULL)); |
2898 | gui_internal_cmd_delete_bookmark, NULL)); |
2880 | wbc->text=g_strdup(wm->text); |
2899 | wbc->text=g_strdup(wm->text); |
2881 | } |
2900 | } |
2882 | gui_internal_menu_render(this); |
2901 | gui_internal_menu_render(this); |
… | |
… | |
2983 | } |
3002 | } |
2984 | if ( prefix ) |
3003 | if ( prefix ) |
2985 | plen=strlen(prefix); |
3004 | plen=strlen(prefix); |
2986 | |
3005 | |
2987 | gui_internal_prune_menu_count(this, 1, 0); |
3006 | gui_internal_prune_menu_count(this, 1, 0); |
2988 | wb=gui_internal_menu(this, _("Bookmarks")); |
3007 | wb=gui_internal_menu(this, "Bookmarks"); |
2989 | wb->background=this->background; |
3008 | wb->background=this->background; |
2990 | w=gui_internal_box_new(this, gravity_top_center|orientation_vertical|flags_expand|flags_fill); |
3009 | w=gui_internal_box_new(this, gravity_top_center|orientation_vertical|flags_expand|flags_fill); |
2991 | w->spy=this->spacing*3; |
3010 | w->spy=this->spacing*3; |
2992 | gui_internal_widget_append(wb, w); |
3011 | gui_internal_widget_append(wb, w); |
2993 | |
3012 | |
… | |
… | |
3018 | gui_internal_widget_append(w, wbm); |
3037 | gui_internal_widget_append(w, wbm); |
3019 | } |
3038 | } |
3020 | } |
3039 | } |
3021 | |
3040 | |
3022 | // Adds the Bookmark folders |
3041 | // Adds the Bookmark folders |
3023 | wbm=gui_internal_button_new_with_callback(this, _("Add Bookmark folder"), |
3042 | wbm=gui_internal_button_new_with_callback(this, "Add Bookmark folder", |
3024 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
3043 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
3025 | gui_internal_cmd_add_bookmark_folder2, NULL); |
3044 | gui_internal_cmd_add_bookmark_folder2, NULL); |
3026 | gui_internal_widget_append(w, wbm); |
3045 | gui_internal_widget_append(w, wbm); |
3027 | |
3046 | |
3028 | // Pastes the Bookmark |
3047 | // Pastes the Bookmark |
3029 | wbm=gui_internal_button_new_with_callback(this, _("Paste bookmark"), |
3048 | wbm=gui_internal_button_new_with_callback(this, "Paste bookmark", |
3030 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
3049 | image_new_xs(this, "gui_active"), gravity_left_center|orientation_horizontal|flags_fill, |
3031 | gui_internal_cmd_paste_bookmark, NULL); |
3050 | gui_internal_cmd_paste_bookmark, NULL); |
3032 | gui_internal_widget_append(w, wbm); |
3051 | gui_internal_widget_append(w, wbm); |
3033 | |
3052 | |
3034 | bookmarks_item_rewind(mattr.u.bookmarks); |
3053 | bookmarks_item_rewind(mattr.u.bookmarks); |
… | |
… | |
3057 | gui_internal_widget_append(row,wbm); |
3076 | gui_internal_widget_append(row,wbm); |
3058 | if (item_coord_get(item, &c, 1)) { |
3077 | if (item_coord_get(item, &c, 1)) { |
3059 | wbm->c.x=c.x; |
3078 | wbm->c.x=c.x; |
3060 | wbm->c.y=c.y; |
3079 | wbm->c.y=c.y; |
3061 | wbm->c.pro=bookmarks_get_projection(mattr.u.bookmarks); |
3080 | wbm->c.pro=bookmarks_get_projection(mattr.u.bookmarks); |
3062 | wbm->name=g_strdup_printf(_("Bookmark %s"),label_full); |
3081 | wbm->name=g_strdup_printf("Bookmark %s",label_full); |
3063 | wbm->text=g_strdup(label_full); |
3082 | wbm->text=g_strdup(label_full); |
3064 | if (!hassub) { |
3083 | if (!hassub) { |
3065 | wbm->data=(void*)7;//Mark us as a bookmark |
3084 | wbm->data=(void*)7;//Mark us as a bookmark |
3066 | } |
3085 | } |
3067 | wbm->prefix=g_strdup(label_full); |
3086 | wbm->prefix=g_strdup(label_full); |
… | |
… | |
3903 | struct attr attr; |
3922 | struct attr attr; |
3904 | struct widget *w,*wb,*wl; |
3923 | struct widget *w,*wb,*wl; |
3905 | struct attr_iter *iter; |
3924 | struct attr_iter *iter; |
3906 | |
3925 | |
3907 | |
3926 | |
3908 | wb=gui_internal_menu(this, _("Layout")); |
3927 | wb=gui_internal_menu(this, "Layout"); |
3909 | w=gui_internal_box_new(this, gravity_top_center|orientation_vertical|flags_expand|flags_fill); |
3928 | w=gui_internal_box_new(this, gravity_top_center|orientation_vertical|flags_expand|flags_fill); |
3910 | w->spy=this->spacing*3; |
3929 | w->spy=this->spacing*3; |
3911 | gui_internal_widget_append(wb, w); |
3930 | gui_internal_widget_append(wb, w); |
3912 | iter=navit_attr_iter_new(); |
3931 | iter=navit_attr_iter_new(); |
3913 | while(navit_get_attr(this->nav, attr_layout, &attr, iter)) { |
3932 | while(navit_get_attr(this->nav, attr_layout, &attr, iter)) { |
… | |
… | |
3945 | } |
3964 | } |
3946 | |
3965 | |
3947 | static void |
3966 | static void |
3948 | gui_internal_cmd_map_download_do(struct gui_priv *this, struct widget *wm, void *data) |
3967 | gui_internal_cmd_map_download_do(struct gui_priv *this, struct widget *wm, void *data) |
3949 | { |
3968 | { |
3950 | char *text=g_strdup_printf(_("Download %s"),wm->name); |
3969 | char *text=g_strdup_printf("Download %s",wm->name); |
3951 | struct widget *w, *wb; |
3970 | struct widget *w, *wb; |
3952 | struct map *map=data; |
3971 | struct map *map=data; |
3953 | double bllon,bllat,trlon,trlat; |
3972 | double bllon,bllat,trlon,trlat; |
3954 | |
3973 | |
3955 | wb=gui_internal_menu(this, text); |
3974 | wb=gui_internal_menu(this, text); |
… | |
… | |
4006 | found=1; |
4025 | found=1; |
4007 | } |
4026 | } |
4008 | on.type=off.type=attr_active; |
4027 | on.type=off.type=attr_active; |
4009 | on.u.num=1; |
4028 | on.u.num=1; |
4010 | off.u.num=0; |
4029 | off.u.num=0; |
4011 | wb=gui_internal_menu(this, wm->name?wm->name:_("Map Download")); |
4030 | wb=gui_internal_menu(this, wm->name?wm->name:"Map Download"); |
4012 | w=gui_internal_box_new(this, gravity_top_center|orientation_vertical|flags_expand|flags_fill); |
4031 | w=gui_internal_box_new(this, gravity_top_center|orientation_vertical|flags_expand|flags_fill); |
4013 | w->spy=this->spacing*3; |
4032 | w->spy=this->spacing*3; |
4014 | gui_internal_widget_append(wb, w); |
4033 | gui_internal_widget_append(wb, w); |
4015 | if (!search) { |
4034 | if (!search) { |
4016 | wma=gui_internal_button_map_attr_new(this, _("Active"), gravity_left_center|orientation_horizontal|flags_fill, map, &on, &off, 1); |
4035 | wma=gui_internal_button_map_attr_new(this, _("Active"), gravity_left_center|orientation_horizontal|flags_fill, map, &on, &off, 1); |
… | |
… | |
4043 | if ((bbox=strchr(buffer,'\t'))) |
4062 | if ((bbox=strchr(buffer,'\t'))) |
4044 | *bbox++='\0'; |
4063 | *bbox++='\0'; |
4045 | if (bbox && (size=strchr(bbox,'\t'))) |
4064 | if (bbox && (size=strchr(bbox,'\t'))) |
4046 | *size++='\0'; |
4065 | *size++='\0'; |
4047 | if (search && !strcmp(buffer, search)) { |
4066 | if (search && !strcmp(buffer, search)) { |
4048 | wma=gui_internal_button_new_with_callback(this, _("Download completely"), NULL, |
4067 | wma=gui_internal_button_new_with_callback(this, "Download completely", NULL, |
4049 | gravity_left_center|orientation_horizontal|flags_fill, gui_internal_cmd_map_download_do, map); |
4068 | gravity_left_center|orientation_horizontal|flags_fill, gui_internal_cmd_map_download_do, map); |
4050 | wma->name=g_strdup(buffer+sp); |
4069 | wma->name=g_strdup(buffer+sp); |
4051 | wma->prefix=g_strdup(bbox); |
4070 | wma->prefix=g_strdup(bbox); |
4052 | gui_internal_widget_append(w, wma); |
4071 | gui_internal_widget_append(w, wma); |
4053 | found=1; |
4072 | found=1; |
… | |
… | |
6355 | { |
6374 | { |
6356 | struct widget *menu,*wb,*w; |
6375 | struct widget *menu,*wb,*w; |
6357 | char *text; |
6376 | char *text; |
6358 | |
6377 | |
6359 | graphics_draw_mode(this->gra, draw_mode_begin); |
6378 | graphics_draw_mode(this->gra, draw_mode_begin); |
6360 | menu=gui_internal_menu(this, _("Show Locale")); |
6379 | menu=gui_internal_menu(this, "Show Locale"); |
6361 | menu->spx=this->spacing*10; |
6380 | menu->spx=this->spacing*10; |
6362 | wb=gui_internal_box_new(this, gravity_top_center|orientation_vertical|flags_expand|flags_fill); |
6381 | wb=gui_internal_box_new(this, gravity_top_center|orientation_vertical|flags_expand|flags_fill); |
6363 | gui_internal_widget_append(menu, wb); |
6382 | gui_internal_widget_append(menu, wb); |
6364 | text=g_strdup_printf("LANG=%1$s (1=%3$s 2=%2$s)",getenv("LANG"),"2","1"); |
6383 | text=g_strdup_printf("LANG=%1$s (1=%3$s 2=%2$s)",getenv("LANG"),"2","1"); |
6365 | gui_internal_widget_append(wb, w=gui_internal_label_new(this, text)); |
6384 | gui_internal_widget_append(wb, w=gui_internal_label_new(this, text)); |