return TRUE;
}
+static void
+poi_info_url_cb(GtkHTML *html, const gchar *url, gpointer data)
+{
+g_printf("URL: %s\n", url);
+#ifdef WITH_OSSO
+/* XXX: Start browser... */
+#else
+
+#endif
+}
+
gboolean
poi_info_dialog(guint poi_id)
{
ls=strlen(p->label);
phtml=g_strdup_printf(
- "<html><body>"
- "<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>",
+ "<html><meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">"
+ "<body>"
+ "<b>%s%s</b><br><table>"
+ "<tr><th align=\"left\">Location:</th><td>%f, %f</td></tr>"
+ "<tr><th align=\"left\">Public:</th><td>%s</td></tr>"
+ "<tr><th align=\"left\">Source:</th><td>%s</td></tr>"
+ "<tr><th align=\"left\">Category:</th><td>%s</td></tr>"
+ "<tr><th align=\"left\">Description:</th><td>%s</td></tr>"
+ "<tr><th align=\"left\">URL:</th><td><a href=\"%s\">%s</a></td></tr>"
+ "<tr><th align=\"left\">Postal Code:</th><td>%s</td></tr>"
+ "</table></body></html>",
ls>0 ? p->label : p->cat_label,
ls==0 ? " (No name)" : "",
p->lat, p->lon,
info=gtk_html_new();
gtk_html_set_editable(GTK_HTML(info), FALSE);
+gtk_html_allow_selection(GTK_HTML(info), TRUE);
sw=gtk_scrolled_window_new(NULL, NULL);
gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
gtk_container_add(GTK_CONTAINER(sw), info);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(dialog)->vbox), sw, TRUE, TRUE, 0);
+g_signal_connect(G_OBJECT(info), "link_clicked", G_CALLBACK(poi_info_url_cb), NULL);
+
gtk_html_load_from_string(info, phtml, -1);
gtk_window_set_default_size(GTK_WINDOW(dialog), 500, 250);