tdesktop/Telegram/SourceFiles/intro/introsignup.h

66 lines
1.3 KiB
C
Raw Normal View History

/*
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/introwidget.h"
namespace Ui {
class RoundButton;
2016-11-24 19:28:23 +00:00
class InputField;
class UserpicButton;
} // namespace Ui
2016-11-24 19:28:23 +00:00
namespace Intro {
class SignupWidget : public Widget::Step {
Q_OBJECT
public:
2019-07-24 08:46:23 +00:00
SignupWidget(
QWidget *parent,
not_null<Main::Account*> account,
not_null<Widget::Data*> data);
2018-06-01 07:00:18 +00:00
void finishInit() override;
2016-11-24 19:28:23 +00:00
void setInnerFocus() override;
void activate() override;
void cancelled() override;
2016-11-24 19:28:23 +00:00
void submit() override;
rpl::producer<QString> nextButtonText() const override;
2016-11-24 19:28:23 +00:00
protected:
void resizeEvent(QResizeEvent *e) override;
2016-11-24 19:28:23 +00:00
private slots:
void onInputChange();
void onCheckRequest();
private:
void refreshLang();
void updateControlsGeometry();
2016-11-24 19:28:23 +00:00
void nameSubmitDone(const MTPauth_Authorization &result);
bool nameSubmitFail(const RPCError &error);
2016-11-24 19:28:23 +00:00
void stopCheck();
object_ptr<Ui::UserpicButton> _photo;
object_ptr<Ui::InputField> _first;
object_ptr<Ui::InputField> _last;
QString _firstName, _lastName;
mtpRequestId _sentRequest = 0;
bool _invertOrder = false;
2018-06-01 07:00:18 +00:00
bool _termsAccepted = false;
object_ptr<QTimer> _checkRequest;
};
2016-11-24 19:28:23 +00:00
} // namespace Intro