Merge pull request #88 from MikeMaximus/v102

Merge v102 into master
This commit is contained in:
MikeMaximus
2017-06-23 16:19:05 -06:00
committed by GitHub
17 changed files with 275 additions and 115 deletions
+10
View File
@@ -1,6 +1,7 @@
Public Class Game Public Class Game
Private sGameName As String Private sGameName As String
Private sProcessName As String Private sProcessName As String
Private sParameter As String
Private sPath As String Private sPath As String
Private bAbsolutePath As Boolean Private bAbsolutePath As Boolean
Private bFolderSave As Boolean Private bFolderSave As Boolean
@@ -26,6 +27,15 @@
End Get End Get
End Property 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 Property Path As String
Set(value As String) Set(value As String)
sPath = value sPath = value
+13
View File
@@ -2,6 +2,7 @@
Private sGameID As String = Guid.NewGuid.ToString Private sGameID As String = Guid.NewGuid.ToString
Private sGameName As String = String.Empty Private sGameName As String = String.Empty
Private sProcessName As String = String.Empty Private sProcessName As String = String.Empty
Private sParameter As String = String.Empty
Private sPath As String = String.Empty Private sPath As String = String.Empty
Private bAbsolutePath As Boolean = False Private bAbsolutePath As Boolean = False
Private bFolderSave As Boolean = False Private bFolderSave As Boolean = False
@@ -74,6 +75,15 @@
End Get End Get
End Property 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 Property Path As String
Set(value As String) Set(value As String)
sPath = mgrPath.ReverseSpecialPaths(value) sPath = mgrPath.ReverseSpecialPaths(value)
@@ -263,6 +273,9 @@
If ProcessName <> oGame.ProcessName Then If ProcessName <> oGame.ProcessName Then
Return False Return False
End If End If
If Parameter <> oGame.Parameter Then
Return False
End If
If Path <> oGame.Path Then If Path <> oGame.Path Then
Return False Return False
End If End If
+4 -2
View File
@@ -30,8 +30,10 @@ Public Class frmChooseGame
lstGameBox.DisplayMember = "Value" lstGameBox.DisplayMember = "Value"
For Each o As clsGame In Process.DuplicateList For Each o As clsGame In Process.DuplicateList
lstGameBox.Items.Add(New KeyValuePair(Of String, String)(o.ID, o.Name)) If o.Parameter = String.Empty Then
oGamesHash.Add(o.ID, o) lstGameBox.Items.Add(New KeyValuePair(Of String, String)(o.ID, o.Name))
oGamesHash.Add(o.ID, o)
End If
Next Next
lstGameBox.SelectedIndex = 0 lstGameBox.SelectedIndex = 0
+33 -11
View File
@@ -28,6 +28,8 @@ Partial Class frmGameManager
Me.btnBackup = New System.Windows.Forms.Button() Me.btnBackup = New System.Windows.Forms.Button()
Me.btnClose = New System.Windows.Forms.Button() Me.btnClose = New System.Windows.Forms.Button()
Me.grpConfig = New System.Windows.Forms.GroupBox() Me.grpConfig = New System.Windows.Forms.GroupBox()
Me.txtParameter = New System.Windows.Forms.TextBox()
Me.lblParameter = New System.Windows.Forms.Label()
Me.chkCleanFolder = New System.Windows.Forms.CheckBox() Me.chkCleanFolder = New System.Windows.Forms.CheckBox()
Me.lblLimit = New System.Windows.Forms.Label() Me.lblLimit = New System.Windows.Forms.Label()
Me.nudLimit = New System.Windows.Forms.NumericUpDown() Me.nudLimit = New System.Windows.Forms.NumericUpDown()
@@ -152,6 +154,8 @@ Partial Class frmGameManager
'grpConfig 'grpConfig
' '
Me.grpConfig.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) 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.chkCleanFolder)
Me.grpConfig.Controls.Add(Me.lblLimit) Me.grpConfig.Controls.Add(Me.lblLimit)
Me.grpConfig.Controls.Add(Me.nudLimit) Me.grpConfig.Controls.Add(Me.nudLimit)
@@ -178,13 +182,29 @@ Partial Class frmGameManager
Me.grpConfig.TabStop = False Me.grpConfig.TabStop = False
Me.grpConfig.Text = "Configuration" Me.grpConfig.Text = "Configuration"
' '
'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 = 7
'
'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 = 6
Me.lblParameter.Text = "Parameter:"
'
'chkCleanFolder 'chkCleanFolder
' '
Me.chkCleanFolder.AutoSize = True Me.chkCleanFolder.AutoSize = True
Me.chkCleanFolder.Location = New System.Drawing.Point(329, 101) Me.chkCleanFolder.Location = New System.Drawing.Point(329, 101)
Me.chkCleanFolder.Name = "chkCleanFolder" Me.chkCleanFolder.Name = "chkCleanFolder"
Me.chkCleanFolder.Size = New System.Drawing.Size(136, 17) Me.chkCleanFolder.Size = New System.Drawing.Size(136, 17)
Me.chkCleanFolder.TabIndex = 11 Me.chkCleanFolder.TabIndex = 13
Me.chkCleanFolder.Text = "Delete folder on restore" Me.chkCleanFolder.Text = "Delete folder on restore"
Me.chkCleanFolder.UseVisualStyleBackColor = True Me.chkCleanFolder.UseVisualStyleBackColor = True
' '
@@ -194,7 +214,7 @@ Partial Class frmGameManager
Me.lblLimit.Location = New System.Drawing.Point(375, 130) Me.lblLimit.Location = New System.Drawing.Point(375, 130)
Me.lblLimit.Name = "lblLimit" Me.lblLimit.Name = "lblLimit"
Me.lblLimit.Size = New System.Drawing.Size(68, 13) Me.lblLimit.Size = New System.Drawing.Size(68, 13)
Me.lblLimit.TabIndex = 14 Me.lblLimit.TabIndex = 16
Me.lblLimit.Text = "Backup Limit" Me.lblLimit.Text = "Backup Limit"
Me.lblLimit.Visible = False Me.lblLimit.Visible = False
' '
@@ -204,7 +224,7 @@ Partial Class frmGameManager
Me.nudLimit.Minimum = New Decimal(New Integer() {2, 0, 0, 0}) Me.nudLimit.Minimum = New Decimal(New Integer() {2, 0, 0, 0})
Me.nudLimit.Name = "nudLimit" Me.nudLimit.Name = "nudLimit"
Me.nudLimit.Size = New System.Drawing.Size(40, 20) Me.nudLimit.Size = New System.Drawing.Size(40, 20)
Me.nudLimit.TabIndex = 13 Me.nudLimit.TabIndex = 15
Me.nudLimit.Value = New Decimal(New Integer() {2, 0, 0, 0}) Me.nudLimit.Value = New Decimal(New Integer() {2, 0, 0, 0})
Me.nudLimit.Visible = False Me.nudLimit.Visible = False
' '
@@ -213,7 +233,7 @@ Partial Class frmGameManager
Me.btnExclude.Location = New System.Drawing.Point(9, 125) Me.btnExclude.Location = New System.Drawing.Point(9, 125)
Me.btnExclude.Name = "btnExclude" Me.btnExclude.Name = "btnExclude"
Me.btnExclude.Size = New System.Drawing.Size(175, 23) Me.btnExclude.Size = New System.Drawing.Size(175, 23)
Me.btnExclude.TabIndex = 9 Me.btnExclude.TabIndex = 11
Me.btnExclude.Text = "E&xclude Items..." Me.btnExclude.Text = "E&xclude Items..."
Me.btnExclude.UseVisualStyleBackColor = True Me.btnExclude.UseVisualStyleBackColor = True
' '
@@ -222,7 +242,7 @@ Partial Class frmGameManager
Me.btnInclude.Location = New System.Drawing.Point(9, 97) Me.btnInclude.Location = New System.Drawing.Point(9, 97)
Me.btnInclude.Name = "btnInclude" Me.btnInclude.Name = "btnInclude"
Me.btnInclude.Size = New System.Drawing.Size(175, 23) Me.btnInclude.Size = New System.Drawing.Size(175, 23)
Me.btnInclude.TabIndex = 8 Me.btnInclude.TabIndex = 10
Me.btnInclude.Text = "In&clude Items..." Me.btnInclude.Text = "In&clude Items..."
Me.btnInclude.UseVisualStyleBackColor = True Me.btnInclude.UseVisualStyleBackColor = True
' '
@@ -241,13 +261,13 @@ Partial Class frmGameManager
Me.btnSavePathBrowse.Location = New System.Drawing.Point(489, 71) Me.btnSavePathBrowse.Location = New System.Drawing.Point(489, 71)
Me.btnSavePathBrowse.Name = "btnSavePathBrowse" Me.btnSavePathBrowse.Name = "btnSavePathBrowse"
Me.btnSavePathBrowse.Size = New System.Drawing.Size(30, 20) Me.btnSavePathBrowse.Size = New System.Drawing.Size(30, 20)
Me.btnSavePathBrowse.TabIndex = 7 Me.btnSavePathBrowse.TabIndex = 9
Me.btnSavePathBrowse.Text = "..." Me.btnSavePathBrowse.Text = "..."
Me.btnSavePathBrowse.UseVisualStyleBackColor = True Me.btnSavePathBrowse.UseVisualStyleBackColor = True
' '
'btnProcessBrowse '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.Name = "btnProcessBrowse"
Me.btnProcessBrowse.Size = New System.Drawing.Size(30, 20) Me.btnProcessBrowse.Size = New System.Drawing.Size(30, 20)
Me.btnProcessBrowse.TabIndex = 5 Me.btnProcessBrowse.TabIndex = 5
@@ -305,7 +325,7 @@ Partial Class frmGameManager
Me.chkTimeStamp.Location = New System.Drawing.Point(190, 129) Me.chkTimeStamp.Location = New System.Drawing.Point(190, 129)
Me.chkTimeStamp.Name = "chkTimeStamp" Me.chkTimeStamp.Name = "chkTimeStamp"
Me.chkTimeStamp.Size = New System.Drawing.Size(133, 17) Me.chkTimeStamp.Size = New System.Drawing.Size(133, 17)
Me.chkTimeStamp.TabIndex = 12 Me.chkTimeStamp.TabIndex = 14
Me.chkTimeStamp.Text = "Save multiple backups" Me.chkTimeStamp.Text = "Save multiple backups"
Me.chkTimeStamp.UseVisualStyleBackColor = True Me.chkTimeStamp.UseVisualStyleBackColor = True
' '
@@ -315,7 +335,7 @@ Partial Class frmGameManager
Me.chkFolderSave.Location = New System.Drawing.Point(190, 101) Me.chkFolderSave.Location = New System.Drawing.Point(190, 101)
Me.chkFolderSave.Name = "chkFolderSave" Me.chkFolderSave.Name = "chkFolderSave"
Me.chkFolderSave.Size = New System.Drawing.Size(109, 17) Me.chkFolderSave.Size = New System.Drawing.Size(109, 17)
Me.chkFolderSave.TabIndex = 10 Me.chkFolderSave.TabIndex = 12
Me.chkFolderSave.Text = "Save entire folder" Me.chkFolderSave.Text = "Save entire folder"
Me.chkFolderSave.UseVisualStyleBackColor = True Me.chkFolderSave.UseVisualStyleBackColor = True
' '
@@ -324,13 +344,13 @@ Partial Class frmGameManager
Me.txtSavePath.Location = New System.Drawing.Point(69, 71) Me.txtSavePath.Location = New System.Drawing.Point(69, 71)
Me.txtSavePath.Name = "txtSavePath" Me.txtSavePath.Name = "txtSavePath"
Me.txtSavePath.Size = New System.Drawing.Size(414, 20) Me.txtSavePath.Size = New System.Drawing.Size(414, 20)
Me.txtSavePath.TabIndex = 6 Me.txtSavePath.TabIndex = 8
' '
'txtProcess 'txtProcess
' '
Me.txtProcess.Location = New System.Drawing.Point(69, 45) Me.txtProcess.Location = New System.Drawing.Point(69, 45)
Me.txtProcess.Name = "txtProcess" 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 Me.txtProcess.TabIndex = 4
' '
'txtName 'txtName
@@ -941,4 +961,6 @@ Partial Class frmGameManager
Friend WithEvents cmsDeleteOne As ToolStripMenuItem Friend WithEvents cmsDeleteOne As ToolStripMenuItem
Friend WithEvents cmsDeleteAll As ToolStripMenuItem Friend WithEvents cmsDeleteAll As ToolStripMenuItem
Friend WithEvents chkCleanFolder As CheckBox Friend WithEvents chkCleanFolder As CheckBox
Friend WithEvents txtParameter As TextBox
Friend WithEvents lblParameter As Label
End Class End Class
+10
View File
@@ -737,6 +737,7 @@ Public Class frmGameManager
txtID.Text = oApp.ID txtID.Text = oApp.ID
txtName.Text = oApp.Name txtName.Text = oApp.Name
txtProcess.Text = oApp.TrueProcess txtProcess.Text = oApp.TrueProcess
txtParameter.Text = oApp.Parameter
txtSavePath.Text = oApp.Path txtSavePath.Text = oApp.Path
txtFileType.Text = oApp.FileType txtFileType.Text = oApp.FileType
txtExclude.Text = oApp.ExcludeList txtExclude.Text = oApp.ExcludeList
@@ -1126,6 +1127,7 @@ Public Class frmGameManager
Else Else
oApp.ProcessName = txtProcess.Text oApp.ProcessName = txtProcess.Text
End If End If
oApp.Parameter = txtParameter.Text
oApp.Path = txtSavePath.Text oApp.Path = txtSavePath.Text
'Only do a simple root check here in case the user doesn't really understand creating a proper configuration '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) oApp.AbsolutePath = Path.IsPathRooted(txtSavePath.Text)
@@ -1257,6 +1259,13 @@ Public Class frmGameManager
Return False Return False
End If End If
If oApp.Parameter <> String.Empty Then
If mgrMonitorList.DoDuplicateParameterCheck(oApp.ProcessName, oApp.Parameter, , oApp.ID) Then
mgrCommon.ShowMessage(frmGameManager_ErrorProcessParameterDupe, MsgBoxStyle.Exclamation)
Return False
End If
End If
Return True Return True
End Function End Function
@@ -1489,6 +1498,7 @@ Public Class frmGameManager
btnProcessBrowse.Text = frmGameManager_btnProcessBrowse btnProcessBrowse.Text = frmGameManager_btnProcessBrowse
lblSavePath.Text = frmGameManager_lblSavePath lblSavePath.Text = frmGameManager_lblSavePath
lblProcess.Text = frmGameManager_lblProcess lblProcess.Text = frmGameManager_lblProcess
lblParameter.Text = frmGameManager_lblParameter
lblName.Text = frmGameManager_lblName lblName.Text = frmGameManager_lblName
chkTimeStamp.Text = frmGameManager_chkTimeStamp chkTimeStamp.Text = frmGameManager_chkTimeStamp
chkFolderSave.Text = frmGameManager_chkFolderSave chkFolderSave.Text = frmGameManager_chkFolderSave
+16 -16
View File
@@ -75,7 +75,6 @@ Partial Class frmMain
Me.gMonHelpAbout = New System.Windows.Forms.ToolStripMenuItem() Me.gMonHelpAbout = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonNotification = New System.Windows.Forms.ToolStripMenuItem() Me.gMonNotification = New System.Windows.Forms.ToolStripMenuItem()
Me.pbIcon = New System.Windows.Forms.PictureBox() Me.pbIcon = New System.Windows.Forms.PictureBox()
Me.btnLogToggle = New System.Windows.Forms.Button()
Me.lblGameTitle = New System.Windows.Forms.Label() Me.lblGameTitle = New System.Windows.Forms.Label()
Me.lblLastAction = New System.Windows.Forms.Label() Me.lblLastAction = New System.Windows.Forms.Label()
Me.lblLastActionTitle = New System.Windows.Forms.Label() Me.lblLastActionTitle = New System.Windows.Forms.Label()
@@ -222,6 +221,9 @@ Partial Class frmMain
' '
'txtLog 'txtLog
' '
Me.txtLog.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtLog.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtLog.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtLog.Location = New System.Drawing.Point(12, 184) Me.txtLog.Location = New System.Drawing.Point(12, 184)
Me.txtLog.MaxLength = 524288 Me.txtLog.MaxLength = 524288
@@ -430,17 +432,11 @@ Partial Class frmMain
Me.pbIcon.TabIndex = 9 Me.pbIcon.TabIndex = 9
Me.pbIcon.TabStop = False Me.pbIcon.TabStop = False
' '
'btnLogToggle
'
Me.btnLogToggle.Location = New System.Drawing.Point(437, 155)
Me.btnLogToggle.Name = "btnLogToggle"
Me.btnLogToggle.Size = New System.Drawing.Size(75, 23)
Me.btnLogToggle.TabIndex = 7
Me.btnLogToggle.Text = "Show &Log"
Me.btnLogToggle.UseVisualStyleBackColor = True
'
'lblGameTitle '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.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.Location = New System.Drawing.Point(66, 36)
Me.lblGameTitle.Name = "lblGameTitle" Me.lblGameTitle.Name = "lblGameTitle"
@@ -450,6 +446,8 @@ Partial Class frmMain
' '
'lblLastAction '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.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.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) Me.lblLastAction.Location = New System.Drawing.Point(12, 165)
@@ -480,7 +478,8 @@ Partial Class frmMain
' '
'btnCancelOperation 'btnCancelOperation
' '
Me.btnCancelOperation.Location = New System.Drawing.Point(437, 126) Me.btnCancelOperation.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnCancelOperation.Location = New System.Drawing.Point(437, 155)
Me.btnCancelOperation.Name = "btnCancelOperation" Me.btnCancelOperation.Name = "btnCancelOperation"
Me.btnCancelOperation.Size = New System.Drawing.Size(75, 23) Me.btnCancelOperation.Size = New System.Drawing.Size(75, 23)
Me.btnCancelOperation.TabIndex = 6 Me.btnCancelOperation.TabIndex = 6
@@ -489,6 +488,8 @@ Partial Class frmMain
' '
'lblStatus1 '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.AutoEllipsis = True
Me.lblStatus1.Location = New System.Drawing.Point(66, 58) Me.lblStatus1.Location = New System.Drawing.Point(66, 58)
Me.lblStatus1.Name = "lblStatus1" Me.lblStatus1.Name = "lblStatus1"
@@ -497,6 +498,8 @@ Partial Class frmMain
' '
'lblStatus2 '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.AutoEllipsis = True
Me.lblStatus2.Location = New System.Drawing.Point(66, 74) Me.lblStatus2.Location = New System.Drawing.Point(66, 74)
Me.lblStatus2.Name = "lblStatus2" Me.lblStatus2.Name = "lblStatus2"
@@ -505,6 +508,8 @@ Partial Class frmMain
' '
'lblStatus3 '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.AutoEllipsis = True
Me.lblStatus3.Location = New System.Drawing.Point(66, 90) Me.lblStatus3.Location = New System.Drawing.Point(66, 90)
Me.lblStatus3.Name = "lblStatus3" Me.lblStatus3.Name = "lblStatus3"
@@ -523,7 +528,6 @@ Partial Class frmMain
' '
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.AutoSize = True
Me.ClientSize = New System.Drawing.Size(524, 401) Me.ClientSize = New System.Drawing.Size(524, 401)
Me.Controls.Add(Me.pbTime) Me.Controls.Add(Me.pbTime)
Me.Controls.Add(Me.lblStatus3) Me.Controls.Add(Me.lblStatus3)
@@ -534,16 +538,13 @@ Partial Class frmMain
Me.Controls.Add(Me.lblLastActionTitle) Me.Controls.Add(Me.lblLastActionTitle)
Me.Controls.Add(Me.lblLastAction) Me.Controls.Add(Me.lblLastAction)
Me.Controls.Add(Me.lblGameTitle) Me.Controls.Add(Me.lblGameTitle)
Me.Controls.Add(Me.btnLogToggle)
Me.Controls.Add(Me.pbIcon) Me.Controls.Add(Me.pbIcon)
Me.Controls.Add(Me.gMonStatusStrip) Me.Controls.Add(Me.gMonStatusStrip)
Me.Controls.Add(Me.gMonMainMenu) Me.Controls.Add(Me.gMonMainMenu)
Me.Controls.Add(Me.txtLog) Me.Controls.Add(Me.txtLog)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.KeyPreview = True Me.KeyPreview = True
Me.MainMenuStrip = Me.gMonMainMenu Me.MainMenuStrip = Me.gMonMainMenu
Me.MaximizeBox = False
Me.MinimizeBox = False Me.MinimizeBox = False
Me.Name = "frmMain" Me.Name = "frmMain"
Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide
@@ -586,7 +587,6 @@ Partial Class frmMain
Friend WithEvents gMonTraySetupGameManager As System.Windows.Forms.ToolStripMenuItem Friend WithEvents gMonTraySetupGameManager As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents gMonTraySetupCustomVariables As System.Windows.Forms.ToolStripMenuItem Friend WithEvents gMonTraySetupCustomVariables As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents pbIcon As System.Windows.Forms.PictureBox Friend WithEvents pbIcon As System.Windows.Forms.PictureBox
Friend WithEvents btnLogToggle As System.Windows.Forms.Button
Friend WithEvents lblGameTitle As System.Windows.Forms.Label Friend WithEvents lblGameTitle As System.Windows.Forms.Label
Friend WithEvents lblLastAction As System.Windows.Forms.Label Friend WithEvents lblLastAction As System.Windows.Forms.Label
Friend WithEvents lblLastActionTitle As System.Windows.Forms.Label Friend WithEvents lblLastActionTitle As System.Windows.Forms.Label
+40 -49
View File
@@ -39,8 +39,6 @@ Public Class frmMain
Private sPriorPath As String Private sPriorPath As String
Private sPriorCompany As String Private sPriorCompany As String
Private sPriorVersion As String Private sPriorVersion As String
Private iFormHeight As Integer
Private iLogSpacer As Integer
Private iRestoreTimeOut As Integer Private iRestoreTimeOut As Integer
'Developer Debug Flags 'Developer Debug Flags
@@ -477,8 +475,8 @@ Public Class frmMain
End If End If
RunRestore(hshRestore) RunRestore(hshRestore)
End If
End If End If
End If
'Shutdown if we are finished 'Shutdown if we are finished
If bFinished Then If bFinished Then
@@ -534,7 +532,7 @@ Public Class frmMain
Private Sub ResetGameInfo(Optional ByVal bKeepInfo As Boolean = False) Private Sub ResetGameInfo(Optional ByVal bKeepInfo As Boolean = False)
If bKeepInfo And Not oProcess.GameInfo Is Nothing Then 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 pbIcon.Image = oPriorImage
lblStatus1.Text = sPriorPath lblStatus1.Text = sPriorPath
lblStatus2.Text = sPriorCompany lblStatus2.Text = sPriorCompany
@@ -599,7 +597,7 @@ Public Class frmMain
Else Else
bAllowIcon = True bAllowIcon = True
bAllowDetails = True bAllowDetails = True
lblGameTitle.Text = oProcess.GameInfo.CroppedName lblGameTitle.Text = oProcess.GameInfo.Name
Try Try
Dim ic As Icon = System.Drawing.Icon.ExtractAssociatedIcon(oProcess.FoundProcess.MainModule.FileName) Dim ic As Icon = System.Drawing.Icon.ExtractAssociatedIcon(oProcess.FoundProcess.MainModule.FileName)
@@ -817,9 +815,11 @@ Public Class frmMain
Dim sVersion As String = My.Application.Info.Version.Major & "." & My.Application.Info.Version.Minor & "." & My.Application.Info.Version.Build Dim sVersion As String = My.Application.Info.Version.Major & "." & My.Application.Info.Version.Minor & "." & My.Application.Info.Version.Build
Dim sProcessType = [Enum].GetName(GetType(System.Reflection.ProcessorArchitecture), iProcessType) Dim sProcessType = [Enum].GetName(GetType(System.Reflection.ProcessorArchitecture), iProcessType)
Dim sRevision As String = My.Application.Info.Version.Revision Dim sRevision As String = My.Application.Info.Version.Revision
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSqliteVersion As String = oDatabase.ReportVersion
Dim sConstCopyright As String = Chr(169) & mgrCommon.FormatString(App_Copyright, Now.Year.ToString) Dim sConstCopyright As String = Chr(169) & mgrCommon.FormatString(App_Copyright, Now.Year.ToString)
mgrCommon.ShowMessage(frmMain_About, New String() {sVersion, sProcessType, sRevision, sConstCopyright}, MsgBoxStyle.Information) mgrCommon.ShowMessage(frmMain_About, New String() {sVersion, sProcessType, sRevision, sSqliteVersion, sConstCopyright}, MsgBoxStyle.Information)
End Sub End Sub
Private Sub OpenTags() Private Sub OpenTags()
@@ -1027,22 +1027,6 @@ Public Class frmMain
End Sub End Sub
'Functions that handle buttons, menus and other GUI features on this form 'Functions that handle buttons, menus and other GUI features on this form
Private Sub ToggleLog()
If bLogToggle = False Then
txtLog.Visible = True
Me.Size = New System.Drawing.Size(Me.Size.Width, iFormHeight)
bLogToggle = True
btnLogToggle.Text = frmMain_btnToggleLog_Hide
txtLog.Select(txtLog.TextLength, 0)
txtLog.ScrollToCaret()
Else
txtLog.Visible = False
Me.Size = New System.Drawing.Size(Me.Size.Width, Me.Size.Height - (txtLog.Height + iLogSpacer))
bLogToggle = False
btnLogToggle.Text = frmMain_btnToggleLog_Show
End If
End Sub
Private Sub ToggleState() Private Sub ToggleState()
'Toggle State with Tray Clicks 'Toggle State with Tray Clicks
If Not bShowToggle Then If Not bShowToggle Then
@@ -1257,8 +1241,8 @@ Public Class frmMain
End Sub End Sub
Private Sub SetForm() Private Sub SetForm()
'Disable Autosize in Linux (Mono prevents manual resizing when this is enabled) 'Set Minimum Size
If mgrCommon.IsUnix Then Me.AutoSize = False Me.MinimumSize = New Size(Me.Size.Width, Me.Size.Height - txtLog.Size.Height)
'Set Form Name 'Set Form Name
Me.Name = App_NameLong Me.Name = App_NameLong
@@ -1317,14 +1301,10 @@ Public Class frmMain
gMonStripAdminButton.ToolTipText = frmMain_RunningAsNormal gMonStripAdminButton.ToolTipText = frmMain_RunningAsNormal
End If End If
btnCancelOperation.Visible = False btnCancelOperation.Visible = False
txtLog.Visible = False
lblLastActionTitle.Visible = False lblLastActionTitle.Visible = False
lblLastAction.Text = String.Empty lblLastAction.Text = String.Empty
pbTime.SizeMode = PictureBoxSizeMode.AutoSize pbTime.SizeMode = PictureBoxSizeMode.AutoSize
pbTime.Image = Icon_Clock pbTime.Image = Icon_Clock
iFormHeight = Me.Size.Height
iLogSpacer = gMonStatusStrip.Location.Y - (txtLog.Location.Y + txtLog.Height)
Me.Size = New System.Drawing.Size(Me.Size.Width, Me.Size.Height - (txtLog.Height + iLogSpacer))
AddHandler mgrMonitorList.UpdateLog, AddressOf UpdateLog AddHandler mgrMonitorList.UpdateLog, AddressOf UpdateLog
ResetGameInfo() ResetGameInfo()
End Sub End Sub
@@ -1470,9 +1450,20 @@ Public Class frmMain
End Function 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() Private Sub CheckForSavedDuplicate()
For Each o As clsGame In oProcess.DuplicateList For Each o As clsGame In oProcess.DuplicateList
If o.ProcessPath.ToLower = oProcess.GameInfo.ProcessPath.ToLower Then If o.ProcessPath.ToLower = oProcess.GameInfo.ProcessPath.ToLower And o.Parameter = String.Empty Then
oProcess.GameInfo = o oProcess.GameInfo = o
oProcess.Duplicate = False oProcess.Duplicate = False
End If End If
@@ -1631,10 +1622,6 @@ Public Class frmMain
OpenGameManager(True) OpenGameManager(True)
End Sub End Sub
Private Sub btnLogToggle_Click(sender As Object, e As EventArgs) Handles btnLogToggle.Click
ToggleLog()
End Sub
Private Sub gMonStripSplitStatusButton_ButtonClick(sender As Object, e As EventArgs) Handles gMonStripStatusButton.Click Private Sub gMonStripSplitStatusButton_ButtonClick(sender As Object, e As EventArgs) Handles gMonStripStatusButton.Click
ScanToggle() ScanToggle()
End Sub End Sub
@@ -1725,20 +1712,20 @@ Public Class frmMain
End If End If
If bContinue = True Then If bContinue = True Then
CheckForSavedDuplicate() If Not CheckForParametersDuplicate() Then CheckForSavedDuplicate()
If oProcess.Duplicate Then If oProcess.Duplicate Then
UpdateLog(frmMain_MultipleGamesDetected, oSettings.ShowDetectionToolTips) UpdateLog(frmMain_MultipleGamesDetected, oSettings.ShowDetectionToolTips)
UpdateStatus(frmMain_MultipleGamesDetected) UpdateStatus(frmMain_MultipleGamesDetected)
SetGameInfo(True) SetGameInfo(True)
Else
UpdateLog(mgrCommon.FormatString(frmMain_GameDetected, oProcess.GameInfo.Name), oSettings.ShowDetectionToolTips)
UpdateStatus(mgrCommon.FormatString(frmMain_GameDetected, oProcess.GameInfo.CroppedName))
SetGameInfo()
End If
oProcess.StartTime = Now
bwMonitor.RunWorkerAsync()
Else Else
UpdateLog(mgrCommon.FormatString(frmMain_GameDetected, oProcess.GameInfo.Name), oSettings.ShowDetectionToolTips) StopScan()
UpdateStatus(mgrCommon.FormatString(frmMain_GameDetected, oProcess.GameInfo.CroppedName))
SetGameInfo()
End If
oProcess.StartTime = Now
bwMonitor.RunWorkerAsync()
Else
StopScan()
End If End If
End If End If
End Sub End Sub
@@ -1850,14 +1837,18 @@ Public Class frmMain
End If End If
End Sub End Sub
Private Sub txtGameInfo_Enter(sender As Object, e As EventArgs)
btnLogToggle.Focus()
End Sub
Private Sub frmMain_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown Private Sub frmMain_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Oemtilde AndAlso e.Modifiers = Keys.Control Then If e.KeyCode = Keys.Oemtilde AndAlso e.Modifiers = Keys.Control Then
OpenDevConsole() OpenDevConsole()
End If End If
End Sub 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 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
lblGameTitle.Focus()
End Sub
End Class End Class
+2 -1
View File
@@ -106,6 +106,7 @@
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@@ -346,6 +347,7 @@
<Content Include="Utilities\x86\7za.exe"> <Content Include="Utilities\x86\7za.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="x64\sqlite3.dll" />
<Content Include="x86\sqlite3.dll" /> <Content Include="x86\sqlite3.dll" />
<None Include="Resources\gbm.ico" /> <None Include="Resources\gbm.ico" />
<Content Include="Resources\Admin.png" /> <Content Include="Resources\Admin.png" />
@@ -358,7 +360,6 @@
<Content Include="Resources\Inbox.png" /> <Content Include="Resources\Inbox.png" />
<Content Include="Resources\type.ico" /> <Content Include="Resources\type.ico" />
<Content Include="Resources\User.png" /> <Content Include="Resources\User.png" />
<Content Include="x64\sqlite3.dll" />
<None Include="Resources\Stopped.png" /> <None Include="Resources\Stopped.png" />
<None Include="Resources\Detected.png" /> <None Include="Resources\Detected.png" />
<None Include="Resources\Ready.png" /> <None Include="Resources\Ready.png" />
+38 -9
View File
@@ -31,6 +31,7 @@ Public Class mgrMonitorList
oGame.MonitorOnly = CBool(dr("MonitorOnly")) oGame.MonitorOnly = CBool(dr("MonitorOnly"))
oGame.BackupLimit = CInt(dr("BackupLimit")) oGame.BackupLimit = CInt(dr("BackupLimit"))
oGame.CleanFolder = CBool(dr("CleanFolder")) oGame.CleanFolder = CBool(dr("CleanFolder"))
If Not IsDBNull(dr("Parameter")) Then oGame.Parameter = CStr(dr("Parameter"))
Return oGame Return oGame
End Function End Function
@@ -56,6 +57,7 @@ Public Class mgrMonitorList
hshParams.Add("MonitorOnly", oGame.MonitorOnly) hshParams.Add("MonitorOnly", oGame.MonitorOnly)
hshParams.Add("BackupLimit", oGame.BackupLimit) hshParams.Add("BackupLimit", oGame.BackupLimit)
hshParams.Add("CleanFolder", oGame.CleanFolder) hshParams.Add("CleanFolder", oGame.CleanFolder)
hshParams.Add("Parameter", oGame.Parameter)
Return hshParams Return hshParams
End Function End Function
@@ -96,7 +98,7 @@ Public Class mgrMonitorList
Dim hshParams As Hashtable Dim hshParams As Hashtable
sSQL = "INSERT INTO monitorlist VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, @TimeStamp, " 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 'Parameters
hshParams = SetCoreParameters(oGame) 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 = "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 &= "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 'Parameters
hshParams = SetCoreParameters(oGame) hshParams = SetCoreParameters(oGame)
@@ -266,6 +268,31 @@ Public Class mgrMonitorList
End If End If
End Function End Function
Public Shared Function DoDuplicateParameterCheck(ByVal sProcess As String, ByVal sParameter As String, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local, Optional ByVal sExcludeID As String = "") As Boolean
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim oData As DataSet
Dim hshParams As New Hashtable
sSQL = "SELECT * FROM monitorlist WHERE Process = @Process AND Parameter = @Parameter"
hshParams.Add("Process", sProcess)
hshParams.Add("Parameter", sParameter)
If sExcludeID <> String.Empty Then
sSQL &= " AND MonitorID <> @MonitorID"
hshParams.Add("MonitorID", sExcludeID)
End If
oData = oDatabase.ReadParamData(sSQL, hshParams)
If oData.Tables(0).Rows.Count > 0 Then
Return True
Else
Return False
End If
End Function
'Sync Functions 'Sync Functions
Public Shared Sub DoListAddUpdateSync(ByVal hshGames As Hashtable, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local, Public Shared Sub DoListAddUpdateSync(ByVal hshGames As Hashtable, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local,
Optional ByVal eSyncFields As clsGame.eOptionalSyncFields = clsGame.eOptionalSyncFields.None) Optional ByVal eSyncFields As clsGame.eOptionalSyncFields = clsGame.eOptionalSyncFields.None)
@@ -317,11 +344,11 @@ Public Class mgrMonitorList
sVersion = "(SELECT Version FROM monitorlist WHERE MonitorID=@ID)" sVersion = "(SELECT Version FROM monitorlist WHERE MonitorID=@ID)"
End If 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 &= "VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, "
sSQL &= sTimeStamp & ", @ExcludeList, " & sGamePath & ", " sSQL &= sTimeStamp & ", @ExcludeList, " & sGamePath & ", "
sSQL &= sIcon & ", @Hours, " & sVersion & ", " 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 For Each oGame As clsGame In hshGames.Values
hshParams = New Hashtable hshParams = New Hashtable
@@ -338,6 +365,7 @@ Public Class mgrMonitorList
hshParams.Add("Hours", oGame.Hours) hshParams.Add("Hours", oGame.Hours)
hshParams.Add("MonitorOnly", oGame.MonitorOnly) hshParams.Add("MonitorOnly", oGame.MonitorOnly)
hshParams.Add("CleanFolder", oGame.CleanFolder) hshParams.Add("CleanFolder", oGame.CleanFolder)
hshParams.Add("Parameter", oGame.Parameter)
'Optional Parameters 'Optional Parameters
If (eSyncFields And clsGame.eOptionalSyncFields.Company) = clsGame.eOptionalSyncFields.Company Then If (eSyncFields And clsGame.eOptionalSyncFields.Company) = clsGame.eOptionalSyncFields.Company Then
@@ -474,9 +502,9 @@ Public Class mgrMonitorList
Select Case eFilterType Select Case eFilterType
Case frmFilter.eFilterType.NoFilter 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 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 If hshStringFilters.Count > 0 Then
sSQL &= " WHERE (" sSQL &= " WHERE ("
@@ -498,7 +526,7 @@ Public Class mgrMonitorList
End If End If
sSQL &= " ORDER BY Name Asc" sSQL &= " ORDER BY Name Asc"
Case frmFilter.eFilterType.AnyTag 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 (" sSQL &= "NATURAL JOIN gametags WHERE gametags.TagID IN ("
For Each oTag As clsTag In oTagFilters For Each oTag As clsTag In oTagFilters
@@ -510,7 +538,7 @@ Public Class mgrMonitorList
sSQL = sSQL.TrimEnd(",") sSQL = sSQL.TrimEnd(",")
sSQL &= ") ORDER BY Name Asc" sSQL &= ") ORDER BY Name Asc"
Case frmFilter.eFilterType.AllTags 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 For Each oTag As clsTag In oTagFilters
sSQL &= "(SELECT MonitorID FROM gametags WHERE monitorlist.MonitorID = gametags.MonitorID And TagID = @TagID" & iCounter & ")" sSQL &= "(SELECT MonitorID FROM gametags WHERE monitorlist.MonitorID = gametags.MonitorID And TagID = @TagID" & iCounter & ")"
@@ -523,7 +551,7 @@ Public Class mgrMonitorList
sSQL &= " ORDER BY Name Asc" sSQL &= " ORDER BY Name Asc"
Case frmFilter.eFilterType.NoTags 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 End Select
Return sSQL Return sSQL
@@ -577,6 +605,7 @@ Public Class mgrMonitorList
oGame.FolderSave = CBool(dr("FolderSave")) oGame.FolderSave = CBool(dr("FolderSave"))
If Not IsDBNull(dr("FileType")) Then oGame.FileType = CStr(dr("FileType")) 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("ExcludeList")) Then oGame.ExcludeList = CStr(dr("ExcludeList"))
If Not IsDBNull(dr("Parameter")) Then oGame.Parameter = CStr(dr("Parameter"))
oGame.Tags = mgrGameTags.GetTagsByGameForExport(sID) oGame.Tags = mgrGameTags.GetTagsByGameForExport(sID)
oList.Add(oGame) oList.Add(oGame)
Next Next
+46 -3
View File
@@ -1,6 +1,5 @@
Imports System.Diagnostics Imports System.IO
Imports System.IO Imports System.Management
Imports System.Threading
Public Class mgrProcesses Public Class mgrProcesses
@@ -11,6 +10,7 @@ Public Class mgrProcesses
Private oDuplicateGames As New ArrayList Private oDuplicateGames As New ArrayList
Private bDuplicates As Boolean Private bDuplicates As Boolean
Private bVerified As Boolean = False Private bVerified As Boolean = False
Private sFullCommand As String = String.Empty
Property FoundProcess As Process Property FoundProcess As Process
Get Get
@@ -72,6 +72,15 @@ Public Class mgrProcesses
End Set End Set
End Property 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) Private Sub VerifyDuplicate(oGame As clsGame, hshScanList As Hashtable)
Dim sProcess As String Dim sProcess As String
bDuplicates = True bDuplicates = True
@@ -85,6 +94,30 @@ Public Class mgrProcesses
Next Next
End Sub 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 'This function will only work correctly on Unix
Private Function GetUnixProcessArguments(ByVal prs As Process) As String() Private Function GetUnixProcessArguments(ByVal prs As Process) As String()
Dim sArguments As String Dim sArguments As String
@@ -153,6 +186,12 @@ Public Class mgrProcesses
prsFoundProcess = prsCurrent prsFoundProcess = prsCurrent
oGame = DirectCast(hshScanList.Item(sProcessCheck), clsGame).ShallowCopy oGame = DirectCast(hshScanList.Item(sProcessCheck), clsGame).ShallowCopy
If mgrCommon.IsUnix Then
GetUnixCommand(prsCurrent)
Else
GetWindowsCommand(prsCurrent)
End If
If oGame.Duplicate = True Then If oGame.Duplicate = True Then
VerifyDuplicate(oGame, hshScanList) VerifyDuplicate(oGame, hshScanList)
Else Else
@@ -160,6 +199,10 @@ Public Class mgrProcesses
oDuplicateGames.Clear() oDuplicateGames.Clear()
End If 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 If Not oGame.AbsolutePath Or oGame.Duplicate Then
Try Try
If Not bWineProcess Then If Not bWineProcess Then
+14 -3
View File
@@ -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, " & 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, " & "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, " & "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) 'Add Tables (Tags)
sSql &= "CREATE TABLE tags (TagID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY); " 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, " & 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, " & "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, " & "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) '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, " & 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) 'Add Table (SavedPath)
sSQL = "CREATE TABLE savedpath (PathName TEXT NOT NULL PRIMARY KEY, Path TEXT NOT NULL);" 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" sSQL &= "PRAGMA user_version=102"
RunParamQuery(sSQL, New Hashtable) RunParamQuery(sSQL, New Hashtable)
@@ -658,7 +662,10 @@ Public Class mgrSQLite
'Backup DB before starting 'Backup DB before starting
BackupDB("v101") 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) RunParamQuery(sSQL, New Hashtable)
End If End If
@@ -671,6 +678,10 @@ Public Class mgrSQLite
Return Math.Round(oFileInfo.Length / 1024, 2) Return Math.Round(oFileInfo.Length / 1024, 2)
End Function End Function
Public Function ReportVersion() As String
Return SqliteConnection.SQLiteVersion
End Function
Public Sub CompactDatabase() Public Sub CompactDatabase()
Dim sSQL As String Dim sSQL As String
Dim command As SQLiteCommand Dim command As SQLiteCommand
+1
View File
@@ -28,6 +28,7 @@ Public Class mgrXML
oGame.FolderSave = g.FolderSave oGame.FolderSave = g.FolderSave
oGame.FileType = g.FileType oGame.FileType = g.FileType
oGame.ExcludeList = g.ExcludeList oGame.ExcludeList = g.ExcludeList
oGame.Parameter = g.Parameter
For Each t As Tag In g.Tags For Each t As Tag In g.Tags
oGame.ImportTags.Add(t) oGame.ImportTags.Add(t)
Next Next
+19 -1
View File
@@ -1635,6 +1635,15 @@ Namespace My.Resources
End Get End Get
End Property End Property
'''<summary>
''' Looks up a localized string similar to A game with this exact process and parameter already exists..
'''</summary>
Friend ReadOnly Property frmGameManager_ErrorProcessParameterDupe() As String
Get
Return ResourceManager.GetString("frmGameManager_ErrorProcessParameterDupe", resourceCulture)
End Get
End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to You must enter a valid game name.. ''' Looks up a localized string similar to You must enter a valid game name..
'''</summary> '''</summary>
@@ -1842,6 +1851,15 @@ Namespace My.Resources
End Get End Get
End Property 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> '''<summary>
''' Looks up a localized string similar to Process:. ''' Looks up a localized string similar to Process:.
'''</summary> '''</summary>
@@ -2266,7 +2284,7 @@ Namespace My.Resources
End Property End Property
'''<summary> '''<summary>
''' Looks up a localized string similar to Game Backup Monitor[BR]Version: [PARAM] ([PARAM])[BR]Build: [PARAM][BR][PARAM][BR][BR]This program comes with ABSOLUTELY NO WARRANTY.[BR]This is free software, and you are welcome to redistribute it under certain conditions.[BR][BR]See gpl-3.0.html in the program folder for details.. ''' Looks up a localized string similar to Game Backup Monitor[BR]Version: [PARAM] ([PARAM])[BR]Build: [PARAM][BR]SQLite: [PARAM][BR][BR][PARAM][BR][BR]This program comes with ABSOLUTELY NO WARRANTY.[BR]This is free software, and you are welcome to redistribute it under certain conditions.[BR][BR]See gpl-3.0.html in the program folder for details..
'''</summary> '''</summary>
Friend ReadOnly Property frmMain_About() As String Friend ReadOnly Property frmMain_About() As String
Get Get
+7 -1
View File
@@ -122,7 +122,7 @@
<value>..\Resources\Admin.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\Admin.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="frmMain_About" xml:space="preserve"> <data name="frmMain_About" xml:space="preserve">
<value>Game Backup Monitor[BR]Version: [PARAM] ([PARAM])[BR]Build: [PARAM][BR][PARAM][BR][BR]This program comes with ABSOLUTELY NO WARRANTY.[BR]This is free software, and you are welcome to redistribute it under certain conditions.[BR][BR]See gpl-3.0.html in the program folder for details.</value> <value>Game Backup Monitor[BR]Version: [PARAM] ([PARAM])[BR]Build: [PARAM][BR]SQLite: [PARAM][BR][BR][PARAM][BR][BR]This program comes with ABSOLUTELY NO WARRANTY.[BR]This is free software, and you are welcome to redistribute it under certain conditions.[BR][BR]See gpl-3.0.html in the program folder for details.</value>
</data> </data>
<data name="frmMain_ManifestAreadyClean" xml:space="preserve"> <data name="frmMain_ManifestAreadyClean" xml:space="preserve">
<value>The local manifest is clean.</value> <value>The local manifest is clean.</value>
@@ -1783,4 +1783,10 @@
<data name="mgrCommon_TB" xml:space="preserve"> <data name="mgrCommon_TB" xml:space="preserve">
<value>[PARAM] TB</value> <value>[PARAM] TB</value>
</data> </data>
<data name="frmGameManager_lblParameter" xml:space="preserve">
<value>Parameter:</value>
</data>
<data name="frmGameManager_ErrorProcessParameterDupe" xml:space="preserve">
<value>A game with this exact process and parameter already exists.</value>
</data>
</root> </root>
+18 -15
View File
@@ -1,22 +1,25 @@
Game Backup Monitor v1.01 Readme Game Backup Monitor v1.02 Readme
http://mikemaximus.github.io/gbm-web/ http://mikemaximus.github.io/gbm-web/
gamebackupmonitor@gmail.com gamebackupmonitor@gmail.com
April 1, 2017 July 1, 2017
New in 1.01 New in 1.02
- (All) Added features to automatically handle new backup files. - (Windows) Upgraded SQLite to 3.19.3.
- Automatically restore new backup files when they are detected. - (All) The SQLite version is displayed on the "About" screen.
- Automatically mark new backup files as restored if the game isn't installed on the current PC. - (All) Added the ability to detect command parameters.
- These new features are available in the "Backup and Restore" section of the Settings. They are optional and disabled by default. - Use parameter detection for better detection of games running in emulators or interpreters like DOSBox.
- (All) Added new configuration option to delete saved game folder on restore - This is an advanced optional feature and is not available in the "Add Game Wizard", please read the manual (http://mikemaximus.github.io/gbm-web/manual.html) for more details.
- This option is used for games that change the file names of their saves, which results in a mix of old and new saved games if the old saves aren't deleted first. - (Linux) Please note that Wine detection is still handled automatically by GBM and only requires a Windows process name. But this feature does work with Wine if you need to detect parameters!
- This option has limitations and is not part of official configurations or import/export features. - (All) Added the ability to resize and maximize the main program window.
- (All) The "Verify backup files with a checksum" option has been removed. This feature is now baked into GBM and cannot be disabled. - The log is now displayed by default and resizes with the window.
- (All) GBM will now behave consistently across different configurations (such as LAN) when performing sync operations. - The "Show/Hide Log" button has been removed due to technical issues with this change.
- (Windows) Fixed rare issue related to DPI display scaling. - The minimum window size will let you easily hide the log as in past versions.
- (All) The last browse location in various dialogs is now saved, such as when using the Import/Export feature.
Read the "Settings" and "The Game Manager" sections of the manual (http://mikemaximus.github.io/gbm-web/manual.html) for more details on how the new features work and their limitations. - (All) Available disk space is checked before attempting a backup. The log now displays available disk space and save folder size.
- (Linux) Using the keyboard to navigate the game list in the Game Manager now works correctly.
- (All) Tags can now be added to a new game configuration before saving on the Game Manager.
- (All) Fixed various issues when adding new game configurations while using filters on the Game Manager.
The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html
Binary file not shown.
Binary file not shown.