wesnoth/wesnoth — pull request #300 by cbeck88 (2014-10-16 04:17:23+00:00)
Title: Clickable hyperlinks in gui2 labels

This branch adds support to open hyperlinks that are sent in chat messages.

More specifically, it adds a left click handler to all gui2 labels, including those in a scroll label, such as the chat history box.

The left click handler asks the underlying font::ttext to derefering the click location to a string index, using pango. Then it finds the token containing that index, and checks if it looks like a URL (starts with "http://" or "https://"). If so, it prompts the user if they would like to open the link. If they do, it runs desktop::open_object(token), which on (all?) platforms should result in the default web browser being used to view the link.