示例#1
0
IntroPwdCheck::IntroPwdCheck(IntroWidget *parent) : IntroStage(parent),
errorAlpha(0),
_next(this, lang(lng_intro_submit), st::btnIntroNext),
_salt(parent->getPwdSalt()),
_hasRecovery(parent->getHasRecovery()),
_hint(parent->getPwdHint()),
_pwdField(this, st::inpIntroPassword, lang(lng_signin_password)),
_codeField(this, st::inpIntroPassword, lang(lng_signin_code)),
_toRecover(this, lang(lng_signin_recover)),
_toPassword(this, lang(lng_signin_try_password)),
_reset(this, lang(lng_signin_reset_account), st::btnRedLink),
sentRequest(0) {
	setVisible(false);
	setGeometry(parent->innerRect());

	connect(&_next, SIGNAL(clicked()), this, SLOT(onSubmitPwd()));
	connect(&checkRequest, SIGNAL(timeout()), this, SLOT(onCheckRequest()));
	connect(&_toRecover, SIGNAL(clicked()), this, SLOT(onToRecover()));
	connect(&_toPassword, SIGNAL(clicked()), this, SLOT(onToPassword()));
	connect(&_pwdField, SIGNAL(changed()), this, SLOT(onInputChange()));
	connect(&_codeField, SIGNAL(changed()), this, SLOT(onInputChange()));
	connect(&_reset, SIGNAL(clicked()), this, SLOT(onReset()));

	_pwdField.setEchoMode(QLineEdit::Password);

	if (!_hint.isEmpty()) {
		_hintText.setText(st::introFont, lng_signin_hint(lt_password_hint, _hint));
	}
	_codeField.hide();
	_toPassword.hide();
	_toRecover.show();
	_reset.hide();

	setMouseTracking(true);
}
示例#2
0
PasscodeBox::PasscodeBox(const QByteArray &newSalt, const QByteArray &curSalt, bool hasRecovery, const QString &hint, bool turningOff) : AbstractBox(st::boxWidth)
, _replacedBy(0)
, _turningOff(turningOff)
, _cloudPwd(true)
, _setRequest(0)
, _newSalt(newSalt)
, _curSalt(curSalt)
, _hasRecovery(hasRecovery)
, _skipEmailWarning(false)
, _aboutHeight(0)
, _about(st::boxWidth - st::boxPadding.left() * 1.5)
, _saveButton(this, lang(_turningOff ? lng_passcode_remove_button : lng_settings_save), st::defaultBoxButton)
, _cancelButton(this, lang(lng_cancel), st::cancelBoxButton)
, _oldPasscode(this, st::defaultInputField, lang(lng_cloud_password_enter_old))
, _newPasscode(this, st::defaultInputField, lang(curSalt.isEmpty() ? lng_cloud_password_enter_first : lng_cloud_password_enter_new))
, _reenterPasscode(this, st::defaultInputField, lang(lng_cloud_password_confirm_new))
, _passwordHint(this, st::defaultInputField, lang(curSalt.isEmpty() ? lng_cloud_password_hint : lng_cloud_password_change_hint))
, _recoverEmail(this, st::defaultInputField, lang(lng_cloud_password_email))
, _recover(this, lang(lng_signin_recover)) {
	textstyleSet(&st::usernameTextStyle);
	if (!hint.isEmpty()) _hintText.setText(st::normalFont, lng_signin_hint(lt_password_hint, hint));
	textstyleRestore();
	init();
	prepare();
}