Skip to content

Commit

Permalink
multi command for ssh
Browse files Browse the repository at this point in the history
  • Loading branch information
ozkanpakdil committed Mar 16, 2014
1 parent 14d1f6c commit d5d2d5b
Show file tree
Hide file tree
Showing 10 changed files with 451 additions and 168 deletions.
7 changes: 7 additions & 0 deletions mRemoteV1/App/App.Runtime.vb
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,8 @@ Namespace App
Public Shared errorsPanel As New DockContent
Public Shared sessionsForm As UI.Window.Sessions
Public Shared sessionsPanel As New DockContent
Public Shared sshsForm As UI.Window.SSHCommands
Public Shared sshsPanel As New DockContent
Public Shared screenshotForm As UI.Window.ScreenshotManager
Public Shared screenshotPanel As New DockContent
Public Shared exportForm As ExportForm
Expand Down Expand Up @@ -412,6 +414,11 @@ Namespace App
Windows.sessionsForm = New UI.Window.Sessions(Windows.sessionsPanel)
Windows.sessionsPanel = Windows.sessionsForm

Windows.sshsForm = New UI.Window.SSHCommands(Windows.sshsPanel)
Windows.sshsPanel = Windows.sshsForm



Windows.screenshotForm = New UI.Window.ScreenshotManager(Windows.screenshotPanel)
Windows.screenshotPanel = Windows.screenshotForm

Expand Down
329 changes: 169 additions & 160 deletions mRemoteV1/Forms/frmMain.Designer.vb

Large diffs are not rendered by default.

14 changes: 7 additions & 7 deletions mRemoteV1/Forms/frmMain.resx
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@
<metadata name="tsQuickConnect.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>367, 17</value>
</metadata>
<metadata name="mnuQuickConnectProtocol.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>778, 17</value>
</metadata>
<metadata name="mnuConnections.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 56</value>
</metadata>
<metadata name="tsExternalTools.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
Expand All @@ -225,16 +231,10 @@
<metadata name="ToolStrip1.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>671, 17</value>
</metadata>
<metadata name="mnuQuickConnectProtocol.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>778, 17</value>
</metadata>
<metadata name="mnuConnections.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 56</value>
</metadata>
<metadata name="tmrAutoSave.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>245, 17</value>
</metadata>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>155</value>
<value>93</value>
</metadata>
</root>
10 changes: 10 additions & 0 deletions mRemoteV1/Forms/frmMain.vb
Original file line number Diff line number Diff line change
Expand Up @@ -1040,4 +1040,14 @@ Public Class frmMain
SystemMenu.InsertMenuItem(SystemMenu.SystemMenuHandle, 1, Tools.SystemMenu.Flags.MF_BYPOSITION Or Tools.SystemMenu.Flags.MF_SEPARATOR, IntPtr.Zero, Nothing)
End Sub
#End Region

Private Sub mMenViewMultiPuttyCommand_Click(sender As Object, e As EventArgs) Handles mMenViewMultiPuttyCommand.Click
If Me.mMenViewMultiPuttyCommand.Checked = False Then
Windows.sshsPanel.Show(Me.pnlDock)
Me.mMenViewMultiPuttyCommand.Checked = True
Else
Windows.sshsPanel.Hide()
Me.mMenViewMultiPuttyCommand.Checked = False
End If
End Sub
End Class
3 changes: 2 additions & 1 deletion mRemoteV1/Tools/ProcessController.vb
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ Namespace Tools

#Region "Win32"
' ReSharper disable ClassNeverInstantiated.Local
Private Class Win32
Public Class Win32
' ReSharper restore ClassNeverInstantiated.Local
' ReSharper disable InconsistentNaming
' ReSharper disable UnusedMethodReturnValue.Local
Expand Down Expand Up @@ -167,6 +167,7 @@ Namespace Tools
Public Const WM_SETTEXT As Integer = &HC
Public Const WM_GETTEXT As Integer = &HD
Public Const WM_COMMAND As Integer = &H111
Public Const WM_KEYDOWN As Integer = &H100

Public Const SW_HIDE As Integer = 0
Public Const SW_SHOW As Integer = 5
Expand Down
40 changes: 40 additions & 0 deletions mRemoteV1/UI/UI.Window.SSHCommands.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

