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