support opening of link in browser in linux as well

This commit is contained in:
Vadim Lopatin 2015-01-27 21:59:58 +03:00
parent bb0c8ce1f0
commit 9510ec4c93
1 changed files with 13 additions and 10 deletions

View File

@ -883,17 +883,20 @@ class Platform {
return this;
}
/// override to support opening url in external browser
/// open url in external browser
bool openURL(string url) {
Log.d("Platform.openURL(", url, ") is called");
bool res = false;
version(Windows) {
import win32.shellapi;
ShellExecuteA(null, "open", url.toStringz, null, null, 1);
res = true;
}
// TODO: support other platforms
return res;
import std.process;
browse(url);
return true;
//Log.d("Platform.openURL(", url, ") is called");
//bool res = false;
//version(Windows) {
// import win32.shellapi;
// ShellExecuteA(null, "open", url.toStringz, null, null, 1);
// res = true;
//}
//// TODO: support other platforms
//return res;
}
}