updateGui();
}
@FXML
protected void deleteAction() {
final TerasologyGameVersion gameVersion = getSelectedGameVersion();
if ((gameVersion != null) && gameVersion.isInstalled()) {
final boolean containsGameData = DirectoryUtils.containsGameData(gameVersion.getInstallationPath());
final String msg;
if (containsGameData) {
msg = BundleUtils.getMessage("confirmDeleteGame_withData", gameVersion.getInstallationPath());
} else {
msg = BundleUtils.getMessage("confirmDeleteGame_withoutData", gameVersion.getInstallationPath());
}
final int option = JOptionPane.showConfirmDialog(null, msg, BundleUtils.getLabel("message_deleteGame_title"), JOptionPane.YES_NO_OPTION);
if (option == JOptionPane.YES_OPTION) {
logger.info("Delete installed game! '{}' '{}'", gameVersion, gameVersion.getInstallationPath());
try {
FileUtils.delete(gameVersion.getInstallationPath());
} catch (IOException e) {
logger.error("Could not delete installed game!", e);
// TODO Show message dialog
return;
}