GtkWidget *sw;
poi_info *p;
gchar *phtml;
+gint ls;
p=poi_get_by_id(poi_id);
if (!p)
return FALSE;
+ls=strlen(p->label);
+
phtml=g_strdup_printf(
"<html><body>"
- "<b>%s</b><br>"
- "<div>"
- "<i>Location: </i>%f, %f<br>"
- "<i>Public: </i>%s<br>"
- "<i>Source: </i>%s<br>"
- "</div>"
- "<div><i>Category:</i><br>%s<br>"
- "<i>Description:</i><br>%s</div>"
- "<div><i>URL:</i>%s<br><i>Postal Code:</i>%s</div>"
- "</body></html>",
- strlen(p->label)>0 ? p->label : "Unnamed POI",
+ "<b>%s%s</b><br><div>"
+ "<i>Location:</i><br>%f, %f<br>"
+ "<i>Public:</i>%s<br>"
+ "<i>Source:</i>%s<br>"
+ "<i>Category:</i><br>%s<br>"
+ "<i>Description:</i><br>%s<br>"
+ "<i>URL:</i><a href=\"%s\">%s</a><br>"
+ "<i>Postal Code:</i>%s<br>"
+ "</div></body></html>",
+ ls>0 ? p->label : p->cat_label,
+ ls==0 ? " (No name)" : "",
p->lat, p->lon,
p->public==1 ? "Yes" : "No",
p->source==POI_SOURCE_OSM ? "OpenStreetMap" : "Other",
p->cat_label ? p->cat_label : "",
p->desc ? p->desc : "",
p->url ? p->url : "",
+ p->url ? p->url : "",
p->postal_code ? p->postal_code : "");
dialog=gtk_dialog_new_with_buttons(_("POI"),
GTK_RESPONSE_ACCEPT,
NULL);
+/* XXX: Add edit button */
+
info=gtk_html_new();
gtk_html_set_editable(GTK_HTML(info), FALSE);
sw=gtk_scrolled_window_new(NULL, NULL);
gtk_html_load_from_string(info, phtml, -1);
-gtk_window_set_default_size(GTK_WINDOW(dialog), 400, 250);
+gtk_window_set_default_size(GTK_WINDOW(dialog), 500, 250);
gtk_widget_show_all(dialog);
gtk_dialog_run(dialog);
gtk_widget_destroy(dialog);