Fix #166, also includes a minor form load bug fix

This commit is contained in:
Michael J. Seiferling
2018-10-15 11:11:16 -06:00
parent 9dc409415f
commit 9fdc35c43d
2 changed files with 23 additions and 3 deletions
+20 -1
View File
@@ -8,6 +8,7 @@ Public Class frmGameManager
Private sBackupFolder As String Private sBackupFolder As String
Private bPendingRestores As Boolean = False Private bPendingRestores As Boolean = False
Private oCurrentBackupItem As clsBackup Private oCurrentBackupItem As clsBackup
Private oLastPlayedGame As clsGame
Private oCurrentGame As clsGame Private oCurrentGame As clsGame
Private oTagsToSave As New List(Of KeyValuePair(Of String, String)) Private oTagsToSave As New List(Of KeyValuePair(Of String, String))
Private oProcessesToSave As New List(Of KeyValuePair(Of String, String)) Private oProcessesToSave As New List(Of KeyValuePair(Of String, String))
@@ -69,6 +70,15 @@ Public Class frmGameManager
End Set End Set
End Property End Property
Property LastPlayedGame As clsGame
Get
Return oLastPlayedGame
End Get
Set(value As clsGame)
oLastPlayedGame = value
End Set
End Property
Property CurrentGame As clsGame Property CurrentGame As clsGame
Get Get
Return oCurrentGame Return oCurrentGame
@@ -1810,6 +1820,7 @@ Public Class frmGameManager
tmFilterTimer = New Timer() tmFilterTimer = New Timer()
tmFilterTimer.Interval = 1000 tmFilterTimer.Interval = 1000
tmFilterTimer.Enabled = False tmFilterTimer.Enabled = False
End Sub End Sub
Private Sub frmGameManager_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub frmGameManager_Load(sender As Object, e As EventArgs) Handles MyBase.Load
@@ -1826,7 +1837,7 @@ Public Class frmGameManager
LoadBackupData() LoadBackupData()
'Event will take care of initial load 'Event will take care of initial load (on Windows)
If PendingRestores Then If PendingRestores Then
optPendingRestores.Checked = True optPendingRestores.Checked = True
Else Else
@@ -1838,8 +1849,11 @@ Public Class frmGameManager
AssignDirtyHandlers(grpStats.Controls) AssignDirtyHandlers(grpStats.Controls)
AssignDirtyHandlersMisc() AssignDirtyHandlersMisc()
'Mono doesn't fire events in the same way as .NET, so we'll to do this to get an initial load on Linux and prevent multiple loads in Windows.
If mgrCommon.IsUnix Then
LoadData(False) LoadData(False)
ModeChange() ModeChange()
End If
End Sub End Sub
Private Sub lstGames_SelectedIndexChanged(sender As Object, e As EventArgs) Handles lstGames.SelectedIndexChanged Private Sub lstGames_SelectedIndexChanged(sender As Object, e As EventArgs) Handles lstGames.SelectedIndexChanged
@@ -2043,6 +2057,11 @@ Public Class frmGameManager
End Sub End Sub
Private Sub frmGameManager_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown Private Sub frmGameManager_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
'Load Last Played Game
If Not LastPlayedGame Is Nothing Then
lstGames.SelectedItem = New KeyValuePair(Of String, String)(LastPlayedGame.ID, LastPlayedGame.Name)
End If
txtQuickFilter.Focus() txtQuickFilter.Focus()
End Sub End Sub
+1
View File
@@ -882,6 +882,7 @@ Public Class frmMain
PauseScan() PauseScan()
frm.Settings = oSettings frm.Settings = oSettings
frm.PendingRestores = bPendingRestores frm.PendingRestores = bPendingRestores
frm.LastPlayedGame = oProcess.GameInfo
frm.ShowDialog() frm.ShowDialog()
LoadGameSettings() LoadGameSettings()
ResumeScan() ResumeScan()