From 49390574bfa7582d2a1a7746d28d01ca5a81a357 Mon Sep 17 00:00:00 2001 From: Brandon Wulf Date: Fri, 14 Jul 2017 18:16:27 -0700 Subject: [PATCH 1/5] Builds and basically works --- mRemoteV1/App/NativeMethods.cs | 8 + mRemoteV1/App/Windows.cs | 13 ++ .../Config/Settings/LayoutSettingsLoader.cs | 6 + mRemoteV1/Connection/Protocol/PuttyBase.cs | 2 +- mRemoteV1/UI/Forms/frmMain.Designer.cs | 10 ++ mRemoteV1/UI/Forms/frmMain.cs | 15 ++ .../UI/Window/SSHCommandWIndow.Designer.cs | 75 ++++++++ mRemoteV1/UI/Window/SSHCommandWIndow.cs | 160 ++++++++++++++++++ mRemoteV1/UI/Window/SSHCommandWIndow.resx | 120 +++++++++++++ mRemoteV1/UI/WindowType.cs | 1 + mRemoteV1/mRemoteV1.csproj | 35 ++-- 11 files changed, 428 insertions(+), 17 deletions(-) create mode 100644 mRemoteV1/UI/Window/SSHCommandWIndow.Designer.cs create mode 100644 mRemoteV1/UI/Window/SSHCommandWIndow.cs create mode 100644 mRemoteV1/UI/Window/SSHCommandWIndow.resx diff --git a/mRemoteV1/App/NativeMethods.cs b/mRemoteV1/App/NativeMethods.cs index 44aa0b96..c9250671 100644 --- a/mRemoteV1/App/NativeMethods.cs +++ b/mRemoteV1/App/NativeMethods.cs @@ -44,6 +44,9 @@ namespace mRemoteNG.App [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] internal static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam); + [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] + internal static extern IntPtr PostMessage(IntPtr hWnd, uint Msg, IntPtr wParam, IntPtr lParam); + [DllImport("user32.dll", SetLastError = true, CharSet = CharSet.Unicode)] internal static extern IntPtr SendMessage(IntPtr hWnd, uint Msg, IntPtr wParam, StringBuilder lParam); @@ -378,6 +381,11 @@ namespace mRemoteNG.App /// public const int WM_KEYUP = 0x101; + /// + /// + /// + public const int WM_CHAR = 0x102; + /// /// /// diff --git a/mRemoteV1/App/Windows.cs b/mRemoteV1/App/Windows.cs index e2020774..faecf0ed 100644 --- a/mRemoteV1/App/Windows.cs +++ b/mRemoteV1/App/Windows.cs @@ -18,6 +18,8 @@ namespace mRemoteNG.App private static DockContent _helpPanel = new DockContent(); private static ExternalToolsWindow _externalappsForm; private static DockContent _externalappsPanel = new DockContent(); + private static SSHCommandWIndow _sshcommandForm; + private static DockContent _sshcommandPanel = new DockContent(); private static PortScanWindow _portscanForm; private static DockContent _portscanPanel = new DockContent(); private static UltraVNCWindow _ultravncscForm; @@ -33,6 +35,8 @@ namespace mRemoteNG.App public static DockContent ErrorsPanel { get; set; } = new DockContent(); public static ScreenshotManagerWindow ScreenshotForm { get; set; } public static DockContent ScreenshotPanel { get; set; } = new DockContent(); + public static SSHCommandWIndow SSHCommandForm { get; set; } + public static DockContent SSHCommandPanel { get; set; } = new DockContent(); public static UpdateWindow UpdateForm { get; set; } public static DockContent UpdatePanel { get; set; } = new DockContent(); public static SSHTransferWindow SshtransferForm { get; set; } @@ -100,6 +104,15 @@ namespace mRemoteNG.App } _externalappsForm.Show(frmMain.Default.pnlDock); } + else if (windowType.Equals(WindowType.SSHCommandWindow)) + { + if (_sshcommandForm == null || _sshcommandForm.IsDisposed) + { + _sshcommandForm = new SSHCommandWIndow(_sshcommandPanel); + _sshcommandPanel = _sshcommandForm; + } + _externalappsForm.Show(frmMain.Default.pnlDock); + } else if (windowType.Equals(WindowType.PortScan)) { _portscanForm = new PortScanWindow(_portscanPanel); diff --git a/mRemoteV1/Config/Settings/LayoutSettingsLoader.cs b/mRemoteV1/Config/Settings/LayoutSettingsLoader.cs index 1728e8b9..b7ecbf5c 100644 --- a/mRemoteV1/Config/Settings/LayoutSettingsLoader.cs +++ b/mRemoteV1/Config/Settings/LayoutSettingsLoader.cs @@ -76,6 +76,9 @@ namespace mRemoteNG.Config.Settings if (persistString == typeof(ScreenshotManagerWindow).ToString()) return Windows.ScreenshotPanel; + + if (persistString == typeof(SSHCommandWIndow).ToString()) + return Windows.SSHCommandPanel; } catch (Exception ex) { @@ -99,6 +102,9 @@ namespace mRemoteNG.Config.Settings Windows.ScreenshotForm = new ScreenshotManagerWindow(Windows.ScreenshotPanel); Windows.ScreenshotPanel = Windows.ScreenshotForm; + Windows.SSHCommandForm = new SSHCommandWIndow(Windows.SSHCommandPanel); + Windows.SSHCommandPanel = Windows.SSHCommandForm; + Windows.UpdateForm = new UpdateWindow(Windows.UpdatePanel); Windows.UpdatePanel = Windows.UpdateForm; } diff --git a/mRemoteV1/Connection/Protocol/PuttyBase.cs b/mRemoteV1/Connection/Protocol/PuttyBase.cs index bb5afa51..73f4e0d2 100644 --- a/mRemoteV1/Connection/Protocol/PuttyBase.cs +++ b/mRemoteV1/Connection/Protocol/PuttyBase.cs @@ -22,7 +22,7 @@ namespace mRemoteNG.Connection.Protocol protected Putty_SSHVersion PuttySSHVersion { private get; set; } - private IntPtr PuttyHandle { get; set; } + public IntPtr PuttyHandle { get; set; } private Process PuttyProcess { get; set; } diff --git a/mRemoteV1/UI/Forms/frmMain.Designer.cs b/mRemoteV1/UI/Forms/frmMain.Designer.cs index 4f19b58d..08c8a14b 100644 --- a/mRemoteV1/UI/Forms/frmMain.Designer.cs +++ b/mRemoteV1/UI/Forms/frmMain.Designer.cs @@ -61,6 +61,7 @@ namespace mRemoteNG.UI.Forms this.mMenViewConfig = new System.Windows.Forms.ToolStripMenuItem(); this.mMenViewErrorsAndInfos = new System.Windows.Forms.ToolStripMenuItem(); this.mMenViewScreenshotManager = new System.Windows.Forms.ToolStripMenuItem(); + this.mMenViewMultiPuttyCommand = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.mMenViewJumpTo = new System.Windows.Forms.ToolStripMenuItem(); this.mMenViewJumpToConnectionsConfig = new System.Windows.Forms.ToolStripMenuItem(); @@ -336,6 +337,7 @@ namespace mRemoteNG.UI.Forms this.mMenViewConfig, this.mMenViewErrorsAndInfos, this.mMenViewScreenshotManager, + this.mMenViewMultiPuttyCommand, this.ToolStripSeparator1, this.mMenViewJumpTo, this.mMenViewResetLayout, @@ -406,6 +408,13 @@ namespace mRemoteNG.UI.Forms this.mMenViewScreenshotManager.Size = new System.Drawing.Size(228, 22); this.mMenViewScreenshotManager.Text = "Screenshot Manager"; this.mMenViewScreenshotManager.Click += new System.EventHandler(this.mMenViewScreenshotManager_Click); + // + // mMenViewMultiPuttyCommand + // + this.mMenViewMultiPuttyCommand.Name = "mMenViewMultiPuttyCommand"; + this.mMenViewMultiPuttyCommand.Size = new System.Drawing.Size(228, 22); + this.mMenViewMultiPuttyCommand.Text = "Multi Putty Commander"; + this.mMenViewMultiPuttyCommand.Click += new System.EventHandler(this.mMenViewMultiPuttyCommand_Click); // // ToolStripSeparator1 // @@ -842,6 +851,7 @@ namespace mRemoteNG.UI.Forms internal System.Windows.Forms.ToolStripMenuItem mMenInfoDonate; internal System.Windows.Forms.ToolStripSeparator mMenViewSep3; internal ToolStripSplitButton btnQuickConnect; + internal System.Windows.Forms.ToolStripMenuItem mMenViewMultiPuttyCommand; internal System.Windows.Forms.ToolStripMenuItem mMenViewJumpTo; internal System.Windows.Forms.ToolStripMenuItem mMenViewJumpToConnectionsConfig; internal System.Windows.Forms.ToolStripMenuItem mMenViewJumpToErrorsInfos; diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index d76d507b..316df31c 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -705,6 +705,7 @@ namespace mRemoteNG.UI.Forms mMenViewConfig.Checked = !Windows.ConfigForm.IsHidden; mMenViewErrorsAndInfos.Checked = !Windows.ErrorsForm.IsHidden; mMenViewScreenshotManager.Checked = !Windows.ScreenshotForm.IsHidden; + mMenViewMultiPuttyCommand.Checked = !Windows.SSHCommandPanel.IsHidden; mMenViewExtAppsToolbar.Checked = tsExternalTools.Visible; mMenViewQuickConnectToolbar.Checked = tsQuickConnect.Visible; @@ -783,6 +784,20 @@ namespace mRemoteNG.UI.Forms } } + private void mMenViewMultiPuttyCommand_Click(object sender, EventArgs e) + { + if (mMenViewMultiPuttyCommand.Checked == false) + { + Windows.SSHCommandPanel.Show(pnlDock); + mMenViewMultiPuttyCommand.Checked = true; + } + else + { + Windows.SSHCommandPanel.Hide(); + mMenViewMultiPuttyCommand.Checked = false; + } + } + private void mMenViewJumpToConnectionsConfig_Click(object sender, EventArgs e) { if (pnlDock.ActiveContent == Windows.TreePanel) diff --git a/mRemoteV1/UI/Window/SSHCommandWIndow.Designer.cs b/mRemoteV1/UI/Window/SSHCommandWIndow.Designer.cs new file mode 100644 index 00000000..5a8649de --- /dev/null +++ b/mRemoteV1/UI/Window/SSHCommandWIndow.Designer.cs @@ -0,0 +1,75 @@ +namespace mRemoteNG.UI.Window +{ + partial class SSHCommandWIndow + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.txtSSHCommand = new System.Windows.Forms.RichTextBox(); + this.lstCommands = new System.Windows.Forms.ListBox(); + this.SuspendLayout(); + // + // txtSSHCommand + // + this.txtSSHCommand.Dock = System.Windows.Forms.DockStyle.Fill; + this.txtSSHCommand.Location = new System.Drawing.Point(0, 0); + this.txtSSHCommand.MinimumSize = new System.Drawing.Size(0, 150); + this.txtSSHCommand.Name = "txtSSHCommand"; + this.txtSSHCommand.Size = new System.Drawing.Size(821, 532); + this.txtSSHCommand.TabIndex = 0; + this.txtSSHCommand.Text = ""; + this.txtSSHCommand.Enter += new System.EventHandler(this.txtSSHCommand_Enter); + this.txtSSHCommand.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSSHCommand_KeyDown); + this.txtSSHCommand.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtSSHCommand_KeyUp); + // + // lstCommands + // + this.lstCommands.Dock = System.Windows.Forms.DockStyle.Right; + this.lstCommands.FormattingEnabled = true; + this.lstCommands.ItemHeight = 16; + this.lstCommands.Location = new System.Drawing.Point(701, 0); + this.lstCommands.Name = "lstCommands"; + this.lstCommands.Size = new System.Drawing.Size(120, 532); + this.lstCommands.TabIndex = 1; + this.lstCommands.Visible = false; + // + // SSHCommandWIndow + // + this.ClientSize = new System.Drawing.Size(821, 532); + this.Controls.Add(this.lstCommands); + this.Controls.Add(this.txtSSHCommand); + this.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.Name = "SSHCommandWIndow"; + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.RichTextBox txtSSHCommand; + private System.Windows.Forms.ListBox lstCommands; + } +} \ No newline at end of file diff --git a/mRemoteV1/UI/Window/SSHCommandWIndow.cs b/mRemoteV1/UI/Window/SSHCommandWIndow.cs new file mode 100644 index 00000000..922f92fc --- /dev/null +++ b/mRemoteV1/UI/Window/SSHCommandWIndow.cs @@ -0,0 +1,160 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using WeifenLuo.WinFormsUI.Docking; +using mRemoteNG.Connection.Protocol; +using mRemoteNG.App; +using System.Collections; +using mRemoteNG.Connection; + +namespace mRemoteNG.UI.Window +{ + public partial class SSHCommandWIndow : BaseWindow + { + + public SSHCommandWIndow(DockContent panel) + { + InitializeComponent(); + + WindowType = WindowType.SSHCommandWindow; + DockPnl = panel; + + HideOnClose = true; + Icon = Resources.Screenshot_Icon; + Name = "SSHCommander"; + TabText = "Multi-SSH"; + Text = "Multi-SSH Commander"; + } + + #region Private Fields + private ArrayList processHandlers = new ArrayList(); + #endregion + + #region Public Methods + #region Event Handlers + private void SSHCommandWindow_Load(object sender, EventArgs e) + { + Control.CheckForIllegalCrossThreadCalls = false; + } + + #endregion + + private void txtSSHCommand_Enter(object sender, EventArgs e) + { + try + { + var connectionInfoList = Runtime.ConnectionTreeModel.GetRecursiveChildList(); + //.Where( node-> !(node is Container.ContainerInfo)); + var previouslyOpenedConnections = connectionInfoList.Where(item => item.OpenConnections.Count > 0); + + //var connectionInfoList = connectionTree.GetRootConnectionNode().GetRecursiveChildList().Where(node => !(node is ContainerInfo)); + //var previouslyOpenedConnections = connectionInfoList.Where(item => item.PleaseConnect); + //foreach (var connectionInfo in previouslyOpenedConnections) + //{ + // _connectionInitiator.OpenConnection(connectionInfo); + //} + + + + processHandlers.Clear(); + foreach (ConnectionInfo connection in previouslyOpenedConnections) + { + foreach (ProtocolBase _base in connection.OpenConnections) + { + if (_base.GetType().IsSubclassOf(typeof(PuttyBase))) + { + processHandlers.Add((PuttyBase)_base); + } + } + } + } + catch (Exception ex) + { + + } + } + + private void txtSSHCommand_KeyDown(object sender, KeyEventArgs e) + { + if (processHandlers.Count == 0) + { + e.SuppressKeyPress = true; + return; + } + + if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down) + { + e.SuppressKeyPress = true; + //string lastCommand = ""; + //if (lstCommands.SelectedIndex == lstCommands.Items.Count) + //{ + // lastCommand = lstCommands.Items[lstCommands.Items.Count].ToString(); + //} + + if (e.KeyCode == Keys.Up && lstCommands.SelectedIndex -1 > -1 && lstCommands.SelectedItem.ToString() == txtSSHCommand.Text) + { + lstCommands.SelectedIndex -= 1; + } + + if (e.KeyCode == Keys.Down && lstCommands.SelectedIndex + 1 < lstCommands.Items.Count) + { + lstCommands.SelectedIndex += 1; + } + + txtSSHCommand.Text = lstCommands.SelectedItem.ToString(); + txtSSHCommand.Select(txtSSHCommand.TextLength, 0); + } + + if (e.Control == true && e.KeyCode != Keys.V && e.Alt == false) + { + sendAllKey(NativeMethods.WM_KEYDOWN, e.KeyValue); + } + + if (e.KeyCode == Keys.Enter) + { + string strLine = txtSSHCommand.Text; + foreach (char chr1 in strLine) + { + sendAllKey(NativeMethods.WM_CHAR, Convert.ToByte(chr1)); + } + sendAllKey(NativeMethods.WM_KEYDOWN, 13); // Enter = char13 + } + } + + private void gotoEndOfText() + { + if (txtSSHCommand.Text.Trim() != "") + { + lstCommands.Items.Add(txtSSHCommand.Text.Trim()); + } + lstCommands.SelectedIndex = lstCommands.Items.Count - 1; + txtSSHCommand.Clear(); + } + + private void sendAllKey(int keyType, int keyData) + { + if (processHandlers.Count == 0) + { + return; + } + foreach (PuttyBase proc in processHandlers) + { + NativeMethods.PostMessage(proc.PuttyHandle, keyType, new IntPtr(keyData), new IntPtr(0)); + } + } + + private void txtSSHCommand_KeyUp(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + gotoEndOfText(); + } + } + } + #endregion +} diff --git a/mRemoteV1/UI/Window/SSHCommandWIndow.resx b/mRemoteV1/UI/Window/SSHCommandWIndow.resx new file mode 100644 index 00000000..1af7de15 --- /dev/null +++ b/mRemoteV1/UI/Window/SSHCommandWIndow.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/mRemoteV1/UI/WindowType.cs b/mRemoteV1/UI/WindowType.cs index 3b320aaa..6ee9f730 100644 --- a/mRemoteV1/UI/WindowType.cs +++ b/mRemoteV1/UI/WindowType.cs @@ -17,5 +17,6 @@ namespace mRemoteNG.UI PortScan = 14, UltraVNCSC = 16, ComponentsCheck = 17, + SSHCommandWindow = 18, } } \ No newline at end of file diff --git a/mRemoteV1/mRemoteV1.csproj b/mRemoteV1/mRemoteV1.csproj index 3d2f5e95..9d62f44d 100644 --- a/mRemoteV1/mRemoteV1.csproj +++ b/mRemoteV1/mRemoteV1.csproj @@ -47,6 +47,12 @@ True + + References\AxInterop.MSTSCLib.dll + + + References\AxInterop.WFICALib.dll + ..\packages\BouncyCastle.1.8.1\lib\BouncyCastle.Crypto.dll True @@ -59,6 +65,10 @@ ..\packages\Geckofx45.45.0.22\lib\net40\Geckofx-Winforms.dll True + + References\Interop.WFICALib.dll + True + False @@ -488,6 +498,12 @@ Form + + Form + + + SSHCommandWIndow.cs + Form @@ -671,6 +687,9 @@ ScreenshotManagerWindow.cs Designer + + SSHCommandWIndow.cs + SSHTransferWindow.cs Designer @@ -1219,14 +1238,6 @@ aximp False - - {238F6F80-B8B4-11CF-8771-00A024541EE3} - 2 - 7 - 0 - aximp - False - {8C11EFA1-92C3-11D1-BC1E-00C04FA31489} 1 @@ -1235,14 +1246,6 @@ tlbimp False - - {238F6F80-B8B4-11CF-8771-00A024541EE3} - 2 - 7 - 0 - tlbimp - False - From 5f9f0769eb10fc7ef800000f0360e5e4185f8d4f Mon Sep 17 00:00:00 2001 From: Brandon Wulf Date: Mon, 17 Jul 2017 15:00:59 -0700 Subject: [PATCH 2/5] Switched Multi SSH window to a Multi SSH toolbar --- mRemoteV1/App/Windows.cs | 12 - .../Config/Settings/LayoutSettingsLoader.cs | 6 - mRemoteV1/UI/Forms/frmMain.Designer.cs | 219 +++++++++++------- mRemoteV1/UI/Forms/frmMain.cs | 143 ++++++++++-- mRemoteV1/UI/Forms/frmMain.resx | 25 +- .../UI/Window/SSHCommandWIndow.Designer.cs | 75 ------ mRemoteV1/UI/Window/SSHCommandWIndow.cs | 160 ------------- mRemoteV1/UI/Window/SSHCommandWIndow.resx | 120 ---------- mRemoteV1/UI/WindowType.cs | 1 - mRemoteV1/mRemoteV1.csproj | 9 - 10 files changed, 268 insertions(+), 502 deletions(-) delete mode 100644 mRemoteV1/UI/Window/SSHCommandWIndow.Designer.cs delete mode 100644 mRemoteV1/UI/Window/SSHCommandWIndow.cs delete mode 100644 mRemoteV1/UI/Window/SSHCommandWIndow.resx diff --git a/mRemoteV1/App/Windows.cs b/mRemoteV1/App/Windows.cs index faecf0ed..d12adb4b 100644 --- a/mRemoteV1/App/Windows.cs +++ b/mRemoteV1/App/Windows.cs @@ -18,7 +18,6 @@ namespace mRemoteNG.App private static DockContent _helpPanel = new DockContent(); private static ExternalToolsWindow _externalappsForm; private static DockContent _externalappsPanel = new DockContent(); - private static SSHCommandWIndow _sshcommandForm; private static DockContent _sshcommandPanel = new DockContent(); private static PortScanWindow _portscanForm; private static DockContent _portscanPanel = new DockContent(); @@ -35,8 +34,6 @@ namespace mRemoteNG.App public static DockContent ErrorsPanel { get; set; } = new DockContent(); public static ScreenshotManagerWindow ScreenshotForm { get; set; } public static DockContent ScreenshotPanel { get; set; } = new DockContent(); - public static SSHCommandWIndow SSHCommandForm { get; set; } - public static DockContent SSHCommandPanel { get; set; } = new DockContent(); public static UpdateWindow UpdateForm { get; set; } public static DockContent UpdatePanel { get; set; } = new DockContent(); public static SSHTransferWindow SshtransferForm { get; set; } @@ -104,15 +101,6 @@ namespace mRemoteNG.App } _externalappsForm.Show(frmMain.Default.pnlDock); } - else if (windowType.Equals(WindowType.SSHCommandWindow)) - { - if (_sshcommandForm == null || _sshcommandForm.IsDisposed) - { - _sshcommandForm = new SSHCommandWIndow(_sshcommandPanel); - _sshcommandPanel = _sshcommandForm; - } - _externalappsForm.Show(frmMain.Default.pnlDock); - } else if (windowType.Equals(WindowType.PortScan)) { _portscanForm = new PortScanWindow(_portscanPanel); diff --git a/mRemoteV1/Config/Settings/LayoutSettingsLoader.cs b/mRemoteV1/Config/Settings/LayoutSettingsLoader.cs index b7ecbf5c..1728e8b9 100644 --- a/mRemoteV1/Config/Settings/LayoutSettingsLoader.cs +++ b/mRemoteV1/Config/Settings/LayoutSettingsLoader.cs @@ -76,9 +76,6 @@ namespace mRemoteNG.Config.Settings if (persistString == typeof(ScreenshotManagerWindow).ToString()) return Windows.ScreenshotPanel; - - if (persistString == typeof(SSHCommandWIndow).ToString()) - return Windows.SSHCommandPanel; } catch (Exception ex) { @@ -102,9 +99,6 @@ namespace mRemoteNG.Config.Settings Windows.ScreenshotForm = new ScreenshotManagerWindow(Windows.ScreenshotPanel); Windows.ScreenshotPanel = Windows.ScreenshotForm; - Windows.SSHCommandForm = new SSHCommandWIndow(Windows.SSHCommandPanel); - Windows.SSHCommandPanel = Windows.SSHCommandForm; - Windows.UpdateForm = new UpdateWindow(Windows.UpdatePanel); Windows.UpdatePanel = Windows.UpdateForm; } diff --git a/mRemoteV1/UI/Forms/frmMain.Designer.cs b/mRemoteV1/UI/Forms/frmMain.Designer.cs index 08c8a14b..7d8b6ca8 100644 --- a/mRemoteV1/UI/Forms/frmMain.Designer.cs +++ b/mRemoteV1/UI/Forms/frmMain.Designer.cs @@ -61,7 +61,6 @@ namespace mRemoteNG.UI.Forms this.mMenViewConfig = new System.Windows.Forms.ToolStripMenuItem(); this.mMenViewErrorsAndInfos = new System.Windows.Forms.ToolStripMenuItem(); this.mMenViewScreenshotManager = new System.Windows.Forms.ToolStripMenuItem(); - this.mMenViewMultiPuttyCommand = new System.Windows.Forms.ToolStripMenuItem(); this.ToolStripSeparator1 = new System.Windows.Forms.ToolStripSeparator(); this.mMenViewJumpTo = new System.Windows.Forms.ToolStripMenuItem(); this.mMenViewJumpToConnectionsConfig = new System.Windows.Forms.ToolStripMenuItem(); @@ -70,6 +69,7 @@ namespace mRemoteNG.UI.Forms this.mMenViewSep2 = new System.Windows.Forms.ToolStripSeparator(); this.mMenViewQuickConnectToolbar = new System.Windows.Forms.ToolStripMenuItem(); this.mMenViewExtAppsToolbar = new System.Windows.Forms.ToolStripMenuItem(); + this.mMenViewMultiSSHToolbar = new System.Windows.Forms.ToolStripMenuItem(); this.mMenViewSep3 = new System.Windows.Forms.ToolStripSeparator(); this.mMenViewFullscreen = new System.Windows.Forms.ToolStripMenuItem(); this.mMenTools = new System.Windows.Forms.ToolStripMenuItem(); @@ -103,6 +103,9 @@ namespace mRemoteNG.UI.Forms this.tsExternalTools = new System.Windows.Forms.ToolStrip(); this.cMenExtAppsToolbar = new System.Windows.Forms.ContextMenuStrip(this.components); this.cMenToolbarShowText = new System.Windows.Forms.ToolStripMenuItem(); + this.tsMultiSSH = new System.Windows.Forms.ToolStrip(); + this.lblMultiSSH = new System.Windows.Forms.ToolStripLabel(); + this.txtMultiSSH = new System.Windows.Forms.ToolStripTextBox(); this.tmrAutoSave = new System.Windows.Forms.Timer(this.components); this.msMain.SuspendLayout(); this.tsContainer.ContentPanel.SuspendLayout(); @@ -110,6 +113,7 @@ namespace mRemoteNG.UI.Forms this.tsContainer.SuspendLayout(); this.tsQuickConnect.SuspendLayout(); this.cMenExtAppsToolbar.SuspendLayout(); + this.tsMultiSSH.SuspendLayout(); this.SuspendLayout(); // // pnlDock @@ -121,7 +125,7 @@ namespace mRemoteNG.UI.Forms this.pnlDock.DocumentStyle = WeifenLuo.WinFormsUI.Docking.DocumentStyle.DockingSdi; this.pnlDock.Location = new System.Drawing.Point(0, 0); this.pnlDock.Name = "pnlDock"; - this.pnlDock.Size = new System.Drawing.Size(966, 498); + this.pnlDock.Size = new System.Drawing.Size(1288, 541); this.pnlDock.TabIndex = 13; this.pnlDock.ActiveDocumentChanged += new System.EventHandler(this.pnlDock_ActiveDocumentChanged); // @@ -129,15 +133,16 @@ namespace mRemoteNG.UI.Forms // this.msMain.Dock = System.Windows.Forms.DockStyle.None; this.msMain.GripMargin = new System.Windows.Forms.Padding(0); + this.msMain.ImageScalingSize = new System.Drawing.Size(20, 20); this.msMain.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.mMenFile, this.mMenView, this.mMenTools, this.mMenInfo}); - this.msMain.Location = new System.Drawing.Point(3, 0); + this.msMain.Location = new System.Drawing.Point(3, 75); this.msMain.Name = "msMain"; this.msMain.Padding = new System.Windows.Forms.Padding(2, 2, 0, 2); - this.msMain.Size = new System.Drawing.Size(177, 24); + this.msMain.Size = new System.Drawing.Size(210, 28); this.msMain.Stretch = false; this.msMain.TabIndex = 16; this.msMain.Text = "Main Toolbar"; @@ -164,7 +169,7 @@ namespace mRemoteNG.UI.Forms this.mMenFileSep5, this.mMenFileExit}); this.mMenFile.Name = "mMenFile"; - this.mMenFile.Size = new System.Drawing.Size(37, 20); + this.mMenFile.Size = new System.Drawing.Size(44, 24); this.mMenFile.Text = "&File"; this.mMenFile.DropDownOpening += new System.EventHandler(this.mMenFile_DropDownOpening); // @@ -173,7 +178,7 @@ namespace mRemoteNG.UI.Forms this.mMenFileNewConnection.Image = global::mRemoteNG.Resources.Connection_Add; this.mMenFileNewConnection.Name = "mMenFileNewConnection"; this.mMenFileNewConnection.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.N))); - this.mMenFileNewConnection.Size = new System.Drawing.Size(281, 22); + this.mMenFileNewConnection.Size = new System.Drawing.Size(340, 26); this.mMenFileNewConnection.Text = "New Connection"; this.mMenFileNewConnection.Click += new System.EventHandler(this.mMenFileNewConnection_Click); // @@ -183,20 +188,20 @@ namespace mRemoteNG.UI.Forms this.mMenFileNewFolder.Name = "mMenFileNewFolder"; this.mMenFileNewFolder.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.N))); - this.mMenFileNewFolder.Size = new System.Drawing.Size(281, 22); + this.mMenFileNewFolder.Size = new System.Drawing.Size(340, 26); this.mMenFileNewFolder.Text = "New Folder"; this.mMenFileNewFolder.Click += new System.EventHandler(this.mMenFileNewFolder_Click); // // mMenFileSep1 // this.mMenFileSep1.Name = "mMenFileSep1"; - this.mMenFileSep1.Size = new System.Drawing.Size(278, 6); + this.mMenFileSep1.Size = new System.Drawing.Size(337, 6); // // mMenFileNew // this.mMenFileNew.Image = global::mRemoteNG.Resources.Connections_New; this.mMenFileNew.Name = "mMenFileNew"; - this.mMenFileNew.Size = new System.Drawing.Size(281, 22); + this.mMenFileNew.Size = new System.Drawing.Size(340, 26); this.mMenFileNew.Text = "New Connection File"; this.mMenFileNew.Click += new System.EventHandler(this.mMenFileNew_Click); // @@ -205,7 +210,7 @@ namespace mRemoteNG.UI.Forms this.mMenFileLoad.Image = global::mRemoteNG.Resources.Connections_Load; this.mMenFileLoad.Name = "mMenFileLoad"; this.mMenFileLoad.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.O))); - this.mMenFileLoad.Size = new System.Drawing.Size(281, 22); + this.mMenFileLoad.Size = new System.Drawing.Size(340, 26); this.mMenFileLoad.Text = "Open Connection File..."; this.mMenFileLoad.Click += new System.EventHandler(this.mMenFileLoad_Click); // @@ -214,7 +219,7 @@ namespace mRemoteNG.UI.Forms this.mMenFileSave.Image = global::mRemoteNG.Resources.Connections_Save; this.mMenFileSave.Name = "mMenFileSave"; this.mMenFileSave.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.S))); - this.mMenFileSave.Size = new System.Drawing.Size(281, 22); + this.mMenFileSave.Size = new System.Drawing.Size(340, 26); this.mMenFileSave.Text = "Save Connection File"; this.mMenFileSave.Click += new System.EventHandler(this.mMenFileSave_Click); // @@ -224,20 +229,20 @@ namespace mRemoteNG.UI.Forms this.mMenFileSaveAs.Name = "mMenFileSaveAs"; this.mMenFileSaveAs.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Shift) | System.Windows.Forms.Keys.S))); - this.mMenFileSaveAs.Size = new System.Drawing.Size(281, 22); + this.mMenFileSaveAs.Size = new System.Drawing.Size(340, 26); this.mMenFileSaveAs.Text = "Save Connection File As..."; this.mMenFileSaveAs.Click += new System.EventHandler(this.mMenFileSaveAs_Click); // // mMenFileSep2 // this.mMenFileSep2.Name = "mMenFileSep2"; - this.mMenFileSep2.Size = new System.Drawing.Size(278, 6); + this.mMenFileSep2.Size = new System.Drawing.Size(337, 6); // // mMenFileDelete // this.mMenFileDelete.Image = global::mRemoteNG.Resources.Delete; this.mMenFileDelete.Name = "mMenFileDelete"; - this.mMenFileDelete.Size = new System.Drawing.Size(281, 22); + this.mMenFileDelete.Size = new System.Drawing.Size(340, 26); this.mMenFileDelete.Text = "Delete..."; this.mMenFileDelete.Click += new System.EventHandler(this.mMenFileDelete_Click); // @@ -245,7 +250,7 @@ namespace mRemoteNG.UI.Forms // this.mMenFileRename.Image = global::mRemoteNG.Resources.Rename; this.mMenFileRename.Name = "mMenFileRename"; - this.mMenFileRename.Size = new System.Drawing.Size(281, 22); + this.mMenFileRename.Size = new System.Drawing.Size(340, 26); this.mMenFileRename.Text = "Rename"; this.mMenFileRename.Click += new System.EventHandler(this.mMenFileRename_Click); // @@ -253,27 +258,27 @@ namespace mRemoteNG.UI.Forms // this.mMenFileDuplicate.Image = global::mRemoteNG.Resources.page_copy; this.mMenFileDuplicate.Name = "mMenFileDuplicate"; - this.mMenFileDuplicate.Size = new System.Drawing.Size(281, 22); + this.mMenFileDuplicate.Size = new System.Drawing.Size(340, 26); this.mMenFileDuplicate.Text = "Duplicate"; this.mMenFileDuplicate.Click += new System.EventHandler(this.mMenFileDuplicate_Click); // // mMenFileSep4 // this.mMenFileSep4.Name = "mMenFileSep4"; - this.mMenFileSep4.Size = new System.Drawing.Size(278, 6); + this.mMenFileSep4.Size = new System.Drawing.Size(337, 6); // // mMenReconnectAll // this.mMenReconnectAll.Image = global::mRemoteNG.Resources.Refresh; this.mMenReconnectAll.Name = "mMenReconnectAll"; - this.mMenReconnectAll.Size = new System.Drawing.Size(281, 22); + this.mMenReconnectAll.Size = new System.Drawing.Size(340, 26); this.mMenReconnectAll.Text = "Reconnect All Connections"; this.mMenReconnectAll.Click += new System.EventHandler(this.mMenReconnectAll_Click); // // mMenFileSep3 // this.mMenFileSep3.Name = "mMenFileSep3"; - this.mMenFileSep3.Size = new System.Drawing.Size(278, 6); + this.mMenFileSep3.Size = new System.Drawing.Size(337, 6); // // mMenFileImport // @@ -282,48 +287,48 @@ namespace mRemoteNG.UI.Forms this.mMenFileImportFromActiveDirectory, this.mMenFileImportFromPortScan}); this.mMenFileImport.Name = "mMenFileImport"; - this.mMenFileImport.Size = new System.Drawing.Size(281, 22); + this.mMenFileImport.Size = new System.Drawing.Size(340, 26); this.mMenFileImport.Text = "&Import"; // // mMenFileImportFromFile // this.mMenFileImportFromFile.Name = "mMenFileImportFromFile"; - this.mMenFileImportFromFile.Size = new System.Drawing.Size(235, 22); + this.mMenFileImportFromFile.Size = new System.Drawing.Size(284, 26); this.mMenFileImportFromFile.Text = "Import from &File..."; this.mMenFileImportFromFile.Click += new System.EventHandler(this.mMenFileImportFromFile_Click); // // mMenFileImportFromActiveDirectory // this.mMenFileImportFromActiveDirectory.Name = "mMenFileImportFromActiveDirectory"; - this.mMenFileImportFromActiveDirectory.Size = new System.Drawing.Size(235, 22); + this.mMenFileImportFromActiveDirectory.Size = new System.Drawing.Size(284, 26); this.mMenFileImportFromActiveDirectory.Text = "Import from &Active Directory..."; this.mMenFileImportFromActiveDirectory.Click += new System.EventHandler(this.mMenFileImportFromActiveDirectory_Click); // // mMenFileImportFromPortScan // this.mMenFileImportFromPortScan.Name = "mMenFileImportFromPortScan"; - this.mMenFileImportFromPortScan.Size = new System.Drawing.Size(235, 22); + this.mMenFileImportFromPortScan.Size = new System.Drawing.Size(284, 26); this.mMenFileImportFromPortScan.Text = "Import from &Port Scan..."; this.mMenFileImportFromPortScan.Click += new System.EventHandler(this.mMenFileImportFromPortScan_Click); // // mMenFileExport // this.mMenFileExport.Name = "mMenFileExport"; - this.mMenFileExport.Size = new System.Drawing.Size(281, 22); + this.mMenFileExport.Size = new System.Drawing.Size(340, 26); this.mMenFileExport.Text = "&Export to File..."; this.mMenFileExport.Click += new System.EventHandler(this.mMenFileExport_Click); // // mMenFileSep5 // this.mMenFileSep5.Name = "mMenFileSep5"; - this.mMenFileSep5.Size = new System.Drawing.Size(278, 6); + this.mMenFileSep5.Size = new System.Drawing.Size(337, 6); // // mMenFileExit // this.mMenFileExit.Image = global::mRemoteNG.Resources.Quit; this.mMenFileExit.Name = "mMenFileExit"; this.mMenFileExit.ShortcutKeys = ((System.Windows.Forms.Keys)((System.Windows.Forms.Keys.Alt | System.Windows.Forms.Keys.F4))); - this.mMenFileExit.Size = new System.Drawing.Size(281, 22); + this.mMenFileExit.Size = new System.Drawing.Size(340, 26); this.mMenFileExit.Text = "Exit"; this.mMenFileExit.Click += new System.EventHandler(this.mMenFileExit_Click); // @@ -337,17 +342,17 @@ namespace mRemoteNG.UI.Forms this.mMenViewConfig, this.mMenViewErrorsAndInfos, this.mMenViewScreenshotManager, - this.mMenViewMultiPuttyCommand, this.ToolStripSeparator1, this.mMenViewJumpTo, this.mMenViewResetLayout, this.mMenViewSep2, this.mMenViewQuickConnectToolbar, this.mMenViewExtAppsToolbar, + this.mMenViewMultiSSHToolbar, this.mMenViewSep3, this.mMenViewFullscreen}); this.mMenView.Name = "mMenView"; - this.mMenView.Size = new System.Drawing.Size(44, 20); + this.mMenView.Size = new System.Drawing.Size(53, 24); this.mMenView.Text = "&View"; this.mMenView.DropDownOpening += new System.EventHandler(this.mMenView_DropDownOpening); // @@ -355,7 +360,7 @@ namespace mRemoteNG.UI.Forms // this.mMenViewAddConnectionPanel.Image = global::mRemoteNG.Resources.Panel_Add; this.mMenViewAddConnectionPanel.Name = "mMenViewAddConnectionPanel"; - this.mMenViewAddConnectionPanel.Size = new System.Drawing.Size(228, 22); + this.mMenViewAddConnectionPanel.Size = new System.Drawing.Size(279, 26); this.mMenViewAddConnectionPanel.Text = "Add Connection Panel"; this.mMenViewAddConnectionPanel.Click += new System.EventHandler(this.mMenViewAddConnectionPanel_Click); // @@ -363,13 +368,13 @@ namespace mRemoteNG.UI.Forms // this.mMenViewConnectionPanels.Image = global::mRemoteNG.Resources.Panels; this.mMenViewConnectionPanels.Name = "mMenViewConnectionPanels"; - this.mMenViewConnectionPanels.Size = new System.Drawing.Size(228, 22); + this.mMenViewConnectionPanels.Size = new System.Drawing.Size(279, 26); this.mMenViewConnectionPanels.Text = "Connection Panels"; // // mMenViewSep1 // this.mMenViewSep1.Name = "mMenViewSep1"; - this.mMenViewSep1.Size = new System.Drawing.Size(225, 6); + this.mMenViewSep1.Size = new System.Drawing.Size(276, 6); // // mMenViewConnections // @@ -377,7 +382,7 @@ namespace mRemoteNG.UI.Forms this.mMenViewConnections.CheckState = System.Windows.Forms.CheckState.Checked; this.mMenViewConnections.Image = global::mRemoteNG.Resources.Root; this.mMenViewConnections.Name = "mMenViewConnections"; - this.mMenViewConnections.Size = new System.Drawing.Size(228, 22); + this.mMenViewConnections.Size = new System.Drawing.Size(279, 26); this.mMenViewConnections.Text = "Connections"; this.mMenViewConnections.Click += new System.EventHandler(this.mMenViewConnections_Click); // @@ -387,7 +392,7 @@ namespace mRemoteNG.UI.Forms this.mMenViewConfig.CheckState = System.Windows.Forms.CheckState.Checked; this.mMenViewConfig.Image = global::mRemoteNG.Resources.cog; this.mMenViewConfig.Name = "mMenViewConfig"; - this.mMenViewConfig.Size = new System.Drawing.Size(228, 22); + this.mMenViewConfig.Size = new System.Drawing.Size(279, 26); this.mMenViewConfig.Text = "Config"; this.mMenViewConfig.Click += new System.EventHandler(this.mMenViewConfig_Click); // @@ -397,29 +402,22 @@ namespace mRemoteNG.UI.Forms this.mMenViewErrorsAndInfos.CheckState = System.Windows.Forms.CheckState.Checked; this.mMenViewErrorsAndInfos.Image = global::mRemoteNG.Resources.ErrorsAndInfos; this.mMenViewErrorsAndInfos.Name = "mMenViewErrorsAndInfos"; - this.mMenViewErrorsAndInfos.Size = new System.Drawing.Size(228, 22); + this.mMenViewErrorsAndInfos.Size = new System.Drawing.Size(279, 26); this.mMenViewErrorsAndInfos.Text = "Errors and Infos"; this.mMenViewErrorsAndInfos.Click += new System.EventHandler(this.mMenViewErrorsAndInfos_Click); // // mMenViewScreenshotManager // - this.mMenViewScreenshotManager.Image = global::mRemoteNG.Resources.Screenshot; + this.mMenViewScreenshotManager.Image = global::mRemoteNG.Resources.Screenshot; this.mMenViewScreenshotManager.Name = "mMenViewScreenshotManager"; - this.mMenViewScreenshotManager.Size = new System.Drawing.Size(228, 22); + this.mMenViewScreenshotManager.Size = new System.Drawing.Size(279, 26); this.mMenViewScreenshotManager.Text = "Screenshot Manager"; this.mMenViewScreenshotManager.Click += new System.EventHandler(this.mMenViewScreenshotManager_Click); - // - // mMenViewMultiPuttyCommand - // - this.mMenViewMultiPuttyCommand.Name = "mMenViewMultiPuttyCommand"; - this.mMenViewMultiPuttyCommand.Size = new System.Drawing.Size(228, 22); - this.mMenViewMultiPuttyCommand.Text = "Multi Putty Commander"; - this.mMenViewMultiPuttyCommand.Click += new System.EventHandler(this.mMenViewMultiPuttyCommand_Click); // // ToolStripSeparator1 // this.ToolStripSeparator1.Name = "ToolStripSeparator1"; - this.ToolStripSeparator1.Size = new System.Drawing.Size(225, 6); + this.ToolStripSeparator1.Size = new System.Drawing.Size(276, 6); // // mMenViewJumpTo // @@ -428,7 +426,7 @@ namespace mRemoteNG.UI.Forms this.mMenViewJumpToErrorsInfos}); this.mMenViewJumpTo.Image = global::mRemoteNG.Resources.JumpTo; this.mMenViewJumpTo.Name = "mMenViewJumpTo"; - this.mMenViewJumpTo.Size = new System.Drawing.Size(228, 22); + this.mMenViewJumpTo.Size = new System.Drawing.Size(279, 26); this.mMenViewJumpTo.Text = "Jump To"; // // mMenViewJumpToConnectionsConfig @@ -437,7 +435,7 @@ namespace mRemoteNG.UI.Forms this.mMenViewJumpToConnectionsConfig.Name = "mMenViewJumpToConnectionsConfig"; this.mMenViewJumpToConnectionsConfig.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Alt) | System.Windows.Forms.Keys.C))); - this.mMenViewJumpToConnectionsConfig.Size = new System.Drawing.Size(258, 22); + this.mMenViewJumpToConnectionsConfig.Size = new System.Drawing.Size(309, 26); this.mMenViewJumpToConnectionsConfig.Text = "Connections && Config"; this.mMenViewJumpToConnectionsConfig.Click += new System.EventHandler(this.mMenViewJumpToConnectionsConfig_Click); // @@ -447,7 +445,7 @@ namespace mRemoteNG.UI.Forms this.mMenViewJumpToErrorsInfos.Name = "mMenViewJumpToErrorsInfos"; this.mMenViewJumpToErrorsInfos.ShortcutKeys = ((System.Windows.Forms.Keys)(((System.Windows.Forms.Keys.Control | System.Windows.Forms.Keys.Alt) | System.Windows.Forms.Keys.E))); - this.mMenViewJumpToErrorsInfos.Size = new System.Drawing.Size(258, 22); + this.mMenViewJumpToErrorsInfos.Size = new System.Drawing.Size(309, 26); this.mMenViewJumpToErrorsInfos.Text = "Errors && Infos"; this.mMenViewJumpToErrorsInfos.Click += new System.EventHandler(this.mMenViewJumpToErrorsInfos_Click); // @@ -455,20 +453,20 @@ namespace mRemoteNG.UI.Forms // this.mMenViewResetLayout.Image = global::mRemoteNG.Resources.application_side_tree; this.mMenViewResetLayout.Name = "mMenViewResetLayout"; - this.mMenViewResetLayout.Size = new System.Drawing.Size(228, 22); + this.mMenViewResetLayout.Size = new System.Drawing.Size(279, 26); this.mMenViewResetLayout.Text = "Reset Layout"; this.mMenViewResetLayout.Click += new System.EventHandler(this.mMenViewResetLayout_Click); // // mMenViewSep2 // this.mMenViewSep2.Name = "mMenViewSep2"; - this.mMenViewSep2.Size = new System.Drawing.Size(225, 6); + this.mMenViewSep2.Size = new System.Drawing.Size(276, 6); // // mMenViewQuickConnectToolbar // this.mMenViewQuickConnectToolbar.Image = global::mRemoteNG.Resources.Play_Quick; this.mMenViewQuickConnectToolbar.Name = "mMenViewQuickConnectToolbar"; - this.mMenViewQuickConnectToolbar.Size = new System.Drawing.Size(228, 22); + this.mMenViewQuickConnectToolbar.Size = new System.Drawing.Size(279, 26); this.mMenViewQuickConnectToolbar.Text = "Quick Connect Toolbar"; this.mMenViewQuickConnectToolbar.Click += new System.EventHandler(this.mMenViewQuickConnectToolbar_Click); // @@ -476,21 +474,29 @@ namespace mRemoteNG.UI.Forms // this.mMenViewExtAppsToolbar.Image = global::mRemoteNG.Resources.ExtApp; this.mMenViewExtAppsToolbar.Name = "mMenViewExtAppsToolbar"; - this.mMenViewExtAppsToolbar.Size = new System.Drawing.Size(228, 22); + this.mMenViewExtAppsToolbar.Size = new System.Drawing.Size(279, 26); this.mMenViewExtAppsToolbar.Text = "External Applications Toolbar"; this.mMenViewExtAppsToolbar.Click += new System.EventHandler(this.mMenViewExtAppsToolbar_Click); // + // mMenViewMultiSSHToolbar + // + this.mMenViewMultiSSHToolbar.Image = global::mRemoteNG.Resources.Panels; + this.mMenViewMultiSSHToolbar.Name = "mMenViewMultiSSHToolbar"; + this.mMenViewMultiSSHToolbar.Size = new System.Drawing.Size(279, 26); + this.mMenViewMultiSSHToolbar.Text = "Multi SSH Toolbar"; + this.mMenViewMultiSSHToolbar.Click += new System.EventHandler(this.mMenViewMultiSSHToolbar_Click); + // // mMenViewSep3 // this.mMenViewSep3.Name = "mMenViewSep3"; - this.mMenViewSep3.Size = new System.Drawing.Size(225, 6); + this.mMenViewSep3.Size = new System.Drawing.Size(276, 6); // // mMenViewFullscreen // this.mMenViewFullscreen.Image = global::mRemoteNG.Resources.arrow_out; this.mMenViewFullscreen.Name = "mMenViewFullscreen"; this.mMenViewFullscreen.ShortcutKeys = System.Windows.Forms.Keys.F11; - this.mMenViewFullscreen.Size = new System.Drawing.Size(228, 22); + this.mMenViewFullscreen.Size = new System.Drawing.Size(279, 26); this.mMenViewFullscreen.Text = "Full Screen"; this.mMenViewFullscreen.Click += new System.EventHandler(this.mMenViewFullscreen_Click); // @@ -505,14 +511,14 @@ namespace mRemoteNG.UI.Forms this.mMenToolsComponentsCheck, this.mMenToolsOptions}); this.mMenTools.Name = "mMenTools"; - this.mMenTools.Size = new System.Drawing.Size(48, 20); + this.mMenTools.Size = new System.Drawing.Size(56, 24); this.mMenTools.Text = "&Tools"; // // mMenToolsSSHTransfer // this.mMenToolsSSHTransfer.Image = global::mRemoteNG.Resources.SSHTransfer; this.mMenToolsSSHTransfer.Name = "mMenToolsSSHTransfer"; - this.mMenToolsSSHTransfer.Size = new System.Drawing.Size(184, 22); + this.mMenToolsSSHTransfer.Size = new System.Drawing.Size(224, 26); this.mMenToolsSSHTransfer.Text = "SSH File Transfer"; this.mMenToolsSSHTransfer.Click += new System.EventHandler(this.mMenToolsSSHTransfer_Click); // @@ -520,7 +526,7 @@ namespace mRemoteNG.UI.Forms // this.mMenToolsUVNCSC.Image = global::mRemoteNG.Resources.UVNC_SC; this.mMenToolsUVNCSC.Name = "mMenToolsUVNCSC"; - this.mMenToolsUVNCSC.Size = new System.Drawing.Size(184, 22); + this.mMenToolsUVNCSC.Size = new System.Drawing.Size(224, 26); this.mMenToolsUVNCSC.Text = "UltraVNC SingleClick"; this.mMenToolsUVNCSC.Visible = false; this.mMenToolsUVNCSC.Click += new System.EventHandler(this.mMenToolsUVNCSC_Click); @@ -529,7 +535,7 @@ namespace mRemoteNG.UI.Forms // this.mMenToolsExternalApps.Image = global::mRemoteNG.Resources.ExtApp; this.mMenToolsExternalApps.Name = "mMenToolsExternalApps"; - this.mMenToolsExternalApps.Size = new System.Drawing.Size(184, 22); + this.mMenToolsExternalApps.Size = new System.Drawing.Size(224, 26); this.mMenToolsExternalApps.Text = "External Applications"; this.mMenToolsExternalApps.Click += new System.EventHandler(this.mMenToolsExternalApps_Click); // @@ -537,20 +543,20 @@ namespace mRemoteNG.UI.Forms // this.mMenToolsPortScan.Image = global::mRemoteNG.Resources.PortScan; this.mMenToolsPortScan.Name = "mMenToolsPortScan"; - this.mMenToolsPortScan.Size = new System.Drawing.Size(184, 22); + this.mMenToolsPortScan.Size = new System.Drawing.Size(224, 26); this.mMenToolsPortScan.Text = "Port Scan"; this.mMenToolsPortScan.Click += new System.EventHandler(this.mMenToolsPortScan_Click); // // mMenToolsSep1 // this.mMenToolsSep1.Name = "mMenToolsSep1"; - this.mMenToolsSep1.Size = new System.Drawing.Size(181, 6); + this.mMenToolsSep1.Size = new System.Drawing.Size(221, 6); // // mMenToolsComponentsCheck // this.mMenToolsComponentsCheck.Image = global::mRemoteNG.Resources.cog_error; this.mMenToolsComponentsCheck.Name = "mMenToolsComponentsCheck"; - this.mMenToolsComponentsCheck.Size = new System.Drawing.Size(184, 22); + this.mMenToolsComponentsCheck.Size = new System.Drawing.Size(224, 26); this.mMenToolsComponentsCheck.Text = "Components Check"; this.mMenToolsComponentsCheck.Click += new System.EventHandler(this.mMenToolsComponentsCheck_Click); // @@ -558,7 +564,7 @@ namespace mRemoteNG.UI.Forms // this.mMenToolsOptions.Image = global::mRemoteNG.Resources.Options; this.mMenToolsOptions.Name = "mMenToolsOptions"; - this.mMenToolsOptions.Size = new System.Drawing.Size(184, 22); + this.mMenToolsOptions.Size = new System.Drawing.Size(224, 26); this.mMenToolsOptions.Text = "Options"; this.mMenToolsOptions.Click += new System.EventHandler(this.mMenToolsOptions_Click); // @@ -576,29 +582,29 @@ namespace mRemoteNG.UI.Forms this.mMenInfoSep2, this.mMenInfoAbout}); this.mMenInfo.Name = "mMenInfo"; - this.mMenInfo.Size = new System.Drawing.Size(44, 20); + this.mMenInfo.Size = new System.Drawing.Size(53, 24); this.mMenInfo.Text = "&Help"; this.mMenInfo.TextDirection = System.Windows.Forms.ToolStripTextDirection.Horizontal; // // mMenInfoHelp // - this.mMenInfoHelp.Image = global::mRemoteNG.Resources.Help; + this.mMenInfoHelp.Image = global::mRemoteNG.Resources.Help; this.mMenInfoHelp.Name = "mMenInfoHelp"; this.mMenInfoHelp.ShortcutKeys = System.Windows.Forms.Keys.F1; - this.mMenInfoHelp.Size = new System.Drawing.Size(190, 22); + this.mMenInfoHelp.Size = new System.Drawing.Size(230, 26); this.mMenInfoHelp.Text = "mRemoteNG Help"; this.mMenInfoHelp.Click += new System.EventHandler(this.mMenInfoHelp_Click); // // mMenInfoSep1 // this.mMenInfoSep1.Name = "mMenInfoSep1"; - this.mMenInfoSep1.Size = new System.Drawing.Size(187, 6); + this.mMenInfoSep1.Size = new System.Drawing.Size(227, 6); // // mMenInfoWebsite // - this.mMenInfoWebsite.Image = global::mRemoteNG.Resources.Website; + this.mMenInfoWebsite.Image = global::mRemoteNG.Resources.Website; this.mMenInfoWebsite.Name = "mMenInfoWebsite"; - this.mMenInfoWebsite.Size = new System.Drawing.Size(190, 22); + this.mMenInfoWebsite.Size = new System.Drawing.Size(230, 26); this.mMenInfoWebsite.Text = "Website"; this.mMenInfoWebsite.Click += new System.EventHandler(this.mMenInfoWebsite_Click); // @@ -606,7 +612,7 @@ namespace mRemoteNG.UI.Forms // this.mMenInfoDonate.Image = global::mRemoteNG.Resources.Donate; this.mMenInfoDonate.Name = "mMenInfoDonate"; - this.mMenInfoDonate.Size = new System.Drawing.Size(190, 22); + this.mMenInfoDonate.Size = new System.Drawing.Size(230, 26); this.mMenInfoDonate.Text = "Donate"; this.mMenInfoDonate.Click += new System.EventHandler(this.mMenInfoDonate_Click); // @@ -614,7 +620,7 @@ namespace mRemoteNG.UI.Forms // this.mMenInfoForum.Image = global::mRemoteNG.Resources.user_comment; this.mMenInfoForum.Name = "mMenInfoForum"; - this.mMenInfoForum.Size = new System.Drawing.Size(190, 22); + this.mMenInfoForum.Size = new System.Drawing.Size(230, 26); this.mMenInfoForum.Text = "Support Forum"; this.mMenInfoForum.Click += new System.EventHandler(this.mMenInfoForum_Click); // @@ -622,33 +628,33 @@ namespace mRemoteNG.UI.Forms // this.mMenInfoBugReport.Image = global::mRemoteNG.Resources.Bug; this.mMenInfoBugReport.Name = "mMenInfoBugReport"; - this.mMenInfoBugReport.Size = new System.Drawing.Size(190, 22); + this.mMenInfoBugReport.Size = new System.Drawing.Size(230, 26); this.mMenInfoBugReport.Text = "Report a Bug"; this.mMenInfoBugReport.Click += new System.EventHandler(this.mMenInfoBugReport_Click); // // ToolStripSeparator2 // this.ToolStripSeparator2.Name = "ToolStripSeparator2"; - this.ToolStripSeparator2.Size = new System.Drawing.Size(187, 6); + this.ToolStripSeparator2.Size = new System.Drawing.Size(227, 6); // // mMenToolsUpdate // this.mMenToolsUpdate.Image = global::mRemoteNG.Resources.Update; this.mMenToolsUpdate.Name = "mMenToolsUpdate"; - this.mMenToolsUpdate.Size = new System.Drawing.Size(190, 22); + this.mMenToolsUpdate.Size = new System.Drawing.Size(230, 26); this.mMenToolsUpdate.Text = "Check for Updates"; this.mMenToolsUpdate.Click += new System.EventHandler(this.mMenToolsUpdate_Click); // // mMenInfoSep2 // this.mMenInfoSep2.Name = "mMenInfoSep2"; - this.mMenInfoSep2.Size = new System.Drawing.Size(187, 6); + this.mMenInfoSep2.Size = new System.Drawing.Size(227, 6); // // mMenInfoAbout // this.mMenInfoAbout.Image = global::mRemoteNG.Resources.mRemote; this.mMenInfoAbout.Name = "mMenInfoAbout"; - this.mMenInfoAbout.Size = new System.Drawing.Size(190, 22); + this.mMenInfoAbout.Size = new System.Drawing.Size(230, 26); this.mMenInfoAbout.Text = "About mRemoteNG"; this.mMenInfoAbout.Click += new System.EventHandler(this.mMenInfoAbout_Click); // @@ -660,7 +666,7 @@ namespace mRemoteNG.UI.Forms // lblQuickConnect // this.lblQuickConnect.Name = "lblQuickConnect"; - this.lblQuickConnect.Size = new System.Drawing.Size(55, 22); + this.lblQuickConnect.Size = new System.Drawing.Size(66, 22); this.lblQuickConnect.Text = "&Connect:"; this.lblQuickConnect.Click += new System.EventHandler(this.lblQuickConnect_Click); // @@ -680,23 +686,25 @@ namespace mRemoteNG.UI.Forms // tsContainer.ContentPanel // this.tsContainer.ContentPanel.Controls.Add(this.pnlDock); - this.tsContainer.ContentPanel.Size = new System.Drawing.Size(966, 498); + this.tsContainer.ContentPanel.Size = new System.Drawing.Size(1288, 541); this.tsContainer.Dock = System.Windows.Forms.DockStyle.Fill; this.tsContainer.Location = new System.Drawing.Point(0, 0); this.tsContainer.Name = "tsContainer"; - this.tsContainer.Size = new System.Drawing.Size(966, 523); + this.tsContainer.Size = new System.Drawing.Size(1288, 644); this.tsContainer.TabIndex = 17; this.tsContainer.Text = "ToolStripContainer1"; // // tsContainer.TopToolStripPanel // - this.tsContainer.TopToolStripPanel.Controls.Add(this.msMain); this.tsContainer.TopToolStripPanel.Controls.Add(this.tsQuickConnect); this.tsContainer.TopToolStripPanel.Controls.Add(this.tsExternalTools); + this.tsContainer.TopToolStripPanel.Controls.Add(this.tsMultiSSH); + this.tsContainer.TopToolStripPanel.Controls.Add(this.msMain); // // tsQuickConnect // this.tsQuickConnect.Dock = System.Windows.Forms.DockStyle.None; + this.tsQuickConnect.ImageScalingSize = new System.Drawing.Size(20, 20); this.tsQuickConnect.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.lblQuickConnect, this.cmbQuickConnect, @@ -705,7 +713,7 @@ namespace mRemoteNG.UI.Forms this.tsQuickConnect.Location = new System.Drawing.Point(msMain.Location.X + msMain.Width + 1, 0); this.tsQuickConnect.MaximumSize = new System.Drawing.Size(0, 25); this.tsQuickConnect.Name = "tsQuickConnect"; - this.tsQuickConnect.Size = new System.Drawing.Size(387, 25); + this.tsQuickConnect.Size = new System.Drawing.Size(417, 25); this.tsQuickConnect.TabIndex = 18; // // btnQuickConnect @@ -715,13 +723,14 @@ namespace mRemoteNG.UI.Forms this.btnQuickConnect.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnQuickConnect.Margin = new System.Windows.Forms.Padding(0, 1, 3, 2); this.btnQuickConnect.Name = "btnQuickConnect"; - this.btnQuickConnect.Size = new System.Drawing.Size(84, 22); + this.btnQuickConnect.Size = new System.Drawing.Size(102, 22); this.btnQuickConnect.Text = "Connect"; this.btnQuickConnect.ButtonClick += new System.EventHandler(this.btnQuickConnect_ButtonClick); this.btnQuickConnect.DropDownItemClicked += new System.Windows.Forms.ToolStripItemClickedEventHandler(this.btnQuickConnect_DropDownItemClicked); // // mnuQuickConnectProtocol // + this.mnuQuickConnectProtocol.ImageScalingSize = new System.Drawing.Size(20, 20); this.mnuQuickConnectProtocol.Name = "mnuQuickConnectProtocol"; this.mnuQuickConnectProtocol.OwnerItem = this.btnQuickConnect; this.mnuQuickConnectProtocol.ShowCheckMargin = true; @@ -736,12 +745,13 @@ namespace mRemoteNG.UI.Forms this.btnConnections.ImageScaling = System.Windows.Forms.ToolStripItemImageScaling.None; this.btnConnections.ImageTransparentColor = System.Drawing.Color.Magenta; this.btnConnections.Name = "btnConnections"; - this.btnConnections.Size = new System.Drawing.Size(29, 22); + this.btnConnections.Size = new System.Drawing.Size(30, 22); this.btnConnections.Text = "Connections"; this.btnConnections.DropDownOpening += new System.EventHandler(this.btnConnections_DropDownOpening); // // mnuConnections // + this.mnuConnections.ImageScalingSize = new System.Drawing.Size(20, 20); this.mnuConnections.Name = "mnuConnections"; this.mnuConnections.OwnerItem = this.btnConnections; this.mnuConnections.Size = new System.Drawing.Size(61, 4); @@ -750,6 +760,7 @@ namespace mRemoteNG.UI.Forms // this.tsExternalTools.ContextMenuStrip = this.cMenExtAppsToolbar; this.tsExternalTools.Dock = System.Windows.Forms.DockStyle.None; + this.tsExternalTools.ImageScalingSize = new System.Drawing.Size(20, 20); this.tsExternalTools.Location = new System.Drawing.Point(tsQuickConnect.Location.X + tsQuickConnect.Width + 1, 0); this.tsExternalTools.MaximumSize = new System.Drawing.Size(0, 25); this.tsExternalTools.Name = "tsExternalTools"; @@ -758,20 +769,49 @@ namespace mRemoteNG.UI.Forms // // cMenExtAppsToolbar // + this.cMenExtAppsToolbar.ImageScalingSize = new System.Drawing.Size(20, 20); this.cMenExtAppsToolbar.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { this.cMenToolbarShowText}); this.cMenExtAppsToolbar.Name = "cMenToolbar"; - this.cMenExtAppsToolbar.Size = new System.Drawing.Size(129, 26); + this.cMenExtAppsToolbar.Size = new System.Drawing.Size(146, 30); // // cMenToolbarShowText // this.cMenToolbarShowText.Checked = true; this.cMenToolbarShowText.CheckState = System.Windows.Forms.CheckState.Checked; this.cMenToolbarShowText.Name = "cMenToolbarShowText"; - this.cMenToolbarShowText.Size = new System.Drawing.Size(128, 22); + this.cMenToolbarShowText.Size = new System.Drawing.Size(145, 26); this.cMenToolbarShowText.Text = "Show Text"; this.cMenToolbarShowText.Click += new System.EventHandler(this.cMenToolbarShowText_Click); // + // tsMultiSSH + // + this.tsMultiSSH.ImageScalingSize = new System.Drawing.Size(20, 20); + this.tsMultiSSH.Items.AddRange(new System.Windows.Forms.ToolStripItem[] { + this.lblMultiSSH, + this.txtMultiSSH}); + this.tsMultiSSH.Location = new System.Drawing.Point(tsQuickConnect.Location.X + tsQuickConnect.Width + 1, 0); + this.tsMultiSSH.MinimumSize = new System.Drawing.Size(300, 0); + this.tsMultiSSH.Name = "tsMultiSSH"; + this.tsMultiSSH.Size = new System.Drawing.Size(430, 25); + this.tsMultiSSH.TabIndex = 0; + this.tsMultiSSH.Dock = System.Windows.Forms.DockStyle.Right; + // + // lblMultiSSH + // + this.lblMultiSSH.Name = "lblMultiSSH"; + this.lblMultiSSH.Size = new System.Drawing.Size(77, 22); + this.lblMultiSSH.Text = "Multi SSH:"; + // + // txtMultiSSH + // + this.txtMultiSSH.Name = "txtMultiSSH"; + this.txtMultiSSH.Size = new System.Drawing.Size(300, 25); + this.txtMultiSSH.ToolTipText = "Press ENTER to send. Ctrl+C is sent immediately."; + this.txtMultiSSH.Enter += new System.EventHandler(this.txtMultiSSH_Enter); + this.txtMultiSSH.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtMultiSSH_KeyDown); + this.txtMultiSSH.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtMultiSSH_KeyUp); + // // tmrAutoSave // this.tmrAutoSave.Interval = 10000; @@ -779,9 +819,9 @@ namespace mRemoteNG.UI.Forms // // frmMain // - this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleDimensions = new System.Drawing.SizeF(8F, 16F); this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; - this.ClientSize = new System.Drawing.Size(966, 523); + this.ClientSize = new System.Drawing.Size(1288, 644); this.Controls.Add(this.tsContainer); this.Icon = global::mRemoteNG.Resources.mRemote_Icon; this.MainMenuStrip = this.msMain; @@ -804,6 +844,8 @@ namespace mRemoteNG.UI.Forms this.tsQuickConnect.ResumeLayout(false); this.tsQuickConnect.PerformLayout(); this.cMenExtAppsToolbar.ResumeLayout(false); + this.tsMultiSSH.ResumeLayout(false); + this.tsMultiSSH.PerformLayout(); this.ResumeLayout(false); } @@ -847,11 +889,12 @@ namespace mRemoteNG.UI.Forms internal System.Windows.Forms.ToolStripMenuItem mMenToolsPortScan; internal System.Windows.Forms.ToolStrip tsQuickConnect; internal System.Windows.Forms.ToolStripMenuItem mMenViewQuickConnectToolbar; - internal System.Windows.Forms.ToolStripSeparator mMenSep3; + internal System.Windows.Forms.ToolStrip tsMultiSSH; + internal System.Windows.Forms.ToolStripMenuItem mMenViewMultiSSHToolbar; + internal System.Windows.Forms.ToolStripSeparator mMenSep3; internal System.Windows.Forms.ToolStripMenuItem mMenInfoDonate; internal System.Windows.Forms.ToolStripSeparator mMenViewSep3; internal ToolStripSplitButton btnQuickConnect; - internal System.Windows.Forms.ToolStripMenuItem mMenViewMultiPuttyCommand; internal System.Windows.Forms.ToolStripMenuItem mMenViewJumpTo; internal System.Windows.Forms.ToolStripMenuItem mMenViewJumpToConnectionsConfig; internal System.Windows.Forms.ToolStripMenuItem mMenViewJumpToErrorsInfos; @@ -883,5 +926,7 @@ namespace mRemoteNG.UI.Forms internal System.Windows.Forms.ToolStripMenuItem mMenFileImportFromPortScan; internal System.Windows.Forms.ToolStripMenuItem mMenFileImport; private System.ComponentModel.IContainer components; + private System.Windows.Forms.ToolStripLabel lblMultiSSH; + private System.Windows.Forms.ToolStripTextBox txtMultiSSH; } } diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index 316df31c..9b085fc4 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -46,9 +46,6 @@ namespace mRemoteNG.UI.Forms private ConnectionTreeWindow ConnectionTreeWindow { get; set; } private readonly IConnectionInitiator _connectionInitiator = new ConnectionInitiator(); - - - private frmMain() { _showFullPathInTitle = Settings.Default.ShowCompleteConsPathInTitle; @@ -253,6 +250,7 @@ namespace mRemoteNG.UI.Forms mMenViewResetLayout.Text = Language.strMenuResetLayout; mMenViewQuickConnectToolbar.Text = Language.strMenuQuickConnectToolbar; mMenViewExtAppsToolbar.Text = Language.strMenuExternalToolsToolbar; + mMenViewMultiSSHToolbar.Text = "Multi SSH Toolbar"; // TODO: Figure out how to put in language text mMenViewFullscreen.Text = Language.strMenuFullScreen; mMenTools.Text = Language.strMenuTools; @@ -300,9 +298,12 @@ namespace mRemoteNG.UI.Forms tsExternalTools.ForeColor = ThemeManager.ActiveTheme.ToolbarTextColor; tsQuickConnect.BackColor = ThemeManager.ActiveTheme.ToolbarBackgroundColor; tsQuickConnect.ForeColor = ThemeManager.ActiveTheme.ToolbarTextColor; - } - - private static void ApplyMenuColors(IEnumerable itemCollection) + tsMultiSSH.BackColor = ThemeManager.ActiveTheme.ToolbarBackgroundColor; + tsMultiSSH.ForeColor = ThemeManager.ActiveTheme.ToolbarTextColor; + + } + + private static void ApplyMenuColors(IEnumerable itemCollection) { foreach (ToolStripItem item in itemCollection) { @@ -705,10 +706,10 @@ namespace mRemoteNG.UI.Forms mMenViewConfig.Checked = !Windows.ConfigForm.IsHidden; mMenViewErrorsAndInfos.Checked = !Windows.ErrorsForm.IsHidden; mMenViewScreenshotManager.Checked = !Windows.ScreenshotForm.IsHidden; - mMenViewMultiPuttyCommand.Checked = !Windows.SSHCommandPanel.IsHidden; mMenViewExtAppsToolbar.Checked = tsExternalTools.Visible; mMenViewQuickConnectToolbar.Checked = tsQuickConnect.Visible; + mMenViewMultiSSHToolbar.Checked = tsMultiSSH.Visible; mMenViewConnectionPanels.DropDownItems.Clear(); @@ -784,20 +785,6 @@ namespace mRemoteNG.UI.Forms } } - private void mMenViewMultiPuttyCommand_Click(object sender, EventArgs e) - { - if (mMenViewMultiPuttyCommand.Checked == false) - { - Windows.SSHCommandPanel.Show(pnlDock); - mMenViewMultiPuttyCommand.Checked = true; - } - else - { - Windows.SSHCommandPanel.Hide(); - mMenViewMultiPuttyCommand.Checked = false; - } - } - private void mMenViewJumpToConnectionsConfig_Click(object sender, EventArgs e) { if (pnlDock.ActiveContent == Windows.TreePanel) @@ -858,6 +845,20 @@ namespace mRemoteNG.UI.Forms } } + private void mMenViewMultiSSHToolbar_Click(object sender, EventArgs e) + { + if (mMenViewMultiSSHToolbar.Checked == false) + { + tsMultiSSH.Visible = true; + mMenViewMultiSSHToolbar.Checked = true; + } + else + { + tsMultiSSH.Visible = false; + mMenViewMultiSSHToolbar.Checked = false; + } + } + private void mMenViewFullscreen_Click(object sender, EventArgs e) { _fullscreen.Value = !_fullscreen.Value; @@ -976,6 +977,106 @@ namespace mRemoteNG.UI.Forms } #endregion + #region Multi SSH + private ArrayList processHandlers = new ArrayList(); + private ArrayList previousCommands = new ArrayList(); + private int previousCommandIndex = 0; + + private void txtMultiSSH_Enter(object sender, EventArgs e) + { + var previouslyOpenedConnections = Runtime.ConnectionTreeModel.GetRecursiveChildList().Where(item => item.OpenConnections.Count > 0); + + processHandlers.Clear(); + foreach (ConnectionInfo connection in previouslyOpenedConnections) + { + foreach (ProtocolBase _base in connection.OpenConnections) + { + if (_base.GetType().IsSubclassOf(typeof(PuttyBase))) + { + processHandlers.Add((PuttyBase)_base); + } + } + } + } + + private void txtMultiSSH_KeyDown(object sender, KeyEventArgs e) + { + if (processHandlers.Count == 0) + { + e.SuppressKeyPress = true; + return; + } + + if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down) + { + e.SuppressKeyPress = true; + if (e.KeyCode == Keys.Up && previousCommandIndex - 1 >= 0) + { + previousCommandIndex -= 1; + } + + if (e.KeyCode == Keys.Down && previousCommandIndex + 1 < previousCommands.Count) + { + previousCommandIndex += 1; + } + + txtMultiSSH.Text = previousCommands[previousCommandIndex].ToString(); + txtMultiSSH.Select(txtMultiSSH.TextLength, 0); + } + + if (e.Control == true && e.KeyCode != Keys.V && e.Alt == false) + { + sendAllKey(NativeMethods.WM_KEYDOWN, e.KeyValue); + } + + if (e.KeyCode == Keys.Enter) + { + string strLine = txtMultiSSH.Text; + foreach (char chr1 in strLine) + { + sendAllKey(NativeMethods.WM_CHAR, Convert.ToByte(chr1)); + } + sendAllKey(NativeMethods.WM_KEYDOWN, 13); // Enter = char13 + } + } + + private void saveLastCommand() + { + if (txtMultiSSH.Text.Trim() != "") + { + previousCommands.Add(txtMultiSSH.Text.Trim()); + } + if (previousCommands.Count >= 100) + { + // Don't keep too many. TODO: make this configurable + previousCommands.RemoveAt(0); + } + + previousCommandIndex = previousCommands.Count - 1; + txtMultiSSH.Clear(); + } + + private void sendAllKey(int keyType, int keyData) + { + if (processHandlers.Count == 0) + { + return; + } + foreach (PuttyBase proc in processHandlers) + { + NativeMethods.PostMessage(proc.PuttyHandle, keyType, new IntPtr(keyData), new IntPtr(0)); + } + } + + private void txtMultiSSH_KeyUp(object sender, KeyEventArgs e) + { + if (e.KeyCode == Keys.Enter) + { + saveLastCommand(); + } + } + #endregion + #region Info private void mMenInfoHelp_Click(object sender, EventArgs e) { diff --git a/mRemoteV1/UI/Forms/frmMain.resx b/mRemoteV1/UI/Forms/frmMain.resx index f820bb6d..011612f2 100644 --- a/mRemoteV1/UI/Forms/frmMain.resx +++ b/mRemoteV1/UI/Forms/frmMain.resx @@ -118,24 +118,27 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - 17, 17 + 148, 17 - 112, 17 - - - 249, 17 - - - 447, 17 + 259, 17 - 591, 17 + 835, 17 - 724, 17 + 994, 17 + + + 17, 17 + + + 423, 17 + + + 663, 17 - 891, 17 + 1195, 17 \ No newline at end of file diff --git a/mRemoteV1/UI/Window/SSHCommandWIndow.Designer.cs b/mRemoteV1/UI/Window/SSHCommandWIndow.Designer.cs deleted file mode 100644 index 5a8649de..00000000 --- a/mRemoteV1/UI/Window/SSHCommandWIndow.Designer.cs +++ /dev/null @@ -1,75 +0,0 @@ -namespace mRemoteNG.UI.Window -{ - partial class SSHCommandWIndow - { - /// - /// Required designer variable. - /// - private System.ComponentModel.IContainer components = null; - - /// - /// Clean up any resources being used. - /// - /// true if managed resources should be disposed; otherwise, false. - protected override void Dispose(bool disposing) - { - if (disposing && (components != null)) - { - components.Dispose(); - } - base.Dispose(disposing); - } - - #region Windows Form Designer generated code - - /// - /// Required method for Designer support - do not modify - /// the contents of this method with the code editor. - /// - private void InitializeComponent() - { - this.txtSSHCommand = new System.Windows.Forms.RichTextBox(); - this.lstCommands = new System.Windows.Forms.ListBox(); - this.SuspendLayout(); - // - // txtSSHCommand - // - this.txtSSHCommand.Dock = System.Windows.Forms.DockStyle.Fill; - this.txtSSHCommand.Location = new System.Drawing.Point(0, 0); - this.txtSSHCommand.MinimumSize = new System.Drawing.Size(0, 150); - this.txtSSHCommand.Name = "txtSSHCommand"; - this.txtSSHCommand.Size = new System.Drawing.Size(821, 532); - this.txtSSHCommand.TabIndex = 0; - this.txtSSHCommand.Text = ""; - this.txtSSHCommand.Enter += new System.EventHandler(this.txtSSHCommand_Enter); - this.txtSSHCommand.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtSSHCommand_KeyDown); - this.txtSSHCommand.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtSSHCommand_KeyUp); - // - // lstCommands - // - this.lstCommands.Dock = System.Windows.Forms.DockStyle.Right; - this.lstCommands.FormattingEnabled = true; - this.lstCommands.ItemHeight = 16; - this.lstCommands.Location = new System.Drawing.Point(701, 0); - this.lstCommands.Name = "lstCommands"; - this.lstCommands.Size = new System.Drawing.Size(120, 532); - this.lstCommands.TabIndex = 1; - this.lstCommands.Visible = false; - // - // SSHCommandWIndow - // - this.ClientSize = new System.Drawing.Size(821, 532); - this.Controls.Add(this.lstCommands); - this.Controls.Add(this.txtSSHCommand); - this.Font = new System.Drawing.Font("Microsoft Sans Serif", 7.8F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); - this.Name = "SSHCommandWIndow"; - this.ResumeLayout(false); - - } - - #endregion - - private System.Windows.Forms.RichTextBox txtSSHCommand; - private System.Windows.Forms.ListBox lstCommands; - } -} \ No newline at end of file diff --git a/mRemoteV1/UI/Window/SSHCommandWIndow.cs b/mRemoteV1/UI/Window/SSHCommandWIndow.cs deleted file mode 100644 index 922f92fc..00000000 --- a/mRemoteV1/UI/Window/SSHCommandWIndow.cs +++ /dev/null @@ -1,160 +0,0 @@ -using System; -using System.Collections.Generic; -using System.ComponentModel; -using System.Data; -using System.Drawing; -using System.Linq; -using System.Text; -using System.Windows.Forms; -using WeifenLuo.WinFormsUI.Docking; -using mRemoteNG.Connection.Protocol; -using mRemoteNG.App; -using System.Collections; -using mRemoteNG.Connection; - -namespace mRemoteNG.UI.Window -{ - public partial class SSHCommandWIndow : BaseWindow - { - - public SSHCommandWIndow(DockContent panel) - { - InitializeComponent(); - - WindowType = WindowType.SSHCommandWindow; - DockPnl = panel; - - HideOnClose = true; - Icon = Resources.Screenshot_Icon; - Name = "SSHCommander"; - TabText = "Multi-SSH"; - Text = "Multi-SSH Commander"; - } - - #region Private Fields - private ArrayList processHandlers = new ArrayList(); - #endregion - - #region Public Methods - #region Event Handlers - private void SSHCommandWindow_Load(object sender, EventArgs e) - { - Control.CheckForIllegalCrossThreadCalls = false; - } - - #endregion - - private void txtSSHCommand_Enter(object sender, EventArgs e) - { - try - { - var connectionInfoList = Runtime.ConnectionTreeModel.GetRecursiveChildList(); - //.Where( node-> !(node is Container.ContainerInfo)); - var previouslyOpenedConnections = connectionInfoList.Where(item => item.OpenConnections.Count > 0); - - //var connectionInfoList = connectionTree.GetRootConnectionNode().GetRecursiveChildList().Where(node => !(node is ContainerInfo)); - //var previouslyOpenedConnections = connectionInfoList.Where(item => item.PleaseConnect); - //foreach (var connectionInfo in previouslyOpenedConnections) - //{ - // _connectionInitiator.OpenConnection(connectionInfo); - //} - - - - processHandlers.Clear(); - foreach (ConnectionInfo connection in previouslyOpenedConnections) - { - foreach (ProtocolBase _base in connection.OpenConnections) - { - if (_base.GetType().IsSubclassOf(typeof(PuttyBase))) - { - processHandlers.Add((PuttyBase)_base); - } - } - } - } - catch (Exception ex) - { - - } - } - - private void txtSSHCommand_KeyDown(object sender, KeyEventArgs e) - { - if (processHandlers.Count == 0) - { - e.SuppressKeyPress = true; - return; - } - - if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down) - { - e.SuppressKeyPress = true; - //string lastCommand = ""; - //if (lstCommands.SelectedIndex == lstCommands.Items.Count) - //{ - // lastCommand = lstCommands.Items[lstCommands.Items.Count].ToString(); - //} - - if (e.KeyCode == Keys.Up && lstCommands.SelectedIndex -1 > -1 && lstCommands.SelectedItem.ToString() == txtSSHCommand.Text) - { - lstCommands.SelectedIndex -= 1; - } - - if (e.KeyCode == Keys.Down && lstCommands.SelectedIndex + 1 < lstCommands.Items.Count) - { - lstCommands.SelectedIndex += 1; - } - - txtSSHCommand.Text = lstCommands.SelectedItem.ToString(); - txtSSHCommand.Select(txtSSHCommand.TextLength, 0); - } - - if (e.Control == true && e.KeyCode != Keys.V && e.Alt == false) - { - sendAllKey(NativeMethods.WM_KEYDOWN, e.KeyValue); - } - - if (e.KeyCode == Keys.Enter) - { - string strLine = txtSSHCommand.Text; - foreach (char chr1 in strLine) - { - sendAllKey(NativeMethods.WM_CHAR, Convert.ToByte(chr1)); - } - sendAllKey(NativeMethods.WM_KEYDOWN, 13); // Enter = char13 - } - } - - private void gotoEndOfText() - { - if (txtSSHCommand.Text.Trim() != "") - { - lstCommands.Items.Add(txtSSHCommand.Text.Trim()); - } - lstCommands.SelectedIndex = lstCommands.Items.Count - 1; - txtSSHCommand.Clear(); - } - - private void sendAllKey(int keyType, int keyData) - { - if (processHandlers.Count == 0) - { - return; - } - foreach (PuttyBase proc in processHandlers) - { - NativeMethods.PostMessage(proc.PuttyHandle, keyType, new IntPtr(keyData), new IntPtr(0)); - } - } - - private void txtSSHCommand_KeyUp(object sender, KeyEventArgs e) - { - if (e.KeyCode == Keys.Enter) - { - gotoEndOfText(); - } - } - } - #endregion -} diff --git a/mRemoteV1/UI/Window/SSHCommandWIndow.resx b/mRemoteV1/UI/Window/SSHCommandWIndow.resx deleted file mode 100644 index 1af7de15..00000000 --- a/mRemoteV1/UI/Window/SSHCommandWIndow.resx +++ /dev/null @@ -1,120 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - \ No newline at end of file diff --git a/mRemoteV1/UI/WindowType.cs b/mRemoteV1/UI/WindowType.cs index 6ee9f730..3b320aaa 100644 --- a/mRemoteV1/UI/WindowType.cs +++ b/mRemoteV1/UI/WindowType.cs @@ -17,6 +17,5 @@ namespace mRemoteNG.UI PortScan = 14, UltraVNCSC = 16, ComponentsCheck = 17, - SSHCommandWindow = 18, } } \ No newline at end of file diff --git a/mRemoteV1/mRemoteV1.csproj b/mRemoteV1/mRemoteV1.csproj index 9d62f44d..22f9436f 100644 --- a/mRemoteV1/mRemoteV1.csproj +++ b/mRemoteV1/mRemoteV1.csproj @@ -498,12 +498,6 @@ Form - - Form - - - SSHCommandWIndow.cs - Form @@ -687,9 +681,6 @@ ScreenshotManagerWindow.cs Designer - - SSHCommandWIndow.cs - SSHTransferWindow.cs Designer From a4b902d5afbe941b78d0ee4ca8b71c7e716efa77 Mon Sep 17 00:00:00 2001 From: Brandon Wulf Date: Mon, 17 Jul 2017 16:14:54 -0700 Subject: [PATCH 3/5] Reverting the references ...even though it won't compile on my box without them.. --- mRemoteV1/mRemoteV1.csproj | 28 +++++++++++++++++----------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/mRemoteV1/mRemoteV1.csproj b/mRemoteV1/mRemoteV1.csproj index 22f9436f..453ecca0 100644 --- a/mRemoteV1/mRemoteV1.csproj +++ b/mRemoteV1/mRemoteV1.csproj @@ -47,12 +47,6 @@ True - - References\AxInterop.MSTSCLib.dll - - - References\AxInterop.WFICALib.dll - ..\packages\BouncyCastle.1.8.1\lib\BouncyCastle.Crypto.dll True @@ -65,10 +59,6 @@ ..\packages\Geckofx45.45.0.22\lib\net40\Geckofx-Winforms.dll True - - References\Interop.WFICALib.dll - True - False @@ -1229,6 +1219,14 @@ aximp False + + {238F6F80-B8B4-11CF-8771-00A024541EE3} + 2 + 7 + 0 + aximp + False + {8C11EFA1-92C3-11D1-BC1E-00C04FA31489} 1 @@ -1237,6 +1235,14 @@ tlbimp False + + {238F6F80-B8B4-11CF-8771-00A024541EE3} + 2 + 7 + 0 + tlbimp + False + @@ -1320,4 +1326,4 @@ powershell.exe -ExecutionPolicy Bypass -File "%25psScriptsDir%25\postbuild_mremo - \ No newline at end of file + From a3d9b2b9cb4ba755f359e50aac86ec7beb19be59 Mon Sep 17 00:00:00 2001 From: Brandon Wulf Date: Mon, 24 Jul 2017 16:45:38 -0700 Subject: [PATCH 4/5] Pulled MultiSSH code into its own class --- mRemoteV1/App/NativeMethods.cs | 4 +- mRemoteV1/Tools/MultiSSHController.cs | 134 +++++++++++++++++++++++++ mRemoteV1/UI/Forms/frmMain.Designer.cs | 3 - mRemoteV1/UI/Forms/frmMain.cs | 104 +------------------ mRemoteV1/mRemoteV1.csproj | 1 + 5 files changed, 140 insertions(+), 106 deletions(-) create mode 100644 mRemoteV1/Tools/MultiSSHController.cs diff --git a/mRemoteV1/App/NativeMethods.cs b/mRemoteV1/App/NativeMethods.cs index c9250671..59504626 100644 --- a/mRemoteV1/App/NativeMethods.cs +++ b/mRemoteV1/App/NativeMethods.cs @@ -382,12 +382,12 @@ namespace mRemoteNG.App public const int WM_KEYUP = 0x101; /// - /// + /// Posted to the window with the keyboard focus when a WM_KEYDOWN message is translated by the TranslateMessage function. The WM_CHAR message contains the character code of the key that was pressed. /// public const int WM_CHAR = 0x102; /// - /// + /// Sent when the user selects a command item from a menu, when a control sends a notification message to its parent window, or when an accelerator keystroke is translated. /// public const int WM_COMMAND = 0x111; diff --git a/mRemoteV1/Tools/MultiSSHController.cs b/mRemoteV1/Tools/MultiSSHController.cs new file mode 100644 index 00000000..60384e6b --- /dev/null +++ b/mRemoteV1/Tools/MultiSSHController.cs @@ -0,0 +1,134 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Windows.Forms; +using System.Collections; +using mRemoteNG.App; +using mRemoteNG.Connection; +using mRemoteNG.Connection.Protocol; + +namespace mRemoteNG.Tools +{ + class MultiSSHController + { + private ArrayList processHandlers = new ArrayList(); + private ArrayList previousCommands = new ArrayList(); + private int previousCommandIndex = 0; + + public int CommandHistoryLength { get; set; } = 100; + + public MultiSSHController(TextBox txtBox) + { + DecorateTextBox(txtBox); + } + + public MultiSSHController(ToolStripTextBox txtBox) + { + DecorateTextBox(txtBox.TextBox); + } + + private void DecorateTextBox(TextBox toBeDecorated) + { + toBeDecorated.Enter += refreshActiveConnections; + toBeDecorated.KeyDown += processKeyPress; + toBeDecorated.KeyUp += processKeyRelease; + } + + private void SendAllKeystrokes(int keyType, int keyData) + { + if (processHandlers.Count == 0) + { + return; + } + foreach (PuttyBase proc in processHandlers) + { + NativeMethods.PostMessage(proc.PuttyHandle, keyType, new IntPtr(keyData), new IntPtr(0)); + } + } + +#region Event Processors + private void refreshActiveConnections(object sender, EventArgs e) + { + var previouslyOpenedConnections = Runtime.ConnectionTreeModel.GetRecursiveChildList().Where(item => item.OpenConnections.Count > 0); + + processHandlers.Clear(); + foreach (ConnectionInfo connection in previouslyOpenedConnections) + { + foreach (ProtocolBase _base in connection.OpenConnections) + { + if (_base.GetType().IsSubclassOf(typeof(PuttyBase))) + { + processHandlers.Add((PuttyBase)_base); + } + } + } + } + + private void processKeyPress(object sender, KeyEventArgs e) + { + TextBox txtMultiSSH = sender as TextBox; + if (txtMultiSSH == null) return; + + if (processHandlers.Count == 0) + { + e.SuppressKeyPress = true; + return; + } + + if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down) + { + e.SuppressKeyPress = true; + if (e.KeyCode == Keys.Up && previousCommandIndex - 1 >= 0) + { + previousCommandIndex -= 1; + } + + if (e.KeyCode == Keys.Down && previousCommandIndex + 1 < previousCommands.Count) + { + previousCommandIndex += 1; + } + + txtMultiSSH.Text = previousCommands[previousCommandIndex].ToString(); + txtMultiSSH.Select(txtMultiSSH.TextLength, 0); + } + + if (e.Control == true && e.KeyCode != Keys.V && e.Alt == false) + { + SendAllKeystrokes(NativeMethods.WM_KEYDOWN, e.KeyValue); + } + + if (e.KeyCode == Keys.Enter) + { + string strLine = txtMultiSSH.Text; + foreach (char chr1 in strLine) + { + SendAllKeystrokes(NativeMethods.WM_CHAR, Convert.ToByte(chr1)); + } + SendAllKeystrokes(NativeMethods.WM_KEYDOWN, 13); // Enter = char13 + } + } + + private void processKeyRelease(object sender, KeyEventArgs e) + { + TextBox txtMultiSSH = sender as TextBox; + if (txtMultiSSH == null) return; + + if (e.KeyCode == Keys.Enter) + { + if (txtMultiSSH.Text.Trim() != "") + { + previousCommands.Add(txtMultiSSH.Text.Trim()); + } + if (previousCommands.Count >= CommandHistoryLength) + { + previousCommands.RemoveAt(0); + } + + previousCommandIndex = previousCommands.Count - 1; + txtMultiSSH.Clear(); + } + } +#endregion + } +} diff --git a/mRemoteV1/UI/Forms/frmMain.Designer.cs b/mRemoteV1/UI/Forms/frmMain.Designer.cs index 7d8b6ca8..6f05da25 100644 --- a/mRemoteV1/UI/Forms/frmMain.Designer.cs +++ b/mRemoteV1/UI/Forms/frmMain.Designer.cs @@ -808,9 +808,6 @@ namespace mRemoteNG.UI.Forms this.txtMultiSSH.Name = "txtMultiSSH"; this.txtMultiSSH.Size = new System.Drawing.Size(300, 25); this.txtMultiSSH.ToolTipText = "Press ENTER to send. Ctrl+C is sent immediately."; - this.txtMultiSSH.Enter += new System.EventHandler(this.txtMultiSSH_Enter); - this.txtMultiSSH.KeyDown += new System.Windows.Forms.KeyEventHandler(this.txtMultiSSH_KeyDown); - this.txtMultiSSH.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtMultiSSH_KeyUp); // // tmrAutoSave // diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index 9b085fc4..25f34aa8 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -45,6 +45,7 @@ namespace mRemoteNG.UI.Forms private SystemMenu _systemMenu; private ConnectionTreeWindow ConnectionTreeWindow { get; set; } private readonly IConnectionInitiator _connectionInitiator = new ConnectionInitiator(); + private MultiSSHController _multiSSHController ; private frmMain() { @@ -52,7 +53,8 @@ namespace mRemoteNG.UI.Forms InitializeComponent(); _fullscreen = new Fullscreen(this); pnlDock.Theme = new VS2012LightTheme(); - } + _multiSSHController = new MultiSSHController(txtMultiSSH); + } static frmMain() { @@ -977,106 +979,6 @@ namespace mRemoteNG.UI.Forms } #endregion - #region Multi SSH - private ArrayList processHandlers = new ArrayList(); - private ArrayList previousCommands = new ArrayList(); - private int previousCommandIndex = 0; - - private void txtMultiSSH_Enter(object sender, EventArgs e) - { - var previouslyOpenedConnections = Runtime.ConnectionTreeModel.GetRecursiveChildList().Where(item => item.OpenConnections.Count > 0); - - processHandlers.Clear(); - foreach (ConnectionInfo connection in previouslyOpenedConnections) - { - foreach (ProtocolBase _base in connection.OpenConnections) - { - if (_base.GetType().IsSubclassOf(typeof(PuttyBase))) - { - processHandlers.Add((PuttyBase)_base); - } - } - } - } - - private void txtMultiSSH_KeyDown(object sender, KeyEventArgs e) - { - if (processHandlers.Count == 0) - { - e.SuppressKeyPress = true; - return; - } - - if (e.KeyCode == Keys.Up || e.KeyCode == Keys.Down) - { - e.SuppressKeyPress = true; - if (e.KeyCode == Keys.Up && previousCommandIndex - 1 >= 0) - { - previousCommandIndex -= 1; - } - - if (e.KeyCode == Keys.Down && previousCommandIndex + 1 < previousCommands.Count) - { - previousCommandIndex += 1; - } - - txtMultiSSH.Text = previousCommands[previousCommandIndex].ToString(); - txtMultiSSH.Select(txtMultiSSH.TextLength, 0); - } - - if (e.Control == true && e.KeyCode != Keys.V && e.Alt == false) - { - sendAllKey(NativeMethods.WM_KEYDOWN, e.KeyValue); - } - - if (e.KeyCode == Keys.Enter) - { - string strLine = txtMultiSSH.Text; - foreach (char chr1 in strLine) - { - sendAllKey(NativeMethods.WM_CHAR, Convert.ToByte(chr1)); - } - sendAllKey(NativeMethods.WM_KEYDOWN, 13); // Enter = char13 - } - } - - private void saveLastCommand() - { - if (txtMultiSSH.Text.Trim() != "") - { - previousCommands.Add(txtMultiSSH.Text.Trim()); - } - if (previousCommands.Count >= 100) - { - // Don't keep too many. TODO: make this configurable - previousCommands.RemoveAt(0); - } - - previousCommandIndex = previousCommands.Count - 1; - txtMultiSSH.Clear(); - } - - private void sendAllKey(int keyType, int keyData) - { - if (processHandlers.Count == 0) - { - return; - } - foreach (PuttyBase proc in processHandlers) - { - NativeMethods.PostMessage(proc.PuttyHandle, keyType, new IntPtr(keyData), new IntPtr(0)); - } - } - - private void txtMultiSSH_KeyUp(object sender, KeyEventArgs e) - { - if (e.KeyCode == Keys.Enter) - { - saveLastCommand(); - } - } - #endregion - #region Info private void mMenInfoHelp_Click(object sender, EventArgs e) { diff --git a/mRemoteV1/mRemoteV1.csproj b/mRemoteV1/mRemoteV1.csproj index 22f9436f..895bc606 100644 --- a/mRemoteV1/mRemoteV1.csproj +++ b/mRemoteV1/mRemoteV1.csproj @@ -220,6 +220,7 @@ + From 0807e7fec16c0b3fba189d752888d79b7b17ee1e Mon Sep 17 00:00:00 2001 From: Brandon Wulf Date: Mon, 24 Jul 2017 17:41:39 -0700 Subject: [PATCH 5/5] Send commands to quickconnect created connections too! --- mRemoteV1/Tools/MultiSSHController.cs | 40 ++++++++++++++++++++------- mRemoteV1/UI/Forms/frmMain.cs | 1 + 2 files changed, 31 insertions(+), 10 deletions(-) diff --git a/mRemoteV1/Tools/MultiSSHController.cs b/mRemoteV1/Tools/MultiSSHController.cs index 60384e6b..c71ad0ea 100644 --- a/mRemoteV1/Tools/MultiSSHController.cs +++ b/mRemoteV1/Tools/MultiSSHController.cs @@ -13,6 +13,7 @@ namespace mRemoteNG.Tools class MultiSSHController { private ArrayList processHandlers = new ArrayList(); + private ArrayList quickConnectConnections = new ArrayList(); private ArrayList previousCommands = new ArrayList(); private int previousCommandIndex = 0; @@ -28,6 +29,11 @@ namespace mRemoteNG.Tools DecorateTextBox(txtBox.TextBox); } + public void ProcessNewQuickConnect(ConnectionInfo connection) + { + quickConnectConnections.Add(connection); + } + private void DecorateTextBox(TextBox toBeDecorated) { toBeDecorated.Enter += refreshActiveConnections; @@ -35,6 +41,21 @@ namespace mRemoteNG.Tools toBeDecorated.KeyUp += processKeyRelease; } + private ArrayList ProcessOpenConnections(ConnectionInfo connection) + { + ArrayList handlers = new ArrayList(); + + foreach (ProtocolBase _base in connection.OpenConnections) + { + if (_base.GetType().IsSubclassOf(typeof(PuttyBase))) + { + handlers.Add((PuttyBase)_base); + } + } + + return handlers; + } + private void SendAllKeystrokes(int keyType, int keyData) { if (processHandlers.Count == 0) @@ -50,18 +71,17 @@ namespace mRemoteNG.Tools #region Event Processors private void refreshActiveConnections(object sender, EventArgs e) { - var previouslyOpenedConnections = Runtime.ConnectionTreeModel.GetRecursiveChildList().Where(item => item.OpenConnections.Count > 0); - processHandlers.Clear(); - foreach (ConnectionInfo connection in previouslyOpenedConnections) + foreach (ConnectionInfo connection in quickConnectConnections) { - foreach (ProtocolBase _base in connection.OpenConnections) - { - if (_base.GetType().IsSubclassOf(typeof(PuttyBase))) - { - processHandlers.Add((PuttyBase)_base); - } - } + processHandlers.AddRange(ProcessOpenConnections(connection)); + } + + var connectionTreeConnections = Runtime.ConnectionTreeModel.GetRecursiveChildList().Where(item => item.OpenConnections.Count > 0); + + foreach (ConnectionInfo connection in connectionTreeConnections) + { + processHandlers.AddRange(ProcessOpenConnections(connection)); } } diff --git a/mRemoteV1/UI/Forms/frmMain.cs b/mRemoteV1/UI/Forms/frmMain.cs index 25f34aa8..f7501003 100644 --- a/mRemoteV1/UI/Forms/frmMain.cs +++ b/mRemoteV1/UI/Forms/frmMain.cs @@ -951,6 +951,7 @@ namespace mRemoteNG.UI.Forms } cmbQuickConnect.Add(connectionInfo); _connectionInitiator.OpenConnection(connectionInfo, ConnectionInfo.Force.DoNotJump); + _multiSSHController.ProcessNewQuickConnect(connectionInfo); } catch (Exception ex) {