示例#1
0
文件: web.cpp 项目: joejoyce/jsEngine
JSBool webLaunchBrowser(JSContext *cx, uintN argc, jsval *vp) {
	char *name = NULL;
		if(JSVAL_IS_STRING(*JS_ARGV(cx,vp)))
			name = JS_EncodeString(cx,JSVAL_TO_STRING(*JS_ARGV(cx,vp)));
		if(name){
			launchBrowser(name);
			JS_free(cx,name);
		}
	return JS_TRUE;
}
示例#2
0
文件: help.cpp 项目: AndreeeCZ/muse
void MusE::startHelpBrowser()
      {
      QString lang(getenv("LANG"));
      QString museHelp;
      bool pdffound = false;
      
#ifdef MUSE_USE_PDF_HELP_FILE
      museHelp = DOCDIR + QString("/muse_pdf/documentation_") + lang + QString(".pdf");
      if (access(museHelp.toLatin1(), R_OK) != 0)
      {
            museHelp = DOCDIR + QString("/muse_pdf/documentation.pdf");
            if (access(museHelp.toLatin1(), R_OK) != 0)
            {
                  //QString info(tr("no help found at: "));
                  //info += museHelp;
                  //info += tr("\nTrying HTML file instead...\n");
                  //QMessageBox::critical(this, tr("MusE: Open Help"), info);
                  fprintf(stderr, "MusE::startHelpBrowser() no help found at:%s\nTrying HTML file instead...",
                          museHelp.toLatin1().constData());
            }
            else
              pdffound = true;
      }
      else
        pdffound = true;
#endif            

      if(!pdffound)
      {
        museHelp = DOCDIR + QString("/muse_html/single/documentation/index_") + lang + QString(".html");
        if (access(museHelp.toLatin1(), R_OK) != 0) {
              museHelp = DOCDIR + QString("/muse_html/single/documentation/index.html");
              if (access(museHelp.toLatin1(), R_OK) != 0) {
                    QString info(tr("no help found at: "));
                    info += museHelp;
                    QMessageBox::critical(this, tr("MusE: Open Help"), info);
                    return;
                    }
              }
      }
      
      launchBrowser(museHelp);
      }
示例#3
0
int _tmain(int argc, _TCHAR* argv[])
{
	std::cout <<
		"\n_________        ___.                 _________         __    \n" <<
		"\\_   ___ \\___.__.\\_ |__   ___________ \\_   ___ \\_____ _/  |_  \n" <<
		"/    \\  \\<   |  | | __ \\_/ __ \\_  __ \\/    \\  \\/\\__  \\\\   __\\ \n" <<
		"\\     \\___\\___  | | \\_\\ \\  ___/|  | \\/\\     \\____/ __ \\|  |   \n" <<
		" \\______  / ____| |___  /\\___  >__|    \\______  (____  /__|   \n" <<
		"        \\/\\/          \\/     \\/               \\/     \\/       \n" <<
		"_________                        __  .__                      \n" <<
		"\\_   ___ \\_______   ____ _____ _/  |_|__| ____   ____   ______\n" <<
		"/    \\  \\/\\_  __ \\_/ __ \\\\__  \\\\   __\\  |/  _ \\ /    \\ /  ___/\n" <<
		"\\     \\____|  | \\/\\  ___/ / __ \\|  | |  (  <_> )   |  \\\\___ \\ \n" <<
		" \\______  /|__|    \\___  >____  /__| |__|\\____/|___|  /____  >\n" <<
		"        \\/             \\/     \\/                    \\/     \\/ \n\n" <<
		"WebDemo Launcher v0.1\n" <<
		"https://github.com/Suva/WebDemoLauncher\n\n";

	WebServer ws;
	int port = ws.getPort();
	launchBrowser("http://localhost:" + std::to_string(port));
	ws.handle();
}
示例#4
0
bool OSystem_POSIX::openUrl(const Common::String &url) {
#ifdef HAS_POSIX_SPAWN
	// inspired by Qt's "qdesktopservices_x11.cpp"

	// try "standards"
	if (launchBrowser("xdg-open", url))
		return true;
	if (launchBrowser(getenv("DEFAULT_BROWSER"), url))
		return true;
	if (launchBrowser(getenv("BROWSER"), url))
		return true;

	// try desktop environment specific tools
	if (launchBrowser("gnome-open", url)) // gnome
		return true;
	if (launchBrowser("kfmclient", url)) // kde
		return true;
	if (launchBrowser("exo-open", url)) // xfce
		return true;

	// try browser names
	if (launchBrowser("firefox", url))
		return true;
	if (launchBrowser("mozilla", url))
		return true;
	if (launchBrowser("netscape", url))
		return true;
	if (launchBrowser("opera", url))
		return true;
	if (launchBrowser("chromium-browser", url))
		return true;
	if (launchBrowser("google-chrome", url))
		return true;

	warning("openUrl() (POSIX) failed to open URL");
	return false;
#else
	return false;
#endif
}
示例#5
0
文件: help.cpp 项目: AndreeeCZ/muse
void MusE::startHomepageBrowser()
      {
      QString museHome = QString("http://www.muse-sequencer.org");

      launchBrowser(museHome);
      }
示例#6
0
文件: help.cpp 项目: AndreeeCZ/muse
void MusE::startBugBrowser()
      {
      QString museBugPage("http://www.muse-sequencer.org/index.php/Report_a_bug");
      launchBrowser(museBugPage);
      }
示例#7
0
void LoaderWindow::helpContents()
{
    launchBrowser(this, "http://wiki.xtuple.org/UpdaterDoc");
}