Exemplo n.º 1
0
void MainScene::turnChanged(bool is_white)
{
    m_remaining = five::GIVEUP_TIMEOUT_CLIENT;
    emit remainingTimeChanged(m_remaining);
    m_time_counter->start();

    m_current = is_white ? PLAYER_WHITE : PLAYER_BLACK;

    ui->transferButton->setProperty("isWhite", is_white);
    ui->transferButton->style()->unpolish(ui->transferButton);
    ui->transferButton->style()->polish(ui->transferButton);
    ui->transferButton->update();

    ui->boardView->turnChanged(is_white);

    ui->undoButton->setProperty("clickStatus", "no");
    ui->undoButton->style()->unpolish(ui->undoButton);
    ui->undoButton->style()->polish(ui->undoButton);
    ui->undoButton->update();

    ui->giveupButton->setProperty("clickStatus", "no");
    ui->giveupButton->style()->unpolish(ui->giveupButton);
    ui->giveupButton->style()->polish(ui->giveupButton);
    ui->giveupButton->update();

    if (m_current == m_who_am_i) {
        ui->undoButton->setEnabled(true);
        ui->giveupButton->setEnabled(true);
        ui->transferButton->setEnabled(true);
    } else {
        ui->undoButton->setEnabled(false);
        ui->giveupButton->setEnabled(false);
        ui->transferButton->setEnabled(false);
    }
}
Exemplo n.º 2
0
void AudioCdRecord::clockJobs()
{
    p->elapsed_time.addSecond( 1 );

    int remain_sec = 0;
    if( p->written_size_int !=0 )
        remain_sec = p->elapsed_time.toSecond()*(p->image_size_int-p->written_size_int)/p->written_size_int;

    p->remaining_time.reset();
    p->remaining_time.setSecond( remain_sec );

    emit elapsedTimeChanged(   p->elapsed_time              );
    emit remainingTimeChanged( p->remaining_time            );
    emit elapsedTimeChanged(   p->elapsed_time.toString()   );
    emit remainingTimeChanged( p->remaining_time.toString() );
}
Exemplo n.º 3
0
void MPG321::clockJobs()
{
    p->elapsed_time.addSecond( 1 );

    int remain_sec = 0;
    if( p->all_frames !=0 )
        remain_sec = p->elapsed_time.toSecond()*(p->all_frames-p->done_frames)/p->done_frames;

    p->remaining_time.reset();
    p->remaining_time.setSecond( remain_sec );

    emit elapsedTimeChanged(   p->elapsed_time              );
    emit remainingTimeChanged( p->remaining_time            );
    emit elapsedTimeChanged(   p->elapsed_time.toString()   );
    emit remainingTimeChanged( p->remaining_time.toString() );
}
Exemplo n.º 4
0
void MainScene::reduceRemaining(void)
{
    if (m_remaining <= 0) return;

    m_remaining -= TIMER_INTERVAL;
    emit remainingTimeChanged(m_remaining);

    if (m_remaining <= 0) toChangeTurn();
}
Exemplo n.º 5
0
void LWDAQ_Client::updateRemainingTime() {
    remainingTimeChanged();
}