Example #1
0
static void button_bookmark(GtkWidget *widget, struct search_param *search)
{
	struct pcoord *c=NULL;
	GtkTreeIter iter;
	char *desc;
	struct attr attr;

	if (!gtk_tree_model_get_iter_first (GTK_TREE_MODEL (search->liststore2), &iter))
		return;
	gtk_tree_model_get (GTK_TREE_MODEL (search->liststore2), &iter, COL_COUNT, &c, -1);
	if (c) {
		navit_get_attr(search->nav, attr_bookmarks, &attr, NULL);
		desc=description(search, &iter);
		bookmarks_add_bookmark(attr.u.bookmarks, c, desc);
		g_free(desc);
	}
}
Example #2
0
static void
popup_set_bookmark(struct navit *nav, struct pcoord *pc)
{
    struct attr attr;
	struct coord c;
	struct coord_geo g;
	char buffer[1024];
	char buffer_geo[1024];
	c.x = pc->x;
	c.y = pc->y;
	transform_to_geo(pc->pro, &c, &g);
	coord_format(g.lat,g.lng,DEGREES_MINUTES_SECONDS,buffer_geo,sizeof(buffer_geo));
	sprintf(buffer,"Map Point %s", buffer_geo);
	if (!gui_add_bookmark(navit_get_gui(nav), pc, buffer)) {
        navit_get_attr(nav, attr_bookmarks, &attr, NULL);
		bookmarks_add_bookmark(attr.u.bookmarks, pc, buffer);
    }
}