void STNewAccountAuthorizeView::fadeAnimated(float v){
    setOpacity(m_fadeAnimation->value()*m_cancelAnimation->value());
    this->setFocus();
    relayout();

    if(m_cancelAnimation->value()==0.f){
        // canceled or done.
        processAddedAccount();
        this->deleteLater();
    }else if(!wasCancelled()){
        if(m_fadeAnimation->value()==1.f){
            if(!m_authView){
                // authoization start!!
                m_authView=new STAuthorizeView();

                QRectF rt(10,36,320,413);
                rt.translate(m_window->offset());
                rt.translate(m_window->pos());

                mainView()->startAuthorizeView(m_authView, (m_cancelButton->pos()+m_window->pos()).toPoint(),
                                               rt.toRect());
                connect(m_authView, SIGNAL(cancelled()),
                        this, SLOT(cancelled()));

                QUrl userAuthURL("https://api.twitter.com/oauth/authorize");
                QPair<QString, QString> tokenParam = qMakePair(QString("oauth_token"), m_temporaryTokenString);
                QUrl openWebPageUrl(userAuthURL.toString(), QUrl::StrictMode);
                openWebPageUrl.addQueryItem(tokenParam.first, tokenParam.second);
                openWebPageUrl.addQueryItem("force_login", "true");
                m_authView->setUrl(openWebPageUrl);
            }
        }
    }
}
示例#2
0
void OAuthWizard::onTemporaryTokenReceived(QString token,
                                           QString /*tokenSecret*/) {
  setField("token", token);
  QUrl userAuthURL(m_server+"/oauth/authorize");
  if (m_oam->lastError() == KQOAuthManager::NoError)
    m_oam->getUserAuthorization(userAuthURL);
  else 
    errorMessage(tr("Network or authentication error!"));
}
示例#3
0
void Kaqtoos::onTemporaryTokenReceived(const QString &token, const QString &tokenSecret)
{
	qDebug() << "Temporary token received: " << token << tokenSecret;

	QUrl userAuthURL("http://api.kactoos.com/api/oauth/authorize");

	if(oauthManager->lastError() == KQOAuthManager::NoError) {
		qDebug() << "Asking for user's permission to access protected resources. Opening URL: " << userAuthURL;
		oauthManager->getUserAuthorization(userAuthURL);
	}

}
示例#4
0
void VimeoAuth::onTemporaryTokenReceived(QString token, QString tokenSecret)
{
    qDebug() << "Temporary token received: " << token << tokenSecret;

    QUrl userAuthURL("https://vimeo.com/oauth/authorize");

    if( oauthManager->lastError() == KQOAuthManager::NoError) {
        QUrl openUrl = oauthManager->getUserAuthorizationUrl(userAuthURL);
        qDebug() << "Asking for user's permission to access protected resources. Opening URL: " << openUrl;
        emit urlReady(openUrl);
    }
}