Changes for issue #37 and #38

This commit is contained in:
Michael J. Seiferling
2016-03-05 13:24:48 -06:00
parent 8880373f34
commit 730305b694
2 changed files with 37 additions and 43 deletions
+27 -22
View File
@@ -401,20 +401,20 @@ Public Class frmGameManager
End Sub
Private Sub OpenBackupFile()
'Unix Hanlder
If Not mgrCommon.IsUnix Then
Dim sFileName As String
sFileName = BackupFolder & CurrentBackupItem.FileName
Dim sFileName As String
Dim oProcessStartInfo As ProcessStartInfo
If File.Exists(sFileName) Then
Process.Start("explorer.exe", "/select," & sFileName)
Else
mgrCommon.ShowMessage(frmGameManager_ErrorNoBackupExists, MsgBoxStyle.Exclamation)
End If
sFileName = BackupFolder & CurrentBackupItem.FileName
If File.Exists(sFileName) Then
oProcessStartInfo = New ProcessStartInfo
oProcessStartInfo.FileName = sFileName
oProcessStartInfo.UseShellExecute = True
oProcessStartInfo.Verb = "open"
Process.Start(oProcessStartInfo)
Else
mgrCommon.ShowMessage(App_ErrorUnixNotAvailable, MsgBoxStyle.Exclamation)
mgrCommon.ShowMessage(frmGameManager_ErrorNoBackupExists, MsgBoxStyle.Exclamation)
End If
End Sub
Private Sub UpdateBuilderButtonLabel(ByVal sBuilderString As String, ByVal sLabel As String, ByVal btn As Button, ByVal bDirty As Boolean)
@@ -488,10 +488,10 @@ Public Class frmGameManager
End Function
Private Sub OpenRestorePath()
If Not mgrCommon.IsUnix Then
Dim sPath As String = String.Empty
Dim sPath As String = String.Empty
Dim oProcessStartInfo As ProcessStartInfo
If CurrentBackupItem.AbsolutePath Then
If CurrentBackupItem.AbsolutePath Then
sPath = CurrentBackupItem.RestorePath
Else
If FindRestorePath() Then
@@ -499,13 +499,14 @@ Public Class frmGameManager
End If
End If
If Directory.Exists(sPath) Then
Process.Start("explorer.exe", sPath)
Else
mgrCommon.ShowMessage(frmGameManager_ErrorNoRestorePathExists, MsgBoxStyle.Exclamation)
End If
If Directory.Exists(sPath) Then
oProcessStartInfo = New ProcessStartInfo
oProcessStartInfo.FileName = sPath
oProcessStartInfo.UseShellExecute = True
oProcessStartInfo.Verb = "open"
Process.Start(oProcessStartInfo)
Else
mgrCommon.ShowMessage(App_ErrorUnixNotAvailable, MsgBoxStyle.Exclamation)
mgrCommon.ShowMessage(frmGameManager_ErrorNoRestorePathExists, MsgBoxStyle.Exclamation)
End If
End Sub
@@ -540,7 +541,6 @@ Public Class frmGameManager
Dim oBackupInfo As clsBackup
Dim sFileName As String
If oRemoteBackupData.Contains(oApp.Name) Then
CurrentBackupItem = DirectCast(oRemoteBackupData(oApp.Name), clsBackup)
txtCurrentBackup.Text = mgrCommon.FormatString(frmGameManager_BackupTimeAndName, New String() {CurrentBackupItem.DateUpdated, CurrentBackupItem.UpdatedBy})
@@ -556,7 +556,12 @@ Public Class frmGameManager
Else
txtFileSize.Text = frmGameManager_ErrorNoBackupExists
End If
txtRestorePath.Text = CurrentBackupItem.RestorePath
If oApp.Temporary Then
txtRestorePath.Text = CurrentBackupItem.RestorePath
Else
txtRestorePath.Text = oApp.Path
End If
Else
txtCurrentBackup.Text = frmGameManager_Never
txtFileSize.Text = String.Empty
+10 -21
View File
@@ -28,35 +28,24 @@ Public Class mgrRestore
Public Event UpdateRestoreInfo(oRestoreInfo As clsBackup)
Public Event SetLastAction(sMessage As String)
Private Shared Function CheckForPathOverride(ByRef oCheckBackup As clsBackup, ByVal oCheckGame As clsGame) As Boolean
Dim oResult As MsgBoxResult
If oCheckBackup.RestorePath <> oCheckGame.Path Then
oResult = mgrCommon.ShowMessage(mgrRestore_ConfirmPathMismatch, oCheckBackup.CroppedName, MsgBoxStyle.YesNoCancel)
If oResult = MsgBoxResult.Yes Then
If Path.IsPathRooted(oCheckGame.Path) Then
oCheckBackup.AbsolutePath = True
oCheckBackup.RestorePath = oCheckGame.Path
Else
oCheckBackup.RestorePath = oCheckGame.Path
End If
ElseIf oResult = MsgBoxResult.Cancel Then
Return False
Private Shared Sub DoPathOverride(ByRef oCheckBackup As clsBackup, ByVal oCheckGame As clsGame)
'Always override the manifest restore path with the current configuration path if possible
If Not oCheckGame.Temporary Then
If Path.IsPathRooted(oCheckGame.Path) Then
oCheckBackup.AbsolutePath = True
oCheckBackup.RestorePath = oCheckGame.Path
Else
oCheckBackup.RestorePath = oCheckGame.Path
End If
End If
Return True
End Function
End Sub
Public Shared Function CheckPath(ByRef oRestoreInfo As clsBackup, ByVal oGame As clsGame, ByRef bTriggerReload As Boolean) As Boolean
Dim sProcess As String
Dim sRestorePath As String
Dim bNoAuto As Boolean
'Before we do anything check if we need to override the current path
If Not CheckForPathOverride(oRestoreInfo, oGame) Then
Return False
End If
DoPathOverride(oRestoreInfo, oGame)
If Not oRestoreInfo.AbsolutePath Then
If oGame.ProcessPath <> String.Empty Then