Permalink
Browse files

ide/Project: On closing the IDE, properly report which projects are m…

…odified (#626)
  • Loading branch information...
1 parent de11d23 commit b14f81f9952260e5927d7e5a14a4630007b30133 @jerstlouis jerstlouis committed Jul 12, 2012
Showing with 29 additions and 0 deletions.
  1. +29 −0 ide/src/project/ProjectView.ec
@@ -451,6 +451,35 @@ class ProjectView : Window
}
if(buildInProgress)
return false;
+
+ if(modifiedDocument)
+ {
+ DialogResult dialogRes;
+ char msg[2048];
+ bool first = true;
+ strcpy(msg, $"You have modified projects.\nSave changes to ");
+ for(p : ide.workspace.projects)
+ {
+ if(p.topNode.modified)
+ {
+ if(!first) strcat(msg, ", ");
+ strcat(msg, p.name);
+ first = false;
+ }
+ }
+ strcat(msg, "?");
+
+ dialogRes = MessageBox { master = master, type = yesNoCancel, text = parent.caption ? parent.caption : rootWindow.caption, contents = msg }.Modal();
+
+ if(dialogRes == yes)
+ {
+ // TOFIX: Precomp error if brackets are taken out
+ return (DialogResult)MenuFileSave(null, 0) != cancel;
+ }
+ else if(dialogRes == cancel)
+ return false;
+ modifiedDocument = false;
+ }
return true;
}

0 comments on commit b14f81f

Please sign in to comment.