mirror of
https://github.com/TorqueGameEngines/Torque3D.git
synced 2026-02-13 03:33:48 +00:00
Basic Platform::openWebBrowser implementation for linux
This commit is contained in:
parent
55c95a6146
commit
d3f51cf7c0
1 changed files with 19 additions and 1 deletions
|
|
@ -1,8 +1,26 @@
|
|||
#include "platform/platform.h"
|
||||
#include <string>
|
||||
|
||||
bool Platform::openWebBrowser( const char* webAddress )
|
||||
{
|
||||
return false; // TODO LINUX
|
||||
std::string startingURL(webAddress);
|
||||
std::string filteredURL;
|
||||
|
||||
unsigned short length = startingURL.length();
|
||||
for(unsigned short i = 0; i < length; i++)
|
||||
{
|
||||
filteredURL = filteredURL + '\\' + startingURL.at(i);
|
||||
}
|
||||
|
||||
std::string runCommand = "URL=" + filteredURL + "; xdg-open $URL > /dev/null 2> /dev/null";
|
||||
|
||||
short statusCode;
|
||||
statusCode = system(runCommand.c_str());
|
||||
|
||||
if(statusCode == 0)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#ifdef TORQUE_DEDICATED
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue