summaryrefslogtreecommitdiff
path: root/src/openttd.cpp
diff options
context:
space:
mode:
authoryexo <yexo@openttd.org>2011-12-11 11:47:08 +0000
committeryexo <yexo@openttd.org>2011-12-11 11:47:08 +0000
commitb4fdba2fb3afcb80e419c048504a118ec8376c09 (patch)
tree036ce622e3bfe2b3176bfe3eecab55f9a943051b /src/openttd.cpp
parent0143f00d6fbe33f1de293c4149bf8ad05bac4d8a (diff)
downloadopenttd-b4fdba2fb3afcb80e419c048504a118ec8376c09.tar.xz
(svn r23490) -Add [FS#2750]: OpenBrowser function to open a browser on major OSes
Diffstat (limited to 'src/openttd.cpp')
-rw-r--r--src/openttd.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/openttd.cpp b/src/openttd.cpp
index a902d197d..f6b00e421 100644
--- a/src/openttd.cpp
+++ b/src/openttd.cpp
@@ -359,6 +359,15 @@ void MakeNewgameSettingsLive()
}
}
+void OpenBrowser(const char *url)
+{
+ /* Make sure we only accept urls that are sure to open a browser. */
+ if (strstr(url, "http://") != url && strstr(url, "https://") != url) return;
+
+ extern void OSOpenBrowser(const char *url);
+ OSOpenBrowser(url);
+}
+
/** Callback structure of statements to be executed after the NewGRF scan. */
struct AfterNewGRFScan : NewGRFScanCallback {
Year startyear; ///< The start year.