void QuetzalAccount::onPasswordRejected() { PasswordDialog *dialog = qobject_cast<PasswordDialog *>(sender()); QuetzalAccountPasswordInfo info = dialog->property("info").value<QuetzalAccountPasswordInfo>(); info.cancelCb(info.userData, info.fields); purple_request_fields_destroy(info.fields); dialog->deleteLater(); }
void EditDialog::on_generateButton_clicked() { PasswordDialog *dialog = new PasswordDialog(this); dialog->setModal(true); connect(dialog, &PasswordDialog::finished, [=](int state) { dialog->deleteLater(); }); connect(dialog, &PasswordDialog::generatePassword, this, &EditDialog::generate_password); dialog->show(); }
void YandexNarodAuthorizator::onDialogFinished(int dialogResult) { PasswordDialog *dialog = qobject_cast<PasswordDialog*>(sender()); Q_ASSERT(dialog); dialog->deleteLater(); if (dialogResult == PasswordDialog::Accepted) requestAuthorization(dialog->login(), dialog->password()); else emit result(Failure, tr("Has no login or password")); }
void QuetzalAccount::onPasswordEntered(const QString &password, bool remember) { PasswordDialog *dialog = qobject_cast<PasswordDialog *>(sender()); QuetzalAccountPasswordInfo info = dialog->property("info").value<QuetzalAccountPasswordInfo>(); PurpleRequestField *passwordField = purple_request_fields_get_field(info.fields, "password"); PurpleRequestField *rememberField = purple_request_fields_get_field(info.fields, "remember"); purple_request_field_string_set_value(passwordField, password.toUtf8().constData()); purple_request_field_bool_set_value(rememberField, remember); info.okCb(info.userData, info.fields); purple_request_fields_destroy(info.fields); dialog->deleteLater(); // if (remember) { // purple_account_set_password(password); // } // config("general").setValue("passwd", password, Config::Crypted); }