Files
tdesktop/Telegram/SourceFiles/intro/intro_qr.h
allhaileris afb81b8278
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
init
2026-02-16 15:50:16 +03:00

69 lines
1.6 KiB
C++

/*
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