2014-05-30 08:53:19 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2018-01-03 10:23:14 +00:00
|
|
|
the official desktop application for the Telegram messaging service.
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2018-01-03 10:23:14 +00:00
|
|
|
For license and copyright information please follow this link:
|
|
|
|
https://github.com/telegramdesktop/tdesktop/blob/master/LEGAL
|
2014-05-30 08:53:19 +00:00
|
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
#include "intro/introwidget.h"
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-11-04 19:50:35 +00:00
|
|
|
namespace Ui {
|
|
|
|
class RoundButton;
|
2016-11-24 19:28:23 +00:00
|
|
|
class InputField;
|
2017-11-13 12:02:53 +00:00
|
|
|
class UserpicButton;
|
2016-11-04 19:50:35 +00:00
|
|
|
} // namespace Ui
|
|
|
|
|
2016-11-24 19:28:23 +00:00
|
|
|
namespace Intro {
|
|
|
|
|
2017-02-18 11:29:19 +00:00
|
|
|
class SignupWidget : public Widget::Step {
|
2014-05-30 08:53:19 +00:00
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2016-11-24 19:28:23 +00:00
|
|
|
SignupWidget(QWidget *parent, Widget::Data *data);
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2018-06-01 07:00:18 +00:00
|
|
|
void finishInit() override;
|
2016-11-24 19:28:23 +00:00
|
|
|
void setInnerFocus() override;
|
2016-03-14 16:59:18 +00:00
|
|
|
void activate() override;
|
|
|
|
void cancelled() override;
|
2016-11-24 19:28:23 +00:00
|
|
|
void submit() override;
|
|
|
|
QString nextButtonText() const override;
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-11-24 19:28:23 +00:00
|
|
|
protected:
|
|
|
|
void resizeEvent(QResizeEvent *e) override;
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-11-24 19:28:23 +00:00
|
|
|
private slots:
|
2014-05-30 08:53:19 +00:00
|
|
|
void onInputChange();
|
|
|
|
void onCheckRequest();
|
|
|
|
|
|
|
|
private:
|
2017-05-30 13:54:05 +00:00
|
|
|
void refreshLang();
|
|
|
|
void updateControlsGeometry();
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-11-24 19:28:23 +00:00
|
|
|
void nameSubmitDone(const MTPauth_Authorization &result);
|
|
|
|
bool nameSubmitFail(const RPCError &error);
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-11-24 19:28:23 +00:00
|
|
|
void stopCheck();
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2017-11-13 12:02:53 +00:00
|
|
|
object_ptr<Ui::UserpicButton> _photo;
|
2016-12-13 17:07:56 +00:00
|
|
|
object_ptr<Ui::InputField> _first;
|
|
|
|
object_ptr<Ui::InputField> _last;
|
2016-11-04 19:50:35 +00:00
|
|
|
QString _firstName, _lastName;
|
|
|
|
mtpRequestId _sentRequest = 0;
|
|
|
|
|
|
|
|
bool _invertOrder = false;
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2018-06-01 07:00:18 +00:00
|
|
|
bool _termsAccepted = false;
|
2016-12-13 17:07:56 +00:00
|
|
|
object_ptr<QTimer> _checkRequest;
|
2015-09-23 17:43:08 +00:00
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
};
|
2016-11-24 19:28:23 +00:00
|
|
|
|
|
|
|
} // namespace Intro
|