tdesktop/Telegram/SourceFiles/intro/intro_start.cpp

51 lines
1.2 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
*/
2019-11-27 09:45:23 +00:00
#include "intro/intro_start.h"
2017-04-13 08:27:10 +00:00
#include "lang/lang_keys.h"
2019-11-22 09:40:52 +00:00
#include "intro/intro_qr.h"
2019-11-27 09:45:23 +00:00
#include "intro/intro_phone.h"
#include "ui/widgets/buttons.h"
#include "ui/widgets/labels.h"
2019-11-27 08:02:56 +00:00
#include "main/main_account.h"
2019-11-27 09:45:23 +00:00
#include "main/main_app_config.h"
2016-11-24 19:28:23 +00:00
namespace Intro {
2019-11-26 11:10:44 +00:00
namespace details {
2019-07-24 08:46:23 +00:00
StartWidget::StartWidget(
QWidget *parent,
not_null<Main::Account*> account,
2019-11-26 11:10:44 +00:00
not_null<Data*> data)
2019-07-24 08:46:23 +00:00
: Step(parent, account, data, true) {
setMouseTracking(true);
setTitleText(rpl::single(qsl("Telegram Desktop")));
setDescriptionText(tr::lng_intro_about());
2016-11-24 19:28:23 +00:00
show();
}
2016-11-24 19:28:23 +00:00
void StartWidget::submit() {
2019-11-27 08:02:56 +00:00
account().destroyStaleAuthorizationKeys();
2019-11-27 09:45:23 +00:00
const auto qrLogin = account().appConfig().get<QString>(
"qr_login_code",
"[not-set]");
DEBUG_LOG(("qr_login_code: %1").arg(qrLogin));
2019-11-27 09:45:23 +00:00
if (qrLogin == "primary") {
goNext<QrWidget>();
} else {
goNext<PhoneWidget>();
}
}
rpl::producer<QString> StartWidget::nextButtonText() const {
return tr::lng_start_msgs();
}
2019-11-26 11:10:44 +00:00
} // namespace details
2016-11-24 19:28:23 +00:00
} // namespace Intro