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
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
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
Needs user action. / needs-user-action (push) Failing after 8s
Can't reproduce. / cant-reproduce (push) Failing after 8s
Close stale issues and PRs / stale (push) Has been cancelled
This commit is contained in:
68
Telegram/SourceFiles/intro/intro_qr.h
Normal file
68
Telegram/SourceFiles/intro/intro_qr.h
Normal file
@@ -0,0 +1,68 @@
|
||||
/*
|
||||
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 "ui/countryinput.h"
|
||||
#include "intro/intro_step.h"
|
||||
#include "base/timer.h"
|
||||
|
||||
namespace Ui {
|
||||
class LinkButton;
|
||||
} // namespace Ui
|
||||
|
||||
namespace Intro {
|
||||
namespace details {
|
||||
|
||||
class QrWidget final : public Step {
|
||||
public:
|
||||
QrWidget(
|
||||
QWidget *parent,
|
||||
not_null<Main::Account*> account,
|
||||
not_null<Data*> data);
|
||||
|
||||
QString accessibilityName() override;
|
||||
QString accessibilityDescription() override;
|
||||
|
||||
void activate() override;
|
||||
void finished() override;
|
||||
void cancelled() override;
|
||||
void submit() override;
|
||||
rpl::producer<QString> nextButtonText() const override;
|
||||
|
||||
bool hasBack() const override {
|
||||
return true;
|
||||
}
|
||||
|
||||
private:
|
||||
int errorTop() const override;
|
||||
|
||||
void sendCheckPasswordRequest();
|
||||
void setupControls();
|
||||
void setupPasskeyLink();
|
||||
void refreshCode();
|
||||
void checkForTokenUpdate(const MTPUpdates &updates);
|
||||
void checkForTokenUpdate(const MTPUpdate &update);
|
||||
void handleTokenResult(const MTPauth_LoginToken &result);
|
||||
void showTokenError(const MTP::Error &error);
|
||||
void importTo(MTP::DcId dcId, const QByteArray &token);
|
||||
void showToken(const QByteArray &token);
|
||||
void done(const MTPauth_Authorization &authorization);
|
||||
|
||||
rpl::event_stream<QByteArray> _qrCodes;
|
||||
Ui::LinkButton *_skip = nullptr;
|
||||
Ui::LinkButton *_passkey = nullptr;
|
||||
base::Timer _refreshTimer;
|
||||
mtpRequestId _requestId = 0;
|
||||
bool _forceRefresh = false;
|
||||
|
||||
};
|
||||
|
||||
[[nodiscard]] QImage TelegramLogoImage();
|
||||
|
||||
} // namespace details
|
||||
} // namespace Intro
|
||||
Reference in New Issue
Block a user