2014-05-30 08:53:19 +00:00
|
|
|
/*
|
|
|
|
This file is part of Telegram Desktop,
|
2014-12-01 10:47:38 +00:00
|
|
|
the official desktop version of Telegram messaging app, see https://telegram.org
|
2014-05-30 08:53:19 +00:00
|
|
|
|
|
|
|
Telegram Desktop is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
It is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
2015-10-03 13:16:42 +00:00
|
|
|
In addition, as a special exception, the copyright holders give permission
|
|
|
|
to link the code of portions of this program with the OpenSSL library.
|
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
Full license: https://github.com/telegramdesktop/tdesktop/blob/master/LICENSE
|
2016-02-08 10:56:18 +00:00
|
|
|
Copyright (c) 2014-2016 John Preston, https://desktop.telegram.org
|
2014-05-30 08:53:19 +00:00
|
|
|
*/
|
|
|
|
#include "stdafx.h"
|
2016-04-21 17:57:29 +00:00
|
|
|
#include "intro/introwidget.h"
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-04-21 17:57:29 +00:00
|
|
|
#include "lang.h"
|
2015-03-02 12:34:16 +00:00
|
|
|
#include "localstorage.h"
|
2016-03-14 16:59:18 +00:00
|
|
|
#include "intro/introstart.h"
|
2014-05-30 08:53:19 +00:00
|
|
|
#include "intro/introphone.h"
|
|
|
|
#include "intro/introcode.h"
|
|
|
|
#include "intro/introsignup.h"
|
2015-04-02 10:33:19 +00:00
|
|
|
#include "intro/intropwdcheck.h"
|
2014-05-30 08:53:19 +00:00
|
|
|
#include "mainwidget.h"
|
2016-04-12 21:31:28 +00:00
|
|
|
#include "mainwindow.h"
|
2014-05-30 08:53:19 +00:00
|
|
|
#include "application.h"
|
2016-04-14 11:00:23 +00:00
|
|
|
#include "ui/text/text.h"
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
IntroWidget::IntroWidget(QWidget *parent) : TWidget(parent)
|
2015-12-08 12:33:37 +00:00
|
|
|
, _a_stage(animation(this, &IntroWidget::step_stage))
|
|
|
|
, _a_show(animation(this, &IntroWidget::step_show))
|
2016-04-14 19:24:42 +00:00
|
|
|
, _back(this, st::setClose) {
|
2015-12-08 12:33:37 +00:00
|
|
|
setGeometry(QRect(0, st::titleHeight, App::wnd()->width(), App::wnd()->height() - st::titleHeight));
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
connect(&_back, SIGNAL(clicked()), this, SLOT(onBack()));
|
2014-11-26 16:45:52 +00:00
|
|
|
_back.hide();
|
|
|
|
|
2016-04-14 19:24:42 +00:00
|
|
|
_countryForReg = psCurrentCountry();
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-04-14 19:24:42 +00:00
|
|
|
MTP::send(MTPhelp_GetNearestDc(), rpcDone(&IntroWidget::gotNearestDC));
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
_stepHistory.push_back(new IntroStart(this));
|
2014-11-26 16:45:52 +00:00
|
|
|
_back.raise();
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
connect(parent, SIGNAL(resized(const QSize&)), this, SLOT(onParentResize(const QSize&)));
|
2014-05-30 08:53:19 +00:00
|
|
|
|
|
|
|
show();
|
|
|
|
setFocus();
|
2014-11-26 16:45:52 +00:00
|
|
|
|
2015-04-02 10:33:19 +00:00
|
|
|
cSetPasswordRecovered(false);
|
|
|
|
|
2014-11-26 16:45:52 +00:00
|
|
|
_back.move(st::setClosePos.x(), st::setClosePos.y());
|
2016-04-14 19:24:42 +00:00
|
|
|
|
|
|
|
#ifndef TDESKTOP_DISABLE_AUTOUPDATE
|
|
|
|
Sandbox::startUpdateCheck();
|
|
|
|
#endif
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
2014-12-19 21:20:30 +00:00
|
|
|
void IntroWidget::langChangeTo(int32 langId) {
|
|
|
|
_langChangeTo = langId;
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroWidget::onChangeLang() {
|
|
|
|
cSetLang(_langChangeTo);
|
2015-03-02 12:34:16 +00:00
|
|
|
Local::writeSettings();
|
2014-12-19 21:20:30 +00:00
|
|
|
cSetRestarting(true);
|
|
|
|
cSetRestartingToSettings(false);
|
|
|
|
App::quit();
|
|
|
|
}
|
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
void IntroWidget::onParentResize(const QSize &newSize) {
|
|
|
|
resize(newSize);
|
|
|
|
}
|
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
void IntroWidget::onStepSubmit() {
|
|
|
|
step()->onSubmit();
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
void IntroWidget::onBack() {
|
|
|
|
historyMove(MoveBack);
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroWidget::historyMove(MoveType type) {
|
|
|
|
if (_a_stage.animating()) return;
|
|
|
|
|
|
|
|
t_assert(_stepHistory.size() > 1);
|
|
|
|
|
2015-10-15 11:51:10 +00:00
|
|
|
if (App::app()) App::app()->mtpPause();
|
2015-10-15 10:18:24 +00:00
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
switch (type) {
|
|
|
|
case MoveBack: {
|
|
|
|
_cacheHide = grabStep();
|
|
|
|
|
|
|
|
IntroStep *back = step();
|
|
|
|
_backFrom = back->hasBack() ? 1 : 0;
|
|
|
|
_stepHistory.pop_back();
|
|
|
|
back->cancelled();
|
|
|
|
delete back;
|
|
|
|
} break;
|
|
|
|
|
|
|
|
case MoveForward: {
|
|
|
|
_cacheHide = grabStep(1);
|
|
|
|
_backFrom = step(1)->hasBack() ? 1 : 0;
|
|
|
|
step(1)->finished();
|
|
|
|
} break;
|
|
|
|
|
|
|
|
case MoveReplace: {
|
|
|
|
_cacheHide = grabStep(1);
|
|
|
|
IntroStep *replaced = step(1);
|
|
|
|
_backFrom = replaced->hasBack() ? 1 : 0;
|
|
|
|
_stepHistory.removeAt(_stepHistory.size() - 2);
|
|
|
|
replaced->finished();
|
|
|
|
delete replaced;
|
|
|
|
} break;
|
|
|
|
}
|
2015-04-04 20:01:34 +00:00
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
_cacheShow = grabStep();
|
|
|
|
_backTo = step()->hasBack() ? 1 : 0;
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
int32 m = (type == MoveBack) ? -1 : 1;
|
2015-10-17 14:52:26 +00:00
|
|
|
a_coordHide = anim::ivalue(0, -m * st::introSlideShift);
|
|
|
|
a_opacityHide = anim::fvalue(1, 0);
|
|
|
|
a_coordShow = anim::ivalue(m * st::introSlideShift, 0);
|
|
|
|
a_opacityShow = anim::fvalue(0, 1);
|
|
|
|
_a_stage.start();
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2015-12-08 12:33:37 +00:00
|
|
|
_a_stage.step();
|
2014-11-26 16:45:52 +00:00
|
|
|
if (_backFrom > 0 || _backTo > 0) {
|
|
|
|
_back.show();
|
|
|
|
} else {
|
|
|
|
_back.hide();
|
|
|
|
}
|
2016-03-14 16:59:18 +00:00
|
|
|
step()->hide();
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
void IntroWidget::pushStep(IntroStep *step, MoveType type) {
|
|
|
|
_stepHistory.push_back(step);
|
|
|
|
_back.raise();
|
|
|
|
_stepHistory.back()->hide();
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
historyMove(type);
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
2016-04-14 19:24:42 +00:00
|
|
|
void IntroWidget::gotNearestDC(const MTPNearestDc &result) {
|
|
|
|
const auto &nearest(result.c_nearestDc());
|
|
|
|
DEBUG_LOG(("Got nearest dc, country: %1, nearest: %2, this: %3").arg(nearest.vcountry.c_string().v.c_str()).arg(nearest.vnearest_dc.v).arg(nearest.vthis_dc.v));
|
|
|
|
MTP::setdc(result.c_nearestDc().vnearest_dc.v, true);
|
|
|
|
if (_countryForReg != nearest.vcountry.c_string().v.c_str()) {
|
|
|
|
_countryForReg = nearest.vcountry.c_string().v.c_str();
|
|
|
|
emit countryChanged();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
QPixmap IntroWidget::grabStep(int skip) {
|
|
|
|
return myGrab(step(skip), QRect(st::introSlideShift, 0, st::introSize.width(), st::introSize.height()));
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IntroWidget::animShow(const QPixmap &bgAnimCache, bool back) {
|
2015-10-15 11:51:10 +00:00
|
|
|
if (App::app()) App::app()->mtpPause();
|
2015-10-15 10:18:24 +00:00
|
|
|
|
2015-10-17 14:52:26 +00:00
|
|
|
(back ? _cacheOver : _cacheUnder) = bgAnimCache;
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2015-10-17 14:52:26 +00:00
|
|
|
_a_show.stop();
|
2016-03-14 16:59:18 +00:00
|
|
|
step()->show();
|
|
|
|
if (step()->hasBack()) {
|
2014-11-26 16:45:52 +00:00
|
|
|
_back.setOpacity(1);
|
|
|
|
_back.show();
|
|
|
|
} else {
|
|
|
|
_back.hide();
|
|
|
|
}
|
2015-10-17 14:52:26 +00:00
|
|
|
(back ? _cacheUnder : _cacheOver) = myGrab(this);
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2016-03-14 16:59:18 +00:00
|
|
|
step()->hide();
|
2014-11-26 16:45:52 +00:00
|
|
|
_back.hide();
|
2015-10-17 14:52:26 +00:00
|
|
|
|
2016-05-14 16:57:06 +00:00
|
|
|
a_coordUnder = back ? anim::ivalue(-st::slideShift, 0) : anim::ivalue(0, -st::slideShift);
|
2015-10-17 14:52:26 +00:00
|
|
|
a_coordOver = back ? anim::ivalue(0, width()) : anim::ivalue(width(), 0);
|
|
|
|
a_shadow = back ? anim::fvalue(1, 0) : anim::fvalue(0, 1);
|
|
|
|
_a_show.start();
|
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
show();
|
|
|
|
}
|
|
|
|
|
2015-12-08 12:33:37 +00:00
|
|
|
void IntroWidget::step_show(float64 ms, bool timer) {
|
2015-10-17 14:52:26 +00:00
|
|
|
float64 dt = ms / st::slideDuration;
|
|
|
|
if (dt >= 1) {
|
|
|
|
_a_show.stop();
|
|
|
|
|
|
|
|
a_coordUnder.finish();
|
|
|
|
a_coordOver.finish();
|
|
|
|
a_shadow.finish();
|
|
|
|
|
|
|
|
_cacheUnder = _cacheOver = QPixmap();
|
|
|
|
|
|
|
|
setFocus();
|
2016-03-14 16:59:18 +00:00
|
|
|
step()->activate();
|
|
|
|
if (step()->hasBack()) {
|
2015-10-17 14:52:26 +00:00
|
|
|
_back.setOpacity(1);
|
|
|
|
_back.show();
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
2015-10-17 14:52:26 +00:00
|
|
|
if (App::app()) App::app()->mtpUnpause();
|
|
|
|
} else {
|
|
|
|
a_coordUnder.update(dt, st::slideFunction);
|
|
|
|
a_coordOver.update(dt, st::slideFunction);
|
|
|
|
a_shadow.update(dt, st::slideFunction);
|
|
|
|
}
|
2015-12-08 12:33:37 +00:00
|
|
|
if (timer) update();
|
2015-10-17 14:52:26 +00:00
|
|
|
}
|
|
|
|
|
2015-12-08 12:33:37 +00:00
|
|
|
void IntroWidget::stop_show() {
|
2015-10-17 14:52:26 +00:00
|
|
|
_a_show.stop();
|
|
|
|
}
|
|
|
|
|
2015-12-08 12:33:37 +00:00
|
|
|
void IntroWidget::step_stage(float64 ms, bool timer) {
|
2015-10-17 14:52:26 +00:00
|
|
|
float64 fullDuration = st::introSlideDelta + st::introSlideDuration, dt = ms / fullDuration;
|
|
|
|
float64 dt1 = (ms > st::introSlideDuration) ? 1 : (ms / st::introSlideDuration), dt2 = (ms > st::introSlideDelta) ? (ms - st::introSlideDelta) / (st::introSlideDuration) : 0;
|
|
|
|
if (dt >= 1) {
|
2015-12-08 12:33:37 +00:00
|
|
|
_a_stage.stop();
|
|
|
|
|
2015-10-17 14:52:26 +00:00
|
|
|
a_coordShow.finish();
|
|
|
|
a_opacityShow.finish();
|
2014-05-30 08:53:19 +00:00
|
|
|
|
2015-10-17 14:52:26 +00:00
|
|
|
_cacheHide = _cacheShow = QPixmap();
|
2014-05-30 08:53:19 +00:00
|
|
|
|
|
|
|
setFocus();
|
2016-03-14 16:59:18 +00:00
|
|
|
step()->activate();
|
|
|
|
if (!step()->hasBack()) {
|
2014-11-26 16:45:52 +00:00
|
|
|
_back.hide();
|
|
|
|
}
|
2015-10-15 10:18:24 +00:00
|
|
|
if (App::app()) App::app()->mtpUnpause();
|
2014-05-30 08:53:19 +00:00
|
|
|
} else {
|
2015-10-17 14:52:26 +00:00
|
|
|
a_coordShow.update(dt2, st::introShowFunc);
|
|
|
|
a_opacityShow.update(dt2, st::introAlphaShowFunc);
|
|
|
|
a_coordHide.update(dt1, st::introHideFunc);
|
|
|
|
a_opacityHide.update(dt1, st::introAlphaHideFunc);
|
2014-11-26 16:45:52 +00:00
|
|
|
if (_backFrom != _backTo) {
|
2015-10-17 14:52:26 +00:00
|
|
|
_back.setOpacity((_backFrom > _backTo) ? a_opacityHide.current() : a_opacityShow.current());
|
2014-11-26 16:45:52 +00:00
|
|
|
} else {
|
|
|
|
_back.setOpacity(1);
|
|
|
|
}
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
2015-12-08 12:33:37 +00:00
|
|
|
if (timer) update();
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IntroWidget::paintEvent(QPaintEvent *e) {
|
|
|
|
bool trivial = (rect() == e->rect());
|
|
|
|
setMouseTracking(true);
|
|
|
|
|
|
|
|
QPainter p(this);
|
|
|
|
if (!trivial) {
|
|
|
|
p.setClipRect(e->rect());
|
|
|
|
}
|
2015-09-29 15:40:06 +00:00
|
|
|
p.fillRect(e->rect(), st::white->b);
|
2015-10-17 14:52:26 +00:00
|
|
|
if (_a_show.animating()) {
|
|
|
|
if (a_coordOver.current() > 0) {
|
2015-10-18 23:01:18 +00:00
|
|
|
p.drawPixmap(QRect(0, 0, a_coordOver.current(), height()), _cacheUnder, QRect(-a_coordUnder.current() * cRetinaFactor(), 0, a_coordOver.current() * cRetinaFactor(), height() * cRetinaFactor()));
|
2015-10-17 14:52:26 +00:00
|
|
|
p.setOpacity(a_shadow.current() * st::slideFadeOut);
|
|
|
|
p.fillRect(0, 0, a_coordOver.current(), height(), st::black->b);
|
|
|
|
p.setOpacity(1);
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
2015-10-17 14:52:26 +00:00
|
|
|
p.drawPixmap(a_coordOver.current(), 0, _cacheOver);
|
|
|
|
p.setOpacity(a_shadow.current());
|
2016-04-21 17:57:29 +00:00
|
|
|
p.drawPixmap(QRect(a_coordOver.current() - st::slideShadow.pxWidth(), 0, st::slideShadow.pxWidth(), height()), App::sprite(), st::slideShadow.rect());
|
2015-10-17 14:52:26 +00:00
|
|
|
} else if (_a_stage.animating()) {
|
|
|
|
p.setOpacity(a_opacityHide.current());
|
2016-03-14 16:59:18 +00:00
|
|
|
p.drawPixmap(step()->x() + st::introSlideShift + a_coordHide.current(), step()->y(), _cacheHide);
|
2015-10-17 14:52:26 +00:00
|
|
|
p.setOpacity(a_opacityShow.current());
|
2016-03-14 16:59:18 +00:00
|
|
|
p.drawPixmap(step()->x() + st::introSlideShift + a_coordShow.current(), step()->y(), _cacheShow);
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
QRect IntroWidget::innerRect() const {
|
|
|
|
int innerWidth = st::introSize.width() + 2 * st::introSlideShift, innerHeight = st::introSize.height();
|
|
|
|
return QRect((width() - innerWidth) / 2, (height() - innerHeight) / 2, innerWidth, (height() + innerHeight) / 2);
|
|
|
|
}
|
|
|
|
|
|
|
|
QString IntroWidget::currentCountry() const {
|
2016-04-14 19:24:42 +00:00
|
|
|
return _countryForReg;
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IntroWidget::setPhone(const QString &phone, const QString &phone_hash, bool registered) {
|
|
|
|
_phone = phone;
|
|
|
|
_phone_hash = phone_hash;
|
|
|
|
_registered = registered;
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroWidget::setCode(const QString &code) {
|
|
|
|
_code = code;
|
|
|
|
}
|
|
|
|
|
2015-04-02 10:33:19 +00:00
|
|
|
void IntroWidget::setPwdSalt(const QByteArray &salt) {
|
|
|
|
_pwdSalt = salt;
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroWidget::setHasRecovery(bool has) {
|
|
|
|
_hasRecovery = has;
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroWidget::setPwdHint(const QString &hint) {
|
|
|
|
_pwdHint = hint;
|
|
|
|
}
|
|
|
|
|
2015-08-31 14:27:20 +00:00
|
|
|
void IntroWidget::setCodeByTelegram(bool byTelegram) {
|
|
|
|
_codeByTelegram = byTelegram;
|
|
|
|
}
|
|
|
|
|
2016-03-15 19:38:30 +00:00
|
|
|
void IntroWidget::setCallStatus(const CallStatus &status) {
|
|
|
|
_callStatus = status;
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
const QString &IntroWidget::getPhone() const {
|
|
|
|
return _phone;
|
|
|
|
}
|
|
|
|
|
|
|
|
const QString &IntroWidget::getPhoneHash() const {
|
|
|
|
return _phone_hash;
|
|
|
|
}
|
|
|
|
|
|
|
|
const QString &IntroWidget::getCode() const {
|
|
|
|
return _code;
|
|
|
|
}
|
|
|
|
|
2016-03-15 19:38:30 +00:00
|
|
|
const IntroWidget::CallStatus &IntroWidget::getCallStatus() const {
|
|
|
|
return _callStatus;
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
2015-04-02 10:33:19 +00:00
|
|
|
const QByteArray &IntroWidget::getPwdSalt() const {
|
|
|
|
return _pwdSalt;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IntroWidget::getHasRecovery() const {
|
|
|
|
return _hasRecovery;
|
|
|
|
}
|
|
|
|
|
|
|
|
const QString &IntroWidget::getPwdHint() const {
|
|
|
|
return _pwdHint;
|
|
|
|
}
|
|
|
|
|
2015-08-31 14:27:20 +00:00
|
|
|
bool IntroWidget::codeByTelegram() const {
|
|
|
|
return _codeByTelegram;
|
|
|
|
}
|
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
void IntroWidget::resizeEvent(QResizeEvent *e) {
|
|
|
|
QRect r(innerRect());
|
2016-03-14 16:59:18 +00:00
|
|
|
for (IntroStep *step : _stepHistory) {
|
|
|
|
step->setGeometry(r);
|
|
|
|
}
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void IntroWidget::finish(const MTPUser &user, const QImage &photo) {
|
2015-12-08 12:33:37 +00:00
|
|
|
App::wnd()->setupMain(true, &user);
|
2014-05-30 08:53:19 +00:00
|
|
|
if (!photo.isNull()) {
|
|
|
|
App::app()->uploadProfilePhoto(photo, MTP::authedId());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
void IntroWidget::keyPressEvent(QKeyEvent *e) {
|
2015-10-17 14:52:26 +00:00
|
|
|
if (_a_show.animating() || _a_stage.animating()) return;
|
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
if (e->key() == Qt::Key_Escape) {
|
2016-03-14 16:59:18 +00:00
|
|
|
if (step()->hasBack()) {
|
|
|
|
onBack();
|
|
|
|
}
|
2014-05-30 08:53:19 +00:00
|
|
|
} else if (e->key() == Qt::Key_Enter || e->key() == Qt::Key_Return || e->key() == Qt::Key_Space) {
|
2016-03-14 16:59:18 +00:00
|
|
|
onStepSubmit();
|
2014-05-30 08:53:19 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2016-02-28 12:36:23 +00:00
|
|
|
void IntroWidget::rpcClear() {
|
2016-03-14 16:59:18 +00:00
|
|
|
for (IntroStep *step : _stepHistory) {
|
|
|
|
step->rpcClear();
|
|
|
|
}
|
2014-08-01 11:09:46 +00:00
|
|
|
}
|
|
|
|
|
2014-05-30 08:53:19 +00:00
|
|
|
IntroWidget::~IntroWidget() {
|
2016-03-14 16:59:18 +00:00
|
|
|
while (!_stepHistory.isEmpty()) {
|
|
|
|
IntroStep *back = _stepHistory.back();
|
|
|
|
_stepHistory.pop_back();
|
|
|
|
delete back;
|
|
|
|
}
|
2014-05-30 08:53:19 +00:00
|
|
|
if (App::wnd()) App::wnd()->noIntro(this);
|
|
|
|
}
|