void DroneshareUploadDialog::startLogUpload(const QString& vehicleUuid)
{
    m_droneshareUpload = new DroneshareUpload();
    m_droneshareUpload->uploadLog(m_filename, m_username, m_password, vehicleUuid, DroneshareAPIKey);
    connect(m_droneshareUpload, SIGNAL(uploadComplete(QString)), this, SLOT(uploadComplete(QString)));
    connect(m_droneshareUpload, SIGNAL(uploadFailed(QString,QString)), this, SLOT(uploadFailed(QString,QString)));
    connect(m_droneshareUpload, SIGNAL(uploadProgress(int,int)), this, SLOT(uploadProgress(int,int)));

    ui->statusLabel->setText(tr("Uploading\n%1").arg(m_filename));
}
예제 #2
0
//virtual 
void LLAssetUploadResponder::result(const LLSD& content)
{
	lldebugs << "LLAssetUploadResponder::result from capabilities" << llendl;

	std::string state = content["state"];
	if (state == "upload")
	{
		uploadUpload(content);
	}
	else if (state == "complete")
	{
		// rename file in VFS with new asset id
		if (mFileName.empty())
		{
			// rename the file in the VFS to the actual asset id
			// llinfos << "Changing uploaded asset UUID to " << content["new_asset"].asUUID() << llendl;
			gVFS->renameFile(mVFileID, mAssetType, content["new_asset"].asUUID(), mAssetType);
		}
		uploadComplete(content);
	}
	else
	{
		uploadFailure(content);
	}
}
예제 #3
0
void QWebDAV::processPutFinished(QNetworkReply *reply)
{
    // Check if a prefix exists that must be removed now that it finished
    QString prefix = reply->request().attribute(
                QNetworkRequest::Attribute(
                    QNetworkRequest::User+ATTPREFIX)).toString();
    if( prefix != "" ) {
        QString tokens = "";
        QString fileNameTemp = reply->request().url().toString().replace(mHostname,"/files/webdav.php/");
        QString to = reply->request().url().toString().replace(prefix,"");
        QString fileName = to;
        fileName.replace(mHostname,"");
        if(mTransferLockRequests.contains(fileName)) {
            TransferLockRequest *request = &(mTransferLockRequests[fileName]);
            tokens = "<"+fileNameTemp+ "> (<" + request->tokenTemp + ">)"
                    +"</files/webdav.php/" +fileName +"> (<"+request->token+">)";
        }
        QByteArray verb("MOVE");
        sendWebdavRequest(reply->request().url(),DAVMOVE,verb,0,
                          to,tokens);
    }
    emit uploadComplete(
                reply->request().url().path().replace(
                    QRegExp("^"+mPathFilter),"").replace(prefix,""));
}
예제 #4
0
void FluushOption::imageCaptured(QPixmap p)
{
    QString savePath = QDir::tempPath() + "/" + QDateTime::currentDateTime().toString("dd_MM_yyyy_hh_mm_ss") + ".png";
    p.save(savePath);

    FluushRequestUpload *upRequest = new FluushRequestUpload(savePath, ui->apiKey->text(), net);
    net->sendMessage(upRequest);

    connect(upRequest, SIGNAL(uploadSuccess(QString)), this, SLOT(uploadComplete(QString)));
    connect(upRequest, SIGNAL(requestFailed(QString)), this, SLOT(requestError(QString)));
}