Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Change the "Launch PuTTY" button in the "Options" dialog to open PuTT…

…Y from the path the user has currently set, instead of what was previously saved.
  • Loading branch information...
commit 5d8db1ade6de5d597402b5a1db2a3344ab0106be 1 parent 423a89f
@rmcardle authored
View
1  CHANGELOG.TXT
@@ -5,6 +5,7 @@
Fixed possible error "Control does not support transparent background colors" when modifying themes.
Fixed changes to the active theme not being saved reliably.
Changed Internet Explorer to no longer force IE7 compatibility mode.
+ Changed the "Launch PuTTY" button in the "Options" dialog to open PuTTY from the path the user has currently set, instead of what was previously saved.
1.71 Beta 3 (2013-03-20):
Fixed issue MR-397 - Putty disappears from the screen
View
1  mRemoteV1/App/App.Info.vb
@@ -11,6 +11,7 @@ Namespace App
Public Shared ReadOnly HomePath As String = My.Application.Info.DirectoryPath
Public Shared EncryptionKey As String = "mR3m"
Public Shared ReportingFilePath As String = ""
+ Public Shared ReadOnly PuttyPath As String = My.Application.Info.DirectoryPath & "\PuTTYNG.exe"
End Class
Public Class Settings
View
2  mRemoteV1/Config/Config.Settings.Load.vb
@@ -87,7 +87,7 @@ Namespace Config
If My.Settings.UseCustomPuttyPath Then
Connection.Protocol.PuttyBase.PuttyPath = My.Settings.CustomPuttyPath
Else
- Connection.Protocol.PuttyBase.PuttyPath = My.Application.Info.DirectoryPath & "\PuTTYNG.exe"
+ Connection.Protocol.PuttyBase.PuttyPath = App.Info.General.PuttyPath
End If
If My.Settings.ShowSystemTrayIcon Then
View
13 mRemoteV1/Connection/Connection.Protocol.PuttyBase.vb
@@ -240,19 +240,6 @@ Namespace Connection
End Try
Return isPuttyNg
End Function
-
- Public Shared Sub StartPutty()
- Try
- Dim p As Process
- Dim pSI As New ProcessStartInfo
- pSI.FileName = PuttyPath
-
- p = Process.Start(pSI)
- p.WaitForExit()
- Catch ex As Exception
- MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, My.Language.strPuttyStartFailed & vbNewLine & ex.Message, True)
- End Try
- End Sub
#End Region
#Region "Enums"
View
83 mRemoteV1/Forms/frmOptions.vb
@@ -1,5 +1,6 @@
Imports System.IO
Imports System.ComponentModel
+Imports mRemoteNG.Messages
Imports mRemoteNG.My
Imports WeifenLuo.WinFormsUI.Docking
Imports mRemoteNG.App.Runtime
@@ -1647,10 +1648,12 @@ Public Class frmOptions
Me.chkAutomaticallyGetSessionInfo.Checked = My.Settings.AutomaticallyGetSessionInfo
Me.chkAutomaticReconnect.Checked = My.Settings.ReconnectOnDisconnect
Me.chkSingleInstance.Checked = My.Settings.SingleInstance
- Me.chkUseCustomPuttyPath.Checked = My.Settings.UseCustomPuttyPath
- Me.txtCustomPuttyPath.Text = My.Settings.CustomPuttyPath
Me.numPuttyWaitTime.Value = My.Settings.MaxPuttyWaitTime
+ chkUseCustomPuttyPath.Checked = Settings.UseCustomPuttyPath
+ txtCustomPuttyPath.Text = Settings.CustomPuttyPath
+ SetPuttyLaunchButtonEnabled()
+
Me.chkUseProxyForAutomaticUpdates.Checked = My.Settings.UpdateUseProxy
Me.btnTestProxy.Enabled = My.Settings.UpdateUseProxy
Me.pnlProxyBasic.Enabled = My.Settings.UpdateUseProxy
@@ -1780,10 +1783,10 @@ Public Class frmOptions
My.Settings.UseCustomPuttyPath = Me.chkUseCustomPuttyPath.Checked
My.Settings.CustomPuttyPath = Me.txtCustomPuttyPath.Text
- If My.Settings.UseCustomPuttyPath Then
- mRemoteNG.Connection.Protocol.PuttyBase.PuttyPath = My.Settings.CustomPuttyPath
+ If Settings.UseCustomPuttyPath Then
+ Connection.Protocol.PuttyBase.PuttyPath = Settings.CustomPuttyPath
Else
- mRemoteNG.Connection.Protocol.PuttyBase.PuttyPath = My.Application.Info.DirectoryPath & "\PuTTYNG.exe"
+ Connection.Protocol.PuttyBase.PuttyPath = App.Info.General.PuttyPath
End If
My.Settings.MaxPuttyWaitTime = Me.numPuttyWaitTime.Value
@@ -2006,26 +2009,70 @@ Public Class frmOptions
End Sub
Private Sub chkUseCustomPuttyPath_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles chkUseCustomPuttyPath.CheckedChanged
- Me.txtCustomPuttyPath.Enabled = Me.chkUseCustomPuttyPath.Checked
- Me.btnBrowseCustomPuttyPath.Enabled = Me.chkUseCustomPuttyPath.Checked
+ txtCustomPuttyPath.Enabled = chkUseCustomPuttyPath.Checked
+ btnBrowseCustomPuttyPath.Enabled = chkUseCustomPuttyPath.Checked
+ SetPuttyLaunchButtonEnabled()
End Sub
- Private Sub btnLaunchPutty_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLaunchPutty.Click
- mRemoteNG.Connection.Protocol.PuttyBase.StartPutty()
+ Private Sub txtCustomPuttyPath_TextChanged(sender As Object, e As System.EventArgs) Handles txtCustomPuttyPath.TextChanged
+ SetPuttyLaunchButtonEnabled()
End Sub
- Private Sub btnBrowseCustomPuttyPath_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowseCustomPuttyPath.Click
- Dim oDlg As New OpenFileDialog()
- oDlg.Filter = My.Language.strFilterApplication & "|*.exe|" & My.Language.strFilterAll & "|*.*"
- oDlg.FileName = "PuTTYNG.exe"
- oDlg.CheckFileExists = True
- oDlg.Multiselect = False
+ Private Sub btnBrowseCustomPuttyPath_Click(ByVal sender As System.Object, ByVal e As EventArgs) Handles btnBrowseCustomPuttyPath.Click
+ Using openFileDialog As New OpenFileDialog()
+ With openFileDialog
+ .Filter = String.Format("{0}|*.exe|{1}|*.*", Language.strFilterApplication, Language.strFilterAll)
+ .FileName = Path.GetFileName(App.Info.General.PuttyPath)
+ .CheckFileExists = True
+ .Multiselect = False
+
+ If .ShowDialog = System.Windows.Forms.DialogResult.OK Then
+ txtCustomPuttyPath.Text = .FileName
+ SetPuttyLaunchButtonEnabled()
+ End If
+ End With
+ End Using
+ End Sub
- If oDlg.ShowDialog = System.Windows.Forms.DialogResult.OK Then
- Me.txtCustomPuttyPath.Text = oDlg.FileName
+ Private Sub SetPuttyLaunchButtonEnabled()
+ Dim puttyPath As String
+ If chkUseCustomPuttyPath.Checked Then
+ puttyPath = txtCustomPuttyPath.Text
+ Else
+ puttyPath = App.Info.General.PuttyPath
End If
- oDlg.Dispose()
+ Dim exists As Boolean = False
+ Try
+ exists = File.Exists(puttyPath)
+ Catch
+ End Try
+
+ If exists Then
+ lblConfigurePuttySessions.Enabled = True
+ btnLaunchPutty.Enabled = True
+ Else
+ lblConfigurePuttySessions.Enabled = False
+ btnLaunchPutty.Enabled = False
+ End If
+ End Sub
+
+ Private Sub btnLaunchPutty_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLaunchPutty.Click
+ Try
+ Dim process As New Process
+ With process.StartInfo
+ .UseShellExecute = False
+ If chkUseCustomPuttyPath.Checked Then
+ .FileName = txtCustomPuttyPath.Text
+ Else
+ .FileName = App.Info.General.PuttyPath
+ End If
+ End With
+ process.Start()
+ process.WaitForExit()
+ Catch ex As Exception
+ MessageCollector.AddMessage(MessageClass.ErrorMsg, Language.strPuttyStartFailed & vbNewLine & ex.Message, True)
+ End Try
End Sub
Private Sub btnBrowseXulRunnerPath_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnBrowseXulRunnerPath.Click
Please sign in to comment.
Something went wrong with that request. Please try again.