From a3ac44af55f7dff4d081ade601786a6e31af205e Mon Sep 17 00:00:00 2001 From: Riley McArdle Date: Fri, 15 Feb 2013 17:09:24 -0600 Subject: [PATCH] Fix issue MR-165 - Can't close About window if it is the last tab --- CHANGELOG.TXT | 1 + mRemoteV1/UI/UI.Window.Base.vb | 24 ++++++++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/CHANGELOG.TXT b/CHANGELOG.TXT index 60f02b16..2239cadd 100644 --- a/CHANGELOG.TXT +++ b/CHANGELOG.TXT @@ -16,6 +16,7 @@ Fix issue MR-99 - Integrate Spanish translation Fix issue MR-101 - Collapse all folders causes a NullReferenceException Fix issue MR-131 - RD Gateway does not respect setting for use different credentials + Fix issue MR-165 - Can't close About window if it is the last tab Fix issue MR-166 - Inheritance button is disabled on some connections Fix issue MR-172 - RDGatewayPassword is unencrypted in confCons.xml file Fix issue MR-176 - Del key while editing connection name triggers 'Delete Connection' diff --git a/mRemoteV1/UI/UI.Window.Base.vb b/mRemoteV1/UI/UI.Window.Base.vb index 1bd33644..7461c00c 100644 --- a/mRemoteV1/UI/UI.Window.Base.vb +++ b/mRemoteV1/UI/UI.Window.Base.vb @@ -34,6 +34,30 @@ Namespace UI End Sub #End Region +#Region "Private Methods" + Private Sub Base_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load + If TypeOf Me Is Connection Then + frmMain.pnlDock.DocumentStyle = DocumentStyle.DockingSdi + Else + frmMain.pnlDock.DocumentStyle = DocumentStyle.DockingWindow + End If + End Sub + + Private Sub Base_FormClosed(sender As System.Object, e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed + Dim nonConnectionPanelCount As Integer = 0 + For Each document As DockContent In frmMain.pnlDock.Documents + If document IsNot Me And Not TypeOf document Is Connection Then + nonConnectionPanelCount = nonConnectionPanelCount + 1 + End If + Next + + If nonConnectionPanelCount = 0 Then + frmMain.pnlDock.DocumentStyle = DocumentStyle.DockingSdi + Else + frmMain.pnlDock.DocumentStyle = DocumentStyle.DockingWindow + End If + End Sub +#End Region End Class End Namespace End Namespace \ No newline at end of file