]> err.no Git - mapper/commitdiff
A bit larger info window. Small html change.
authorKaj-Michael Lang <milang@onion.tal.org>
Sun, 4 Nov 2007 20:05:09 +0000 (22:05 +0200)
committerKaj-Michael Lang <milang@onion.tal.org>
Sun, 4 Nov 2007 20:05:09 +0000 (22:05 +0200)
src/poi-gui.c

index dcb1e1a4f0ed6253da4d6996aa85a432c4252a53..4d9ecd0ff77c54502cadc2bd9478ba816920e248 100644 (file)
@@ -684,30 +684,34 @@ GtkWidget *info;
 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"),
@@ -717,6 +721,8 @@ 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);
@@ -726,7 +732,7 @@ gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), sw, TRUE, TRUE, 0);
 
 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);