From 05949d9be1aaccf77c5f8a9f449067f54523b182 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20Sch=C3=B6n?= Date: Thu, 16 Mar 2023 20:24:43 +0100 Subject: [PATCH] added 'Remote Files' button to KVMViewer --- src/KVMViewer.Designer.cs | 11 +++ src/KVMViewer.cs | 15 ++++ src/KVMViewer.resx | 167 +++++++++++++++++++------------------- 3 files changed, 108 insertions(+), 85 deletions(-) diff --git a/src/KVMViewer.Designer.cs b/src/KVMViewer.Designer.cs index cee1679..fa60aa0 100644 --- a/src/KVMViewer.Designer.cs +++ b/src/KVMViewer.Designer.cs @@ -51,6 +51,7 @@ namespace MeshCentralRouter this.toolStripStatusLabel1 = new System.Windows.Forms.ToolStripStatusLabel(); this.updateTimer = new System.Windows.Forms.Timer(this.components); this.topPanel = new System.Windows.Forms.Panel(); + this.openRemoteFilesButton = new System.Windows.Forms.Button(); this.extraButtonsPanel = new System.Windows.Forms.Panel(); this.splitButton = new System.Windows.Forms.Button(); this.clipOutboundButton = new System.Windows.Forms.Button(); @@ -104,6 +105,7 @@ namespace MeshCentralRouter // topPanel // this.topPanel.BackColor = System.Drawing.SystemColors.Control; + this.topPanel.Controls.Add(this.openRemoteFilesButton); this.topPanel.Controls.Add(this.extraButtonsPanel); this.topPanel.Controls.Add(this.splitButton); this.topPanel.Controls.Add(this.clipOutboundButton); @@ -116,6 +118,14 @@ namespace MeshCentralRouter resources.ApplyResources(this.topPanel, "topPanel"); this.topPanel.Name = "topPanel"; // + // openRemoteFilesButton + // + resources.ApplyResources(this.openRemoteFilesButton, "openRemoteFilesButton"); + this.openRemoteFilesButton.Name = "openRemoteFilesButton"; + this.openRemoteFilesButton.TabStop = false; + this.openRemoteFilesButton.UseVisualStyleBackColor = true; + this.openRemoteFilesButton.Click += new System.EventHandler(this.openRemoteFilesButton_Click); + // // extraButtonsPanel // resources.ApplyResources(this.extraButtonsPanel, "extraButtonsPanel"); @@ -298,6 +308,7 @@ namespace MeshCentralRouter private Button splitButton; private Panel extraButtonsPanel; private ImageList displaySelectorImageList; + private Button openRemoteFilesButton; } } diff --git a/src/KVMViewer.cs b/src/KVMViewer.cs index 920f39e..0888c5b 100644 --- a/src/KVMViewer.cs +++ b/src/KVMViewer.cs @@ -397,6 +397,7 @@ namespace MeshCentralRouter } cadButton.Enabled = (state == 3); + openRemoteFilesButton.Enabled = (state == 3 && (node.agentcaps & 4) != 0); if ((kvmControl.AutoSendClipboard) && ((server.features2 & 0x1000) == 0)) // 0x1000 Clipboard Set { clipInboundButton.Visible = false; @@ -755,6 +756,20 @@ namespace MeshCentralRouter } } + private void openRemoteFilesButton_Click(object sender, EventArgs e) + { + if ((node.conn & 1) == 0) { return; } // Agent not connected on this device + if (node.fileViewer == null) + { + node.fileViewer = new FileViewer(server, node); + node.fileViewer.Show(); + node.fileViewer.MenuItemConnect_Click(null, null); + } + else + { + node.fileViewer.Focus(); + } + } } } diff --git a/src/KVMViewer.resx b/src/KVMViewer.resx index d23caf2..0131993 100644 --- a/src/KVMViewer.resx +++ b/src/KVMViewer.resx @@ -122,7 +122,7 @@ - 1372, 20 + 1029, 17 --- @@ -131,7 +131,7 @@ MiddleLeft - 16, 20 + 13, 17 v @@ -141,14 +141,10 @@ False - 0, 897 - - - - 1, 0, 19, 0 + 0, 727 - 1392, 25 + 1044, 22 9 @@ -171,14 +167,48 @@ 154, 17 + + False + + + 192, 3 + + + + 2, 2, 2, 2 + + + 89, 26 + + + 2 + + + Remote Files + + + openRemoteFilesButton + + + System.Windows.Forms.Button, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + topPanel + + + 0 + Top, Left, Right - 383, 4 + 380, 2 + + + 2, 2, 2, 2 - 658, 32 + 401, 27 10 @@ -193,7 +223,7 @@ topPanel - 0 + 1 Top, Right @@ -202,13 +232,10 @@ NoControl - 1048, 4 - - - 4, 4, 4, 4 + 786, 3 - 119, 32 + 89, 26 8 @@ -229,7 +256,7 @@ topPanel - 1 + 2 Top, Right @@ -241,16 +268,13 @@ NoControl - 1175, 4 - - - 4, 4, 4, 4 + 881, 3 - 40, 32 + 30, 26 - 3 + 4 clipOutboundButton @@ -262,7 +286,7 @@ topPanel - 2 + 3 Top, Right @@ -274,16 +298,13 @@ NoControl - 1223, 4 - - - 4, 4, 4, 4 + 917, 3 - 40, 32 + 30, 26 - 4 + 5 399, 17 @@ -301,7 +322,7 @@ topPanel - 3 + 4 Top, Right @@ -310,13 +331,10 @@ NoControl - 1319, 4 - - - 4, 4, 4, 4 + 989, 3 - 69, 32 + 52, 26 7 @@ -334,22 +352,19 @@ topPanel - 4 + 5 NoControl - 257, 4 - - - 4, 4, 4, 4 + 286, 3 - 119, 32 + 89, 26 - 2 + 3 Settings @@ -364,7 +379,7 @@ topPanel - 5 + 6 Top, Right @@ -373,13 +388,10 @@ NoControl - 1271, 4 - - - 4, 4, 4, 4 + 953, 3 - 40, 32 + 30, 26 6 @@ -394,7 +406,7 @@ topPanel - 6 + 7 False @@ -403,13 +415,10 @@ NoControl - 131, 4 - - - 4, 4, 4, 4 + 98, 3 - 119, 32 + 89, 26 1 @@ -427,31 +436,31 @@ topPanel - 7 + 8 518, 17 - 198, 24 + 171, 22 Ask Consent + Bar - 198, 24 + 171, 22 Ask Consent - 198, 24 + 171, 22 Privacy Bar - 199, 76 + 172, 70 consentContextMenuStrip @@ -463,13 +472,10 @@ NoControl - 4, 4 - - - 4, 4, 4, 4 + 3, 3 - 119, 32 + 89, 26 0 @@ -487,7 +493,7 @@ topPanel - 8 + 9 Top @@ -495,11 +501,8 @@ 0, 0 - - 4, 4, 4, 4 - - 1392, 39 + 1044, 32 11 @@ -529,13 +532,10 @@ NoControl - 16, 73 - - - 4, 0, 4, 0 + 12, 59 - 86, 31 + 70, 25 12 @@ -565,13 +565,10 @@ Fill - 0, 39 - - - 4, 4, 4, 4 + 0, 32 - 1392, 858 + 1044, 695 10 @@ -580,7 +577,7 @@ resizeKvmControl - MeshCentralRouter.KVMResizeControl, MeshCentralRouter, Version=1.8.8096.29519, Culture=neutral, PublicKeyToken=null + MeshCentralRouter.KVMResizeControl, MeshCentralRouter, Version=1.8.8475.33354, Culture=neutral, PublicKeyToken=null $this @@ -596,7 +593,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAADs - DgAAAk1TRnQBSQFMAgEBBAEAARABAAEQAQABEAEAARABAAT/AREBAAj/AUIBTQE2BwABNgMAASgDAAFA + DgAAAk1TRnQBSQFMAgEBBAEAATABAAEwAQABEAEAARABAAT/AREBAAj/AUIBTQE2BwABNgMAASgDAAFA AwABIAMAAQEBAAEQBgABEP8A/wD/AP8A/wD/AP8A/wAiAAH3AV4BpQEUAaUBFAGlARQBpQEUAaUBFAGl ARQB9wFeEAAB9wFeAaUBFAGlARQBpQEUAaUBFAGlARQBpQEUAfcBXhAAAfcBXgGlARQBpQEUAaUBFAGl ARQBpQEUAaUBFAH3AV4QAAH3AV4BpQEUAaUBFAGlARQBpQEUAaUBFAGlARQB9wFeEAAB3gF7ARgBYwFr @@ -666,10 +663,10 @@ True - 8, 16 + 6, 13 - 1392, 922 + 1044, 749 @@ -1097,7 +1094,7 @@ - 3, 2, 3, 2 + 2, 2, 2, 2 CenterScreen