Added a timed check to verify backup path for #180
This commit is contained in:
+22
-11
@@ -2,6 +2,7 @@
|
||||
Imports System.IO
|
||||
Imports System.Text.RegularExpressions
|
||||
Imports System.Reflection
|
||||
Imports System.Threading.Thread
|
||||
|
||||
Public Class mgrPath
|
||||
'Important Note: Any changes to sSettingsRoot & sDBLocation need to be mirrored in frmMain.vb -> VerifyGameDataPath
|
||||
@@ -612,21 +613,31 @@ Public Class mgrPath
|
||||
|
||||
Public Shared Function VerifyBackupPath(ByRef sBackupPath As String) As Boolean
|
||||
Dim dBrowser As FolderBrowserDialog
|
||||
Dim oDialogResult As DialogResult
|
||||
Dim iTotalWait As Integer
|
||||
Dim iTimeOut As Integer = 60000
|
||||
|
||||
If Not Directory.Exists(sBackupPath) Then
|
||||
If mgrCommon.ShowMessage(mgrPath_ConfirmBackupLocation, sBackupPath, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
|
||||
dBrowser = New FolderBrowserDialog
|
||||
dBrowser.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
|
||||
If dBrowser.ShowDialog = DialogResult.OK Then
|
||||
sBackupPath = dBrowser.SelectedPath
|
||||
Return True
|
||||
Else
|
||||
Do While Not (Directory.Exists(sBackupPath))
|
||||
Sleep(5000)
|
||||
iTotalWait += 5000
|
||||
If iTotalWait >= iTimeOut Then
|
||||
oDialogResult = mgrCommon.ShowMessage(mgrPath_ConfirmBackupLocation, sBackupPath, MsgBoxStyle.YesNoCancel)
|
||||
If oDialogResult = MsgBoxResult.Yes Then
|
||||
dBrowser = New FolderBrowserDialog
|
||||
dBrowser.SelectedPath = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
|
||||
If dBrowser.ShowDialog = DialogResult.OK Then
|
||||
sBackupPath = dBrowser.SelectedPath
|
||||
Return True
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
ElseIf oDialogResult = DialogResult.No Then
|
||||
Return False
|
||||
Else
|
||||
iTotalWait = 0
|
||||
End If
|
||||
Else
|
||||
Return False
|
||||
End If
|
||||
End If
|
||||
Loop
|
||||
|
||||
Return True
|
||||
End Function
|
||||
|
||||
Generated
+1
-1
@@ -6439,7 +6439,7 @@ Namespace My.Resources
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to The backup location [PARAM] is not available.[BR]It may be on an external or network drive that isn't connected.[BR][BR]Do you want to select another backup location and continue?.
|
||||
''' Looks up a localized string similar to The backup location [PARAM] is not available.[BR]It may be on an external or network drive that isn't connected.[BR][BR]Do you want to select another backup location?[BR][BR]Select "No" to quit or "Cancel" to continue waiting for the location to become available..
|
||||
'''</summary>
|
||||
Friend ReadOnly Property mgrPath_ConfirmBackupLocation() As String
|
||||
Get
|
||||
|
||||
@@ -1361,7 +1361,7 @@
|
||||
<value>[PARAM][BR][BR]Do you wish to automatically search for the game path? (Path will be saved)</value>
|
||||
</data>
|
||||
<data name="mgrPath_ConfirmBackupLocation" xml:space="preserve">
|
||||
<value>The backup location [PARAM] is not available.[BR]It may be on an external or network drive that isn't connected.[BR][BR]Do you want to select another backup location and continue?</value>
|
||||
<value>The backup location [PARAM] is not available.[BR]It may be on an external or network drive that isn't connected.[BR][BR]Do you want to select another backup location?[BR][BR]Select "No" to quit or "Cancel" to continue waiting for the location to become available.</value>
|
||||
</data>
|
||||
<data name="mgrPath_ConfirmManualPath" xml:space="preserve">
|
||||
<value>[PARAM][BR][BR]Do you wish to manually set the game path? (Path will be saved)</value>
|
||||
|
||||
Reference in New Issue
Block a user