Skip to content

Commit

Permalink
Fix issue MR-332 - Can't select different tab with one click after di…
Browse files Browse the repository at this point in the history
…sconnecting existing tab
  • Loading branch information
rmcardle committed Feb 24, 2013
1 parent 94d901e commit 73f7105
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.TXT
Expand Up @@ -4,6 +4,7 @@
Fixed issue MR-130 - Issues duplicating folders Fixed issue MR-130 - Issues duplicating folders
Fixed issue MR-158 - Password field not accepting Pipe Fixed issue MR-158 - Password field not accepting Pipe
Fixed issue MR-330 - Portable version saves log to user's profile folder Fixed issue MR-330 - Portable version saves log to user's profile folder
Fixed issue MR-332 - Can't select different tab with one click after disconnecting existing tab
Fixed issue MR-333 - Unnecessary prompt for 'close all open connections?' Fixed issue MR-333 - Unnecessary prompt for 'close all open connections?'


1.70 (2013-02-22): 1.70 (2013-02-22):
Expand Down
13 changes: 9 additions & 4 deletions mRemoteV1/UI/UI.Window.Connection.vb
Expand Up @@ -276,6 +276,7 @@ Namespace UI
End If End If


nTab.Selected = True nTab.Selected = True
_ignoreChangeSelectedTabClick = False


Return nTab Return nTab
Catch ex As Exception Catch ex As Exception
Expand Down Expand Up @@ -762,6 +763,7 @@ Namespace UI
Dim IC As mRemoteNG.Connection.InterfaceControl = Me.TabController.SelectedTab.Tag Dim IC As mRemoteNG.Connection.InterfaceControl = Me.TabController.SelectedTab.Tag


App.Runtime.OpenConnection(IC.Info, mRemoteNG.Connection.Info.Force.DoNotJump) App.Runtime.OpenConnection(IC.Info, mRemoteNG.Connection.Info.Force.DoNotJump)
_ignoreChangeSelectedTabClick = False
End If End If
End If End If
Catch ex As Exception Catch ex As Exception
Expand Down Expand Up @@ -822,6 +824,7 @@ Namespace UI
Else Else
Try Try
Me.TabController.TabPages.Remove(TabToBeClosed) Me.TabController.TabPages.Remove(TabToBeClosed)
_ignoreChangeSelectedTabClick = False
Catch comEx As System.Runtime.InteropServices.COMException Catch comEx As System.Runtime.InteropServices.COMException
CloseTab(TabToBeClosed) CloseTab(TabToBeClosed)
Catch ex As Exception Catch ex As Exception
Expand All @@ -834,23 +837,25 @@ Namespace UI
End If End If
End Sub End Sub


Private _selectedTabChanged As Boolean = False Private _ignoreChangeSelectedTabClick As Boolean = False
Private Sub TabController_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabController.SelectionChanged Private Sub TabController_SelectionChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles TabController.SelectionChanged
_selectedTabChanged = True _ignoreChangeSelectedTabClick = True
FocusIC() FocusIC()
RefreshIC() RefreshIC()
End Sub End Sub


Private Sub TabController_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles TabController.MouseUp Private Sub TabController_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles TabController.MouseUp
Debug.Print("TabController_MouseUp()")
Debug.Print("_ignoreChangeSelectedTabClick = {0}", _ignoreChangeSelectedTabClick)
Try Try
If Not Native.GetForegroundWindow() = frmMain.Handle And Not _selectedTabChanged Then If Not Native.GetForegroundWindow() = frmMain.Handle And Not _ignoreChangeSelectedTabClick Then
Dim clickedTab As Magic.Controls.TabPage = TabController.TabPageFromPoint(e.Location) Dim clickedTab As Magic.Controls.TabPage = TabController.TabPageFromPoint(e.Location)
If clickedTab IsNot Nothing And TabController.SelectedTab IsNot clickedTab Then If clickedTab IsNot Nothing And TabController.SelectedTab IsNot clickedTab Then
Native.SetForegroundWindow(Handle) Native.SetForegroundWindow(Handle)
TabController.SelectedTab = clickedTab TabController.SelectedTab = clickedTab
End If End If
End If End If
_selectedTabChanged = False _ignoreChangeSelectedTabClick = False


Select Case e.Button Select Case e.Button
Case MouseButtons.Left Case MouseButtons.Left
Expand Down

0 comments on commit 73f7105

Please sign in to comment.