Fixes for issues #37 and #39

This commit is contained in:
Michael J. Seiferling
2016-03-05 15:56:02 -06:00
parent 93c9b1a5ee
commit ca9fef33ea
6 changed files with 15 additions and 31 deletions
+3 -14
View File
@@ -22,23 +22,14 @@ Partial Class frmFileFolderSearch
'Do not modify it using the code editor. 'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _ <System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.pgbProgress = New System.Windows.Forms.ProgressBar()
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.SuspendLayout() Me.SuspendLayout()
' '
'pgbProgress
'
Me.pgbProgress.Location = New System.Drawing.Point(12, 12)
Me.pgbProgress.MarqueeAnimationSpeed = 0
Me.pgbProgress.Name = "pgbProgress"
Me.pgbProgress.Size = New System.Drawing.Size(460, 23)
Me.pgbProgress.TabIndex = 0
'
'txtCurrentLocation 'txtCurrentLocation
' '
Me.txtCurrentLocation.Location = New System.Drawing.Point(12, 43) Me.txtCurrentLocation.Location = New System.Drawing.Point(12, 12)
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(379, 20)
@@ -47,7 +38,7 @@ Partial Class frmFileFolderSearch
' '
'btnCancel 'btnCancel
' '
Me.btnCancel.Location = New System.Drawing.Point(397, 41) Me.btnCancel.Location = New System.Drawing.Point(397, 10)
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 = 0
@@ -62,10 +53,9 @@ Partial Class 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, 77) Me.ClientSize = New System.Drawing.Size(484, 46)
Me.Controls.Add(Me.btnCancel) Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.txtCurrentLocation) Me.Controls.Add(Me.txtCurrentLocation)
Me.Controls.Add(Me.pgbProgress)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False Me.MaximizeBox = False
Me.MinimizeBox = False Me.MinimizeBox = False
@@ -77,7 +67,6 @@ Partial Class frmFileFolderSearch
Me.PerformLayout() Me.PerformLayout()
End Sub End Sub
Friend WithEvents pgbProgress As System.Windows.Forms.ProgressBar
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
+2 -5
View File
@@ -60,7 +60,7 @@ Public Class frmFileFolderSearch
Try Try
'Search Current Directory 'Search Current Directory
If dir.GetDirectories(sDirectoryName).Length > 0 Then If dir.GetDirectories(sDirectoryName).Length > 0 Then
Return dir.FullName & "\" & sDirectoryName Return dir.FullName & Path.DirectorySeparatorChar & sDirectoryName
End If End If
'Search Sub Directory 'Search Sub Directory
@@ -92,7 +92,7 @@ Public Class frmFileFolderSearch
Try Try
'Search Current Directory 'Search Current Directory
If dir.GetFiles(sFileName).Length > 0 Then If dir.GetFiles(sFileName).Length > 0 Then
Return dir.FullName & "\" & sFileName Return dir.FullName & Path.DirectorySeparatorChar & sFileName
End If End If
'Search Sub Directory 'Search Sub Directory
@@ -122,8 +122,6 @@ Public Class frmFileFolderSearch
End Sub End Sub
Private Sub Search(ByVal oDrive As DriveInfo) Private Sub Search(ByVal oDrive As DriveInfo)
pgbProgress.Style = ProgressBarStyle.Marquee
pgbProgress.MarqueeAnimationSpeed = 5
oSearchDrive = oDrive.RootDirectory oSearchDrive = oDrive.RootDirectory
bwSearch.RunWorkerAsync() bwSearch.RunWorkerAsync()
iCurrentDrive += 1 iCurrentDrive += 1
@@ -131,7 +129,6 @@ Public Class frmFileFolderSearch
Private Sub EndSearch() Private Sub EndSearch()
Dim oResult As MsgBoxResult Dim oResult As MsgBoxResult
pgbProgress.MarqueeAnimationSpeed = 0
If FoundItem = "Cancel" Then FoundItem = String.Empty If FoundItem = "Cancel" Then FoundItem = String.Empty
+5 -7
View File
@@ -469,14 +469,14 @@ Public Class frmGameManager
If Not CurrentBackupItem.AbsolutePath Then If Not CurrentBackupItem.AbsolutePath Then
If CurrentGame.ProcessPath <> String.Empty Then If CurrentGame.ProcessPath <> String.Empty Then
CurrentBackupItem.RelativeRestorePath = CurrentGame.ProcessPath & "\" & CurrentBackupItem.RestorePath CurrentBackupItem.RelativeRestorePath = CurrentGame.ProcessPath & Path.DirectorySeparatorChar & CurrentBackupItem.RestorePath
Else Else
sProcess = CurrentGame.TrueProcess sProcess = CurrentGame.TrueProcess
If mgrCommon.IsProcessNotSearchable(CurrentGame) Then bNoAuto = True If mgrCommon.IsProcessNotSearchable(CurrentGame) Then bNoAuto = True
sRestorePath = mgrPath.ProcessPathSearch(CurrentBackupItem.Name, sProcess, mgrCommon.FormatString(frmGameManager_ErrorPathNotSet, CurrentBackupItem.Name), bNoAuto) sRestorePath = mgrPath.ProcessPathSearch(CurrentBackupItem.Name, sProcess, mgrCommon.FormatString(frmGameManager_ErrorPathNotSet, CurrentBackupItem.Name), bNoAuto)
If sRestorePath <> String.Empty Then If sRestorePath <> String.Empty Then
CurrentBackupItem.RelativeRestorePath = sRestorePath & "\" & CurrentBackupItem.RestorePath CurrentBackupItem.RelativeRestorePath = sRestorePath & Path.DirectorySeparatorChar & CurrentBackupItem.RestorePath
txtAppPath.Text = sRestorePath txtAppPath.Text = sRestorePath
Else Else
Return False Return False
@@ -557,11 +557,8 @@ Public Class frmGameManager
txtFileSize.Text = frmGameManager_ErrorNoBackupExists txtFileSize.Text = frmGameManager_ErrorNoBackupExists
End If End If
If oApp.Temporary Then mgrRestore.DoPathOverride(CurrentBackupItem, oApp)
txtRestorePath.Text = CurrentBackupItem.RestorePath 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
@@ -611,7 +608,7 @@ Public Class frmGameManager
mgrCommon.DeleteFile(BackupFolder & CurrentBackupItem.FileName) mgrCommon.DeleteFile(BackupFolder & CurrentBackupItem.FileName)
'Check if using backup sub-directories (Probably not the best way to check for this) 'Check if using backup sub-directories (Probably not the best way to check for this)
If CurrentBackupItem.FileName.StartsWith(CurrentBackupItem.Name & "\") Then If CurrentBackupItem.FileName.StartsWith(CurrentBackupItem.Name & Path.DirectorySeparatorChar) Then
'Build sub-dir backup path 'Build sub-dir backup path
sSubDir = BackupFolder & CurrentBackupItem.Name sSubDir = BackupFolder & CurrentBackupItem.Name
@@ -838,6 +835,7 @@ Public Class frmGameManager
btnAdd.Enabled = True btnAdd.Enabled = True
btnDelete.Enabled = False btnDelete.Enabled = False
btnBackup.Enabled = False btnBackup.Enabled = False
btnOpenRestorePath.Enabled = False
btnTags.Enabled = False btnTags.Enabled = False
lblTags.Visible = False lblTags.Visible = False
btnInclude.Text = frmGameManager_btnInclude btnInclude.Text = frmGameManager_btnInclude
+1 -1
View File
@@ -97,7 +97,7 @@ Public Class frmMain
If oGame.AbsolutePath Then If oGame.AbsolutePath Then
sStatus2 = oGame.Path sStatus2 = oGame.Path
Else Else
sStatus2 = oGame.ProcessPath & "\" & oGame.Path sStatus2 = oGame.ProcessPath & System.IO.Path.DirectorySeparatorChar & oGame.Path
End If End If
sStatus3 = String.Empty sStatus3 = String.Empty
+2 -2
View File
@@ -98,8 +98,8 @@ Public Class mgrCommon
Dim sExemptList As String() = {"dosbox", "scummvm"} Dim sExemptList As String() = {"dosbox", "scummvm"}
Dim bFound As Boolean = False Dim bFound As Boolean = False
'frmFileFolderSearch is currently very buggy in Mono, this will disable all searches on Unix 'We can't search if we don't have a configuration
If IsUnix() Then If oGame.Temporary Then
Return True Return True
End If End If
+1 -1
View File
@@ -28,7 +28,7 @@ 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 Sub DoPathOverride(ByRef oCheckBackup As clsBackup, ByVal oCheckGame As clsGame) Public Shared Sub DoPathOverride(ByRef oCheckBackup As clsBackup, ByVal oCheckGame As clsGame)
'Always override the manifest restore path with the current configuration path if possible 'Always override the manifest restore path with the current configuration path if possible
If Not oCheckGame.Temporary Then If Not oCheckGame.Temporary Then
If Path.IsPathRooted(oCheckGame.Path) Then If Path.IsPathRooted(oCheckGame.Path) Then