Prompt for import settings

This commit is contained in:
Tim Young 2017-08-02 09:01:14 -05:00
parent ceba92f3d2
commit 8fdefcaabc
6 changed files with 38 additions and 11 deletions

View File

@ -830,7 +830,7 @@ namespace EduNetworkBuilder
if (theIcon != null)
CheckInputForm.Icon = theIcon;
int startx = 150;
int startx = 20;
int y = 0;
int lastY = 0;
@ -845,9 +845,11 @@ namespace EduNetworkBuilder
//Put it in the appropriate location
cb.Location = new Point(startx, (y * (cb.Height + yspace)) + yspace);
cb.AutoSize = true;
lastY = cb.Location.Y;
lastHeight = cb.Height;
CheckInputForm.Controls.Add(cb);
y++;
}
CheckInputForm.AutoSize = true;
@ -867,11 +869,12 @@ namespace EduNetworkBuilder
CheckInputForm.AcceptButton = btnAccept;
CheckInputForm.CancelButton = btnCancel;
CheckInputForm.Height = btnCancel.Location.Y + btnCancel.Height + 10;
CheckInputForm.ShowDialog();
foreach (KeyValuePair<string, bool> entry in Checks)
{
if(CheckInputForm.Controls[entry.Key] != null && CheckInputForm.Controls[entry.Key] is CheckBox)
if(responses != null && CheckInputForm.Controls[entry.Key] != null && CheckInputForm.Controls[entry.Key] is CheckBox)
{
CheckBox One = (CheckBox)CheckInputForm.Controls[entry.Key];
responses.Add(One.Name, One.Checked);

View File

@ -44,6 +44,7 @@
this.changeLanguageToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.classSetupToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.profileToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.addToClassworkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.allToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.dHCPRequestToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.clearArpTableToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
@ -82,7 +83,6 @@
this.HelpPanel = new System.Windows.Forms.Panel();
this.cbViewTitles = new System.Windows.Forms.CheckBox();
this.myProgressBar = new System.Windows.Forms.ProgressBar();
this.addToClassworkToolStripMenuItem = new System.Windows.Forms.ToolStripMenuItem();
this.msMainMenuStrip.SuspendLayout();
((System.ComponentModel.ISupportInitialize)(this.pbNetworkView)).BeginInit();
this.HelpPanel.SuspendLayout();
@ -219,6 +219,13 @@
this.profileToolStripMenuItem.Text = "Profile";
this.profileToolStripMenuItem.Click += new System.EventHandler(this.profileToolStripMenuItem_Click);
//
// addToClassworkToolStripMenuItem
//
this.addToClassworkToolStripMenuItem.Name = "addToClassworkToolStripMenuItem";
this.addToClassworkToolStripMenuItem.Size = new System.Drawing.Size(203, 26);
this.addToClassworkToolStripMenuItem.Text = "Add To Classwork";
this.addToClassworkToolStripMenuItem.Click += new System.EventHandler(this.addToClassworkToolStripMenuItem_Click);
//
// allToolStripMenuItem
//
this.allToolStripMenuItem.DropDownItems.AddRange(new System.Windows.Forms.ToolStripItem[] {
@ -573,13 +580,6 @@
this.myProgressBar.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.myProgressBar.TabIndex = 11;
//
// addToClassworkToolStripMenuItem
//
this.addToClassworkToolStripMenuItem.Name = "addToClassworkToolStripMenuItem";
this.addToClassworkToolStripMenuItem.Size = new System.Drawing.Size(203, 26);
this.addToClassworkToolStripMenuItem.Text = "Add To Classwork";
this.addToClassworkToolStripMenuItem.Click += new System.EventHandler(this.addToClassworkToolStripMenuItem_Click);
//
// BuilderWindow
//
this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F);

View File

@ -1945,5 +1945,6 @@ namespace EduNetworkBuilder
UpdateMenu();
}
}
}

View File

@ -408,6 +408,7 @@
this.btnImportStudents.TabIndex = 2;
this.btnImportStudents.Text = "Import Students";
this.btnImportStudents.UseVisualStyleBackColor = true;
this.btnImportStudents.Click += new System.EventHandler(this.btnImportStudents_Click);
//
// PersonProfileForm
//

View File

@ -521,12 +521,21 @@ namespace EduNetworkBuilder
DialogResult result = mydialog.ShowDialog();
if (result == System.Windows.Forms.DialogResult.Cancel) return;
//Prompt for import settings.
Dictionary<string, bool> Checks = new Dictionary<string, bool>();
Checks.Add(NB.Translate("PPF_AutoGenPW"), AutoCreatePWs);
Checks.Add(NB.Translate("PPF_ForcePWChange"), ForcePWChange);
Dictionary<string, bool> Response = NB.CheckPromptBox(Checks, NB.Translate("PPF_ImportSettings"),Properties.Resources.NBIco);
if (Response == null) return; //We canceled out
if (Response.ContainsKey(NB.Translate("PPF_AutoGenPW"))) AutoCreatePWs = Response[NB.Translate("PPF_AutoGenPW")];
if (Response.ContainsKey(NB.Translate("PPF_ForcePWChange"))) ForcePWChange = Response[NB.Translate("PPF_ForcePWChange")];
List<StudentHolder> tList = new List<StudentHolder>();
List<string> InvalidUsers = new List<string>();
List<string> InvalidFullName = new List<string>();
List<string> InvalidPasswords = new List<string>();
//Now we have a csv file. Try to parse it
bool HadError = false;
try
@ -637,5 +646,6 @@ namespace EduNetworkBuilder
message += "\n" + one;
MessageBox.Show(message);
}
}
}

View File

@ -1769,10 +1769,22 @@
<value>You must load a user profile before you can open a homework file.</value>
<comment>NB_LoadUserFirst = You must load a user profile before you can open a homework file.</comment>
</data>
<data name="PPF_AutoGenPW" xml:space="preserve">
<value>Auto Generate Passwords</value>
<comment>PPF_AutoGenPW = Auto Generate Passwords</comment>
</data>
<data name="PPF_ChangePassword" xml:space="preserve">
<value>Change Password</value>
<comment>PPF_ChangePassword = Change Password</comment>
</data>
<data name="PPF_ForcePWChange" xml:space="preserve">
<value>Change password at first login</value>
<comment>PPF_ForcePWChange = Change password at first login</comment>
</data>
<data name="PPF_ImportSettings" xml:space="preserve">
<value>Specify Import Settings</value>
<comment>PPF_ImportSettings = Specify Import Settings</comment>
</data>
<data name="PPF_ImportStudents" xml:space="preserve">
<value>Import Students</value>
<comment>PPF_ImportStudents = Import Students</comment>