Ejemplo n.º 1
0
void SettingsJavaPluginForm::uninstall()
{
	if (QMessageBox::warning(getMainWindow(), "FatRat", tr("Do you really wish to uninstall the selected extensions?"), QMessageBox::Yes|QMessageBox::Cancel) != QMessageBox::Yes)
	{
		return;
	}

	QString baseDir = QDir::homePath() + USER_PROFILE_PATH "/data/java/";
	QDir dir(baseDir);
	int numRemoved = 0;

	for (int i = 0; i < treeInstalled->topLevelItemCount(); i++)
	{
		QTreeWidgetItem* item = treeInstalled->topLevelItem(i);
		if (item->checkState(0) != Qt::Checked)
			continue;
		QString fileName = item->text(0) + ".jar";

		if (!dir.remove(fileName))
			QMessageBox::critical(getMainWindow(), "FatRat", tr("Failed to remove \"%1\", check the file permissions.").arg(fileName));
		numRemoved++;
	}

	if (numRemoved)
		askRestart();
}
Ejemplo n.º 2
0
/**
 * This method handles playing a loaded game
 * @remarks	Originally called tjouer
 */
void MortevielleEngine::playGame() {
	gameLoaded();

	// Loop handling actions until the game has to be quit, or show the lose or end sequence
	do {
		handleAction();
		if (shouldQuit())
			return;
	} while (!((_quitGame) || (_endGame) || (_loseGame)));

	if (_endGame)
		endGame();
	else if (_loseGame)
		askRestart();
}