mirror of
https://github.com/mRemoteNG/mRemoteNG.git
synced 2026-02-17 14:07:46 +08:00
Changed exit confirmation from MsgBox to TaskDialog.
This commit is contained in:
@@ -2,6 +2,7 @@ Imports mRemote.App.Runtime
|
||||
Imports System.Reflection
|
||||
Imports Crownwood
|
||||
Imports mRemote.App.Native
|
||||
Imports PSTaskDialog
|
||||
|
||||
Public Class frmMain
|
||||
Public prevWindowsState As FormWindowState
|
||||
@@ -106,7 +107,11 @@ Public Class frmMain
|
||||
|
||||
Private Sub frmMain_FormClosing(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosingEventArgs) Handles Me.FormClosing
|
||||
If My.Settings.ConfirmExit And wL.Count > 0 Then
|
||||
If MsgBox(Language.Base.UnclosedConnectionPanels, MsgBoxStyle.YesNo Or MsgBoxStyle.Question) = MsgBoxResult.No Then
|
||||
Dim Result As DialogResult = cTaskDialog.MessageBox(Me, My.Application.Info.AssemblyName, My.Resources.strConfirmExitMainInstruction, "", "", "", My.Resources.strDoNotShowThisMessageAgain, eTaskDialogButtons.YesNo, eSysIcons.Question, Nothing)
|
||||
If cTaskDialog.VerificationChecked Then
|
||||
My.Settings.ConfirmExit = False
|
||||
End If
|
||||
If Result = DialogResult.No Then
|
||||
e.Cancel = True
|
||||
Exit Sub
|
||||
End If
|
||||
@@ -122,6 +127,7 @@ Public Class frmMain
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "Timer"
|
||||
Private tmrRuns As Integer = 0
|
||||
Private Sub tmrShowUpdate_Tick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles tmrShowUpdate.Tick
|
||||
If tmrRuns = 5 Then
|
||||
@@ -145,7 +151,7 @@ Public Class frmMain
|
||||
mC.AddMessage(Messages.MessageClass.InformationMsg, "Doing AutoSave", True)
|
||||
App.Runtime.SaveConnections()
|
||||
End Sub
|
||||
|
||||
#End Region
|
||||
|
||||
#Region "Ext Apps Toolbar"
|
||||
Private Sub cMenToolbarShowText_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles cMenToolbarShowText.Click
|
||||
@@ -558,6 +564,7 @@ Public Class frmMain
|
||||
End Sub
|
||||
#End Region
|
||||
|
||||
#Region "Window Overrides and DockPanel Stuff"
|
||||
Private Sub frmMain_Resize(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Resize
|
||||
If Me.WindowState = FormWindowState.Minimized Then
|
||||
If My.Settings.MinimizeToTray Then
|
||||
@@ -571,7 +578,6 @@ Public Class frmMain
|
||||
End If
|
||||
End Sub
|
||||
|
||||
#Region "Window Overrides and DockPanel Stuff"
|
||||
Private bWmGetTextFlag As Boolean = False
|
||||
Private bWmWindowPosChangedFlag As Boolean = False
|
||||
|
||||
@@ -579,32 +585,31 @@ Public Class frmMain
|
||||
Try
|
||||
'Debug.Print(m.Msg)
|
||||
|
||||
If m.Msg = WM_GETTEXT Then
|
||||
bWmGetTextFlag = True
|
||||
ElseIf m.Msg = WM_WINDOWPOSCHANGED Then
|
||||
If bWmGetTextFlag Then
|
||||
ActivateConnection()
|
||||
End If
|
||||
|
||||
bWmGetTextFlag = False
|
||||
bWmWindowPosChangedFlag = True
|
||||
ElseIf m.Msg = WM_ACTIVATEAPP Then
|
||||
If bWmWindowPosChangedFlag Then
|
||||
ActivateConnection()
|
||||
End If
|
||||
Else
|
||||
bWmGetTextFlag = False
|
||||
bWmWindowPosChangedFlag = False
|
||||
End If
|
||||
|
||||
If m.Msg = Tools.SystemMenu.Flags.WM_SYSCOMMAND Then
|
||||
For i As Integer = 0 To SysMenSubItems.Length - 1
|
||||
If SysMenSubItems(i) = m.WParam Then
|
||||
Screens.SendFormToScreen(Screen.AllScreens(i))
|
||||
Exit For
|
||||
Select m.Msg
|
||||
Case WM_GETTEXT
|
||||
bWmGetTextFlag = True
|
||||
Case WM_WINDOWPOSCHANGED
|
||||
If bWmGetTextFlag Then
|
||||
ActivateConnection()
|
||||
End If
|
||||
Next
|
||||
End If
|
||||
|
||||
bWmGetTextFlag = False
|
||||
bWmWindowPosChangedFlag = True
|
||||
Case WM_ACTIVATEAPP
|
||||
If bWmWindowPosChangedFlag Then
|
||||
ActivateConnection()
|
||||
End If
|
||||
Case WM_SYSCOMMAND
|
||||
For i As Integer = 0 To SysMenSubItems.Length - 1
|
||||
If SysMenSubItems(i) = m.WParam Then
|
||||
Screens.SendFormToScreen(Screen.AllScreens(i))
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
Case Else
|
||||
bWmGetTextFlag = False
|
||||
bWmWindowPosChangedFlag = False
|
||||
End Select
|
||||
Catch ex As Exception
|
||||
End Try
|
||||
|
||||
|
||||
@@ -340,7 +340,6 @@
|
||||
Public Const SendTo As String = "Send to..."
|
||||
Public Const Screen As String = "Screen"
|
||||
|
||||
Public Const UnclosedConnectionPanels As String = "There are unclosed connection panels, are you sure you want to quit?"
|
||||
Public Const SaveConnectionsFileBeforeOpeningAnother As String = "Do you want to save the current connections file before loading another?"
|
||||
Public Const NewPanel As String = "New Panel"
|
||||
Public Const PanelName As String = "Panel name"
|
||||
|
||||
18
mRemoteV1/My Project/Resources.Designer.vb
generated
18
mRemoteV1/My Project/Resources.Designer.vb
generated
@@ -771,6 +771,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Do you want to close all open connections?.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property strConfirmExitMainInstruction() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("strConfirmExitMainInstruction", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Are you sure you want to reset the panels to their default layout?.
|
||||
'''</summary>
|
||||
@@ -780,6 +789,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Do not show this message again..
|
||||
'''</summary>
|
||||
Friend ReadOnly Property strDoNotShowThisMessageAgain() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("strDoNotShowThisMessageAgain", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Includes icons by [FAMFAMFAM].
|
||||
'''</summary>
|
||||
|
||||
@@ -481,4 +481,10 @@
|
||||
<data name="strConfirmResetLayout" xml:space="preserve">
|
||||
<value>Are you sure you want to reset the panels to their default layout?</value>
|
||||
</data>
|
||||
<data name="strConfirmExitMainInstruction" xml:space="preserve">
|
||||
<value>Do you want to close all open connections?</value>
|
||||
</data>
|
||||
<data name="strDoNotShowThisMessageAgain" xml:space="preserve">
|
||||
<value>Do not show this message again.</value>
|
||||
</data>
|
||||
</root>
|
||||
2
mRemoteV1/My Project/Settings.Designer.vb
generated
2
mRemoteV1/My Project/Settings.Designer.vb
generated
@@ -239,7 +239,7 @@ Namespace My
|
||||
<Global.System.Configuration.UserScopedSettingAttribute(), _
|
||||
Global.System.Configuration.SettingsProviderAttribute(GetType(mRemote.Config.Settings.Providers.ChooseProvider)), _
|
||||
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("False")> _
|
||||
Global.System.Configuration.DefaultSettingValueAttribute("True")> _
|
||||
Public Property ConfirmExit() As Boolean
|
||||
Get
|
||||
Return CType(Me("ConfirmExit"),Boolean)
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="ConfirmExit" Provider="mRemote.Config.Settings.Providers.ChooseProvider" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">False</Value>
|
||||
<Value Profile="(Default)">True</Value>
|
||||
</Setting>
|
||||
<Setting Name="CheckForUpdatesOnStartup" Provider="mRemote.Config.Settings.Providers.ChooseProvider" Type="System.Boolean" Scope="User">
|
||||
<Value Profile="(Default)">True</Value>
|
||||
|
||||
BIN
mRemoteV1/References/PSTaskDialog.dll
Normal file
BIN
mRemoteV1/References/PSTaskDialog.dll
Normal file
Binary file not shown.
@@ -103,7 +103,7 @@
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="ConfirmExit" serializeAs="String">
|
||||
<value>False</value>
|
||||
<value>True</value>
|
||||
</setting>
|
||||
<setting name="CheckForUpdatesOnStartup" serializeAs="String">
|
||||
<value>True</value>
|
||||
|
||||
@@ -125,6 +125,10 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>References\Org.Mentalis.Security.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="PSTaskDialog, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>References\PSTaskDialog.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Skybound.Gecko, Version=1.8.1.4, Culture=neutral, PublicKeyToken=3209ac31600d1857, processorArchitecture=x86">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>References\Skybound.Gecko.dll</HintPath>
|
||||
|
||||
Reference in New Issue
Block a user