Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

function to open an URL in web browser from OpenTTD #2750

Closed
DorpsGek opened this issue Mar 21, 2009 · 1 comment
Closed

function to open an URL in web browser from OpenTTD #2750

DorpsGek opened this issue Mar 21, 2009 · 1 comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)

Comments

@DorpsGek
Copy link
Member

Zuu opened the ticket and wrote:

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.)

Reported version: trunk
Operating system: All


This issue was imported from FlySpray: https://bugs.openttd.org/task/2750
@DorpsGek
Copy link
Member Author

Yexo closed the ticket.

Reason for closing: Implemented

In r23490


This comment was imported from FlySpray: https://bugs.openttd.org/task/2750

@DorpsGek DorpsGek added Core flyspray This issue is imported from FlySpray (https://bugs.openttd.org/) labels Apr 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
flyspray This issue is imported from FlySpray (https://bugs.openttd.org/)
Projects
None yet
Development

No branches or pull requests

1 participant