Exemple #1
0
void SimApp::cmdDisplayText(const QSimCommand &cmd)
{
#ifndef QTOPIA_TEST
    // DisplayText with low priority came while screen is busy
    if ( !this->isVisible()
            && !(HomeScreenControl::instance()->homeScreen()->windowState() & Qt::WindowActive)
            && !cmd.highPriority() ) {
        QSimTerminalResponse resp;
        resp.setCommand(cmd);
        resp.setCause(QSimTerminalResponse::ScreenIsBusy);
        resp.setResult(QSimTerminalResponse::MEUnableToProcess);
        sendResponse( resp );
        return;
    }
#endif
    if ( cmd.iconId() > 0 )
        createIconReader();

    hasSustainedDisplayText = cmd.immediateResponse();

    if (view && qobject_cast<SimText*>(view)) {
        SimText *text = (SimText *)view;
        if (cmd.highPriority() || !text->hasHighPriority()) {
            if (cmd.iconId())
                text->setCommand(cmd, iconReader);
            else
                text->setCommand(cmd);
            stack->setCurrentWidget(text);
        } else {
            // send screen busy response
            QSimTerminalResponse resp;
            resp.setCommand(cmd);
            resp.setCause(QSimTerminalResponse::ScreenIsBusy);
            resp.setResult(QSimTerminalResponse::MEUnableToProcess);
            sendResponse( resp );
        }
    } else {
        SimText *text = new SimText(cmd, iconReader, stack);
        connect(text, SIGNAL(sendResponse(QSimTerminalResponse)),
                this, SLOT(sendResponse(QSimTerminalResponse)) );
        connect(text, SIGNAL(hideApp()), this, SLOT(hideApp()));
        setView(text);
    }
}
Exemple #2
0
void MainDlg::minimizeApp() {
    //hiding effect
    QPropertyAnimation *animation = new QPropertyAnimation(this, "windowOpacity");
    animation->setStartValue(0.95);
    animation->setEndValue(0.0);
    animation->setDuration(400);
    animation->setEasingCurve(QEasingCurve::OutCubic);
    connect(animation, SIGNAL(finished()), this, SLOT(hideApp()));

    animation->start();
}