MCPcopy Create free account
hub / github.com/TDesktop-x64/tdesktop / submit

Method submit

Telegram/SourceFiles/boxes/passcode_box.cpp:348–381  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

346}
347
348void PasscodeBox::submit() {
349 const auto has = currentlyHave();
350 if (_oldPasscode->hasFocus()) {
351 if (onlyCheckCurrent()) {
352 save();
353 } else {
354 _newPasscode->setFocus();
355 }
356 } else if (_newPasscode->hasFocus()) {
357 _reenterPasscode->setFocus();
358 } else if (_reenterPasscode->hasFocus()) {
359 if (has && _oldPasscode->text().isEmpty()) {
360 _oldPasscode->setFocus();
361 _oldPasscode->showError();
362 } else if (_newPasscode->text().isEmpty()) {
363 _newPasscode->setFocus();
364 _newPasscode->showError();
365 } else if (_reenterPasscode->text().isEmpty()) {
366 _reenterPasscode->showError();
367 } else if (!_passwordHint->isHidden()) {
368 _passwordHint->setFocus();
369 } else {
370 save();
371 }
372 } else if (_passwordHint->hasFocus()) {
373 if (_recoverEmail->isHidden()) {
374 save();
375 } else {
376 _recoverEmail->setFocus();
377 }
378 } else if (_recoverEmail->hasFocus()) {
379 save();
380 }
381}
382
383void PasscodeBox::paintEvent(QPaintEvent *e) {
384 BoxContent::paintEvent(e);

Callers

nothing calls this directly

Calls 15

MTP_flagsFunction · 0.85
MTP_stringFunction · 0.85
sendFunction · 0.85
handleFloodErrorsMethod · 0.80
MakeConfirmBoxFunction · 0.50
hasFocusMethod · 0.45
setFocusMethod · 0.45
isEmptyMethod · 0.45
textMethod · 0.45
showErrorMethod · 0.45
isHiddenMethod · 0.45
sendMethod · 0.45

Tested by

no test coverage detected