You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The idea is that in OpenTTD there exist situations where you would like to make OpenTTD open a specific URL in the users web browser.
This is known to be different on different platforms, so therefore I have tried to figure out how to do it on Windows, Linux and MacOSX. To keep track of the result I've decided to open this ticket and have it written down here.
Windows:
The ShellExecute function is used to Open an URL. So you simply pass the open-argument and the URL. I don't think it is necessary to write down exactly how to do it here, as google has tons of results concerning how to open an URL in Windows.
MacOSX:
On MacOSX there is an utility in PATH called 'open' that can be used to open URLs like this:
system("open http://www.google.com");
Linux:
On Linux there is no default browser property that is safe over all various distributions and desktop environment. But there is an intiative to provide developers with a tool to bridge this that eis_os told about: http://portland.freedesktop.org/wiki/XdgUtils
I have not tested XdgUtils, so I don't know how safe it is, but we might need to fallback on having a configurable setting in OpenTTD which would simply be a string containing the path to the web browser as well as any needed arguments before the URL is added. (The problem here is that OpenTTD don't have strings as a configuration type yet, so that need to be sorted out I guess.)
Zuu opened the ticket and wrote:
Reported version: trunk
Operating system: All
This issue was imported from FlySpray: https://bugs.openttd.org/task/2750
The text was updated successfully, but these errors were encountered: