Tweaks for issue #79

This commit is contained in:
MikeMaximus
2017-06-22 11:43:03 -06:00
parent 5fa746da8e
commit 97cf2618e3
7 changed files with 76 additions and 30 deletions
+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
If o.Parameter = String.Empty Then
lstGameBox.Items.Add(New KeyValuePair(Of String, String)(o.ID, o.Name)) lstGameBox.Items.Add(New KeyValuePair(Of String, String)(o.ID, o.Name))
oGamesHash.Add(o.ID, o) oGamesHash.Add(o.ID, o)
End If
Next Next
lstGameBox.SelectedIndex = 0 lstGameBox.SelectedIndex = 0
+27 -27
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()
@@ -96,8 +98,6 @@ Partial Class frmGameManager
Me.cmsDeleteBackup = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.cmsDeleteBackup = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.cmsDeleteOne = New System.Windows.Forms.ToolStripMenuItem() Me.cmsDeleteOne = New System.Windows.Forms.ToolStripMenuItem()
Me.cmsDeleteAll = 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() Me.grpConfig.SuspendLayout()
CType(Me.nudLimit, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.nudLimit, System.ComponentModel.ISupportInitialize).BeginInit()
Me.grpExtra.SuspendLayout() Me.grpExtra.SuspendLayout()
@@ -182,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
' '
@@ -198,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
' '
@@ -208,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
' '
@@ -217,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
' '
@@ -226,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
' '
@@ -245,7 +261,7 @@ 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
' '
@@ -309,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
' '
@@ -319,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
' '
@@ -328,7 +344,7 @@ 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
' '
@@ -823,22 +839,6 @@ Partial Class frmGameManager
Me.cmsDeleteAll.Size = New System.Drawing.Size(114, 22) Me.cmsDeleteAll.Size = New System.Drawing.Size(114, 22)
Me.cmsDeleteAll.Text = "&All Files" 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 'frmGameManager
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
+7
View File
@@ -1259,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
+1 -1
View File
@@ -1463,7 +1463,7 @@ Public Class frmMain
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
+25
View File
@@ -268,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)
+9
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>
+3
View File
@@ -1786,4 +1786,7 @@
<data name="frmGameManager_lblParameter" xml:space="preserve"> <data name="frmGameManager_lblParameter" xml:space="preserve">
<value>Parameter:</value> <value>Parameter:</value>
</data> </data>
<data name="frmGameManager_ErrorProcessParameterDupe" xml:space="preserve">
<value>A game with this exact process and parameter already exists.</value>
</data>
</root> </root>