コード例 #1
0
void MainApplication::onProxyAuthenticationRequired(const QNetworkProxy& networkProxy, QAuthenticator* authenticator)
{
  PasswordDialog passwordDialog(activationWindow());
  passwordDialog.exec();

  if (passwordDialog.result() == QDialog::Accepted)
    authenticator->setUser(passwordDialog.userName());
    authenticator->setPassword(passwordDialog.password());
}
コード例 #2
0
void ConferenceAuthOp::onPasswordProvided(QDBusPendingCallWatcher *watcher)
{
    QDBusPendingReply<bool> reply = *watcher;
    if (!reply.isValid() || reply.count() < 1) {
        return;
    }

    if (reply.argumentAt<0>()) {
        m_walletInterface->setEntry(m_account,m_channel->targetId(), m_password);
        setFinished();
    } else {
        qDebug() << "Password was incorrect, enter again";
        passwordDialog();
    }
}
コード例 #3
0
void ConferenceAuthOp::passwordFlagOperationFinished(QDBusPendingCallWatcher *watcher)
{
    QDBusPendingReply<uint> reply = *watcher;
    if (reply.isError()) {
        qWarning() << "Reply is a error. ABORT!";
        return;
    }


    if (reply.argumentAt<0>() == Tp::ChannelPasswordFlagProvide) {
        if (m_walletInterface->hasEntry(m_account, m_channel->targetId())) {
            providePassword(m_walletInterface->entry(m_account, m_channel->targetId()));
        } else {
            passwordDialog();
        }
    }
}