Usability updates for filters and wizards

This commit is contained in:
Michael J. Seiferling
2015-12-05 21:27:53 -06:00
parent 80badb577a
commit d26c78c093
5 changed files with 123 additions and 85 deletions
+18 -9
View File
@@ -194,24 +194,23 @@ Public Class frmAddWizard
End Function
Private Sub DoSave()
Dim oGames As New List(Of clsGame)
Dim hshDupeCheck As New Hashtable
Dim sExistingGame As String
Dim sNewGame As String = oGameToSave.Name & ":" & oGameToSave.ProcessName
Dim sNewGame As String = oGameToSave.ProcessName & ":" & oGameToSave.Name
For Each o As clsGame In GameData.Values
oGames.Add(o)
sExistingGame = o.Name & ":" & o.ProcessName
hshDupeCheck.Add(sExistingGame, String.Empty)
hshDupeCheck.Add(o.CompoundKey, String.Empty)
Next
If hshDupeCheck.Contains(sNewGame) Then
MsgBox("The monitor list already contains a game with this exact name and process.", MsgBoxStyle.Exclamation, "Game Backup Monitor")
MsgBox("A game with this exact name and process already exists.", MsgBoxStyle.Exclamation, "Game Backup Monitor")
Else
mgrMonitorList.DoListAdd(oGameToSave)
MsgBox(oGameToSave.Name & " has been added to the monitor list.", MsgBoxStyle.Exclamation, "Game Backup Monitor")
If MsgBox(oGameToSave.Name & " has been saved." & vbCrLf & vbCrLf &
"Would you like to add tags for " & oGameToSave.Name & "?", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then
OpenTags(oGameToSave)
End If
Me.Close()
End If
End If
End Sub
Private Sub ValidateBack()
@@ -397,6 +396,16 @@ Public Class frmAddWizard
txtBox.Text = frm.BuilderString
End Sub
Private Sub OpenTags(ByVal oGame As clsGame)
Dim frm As New frmGameTags
Dim sMonitorIDs As New List(Of String)
sMonitorIDs.Add(oGame.ID)
frm.IDList = sMonitorIDs
frm.GameName = oGame.Name
frm.ShowDialog()
End Sub
Private Sub btnBack_Click(sender As Object, e As EventArgs) Handles btnBack.Click
ValidateBack()
End Sub
+10 -6
View File
@@ -1,12 +1,14 @@
Public Class frmFilter
Public Enum eFilterType As Integer
Any = 1
All = 2
NoFilter = 1
AnyTag = 2
AllTags = 3
NoTags = 4
End Enum
Dim oFilters As New List(Of clsTag)
Dim eCurrentFilterType As eFilterType = eFilterType.Any
Dim eCurrentFilterType As eFilterType = eFilterType.AnyTag
Dim hshTags As New Hashtable
Dim bShutdown As Boolean = False
@@ -103,10 +105,12 @@
Next
'Set Filter Type
If optAll.Checked Then
eCurrentFilterType = eFilterType.All
If Filters.Count = 0 Then
eCurrentFilterType = eFilterType.NoTags
ElseIf optAll.Checked Then
eCurrentFilterType = eFilterType.AllTags
Else
eCurrentFilterType = eFilterType.Any
eCurrentFilterType = eFilterType.AnyTag
End If
End Sub
+28 -11
View File
@@ -16,6 +16,8 @@ Public Class frmGameManager
Private oRemoteBackupData As SortedList
Private bIsDirty As Boolean = False
Private bIsLoading As Boolean = False
Private oCurrentFilters As New List(Of clsTag)
Private eCurrentFilter As frmFilter.eFilterType = frmFilter.eFilterType.NoFilter
Private Enum eModes As Integer
View = 1
@@ -201,22 +203,25 @@ Public Class frmGameManager
End If
End Sub
Private Sub LoadData()
Private Sub LoadData(Optional ByVal bRetainFilter As Boolean = True)
Dim oRestoreData As New SortedList
Dim oGame As clsGame
Dim oBackup As clsBackup
Dim frm As frmFilter
Dim oFilters As New List(Of clsTag)
Dim eCurrentFilter As frmFilter.eFilterType = frmFilter.eFilterType.Any
If optTag.Checked Then
frm = New frmFilter
frm.ShowDialog()
oFilters = frm.Filters
eCurrentFilter = frm.FilterType
If Not bRetainFilter Then
frm = New frmFilter
frm.ShowDialog()
oCurrentFilters = frm.Filters
eCurrentFilter = frm.FilterType
End If
Else
oCurrentFilters.Clear()
eCurrentFilter = frmFilter.eFilterType.NoFilter
End If
AppData = mgrMonitorList.ReadFilteredList(oFilters, eCurrentFilter)
AppData = mgrMonitorList.ReadFilteredList(oCurrentFilters, eCurrentFilter)
If optPendingRestores.Checked Then
oRestoreData = mgrRestore.CompareManifests
@@ -492,7 +497,18 @@ Public Class frmGameManager
frm.IDList = sMonitorIDs
frm.GameName = CurrentGame.Name
frm.ShowDialog()
FillTags(CurrentGame.ID)
'Only update visible tags if one item is selected
If lstGames.SelectedItems.Count = 1 Then FillTags(CurrentGame.ID)
'If a tag filter is enabled, reload list to reflect changes
If optTag.Checked Then
LoadData()
End If
'If the selected game(s) no longer match the filter, disable the form
If lstGames.SelectedIndex = -1 Then eCurrentMode = eModes.Disabled
ModeChange()
End Sub
Private Sub GetBackupInfo(ByVal oApp As clsGame)
@@ -801,7 +817,6 @@ Public Class frmGameManager
WipeControls(grpExtra.Controls)
WipeControls(grpStats.Controls)
pbIcon.Image = My.Resources.Unknown
lblTags.Text = String.Empty
lblSync.Visible = False
btnSave.Enabled = False
btnCancel.Enabled = False
@@ -816,6 +831,7 @@ Public Class frmGameManager
btnRestore.Enabled = False
btnMarkAsRestored.Enabled = False
btnTags.Enabled = False
lblTags.Visible = False
btnInclude.Text = "In&clude Items..."
btnExclude.Text = "E&xclude Items..."
Case eModes.MultiSelect
@@ -840,6 +856,7 @@ Public Class frmGameManager
btnRestore.Enabled = True
btnMarkAsRestored.Enabled = True
btnTags.Enabled = True
lblTags.Visible = False
End Select
IsLoading = False
@@ -1257,7 +1274,7 @@ Public Class frmGameManager
lstGames.ClearSelected()
eCurrentMode = eModes.Disabled
ModeChange()
LoadData()
LoadData(False)
End Sub
Private Sub btnInclude_Click(sender As Object, e As EventArgs) Handles btnInclude.Click
+2 -2
View File
@@ -72,7 +72,7 @@ Public Class frmStartUpWizard
Private Sub DownloadSettings()
If MsgBox("Would you like to import from the latest pre-configured game list?", MsgBoxStyle.YesNo, "Game Backup Monitor") = MsgBoxResult.Yes Then
If mgrMonitorList.DoImport(mgrPath.OfficialImportURL) Then
oGameData = mgrMonitorList.ReadList(mgrMonitorList.eListTypes.ScanList)
oGameData = mgrMonitorList.ReadList(mgrMonitorList.eListTypes.FullList)
If oSettings.Sync Then mgrMonitorList.SyncMonitorLists()
End If
End If
@@ -80,7 +80,7 @@ Public Class frmStartUpWizard
Private Sub LoadGameSettings()
'Load Game XML
oGameData = mgrMonitorList.ReadList(mgrMonitorList.eListTypes.ScanList)
oGameData = mgrMonitorList.ReadList(mgrMonitorList.eListTypes.FullList)
End Sub
Private Sub OpenGameWizard()