open a web-page in the "default" browser. As there is
no standard convention for having a defualt browser in
Unix the only thing I could think of is something
like:
#ifdef WIN32
return JustExecWebPage()
#else
#ifdef __unix__
if( IsDisplayEnvVarSet())
{
if( KdeIsRunning())
{
return AskKdeWhatTheDefaultBrowserIs();
}
else if( GnomeIsRunning())
{
return AskGnomeWhatTheDefaultBrowserIs();
}
else if( CdeIsRunning())
{
return AskCdeWhatTheDefaultBrowserIs();
}
else if( IsMozillaInstalled())
{
return RunMozilla();
}
else if( IsNetscapeInstalled())
{
return RunNetscape();
}
else if( IsOperaInstalled())
{
return RunOpera();
}
else if( IsMosaicInstalled())
{
return RunMosaic();
}
}
if ( DoWeHaveATerminal() && IsLynxInstalled() )
{
return RunLynx();
}
/* Give up! */
return NULL;
#else
#error "Add support for this platform"
#endif
#endif
While this may work, it seems un-necessarily
complicated. Anyone have any better ideas???
Thanks in advance,
-Loren
Nažalost, niko nije imao bolju ideju :).
[Ovu poruku je menjao Burgos dana 27.07.2008. u 03:37 GMT+1]