From 067b991561f2a85ba5173912e36ae79cf8977dc2 Mon Sep 17 00:00:00 2001 From: baldurk Date: Fri, 26 Aug 2016 17:27:28 +0200 Subject: [PATCH] Re-jig remote manager GUI a little for better user flow --- .../Windows/Dialogs/RemoteManager.Designer.cs | 417 +++++++++--------- renderdocui/Windows/Dialogs/RemoteManager.cs | 259 ++++++++--- .../Windows/Dialogs/RemoteManager.resx | 12 +- 3 files changed, 410 insertions(+), 278 deletions(-) diff --git a/renderdocui/Windows/Dialogs/RemoteManager.Designer.cs b/renderdocui/Windows/Dialogs/RemoteManager.Designer.cs index 0210bf9da..5204a7d20 100644 --- a/renderdocui/Windows/Dialogs/RemoteManager.Designer.cs +++ b/renderdocui/Windows/Dialogs/RemoteManager.Designer.cs @@ -29,53 +29,50 @@ private void InitializeComponent() { System.Windows.Forms.TableLayoutPanel tableLayoutPanel1; - TreelistView.TreeListColumn treeListColumn3 = ((TreelistView.TreeListColumn)(new TreelistView.TreeListColumn("hostname", "Hostname"))); - TreelistView.TreeListColumn treeListColumn4 = ((TreelistView.TreeListColumn)(new TreelistView.TreeListColumn("running", "Running"))); System.Windows.Forms.GroupBox basicConfigBox; System.Windows.Forms.TableLayoutPanel tableLayoutPanel2; - System.Windows.Forms.Label label1; - System.Windows.Forms.Label label2; System.Windows.Forms.Label label3; - System.Windows.Forms.Label label4; - this.hosts = new TreelistView.TreeListView(); - this.connect = new System.Windows.Forms.Button(); - this.addhost = new System.Windows.Forms.Button(); + System.Windows.Forms.Label label1; + System.Windows.Forms.GroupBox opsBox; + System.Windows.Forms.Label label2; + TreelistView.TreeListColumn treeListColumn1 = ((TreelistView.TreeListColumn)(new TreelistView.TreeListColumn("hostname", "Hostname"))); + TreelistView.TreeListColumn treeListColumn2 = ((TreelistView.TreeListColumn)(new TreelistView.TreeListColumn("running", "Running"))); this.hostname = new System.Windows.Forms.TextBox(); - this.refresh = new System.Windows.Forms.Button(); - this.configure = new System.Windows.Forms.Button(); - this.configHostname = new System.Windows.Forms.TextBox(); - this.configRunCommand = new System.Windows.Forms.TextBox(); - this.setHostname = new System.Windows.Forms.Button(); - this.setRunCommand = new System.Windows.Forms.Button(); + this.runCommand = new System.Windows.Forms.TextBox(); + this.addUpdateHost = new System.Windows.Forms.Button(); + this.deleteHost = new System.Windows.Forms.Button(); + this.refreshOne = new System.Windows.Forms.Button(); + this.connect = new System.Windows.Forms.Button(); + this.refreshAll = new System.Windows.Forms.Button(); + this.lookupsProgressFlow = new System.Windows.Forms.FlowLayoutPanel(); + this.progressPicture = new System.Windows.Forms.PictureBox(); + this.hosts = new TreelistView.TreeListView(); + this.remoteCountLabel = new System.Windows.Forms.Label(); tableLayoutPanel1 = new System.Windows.Forms.TableLayoutPanel(); basicConfigBox = new System.Windows.Forms.GroupBox(); tableLayoutPanel2 = new System.Windows.Forms.TableLayoutPanel(); - label1 = new System.Windows.Forms.Label(); - label2 = new System.Windows.Forms.Label(); label3 = new System.Windows.Forms.Label(); - label4 = new System.Windows.Forms.Label(); + label1 = new System.Windows.Forms.Label(); + opsBox = new System.Windows.Forms.GroupBox(); + label2 = new System.Windows.Forms.Label(); tableLayoutPanel1.SuspendLayout(); - ((System.ComponentModel.ISupportInitialize)(this.hosts)).BeginInit(); basicConfigBox.SuspendLayout(); tableLayoutPanel2.SuspendLayout(); + opsBox.SuspendLayout(); + this.lookupsProgressFlow.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.progressPicture)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.hosts)).BeginInit(); this.SuspendLayout(); // // tableLayoutPanel1 // - tableLayoutPanel1.ColumnCount = 6; + tableLayoutPanel1.ColumnCount = 2; tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F)); tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - tableLayoutPanel1.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); tableLayoutPanel1.Controls.Add(this.hosts, 0, 0); - tableLayoutPanel1.Controls.Add(this.connect, 5, 1); - tableLayoutPanel1.Controls.Add(this.addhost, 1, 1); - tableLayoutPanel1.Controls.Add(this.hostname, 0, 1); - tableLayoutPanel1.Controls.Add(this.refresh, 2, 1); - tableLayoutPanel1.Controls.Add(this.configure, 4, 1); tableLayoutPanel1.Controls.Add(basicConfigBox, 0, 2); + tableLayoutPanel1.Controls.Add(opsBox, 1, 2); + tableLayoutPanel1.Controls.Add(this.lookupsProgressFlow, 0, 1); tableLayoutPanel1.Dock = System.Windows.Forms.DockStyle.Fill; tableLayoutPanel1.Location = new System.Drawing.Point(0, 0); tableLayoutPanel1.Name = "tableLayoutPanel1"; @@ -83,101 +80,21 @@ tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F)); tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle()); - tableLayoutPanel1.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Absolute, 20F)); - tableLayoutPanel1.Size = new System.Drawing.Size(632, 438); + tableLayoutPanel1.Size = new System.Drawing.Size(602, 460); tableLayoutPanel1.TabIndex = 2; // - // hosts - // - this.hosts.AlwaysDisplayVScroll = true; - treeListColumn3.AutoSize = true; - treeListColumn3.AutoSizeMinSize = 15; - treeListColumn3.Width = 48; - treeListColumn4.AutoSizeMinSize = 0; - treeListColumn4.Width = 250; - this.hosts.Columns.AddRange(new TreelistView.TreeListColumn[] { - treeListColumn3, - treeListColumn4}); - tableLayoutPanel1.SetColumnSpan(this.hosts, 6); - this.hosts.Cursor = System.Windows.Forms.Cursors.Arrow; - this.hosts.Dock = System.Windows.Forms.DockStyle.Fill; - this.hosts.Location = new System.Drawing.Point(3, 3); - this.hosts.MultiSelect = false; - this.hosts.Name = "hosts"; - this.hosts.RowOptions.ShowHeader = false; - this.hosts.Size = new System.Drawing.Size(626, 259); - this.hosts.TabIndex = 1; - this.hosts.ViewOptions.HoverHandTreeColumn = false; - this.hosts.ViewOptions.Indent = 12; - this.hosts.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.hosts_AfterSelect); - this.hosts.NodeDoubleClicked += new TreelistView.TreeListView.NodeDoubleClickedHandler(this.hosts_NodeDoubleClicked); - this.hosts.KeyDown += new System.Windows.Forms.KeyEventHandler(this.hosts_KeyDown); - // - // connect - // - this.connect.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.connect.Enabled = false; - this.connect.Location = new System.Drawing.Point(554, 268); - this.connect.Name = "connect"; - this.connect.Size = new System.Drawing.Size(75, 23); - this.connect.TabIndex = 5; - this.connect.Text = "Connect"; - this.connect.UseVisualStyleBackColor = true; - this.connect.Click += new System.EventHandler(this.connect_Click); - // - // addhost - // - this.addhost.Anchor = System.Windows.Forms.AnchorStyles.Right; - this.addhost.Location = new System.Drawing.Point(291, 268); - this.addhost.Name = "addhost"; - this.addhost.Size = new System.Drawing.Size(75, 23); - this.addhost.TabIndex = 3; - this.addhost.Text = "Add Host"; - this.addhost.UseVisualStyleBackColor = true; - this.addhost.Click += new System.EventHandler(this.addhost_Click); - // - // hostname - // - this.hostname.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) - | System.Windows.Forms.AnchorStyles.Right))); - this.hostname.Location = new System.Drawing.Point(3, 268); - this.hostname.Name = "hostname"; - this.hostname.Size = new System.Drawing.Size(282, 20); - this.hostname.TabIndex = 2; - this.hostname.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textbox_KeyPress); - // - // refresh - // - this.refresh.Location = new System.Drawing.Point(372, 268); - this.refresh.Name = "refresh"; - this.refresh.Size = new System.Drawing.Size(75, 23); - this.refresh.TabIndex = 4; - this.refresh.Text = "Refresh"; - this.refresh.UseVisualStyleBackColor = true; - this.refresh.Click += new System.EventHandler(this.refresh_Click); - // - // configure - // - this.configure.Location = new System.Drawing.Point(473, 268); - this.configure.Name = "configure"; - this.configure.Size = new System.Drawing.Size(75, 23); - this.configure.TabIndex = 6; - this.configure.Text = "Configure"; - this.configure.UseVisualStyleBackColor = true; - // // basicConfigBox // basicConfigBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); - tableLayoutPanel1.SetColumnSpan(basicConfigBox, 6); basicConfigBox.Controls.Add(tableLayoutPanel2); - basicConfigBox.Location = new System.Drawing.Point(3, 297); + basicConfigBox.Location = new System.Drawing.Point(3, 319); basicConfigBox.Name = "basicConfigBox"; - basicConfigBox.Size = new System.Drawing.Size(626, 138); + basicConfigBox.Size = new System.Drawing.Size(476, 138); basicConfigBox.TabIndex = 7; basicConfigBox.TabStop = false; - basicConfigBox.Text = "Basic configuration"; + basicConfigBox.Text = "Host configuration"; // // tableLayoutPanel2 // @@ -185,127 +102,228 @@ | System.Windows.Forms.AnchorStyles.Left) | System.Windows.Forms.AnchorStyles.Right))); tableLayoutPanel2.AutoSize = true; - tableLayoutPanel2.ColumnCount = 3; - tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 20F)); + tableLayoutPanel2.ColumnCount = 2; tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 80F)); tableLayoutPanel2.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle()); - tableLayoutPanel2.Controls.Add(label1, 0, 1); - tableLayoutPanel2.Controls.Add(this.configHostname, 1, 1); - tableLayoutPanel2.Controls.Add(this.configRunCommand, 1, 3); - tableLayoutPanel2.Controls.Add(label2, 0, 3); - tableLayoutPanel2.Controls.Add(label3, 1, 2); - tableLayoutPanel2.Controls.Add(label4, 1, 0); - tableLayoutPanel2.Controls.Add(this.setHostname, 2, 1); - tableLayoutPanel2.Controls.Add(this.setRunCommand, 2, 3); + tableLayoutPanel2.Controls.Add(this.hostname, 0, 1); + tableLayoutPanel2.Controls.Add(this.runCommand, 0, 3); + tableLayoutPanel2.Controls.Add(label3, 0, 2); + tableLayoutPanel2.Controls.Add(this.addUpdateHost, 1, 1); + tableLayoutPanel2.Controls.Add(label1, 0, 0); tableLayoutPanel2.Location = new System.Drawing.Point(6, 19); tableLayoutPanel2.Name = "tableLayoutPanel2"; tableLayoutPanel2.RowCount = 4; tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); - tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 51.51515F)); tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle()); - tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 50F)); - tableLayoutPanel2.Size = new System.Drawing.Size(614, 112); + tableLayoutPanel2.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 48.48485F)); + tableLayoutPanel2.Size = new System.Drawing.Size(464, 112); tableLayoutPanel2.TabIndex = 0; // - // label1 + // hostname // - label1.Anchor = System.Windows.Forms.AnchorStyles.Right; - label1.AutoSize = true; - label1.Location = new System.Drawing.Point(53, 34); - label1.Name = "label1"; - label1.Size = new System.Drawing.Size(58, 13); - label1.TabIndex = 0; - label1.Text = "Hostname:"; + this.hostname.Dock = System.Windows.Forms.DockStyle.Fill; + this.hostname.Location = new System.Drawing.Point(3, 23); + this.hostname.Name = "hostname"; + this.hostname.Size = new System.Drawing.Size(395, 20); + this.hostname.TabIndex = 1; + this.hostname.TextChanged += new System.EventHandler(this.hostname_TextChanged); + this.hostname.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textbox_KeyPress); // - // configHostname + // runCommand // - this.configHostname.Dock = System.Windows.Forms.DockStyle.Fill; - this.configHostname.Location = new System.Drawing.Point(117, 29); - this.configHostname.Name = "configHostname"; - this.configHostname.Size = new System.Drawing.Size(453, 20); - this.configHostname.TabIndex = 1; - this.configHostname.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textbox_KeyPress); - // - // configRunCommand - // - this.configRunCommand.Dock = System.Windows.Forms.DockStyle.Fill; - this.configRunCommand.Location = new System.Drawing.Point(117, 85); - this.configRunCommand.Name = "configRunCommand"; - this.configRunCommand.Size = new System.Drawing.Size(453, 20); - this.configRunCommand.TabIndex = 4; - this.configRunCommand.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textbox_KeyPress); - // - // label2 - // - label2.Anchor = System.Windows.Forms.AnchorStyles.Right; - label2.AutoSize = true; - label2.Location = new System.Drawing.Point(3, 90); - label2.Name = "label2"; - label2.Size = new System.Drawing.Size(108, 13); - label2.TabIndex = 2; - label2.Text = "Server run command:"; + this.runCommand.Dock = System.Windows.Forms.DockStyle.Fill; + this.runCommand.Location = new System.Drawing.Point(3, 89); + this.runCommand.Name = "runCommand"; + this.runCommand.Size = new System.Drawing.Size(395, 20); + this.runCommand.TabIndex = 4; + this.runCommand.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.textbox_KeyPress); // // label3 // label3.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); label3.AutoSize = true; - label3.Location = new System.Drawing.Point(117, 66); + label3.Location = new System.Drawing.Point(3, 57); label3.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3); label3.Name = "label3"; - label3.Size = new System.Drawing.Size(413, 13); + label3.Size = new System.Drawing.Size(386, 26); label3.TabIndex = 3; - label3.Text = "This lets you configure a command to run that launches the remote server on this " + - "host."; + label3.Text = "Run Command: Configure a command to run that launches the remote server on this h" + + "ost."; // - // label4 + // addUpdateHost // - label4.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); - label4.AutoSize = true; - label4.Location = new System.Drawing.Point(117, 10); - label4.Margin = new System.Windows.Forms.Padding(3, 10, 3, 3); - label4.Name = "label4"; - label4.Size = new System.Drawing.Size(261, 13); - label4.TabIndex = 5; - label4.Text = "Configure the network hostname for this remote server"; + this.addUpdateHost.Location = new System.Drawing.Point(404, 23); + this.addUpdateHost.Name = "addUpdateHost"; + this.addUpdateHost.Size = new System.Drawing.Size(57, 21); + this.addUpdateHost.TabIndex = 6; + this.addUpdateHost.Text = "Add"; + this.addUpdateHost.UseVisualStyleBackColor = true; + this.addUpdateHost.Click += new System.EventHandler(this.addUpdateHost_Click); // - // setHostname + // label1 // - this.setHostname.Location = new System.Drawing.Point(576, 29); - this.setHostname.Name = "setHostname"; - this.setHostname.Size = new System.Drawing.Size(34, 23); - this.setHostname.TabIndex = 6; - this.setHostname.Text = "Set"; - this.setHostname.UseVisualStyleBackColor = true; - this.setHostname.Click += new System.EventHandler(this.setConfig_Click); + label1.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left))); + label1.AutoSize = true; + label1.Location = new System.Drawing.Point(3, 0); + label1.MinimumSize = new System.Drawing.Size(0, 20); + label1.Name = "label1"; + label1.Size = new System.Drawing.Size(58, 20); + label1.TabIndex = 0; + label1.Text = "Hostname:"; + label1.TextAlign = System.Drawing.ContentAlignment.BottomCenter; // - // setRunCommand + // opsBox // - this.setRunCommand.Location = new System.Drawing.Point(576, 85); - this.setRunCommand.Name = "setRunCommand"; - this.setRunCommand.Size = new System.Drawing.Size(34, 23); - this.setRunCommand.TabIndex = 7; - this.setRunCommand.Text = "Set"; - this.setRunCommand.UseVisualStyleBackColor = true; - this.setRunCommand.Click += new System.EventHandler(this.setConfig_Click); + opsBox.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom) + | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + opsBox.Controls.Add(this.deleteHost); + opsBox.Controls.Add(this.refreshOne); + opsBox.Controls.Add(this.connect); + opsBox.Controls.Add(this.refreshAll); + opsBox.Location = new System.Drawing.Point(485, 319); + opsBox.Name = "opsBox"; + opsBox.Size = new System.Drawing.Size(114, 138); + opsBox.TabIndex = 8; + opsBox.TabStop = false; + opsBox.Text = "Operations"; + // + // deleteHost + // + this.deleteHost.Enabled = false; + this.deleteHost.Location = new System.Drawing.Point(6, 106); + this.deleteHost.Name = "deleteHost"; + this.deleteHost.Size = new System.Drawing.Size(101, 23); + this.deleteHost.TabIndex = 6; + this.deleteHost.Text = "Delete"; + this.deleteHost.UseVisualStyleBackColor = true; + this.deleteHost.Click += new System.EventHandler(this.deleteHost_Click); + // + // refreshOne + // + this.refreshOne.Location = new System.Drawing.Point(6, 19); + this.refreshOne.Name = "refreshOne"; + this.refreshOne.Size = new System.Drawing.Size(101, 23); + this.refreshOne.TabIndex = 5; + this.refreshOne.Text = "Refresh Selected"; + this.refreshOne.UseVisualStyleBackColor = true; + this.refreshOne.Click += new System.EventHandler(this.refreshOne_Click); + // + // connect + // + this.connect.Enabled = false; + this.connect.Location = new System.Drawing.Point(6, 77); + this.connect.Name = "connect"; + this.connect.Size = new System.Drawing.Size(101, 23); + this.connect.TabIndex = 5; + this.connect.Text = "Connect to App"; + this.connect.UseVisualStyleBackColor = true; + this.connect.Click += new System.EventHandler(this.connect_Click); + // + // refreshAll + // + this.refreshAll.Location = new System.Drawing.Point(6, 48); + this.refreshAll.Name = "refreshAll"; + this.refreshAll.Size = new System.Drawing.Size(101, 23); + this.refreshAll.TabIndex = 4; + this.refreshAll.Text = "Refresh All"; + this.refreshAll.UseVisualStyleBackColor = true; + this.refreshAll.Click += new System.EventHandler(this.refreshAll_Click); + // + // lookupsProgressFlow + // + this.lookupsProgressFlow.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Left) + | System.Windows.Forms.AnchorStyles.Right))); + tableLayoutPanel1.SetColumnSpan(this.lookupsProgressFlow, 2); + this.lookupsProgressFlow.Controls.Add(this.progressPicture); + this.lookupsProgressFlow.Controls.Add(label2); + this.lookupsProgressFlow.Controls.Add(this.remoteCountLabel); + this.lookupsProgressFlow.Location = new System.Drawing.Point(3, 289); + this.lookupsProgressFlow.MinimumSize = new System.Drawing.Size(0, 24); + this.lookupsProgressFlow.Name = "lookupsProgressFlow"; + this.lookupsProgressFlow.Size = new System.Drawing.Size(596, 24); + this.lookupsProgressFlow.TabIndex = 9; + this.lookupsProgressFlow.Visible = false; + // + // progressPicture + // + this.progressPicture.Location = new System.Drawing.Point(3, 3); + this.progressPicture.Name = "progressPicture"; + this.progressPicture.Size = new System.Drawing.Size(100, 16); + this.progressPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.AutoSize; + this.progressPicture.TabIndex = 0; + this.progressPicture.TabStop = false; + // + // label2 + // + label2.AutoSize = true; + label2.Dock = System.Windows.Forms.DockStyle.Left; + label2.Location = new System.Drawing.Point(109, 0); + label2.Name = "label2"; + label2.Size = new System.Drawing.Size(228, 22); + label2.TabIndex = 1; + label2.Text = "Remote connections in progress. Please wait..."; + label2.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; + // + // hosts + // + this.hosts.AlwaysDisplayVScroll = true; + treeListColumn1.AutoSize = true; + treeListColumn1.AutoSizeMinSize = 15; + treeListColumn1.Width = 48; + treeListColumn2.AutoSizeMinSize = 0; + treeListColumn2.Width = 250; + this.hosts.Columns.AddRange(new TreelistView.TreeListColumn[] { + treeListColumn1, + treeListColumn2}); + tableLayoutPanel1.SetColumnSpan(this.hosts, 2); + this.hosts.Cursor = System.Windows.Forms.Cursors.Arrow; + this.hosts.Dock = System.Windows.Forms.DockStyle.Fill; + this.hosts.Location = new System.Drawing.Point(3, 3); + this.hosts.MultiSelect = false; + this.hosts.Name = "hosts"; + this.hosts.RowOptions.ShowHeader = false; + this.hosts.Size = new System.Drawing.Size(596, 280); + this.hosts.TabIndex = 1; + this.hosts.ViewOptions.HoverHandTreeColumn = false; + this.hosts.ViewOptions.Indent = 12; + this.hosts.AfterSelect += new System.Windows.Forms.TreeViewEventHandler(this.hosts_AfterSelect); + this.hosts.NodeDoubleClicked += new TreelistView.TreeListView.NodeDoubleClickedHandler(this.hosts_NodeDoubleClicked); + this.hosts.KeyDown += new System.Windows.Forms.KeyEventHandler(this.hosts_KeyDown); + // + // remoteCountLabel + // + this.remoteCountLabel.AutoSize = true; + this.remoteCountLabel.Dock = System.Windows.Forms.DockStyle.Left; + this.remoteCountLabel.Location = new System.Drawing.Point(343, 0); + this.remoteCountLabel.Name = "remoteCountLabel"; + this.remoteCountLabel.Size = new System.Drawing.Size(118, 22); + this.remoteCountLabel.TabIndex = 2; + this.remoteCountLabel.Text = "999 connections active"; + this.remoteCountLabel.TextAlign = System.Drawing.ContentAlignment.MiddleLeft; // // RemoteManager // this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(632, 438); + this.ClientSize = new System.Drawing.Size(602, 460); this.Controls.Add(tableLayoutPanel1); this.Font = new System.Drawing.Font("Microsoft Sans Serif", 8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedToolWindow; this.Name = "RemoteManager"; this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; - this.Text = "Remote manager"; + this.Text = "Remote Host Manager"; tableLayoutPanel1.ResumeLayout(false); - tableLayoutPanel1.PerformLayout(); - ((System.ComponentModel.ISupportInitialize)(this.hosts)).EndInit(); basicConfigBox.ResumeLayout(false); basicConfigBox.PerformLayout(); tableLayoutPanel2.ResumeLayout(false); tableLayoutPanel2.PerformLayout(); + opsBox.ResumeLayout(false); + this.lookupsProgressFlow.ResumeLayout(false); + this.lookupsProgressFlow.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.progressPicture)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.hosts)).EndInit(); this.ResumeLayout(false); } @@ -314,13 +332,14 @@ private TreelistView.TreeListView hosts; private System.Windows.Forms.Button connect; - private System.Windows.Forms.Button addhost; + private System.Windows.Forms.Button refreshAll; private System.Windows.Forms.TextBox hostname; - private System.Windows.Forms.Button refresh; - private System.Windows.Forms.Button configure; - private System.Windows.Forms.TextBox configHostname; - private System.Windows.Forms.TextBox configRunCommand; - private System.Windows.Forms.Button setHostname; - private System.Windows.Forms.Button setRunCommand; + private System.Windows.Forms.TextBox runCommand; + private System.Windows.Forms.Button addUpdateHost; + private System.Windows.Forms.Button refreshOne; + private System.Windows.Forms.Button deleteHost; + private System.Windows.Forms.FlowLayoutPanel lookupsProgressFlow; + private System.Windows.Forms.PictureBox progressPicture; + private System.Windows.Forms.Label remoteCountLabel; } } \ No newline at end of file diff --git a/renderdocui/Windows/Dialogs/RemoteManager.cs b/renderdocui/Windows/Dialogs/RemoteManager.cs index cb55d803c..d91ee689c 100644 --- a/renderdocui/Windows/Dialogs/RemoteManager.cs +++ b/renderdocui/Windows/Dialogs/RemoteManager.cs @@ -102,6 +102,8 @@ namespace renderdocui.Windows.Dialogs { InitializeComponent(); + progressPicture.Image = global::renderdocui.Properties.Resources.hourglass; + hosts_AfterSelect(hosts, new TreeViewEventArgs(null)); Icon = global::renderdocui.Properties.Resources.icon; @@ -133,12 +135,19 @@ namespace renderdocui.Windows.Dialogs hosts.Nodes.Add(node); - refresh.Enabled = false; + refreshOne.Enabled = refreshAll.Enabled = false; + UpdateLookupsStatus(); Thread th = Helpers.NewThread(new ParameterizedThreadStart(LookupHostConnections)); th.Start(node); } + private void UpdateLookupsStatus() + { + lookupsProgressFlow.Visible = !refreshAll.Enabled; + remoteCountLabel.Text = String.Format("{0} lookups remaining", lookupsInProgress); + } + private static int lookupsInProgress = 0; private static Mutex lookupMutex = new Mutex(); @@ -240,19 +249,28 @@ namespace renderdocui.Windows.Dialogs // (to stop flooding) private void LookupComplete() { - updateConnectButton(); - if (lookupsInProgress == 0) - { - refresh.Enabled = true; - } + refreshOne.Enabled = refreshAll.Enabled = true; + + updateConnectButton(); + UpdateLookupsStatus(); } + private bool selectInProgress = false; + private void hosts_AfterSelect(object sender, TreeViewEventArgs e) { - configHostname.Enabled = configRunCommand.Enabled = - setHostname.Enabled = setRunCommand.Enabled = false; - configHostname.Text = configRunCommand.Text = ""; + if (selectInProgress) + return; + + selectInProgress = true; + + runCommand.Text = ""; + hostname.Text = ""; + + deleteHost.Enabled = refreshOne.Enabled = false; + hostname.Enabled = addUpdateHost.Enabled = runCommand.Enabled = true; + addUpdateHost.Text = "Add"; if (hosts.SelectedNode != null && hosts.SelectedNode.Tag != null) @@ -261,21 +279,76 @@ namespace renderdocui.Windows.Dialogs if (host != null) { + if (refreshAll.Enabled) + refreshOne.Enabled = true; + + addUpdateHost.Text = "Update"; + if (host.Hostname == "localhost") { - configHostname.Text = "localhost"; + hostname.Enabled = addUpdateHost.Enabled = runCommand.Enabled = false; + hostname.Text = "localhost"; } else { - configHostname.Enabled = configRunCommand.Enabled = - setHostname.Enabled = setRunCommand.Enabled = true; - configHostname.Text = host.Hostname; - configRunCommand.Text = host.RunCommand; + deleteHost.Enabled = true; + runCommand.Text = host.RunCommand; + hostname.Text = host.Hostname; } } } updateConnectButton(); + + selectInProgress = false; + } + + private void hostname_TextChanged(object sender, EventArgs e) + { + if(selectInProgress) + return; + + selectInProgress = true; + + addUpdateHost.Text = "Add"; + addUpdateHost.Enabled = true; + deleteHost.Enabled = refreshOne.Enabled = false; + hostname.Enabled = addUpdateHost.Enabled = runCommand.Enabled = true; + + TreelistView.Node node = null; + + foreach(var n in hosts.Nodes) + { + if(n["hostname"].ToString() == hostname.Text) + { + if (refreshAll.Enabled) + refreshOne.Enabled = true; + + addUpdateHost.Text = "Update"; + + if (hostname.Text == "localhost") + { + hostname.Enabled = addUpdateHost.Enabled = runCommand.Enabled = false; + } + else + { + deleteHost.Enabled = true; + runCommand.Text = (n.Tag as RemoteHost).RunCommand; + } + + node = n; + break; + } + } + + if (hosts.SelectedNode != node) + { + hosts.FocusedNode = node; + } + + updateConnectButton(); + + selectInProgress = false; } private void updateConnectButton() @@ -284,13 +357,17 @@ namespace renderdocui.Windows.Dialogs hosts.SelectedNode.Tag != null) { connect.Enabled = true; - connect.Text = "Connect"; + connect.Text = "Connect to App"; RemoteHost host = hosts.SelectedNode.Tag as RemoteHost; if (host != null) { - if(host.ServerRunning) + if (host.Hostname == "localhost") + { + connect.Enabled = false; + } + else if(host.ServerRunning) { connect.Text = "Shutdown"; @@ -312,7 +389,7 @@ namespace renderdocui.Windows.Dialogs } } - private void ConnectToHost(TreelistView.Node node) + private void ConnectToApp(TreelistView.Node node) { if (node != null && node.Tag != null) @@ -346,6 +423,7 @@ namespace renderdocui.Windows.Dialogs { RemoteHost h = new RemoteHost(); h.Hostname = host; + h.RunCommand = runCommand.Text; m_Core.Config.RemoteHosts.Add(h); m_Core.Config.Serialize(Core.ConfigFilename); @@ -356,14 +434,32 @@ namespace renderdocui.Windows.Dialogs } } hostname.Text = ""; + hostname.Text = host; + } + + private void SetRunCommand() + { + if (hosts.SelectedNode == null) + return; + + RemoteHost h = hosts.SelectedNode.Tag as RemoteHost; + + if (h != null) + { + h.RunCommand = runCommand.Text.Trim(); + m_Core.Config.Serialize(Core.ConfigFilename); + } } private void connect_Click(object sender, EventArgs e) { TreelistView.Node node = hosts.SelectedNode; + if (node == null) + return; + if (node.Tag is RemoteConnect) { - ConnectToHost(node); + ConnectToApp(node); } else if (node.Tag is RemoteHost) { @@ -396,10 +492,12 @@ namespace renderdocui.Windows.Dialogs else { // try to run - refresh.Enabled = false; + refreshOne.Enabled = refreshAll.Enabled = false; Thread th = Helpers.NewThread(new ParameterizedThreadStart(RunRemoteServer)); th.Start(node); + + UpdateLookupsStatus(); } } } @@ -407,20 +505,15 @@ namespace renderdocui.Windows.Dialogs private void hosts_NodeDoubleClicked(TreelistView.Node node) { if(node.Tag is RemoteConnect) - ConnectToHost(node); + ConnectToApp(node); } - private void addhost_Click(object sender, EventArgs e) - { - AddNewHost(); - } - - private void refresh_Click(object sender, EventArgs e) + private void refreshAll_Click(object sender, EventArgs e) { if (lookupsInProgress > 0) return; - refresh.Enabled = false; + refreshOne.Enabled = refreshAll.Enabled = false; hosts.BeginUpdate(); foreach (TreelistView.Node n in hosts.Nodes) @@ -434,6 +527,62 @@ namespace renderdocui.Windows.Dialogs th.Start(n); } hosts.EndUpdate(); + + UpdateLookupsStatus(); + } + + private void refreshOne_Click(object sender, EventArgs e) + { + if (lookupsInProgress > 0 || hosts.SelectedNode == null) + return; + + refreshOne.Enabled = refreshAll.Enabled = false; + + hosts.BeginUpdate(); + TreelistView.Node n = hosts.SelectedNode; + { + n.Nodes.Clear(); + n.Italic = true; + n.Image = global::renderdocui.Properties.Resources.hourglass; + n.Bold = false; + + Thread th = Helpers.NewThread(new ParameterizedThreadStart(LookupHostConnections)); + th.Start(n); + } + hosts.EndUpdate(); + + UpdateLookupsStatus(); + } + + private void deleteHost_Click(object sender, EventArgs e) + { + if(hosts.SelectedNode == null || hosts.SelectedNode.Parent != null) + return; + + string hostname = hosts.SelectedNode["hostname"] as string; + + if (hostname == "localhost") + return; + + DialogResult res = MessageBox.Show(String.Format("Are you sure you wish to delete {0}?", hostname), + "Deleting host", MessageBoxButtons.YesNoCancel); + + if (res == DialogResult.Cancel || res == DialogResult.No) + return; + + if (res == DialogResult.Yes) + { + m_Core.Config.RemoteHosts.Remove(hosts.SelectedNode.Tag as RemoteHost); + m_Core.Config.Serialize(Core.ConfigFilename); + hosts.BeginUpdate(); + hosts.Nodes.Remove(hosts.SelectedNode); + hosts.EndUpdate(); + + hosts.FocusedNode = null; + + this.hostname.Text = ""; + this.hostname.Text = hostname; + } } private void hosts_KeyDown(object sender, KeyEventArgs e) @@ -441,63 +590,27 @@ namespace renderdocui.Windows.Dialogs if (e.KeyData == Keys.Return || e.KeyData == Keys.Enter) { if (connect.Enabled) - { - connect_Click(sender, new EventArgs()); - } - } - if (e.KeyData == Keys.Delete && hosts.SelectedNode != null && hosts.SelectedNode.Parent == null) - { - string hostname = hosts.SelectedNode["hostname"] as string; - - if(hostname == "localhost") - return; - - DialogResult res = MessageBox.Show(String.Format("Are you sure you wish to delete {0}?", hostname), - "Deleting host", MessageBoxButtons.YesNoCancel); - - if (res == DialogResult.Cancel || res == DialogResult.No) - return; - - if (res == DialogResult.Yes) - { - m_Core.Config.RemoteHosts.Remove(hosts.SelectedNode.Tag as RemoteHost); - m_Core.Config.Serialize(Core.ConfigFilename); - hosts.BeginUpdate(); - hosts.Nodes.Remove(hosts.SelectedNode); - hosts.EndUpdate(); - } + connect.PerformClick(); } + if (e.KeyData == Keys.Delete) + deleteHost.PerformClick(); } private void textbox_KeyPress(object sender, KeyPressEventArgs e) { if (e.KeyChar == '\n' || e.KeyChar == '\r') { - if(sender == hostname) - addhost_Click(sender, new EventArgs()); - if(sender == configHostname) - setConfig_Click(setHostname, new EventArgs()); - if(sender == configRunCommand) - setConfig_Click(setRunCommand, new EventArgs()); + if(addUpdateHost.Enabled) + addUpdateHost.PerformClick(); } } - private void setConfig_Click(object sender, EventArgs e) + private void addUpdateHost_Click(object sender, EventArgs e) { - int idx = m_Core.Config.RemoteHosts.IndexOf(hosts.SelectedNode.Tag as RemoteHost); - - if(idx >= 0) - { - if (sender == setHostname) - m_Core.Config.RemoteHosts[idx].Hostname = configHostname.Text.Trim(); - if (sender == setRunCommand) - m_Core.Config.RemoteHosts[idx].RunCommand = configRunCommand.Text.Trim(); - - m_Core.Config.Serialize(Core.ConfigFilename); - hosts.BeginUpdate(); - hosts.SelectedNode["hostname"] = m_Core.Config.RemoteHosts[idx].Hostname; - hosts.EndUpdate(); - } + if (hosts.SelectedNode != null && hosts.SelectedNode.Tag is RemoteHost) + SetRunCommand(); + else + AddNewHost(); } } } diff --git a/renderdocui/Windows/Dialogs/RemoteManager.resx b/renderdocui/Windows/Dialogs/RemoteManager.resx index f4545399e..7dec54d68 100644 --- a/renderdocui/Windows/Dialogs/RemoteManager.resx +++ b/renderdocui/Windows/Dialogs/RemoteManager.resx @@ -126,16 +126,16 @@ False + + False + False + + False + False - - False - - - False - \ No newline at end of file