diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index bd93cf069..be4fa3f91 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -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 diff --git a/mRemoteV1/UI/UI.Window.Config.vb b/mRemoteV1/UI/UI.Window.Config.vb index d6cc4be16..f2a3e0506 100644 --- a/mRemoteV1/UI/UI.Window.Config.vb +++ b/mRemoteV1/UI/UI.Window.Config.vb @@ -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