Enhancement for issue #79
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
Public Class Game
|
||||
Private sGameName As String
|
||||
Private sProcessName As String
|
||||
Private sParameter As String
|
||||
Private sPath As String
|
||||
Private bAbsolutePath As Boolean
|
||||
Private bFolderSave As Boolean
|
||||
@@ -26,6 +27,15 @@
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Property Parameter As String
|
||||
Set(value As String)
|
||||
sParameter = value
|
||||
End Set
|
||||
Get
|
||||
Return sParameter
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Property Path As String
|
||||
Set(value As String)
|
||||
sPath = value
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
Private sGameID As String = Guid.NewGuid.ToString
|
||||
Private sGameName As String = String.Empty
|
||||
Private sProcessName As String = String.Empty
|
||||
Private sParameter As String = String.Empty
|
||||
Private sPath As String = String.Empty
|
||||
Private bAbsolutePath As Boolean = False
|
||||
Private bFolderSave As Boolean = False
|
||||
@@ -74,6 +75,15 @@
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Property Parameter As String
|
||||
Set(value As String)
|
||||
sParameter = value
|
||||
End Set
|
||||
Get
|
||||
Return sParameter
|
||||
End Get
|
||||
End Property
|
||||
|
||||
Property Path As String
|
||||
Set(value As String)
|
||||
sPath = mgrPath.ReverseSpecialPaths(value)
|
||||
@@ -263,6 +273,9 @@
|
||||
If ProcessName <> oGame.ProcessName Then
|
||||
Return False
|
||||
End If
|
||||
If Parameter <> oGame.Parameter Then
|
||||
Return False
|
||||
End If
|
||||
If Path <> oGame.Path Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
Generated
+24
-2
@@ -96,6 +96,8 @@ Partial Class frmGameManager
|
||||
Me.cmsDeleteBackup = New System.Windows.Forms.ContextMenuStrip(Me.components)
|
||||
Me.cmsDeleteOne = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.cmsDeleteAll = New System.Windows.Forms.ToolStripMenuItem()
|
||||
Me.lblParameter = New System.Windows.Forms.Label()
|
||||
Me.txtParameter = New System.Windows.Forms.TextBox()
|
||||
Me.grpConfig.SuspendLayout()
|
||||
CType(Me.nudLimit, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.grpExtra.SuspendLayout()
|
||||
@@ -152,6 +154,8 @@ Partial Class frmGameManager
|
||||
'grpConfig
|
||||
'
|
||||
Me.grpConfig.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.grpConfig.Controls.Add(Me.txtParameter)
|
||||
Me.grpConfig.Controls.Add(Me.lblParameter)
|
||||
Me.grpConfig.Controls.Add(Me.chkCleanFolder)
|
||||
Me.grpConfig.Controls.Add(Me.lblLimit)
|
||||
Me.grpConfig.Controls.Add(Me.nudLimit)
|
||||
@@ -247,7 +251,7 @@ Partial Class frmGameManager
|
||||
'
|
||||
'btnProcessBrowse
|
||||
'
|
||||
Me.btnProcessBrowse.Location = New System.Drawing.Point(489, 45)
|
||||
Me.btnProcessBrowse.Location = New System.Drawing.Point(225, 44)
|
||||
Me.btnProcessBrowse.Name = "btnProcessBrowse"
|
||||
Me.btnProcessBrowse.Size = New System.Drawing.Size(30, 20)
|
||||
Me.btnProcessBrowse.TabIndex = 5
|
||||
@@ -330,7 +334,7 @@ Partial Class frmGameManager
|
||||
'
|
||||
Me.txtProcess.Location = New System.Drawing.Point(69, 45)
|
||||
Me.txtProcess.Name = "txtProcess"
|
||||
Me.txtProcess.Size = New System.Drawing.Size(414, 20)
|
||||
Me.txtProcess.Size = New System.Drawing.Size(150, 20)
|
||||
Me.txtProcess.TabIndex = 4
|
||||
'
|
||||
'txtName
|
||||
@@ -819,6 +823,22 @@ Partial Class frmGameManager
|
||||
Me.cmsDeleteAll.Size = New System.Drawing.Size(114, 22)
|
||||
Me.cmsDeleteAll.Text = "&All Files"
|
||||
'
|
||||
'lblParameter
|
||||
'
|
||||
Me.lblParameter.AutoSize = True
|
||||
Me.lblParameter.Location = New System.Drawing.Point(269, 48)
|
||||
Me.lblParameter.Name = "lblParameter"
|
||||
Me.lblParameter.Size = New System.Drawing.Size(58, 13)
|
||||
Me.lblParameter.TabIndex = 15
|
||||
Me.lblParameter.Text = "Parameter:"
|
||||
'
|
||||
'txtParameter
|
||||
'
|
||||
Me.txtParameter.Location = New System.Drawing.Point(333, 45)
|
||||
Me.txtParameter.Name = "txtParameter"
|
||||
Me.txtParameter.Size = New System.Drawing.Size(150, 20)
|
||||
Me.txtParameter.TabIndex = 16
|
||||
'
|
||||
'frmGameManager
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
@@ -941,4 +961,6 @@ Partial Class frmGameManager
|
||||
Friend WithEvents cmsDeleteOne As ToolStripMenuItem
|
||||
Friend WithEvents cmsDeleteAll As ToolStripMenuItem
|
||||
Friend WithEvents chkCleanFolder As CheckBox
|
||||
Friend WithEvents txtParameter As TextBox
|
||||
Friend WithEvents lblParameter As Label
|
||||
End Class
|
||||
|
||||
@@ -737,6 +737,7 @@ Public Class frmGameManager
|
||||
txtID.Text = oApp.ID
|
||||
txtName.Text = oApp.Name
|
||||
txtProcess.Text = oApp.TrueProcess
|
||||
txtParameter.Text = oApp.Parameter
|
||||
txtSavePath.Text = oApp.Path
|
||||
txtFileType.Text = oApp.FileType
|
||||
txtExclude.Text = oApp.ExcludeList
|
||||
@@ -1126,6 +1127,7 @@ Public Class frmGameManager
|
||||
Else
|
||||
oApp.ProcessName = txtProcess.Text
|
||||
End If
|
||||
oApp.Parameter = txtParameter.Text
|
||||
oApp.Path = txtSavePath.Text
|
||||
'Only do a simple root check here in case the user doesn't really understand creating a proper configuration
|
||||
oApp.AbsolutePath = Path.IsPathRooted(txtSavePath.Text)
|
||||
@@ -1489,6 +1491,7 @@ Public Class frmGameManager
|
||||
btnProcessBrowse.Text = frmGameManager_btnProcessBrowse
|
||||
lblSavePath.Text = frmGameManager_lblSavePath
|
||||
lblProcess.Text = frmGameManager_lblProcess
|
||||
lblParameter.Text = frmGameManager_lblParameter
|
||||
lblName.Text = frmGameManager_lblName
|
||||
chkTimeStamp.Text = frmGameManager_chkTimeStamp
|
||||
chkFolderSave.Text = frmGameManager_chkFolderSave
|
||||
|
||||
Generated
+11
@@ -434,6 +434,9 @@ Partial Class frmMain
|
||||
'
|
||||
'lblGameTitle
|
||||
'
|
||||
Me.lblGameTitle.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.lblGameTitle.AutoEllipsis = True
|
||||
Me.lblGameTitle.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.lblGameTitle.Location = New System.Drawing.Point(66, 36)
|
||||
Me.lblGameTitle.Name = "lblGameTitle"
|
||||
@@ -443,6 +446,8 @@ Partial Class frmMain
|
||||
'
|
||||
'lblLastAction
|
||||
'
|
||||
Me.lblLastAction.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.lblLastAction.AutoEllipsis = True
|
||||
Me.lblLastAction.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
|
||||
Me.lblLastAction.Location = New System.Drawing.Point(12, 165)
|
||||
@@ -483,6 +488,8 @@ Partial Class frmMain
|
||||
'
|
||||
'lblStatus1
|
||||
'
|
||||
Me.lblStatus1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.lblStatus1.AutoEllipsis = True
|
||||
Me.lblStatus1.Location = New System.Drawing.Point(66, 58)
|
||||
Me.lblStatus1.Name = "lblStatus1"
|
||||
@@ -491,6 +498,8 @@ Partial Class frmMain
|
||||
'
|
||||
'lblStatus2
|
||||
'
|
||||
Me.lblStatus2.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.lblStatus2.AutoEllipsis = True
|
||||
Me.lblStatus2.Location = New System.Drawing.Point(66, 74)
|
||||
Me.lblStatus2.Name = "lblStatus2"
|
||||
@@ -499,6 +508,8 @@ Partial Class frmMain
|
||||
'
|
||||
'lblStatus3
|
||||
'
|
||||
Me.lblStatus3.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
|
||||
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
|
||||
Me.lblStatus3.AutoEllipsis = True
|
||||
Me.lblStatus3.Location = New System.Drawing.Point(66, 90)
|
||||
Me.lblStatus3.Name = "lblStatus3"
|
||||
|
||||
+15
-4
@@ -532,7 +532,7 @@ Public Class frmMain
|
||||
|
||||
Private Sub ResetGameInfo(Optional ByVal bKeepInfo As Boolean = False)
|
||||
If bKeepInfo And Not oProcess.GameInfo Is Nothing Then
|
||||
lblGameTitle.Text = mgrCommon.FormatString(frmMain_LastGame, oProcess.GameInfo.CroppedName)
|
||||
lblGameTitle.Text = mgrCommon.FormatString(frmMain_LastGame, oProcess.GameInfo.Name)
|
||||
pbIcon.Image = oPriorImage
|
||||
lblStatus1.Text = sPriorPath
|
||||
lblStatus2.Text = sPriorCompany
|
||||
@@ -597,7 +597,7 @@ Public Class frmMain
|
||||
Else
|
||||
bAllowIcon = True
|
||||
bAllowDetails = True
|
||||
lblGameTitle.Text = oProcess.GameInfo.CroppedName
|
||||
lblGameTitle.Text = oProcess.GameInfo.Name
|
||||
|
||||
Try
|
||||
Dim ic As Icon = System.Drawing.Icon.ExtractAssociatedIcon(oProcess.FoundProcess.MainModule.FileName)
|
||||
@@ -1448,6 +1448,17 @@ Public Class frmMain
|
||||
|
||||
End Function
|
||||
|
||||
Private Function CheckForParametersDuplicate() As Boolean
|
||||
For Each o As clsGame In oProcess.DuplicateList
|
||||
If o.Parameter <> String.Empty And oProcess.FullCommand.Contains(o.Parameter) Then
|
||||
oProcess.GameInfo = o
|
||||
oProcess.Duplicate = False
|
||||
Return True
|
||||
End If
|
||||
Next
|
||||
Return False
|
||||
End Function
|
||||
|
||||
Private Sub CheckForSavedDuplicate()
|
||||
For Each o As clsGame In oProcess.DuplicateList
|
||||
If o.ProcessPath.ToLower = oProcess.GameInfo.ProcessPath.ToLower Then
|
||||
@@ -1699,7 +1710,7 @@ Public Class frmMain
|
||||
End If
|
||||
|
||||
If bContinue = True Then
|
||||
CheckForSavedDuplicate()
|
||||
If Not CheckForParametersDuplicate() Then CheckForSavedDuplicate()
|
||||
If oProcess.Duplicate Then
|
||||
UpdateLog(frmMain_MultipleGamesDetected, oSettings.ShowDetectionToolTips)
|
||||
UpdateStatus(frmMain_MultipleGamesDetected)
|
||||
@@ -1831,7 +1842,7 @@ Public Class frmMain
|
||||
End Sub
|
||||
|
||||
'This event handler lets the user clear focus from the log by clicking anywhere on the form.
|
||||
'Due to txtLog being the only focusable control in most cases, it's impossible for it to lose focus unless force a focus change.
|
||||
'Due to txtLog being the only focusable control in most cases, it's impossible for it to lose focus unless a change is forced.
|
||||
Private Sub ClearLogFocus(sender As Object, e As EventArgs) Handles MyBase.Click, lblGameTitle.Click, lblStatus1.Click, lblStatus2.Click,
|
||||
lblStatus3.Click, pbTime.Click, lblTimeSpent.Click, lblLastActionTitle.Click, lblLastAction.Click, gMonMainMenu.Click, gMonStatusStrip.Click
|
||||
'Move focus to first label
|
||||
|
||||
@@ -106,6 +106,7 @@
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Windows.Forms" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Core" />
|
||||
|
||||
@@ -31,6 +31,7 @@ Public Class mgrMonitorList
|
||||
oGame.MonitorOnly = CBool(dr("MonitorOnly"))
|
||||
oGame.BackupLimit = CInt(dr("BackupLimit"))
|
||||
oGame.CleanFolder = CBool(dr("CleanFolder"))
|
||||
If Not IsDBNull(dr("Parameter")) Then oGame.Parameter = CStr(dr("Parameter"))
|
||||
|
||||
Return oGame
|
||||
End Function
|
||||
@@ -56,6 +57,7 @@ Public Class mgrMonitorList
|
||||
hshParams.Add("MonitorOnly", oGame.MonitorOnly)
|
||||
hshParams.Add("BackupLimit", oGame.BackupLimit)
|
||||
hshParams.Add("CleanFolder", oGame.CleanFolder)
|
||||
hshParams.Add("Parameter", oGame.Parameter)
|
||||
|
||||
Return hshParams
|
||||
End Function
|
||||
@@ -96,7 +98,7 @@ Public Class mgrMonitorList
|
||||
Dim hshParams As Hashtable
|
||||
|
||||
sSQL = "INSERT INTO monitorlist VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, @TimeStamp, "
|
||||
sSQL &= "@ExcludeList, @ProcessPath, @Icon, @Hours, @Version, @Company, @Enabled, @MonitorOnly, @BackupLimit, @CleanFolder)"
|
||||
sSQL &= "@ExcludeList, @ProcessPath, @Icon, @Hours, @Version, @Company, @Enabled, @MonitorOnly, @BackupLimit, @CleanFolder, @Parameter)"
|
||||
|
||||
'Parameters
|
||||
hshParams = SetCoreParameters(oGame)
|
||||
@@ -112,7 +114,7 @@ Public Class mgrMonitorList
|
||||
|
||||
sSQL = "UPDATE monitorlist SET Name=@Name, Process=@Process, Path=@Path, AbsolutePath=@AbsolutePath, FolderSave=@FolderSave, "
|
||||
sSQL &= "FileType=@FileType, TimeStamp=@TimeStamp, ExcludeList=@ExcludeList, ProcessPath=@ProcessPath, Icon=@Icon, "
|
||||
sSQL &= "Hours=@Hours, Version=@Version, Company=@Company, Enabled=@Enabled, MonitorOnly=@MonitorOnly, BackupLimit=@BackupLimit, CleanFolder=@CleanFolder WHERE MonitorID=@ID"
|
||||
sSQL &= "Hours=@Hours, Version=@Version, Company=@Company, Enabled=@Enabled, MonitorOnly=@MonitorOnly, BackupLimit=@BackupLimit, CleanFolder=@CleanFolder, Parameter=@Parameter WHERE MonitorID=@ID"
|
||||
|
||||
'Parameters
|
||||
hshParams = SetCoreParameters(oGame)
|
||||
@@ -317,11 +319,11 @@ Public Class mgrMonitorList
|
||||
sVersion = "(SELECT Version FROM monitorlist WHERE MonitorID=@ID)"
|
||||
End If
|
||||
|
||||
sSQL = "INSERT OR REPLACE INTO monitorlist (MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder) "
|
||||
sSQL = "INSERT OR REPLACE INTO monitorlist (MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter) "
|
||||
sSQL &= "VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, "
|
||||
sSQL &= sTimeStamp & ", @ExcludeList, " & sGamePath & ", "
|
||||
sSQL &= sIcon & ", @Hours, " & sVersion & ", "
|
||||
sSQL &= sCompany & ", " & sMonitorGame & ", @MonitorOnly, " & sBackupLimit & ",@CleanFolder);"
|
||||
sSQL &= sCompany & ", " & sMonitorGame & ", @MonitorOnly, " & sBackupLimit & ", @CleanFolder, @Parameter);"
|
||||
|
||||
For Each oGame As clsGame In hshGames.Values
|
||||
hshParams = New Hashtable
|
||||
@@ -338,6 +340,7 @@ Public Class mgrMonitorList
|
||||
hshParams.Add("Hours", oGame.Hours)
|
||||
hshParams.Add("MonitorOnly", oGame.MonitorOnly)
|
||||
hshParams.Add("CleanFolder", oGame.CleanFolder)
|
||||
hshParams.Add("Parameter", oGame.Parameter)
|
||||
|
||||
'Optional Parameters
|
||||
If (eSyncFields And clsGame.eOptionalSyncFields.Company) = clsGame.eOptionalSyncFields.Company Then
|
||||
@@ -474,9 +477,9 @@ Public Class mgrMonitorList
|
||||
|
||||
Select Case eFilterType
|
||||
Case frmFilter.eFilterType.NoFilter
|
||||
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder FROM monitorlist ORDER BY Name Asc"
|
||||
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter FROM monitorlist ORDER BY Name Asc"
|
||||
Case frmFilter.eFilterType.FieldAnd, frmFilter.eFilterType.FieldOr
|
||||
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder FROM monitorlist"
|
||||
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter FROM monitorlist"
|
||||
|
||||
If hshStringFilters.Count > 0 Then
|
||||
sSQL &= " WHERE ("
|
||||
@@ -498,7 +501,7 @@ Public Class mgrMonitorList
|
||||
End If
|
||||
sSQL &= " ORDER BY Name Asc"
|
||||
Case frmFilter.eFilterType.AnyTag
|
||||
sSQL = "SELECT DISTINCT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder FROM monitorlist "
|
||||
sSQL = "SELECT DISTINCT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter FROM monitorlist "
|
||||
sSQL &= "NATURAL JOIN gametags WHERE gametags.TagID IN ("
|
||||
|
||||
For Each oTag As clsTag In oTagFilters
|
||||
@@ -510,7 +513,7 @@ Public Class mgrMonitorList
|
||||
sSQL = sSQL.TrimEnd(",")
|
||||
sSQL &= ") ORDER BY Name Asc"
|
||||
Case frmFilter.eFilterType.AllTags
|
||||
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder FROM monitorlist WHERE MonitorID IN "
|
||||
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter FROM monitorlist WHERE MonitorID IN "
|
||||
|
||||
For Each oTag As clsTag In oTagFilters
|
||||
sSQL &= "(SELECT MonitorID FROM gametags WHERE monitorlist.MonitorID = gametags.MonitorID And TagID = @TagID" & iCounter & ")"
|
||||
@@ -523,7 +526,7 @@ Public Class mgrMonitorList
|
||||
|
||||
sSQL &= " ORDER BY Name Asc"
|
||||
Case frmFilter.eFilterType.NoTags
|
||||
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder FROM monitorlist WHERE MonitorID NOT IN (SELECT MonitorID FROM gametags) ORDER BY Name Asc"
|
||||
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter FROM monitorlist WHERE MonitorID NOT IN (SELECT MonitorID FROM gametags) ORDER BY Name Asc"
|
||||
End Select
|
||||
|
||||
Return sSQL
|
||||
@@ -577,6 +580,7 @@ Public Class mgrMonitorList
|
||||
oGame.FolderSave = CBool(dr("FolderSave"))
|
||||
If Not IsDBNull(dr("FileType")) Then oGame.FileType = CStr(dr("FileType"))
|
||||
If Not IsDBNull(dr("ExcludeList")) Then oGame.ExcludeList = CStr(dr("ExcludeList"))
|
||||
If Not IsDBNull(dr("Parameter")) Then oGame.Parameter = CStr(dr("Parameter"))
|
||||
oGame.Tags = mgrGameTags.GetTagsByGameForExport(sID)
|
||||
oList.Add(oGame)
|
||||
Next
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
Imports System.Diagnostics
|
||||
Imports System.IO
|
||||
Imports System.Threading
|
||||
Imports System.IO
|
||||
Imports System.Management
|
||||
|
||||
Public Class mgrProcesses
|
||||
|
||||
@@ -11,6 +10,7 @@ Public Class mgrProcesses
|
||||
Private oDuplicateGames As New ArrayList
|
||||
Private bDuplicates As Boolean
|
||||
Private bVerified As Boolean = False
|
||||
Private sFullCommand As String = String.Empty
|
||||
|
||||
Property FoundProcess As Process
|
||||
Get
|
||||
@@ -72,6 +72,15 @@ Public Class mgrProcesses
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property FullCommand As String
|
||||
Get
|
||||
Return sFullCommand
|
||||
End Get
|
||||
Set(value As String)
|
||||
sFullCommand = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Private Sub VerifyDuplicate(oGame As clsGame, hshScanList As Hashtable)
|
||||
Dim sProcess As String
|
||||
bDuplicates = True
|
||||
@@ -85,6 +94,30 @@ Public Class mgrProcesses
|
||||
Next
|
||||
End Sub
|
||||
|
||||
'This function will only work correctly on Windows
|
||||
Private Sub GetWindowsCommand(ByVal prs As Process)
|
||||
FullCommand = String.Empty
|
||||
Try
|
||||
Using searcher As New ManagementObjectSearcher("SELECT CommandLine FROM Win32_Process WHERE ProcessId = " + prs.Id.ToString)
|
||||
For Each o As ManagementObject In searcher.Get()
|
||||
FullCommand &= o("CommandLine") & " "
|
||||
Next
|
||||
End Using
|
||||
Catch ex As Exception
|
||||
'Do Nothing
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'This function will only work correctly on Unix
|
||||
Private Sub GetUnixCommand(ByVal prs As Process)
|
||||
FullCommand = String.Empty
|
||||
Try
|
||||
FullCommand = File.ReadAllText("/proc/" & prs.Id.ToString() & "/cmdline").Replace(vbNullChar, " ")
|
||||
Catch ex As Exception
|
||||
'Do Nothing
|
||||
End Try
|
||||
End Sub
|
||||
|
||||
'This function will only work correctly on Unix
|
||||
Private Function GetUnixProcessArguments(ByVal prs As Process) As String()
|
||||
Dim sArguments As String
|
||||
@@ -153,6 +186,12 @@ Public Class mgrProcesses
|
||||
prsFoundProcess = prsCurrent
|
||||
oGame = DirectCast(hshScanList.Item(sProcessCheck), clsGame).ShallowCopy
|
||||
|
||||
If mgrCommon.IsUnix Then
|
||||
GetUnixCommand(prsCurrent)
|
||||
Else
|
||||
GetWindowsCommand(prsCurrent)
|
||||
End If
|
||||
|
||||
If oGame.Duplicate = True Then
|
||||
VerifyDuplicate(oGame, hshScanList)
|
||||
Else
|
||||
@@ -160,6 +199,10 @@ Public Class mgrProcesses
|
||||
oDuplicateGames.Clear()
|
||||
End If
|
||||
|
||||
If oGame.Parameter <> String.Empty And Not oGame.Duplicate And Not FullCommand.Contains(oGame.Parameter) Then
|
||||
Return False
|
||||
End If
|
||||
|
||||
If Not oGame.AbsolutePath Or oGame.Duplicate Then
|
||||
Try
|
||||
If Not bWineProcess Then
|
||||
|
||||
@@ -83,7 +83,7 @@ Public Class mgrSQLite
|
||||
sSql &= "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " &
|
||||
"AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " &
|
||||
"ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " &
|
||||
"BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, PRIMARY KEY(Name, Process));"
|
||||
"BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, Parameter TEXT, PRIMARY KEY(Name, Process));"
|
||||
|
||||
'Add Tables (Tags)
|
||||
sSql &= "CREATE TABLE tags (TagID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY); "
|
||||
@@ -120,7 +120,7 @@ Public Class mgrSQLite
|
||||
sSql = "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " &
|
||||
"AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " &
|
||||
"ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " &
|
||||
"BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, PRIMARY KEY(Name, Process));"
|
||||
"BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, Parameter TEXT, PRIMARY KEY(Name, Process));"
|
||||
|
||||
'Add Tables (Remote Manifest)
|
||||
sSql &= "CREATE TABLE manifest (ManifestID TEXT NOT NULL PRIMARY KEY, Name TEXT NOT NULL, FileName TEXT NOT NULL, RestorePath TEXT NOT NULL, " &
|
||||
@@ -650,6 +650,10 @@ Public Class mgrSQLite
|
||||
|
||||
'Add Table (SavedPath)
|
||||
sSQL = "CREATE TABLE savedpath (PathName TEXT NOT NULL PRIMARY KEY, Path TEXT NOT NULL);"
|
||||
|
||||
'Add new field(s)
|
||||
sSQL &= "ALTER TABLE monitorlist ADD COLUMN Parameter TEXT;"
|
||||
|
||||
sSQL &= "PRAGMA user_version=102"
|
||||
|
||||
RunParamQuery(sSQL, New Hashtable)
|
||||
@@ -658,7 +662,10 @@ Public Class mgrSQLite
|
||||
'Backup DB before starting
|
||||
BackupDB("v101")
|
||||
|
||||
sSQL = "PRAGMA user_version=102"
|
||||
'Add new field(s)
|
||||
sSQL = "ALTER TABLE monitorlist ADD COLUMN Parameter TEXT;"
|
||||
|
||||
sSQL &= "PRAGMA user_version=102"
|
||||
|
||||
RunParamQuery(sSQL, New Hashtable)
|
||||
End If
|
||||
|
||||
@@ -28,6 +28,7 @@ Public Class mgrXML
|
||||
oGame.FolderSave = g.FolderSave
|
||||
oGame.FileType = g.FileType
|
||||
oGame.ExcludeList = g.ExcludeList
|
||||
oGame.Parameter = g.Parameter
|
||||
For Each t As Tag In g.Tags
|
||||
oGame.ImportTags.Add(t)
|
||||
Next
|
||||
|
||||
Generated
+9
@@ -1842,6 +1842,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Parameter:.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmGameManager_lblParameter() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmGameManager_lblParameter", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Process:.
|
||||
'''</summary>
|
||||
|
||||
@@ -1783,4 +1783,7 @@
|
||||
<data name="mgrCommon_TB" xml:space="preserve">
|
||||
<value>[PARAM] TB</value>
|
||||
</data>
|
||||
<data name="frmGameManager_lblParameter" xml:space="preserve">
|
||||
<value>Parameter:</value>
|
||||
</data>
|
||||
</root>
|
||||
Reference in New Issue
Block a user