Fix issue MR-375 - Changing a connection's icon using the picture button should immediately update Icon field

This commit is contained in:
Riley McArdle
2013-03-15 18:03:41 -05:00
parent 8030c9a63d
commit 66fe33683e
2 changed files with 20 additions and 10 deletions

View File

@@ -1,6 +1,7 @@
Added feature MR-345 - Two separate options for confirming closure of Tabs and Connection Panels
Added feature MR-346 - Option to show/hide the description box at the bottom of the Config panel
Fixed issue MR-354 - Re-ordering tabs doesn't give good, reliable visual feedback
Fixed issue MR-375 - Changing a connection's icon using the picture button should immediately update Icon field
Fixed issue MR-377 - Several redundant panels can be opened
Fixed issue MR-379 - Connection variables not working with external tools
Fixed issue MR-381 - Notifications panel - whitespace context menu allows Copy and Delete on nothing

View File

@@ -1376,19 +1376,28 @@ Namespace UI
End Try
End Sub
Private Sub IconMenu_Click(ByVal sender As Object, ByVal e As System.EventArgs)
Private Sub IconMenu_Click(ByVal sender As Object, ByVal e As EventArgs)
Try
If TypeOf Me.pGrid.SelectedObject Is mRemoteNG.Connection.Info Then
TryCast(Me.pGrid.SelectedObject, mRemoteNG.Connection.Info).Icon = TryCast(sender, ToolStripMenuItem).Text
Dim conIcon As Icon = mRemoteNG.Connection.Icon.FromString(TryCast(Me.pGrid.SelectedObject, mRemoteNG.Connection.Info).Icon)
If conIcon IsNot Nothing Then
Me.btnIcon.Image = conIcon.ToBitmap
End If
Dim connectionInfo As mRemoteNG.Connection.Info = TryCast(pGrid.SelectedObject, mRemoteNG.Connection.Info)
If connectionInfo Is Nothing Then Return
App.Runtime.SaveConnectionsBG()
End If
Dim selectedMenuItem As ToolStripMenuItem = TryCast(sender, ToolStripMenuItem)
If selectedMenuItem Is Nothing Then Return
Dim iconName As String = selectedMenuItem.Text
If String.IsNullOrEmpty(iconName) Then Return
Dim connectionIcon As Icon = mRemoteNG.Connection.Icon.FromString(iconName)
If connectionIcon Is Nothing Then Return
btnIcon.Image = connectionIcon.ToBitmap()
connectionInfo.Icon = iconName
pGrid.Refresh()
SaveConnectionsBG()
Catch ex As Exception
MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, My.Language.strConfigPropertyGridMenuClickFailed & vbNewLine & ex.Message, True)
MessageCollector.AddMessage(Messages.MessageClass.ErrorMsg, Language.strConfigPropertyGridMenuClickFailed & vbNewLine & ex.Message, True)
End Try
End Sub
#End Region