mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 22:11:48 +08:00
Fixed confirm closing connection tabs to also ask when closing a panel.
This commit is contained in:
@@ -10,6 +10,15 @@ Public Class frmMain
|
||||
Public Shared Event clipboardchange()
|
||||
Private fpChainedWindowHandle As IntPtr
|
||||
|
||||
#Region "Properties"
|
||||
Private _IsClosing As Boolean = False
|
||||
Public ReadOnly Property IsClosing() As Boolean
|
||||
Get
|
||||
Return _IsClosing
|
||||
End Get
|
||||
End Property
|
||||
#End Region
|
||||
|
||||
#Region "Startup & Shutdown"
|
||||
Private Sub frmMain_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
|
||||
'insert enable edition code here
|
||||
@@ -155,6 +164,8 @@ Public Class frmMain
|
||||
End If
|
||||
End If
|
||||
|
||||
_IsClosing = True
|
||||
|
||||
For Each Window As UI.Window.Base In wL
|
||||
Window.Close()
|
||||
Next
|
||||
|
||||
11
mRemoteV1/My Project/Resources.Designer.vb
generated
11
mRemoteV1/My Project/Resources.Designer.vb
generated
@@ -1,7 +1,7 @@
|
||||
'------------------------------------------------------------------------------
|
||||
' <auto-generated>
|
||||
' This code was generated by a tool.
|
||||
' Runtime Version:2.0.50727.5444
|
||||
' Runtime Version:2.0.50727.4959
|
||||
'
|
||||
' Changes to this file may cause incorrect behavior and will be lost if
|
||||
' the code is regenerated.
|
||||
@@ -1697,6 +1697,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Are you sure you want to close the panel, "{0}"? Any connections that it contains will also be closed..
|
||||
'''</summary>
|
||||
Friend ReadOnly Property strConfirmCloseConnectionPanelMainInstruction() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("strConfirmCloseConnectionPanelMainInstruction", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Are you sure you want to delete the external tool, "{0}"?.
|
||||
'''</summary>
|
||||
|
||||
@@ -2325,4 +2325,7 @@ Error Description: {1}</value>
|
||||
<data name="strConfirmCloseConnectionMainInstruction" xml:space="preserve">
|
||||
<value>Do you want to close the connection, "{0}"?</value>
|
||||
</data>
|
||||
<data name="strConfirmCloseConnectionPanelMainInstruction" xml:space="preserve">
|
||||
<value>Are you sure you want to close the panel, "{0}"? Any connections that it contains will also be closed.</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -307,6 +307,17 @@ Namespace UI
|
||||
End Sub
|
||||
|
||||
Private Sub Connection_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
|
||||
If Not frmMain.IsClosing And My.Settings.ConfirmCloseConnection And TabController.TabPages.Count > 0 Then
|
||||
Dim Result As DialogResult = cTaskDialog.MessageBox(Me, My.Application.Info.ProductName, String.Format(My.Resources.strConfirmCloseConnectionPanelMainInstruction, Me.Text), "", "", "", My.Resources.strCheckboxDoNotShowThisMessageAgain, eTaskDialogButtons.YesNo, eSysIcons.Question, Nothing)
|
||||
If cTaskDialog.VerificationChecked Then
|
||||
My.Settings.ConfirmCloseConnection = False
|
||||
End If
|
||||
If Result = DialogResult.No Then
|
||||
e.Cancel = True
|
||||
Exit Sub
|
||||
End If
|
||||
End If
|
||||
|
||||
Try
|
||||
For Each tabP As Magic.Controls.TabPage In Me.TabController.TabPages
|
||||
If tabP.Tag IsNot Nothing Then
|
||||
|
||||
Reference in New Issue
Block a user