From 4779bf24257fb9b45ac5a62b2106b5ed18237bd0 Mon Sep 17 00:00:00 2001 From: Tim Young Date: Mon, 14 Aug 2017 10:28:03 -0500 Subject: [PATCH] Add auto-DHCP option to teacher setting window --- EduNetworkBuilder/PersonProfileForm.Designer.cs | 14 ++++++++++++++ EduNetworkBuilder/PersonProfileForm.cs | 12 +++++++++++- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/EduNetworkBuilder/PersonProfileForm.Designer.cs b/EduNetworkBuilder/PersonProfileForm.Designer.cs index 3867402..42c4f67 100644 --- a/EduNetworkBuilder/PersonProfileForm.Designer.cs +++ b/EduNetworkBuilder/PersonProfileForm.Designer.cs @@ -69,6 +69,7 @@ this.tbStudentUsername = new System.Windows.Forms.TextBox(); this.tvClasswork = new System.Windows.Forms.TreeView(); this.btnExit = new System.Windows.Forms.Button(); + this.cbTeacherAutoDHCP = new System.Windows.Forms.CheckBox(); this.tcTabControl.SuspendLayout(); this.TabProfile.SuspendLayout(); this.TabClasswork.SuspendLayout(); @@ -94,6 +95,7 @@ // // TabProfile // + this.TabProfile.Controls.Add(this.cbTeacherAutoDHCP); this.TabProfile.Controls.Add(this.btnChangePassword); this.TabProfile.Controls.Add(this.lblFullName); this.TabProfile.Controls.Add(this.tbFullName); @@ -496,6 +498,17 @@ this.btnExit.UseVisualStyleBackColor = true; this.btnExit.Click += new System.EventHandler(this.btnExit_Click); // + // cbTeacherAutoDHCP + // + this.cbTeacherAutoDHCP.AutoSize = true; + this.cbTeacherAutoDHCP.Location = new System.Drawing.Point(20, 107); + this.cbTeacherAutoDHCP.Name = "cbTeacherAutoDHCP"; + this.cbTeacherAutoDHCP.Size = new System.Drawing.Size(210, 21); + this.cbTeacherAutoDHCP.TabIndex = 5; + this.cbTeacherAutoDHCP.Text = "Auto DHCP on network Load"; + this.cbTeacherAutoDHCP.UseVisualStyleBackColor = true; + this.cbTeacherAutoDHCP.CheckedChanged += new System.EventHandler(this.cbTeacherAutoDHCP_CheckedChanged); + // // PersonProfileForm // this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); @@ -564,5 +577,6 @@ private System.Windows.Forms.Button btnAllHomeworkToStudents; private System.Windows.Forms.Button btnReadAllStudentHomework; private System.Windows.Forms.Button btnExportStudentPasswords; + private System.Windows.Forms.CheckBox cbTeacherAutoDHCP; } } \ No newline at end of file diff --git a/EduNetworkBuilder/PersonProfileForm.cs b/EduNetworkBuilder/PersonProfileForm.cs index b16fcd0..b1baf17 100644 --- a/EduNetworkBuilder/PersonProfileForm.cs +++ b/EduNetworkBuilder/PersonProfileForm.cs @@ -269,14 +269,19 @@ namespace EduNetworkBuilder if (CurrentUser.isAdmin) this.Text = "Admin: " + CurrentUser.UserName; else this.Text = "Student: " + CurrentUser.UserName; + cbTeacherAutoDHCP.Checked = CurrentUser.UserSettings.AutoDHCPAllMachinesAtNetworkLoad; + tvClasswork.Nodes.Clear(); if (CurrentUser.isAdmin) { + cbTeacherAutoDHCP.Visible = true; UpdateAdminFormFromUser(); } else + { + cbTeacherAutoDHCP.Visible = false; UpdateStudentFormFromUser(); - + } } private void UpdateAdminFormFromUser() @@ -978,5 +983,10 @@ namespace EduNetworkBuilder WriteStudentCSVFile(mydialog.FileName); } + + private void cbTeacherAutoDHCP_CheckedChanged(object sender, EventArgs e) + { + CurrentUser.UserSettings.AutoDHCPAllMachinesAtNetworkLoad = cbTeacherAutoDHCP.Checked; + } } } \ No newline at end of file