From 39eed6d9e28da0fd7e2c47503ac51792c5f74dc8 Mon Sep 17 00:00:00 2001 From: Cyberboss Date: Wed, 6 Sep 2017 16:14:14 -0400 Subject: [PATCH] Adds the webclient checkbox to server tools --- TGControlPanel/Main.Designer.cs | 117 ++++++++++++++++++-------------- TGControlPanel/ServerPage.cs | 8 +++ 2 files changed, 75 insertions(+), 50 deletions(-) diff --git a/TGControlPanel/Main.Designer.cs b/TGControlPanel/Main.Designer.cs index 73e37e9903..8a215ebde3 100644 --- a/TGControlPanel/Main.Designer.cs +++ b/TGControlPanel/Main.Designer.cs @@ -71,6 +71,10 @@ this.MajorVersionNumeric = new System.Windows.Forms.NumericUpDown(); this.UpdateProgressBar = new System.Windows.Forms.ProgressBar(); this.ServerPanel = new System.Windows.Forms.TabPage(); + this.AutostartCheckbox = new System.Windows.Forms.CheckBox(); + this.WebclientCheckBox = new System.Windows.Forms.CheckBox(); + this.WorldAnnounceButton = new System.Windows.Forms.Button(); + this.WorldAnnounceField = new System.Windows.Forms.TextBox(); this.VisibilityTitle = new System.Windows.Forms.Label(); this.SecuritySelector = new System.Windows.Forms.ComboBox(); this.SecurityTitle = new System.Windows.Forms.Label(); @@ -79,6 +83,7 @@ this.NudgePortLabel = new System.Windows.Forms.Label(); this.ServerPathLabel = new System.Windows.Forms.Label(); this.ServerPathTextbox = new System.Windows.Forms.TextBox(); + this.CompileCancelButton = new System.Windows.Forms.Button(); this.ProjectPathLabel = new System.Windows.Forms.Label(); this.projectNameText = new System.Windows.Forms.TextBox(); this.PortLabel = new System.Windows.Forms.Label(); @@ -94,7 +99,6 @@ this.ServerRestartButton = new System.Windows.Forms.Button(); this.ServerStopButton = new System.Windows.Forms.Button(); this.ServerStartButton = new System.Windows.Forms.Button(); - this.AutostartCheckbox = new System.Windows.Forms.CheckBox(); this.CompilerStatusLabel = new System.Windows.Forms.Label(); this.CompilerLabel = new System.Windows.Forms.Label(); this.compileButton = new System.Windows.Forms.Button(); @@ -175,9 +179,6 @@ this.WorldStatusTimer = new System.Windows.Forms.Timer(this.components); this.FullUpdateWorker = new System.ComponentModel.BackgroundWorker(); this.ServerStartBGW = new System.ComponentModel.BackgroundWorker(); - this.WorldAnnounceField = new System.Windows.Forms.TextBox(); - this.CompileCancelButton = new System.Windows.Forms.Button(); - this.WorldAnnounceButton = new System.Windows.Forms.Button(); this.Panels.SuspendLayout(); this.RepoPanel.SuspendLayout(); ((System.ComponentModel.ISupportInitialize)(this.TestmergeSelector)).BeginInit(); @@ -723,6 +724,8 @@ // ServerPanel // this.ServerPanel.BackColor = System.Drawing.Color.FromArgb(((int)(((byte)(39)))), ((int)(((byte)(40)))), ((int)(((byte)(34))))); + this.ServerPanel.Controls.Add(this.AutostartCheckbox); + this.ServerPanel.Controls.Add(this.WebclientCheckBox); this.ServerPanel.Controls.Add(this.WorldAnnounceButton); this.ServerPanel.Controls.Add(this.WorldAnnounceField); this.ServerPanel.Controls.Add(this.VisibilityTitle); @@ -749,7 +752,6 @@ this.ServerPanel.Controls.Add(this.ServerRestartButton); this.ServerPanel.Controls.Add(this.ServerStopButton); this.ServerPanel.Controls.Add(this.ServerStartButton); - this.ServerPanel.Controls.Add(this.AutostartCheckbox); this.ServerPanel.Controls.Add(this.CompilerStatusLabel); this.ServerPanel.Controls.Add(this.CompilerLabel); this.ServerPanel.Controls.Add(this.compileButton); @@ -764,6 +766,53 @@ this.ServerPanel.TabIndex = 2; this.ServerPanel.Text = "Server"; // + // AutostartCheckbox + // + this.AutostartCheckbox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.AutostartCheckbox.AutoSize = true; + this.AutostartCheckbox.Font = new System.Drawing.Font("Verdana", 12F); + this.AutostartCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(242))))); + this.AutostartCheckbox.Location = new System.Drawing.Point(758, 0); + this.AutostartCheckbox.Name = "AutostartCheckbox"; + this.AutostartCheckbox.Size = new System.Drawing.Size(104, 22); + this.AutostartCheckbox.TabIndex = 15; + this.AutostartCheckbox.Text = "Autostart"; + this.AutostartCheckbox.UseVisualStyleBackColor = true; + this.AutostartCheckbox.CheckedChanged += new System.EventHandler(this.AutostartCheckbox_CheckedChanged); + // + // WebclientCheckBox + // + this.WebclientCheckBox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); + this.WebclientCheckBox.AutoSize = true; + this.WebclientCheckBox.Font = new System.Drawing.Font("Verdana", 12F); + this.WebclientCheckBox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(242))))); + this.WebclientCheckBox.Location = new System.Drawing.Point(758, 28); + this.WebclientCheckBox.Name = "WebclientCheckBox"; + this.WebclientCheckBox.Size = new System.Drawing.Size(108, 22); + this.WebclientCheckBox.TabIndex = 42; + this.WebclientCheckBox.Text = "Webclient"; + this.WebclientCheckBox.UseVisualStyleBackColor = true; + this.WebclientCheckBox.CheckedChanged += new System.EventHandler(this.WebclientCheckBox_CheckedChanged); + // + // WorldAnnounceButton + // + this.WorldAnnounceButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.WorldAnnounceButton.Location = new System.Drawing.Point(785, 136); + this.WorldAnnounceButton.Name = "WorldAnnounceButton"; + this.WorldAnnounceButton.Size = new System.Drawing.Size(77, 20); + this.WorldAnnounceButton.TabIndex = 41; + this.WorldAnnounceButton.Text = "Send"; + this.WorldAnnounceButton.UseVisualStyleBackColor = true; + this.WorldAnnounceButton.Click += new System.EventHandler(this.WorldAnnounceButton_Click); + // + // WorldAnnounceField + // + this.WorldAnnounceField.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.WorldAnnounceField.Location = new System.Drawing.Point(566, 136); + this.WorldAnnounceField.Name = "WorldAnnounceField"; + this.WorldAnnounceField.Size = new System.Drawing.Size(213, 20); + this.WorldAnnounceField.TabIndex = 40; + // // VisibilityTitle // this.VisibilityTitle.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); @@ -871,6 +920,18 @@ this.ServerPathTextbox.Size = new System.Drawing.Size(296, 20); this.ServerPathTextbox.TabIndex = 32; // + // CompileCancelButton + // + this.CompileCancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); + this.CompileCancelButton.Enabled = false; + this.CompileCancelButton.Location = new System.Drawing.Point(737, 302); + this.CompileCancelButton.Name = "CompileCancelButton"; + this.CompileCancelButton.Size = new System.Drawing.Size(69, 31); + this.CompileCancelButton.TabIndex = 31; + this.CompileCancelButton.Text = "Cancel"; + this.CompileCancelButton.UseVisualStyleBackColor = true; + this.CompileCancelButton.Click += new System.EventHandler(this.CompileCancelButton_Click); + // // ProjectPathLabel // this.ProjectPathLabel.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); @@ -1054,20 +1115,6 @@ this.ServerStartButton.UseVisualStyleBackColor = true; this.ServerStartButton.Click += new System.EventHandler(this.ServerStartButton_Click); // - // AutostartCheckbox - // - this.AutostartCheckbox.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Right))); - this.AutostartCheckbox.AutoSize = true; - this.AutostartCheckbox.Font = new System.Drawing.Font("Verdana", 12F); - this.AutostartCheckbox.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(248)))), ((int)(((byte)(248)))), ((int)(((byte)(242))))); - this.AutostartCheckbox.Location = new System.Drawing.Point(758, 17); - this.AutostartCheckbox.Name = "AutostartCheckbox"; - this.AutostartCheckbox.Size = new System.Drawing.Size(104, 22); - this.AutostartCheckbox.TabIndex = 15; - this.AutostartCheckbox.Text = "Autostart"; - this.AutostartCheckbox.UseVisualStyleBackColor = true; - this.AutostartCheckbox.CheckedChanged += new System.EventHandler(this.AutostartCheckbox_CheckedChanged); - // // CompilerStatusLabel // this.CompilerStatusLabel.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left) @@ -1961,37 +2008,6 @@ // this.ServerStartBGW.DoWork += new System.ComponentModel.DoWorkEventHandler(this.ServerStartBGW_DoWork); // - // WorldAnnounceField - // - this.WorldAnnounceField.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.WorldAnnounceField.Location = new System.Drawing.Point(566, 136); - this.WorldAnnounceField.Name = "WorldAnnounceField"; - this.WorldAnnounceField.Size = new System.Drawing.Size(213, 20); - this.WorldAnnounceField.TabIndex = 40; - // - // CompileCancelButton - // - this.CompileCancelButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.CompileCancelButton.Enabled = false; - this.CompileCancelButton.Location = new System.Drawing.Point(737, 302); - this.CompileCancelButton.Name = "CompileCancelButton"; - this.CompileCancelButton.Size = new System.Drawing.Size(69, 31); - this.CompileCancelButton.TabIndex = 31; - this.CompileCancelButton.Text = "Cancel"; - this.CompileCancelButton.UseVisualStyleBackColor = true; - this.CompileCancelButton.Click += new System.EventHandler(this.CompileCancelButton_Click); - // - // WorldAnnounceButton - // - this.WorldAnnounceButton.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Right))); - this.WorldAnnounceButton.Location = new System.Drawing.Point(785, 136); - this.WorldAnnounceButton.Name = "WorldAnnounceButton"; - this.WorldAnnounceButton.Size = new System.Drawing.Size(77, 20); - this.WorldAnnounceButton.TabIndex = 41; - this.WorldAnnounceButton.Text = "Send"; - this.WorldAnnounceButton.UseVisualStyleBackColor = true; - this.WorldAnnounceButton.Click += new System.EventHandler(this.WorldAnnounceButton_Click); - // // Main // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); @@ -2181,5 +2197,6 @@ private System.Windows.Forms.Button WorldAnnounceButton; private System.Windows.Forms.TextBox WorldAnnounceField; private System.Windows.Forms.Button CompileCancelButton; + private System.Windows.Forms.CheckBox WebclientCheckBox; } } diff --git a/TGControlPanel/ServerPage.cs b/TGControlPanel/ServerPage.cs index 44a0c516ee..b5d1e04bd9 100644 --- a/TGControlPanel/ServerPage.cs +++ b/TGControlPanel/ServerPage.cs @@ -104,6 +104,7 @@ namespace TGControlPanel initializeButton.Visible = RepoExists; NudgePortSelector.Visible = RepoExists; AutostartCheckbox.Visible = RepoExists; + WebclientCheckBox.Visible = RepoExists; PortSelector.Visible = RepoExists; projectNameText.Visible = RepoExists; compilerProgressBar.Visible = RepoExists; @@ -157,6 +158,7 @@ namespace TGControlPanel ServerGStopButton.Enabled = !ShuttingDown; AutostartCheckbox.Checked = DD.Autostart(); + WebclientCheckBox.Checked = DD.Webclient(); if (!PortSelector.Focused) PortSelector.Value = DD.Port(); if (!projectNameText.Focused) @@ -485,5 +487,11 @@ namespace TGControlPanel } WorldAnnounceField.Text = ""; } + + private void WebclientCheckBox_CheckedChanged(object sender, EventArgs e) + { + if (!updatingFields) + Server.GetComponent().SetWebclient(WebclientCheckBox.Checked); + } } }