diff options
author | jandegr <jandegr@users.noreply.github.com> | 2016-09-05 16:13:48 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-09-05 16:13:48 +0200 |
commit | 1404d73fa7e196858fee6356c6e19924f7049feb (patch) | |
tree | 2308591bfb8d078b356f7089658ac22ecc9d59d5 /navit/gui/internal/gui_internal_command.c | |
parent | c00f2b0469dc34f69592254083c1e5d333f795d0 (diff) | |
download | navit-1404d73fa7e196858fee6356c6e19924f7049feb.tar.gz |
gui_internal_heightprofile
show a notification in heightprofile when no map is found providing heightlines
Diffstat (limited to 'navit/gui/internal/gui_internal_command.c')
-rw-r--r-- | navit/gui/internal/gui_internal_command.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/navit/gui/internal/gui_internal_command.c b/navit/gui/internal/gui_internal_command.c index 16a4cd25b..21e299162 100644 --- a/navit/gui/internal/gui_internal_command.c +++ b/navit/gui/internal/gui_internal_command.c @@ -456,15 +456,11 @@ gui_internal_cmd2_setting_layout(struct gui_priv *this, char *function, struct a * the name of the file providing the heightlines must * comply with *.heightlines.bin * - * todo : make it show a flat segment when using a tunnel */ static void gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, struct attr **in, struct attr ***out, int *valid) { - - struct widget * menu, *box; - struct map * map=NULL; struct map_rect * mr=NULL; struct route * route; @@ -507,6 +503,7 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st mr = NULL; ms=navit_get_mapset(this->nav); if (!first && ms) { + int heightmap_installed = FALSE; msh=mapset_open(ms); while ((map=mapset_next(msh, 1))) { struct attr name_attr; @@ -515,6 +512,7 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st if (strstr(name_attr.u.str,".heightlines.bin")){ dbg(lvl_info,"reading heightlines from map %s\n",name_attr.u.str); mr=map_rect_new(map, &sel); + heightmap_installed = TRUE; } else { dbg(lvl_debug,"ignoring map %s\n",name_attr.u.str); @@ -535,6 +533,14 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st } } mapset_close(msh); + if (!heightmap_installed){ + char *text; + struct widget *w; + text=g_strdup_printf("%s",_("please install a map *.heightlines.bin to provide elevationdata")); + gui_internal_widget_append(box, w=gui_internal_label_new(this, text)); + w->flags=gravity_bottom_center|orientation_horizontal|flags_fill; + g_free(text); + } } } map=NULL; @@ -576,7 +582,6 @@ gui_internal_cmd2_route_height_profile(struct gui_priv *this, char *function, st } last=c; } - } } if(mr) |