Handle OS properly when importing configurations
This commit is contained in:
@@ -51,7 +51,7 @@ Public Class frmAdvancedImport
|
||||
lstGames.BeginUpdate()
|
||||
bSelectAll = Not bSelectAll
|
||||
For i As Integer = 0 To lstGames.Items.Count - 1
|
||||
lstGames.Items(i).Checked = bSelectAll
|
||||
lstGames.Items(i).Checked = bSelectAll
|
||||
Next
|
||||
lstGames.EndUpdate()
|
||||
Cursor.Current = Cursors.Default
|
||||
@@ -66,46 +66,6 @@ Public Class frmAdvancedImport
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub ModTags(ByRef oTags As List(Of Tag))
|
||||
Dim bExists As Boolean
|
||||
Dim oTag As Tag
|
||||
Dim oNewTag As Tag
|
||||
Dim oRemoveTag As New Tag
|
||||
Dim sTag As String
|
||||
Dim sAddTags() As String = {"Wine"}
|
||||
Dim sRemoveTags() As String = {"Official"}
|
||||
|
||||
For Each sTag In sAddTags
|
||||
bExists = False
|
||||
For Each oTag In oTags
|
||||
If oTag.Name = sTag Then
|
||||
bExists = True
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If Not bExists Then
|
||||
oNewTag = New Tag
|
||||
oNewTag.Name = sTag
|
||||
oTags.Add(oNewTag)
|
||||
End If
|
||||
Next
|
||||
|
||||
For Each sTag In sRemoveTags
|
||||
bExists = False
|
||||
For Each oTag In oTags
|
||||
If oTag.Name = sTag Then
|
||||
bExists = True
|
||||
oRemoveTag = oTag
|
||||
Exit For
|
||||
End If
|
||||
Next
|
||||
If bExists Then
|
||||
oTags.Remove(oRemoveTag)
|
||||
End If
|
||||
Next
|
||||
|
||||
End Sub
|
||||
|
||||
Private Function CheckIgnoreTags(ByVal oTags As List(Of Tag)) As Boolean
|
||||
Dim oTag As Tag
|
||||
Dim sTag As String
|
||||
@@ -142,11 +102,6 @@ Public Class frmAdvancedImport
|
||||
bAddItem = False
|
||||
oApp = DirectCast(de.Value, clsGame)
|
||||
|
||||
'Run any required tag mods
|
||||
If ModWinConfigsForLinux Then
|
||||
ModTags(oApp.ImportTags)
|
||||
End If
|
||||
|
||||
sTags = String.Empty
|
||||
oApp.ImportTags.Sort(AddressOf mgrCommon.CompareImportTagsByName)
|
||||
For Each oTag As Tag In oApp.ImportTags
|
||||
|
||||
@@ -835,7 +835,7 @@ Public Class mgrMonitorList
|
||||
|
||||
Cursor.Current = Cursors.WaitCursor
|
||||
|
||||
If Not mgrXML.ReadMonitorList(sLocation, oExportInfo, hshCompareFrom, bWebRead) Then
|
||||
If Not mgrXML.ReadMonitorList(sLocation, oExportInfo, hshCompareFrom, bWebRead, bWinConfigsInLinux) Then
|
||||
Exit Sub
|
||||
End If
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ Imports System.Net
|
||||
|
||||
Public Class mgrXML
|
||||
|
||||
Public Shared Function ReadMonitorList(ByVal sLocation As String, ByRef oExportInfo As ExportData, ByRef hshList As Hashtable, Optional ByVal bWebRead As Boolean = False) As Boolean
|
||||
Public Shared Function ReadMonitorList(ByVal sLocation As String, ByRef oExportInfo As ExportData, ByRef hshList As Hashtable, Optional ByVal bWebRead As Boolean = False, Optional ByVal bWinConfigsInLinux As Boolean = False) As Boolean
|
||||
Dim oList As List(Of Game)
|
||||
Dim hshDupeList As New Hashtable
|
||||
Dim oExportData As New ExportData
|
||||
@@ -43,6 +43,14 @@ Public Class mgrXML
|
||||
oGame.IsRegEx = g.IsRegEx
|
||||
oGame.RecurseSubFolders = g.RecurseSubFolders
|
||||
oGame.OS = g.OS
|
||||
'Retain compatability when the OS value is not set
|
||||
If oGame.OS = 0 Then
|
||||
If bWinConfigsInLinux Then
|
||||
oGame.OS = clsGame.eOS.Windows
|
||||
Else
|
||||
oGame.OS = mgrCommon.GetCurrentOS
|
||||
End If
|
||||
End If
|
||||
For Each t As Tag In g.Tags
|
||||
oGame.ImportTags.Add(t)
|
||||
Next
|
||||
|
||||
Reference in New Issue
Block a user