From 8fdefcaabc970f27763a6ab0978e4e4d962582d8 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Wed, 2 Aug 2017 09:01:14 -0500 Subject: [PATCH] Prompt for import settings --- EduNetworkBuilder/NB.cs | 7 +++++-- EduNetworkBuilder/NetworkBuilder.Designer.cs | 16 ++++++++-------- EduNetworkBuilder/NetworkBuilder.cs | 1 + EduNetworkBuilder/PersonProfileForm.Designer.cs | 1 + EduNetworkBuilder/PersonProfileForm.cs | 12 +++++++++++- .../Resources/languages/edustrings.resx | 12 ++++++++++++ 6 files changed, 38 insertions(+), 11 deletions(-) diff --git a/EduNetworkBuilder/NB.cs b/EduNetworkBuilder/NB.cs index 138ea2b..66d83d6 100644 --- a/EduNetworkBuilder/NB.cs +++ b/EduNetworkBuilder/NB.cs @@ -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 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); diff --git a/EduNetworkBuilder/NetworkBuilder.Designer.cs b/EduNetworkBuilder/NetworkBuilder.Designer.cs index 80045ca..9f00138 100644 --- a/EduNetworkBuilder/NetworkBuilder.Designer.cs +++ b/EduNetworkBuilder/NetworkBuilder.Designer.cs @@ -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); diff --git a/EduNetworkBuilder/NetworkBuilder.cs b/EduNetworkBuilder/NetworkBuilder.cs index 9a86b46..f26e7e6 100644 --- a/EduNetworkBuilder/NetworkBuilder.cs +++ b/EduNetworkBuilder/NetworkBuilder.cs @@ -1945,5 +1945,6 @@ namespace EduNetworkBuilder UpdateMenu(); } + } } \ No newline at end of file diff --git a/EduNetworkBuilder/PersonProfileForm.Designer.cs b/EduNetworkBuilder/PersonProfileForm.Designer.cs index cb44890..61a4364 100644 --- a/EduNetworkBuilder/PersonProfileForm.Designer.cs +++ b/EduNetworkBuilder/PersonProfileForm.Designer.cs @@ -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 // diff --git a/EduNetworkBuilder/PersonProfileForm.cs b/EduNetworkBuilder/PersonProfileForm.cs index 26f8594..cedd3f9 100644 --- a/EduNetworkBuilder/PersonProfileForm.cs +++ b/EduNetworkBuilder/PersonProfileForm.cs @@ -521,12 +521,21 @@ namespace EduNetworkBuilder DialogResult result = mydialog.ShowDialog(); if (result == System.Windows.Forms.DialogResult.Cancel) return; + //Prompt for import settings. + Dictionary Checks = new Dictionary(); + Checks.Add(NB.Translate("PPF_AutoGenPW"), AutoCreatePWs); + Checks.Add(NB.Translate("PPF_ForcePWChange"), ForcePWChange); + + Dictionary 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 tList = new List(); List InvalidUsers = new List(); List InvalidFullName = new List(); List InvalidPasswords = new List(); - //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); } + } } \ No newline at end of file diff --git a/EduNetworkBuilder/Resources/languages/edustrings.resx b/EduNetworkBuilder/Resources/languages/edustrings.resx index 857b502..c7c90ca 100644 --- a/EduNetworkBuilder/Resources/languages/edustrings.resx +++ b/EduNetworkBuilder/Resources/languages/edustrings.resx @@ -1769,10 +1769,22 @@ You must load a user profile before you can open a homework file. NB_LoadUserFirst = You must load a user profile before you can open a homework file. + + Auto Generate Passwords + PPF_AutoGenPW = Auto Generate Passwords + Change Password PPF_ChangePassword = Change Password + + Change password at first login + PPF_ForcePWChange = Change password at first login + + + Specify Import Settings + PPF_ImportSettings = Specify Import Settings + Import Students PPF_ImportStudents = Import Students