Merge pull request #44 from MikeMaximus/msgbox_crash_fix
Merge fixes for issue #43
This commit is contained in:
+52
-5
@@ -25,23 +25,27 @@ Partial Class frmFileFolderSearch
|
|||||||
Me.txtCurrentLocation = New System.Windows.Forms.TextBox()
|
Me.txtCurrentLocation = New System.Windows.Forms.TextBox()
|
||||||
Me.btnCancel = New System.Windows.Forms.Button()
|
Me.btnCancel = New System.Windows.Forms.Button()
|
||||||
Me.bwSearch = New System.ComponentModel.BackgroundWorker()
|
Me.bwSearch = New System.ComponentModel.BackgroundWorker()
|
||||||
|
Me.lstResults = New System.Windows.Forms.ListBox()
|
||||||
|
Me.btnOk = New System.Windows.Forms.Button()
|
||||||
|
Me.lblResults = New System.Windows.Forms.Label()
|
||||||
|
Me.cboDrive = New System.Windows.Forms.ComboBox()
|
||||||
Me.SuspendLayout()
|
Me.SuspendLayout()
|
||||||
'
|
'
|
||||||
'txtCurrentLocation
|
'txtCurrentLocation
|
||||||
'
|
'
|
||||||
Me.txtCurrentLocation.Location = New System.Drawing.Point(12, 12)
|
Me.txtCurrentLocation.Location = New System.Drawing.Point(102, 13)
|
||||||
Me.txtCurrentLocation.Name = "txtCurrentLocation"
|
Me.txtCurrentLocation.Name = "txtCurrentLocation"
|
||||||
Me.txtCurrentLocation.ReadOnly = True
|
Me.txtCurrentLocation.ReadOnly = True
|
||||||
Me.txtCurrentLocation.Size = New System.Drawing.Size(379, 20)
|
Me.txtCurrentLocation.Size = New System.Drawing.Size(370, 20)
|
||||||
Me.txtCurrentLocation.TabIndex = 0
|
Me.txtCurrentLocation.TabIndex = 0
|
||||||
Me.txtCurrentLocation.TabStop = False
|
Me.txtCurrentLocation.TabStop = False
|
||||||
'
|
'
|
||||||
'btnCancel
|
'btnCancel
|
||||||
'
|
'
|
||||||
Me.btnCancel.Location = New System.Drawing.Point(397, 10)
|
Me.btnCancel.Location = New System.Drawing.Point(397, 146)
|
||||||
Me.btnCancel.Name = "btnCancel"
|
Me.btnCancel.Name = "btnCancel"
|
||||||
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
|
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
|
||||||
Me.btnCancel.TabIndex = 0
|
Me.btnCancel.TabIndex = 4
|
||||||
Me.btnCancel.Text = "&Cancel"
|
Me.btnCancel.Text = "&Cancel"
|
||||||
Me.btnCancel.UseVisualStyleBackColor = True
|
Me.btnCancel.UseVisualStyleBackColor = True
|
||||||
'
|
'
|
||||||
@@ -49,11 +53,50 @@ Partial Class frmFileFolderSearch
|
|||||||
'
|
'
|
||||||
Me.bwSearch.WorkerSupportsCancellation = True
|
Me.bwSearch.WorkerSupportsCancellation = True
|
||||||
'
|
'
|
||||||
|
'lstResults
|
||||||
|
'
|
||||||
|
Me.lstResults.FormattingEnabled = True
|
||||||
|
Me.lstResults.Location = New System.Drawing.Point(12, 58)
|
||||||
|
Me.lstResults.Name = "lstResults"
|
||||||
|
Me.lstResults.Size = New System.Drawing.Size(460, 82)
|
||||||
|
Me.lstResults.TabIndex = 2
|
||||||
|
'
|
||||||
|
'btnOk
|
||||||
|
'
|
||||||
|
Me.btnOk.Location = New System.Drawing.Point(316, 146)
|
||||||
|
Me.btnOk.Name = "btnOk"
|
||||||
|
Me.btnOk.Size = New System.Drawing.Size(75, 23)
|
||||||
|
Me.btnOk.TabIndex = 3
|
||||||
|
Me.btnOk.Text = "&OK"
|
||||||
|
Me.btnOk.UseVisualStyleBackColor = True
|
||||||
|
'
|
||||||
|
'lblResults
|
||||||
|
'
|
||||||
|
Me.lblResults.Location = New System.Drawing.Point(9, 42)
|
||||||
|
Me.lblResults.Name = "lblResults"
|
||||||
|
Me.lblResults.Size = New System.Drawing.Size(463, 13)
|
||||||
|
Me.lblResults.TabIndex = 1
|
||||||
|
Me.lblResults.Text = "Search Results"
|
||||||
|
Me.lblResults.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
|
||||||
|
'
|
||||||
|
'cboDrive
|
||||||
|
'
|
||||||
|
Me.cboDrive.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
|
||||||
|
Me.cboDrive.FormattingEnabled = True
|
||||||
|
Me.cboDrive.Location = New System.Drawing.Point(12, 13)
|
||||||
|
Me.cboDrive.Name = "cboDrive"
|
||||||
|
Me.cboDrive.Size = New System.Drawing.Size(85, 21)
|
||||||
|
Me.cboDrive.TabIndex = 5
|
||||||
|
'
|
||||||
'frmFileFolderSearch
|
'frmFileFolderSearch
|
||||||
'
|
'
|
||||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||||
Me.ClientSize = New System.Drawing.Size(484, 46)
|
Me.ClientSize = New System.Drawing.Size(484, 181)
|
||||||
|
Me.Controls.Add(Me.cboDrive)
|
||||||
|
Me.Controls.Add(Me.lblResults)
|
||||||
|
Me.Controls.Add(Me.btnOk)
|
||||||
|
Me.Controls.Add(Me.lstResults)
|
||||||
Me.Controls.Add(Me.btnCancel)
|
Me.Controls.Add(Me.btnCancel)
|
||||||
Me.Controls.Add(Me.txtCurrentLocation)
|
Me.Controls.Add(Me.txtCurrentLocation)
|
||||||
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
|
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
|
||||||
@@ -70,4 +113,8 @@ Partial Class frmFileFolderSearch
|
|||||||
Friend WithEvents txtCurrentLocation As System.Windows.Forms.TextBox
|
Friend WithEvents txtCurrentLocation As System.Windows.Forms.TextBox
|
||||||
Friend WithEvents btnCancel As System.Windows.Forms.Button
|
Friend WithEvents btnCancel As System.Windows.Forms.Button
|
||||||
Friend WithEvents bwSearch As System.ComponentModel.BackgroundWorker
|
Friend WithEvents bwSearch As System.ComponentModel.BackgroundWorker
|
||||||
|
Friend WithEvents lstResults As System.Windows.Forms.ListBox
|
||||||
|
Friend WithEvents btnOk As System.Windows.Forms.Button
|
||||||
|
Friend WithEvents lblResults As System.Windows.Forms.Label
|
||||||
|
Friend WithEvents cboDrive As System.Windows.Forms.ComboBox
|
||||||
End Class
|
End Class
|
||||||
|
|||||||
@@ -4,14 +4,24 @@ Imports System.IO
|
|||||||
Public Class frmFileFolderSearch
|
Public Class frmFileFolderSearch
|
||||||
Private sSearchItem As String
|
Private sSearchItem As String
|
||||||
Private sGameName As String = String.Empty
|
Private sGameName As String = String.Empty
|
||||||
|
Private bIsLoading As Boolean
|
||||||
Private bIsFolder As Boolean
|
Private bIsFolder As Boolean
|
||||||
Private sFoundItem As String
|
Private sFoundItem As String
|
||||||
Private oDrives As List(Of DriveInfo)
|
Private oDrives As List(Of DriveInfo)
|
||||||
Private iCurrentDrive As Integer
|
|
||||||
Private oSearchDrive As DirectoryInfo
|
Private oSearchDrive As DirectoryInfo
|
||||||
Dim bShutdown As Boolean = False
|
Dim bShutdown As Boolean = False
|
||||||
|
|
||||||
|
Private Enum eStopStatus As Integer
|
||||||
|
Cancel = 1
|
||||||
|
ChangeDrive = 2
|
||||||
|
FoundResult = 3
|
||||||
|
FinishedDrive = 4
|
||||||
|
End Enum
|
||||||
|
|
||||||
|
Private iStopStatus As eStopStatus
|
||||||
|
|
||||||
Delegate Sub UpdateInfoCallBack(ByVal sCurrentFolder As String)
|
Delegate Sub UpdateInfoCallBack(ByVal sCurrentFolder As String)
|
||||||
|
Delegate Sub UpdateResultsCallBack(ByVal sItem As String)
|
||||||
|
|
||||||
Public Property GameName As String
|
Public Property GameName As String
|
||||||
Get
|
Get
|
||||||
@@ -58,6 +68,18 @@ Public Class frmFileFolderSearch
|
|||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub UpdateResults(ByVal sItem As String)
|
||||||
|
If lstResults.InvokeRequired = True Then
|
||||||
|
Dim d As New UpdateInfoCallBack(AddressOf UpdateResults)
|
||||||
|
Me.Invoke(d, New Object() {sItem})
|
||||||
|
Else
|
||||||
|
'It's possible the same location will be searched twice when using Linux. Filter out duplicate results
|
||||||
|
If Not lstResults.Items.Contains(sItem) Then
|
||||||
|
lstResults.Items.Add(sItem)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
Private Function SearchDirectory(ByVal dir As DirectoryInfo, ByVal sDirectoryName As String) As String
|
Private Function SearchDirectory(ByVal dir As DirectoryInfo, ByVal sDirectoryName As String) As String
|
||||||
Dim sSubSearch As String = String.Empty
|
Dim sSubSearch As String = String.Empty
|
||||||
Dim sFoundItem As String = String.Empty
|
Dim sFoundItem As String = String.Empty
|
||||||
@@ -77,11 +99,7 @@ Public Class frmFileFolderSearch
|
|||||||
'Search Current Directory
|
'Search Current Directory
|
||||||
If dir.GetDirectories(sDirectoryName).Length > 0 Then
|
If dir.GetDirectories(sDirectoryName).Length > 0 Then
|
||||||
sFoundItem = dir.FullName & Path.DirectorySeparatorChar & sDirectoryName
|
sFoundItem = dir.FullName & Path.DirectorySeparatorChar & sDirectoryName
|
||||||
If mgrCommon.ShowMessage(mgrPath_ConfirmPathCorrect, New String() {GameName, sFoundItem}, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
|
UpdateResults(sFoundItem)
|
||||||
Return sFoundItem
|
|
||||||
Else
|
|
||||||
Return String.Empty
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Search Sub Directory
|
'Search Sub Directory
|
||||||
@@ -120,11 +138,7 @@ Public Class frmFileFolderSearch
|
|||||||
'Search Current Directory
|
'Search Current Directory
|
||||||
If dir.GetFiles(sFileName).Length > 0 Then
|
If dir.GetFiles(sFileName).Length > 0 Then
|
||||||
sFoundItem = Path.GetDirectoryName(dir.FullName & Path.DirectorySeparatorChar & sFileName)
|
sFoundItem = Path.GetDirectoryName(dir.FullName & Path.DirectorySeparatorChar & sFileName)
|
||||||
If mgrCommon.ShowMessage(mgrPath_ConfirmPathCorrect, New String() {GameName, sFoundItem}, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
|
UpdateResults(sFoundItem)
|
||||||
Return sFoundItem
|
|
||||||
Else
|
|
||||||
Return String.Empty
|
|
||||||
End If
|
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Search Sub Directory
|
'Search Sub Directory
|
||||||
@@ -146,36 +160,59 @@ Public Class frmFileFolderSearch
|
|||||||
End Function
|
End Function
|
||||||
|
|
||||||
Private Sub GetDrives()
|
Private Sub GetDrives()
|
||||||
|
Dim oComboItems As New List(Of KeyValuePair(Of Integer, String))
|
||||||
|
Dim iCount As Integer = 0
|
||||||
|
|
||||||
|
'cboDrive
|
||||||
|
cboDrive.ValueMember = "Key"
|
||||||
|
cboDrive.DisplayMember = "Value"
|
||||||
|
|
||||||
oDrives = New List(Of DriveInfo)
|
oDrives = New List(Of DriveInfo)
|
||||||
For Each oDrive As DriveInfo In My.Computer.FileSystem.Drives
|
For Each oDrive As DriveInfo In My.Computer.FileSystem.Drives
|
||||||
If oDrive.DriveType = IO.DriveType.Fixed Then
|
If oDrive.DriveType = IO.DriveType.Fixed Then
|
||||||
oDrives.Add(oDrive)
|
oDrives.Add(oDrive)
|
||||||
|
oComboItems.Add(New KeyValuePair(Of Integer, String)(iCount, oDrive.RootDirectory.ToString))
|
||||||
|
iCount += 1
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
cboDrive.DataSource = oComboItems
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub Search(ByVal oDrive As DriveInfo)
|
Private Sub Search(ByVal oDrive As DriveInfo)
|
||||||
|
iStopStatus = eStopStatus.FinishedDrive
|
||||||
oSearchDrive = oDrive.RootDirectory
|
oSearchDrive = oDrive.RootDirectory
|
||||||
bwSearch.RunWorkerAsync()
|
bwSearch.RunWorkerAsync()
|
||||||
iCurrentDrive += 1
|
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub EndSearch()
|
Private Sub EndSearch()
|
||||||
Dim oResult As MsgBoxResult
|
|
||||||
|
|
||||||
If FoundItem = "Cancel" Then FoundItem = String.Empty
|
If FoundItem = "Cancel" Then FoundItem = String.Empty
|
||||||
|
|
||||||
If oDrives.Count > iCurrentDrive And FoundItem = String.Empty Then
|
Select Case iStopStatus
|
||||||
oResult = mgrCommon.ShowMessage(frmFileFolderSearch_SwitchDrives, New String() {oSearchDrive.Root.ToString, oDrives(iCurrentDrive).RootDirectory.ToString}, MsgBoxStyle.YesNo)
|
Case eStopStatus.Cancel
|
||||||
If oResult = MsgBoxResult.Yes Then
|
SearchComplete(frmFileFolderSearch_SearchCancel)
|
||||||
Search(oDrives(iCurrentDrive))
|
Case eStopStatus.ChangeDrive
|
||||||
Else
|
Search(oDrives(cboDrive.SelectedValue))
|
||||||
|
Case eStopStatus.FinishedDrive
|
||||||
|
'Attempt to move onto the next drive it one exists and there's been no results
|
||||||
|
If oDrives.Count > 1 And lstResults.Items.Count = 0 Then
|
||||||
|
If cboDrive.SelectedIndex = (cboDrive.Items.Count - 1) Then
|
||||||
|
cboDrive.SelectedIndex = 0
|
||||||
|
Else
|
||||||
|
cboDrive.SelectedIndex = cboDrive.SelectedIndex + 1
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
SearchComplete(frmFileFolderSearch_SearchComplete)
|
||||||
|
End If
|
||||||
|
Case eStopStatus.FoundResult
|
||||||
bShutdown = True
|
bShutdown = True
|
||||||
Me.Close()
|
Me.Close()
|
||||||
End If
|
End Select
|
||||||
Else
|
End Sub
|
||||||
bShutdown = True
|
|
||||||
Me.Close()
|
Private Sub SearchComplete(ByVal sStopMessage As String)
|
||||||
|
txtCurrentLocation.Text = sStopMessage
|
||||||
|
If lstResults.Items.Count > 0 Then
|
||||||
|
lstResults.SelectedIndex = 0
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -184,13 +221,17 @@ Public Class frmFileFolderSearch
|
|||||||
Me.Text = frmFileFolderSearch_FormName
|
Me.Text = frmFileFolderSearch_FormName
|
||||||
|
|
||||||
'Set Form Text
|
'Set Form Text
|
||||||
|
lblResults.Text = frmFileFolderSearch_lblResults
|
||||||
|
btnOk.Text = frmFileFolderSearch_btnOk
|
||||||
btnCancel.Text = frmFileFolderSearch_btnCancel
|
btnCancel.Text = frmFileFolderSearch_btnCancel
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub frmFileFolderSearch_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
Private Sub frmFileFolderSearch_Load(sender As Object, e As EventArgs) Handles MyBase.Load
|
||||||
|
bIsLoading = True
|
||||||
SetForm()
|
SetForm()
|
||||||
GetDrives()
|
GetDrives()
|
||||||
Search(oDrives(iCurrentDrive))
|
bIsLoading = False
|
||||||
|
Search(oDrives(0))
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub bwSearch_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles bwSearch.DoWork
|
Private Sub bwSearch_DoWork(sender As Object, e As System.ComponentModel.DoWorkEventArgs) Handles bwSearch.DoWork
|
||||||
@@ -206,11 +247,54 @@ Public Class frmFileFolderSearch
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
|
Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
|
||||||
bwSearch.CancelAsync()
|
If bwSearch.IsBusy Then
|
||||||
|
iStopStatus = eStopStatus.Cancel
|
||||||
|
bwSearch.CancelAsync()
|
||||||
|
Else
|
||||||
|
bShutdown = True
|
||||||
|
Me.Close()
|
||||||
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub frmFileFolderSearch_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
|
Private Sub frmFileFolderSearch_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
|
||||||
bwSearch.CancelAsync()
|
|
||||||
If Not bShutdown Then e.Cancel = True
|
If Not bShutdown Then e.Cancel = True
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub btnOk_Click(sender As Object, e As EventArgs) Handles btnOk.Click
|
||||||
|
Dim sItem As String
|
||||||
|
|
||||||
|
If lstResults.SelectedItems.Count = 1 Then
|
||||||
|
sItem = lstResults.SelectedItem.ToString
|
||||||
|
If mgrCommon.ShowMessage(mgrPath_ConfirmPathCorrect, New String() {GameName, sItem}, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
|
||||||
|
FoundItem = sItem
|
||||||
|
If bwSearch.IsBusy Then
|
||||||
|
iStopStatus = eStopStatus.FoundResult
|
||||||
|
bwSearch.CancelAsync()
|
||||||
|
Else
|
||||||
|
bShutdown = True
|
||||||
|
Me.Close()
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
|
||||||
|
Private Sub cboDrive_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboDrive.SelectedIndexChanged
|
||||||
|
If Not bIsLoading Then
|
||||||
|
Dim oResult As MsgBoxResult
|
||||||
|
|
||||||
|
oResult = mgrCommon.ShowMessage(frmFileFolderSearch_SwitchDrives, New String() {oDrives(cboDrive.SelectedValue).RootDirectory.ToString}, MsgBoxStyle.YesNo)
|
||||||
|
|
||||||
|
If oResult = MsgBoxResult.Yes Then
|
||||||
|
If bwSearch.IsBusy Then
|
||||||
|
iStopStatus = eStopStatus.ChangeDrive
|
||||||
|
bwSearch.CancelAsync()
|
||||||
|
Else
|
||||||
|
Search(oDrives(cboDrive.SelectedValue))
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
iStopStatus = eStopStatus.FinishedDrive
|
||||||
|
SearchComplete(frmFileFolderSearch_SearchCancel)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
@@ -335,6 +335,10 @@ Public Class frmIncludeExclude
|
|||||||
|
|
||||||
Private Sub lstBuilder_AfterLabelEdit(sender As Object, e As LabelEditEventArgs) Handles lstBuilder.AfterLabelEdit
|
Private Sub lstBuilder_AfterLabelEdit(sender As Object, e As LabelEditEventArgs) Handles lstBuilder.AfterLabelEdit
|
||||||
If Not e.Label Is Nothing Then
|
If Not e.Label Is Nothing Then
|
||||||
|
If e.Label = String.Empty Then
|
||||||
|
e.CancelEdit = True
|
||||||
|
End If
|
||||||
|
|
||||||
If lstBuilder.Items.ContainsKey(e.Label) Then
|
If lstBuilder.Items.ContainsKey(e.Label) Then
|
||||||
e.CancelEdit = True
|
e.CancelEdit = True
|
||||||
Else
|
Else
|
||||||
|
|||||||
+34
-14
@@ -146,15 +146,11 @@ Public Class frmMain
|
|||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ExecuteBackup(ByVal oBackupList As List(Of clsGame))
|
Private Sub ExecuteBackup(ByVal oBackupList As List(Of clsGame))
|
||||||
'Init Backup Settings
|
|
||||||
oBackup.Settings = oSettings
|
|
||||||
oBackup.DoBackup(oBackupList)
|
oBackup.DoBackup(oBackupList)
|
||||||
OperationEnded()
|
OperationEnded()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub ExecuteRestore(ByVal oRestoreList As List(Of clsBackup))
|
Private Sub ExecuteRestore(ByVal oRestoreList As List(Of clsBackup))
|
||||||
'Init Restore Settings
|
|
||||||
oRestore.Settings = oSettings
|
|
||||||
oRestore.DoRestore(oRestoreList)
|
oRestore.DoRestore(oRestoreList)
|
||||||
OperationEnded()
|
OperationEnded()
|
||||||
End Sub
|
End Sub
|
||||||
@@ -165,19 +161,26 @@ Public Class frmMain
|
|||||||
Dim oReadyList As New List(Of clsBackup)
|
Dim oReadyList As New List(Of clsBackup)
|
||||||
Dim oRestoreInfo As clsBackup
|
Dim oRestoreInfo As clsBackup
|
||||||
Dim bTriggerReload As Boolean = False
|
Dim bTriggerReload As Boolean = False
|
||||||
|
Dim bPathVerified As Boolean
|
||||||
eCurrentOperation = eOperation.Restore
|
eCurrentOperation = eOperation.Restore
|
||||||
OperationStarted()
|
OperationStarted()
|
||||||
|
|
||||||
'Build Restore List
|
'Build Restore List
|
||||||
For Each oGame In oRestoreList
|
For Each oGame In oRestoreList
|
||||||
|
bPathVerified = False
|
||||||
oRestoreInfo = oBackupData(oGame.Name)
|
oRestoreInfo = oBackupData(oGame.Name)
|
||||||
|
|
||||||
If mgrRestore.CheckPath(oRestoreInfo, oGame, bTriggerReload) Then
|
If mgrRestore.CheckPath(oRestoreInfo, oGame, bTriggerReload) Then
|
||||||
oReadyList.Add(oRestoreInfo)
|
bPathVerified = True
|
||||||
Else
|
Else
|
||||||
UpdateLog(mgrCommon.FormatString(frmMain_ErrorRestorePath, oRestoreInfo.Name), False, ToolTipIcon.Error, True)
|
UpdateLog(mgrCommon.FormatString(frmMain_ErrorRestorePath, oRestoreInfo.Name), False, ToolTipIcon.Error, True)
|
||||||
End If
|
End If
|
||||||
|
|
||||||
|
If bPathVerified Then
|
||||||
|
If oRestore.CheckRestorePrereq(oRestoreInfo) Then
|
||||||
|
oReadyList.Add(oRestoreInfo)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
'Reload the monitor list if any game data was changed during the path checks
|
'Reload the monitor list if any game data was changed during the path checks
|
||||||
@@ -197,6 +200,7 @@ Public Class frmMain
|
|||||||
Private Sub RunManualBackup(ByVal oBackupList As List(Of clsGame))
|
Private Sub RunManualBackup(ByVal oBackupList As List(Of clsGame))
|
||||||
Dim oGame As clsGame
|
Dim oGame As clsGame
|
||||||
Dim bNoAuto As Boolean
|
Dim bNoAuto As Boolean
|
||||||
|
Dim bPathVerified As Boolean
|
||||||
Dim oReadyList As New List(Of clsGame)
|
Dim oReadyList As New List(Of clsGame)
|
||||||
|
|
||||||
eCurrentOperation = eOperation.Backup
|
eCurrentOperation = eOperation.Backup
|
||||||
@@ -205,6 +209,7 @@ Public Class frmMain
|
|||||||
'Build Backup List
|
'Build Backup List
|
||||||
For Each oGame In oBackupList
|
For Each oGame In oBackupList
|
||||||
bNoAuto = False
|
bNoAuto = False
|
||||||
|
bPathVerified = False
|
||||||
gMonStripStatusButton.Enabled = False
|
gMonStripStatusButton.Enabled = False
|
||||||
|
|
||||||
UpdateLog(mgrCommon.FormatString(frmMain_ManualBackup, oGame.Name), False)
|
UpdateLog(mgrCommon.FormatString(frmMain_ManualBackup, oGame.Name), False)
|
||||||
@@ -216,12 +221,18 @@ Public Class frmMain
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If oGame.ProcessPath <> String.Empty Then
|
If oGame.ProcessPath <> String.Empty Then
|
||||||
oReadyList.Add(oGame)
|
bPathVerified = True
|
||||||
Else
|
Else
|
||||||
UpdateLog(mgrCommon.FormatString(frmMain_ErrorBackupUnknownPath, oGame.Name), True, ToolTipIcon.Error, True)
|
UpdateLog(mgrCommon.FormatString(frmMain_ErrorBackupUnknownPath, oGame.Name), False, ToolTipIcon.Error, True)
|
||||||
End If
|
End If
|
||||||
Else
|
Else
|
||||||
oReadyList.Add(oGame)
|
bPathVerified = True
|
||||||
|
End If
|
||||||
|
|
||||||
|
If bPathVerified Then
|
||||||
|
If oBackup.CheckBackupPrereq(oGame) Then
|
||||||
|
oReadyList.Add(oGame)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
|
|
||||||
@@ -300,11 +311,16 @@ Public Class frmMain
|
|||||||
End If
|
End If
|
||||||
|
|
||||||
If bDoBackup Then
|
If bDoBackup Then
|
||||||
'Run the backup
|
If Not oBackup.CheckBackupPrereq(oProcess.GameInfo) Then
|
||||||
oReadyList.Add(oProcess.GameInfo)
|
SetLastAction(mgrCommon.FormatString(frmMain_ErrorBackupCancel, oProcess.GameInfo.CroppedName))
|
||||||
Dim trd As New System.Threading.Thread(AddressOf ExecuteBackup)
|
OperationEnded()
|
||||||
trd.IsBackground = True
|
Else
|
||||||
trd.Start(oReadyList)
|
'Run the backup
|
||||||
|
oReadyList.Add(oProcess.GameInfo)
|
||||||
|
Dim trd As New System.Threading.Thread(AddressOf ExecuteBackup)
|
||||||
|
trd.IsBackground = True
|
||||||
|
trd.Start(oReadyList)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
@@ -684,6 +700,8 @@ Public Class frmMain
|
|||||||
PauseScan()
|
PauseScan()
|
||||||
If frm.ShowDialog() = Windows.Forms.DialogResult.OK Then
|
If frm.ShowDialog() = Windows.Forms.DialogResult.OK Then
|
||||||
oSettings = frm.Settings
|
oSettings = frm.Settings
|
||||||
|
oBackup.Settings = oSettings
|
||||||
|
oRestore.Settings = oSettings
|
||||||
'Set Remote Database Location
|
'Set Remote Database Location
|
||||||
mgrPath.RemoteDatabaseLocation = oSettings.BackupFolder
|
mgrPath.RemoteDatabaseLocation = oSettings.BackupFolder
|
||||||
SetupSyncWatcher()
|
SetupSyncWatcher()
|
||||||
@@ -806,6 +824,8 @@ Public Class frmMain
|
|||||||
|
|
||||||
'Load Settings
|
'Load Settings
|
||||||
oSettings.LoadSettings()
|
oSettings.LoadSettings()
|
||||||
|
oBackup.Settings = oSettings
|
||||||
|
oRestore.Settings = oSettings
|
||||||
|
|
||||||
If Not bFirstRun Then
|
If Not bFirstRun Then
|
||||||
'The application cannot continue if this fails
|
'The application cannot continue if this fails
|
||||||
|
|||||||
+22
-14
@@ -85,6 +85,28 @@ Public Class mgrBackup
|
|||||||
End Try
|
End Try
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Public Function CheckBackupPrereq(ByVal oGame As clsGame) As Boolean
|
||||||
|
Dim sBackupFile As String = oSettings.BackupFolder
|
||||||
|
If oSettings.CreateSubFolder Then sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name
|
||||||
|
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name & ".7z"
|
||||||
|
|
||||||
|
If mgrRestore.CheckManifest(oGame.Name) Then
|
||||||
|
If mgrCommon.ShowMessage(mgrBackup_ConfirmManifestConflict, oGame.Name, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
|
||||||
|
RaiseEvent UpdateLog(mgrBackup_ErrorManifestConflict, False, ToolTipIcon.Error, True)
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
If oSettings.ShowOverwriteWarning And File.Exists(sBackupFile) And Not oGame.AppendTimeStamp Then
|
||||||
|
If mgrCommon.ShowMessage(mgrBackup_ConfirmOverwrite, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
|
||||||
|
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorOverwriteAbort, oGame.Name), False, ToolTipIcon.Error, True)
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Sub DoBackup(ByVal oBackupList As List(Of clsGame))
|
Public Sub DoBackup(ByVal oBackupList As List(Of clsGame))
|
||||||
Dim oGame As clsGame
|
Dim oGame As clsGame
|
||||||
Dim bDoBackup As Boolean
|
Dim bDoBackup As Boolean
|
||||||
@@ -109,13 +131,6 @@ Public Class mgrBackup
|
|||||||
CancelOperation = False
|
CancelOperation = False
|
||||||
RaiseEvent UpdateBackupInfo(oGame)
|
RaiseEvent UpdateBackupInfo(oGame)
|
||||||
|
|
||||||
If mgrRestore.CheckManifest(oGame.Name) Then
|
|
||||||
If mgrCommon.ShowMessage(mgrBackup_ConfirmManifestConflict, oGame.Name, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
|
|
||||||
RaiseEvent UpdateLog(mgrBackup_ErrorManifestConflict, False, ToolTipIcon.Error, True)
|
|
||||||
bDoBackup = False
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If oSettings.CreateSubFolder Then
|
If oSettings.CreateSubFolder Then
|
||||||
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name
|
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name
|
||||||
Try
|
Try
|
||||||
@@ -134,13 +149,6 @@ Public Class mgrBackup
|
|||||||
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name & ".7z"
|
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name & ".7z"
|
||||||
End If
|
End If
|
||||||
|
|
||||||
If oSettings.ShowOverwriteWarning And File.Exists(sBackupFile) Then
|
|
||||||
If mgrCommon.ShowMessage(mgrBackup_ConfirmOverwrite, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
|
|
||||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorOverwriteAbort, oGame.Name), False, ToolTipIcon.Error, True)
|
|
||||||
bDoBackup = False
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
If bDoBackup Then
|
If bDoBackup Then
|
||||||
If oGame.AbsolutePath = False Then
|
If oGame.AbsolutePath = False Then
|
||||||
If oGame.Path <> String.Empty Then
|
If oGame.Path <> String.Empty Then
|
||||||
|
|||||||
+91
-82
@@ -161,20 +161,64 @@ Public Class mgrRestore
|
|||||||
Return slRemovedItems
|
Return slRemovedItems
|
||||||
End Function
|
End Function
|
||||||
|
|
||||||
|
Public Function CheckRestorePrereq(ByVal oBackupInfo As clsBackup) As Boolean
|
||||||
|
Dim sHash As String
|
||||||
|
Dim sExtractPath As String
|
||||||
|
Dim sBackupFile As String = oSettings.BackupFolder & Path.DirectorySeparatorChar & oBackupInfo.FileName
|
||||||
|
|
||||||
|
If oBackupInfo.AbsolutePath Then
|
||||||
|
sExtractPath = oBackupInfo.RestorePath
|
||||||
|
Else
|
||||||
|
sExtractPath = oBackupInfo.RelativeRestorePath
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Check if restore location exists, prompt to create if it doesn't.
|
||||||
|
If Not Directory.Exists(sExtractPath) Then
|
||||||
|
If mgrCommon.ShowMessage(mgrRestore_ConfirmCreatePath, sExtractPath, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
|
||||||
|
Try
|
||||||
|
Directory.CreateDirectory(sExtractPath)
|
||||||
|
Catch ex As Exception
|
||||||
|
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorCreatePath, ex.Message), False, ToolTipIcon.Error, True)
|
||||||
|
Return False
|
||||||
|
End Try
|
||||||
|
Else
|
||||||
|
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorNoPath, sExtractPath), False, ToolTipIcon.Error, True)
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
'Check file integrity
|
||||||
|
If oSettings.CheckSum Then
|
||||||
|
If oBackupInfo.CheckSum <> String.Empty Then
|
||||||
|
sHash = mgrHash.Generate_SHA256_Hash(sBackupFile)
|
||||||
|
If sHash <> oBackupInfo.CheckSum Then
|
||||||
|
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorFailedCheck, oBackupInfo.Name), False, ToolTipIcon.Info, True)
|
||||||
|
If mgrCommon.ShowMessage(mgrRestore_ConfirmFailedCheck, oBackupInfo.Name, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
|
||||||
|
RaiseEvent UpdateLog(mgrRestore_ErrorCheckAbort, False, ToolTipIcon.Info, True)
|
||||||
|
Return False
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_Verified, oBackupInfo.Name), False, ToolTipIcon.Info, True)
|
||||||
|
End If
|
||||||
|
Else
|
||||||
|
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_NoVerify, oBackupInfo.Name), False, ToolTipIcon.Info, True)
|
||||||
|
End If
|
||||||
|
End If
|
||||||
|
|
||||||
|
Return True
|
||||||
|
End Function
|
||||||
|
|
||||||
Public Sub DoRestore(ByVal oRestoreList As List(Of clsBackup))
|
Public Sub DoRestore(ByVal oRestoreList As List(Of clsBackup))
|
||||||
Dim prs7z As Process
|
Dim prs7z As Process
|
||||||
Dim sBackupFile As String
|
Dim sBackupFile As String
|
||||||
Dim sExtractPath As String
|
Dim sExtractPath As String
|
||||||
Dim bDoRestore As Boolean
|
|
||||||
Dim bRestoreCompleted As Boolean
|
Dim bRestoreCompleted As Boolean
|
||||||
Dim sHash As String
|
|
||||||
|
|
||||||
For Each oBackupInfo In oRestoreList
|
For Each oBackupInfo In oRestoreList
|
||||||
'Init
|
'Init
|
||||||
prs7z = New Process
|
prs7z = New Process
|
||||||
sBackupFile = oSettings.BackupFolder & Path.DirectorySeparatorChar & oBackupInfo.FileName
|
sBackupFile = oSettings.BackupFolder & Path.DirectorySeparatorChar & oBackupInfo.FileName
|
||||||
sExtractPath = String.Empty
|
sExtractPath = String.Empty
|
||||||
bDoRestore = True
|
|
||||||
bRestoreCompleted = False
|
bRestoreCompleted = False
|
||||||
CancelOperation = False
|
CancelOperation = False
|
||||||
RaiseEvent UpdateRestoreInfo(oBackupInfo)
|
RaiseEvent UpdateRestoreInfo(oBackupInfo)
|
||||||
@@ -185,93 +229,58 @@ Public Class mgrRestore
|
|||||||
sExtractPath = oBackupInfo.RelativeRestorePath
|
sExtractPath = oBackupInfo.RelativeRestorePath
|
||||||
End If
|
End If
|
||||||
|
|
||||||
'Check if restore location exists, prompt to create if it doesn't.
|
Try
|
||||||
If Not Directory.Exists(sExtractPath) Then
|
If File.Exists(sBackupFile) Then
|
||||||
If mgrCommon.ShowMessage(mgrRestore_ConfirmCreatePath, sExtractPath, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
|
If mgrCommon.IsUnix Then
|
||||||
Try
|
prs7z.StartInfo.Arguments = "x """ & sBackupFile & """ -o""" & sExtractPath & Path.DirectorySeparatorChar & """ -aoa -r"
|
||||||
Directory.CreateDirectory(sExtractPath)
|
|
||||||
Catch ex As Exception
|
|
||||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorCreatePath, ex.Message), False, ToolTipIcon.Error, True)
|
|
||||||
bDoRestore = False
|
|
||||||
End Try
|
|
||||||
Else
|
|
||||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorNoPath, sExtractPath), False, ToolTipIcon.Error, True)
|
|
||||||
bDoRestore = False
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
|
|
||||||
'Check file integrity
|
|
||||||
If oSettings.CheckSum Then
|
|
||||||
If oBackupInfo.CheckSum <> String.Empty Then
|
|
||||||
sHash = mgrHash.Generate_SHA256_Hash(sBackupFile)
|
|
||||||
If sHash <> oBackupInfo.CheckSum Then
|
|
||||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorFailedCheck, oBackupInfo.Name), False, ToolTipIcon.Info, True)
|
|
||||||
If mgrCommon.ShowMessage(mgrRestore_ConfirmFailedCheck, oBackupInfo.Name, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
|
|
||||||
RaiseEvent UpdateLog(mgrRestore_ErrorCheckAbort, False, ToolTipIcon.Info, True)
|
|
||||||
bDoRestore = False
|
|
||||||
End If
|
|
||||||
Else
|
Else
|
||||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_Verified, oBackupInfo.Name), False, ToolTipIcon.Info, True)
|
prs7z.StartInfo.Arguments = "x -bb1 -bt """ & sBackupFile & """ -o""" & sExtractPath & Path.DirectorySeparatorChar & """ -aoa -r"
|
||||||
End If
|
End If
|
||||||
Else
|
prs7z.StartInfo.FileName = mgrPath.Utility7zLocation
|
||||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_NoVerify, oBackupInfo.Name), False, ToolTipIcon.Info, True)
|
prs7z.StartInfo.UseShellExecute = False
|
||||||
End If
|
prs7z.StartInfo.RedirectStandardOutput = True
|
||||||
End If
|
prs7z.StartInfo.CreateNoWindow = True
|
||||||
|
prs7z.Start()
|
||||||
If bDoRestore Then
|
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_RestoreInProgress, sExtractPath), False, ToolTipIcon.Info, True)
|
||||||
Try
|
While Not prs7z.StandardOutput.EndOfStream
|
||||||
If File.Exists(sBackupFile) Then
|
If CancelOperation Then
|
||||||
If mgrCommon.IsUnix Then
|
prs7z.Kill()
|
||||||
prs7z.StartInfo.Arguments = "x """ & sBackupFile & """ -o""" & sExtractPath & Path.DirectorySeparatorChar & """ -aoa -r"
|
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorFullAbort, oBackupInfo.Name), True, ToolTipIcon.Error, True)
|
||||||
|
Exit While
|
||||||
|
End If
|
||||||
|
RaiseEvent UpdateLog(prs7z.StandardOutput.ReadLine, False, ToolTipIcon.Info, False)
|
||||||
|
End While
|
||||||
|
prs7z.WaitForExit()
|
||||||
|
If Not CancelOperation Then
|
||||||
|
If prs7z.ExitCode = 0 Then
|
||||||
|
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_RestoreComplete, oBackupInfo.Name), False, ToolTipIcon.Info, True)
|
||||||
|
bRestoreCompleted = True
|
||||||
Else
|
Else
|
||||||
prs7z.StartInfo.Arguments = "x -bb1 -bt """ & sBackupFile & """ -o""" & sExtractPath & Path.DirectorySeparatorChar & """ -aoa -r"
|
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_RestoreWarnings, oBackupInfo.Name), True, ToolTipIcon.Warning, True)
|
||||||
|
bRestoreCompleted = False
|
||||||
End If
|
End If
|
||||||
prs7z.StartInfo.FileName = mgrPath.Utility7zLocation
|
|
||||||
prs7z.StartInfo.UseShellExecute = False
|
|
||||||
prs7z.StartInfo.RedirectStandardOutput = True
|
|
||||||
prs7z.StartInfo.CreateNoWindow = True
|
|
||||||
prs7z.Start()
|
|
||||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_RestoreInProgress, sExtractPath), False, ToolTipIcon.Info, True)
|
|
||||||
While Not prs7z.StandardOutput.EndOfStream
|
|
||||||
If CancelOperation Then
|
|
||||||
prs7z.Kill()
|
|
||||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorFullAbort, oBackupInfo.Name), True, ToolTipIcon.Error, True)
|
|
||||||
Exit While
|
|
||||||
End If
|
|
||||||
RaiseEvent UpdateLog(prs7z.StandardOutput.ReadLine, False, ToolTipIcon.Info, False)
|
|
||||||
End While
|
|
||||||
prs7z.WaitForExit()
|
|
||||||
If Not CancelOperation Then
|
|
||||||
If prs7z.ExitCode = 0 Then
|
|
||||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_RestoreComplete, oBackupInfo.Name), False, ToolTipIcon.Info, True)
|
|
||||||
bRestoreCompleted = True
|
|
||||||
Else
|
|
||||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_RestoreWarnings, oBackupInfo.Name), True, ToolTipIcon.Warning, True)
|
|
||||||
bRestoreCompleted = False
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
prs7z.Dispose()
|
|
||||||
Else
|
|
||||||
RaiseEvent UpdateLog(mgrRestore_ErrorNoBackup, True, ToolTipIcon.Error, True)
|
|
||||||
End If
|
End If
|
||||||
|
prs7z.Dispose()
|
||||||
If bRestoreCompleted Then
|
Else
|
||||||
'Save Local Manifest
|
RaiseEvent UpdateLog(mgrRestore_ErrorNoBackup, True, ToolTipIcon.Error, True)
|
||||||
If mgrManifest.DoManifestCheck(oBackupInfo.Name, mgrSQLite.Database.Local) Then
|
End If
|
||||||
mgrManifest.DoManifestUpdate(oBackupInfo, mgrSQLite.Database.Local)
|
|
||||||
Else
|
|
||||||
mgrManifest.DoManifestAdd(oBackupInfo, mgrSQLite.Database.Local)
|
|
||||||
End If
|
|
||||||
End If
|
|
||||||
Catch ex As Exception
|
|
||||||
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorOtherFailure, ex.Message), False, ToolTipIcon.Error, True)
|
|
||||||
End Try
|
|
||||||
|
|
||||||
If bRestoreCompleted Then
|
If bRestoreCompleted Then
|
||||||
RaiseEvent SetLastAction(mgrCommon.FormatString(mgrRestore_ActionComplete, oBackupInfo.CroppedName))
|
'Save Local Manifest
|
||||||
Else
|
If mgrManifest.DoManifestCheck(oBackupInfo.Name, mgrSQLite.Database.Local) Then
|
||||||
RaiseEvent SetLastAction(mgrCommon.FormatString(mgrRestore_ActionFailed, oBackupInfo.CroppedName))
|
mgrManifest.DoManifestUpdate(oBackupInfo, mgrSQLite.Database.Local)
|
||||||
|
Else
|
||||||
|
mgrManifest.DoManifestAdd(oBackupInfo, mgrSQLite.Database.Local)
|
||||||
|
End If
|
||||||
End If
|
End If
|
||||||
|
Catch ex As Exception
|
||||||
|
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorOtherFailure, ex.Message), False, ToolTipIcon.Error, True)
|
||||||
|
End Try
|
||||||
|
|
||||||
|
If bRestoreCompleted Then
|
||||||
|
RaiseEvent SetLastAction(mgrCommon.FormatString(mgrRestore_ActionComplete, oBackupInfo.CroppedName))
|
||||||
|
Else
|
||||||
|
RaiseEvent SetLastAction(mgrCommon.FormatString(mgrRestore_ActionFailed, oBackupInfo.CroppedName))
|
||||||
End If
|
End If
|
||||||
Next
|
Next
|
||||||
End Sub
|
End Sub
|
||||||
|
|||||||
Generated
+37
-1
@@ -834,6 +834,15 @@ Namespace My.Resources
|
|||||||
End Get
|
End Get
|
||||||
End Property
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Looks up a localized string similar to &OK.
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property frmFileFolderSearch_btnOk() As String
|
||||||
|
Get
|
||||||
|
Return ResourceManager.GetString("frmFileFolderSearch_btnOk", resourceCulture)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to Search.
|
''' Looks up a localized string similar to Search.
|
||||||
'''</summary>
|
'''</summary>
|
||||||
@@ -844,7 +853,34 @@ Namespace My.Resources
|
|||||||
End Property
|
End Property
|
||||||
|
|
||||||
'''<summary>
|
'''<summary>
|
||||||
''' Looks up a localized string similar to The location was not found on the [PARAM] drive. Do you wish to search the [PARAM] drive?.
|
''' Looks up a localized string similar to Search Results.
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property frmFileFolderSearch_lblResults() As String
|
||||||
|
Get
|
||||||
|
Return ResourceManager.GetString("frmFileFolderSearch_lblResults", resourceCulture)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Looks up a localized string similar to Search Aborted!.
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property frmFileFolderSearch_SearchCancel() As String
|
||||||
|
Get
|
||||||
|
Return ResourceManager.GetString("frmFileFolderSearch_SearchCancel", resourceCulture)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Looks up a localized string similar to Search Complete!.
|
||||||
|
'''</summary>
|
||||||
|
Friend ReadOnly Property frmFileFolderSearch_SearchComplete() As String
|
||||||
|
Get
|
||||||
|
Return ResourceManager.GetString("frmFileFolderSearch_SearchComplete", resourceCulture)
|
||||||
|
End Get
|
||||||
|
End Property
|
||||||
|
|
||||||
|
'''<summary>
|
||||||
|
''' Looks up a localized string similar to Do you wish to search the [PARAM] drive?.
|
||||||
'''</summary>
|
'''</summary>
|
||||||
Friend ReadOnly Property frmFileFolderSearch_SwitchDrives() As String
|
Friend ReadOnly Property frmFileFolderSearch_SwitchDrives() As String
|
||||||
Get
|
Get
|
||||||
|
|||||||
@@ -890,7 +890,7 @@
|
|||||||
<value>Search</value>
|
<value>Search</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="frmFileFolderSearch_SwitchDrives" xml:space="preserve">
|
<data name="frmFileFolderSearch_SwitchDrives" xml:space="preserve">
|
||||||
<value>The location was not found on the [PARAM] drive. Do you wish to search the [PARAM] drive?</value>
|
<value>Do you wish to search the [PARAM] drive?</value>
|
||||||
</data>
|
</data>
|
||||||
<data name="frmFilter_btnAdd" xml:space="preserve">
|
<data name="frmFilter_btnAdd" xml:space="preserve">
|
||||||
<value>></value>
|
<value>></value>
|
||||||
@@ -1585,4 +1585,16 @@
|
|||||||
<data name="frmMain_AtTime" xml:space="preserve">
|
<data name="frmMain_AtTime" xml:space="preserve">
|
||||||
<value>at [PARAM].</value>
|
<value>at [PARAM].</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="frmFileFolderSearch_btnOk" xml:space="preserve">
|
||||||
|
<value>&OK</value>
|
||||||
|
</data>
|
||||||
|
<data name="frmFileFolderSearch_lblResults" xml:space="preserve">
|
||||||
|
<value>Search Results</value>
|
||||||
|
</data>
|
||||||
|
<data name="frmFileFolderSearch_SearchComplete" xml:space="preserve">
|
||||||
|
<value>Search Complete!</value>
|
||||||
|
</data>
|
||||||
|
<data name="frmFileFolderSearch_SearchCancel" xml:space="preserve">
|
||||||
|
<value>Search Aborted!</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Reference in New Issue
Block a user