148 changes: 148 additions & 0 deletions mRemoteV1/UI/UI.Window.SSHCommands.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<metadata name="$this.TrayHeight" type="System.Int32, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
<value>49</value>
</metadata>
<assembly alias="System.Drawing" name="System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
<data name="$this.Icon" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>
AAABAAEAEBAAAAEAIABoBAAAFgAAACgAAAAQAAAAIAAAAAEAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA
AABtqNwNW4y4K0lEPoJKSkrgVVVV709PT/dKSkr3U1NT9EBAQN1KSEhkXprRKm+n2g0AAAAAAAAAAAAA
AAAAAAAAU5jbr0Z7sv9gWVL/eXl5/4eHh/95eXn/Xl5e/4qKiv9ubm7/SUhH/0aIyf9YmNenAAAAAAAA
AAAAAAAAAAAAADGN6f9/qM3/fHdy/4yMjP9tbW3/TU1N/0hISP9nZ2f/dX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bOVhPAAAAAAAA
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEzJlJxNCgMERT5b3D0uO9xFBfOkUMldpEStGBAAA
AAAAAAAAAA+cQQAPnEEAD5xBAA+cQQAAnEGAAJxBwACcQcAAnEHAAJxBwAGcQcADnEHAA5xB/AOcQfwD
nEH8A5xB/gOcQQ==
</value>
</data>
</root>
58 changes: 58 additions & 0 deletions mRemoteV1/UI/UI.Window.SSHCommands.vb
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
Imports System.Threading
Imports mRemoteNG.My
Imports WeifenLuo.WinFormsUI.Docking
Imports mRemoteNG.App.Runtime
Imports System.Runtime.InteropServices
Imports System.Text
Imports System.Windows
Imports mRemoteNG.Tools.ProcessController

Namespace UI
Namespace Window
Public Class SSHCommands
Inherits Base
#Region "Private Fields"
Private _getSessionsThread As Thread
Private _retrieved As Boolean = False
#End Region

#Region "Public Methods"
Public Sub New(ByVal panel As DockContent)
WindowType = Type.SSHCommands
DockPnl = panel
InitializeComponent()
End Sub
#End Region
Private Sub SSHCommands_Load(ByVal sender As Object, ByVal e As EventArgs) Handles Me.Load


End Sub

Private Sub TextBox1_KeyUp(sender As Object, e As KeyEventArgs) Handles txtSSHCommand.KeyUp
If e.KeyCode = Keys.Enter Then
e.SuppressKeyPress = True

For Each _connection As mRemoteNG.Connection.Info In mRemoteNG.App.Runtime.ConnectionList
For Each _base As mRemoteNG.Connection.Protocol.Base In _connection.OpenConnections
If _base.InterfaceControl.Info.Protocol = mRemoteNG.Connection.Protocol.Protocols.SSH1 Or _
_base.InterfaceControl.Info.Protocol = mRemoteNG.Connection.Protocol.Protocols.SSH2 Then
Dim bb As mRemoteNG.Connection.Protocol.SSH2 = _base
Dim line As Integer = txtSSHCommand.GetLineFromCharIndex(txtSSHCommand.SelectionStart)
Dim strLine As String = txtSSHCommand.Lines(line - 1)

For Each ch As Char In strLine
Dim val As System.Windows.Forms.Keys = DirectCast([Enum].Parse(GetType(Keys), ch.ToString().ToUpper()), Keys)
Win32.SendMessage(bb.PuttyHandle, Win32.WM_KEYDOWN, val, 0)
Next

Win32.SendMessage(bb.PuttyHandle, Win32.WM_KEYDOWN, Keys.Enter, 0)

End If
Next
Next
End If
End Sub

End Class
End Namespace
End Namespace
1 change: 1 addition & 0 deletions mRemoteV1/UI/UI.Window.Type.vb
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ Namespace UI
UltraVNCSC = 16
ComponentsCheck = 17
Announcement = 18
SSHCommands = 19
End Enum
End Namespace
End Namespace
9 changes: 9 additions & 0 deletions mRemoteV1/mRemoteV1.vbproj
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,12 @@
<Compile Include="UI\UI.Window.Sessions.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\UI.Window.SSHCommands.Designer.vb">
<DependentUpon>UI.Window.SSHCommands.vb</DependentUpon>
</Compile>
<Compile Include="UI\UI.Window.SSHCommands.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="UI\UI.Window.SSHTransfer.vb">
<SubType>Form</SubType>
</Compile>
Expand Down Expand Up @@ -615,6 +621,9 @@
<DependentUpon>UI.Window.Sessions.vb</DependentUpon>
<SubType>Designer</SubType>
</EmbeddedResource>
<EmbeddedResource Include="UI\UI.Window.SSHCommands.resx">
<DependentUpon>UI.Window.SSHCommands.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="UI\UI.Window.SSHTransfer.resx">
<DependentUpon>UI.Window.SSHTransfer.vb</DependentUpon>
<SubType>Designer</SubType>
Expand Down

0 comments on commit d5d2d5b

Please sign in to comment.