Beispiel #1
0
O1Beatport::O1Beatport(QObject *parent) :
    O1(parent),
    _dialogContent(new Ui::BeatportAuthentication),
    _dialog(new QDialog),
    _status(InitialState)
{
    if(QByteArray(BEATPORT_API_KEY).isEmpty() || QByteArray(BEATPORT_API_SECRET).isEmpty()) {
        _status = APIKeysMissing;
        return;
    } else {
        setClientId(BEATPORT_API_KEY);
        setClientSecret(BEATPORT_API_SECRET);
    }

    _dialogContent->setupUi(_dialog);
    connect(_dialogContent->webView, &QWebView::linkClicked,
            this, &O1Beatport::onLinkClickedInsideWebView);

    setAccessTokenUrl(QUrl("https://oauth-api.beatport.com/identity/1/oauth/access-token"));
    setAuthorizeUrl(QUrl("https://oauth-api.beatport.com/identity/1/oauth/authorize"));
    setRequestTokenUrl(QUrl("https://oauth-api.beatport.com/identity/1/oauth/request-token"));

    connect(this, &O1::openBrowser, this, &O1Beatport::onOpenBrowser);
    connect(this, &O1::closeBrowser, _dialog, &QDialog::hide);
    connect(this, &O1::linkedChanged, this, &O1Beatport::onLinkingChanged);
    connect(this, &O1::linkingSucceeded, this, &O1Beatport::onLinkingSucceeded);
}
Beispiel #2
0
void O1Tomboy::setBaseURL(const QString &value)
{
    setRequestTokenUrl(QUrl(value + QStringLiteral("/oauth/request_token")));
    setAuthorizeUrl(QUrl(value + QStringLiteral("/oauth/authorize")));
    setAccessTokenUrl(QUrl(value + QStringLiteral("/oauth/access_token")));
    setClientId(QStringLiteral("anyone"));
    setClientSecret(QStringLiteral("anyone"));
}