Пример #1
0
void About::show() {
	qDebug() << "XXXX About: show()";
	qDebug() << "XXXX finding NavigationPane object from cache";
	Navigator* nav = Navigator::getInstance();
	NavigationPane* navpane = nav->getNavigationPane();
	_root = _qml->createRootObject<Page>();
	navpane->push(_root);
}
void About::show() {
	qDebug() << "About: show()";
	qDebug() << "finding NavigationPane object from cache";
	Navigator* nav = Navigator::getInstance();
	NavigationPane* navpane = nav->getNavigationPane();
	// refresh _root
	_root = _qml->createRootNode<AbstractPane>();
	navpane->push(_root);
}
void ApduDetails::show() {
	qDebug() << "XXXX ApduDetails: show()";

	qDebug() << "XXXX finding NavigationPane object from cache";
	Navigator* nav = Navigator::getInstance();
	NavigationPane* navpane = nav->getNavigationPane();
	_root = _qml->createRootObject<Page>();
	navpane->push(_root);

	findAndConnectControls();
}
void EventLog::onBackNavigationTriggered() {
	qDebug() << "finding NavigationPane object from cache";
	Navigator* nav = Navigator::getInstance();
	NavigationPane* navpane = nav->getNavigationPane();
	// refresh _root
	_root = _qml->createRootNode<AbstractPane>();
	navpane->popAndDelete();

	qDebug() << "EventLog:emit hide()";
	emit back();
}
void EventLog::show() {
	qDebug() << "EventLog: show()";

	qDebug() << "finding NavigationPane object from cache";
	Navigator* nav = Navigator::getInstance();
	NavigationPane* navpane = nav->getNavigationPane();
	// refresh _root
	_root = _qml->createRootNode<AbstractPane>();
	navpane->push(_root);

	//find and reconnect all the controls again, because we had to refresh the root pointer
	findAndConnectControls();
}
Пример #6
0
void IntroScreen::_sendCodeCallback(struct tgl_state *TLS, void *callback_extra, int success, struct tgl_user *self)
{
    IntroScreen* _this = (IntroScreen*)callback_extra;
    if (success)
    {
        _this->m_app->showMainScreen();
    }
    else
    {
        NavigationPane* navigationPane = _this->m_rootObject;
        navigationPane->setBackButtonsVisible(true);
        while (navigationPane->count() > 3)
            navigationPane->pop();

        emit _this->wrongCode();
    }
}
Пример #7
0
void IntroScreen::submitCode(const QString& code)
{
    QByteArray _user = m_phone.toLocal8Bit();
    QByteArray _hash = m_codeHash.toLocal8Bit();
    QByteArray _code = code.toLocal8Bit();
    m_code = code;
    if (m_registered)
        tgl_do_send_code_result(gTLS, _user.data(), _hash.data(), _code.data(), _sendCodeCallback, this);
    else if (m_firstName.size() && m_lastName.size())
    {
        tgl_do_send_code_result_auth(gTLS, _user.data(), _hash.data(), _code.data(), m_firstName.toUtf8().data(), m_lastName.toUtf8().data(), _sendCodeCallback, this);
    }
    else
    {
        NavigationPane* navigationPane = this->m_rootObject;
        navigationPane->setBackButtonsVisible(true);

        QmlDocument* qml = QmlDocument::create("asset:///ui/pages/Registration.qml");
        Page* page = qml->createRootObject<Page>();
        qml->setContextProperty("_owner", this);
        navigationPane->push(page);
    }
}