init
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Some checks failed
Docker. / Ubuntu (push) Has been cancelled
User-agent updater. / User-agent (push) Failing after 15s
Lock Threads / lock (push) Failing after 10s
Waiting for answer. / waiting-for-answer (push) Failing after 22s
Close stale issues and PRs / stale (push) Successful in 13s
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
This commit is contained in:
98
Telegram/SourceFiles/intro/intro_code.h
Normal file
98
Telegram/SourceFiles/intro/intro_code.h
Normal file
@@ -0,0 +1,98 @@
|
||||
/*
|
||||
This file is part of Telegram Desktop,
|
||||
the official desktop application for the Telegram messaging service.
|
||||
|
||||
For license and copyright information please follow this link:
|
||||
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
||||
*/
|
||||
#pragma once
|
||||
|
||||
#include "intro/intro_step.h"
|
||||
#include "intro/intro_widget.h"
|
||||
#include "ui/widgets/fields/masked_input_field.h"
|
||||
#include "base/timer.h"
|
||||
|
||||
namespace Ui {
|
||||
class RoundButton;
|
||||
class LinkButton;
|
||||
class FlatLabel;
|
||||
class CodeInput;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Intro {
|
||||
namespace details {
|
||||
|
||||
enum class CallStatus;
|
||||
|
||||
class CodeWidget final : public Step {
|
||||
public:
|
||||
CodeWidget(
|
||||
QWidget *parent,
|
||||
not_null<Main::Account*> account,
|
||||
not_null<Data*> data);
|
||||
|
||||
bool hasBack() const override {
|
||||
return true;
|
||||
}
|
||||
void setInnerFocus() override;
|
||||
void activate() override;
|
||||
void finished() override;
|
||||
void cancelled() override;
|
||||
void submit() override;
|
||||
rpl::producer<QString> nextButtonText() const override;
|
||||
rpl::producer<const style::RoundButton*> nextButtonStyle() const override;
|
||||
|
||||
void updateDescText();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *e) override;
|
||||
|
||||
private:
|
||||
void noTelegramCode();
|
||||
void sendCall();
|
||||
void checkRequest();
|
||||
|
||||
int errorTop() const override;
|
||||
|
||||
[[nodiscard]] bool isEmailVerification() const;
|
||||
|
||||
void updateCallText();
|
||||
void refreshLang();
|
||||
void updateControlsGeometry();
|
||||
|
||||
void codeSubmitDone(const MTPauth_Authorization &result);
|
||||
void codeSubmitFail(const MTP::Error &error);
|
||||
void emailVerifyDone(const MTPaccount_EmailVerified &result);
|
||||
|
||||
void showCodeError(rpl::producer<QString> text);
|
||||
void callDone(const MTPauth_SentCode &result);
|
||||
void gotPassword(const MTPaccount_Password &result);
|
||||
|
||||
void noTelegramCodeDone(const MTPauth_SentCode &result);
|
||||
void noTelegramCodeFail(const MTP::Error &result);
|
||||
|
||||
void submitCode(const QString &text);
|
||||
|
||||
void stopCheck();
|
||||
|
||||
object_ptr<Ui::LinkButton> _noTelegramCode;
|
||||
mtpRequestId _noTelegramCodeRequestId = 0;
|
||||
|
||||
object_ptr<Ui::CodeInput> _code;
|
||||
QString _sentCode;
|
||||
mtpRequestId _sentRequest = 0;
|
||||
|
||||
rpl::variable<bool> _isFragment = false;
|
||||
|
||||
base::Timer _callTimer;
|
||||
CallStatus _callStatus = CallStatus();
|
||||
int _callTimeout;
|
||||
mtpRequestId _callRequestId = 0;
|
||||
object_ptr<Ui::FlatLabel> _callLabel;
|
||||
|
||||
base::Timer _checkRequestTimer;
|
||||
|
||||
};
|
||||
|
||||
} // namespace details
|
||||
} // namespace Intro
|
||||
Reference in New Issue
Block a user