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; return this;
} }
/// override to support opening url in external browser /// open url in external browser
bool openURL(string url) { bool openURL(string url) {
Log.d("Platform.openURL(", url, ") is called"); import std.process;
bool res = false; browse(url);
version(Windows) { return true;
import win32.shellapi; //Log.d("Platform.openURL(", url, ") is called");
ShellExecuteA(null, "open", url.toStringz, null, null, 1); //bool res = false;
res = true; //version(Windows) {
} // import win32.shellapi;
// TODO: support other platforms // ShellExecuteA(null, "open", url.toStringz, null, null, 1);
return res; // res = true;
//}
//// TODO: support other platforms
//return res;
} }
} }