/**
* Check if the project has been modified, before creating a new one or open
* another
*/
public boolean checkCurrentProject() {
GanttDialogInfo gdiSaveError = new GanttDialogInfo(this,
GanttDialogInfo.ERROR, GanttDialogInfo.YES_NO_CANCEL_OPTION,
language.getText("msg12"), language.getText("error"));
boolean trySave = true;
if (askForSave == true) {
UIFacade.Choice saveChoice = getUIFacade().showConfirmationDialog(language.getText("msg1"), language.getText("warning"));
if (UIFacade.Choice.CANCEL==saveChoice) {
return false;
}
if (UIFacade.Choice.YES==saveChoice) {
do {
try {
trySave = false;
saveProject();
} catch (Exception e) {
if (!GPLogger.log(e)) {
e.printStackTrace(System.err);
}
gdiSaveError.show();
if (gdiSaveError.res == GanttDialogInfo.CANCEL)
return false;
trySave = (gdiSaveError.res == GanttDialogInfo.YES);
}
} while (trySave);