Пример #1
0
void GameWidget::nextMove()
{
    _gameController->nextMove();
    bool gameFinished = _gameController->gameOver();
    this->updateActor();

    _lblMovementGhostCounter->setText(QString::number(_gameController->getGhostMovementCounter()));

    if(gameFinished)
    {
        QMessageBox msgBox;
        msgBox.setText("Le Pacman a été attrapé !");
        QString text = "Les ghosts ont mis ";
        text += QString("%1").arg( _gameController->getGhostMovementCounter() );
        text += " coups pour attraper le Pacman.\n";

        msgBox.setDetailedText(text);

        QPushButton *btnRestart = msgBox.addButton(tr("&Recommener"), QMessageBox::AcceptRole);
        QPushButton *btnMenu = msgBox.addButton(tr("Revenir au &menu"), QMessageBox::RejectRole);
        msgBox.exec();

        if (msgBox.clickedButton() == btnRestart)
        {
            emit restarted();
        }
        else if (msgBox.clickedButton() == btnMenu)
        {
            emit terminated();
        }
    }
}
/*
 * Dump crash to file (typically FAT file on SD/MMC).
 */
static int do_checkcrash(cmd_tbl_t *cmdtp, int flag, int argc, char *argv[])
{
	int rc = 0;
#if defined(ENG_VERSION)
	Elf32_Ehdr *elfhdr_addr;
	char *crash_env_val;

	crash_env_val = getenv("crash_dump");
	if ((crash_env_val != NULL) && strcmp(crash_env_val, "yes") == 0) {
		rc = -1;
		elfhdr_addr = get_elfhdr_addr();
		if (elfhdr_addr != NULL)
			rc = check_elfhdr(elfhdr_addr);
		if (rc == 0) {
			printf("crash dump elf header found."
			       " Dumping to card...\n");
			rc = crashdump(elfhdr_addr);
			if (rc != 0)
				printf("checkcrash: "
				       "error writing dump from %x to %s\n",
				       (u32) elfhdr_addr, crash_filename);
		}
		else {
			printf("crash dump elf header not found. Will try to create one"
			       " Dumping to card...\n");
			rc = dump_regions_from_environment();
		}
	}
	stop_mpcore_wdt();

	/*
	 * For some reason we can't reboot into the linux kernel when coming
	 * from there using kexec. On the other hand, we can't reset through the
	 * PRCMU when we are here because of a watchdog reset.
	 * For now let's
	 * 1) Reset through PRCMU when coming from kexec
	 * 2) Continue booting when coming from a watchdog reset
	 */
	if (!reboot_at_crash())
		setenv("bootdelay", "-1");
	else
#endif
		if (restarted())
			do_reset();

	return rc;
}