diff --git a/EduNetworkBuilder/NB.cs b/EduNetworkBuilder/NB.cs
index 66d83d6..83071e1 100644
--- a/EduNetworkBuilder/NB.cs
+++ b/EduNetworkBuilder/NB.cs
@@ -994,5 +994,20 @@ namespace EduNetworkBuilder
return ValidateString(password, AllowedUsernameCharacters + " ");
}
+ public static OpenFileDialog SelectDirectoryDialog(string Title, string InitialDirectory="")
+ {
+ OpenFileDialog OFD = new OpenFileDialog();
+ OFD.Title = Title;
+ if (InitialDirectory != "")
+ OFD.InitialDirectory = InitialDirectory;
+ OFD.ValidateNames = false;
+ OFD.CheckFileExists = false;
+ OFD.CheckPathExists = true;
+ OFD.FileName = NB.Translate("PPF_SelectThisFolder");
+ DialogResult answer = OFD.ShowDialog();
+ if (answer == DialogResult.Cancel) OFD.FileName = ""; //This is how we cancel out
+ return OFD;
+ }
+
}
}
diff --git a/EduNetworkBuilder/PersonProfileForm.cs b/EduNetworkBuilder/PersonProfileForm.cs
index fa3c58f..cee522c 100644
--- a/EduNetworkBuilder/PersonProfileForm.cs
+++ b/EduNetworkBuilder/PersonProfileForm.cs
@@ -100,12 +100,8 @@ namespace EduNetworkBuilder
//Find a directory for it.
CurrentUser = new PersonClass(Dest, true); //Make an admin person class
//Choose an initial folder for the file:
- OpenFileDialog OFD = new OpenFileDialog();
- OFD.ValidateNames = false;
- OFD.CheckFileExists = false;
- OFD.CheckPathExists = true;
- OFD.FileName = NB.Translate("PPF_SelectThisFolder");
- OFD.ShowDialog();
+ OpenFileDialog OFD = NB.SelectDirectoryDialog(NB.Translate("PPF_UserDirectory"),CurrentUser.filepath);
+ if (OFD.FileName == "") return;//we cancel out
CurrentUser.filepath = Path.GetDirectoryName(OFD.FileName);
CurrentUser.UserSettings.AutoStartPuzzles = false;
CurrentUser.UserSettings.ChosenLanguage = oldsettings.ChosenLanguage;
@@ -655,8 +651,23 @@ namespace EduNetworkBuilder
MessageBox.Show(message);
}
+ ///
+ /// Generate The student files for all the students.
+ ///
+ ///
+ ///
private void btnGenerateStudentFiles_Click(object sender, EventArgs e)
{
+ //Verify (choose) student file directory
+ //Loop through all the students
+ //Calculate the filename for the student file
+ //See if the file exists. If not, gen a new file
+ //Keep track of total # students, # new files, # skipped because they existed
+
+ OpenFileDialog OFD = NB.SelectDirectoryDialog(NB.Translate("PPF_SelectStudentDir"),CurrentUser.StudentFilePath);
+ if (OFD.FileName == "") return;//we cancel out
+ CurrentUser.StudentFilePath = Path.GetDirectoryName(OFD.FileName);
+
}
}
diff --git a/EduNetworkBuilder/Resources/languages/edustrings.resx b/EduNetworkBuilder/Resources/languages/edustrings.resx
index d3e3517..426c3b7 100644
--- a/EduNetworkBuilder/Resources/languages/edustrings.resx
+++ b/EduNetworkBuilder/Resources/languages/edustrings.resx
@@ -1817,4 +1817,12 @@
Error. Could not import students. List of invalid
PPF_NoImportInvalid = Error. Could not import students. List of invalid
+
+ Student Files Directory
+ PPF_SelectStudentDir = Stdent Files Directory
+
+
+ User File Directory
+ PPF_UserDirectory
+
\ No newline at end of file