Ejemplo n.º 1
0
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();
}
Ejemplo n.º 2
0
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();
}
Ejemplo n.º 3
0
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"));
}
Ejemplo n.º 4
0
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);
}