void registrationKeyDialog::sRequest()
{
  QString urlstr("https://xtuple.com/request-new-license-key");
  QUrl    url(urlstr);

  XTupleProductKey pk(_key->text().trimmed());
  if (! pk.customerId().isEmpty())
    url.setQuery(QString("customerId=%1").arg(pk.customerId()), QUrl::StrictMode);

  _status->setHtml(tr("Opening %1").arg(urlstr));
  QDesktopServices::openUrl(url);
  _metrics->set("NewRegistrationKeyRequested",
                tr("New key requested on %1").arg(QDate::currentDate().toString(Qt::ISODate)));
}
Example #2
0
void OneSixUpdate::versionFileStart()
{
	setStatus("Getting the version files from Mojang.");

	QString urlstr("http://s3.amazonaws.com/Minecraft.Download/versions/");
	urlstr += targetVersion->descriptor() + "/" + targetVersion->descriptor() + ".json";
	auto job = new NetJob("Version index");
	job->addNetAction(ByteArrayDownload::make(QUrl(urlstr)));
	specificVersionDownloadJob.reset(job);
	connect(specificVersionDownloadJob.get(), SIGNAL(succeeded()), SLOT(versionFileFinished()));
	connect(specificVersionDownloadJob.get(), SIGNAL(failed()), SLOT(versionFileFailed()));
	connect(specificVersionDownloadJob.get(), SIGNAL(progress(qint64, qint64)),
			SIGNAL(progress(qint64, qint64)));
	specificVersionDownloadJob->start();
}
Example #3
0
MainWindow::MainWindow(char *urlx):iskeyboardshow(false)
{
    setWindowFlags(Qt::WindowStaysOnTopHint);
    this->showFullScreen();
//    this->setWindowFlags(Qt::WindowCloseButtonHint);
//    setWindowFlags(Qt::Tool | Qt::FramelessWindowHint);   // 隐藏标题栏己周围框架
//    this->setAttribute(Qt::WA_TranslucentBackground, true);        // 设置背景透明(version >= QT4.5)
//    this->setAttribute(Qt::WA_NoSystemBackground, true);
//    this->setAttribute(Qt::WA_NoBackground, true);
//    QPalette pal = palette();
//    pal.setColor(QPalette::Background, QColor(0x00,0x00,0x00,0x00));
//    this->setPalette(pal);
//    QMessageBox::warning(NULL,"MainWindow",QString("%1").arg((this->centralWidget() == 0)?"nil":"have"));
//    qApp->setStyleSheet("QMainWindow {background-image: url(:/images/111.png);}");

    frm = new QFrame();
    keyboardfrm = new mainForm;
    webView = new WebView(frm);
    pbExit = new QPushButton(frm);
    pbInput = new QPushButton(frm);

//    pbInput->setCheckable(true);

//    keyboardfrm->setAttribute(Qt::WA_TranslucentBackground, false);

    //webView->load(QUrl("http://10.6.14.60:8080/hipicd/cube/index.html"));
   // webView->load(QUrl("http://www.baidu.com"));

    if(NULL != urlx)
    {
        QString urlstr(urlx);

        if (-1 != urlstr.indexOf(QRegExp("[Ff][Ii][Ll][Ee]"),0))
        {
            qDebug() << "localfile: " << urlstr;
            webView->load(QUrl::fromLocalFile( urlstr));
        }
        else if (-1 == urlstr.indexOf(QRegExp("[Hh][Tt][Tt][Pp]"),0))
        {
            urlstr.prepend("http://");
        }


//        QMessageBox::warning(NULL, "error", urlstr);
        webView->load(QUrl(urlstr));
    }
    else
    {
        webView->load(QUrl("http://resource.hipidata.cn/web/s_index.html"));
    }


 
    webPage = webView->page();


//    webHistory = webPage->history();
    //webView->setD

//    urlAddr = new QLineEdit;
//    statusLabel = new QLabel;
//    progressBar = new QProgressBar;

    dockWidget = new QDockWidget();
    dockWidget->setFocusPolicy(Qt::NoFocus);
    dockWidget->setFocusProxy(0);
    dockWidget->setAllowedAreas(Qt::BottomDockWidgetArea);
    dockWidget->setFeatures(QDockWidget::DockWidgetClosable);
    this->setCorner(Qt::BottomLeftCorner, Qt::BottomDockWidgetArea);
//    dockWidget->setFloating(true);


	//ldockWidget = new QDockWidget();
	
	
	
    QFile file;
    file.setFileName(":/myjquery.js");
    file.open(QIODevice::ReadOnly);
    this->jQuery = file.readAll();
    file.close();


	//QMessageBox::about(this,jQuery,this->jQuery);
	//webPage->currentFrame()->evaluateJavaScript(jQuery);
	

//    createActions();
    //createMenus();
    //createToolBars();
    createCentralWidget();

//    createStatusBar();
    createKeyBoardDock();
//    createHeader();
   // createLeftDock();
    setKeyBoardDockShow(false);

    webPage->setLinkDelegationPolicy(QWebPage::DelegateAllLinks);



    connect(dockWidget->toggleViewAction(), SIGNAL(toggled(bool)), this, SLOT(on_dockwidget_toggled(bool)));
    connect(pbInput, SIGNAL(clicked()), this, SLOT(on_pbInput_clicked()));
    connect(pbExit, SIGNAL(clicked()), this, SLOT(on_pbExit_clicked()));
    connect(webView, SIGNAL(linkClicked( const QUrl & )), this, SLOT(myOnLinkClicked( const QUrl & )) );
    connect(webPage, SIGNAL(microFocusChanged()),this, SLOT(myContentChanged()));
    connect(webView, SIGNAL(titleChanged(QString)), this, SLOT(showTitle(const QString &)));

//    connect(urlAddr, SIGNAL(returnPressed()), this, SLOT(loadUrlAddr()));
//    connect(webView, SIGNAL(urlChanged(const QUrl &)), this, SLOT(displayUrlAddr(const QUrl &)));

//    connect(webView, SIGNAL(linkClicked( const QUrl & )), this, SLOT(setKeyBoardDockShow(true)) );
//    connect(webView, SIGNAL(titleChanged(const QString &)), this, SLOT(showTitle(const QString &)));
//    connect(webView, SIGNAL(statusBarMessage(const QString &)),statusLabel, SLOT(setText(const QString &)));

//    connect(webView, SIGNAL(loadStarted()), this, SLOT(webLoadStarted()));

//    connect(webView, SIGNAL(loadProgress(int)), this, SLOT(webLoadProgress(int)));
//    connect(webView, SIGNAL(loadFinished(bool)), this, SLOT(webLoadFinished(bool)));
//    connect(webView, SIGNAL(loadFinished(bool)), this, SLOT(webPage->currentFrame()->evaluateJavaScript(jQuery)));
}
Example #4
0
void OneSixUpdate::jarlibStart()
{
	OneSixInstance *inst = (OneSixInstance *)m_inst;
	bool successful = inst->reloadFullVersion();
	if (!successful)
	{
		emitFailed("Failed to load the version description file (version.json). It might be "
				   "corrupted, missing or simply too new.");
		return;
	}

	std::shared_ptr<OneSixVersion> version = inst->getFullVersion();

	// download the right jar, save it in versions/$version/$version.jar
	QString urlstr("http://s3.amazonaws.com/Minecraft.Download/versions/");
	urlstr += version->id + "/" + version->id + ".jar";
	QString targetstr("versions/");
	targetstr += version->id + "/" + version->id + ".jar";

	auto job = new NetJob("Libraries for instance " + inst->name());
	job->addNetAction(FileDownload::make(QUrl(urlstr), targetstr));
	jarlibDownloadJob.reset(job);

	auto libs = version->getActiveNativeLibs();
	libs.append(version->getActiveNormalLibs());

	auto metacache = MMC->metacache();
	QList<ForgeXzDownloadPtr> ForgeLibs;
	bool already_forge_xz = false;
	for (auto lib : libs)
	{
		if (lib->hint() == "local")
			continue;
		auto entry = metacache->resolveEntry("libraries", lib->storagePath());
		if (entry->stale)
		{
			if (lib->hint() == "forge-pack-xz")
			{
				ForgeLibs.append(ForgeXzDownload::make(lib->storagePath(), entry));
			}
			else
			{
				jarlibDownloadJob->addNetAction(CacheDownload::make(lib->downloadUrl(), entry));
			}
		}
	}
	// TODO: think about how to propagate this from the original json file... or IF AT ALL
	QString forgeMirrorList = "http://files.minecraftforge.net/mirror-brand.list";
	if (!ForgeLibs.empty())
	{
		jarlibDownloadJob->addNetAction(
			ForgeMirrors::make(ForgeLibs, jarlibDownloadJob, forgeMirrorList));
	}

	connect(jarlibDownloadJob.get(), SIGNAL(succeeded()), SLOT(jarlibFinished()));
	connect(jarlibDownloadJob.get(), SIGNAL(failed()), SLOT(jarlibFailed()));
	connect(jarlibDownloadJob.get(), SIGNAL(progress(qint64, qint64)),
			SIGNAL(progress(qint64, qint64)));

	jarlibDownloadJob->start();
}