diff --git a/GBM/Classes/XML Serialize Classes/ExportData.vb b/GBM/Classes/XML Serialize Classes/ExportData.vb new file mode 100644 index 0000000..3113b27 --- /dev/null +++ b/GBM/Classes/XML Serialize Classes/ExportData.vb @@ -0,0 +1,63 @@ +Imports System.Xml.Serialization + + +Public Class ExportData + Dim oConfigs As List(Of Game) + Private dExported As Int64 + Private iTotalConfigs As Integer + Private iAppVer As Integer + + + Property Exported As Int64 + Set(value As Int64) + dExported = value + End Set + Get + Return dExported + End Get + End Property + + + Property TotalConfigurations As Integer + Set(value As Integer) + iTotalConfigs = value + End Set + Get + Return iTotalConfigs + End Get + End Property + + + Property AppVer As Integer + Set(value As Integer) + iAppVer = value + End Set + Get + Return iAppVer + End Get + End Property + + + Property Configurations As List(Of Game) + Set(value As List(Of Game)) + oConfigs = value + End Set + Get + Return oConfigs + End Get + End Property + + Public Sub New() + dExported = 0 + iTotalConfigs = 0 + iAppVer = 0 + oConfigs = New List(Of Game) + End Sub + + Public Sub New(ByVal dInitExported As Int64, ByVal iInitTotalConfigs As Integer, ByVal iInitAppVer As Integer, ByVal oInitConfigs As List(Of Game)) + dExported = dInitExported + iTotalConfigs = iInitTotalConfigs + iAppVer = iInitAppVer + oConfigs = oInitConfigs + End Sub +End Class diff --git a/GBM/Classes/clsGameFilter.vb b/GBM/Classes/clsGameFilter.vb index b1395d3..191cef6 100644 --- a/GBM/Classes/clsGameFilter.vb +++ b/GBM/Classes/clsGameFilter.vb @@ -2,6 +2,7 @@ Private sID As String Private oField As clsGameFilterField + Private bNot As Boolean Private oData As Object Private eNumericOperator As eNumericOperators = eNumericOperators.Equals @@ -31,6 +32,15 @@ End Set End Property + Public Property NotCondition As Boolean + Get + Return bNot + End Get + Set(value As Boolean) + bNot = value + End Set + End Property + Public Property Data As Object Get Return oData diff --git a/GBM/Forms/frmAdvancedImport.Designer.vb b/GBM/Forms/frmAdvancedImport.Designer.vb index 21aae4c..d081c55 100644 --- a/GBM/Forms/frmAdvancedImport.Designer.vb +++ b/GBM/Forms/frmAdvancedImport.Designer.vb @@ -1,9 +1,9 @@ - _ + Partial Class frmAdvancedImport Inherits System.Windows.Forms.Form 'Form overrides dispose to clean up the component list. - _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) Try If disposing AndAlso components IsNot Nothing Then @@ -20,7 +20,7 @@ Partial Class frmAdvancedImport 'NOTE: The following procedure is required by the Windows Form Designer 'It can be modified using the Windows Form Designer. 'Do not modify it using the code editor. - _ + Private Sub InitializeComponent() Me.btnImport = New System.Windows.Forms.Button() Me.chkSelectAll = New System.Windows.Forms.CheckBox() @@ -44,7 +44,7 @@ Partial Class frmAdvancedImport 'chkSelectAll ' Me.chkSelectAll.AutoSize = True - Me.chkSelectAll.Location = New System.Drawing.Point(12, 12) + Me.chkSelectAll.Location = New System.Drawing.Point(12, 11) Me.chkSelectAll.Name = "chkSelectAll" Me.chkSelectAll.Size = New System.Drawing.Size(70, 17) Me.chkSelectAll.TabIndex = 0 @@ -98,9 +98,9 @@ Partial Class frmAdvancedImport ' 'lblFilter ' - Me.lblFilter.Location = New System.Drawing.Point(307, 12) + Me.lblFilter.Location = New System.Drawing.Point(371, 12) Me.lblFilter.Name = "lblFilter" - Me.lblFilter.Size = New System.Drawing.Size(103, 14) + Me.lblFilter.Size = New System.Drawing.Size(39, 14) Me.lblFilter.TabIndex = 0 Me.lblFilter.Text = "Filter:" Me.lblFilter.TextAlign = System.Drawing.ContentAlignment.TopRight diff --git a/GBM/Forms/frmAdvancedImport.vb b/GBM/Forms/frmAdvancedImport.vb index 70ef96b..f71dec8 100644 --- a/GBM/Forms/frmAdvancedImport.vb +++ b/GBM/Forms/frmAdvancedImport.vb @@ -3,6 +3,7 @@ Imports System.IO Public Class frmAdvancedImport + Private oImportData As ExportData Private hshImportData As Hashtable Private hshFinalData As New Hashtable Private bSelectAll As Boolean = True @@ -10,6 +11,15 @@ Public Class frmAdvancedImport Private iCurrentSort As Integer = 0 Private WithEvents tmFilterTimer As Timer + Public Property ImportInfo As ExportData + Set(value As ExportData) + oImportData = value + End Set + Get + Return oImportData + End Get + End Property + Public Property ImportData As Hashtable Set(value As Hashtable) hshImportData = value @@ -135,6 +145,11 @@ Public Class frmAdvancedImport 'Set Form Name Me.Text = frmAdvancedImport_FormName + 'Add configuration date to title if applicable + If ImportInfo.Exported <> 0 Then + Me.Text &= " [" & mgrCommon.UnixToDate(ImportInfo.Exported).Date & "]" + End If + 'Set Form Text lblFilter.Text = frmAdvancedImport_lblFilter btnCancel.Text = frmAdvancedImport_btnCancel diff --git a/GBM/Forms/frmFilter.Designer.vb b/GBM/Forms/frmFilter.Designer.vb index 71f4469..ddfcc1d 100644 --- a/GBM/Forms/frmFilter.Designer.vb +++ b/GBM/Forms/frmFilter.Designer.vb @@ -23,17 +23,23 @@ Partial Class frmFilter _ Private Sub InitializeComponent() Me.grpTagFilter = New System.Windows.Forms.GroupBox() + Me.lblExcludeTags = New System.Windows.Forms.Label() + Me.btnExcludeRemove = New System.Windows.Forms.Button() + Me.btnExcludeAdd = New System.Windows.Forms.Button() + Me.lstExcludeTags = New System.Windows.Forms.ListBox() Me.grpTagOptions = New System.Windows.Forms.GroupBox() Me.optAll = New System.Windows.Forms.RadioButton() Me.optAny = New System.Windows.Forms.RadioButton() - Me.lblGameTags = New System.Windows.Forms.Label() + Me.lblIncludeTags = New System.Windows.Forms.Label() Me.lblTags = New System.Windows.Forms.Label() - Me.btnRemove = New System.Windows.Forms.Button() - Me.btnAdd = New System.Windows.Forms.Button() - Me.lstTagFilter = New System.Windows.Forms.ListBox() + Me.btnIncludeRemove = New System.Windows.Forms.Button() + Me.btnIncludeAdd = New System.Windows.Forms.Button() + Me.lstIncludeTags = New System.Windows.Forms.ListBox() Me.lstTags = New System.Windows.Forms.ListBox() Me.btnOK = New System.Windows.Forms.Button() Me.grpGameFilter = New System.Windows.Forms.GroupBox() + Me.lblNot = New System.Windows.Forms.Label() + Me.chkNot = New System.Windows.Forms.CheckBox() Me.cboBoolFilter = New System.Windows.Forms.ComboBox() Me.numFilter = New System.Windows.Forms.NumericUpDown() Me.cboNumericOps = New System.Windows.Forms.ComboBox() @@ -68,19 +74,60 @@ Partial Class frmFilter ' 'grpTagFilter ' + Me.grpTagFilter.Controls.Add(Me.lblExcludeTags) + Me.grpTagFilter.Controls.Add(Me.btnExcludeRemove) + Me.grpTagFilter.Controls.Add(Me.btnExcludeAdd) + Me.grpTagFilter.Controls.Add(Me.lstExcludeTags) Me.grpTagFilter.Controls.Add(Me.grpTagOptions) - Me.grpTagFilter.Controls.Add(Me.lblGameTags) + Me.grpTagFilter.Controls.Add(Me.lblIncludeTags) Me.grpTagFilter.Controls.Add(Me.lblTags) - Me.grpTagFilter.Controls.Add(Me.btnRemove) - Me.grpTagFilter.Controls.Add(Me.btnAdd) - Me.grpTagFilter.Controls.Add(Me.lstTagFilter) + Me.grpTagFilter.Controls.Add(Me.btnIncludeRemove) + Me.grpTagFilter.Controls.Add(Me.btnIncludeAdd) + Me.grpTagFilter.Controls.Add(Me.lstIncludeTags) Me.grpTagFilter.Controls.Add(Me.lstTags) Me.grpTagFilter.Location = New System.Drawing.Point(12, 236) Me.grpTagFilter.Name = "grpTagFilter" - Me.grpTagFilter.Size = New System.Drawing.Size(385, 198) + Me.grpTagFilter.Size = New System.Drawing.Size(410, 198) Me.grpTagFilter.TabIndex = 3 Me.grpTagFilter.TabStop = False ' + 'lblExcludeTags + ' + Me.lblExcludeTags.AutoSize = True + Me.lblExcludeTags.Location = New System.Drawing.Point(313, 16) + Me.lblExcludeTags.Name = "lblExcludeTags" + Me.lblExcludeTags.Size = New System.Drawing.Size(72, 13) + Me.lblExcludeTags.TabIndex = 10 + Me.lblExcludeTags.Text = "Exclude Tags" + ' + 'btnExcludeRemove + ' + Me.btnExcludeRemove.Location = New System.Drawing.Point(261, 91) + Me.btnExcludeRemove.Name = "btnExcludeRemove" + Me.btnExcludeRemove.Size = New System.Drawing.Size(31, 23) + Me.btnExcludeRemove.TabIndex = 9 + Me.btnExcludeRemove.Text = "<" + Me.btnExcludeRemove.UseVisualStyleBackColor = True + ' + 'btnExcludeAdd + ' + Me.btnExcludeAdd.Location = New System.Drawing.Point(261, 62) + Me.btnExcludeAdd.Name = "btnExcludeAdd" + Me.btnExcludeAdd.Size = New System.Drawing.Size(31, 23) + Me.btnExcludeAdd.TabIndex = 8 + Me.btnExcludeAdd.Text = ">" + Me.btnExcludeAdd.UseVisualStyleBackColor = True + ' + 'lstExcludeTags + ' + Me.lstExcludeTags.FormattingEnabled = True + Me.lstExcludeTags.Location = New System.Drawing.Point(298, 32) + Me.lstExcludeTags.Name = "lstExcludeTags" + Me.lstExcludeTags.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended + Me.lstExcludeTags.Size = New System.Drawing.Size(103, 108) + Me.lstExcludeTags.Sorted = True + Me.lstExcludeTags.TabIndex = 7 + ' 'grpTagOptions ' Me.grpTagOptions.Controls.Add(Me.optAll) @@ -113,65 +160,65 @@ Partial Class frmFilter Me.optAny.Text = "Any Tag" Me.optAny.UseVisualStyleBackColor = True ' - 'lblGameTags + 'lblIncludeTags ' - Me.lblGameTags.AutoSize = True - Me.lblGameTags.Location = New System.Drawing.Point(271, 16) - Me.lblGameTags.Name = "lblGameTags" - Me.lblGameTags.Size = New System.Drawing.Size(66, 13) - Me.lblGameTags.TabIndex = 4 - Me.lblGameTags.Text = "Current Filter" + Me.lblIncludeTags.AutoSize = True + Me.lblIncludeTags.Location = New System.Drawing.Point(23, 16) + Me.lblIncludeTags.Name = "lblIncludeTags" + Me.lblIncludeTags.Size = New System.Drawing.Size(69, 13) + Me.lblIncludeTags.TabIndex = 4 + Me.lblIncludeTags.Text = "Include Tags" ' 'lblTags ' Me.lblTags.AutoSize = True - Me.lblTags.Location = New System.Drawing.Point(43, 16) + Me.lblTags.Location = New System.Drawing.Point(165, 16) Me.lblTags.Name = "lblTags" Me.lblTags.Size = New System.Drawing.Size(77, 13) Me.lblTags.TabIndex = 0 Me.lblTags.Text = "Available Tags" ' - 'btnRemove + 'btnIncludeRemove ' - Me.btnRemove.Location = New System.Drawing.Point(162, 88) - Me.btnRemove.Name = "btnRemove" - Me.btnRemove.Size = New System.Drawing.Size(61, 23) - Me.btnRemove.TabIndex = 3 - Me.btnRemove.Text = "<" - Me.btnRemove.UseVisualStyleBackColor = True + Me.btnIncludeRemove.Location = New System.Drawing.Point(115, 91) + Me.btnIncludeRemove.Name = "btnIncludeRemove" + Me.btnIncludeRemove.Size = New System.Drawing.Size(31, 23) + Me.btnIncludeRemove.TabIndex = 3 + Me.btnIncludeRemove.Text = ">" + Me.btnIncludeRemove.UseVisualStyleBackColor = True ' - 'btnAdd + 'btnIncludeAdd ' - Me.btnAdd.Location = New System.Drawing.Point(162, 59) - Me.btnAdd.Name = "btnAdd" - Me.btnAdd.Size = New System.Drawing.Size(61, 23) - Me.btnAdd.TabIndex = 2 - Me.btnAdd.Text = ">" - Me.btnAdd.UseVisualStyleBackColor = True + Me.btnIncludeAdd.Location = New System.Drawing.Point(115, 62) + Me.btnIncludeAdd.Name = "btnIncludeAdd" + Me.btnIncludeAdd.Size = New System.Drawing.Size(31, 23) + Me.btnIncludeAdd.TabIndex = 2 + Me.btnIncludeAdd.Text = "<" + Me.btnIncludeAdd.UseVisualStyleBackColor = True ' - 'lstTagFilter + 'lstIncludeTags ' - Me.lstTagFilter.FormattingEnabled = True - Me.lstTagFilter.Location = New System.Drawing.Point(229, 32) - Me.lstTagFilter.Name = "lstTagFilter" - Me.lstTagFilter.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended - Me.lstTagFilter.Size = New System.Drawing.Size(150, 108) - Me.lstTagFilter.Sorted = True - Me.lstTagFilter.TabIndex = 5 + Me.lstIncludeTags.FormattingEnabled = True + Me.lstIncludeTags.Location = New System.Drawing.Point(6, 32) + Me.lstIncludeTags.Name = "lstIncludeTags" + Me.lstIncludeTags.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended + Me.lstIncludeTags.Size = New System.Drawing.Size(103, 108) + Me.lstIncludeTags.Sorted = True + Me.lstIncludeTags.TabIndex = 5 ' 'lstTags ' Me.lstTags.FormattingEnabled = True - Me.lstTags.Location = New System.Drawing.Point(6, 32) + Me.lstTags.Location = New System.Drawing.Point(152, 32) Me.lstTags.Name = "lstTags" Me.lstTags.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended - Me.lstTags.Size = New System.Drawing.Size(150, 108) + Me.lstTags.Size = New System.Drawing.Size(103, 108) Me.lstTags.Sorted = True Me.lstTags.TabIndex = 1 ' 'btnOK ' - Me.btnOK.Location = New System.Drawing.Point(322, 526) + Me.btnOK.Location = New System.Drawing.Point(347, 526) Me.btnOK.Name = "btnOK" Me.btnOK.Size = New System.Drawing.Size(75, 23) Me.btnOK.TabIndex = 6 @@ -180,6 +227,8 @@ Partial Class frmFilter ' 'grpGameFilter ' + Me.grpGameFilter.Controls.Add(Me.lblNot) + Me.grpGameFilter.Controls.Add(Me.chkNot) Me.grpGameFilter.Controls.Add(Me.cboBoolFilter) Me.grpGameFilter.Controls.Add(Me.numFilter) Me.grpGameFilter.Controls.Add(Me.cboNumericOps) @@ -194,15 +243,33 @@ Partial Class frmFilter Me.grpGameFilter.Controls.Add(Me.txtStringFilter) Me.grpGameFilter.Location = New System.Drawing.Point(12, 35) Me.grpGameFilter.Name = "grpGameFilter" - Me.grpGameFilter.Size = New System.Drawing.Size(385, 172) + Me.grpGameFilter.Size = New System.Drawing.Size(410, 172) Me.grpGameFilter.TabIndex = 1 Me.grpGameFilter.TabStop = False ' + 'lblNot + ' + Me.lblNot.AutoSize = True + Me.lblNot.Location = New System.Drawing.Point(161, 20) + Me.lblNot.Name = "lblNot" + Me.lblNot.Size = New System.Drawing.Size(24, 13) + Me.lblNot.TabIndex = 11 + Me.lblNot.Text = "Not" + ' + 'chkNot + ' + Me.chkNot.AutoSize = True + Me.chkNot.Location = New System.Drawing.Point(166, 39) + Me.chkNot.Name = "chkNot" + Me.chkNot.Size = New System.Drawing.Size(15, 14) + Me.chkNot.TabIndex = 10 + Me.chkNot.UseVisualStyleBackColor = True + ' 'cboBoolFilter ' Me.cboBoolFilter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cboBoolFilter.FormattingEnabled = True - Me.cboBoolFilter.Location = New System.Drawing.Point(162, 36) + Me.cboBoolFilter.Location = New System.Drawing.Point(187, 36) Me.cboBoolFilter.Name = "cboBoolFilter" Me.cboBoolFilter.Size = New System.Drawing.Size(136, 21) Me.cboBoolFilter.TabIndex = 3 @@ -210,7 +277,7 @@ Partial Class frmFilter 'numFilter ' Me.numFilter.DecimalPlaces = 1 - Me.numFilter.Location = New System.Drawing.Point(233, 37) + Me.numFilter.Location = New System.Drawing.Point(258, 37) Me.numFilter.Maximum = New Decimal(New Integer() {1000000, 0, 0, 0}) Me.numFilter.Name = "numFilter" Me.numFilter.Size = New System.Drawing.Size(65, 20) @@ -220,7 +287,7 @@ Partial Class frmFilter ' Me.cboNumericOps.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cboNumericOps.FormattingEnabled = True - Me.cboNumericOps.Location = New System.Drawing.Point(162, 36) + Me.cboNumericOps.Location = New System.Drawing.Point(188, 36) Me.cboNumericOps.Name = "cboNumericOps" Me.cboNumericOps.Size = New System.Drawing.Size(65, 21) Me.cboNumericOps.TabIndex = 3 @@ -237,7 +304,7 @@ Partial Class frmFilter 'lblFilterData ' Me.lblFilterData.AutoSize = True - Me.lblFilterData.Location = New System.Drawing.Point(214, 20) + Me.lblFilterData.Location = New System.Drawing.Point(239, 20) Me.lblFilterData.Name = "lblFilterData" Me.lblFilterData.Size = New System.Drawing.Size(32, 13) Me.lblFilterData.TabIndex = 2 @@ -271,7 +338,7 @@ Partial Class frmFilter ' 'btnAddFilter ' - Me.btnAddFilter.Location = New System.Drawing.Point(304, 34) + Me.btnAddFilter.Location = New System.Drawing.Point(329, 34) Me.btnAddFilter.Name = "btnAddFilter" Me.btnAddFilter.Size = New System.Drawing.Size(75, 23) Me.btnAddFilter.TabIndex = 5 @@ -320,7 +387,7 @@ Partial Class frmFilter ' 'txtStringFilter ' - Me.txtStringFilter.Location = New System.Drawing.Point(162, 36) + Me.txtStringFilter.Location = New System.Drawing.Point(187, 36) Me.txtStringFilter.Name = "txtStringFilter" Me.txtStringFilter.Size = New System.Drawing.Size(136, 20) Me.txtStringFilter.TabIndex = 3 @@ -332,7 +399,7 @@ Partial Class frmFilter Me.grpSorting.Controls.Add(Me.cboSortField) Me.grpSorting.Location = New System.Drawing.Point(12, 440) Me.grpSorting.Name = "grpSorting" - Me.grpSorting.Size = New System.Drawing.Size(385, 80) + Me.grpSorting.Size = New System.Drawing.Size(410, 80) Me.grpSorting.TabIndex = 4 Me.grpSorting.TabStop = False Me.grpSorting.Text = "Sorting" @@ -421,7 +488,7 @@ Partial Class frmFilter ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(409, 561) + Me.ClientSize = New System.Drawing.Size(434, 561) Me.Controls.Add(Me.Label1) Me.Controls.Add(Me.grpSorting) Me.Controls.Add(Me.chkTag) @@ -455,11 +522,11 @@ Partial Class frmFilter Friend WithEvents grpTagOptions As System.Windows.Forms.GroupBox Friend WithEvents optAll As System.Windows.Forms.RadioButton Friend WithEvents optAny As System.Windows.Forms.RadioButton - Friend WithEvents lblGameTags As System.Windows.Forms.Label + Friend WithEvents lblIncludeTags As System.Windows.Forms.Label Friend WithEvents lblTags As System.Windows.Forms.Label - Friend WithEvents btnRemove As System.Windows.Forms.Button - Friend WithEvents btnAdd As System.Windows.Forms.Button - Friend WithEvents lstTagFilter As System.Windows.Forms.ListBox + Friend WithEvents btnIncludeRemove As System.Windows.Forms.Button + Friend WithEvents btnIncludeAdd As System.Windows.Forms.Button + Friend WithEvents lstIncludeTags As System.Windows.Forms.ListBox Friend WithEvents lstTags As System.Windows.Forms.ListBox Friend WithEvents btnOK As System.Windows.Forms.Button Friend WithEvents grpGameFilter As System.Windows.Forms.GroupBox @@ -486,4 +553,10 @@ Partial Class frmFilter Friend WithEvents lblSortFields As Label Friend WithEvents Label1 As Label Friend WithEvents grpSortOptions As GroupBox + Friend WithEvents lblExcludeTags As Label + Friend WithEvents btnExcludeRemove As Button + Friend WithEvents btnExcludeAdd As Button + Friend WithEvents lstExcludeTags As ListBox + Friend WithEvents lblNot As Label + Friend WithEvents chkNot As CheckBox End Class diff --git a/GBM/Forms/frmFilter.vb b/GBM/Forms/frmFilter.vb index 6464c24..3f2fd69 100644 --- a/GBM/Forms/frmFilter.vb +++ b/GBM/Forms/frmFilter.vb @@ -9,7 +9,8 @@ Public Class frmFilter NoTags = 4 End Enum - Dim oTagFilters As New List(Of clsTag) + Dim oIncludeTagFilters As New List(Of clsTag) + Dim oExcludeTagFilters As New List(Of clsTag) Dim oGameFilters As New List(Of clsGameFilter) Dim oValidFields As New List(Of clsGameFilterField) Dim eCurrentFilterType As eFilterType = eFilterType.BaseFilter @@ -28,12 +29,21 @@ Public Class frmFilter End Set End Property - Public Property TagFilters As List(Of clsTag) + Public Property IncludeTagFilters As List(Of clsTag) Get - Return oTagFilters + Return oIncludeTagFilters End Get Set(value As List(Of clsTag)) - oTagFilters = value + oIncludeTagFilters = value + End Set + End Property + + Public Property ExcludeTagFilters As List(Of clsTag) + Get + Return oExcludeTagFilters + End Get + Set(value As List(Of clsTag)) + oExcludeTagFilters = value End Set End Property @@ -73,13 +83,13 @@ Public Class frmFilter End Set End Property - Private Sub AddTag() + Private Sub AddTag(ByRef lst As ListBox) Dim oData As KeyValuePair(Of String, String) Dim oTags As List(Of KeyValuePair(Of String, String)) If lstTags.SelectedItems.Count = 1 Then oData = lstTags.SelectedItems(0) - lstTagFilter.Items.Add(oData) + lst.Items.Add(oData) lstTags.Items.Remove(oData) ElseIf lstTags.SelectedItems.Count > 1 Then oTags = New List(Of KeyValuePair(Of String, String)) @@ -89,30 +99,30 @@ Public Class frmFilter Next For Each kp As KeyValuePair(Of String, String) In oTags - lstTagFilter.Items.Add(kp) + lst.Items.Add(kp) lstTags.Items.Remove(kp) Next End If End Sub - Private Sub RemoveTag() + Private Sub RemoveTag(ByRef lst As ListBox) Dim oData As KeyValuePair(Of String, String) Dim oTags As List(Of KeyValuePair(Of String, String)) - If lstTagFilter.SelectedItems.Count = 1 Then - oData = lstTagFilter.SelectedItems(0) - lstTagFilter.Items.Remove(oData) + If lst.SelectedItems.Count = 1 Then + oData = lst.SelectedItems(0) + lst.Items.Remove(oData) lstTags.Items.Add(oData) - ElseIf lstTagFilter.SelectedItems.Count > 1 Then + ElseIf lst.SelectedItems.Count > 1 Then oTags = New List(Of KeyValuePair(Of String, String)) - For Each oData In lstTagFilter.SelectedItems + For Each oData In lst.SelectedItems oTags.Add(oData) Next For Each kp As KeyValuePair(Of String, String) In oTags - lstTagFilter.Items.Remove(kp) + lst.Items.Remove(kp) lstTags.Items.Add(kp) Next End If @@ -283,13 +293,17 @@ Public Class frmFilter 'Handle Lists lstTags.Items.Clear() - lstTagFilter.Items.Clear() + lstIncludeTags.Items.Clear() + lstExcludeTags.Items.Clear() lstTags.ValueMember = "Key" lstTags.DisplayMember = "Value" - lstTagFilter.ValueMember = "Key" - lstTagFilter.DisplayMember = "Value" + lstIncludeTags.ValueMember = "Key" + lstIncludeTags.DisplayMember = "Value" + + lstExcludeTags.ValueMember = "Key" + lstExcludeTags.DisplayMember = "Value" For Each de As DictionaryEntry In hshTags oTag = DirectCast(de.Value, clsTag) @@ -322,16 +336,35 @@ Public Class frmFilter sFilter = oFilter.Field.FriendlyFieldName & " = " & oFilter.Data End Select + If oFilter.NotCondition Then + sFilter &= " (" & frmFilter_lblNot & ")" + End If + lstFilter.Items.Add(New KeyValuePair(Of clsGameFilter, String)(oFilter, sFilter)) Next End If 'Tag Filters - If oTagFilters.Count > 0 Then + If oIncludeTagFilters.Count > 0 Then chkTag.Checked = True - For Each oTag As clsTag In oTagFilters + For Each oTag As clsTag In oIncludeTagFilters oListTag = New KeyValuePair(Of String, String)(oTag.ID, oTag.Name) - lstTagFilter.Items.Add(oListTag) + lstIncludeTags.Items.Add(oListTag) + lstTags.Items.Remove(oListTag) + Next + + If eCurrentFilterType = eFilterType.AllTags Then + optAll.Checked = True + Else + optAny.Checked = True + End If + End If + + If oExcludeTagFilters.Count > 0 Then + chkTag.Checked = True + For Each oTag As clsTag In oExcludeTagFilters + oListTag = New KeyValuePair(Of String, String)(oTag.ID, oTag.Name) + lstExcludeTags.Items.Add(oListTag) lstTags.Items.Remove(oListTag) Next @@ -360,6 +393,7 @@ Public Class frmFilter cboBoolFilter.SelectedIndex = 0 numFilter.Value = 0 txtStringFilter.Text = String.Empty + chkNot.Checked = False 'Reset Visibilty cboBoolFilter.Visible = False @@ -402,6 +436,13 @@ Public Class frmFilter sFilter = oFilter.Field.FriendlyFieldName & " = " & oFilter.Data End Select + If chkNot.Checked Then + oFilter.NotCondition = True + sFilter &= " (" & frmFilter_lblNot & ")" + Else + oFilter.NotCondition = False + End If + oGameFilters.Add(oFilter) lstFilter.Items.Add(New KeyValuePair(Of clsGameFilter, String)(oFilter, sFilter)) @@ -431,14 +472,19 @@ Public Class frmFilter If chkTag.Checked Then 'Set Tags - TagFilters.Clear() - For Each oData In lstTagFilter.Items + IncludeTagFilters.Clear() + For Each oData In lstIncludeTags.Items oTag = DirectCast(hshTags(oData.Value), clsTag) - TagFilters.Add(oTag) + IncludeTagFilters.Add(oTag) + Next + ExcludeTagFilters.Clear() + For Each oData In lstExcludeTags.Items + oTag = DirectCast(hshTags(oData.Value), clsTag) + ExcludeTagFilters.Add(oTag) Next 'Set Filter Type - If TagFilters.Count = 0 Then + If IncludeTagFilters.Count = 0 And ExcludeTagFilters.Count = 0 Then eCurrentFilterType = eFilterType.NoTags ElseIf optAll.Checked Then eCurrentFilterType = eFilterType.AllTags @@ -525,10 +571,13 @@ Public Class frmFilter grpFilterType.Text = frmFilter_grpFilterType optAll.Text = frmFilter_optAll optAny.Text = frmFilter_optAny - lblGameTags.Text = frmFilter_lblGameTags + lblIncludeTags.Text = frmFilter_lblIncludeTags + lblExcludeTags.Text = frmFilter_lblExcludeTags lblTags.Text = frmFilter_lblTags - btnRemove.Text = frmFilter_btnRemove - btnAdd.Text = frmFilter_btnAdd + btnIncludeRemove.Text = frmFilter_btnIncludeRemove + btnIncludeAdd.Text = frmFilter_btnIncludeAdd + btnExcludeRemove.Text = frmFilter_btnExcludeRemove + btnExcludeAdd.Text = frmFilter_btnExcludeAdd btnOK.Text = frmFilter_btnOK grpTagOptions.Text = frmFilter_grpTagOptions chkTag.Text = frmFilter_chkTag @@ -569,12 +618,20 @@ Public Class frmFilter Me.Close() End Sub - Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click - AddTag() + Private Sub btnIncludeAdd_Click(sender As Object, e As EventArgs) Handles btnIncludeAdd.Click + AddTag(lstIncludeTags) End Sub - Private Sub btnRemove_Click(sender As Object, e As EventArgs) Handles btnRemove.Click - RemoveTag() + Private Sub btnExcludeAdd_Click(sender As Object, e As EventArgs) Handles btnExcludeAdd.Click + AddTag(lstExcludeTags) + End Sub + + Private Sub btnExcludeRemove_Click(sender As Object, e As EventArgs) Handles btnExcludeRemove.Click + RemoveTag(lstExcludeTags) + End Sub + + Private Sub btnIncludeRemove_Click(sender As Object, e As EventArgs) Handles btnIncludeRemove.Click + RemoveTag(lstIncludeTags) End Sub Private Sub frmFilter_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing @@ -599,7 +656,7 @@ Public Class frmFilter grpTagFilter.Enabled = True Else grpTagFilter.Enabled = False - oTagFilters.Clear() + oIncludeTagFilters.Clear() LoadTagData() End If End Sub diff --git a/GBM/Forms/frmGameManager.Designer.vb b/GBM/Forms/frmGameManager.Designer.vb index b658e3c..cc094b2 100644 --- a/GBM/Forms/frmGameManager.Designer.vb +++ b/GBM/Forms/frmGameManager.Designer.vb @@ -28,6 +28,8 @@ Partial Class frmGameManager Me.btnBackup = New System.Windows.Forms.Button() Me.btnClose = New System.Windows.Forms.Button() Me.grpConfig = New System.Windows.Forms.GroupBox() + Me.lblComments = New System.Windows.Forms.Label() + Me.txtComments = New System.Windows.Forms.TextBox() Me.txtParameter = New System.Windows.Forms.TextBox() Me.lblParameter = New System.Windows.Forms.Label() Me.chkCleanFolder = New System.Windows.Forms.CheckBox() @@ -98,9 +100,6 @@ 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.btnSessions = New System.Windows.Forms.Button() - Me.txtComments = New System.Windows.Forms.TextBox() - Me.lblComments = New System.Windows.Forms.Label() Me.grpConfig.SuspendLayout() CType(Me.nudLimit, System.ComponentModel.ISupportInitialize).BeginInit() Me.grpExtra.SuspendLayout() @@ -140,7 +139,7 @@ Partial Class frmGameManager Me.btnBackup.Location = New System.Drawing.Point(616, 586) Me.btnBackup.Name = "btnBackup" Me.btnBackup.Size = New System.Drawing.Size(75, 23) - Me.btnBackup.TabIndex = 19 + Me.btnBackup.TabIndex = 18 Me.btnBackup.Text = "&Backup" Me.btnBackup.UseVisualStyleBackColor = True ' @@ -150,7 +149,7 @@ Partial Class frmGameManager Me.btnClose.Location = New System.Drawing.Point(697, 586) Me.btnClose.Name = "btnClose" Me.btnClose.Size = New System.Drawing.Size(75, 23) - Me.btnClose.TabIndex = 20 + Me.btnClose.TabIndex = 19 Me.btnClose.Text = "C&lose" Me.btnClose.UseVisualStyleBackColor = True ' @@ -187,6 +186,24 @@ Partial Class frmGameManager Me.grpConfig.TabStop = False Me.grpConfig.Text = "Configuration" ' + 'lblComments + ' + Me.lblComments.AutoSize = True + Me.lblComments.Location = New System.Drawing.Point(7, 157) + Me.lblComments.Name = "lblComments" + Me.lblComments.Size = New System.Drawing.Size(59, 13) + Me.lblComments.TabIndex = 18 + Me.lblComments.Text = "Comments:" + ' + 'txtComments + ' + Me.txtComments.Location = New System.Drawing.Point(70, 154) + Me.txtComments.Multiline = True + Me.txtComments.Name = "txtComments" + Me.txtComments.ScrollBars = System.Windows.Forms.ScrollBars.Vertical + Me.txtComments.Size = New System.Drawing.Size(413, 54) + Me.txtComments.TabIndex = 17 + ' 'txtParameter ' Me.txtParameter.Location = New System.Drawing.Point(333, 45) @@ -662,7 +679,7 @@ Partial Class frmGameManager Me.btnMarkAsRestored.Location = New System.Drawing.Point(429, 586) Me.btnMarkAsRestored.Name = "btnMarkAsRestored" Me.btnMarkAsRestored.Size = New System.Drawing.Size(100, 23) - Me.btnMarkAsRestored.TabIndex = 17 + Me.btnMarkAsRestored.TabIndex = 16 Me.btnMarkAsRestored.Text = "&Mark as Restored" Me.btnMarkAsRestored.UseVisualStyleBackColor = True ' @@ -672,7 +689,7 @@ Partial Class frmGameManager Me.btnRestore.Location = New System.Drawing.Point(535, 586) Me.btnRestore.Name = "btnRestore" Me.btnRestore.Size = New System.Drawing.Size(75, 23) - Me.btnRestore.TabIndex = 18 + Me.btnRestore.TabIndex = 17 Me.btnRestore.Text = "&Restore" Me.btnRestore.UseVisualStyleBackColor = True ' @@ -698,7 +715,7 @@ Partial Class frmGameManager 'btnCancel ' Me.btnCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.btnCancel.Location = New System.Drawing.Point(697, 392) + Me.btnCancel.Location = New System.Drawing.Point(697, 394) Me.btnCancel.Name = "btnCancel" Me.btnCancel.Size = New System.Drawing.Size(75, 23) Me.btnCancel.TabIndex = 14 @@ -844,39 +861,11 @@ Partial Class frmGameManager Me.cmsDeleteAll.Size = New System.Drawing.Size(114, 22) Me.cmsDeleteAll.Text = "&All Files" ' - 'btnSessions - ' - Me.btnSessions.Location = New System.Drawing.Point(323, 586) - Me.btnSessions.Name = "btnSessions" - Me.btnSessions.Size = New System.Drawing.Size(100, 23) - Me.btnSessions.TabIndex = 12 - Me.btnSessions.Text = "&View Sessions..." - Me.btnSessions.UseVisualStyleBackColor = True - ' - 'txtComments - ' - Me.txtComments.Location = New System.Drawing.Point(70, 154) - Me.txtComments.Multiline = True - Me.txtComments.Name = "txtComments" - Me.txtComments.ScrollBars = System.Windows.Forms.ScrollBars.Vertical - Me.txtComments.Size = New System.Drawing.Size(413, 54) - Me.txtComments.TabIndex = 17 - ' - 'lblComments - ' - Me.lblComments.AutoSize = True - Me.lblComments.Location = New System.Drawing.Point(7, 157) - Me.lblComments.Name = "lblComments" - Me.lblComments.Size = New System.Drawing.Size(59, 13) - Me.lblComments.TabIndex = 18 - Me.lblComments.Text = "Comments:" - ' 'frmGameManager ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(784, 621) - Me.Controls.Add(Me.btnSessions) Me.Controls.Add(Me.lblQuickFilter) Me.Controls.Add(Me.txtQuickFilter) Me.Controls.Add(Me.btnExport) @@ -996,7 +985,6 @@ Partial Class frmGameManager Friend WithEvents chkCleanFolder As CheckBox Friend WithEvents txtParameter As TextBox Friend WithEvents lblParameter As Label - Friend WithEvents btnSessions As Button Friend WithEvents lblComments As Label Friend WithEvents txtComments As TextBox End Class diff --git a/GBM/Forms/frmGameManager.vb b/GBM/Forms/frmGameManager.vb index b7d68f0..57cee42 100644 --- a/GBM/Forms/frmGameManager.vb +++ b/GBM/Forms/frmGameManager.vb @@ -19,7 +19,8 @@ Public Class frmGameManager Private oRemoteBackupData As SortedList Private bIsDirty As Boolean = False Private bIsLoading As Boolean = False - Private oCurrentTagFilters As New List(Of clsTag) + Private oCurrentIncludeTagFilters As New List(Of clsTag) + Private oCurrentExcludeTagFilters As New List(Of clsTag) Private oCurrentFilters As New List(Of clsGameFilter) Private eCurrentFilter As frmFilter.eFilterType = frmFilter.eFilterType.BaseFilter Private bCurrentAndOperator As Boolean = False @@ -227,7 +228,8 @@ Public Class frmGameManager If Not bRetainFilter Then frm = New frmFilter - frm.TagFilters = oCurrentTagFilters + frm.IncludeTagFilters = oCurrentIncludeTagFilters + frm.ExcludeTagFilters = oCurrentExcludeTagFilters frm.GameFilters = oCurrentFilters frm.FilterType = eCurrentFilter frm.AndOperator = bCurrentAndOperator @@ -236,7 +238,8 @@ Public Class frmGameManager frm.ShowDialog() - oCurrentTagFilters = frm.TagFilters + oCurrentIncludeTagFilters = frm.IncludeTagFilters + oCurrentExcludeTagFilters = frm.ExcludeTagFilters oCurrentFilters = frm.GameFilters eCurrentFilter = frm.FilterType bCurrentAndOperator = frm.AndOperator @@ -244,14 +247,15 @@ Public Class frmGameManager sCurrentSortField = frm.SortField End If Else - oCurrentTagFilters.Clear() + oCurrentIncludeTagFilters.Clear() + oCurrentExcludeTagFilters.Clear() oCurrentFilters.Clear() eCurrentFilter = frmFilter.eFilterType.BaseFilter bCurrentSortAsc = True sCurrentSortField = "Name" End If - GameData = mgrMonitorList.ReadFilteredList(oCurrentTagFilters, oCurrentFilters, eCurrentFilter, bCurrentAndOperator, bCurrentSortAsc, sCurrentSortField) + GameData = mgrMonitorList.ReadFilteredList(oCurrentIncludeTagFilters, oCurrentExcludeTagFilters, oCurrentFilters, eCurrentFilter, bCurrentAndOperator, bCurrentSortAsc, sCurrentSortField) If optPendingRestores.Checked Then oRestoreData = mgrRestore.CompareManifests @@ -907,7 +911,6 @@ Public Class frmGameManager btnExclude.Text = frmGameManager_btnExclude btnImport.Enabled = False btnExport.Enabled = False - btnSessions.Enabled = False Case eModes.Edit grpFilter.Enabled = False lstGames.Enabled = False @@ -932,7 +935,6 @@ Public Class frmGameManager lblTags.Visible = True btnImport.Enabled = False btnExport.Enabled = False - btnSessions.Enabled = False Case eModes.View grpFilter.Enabled = True lstGames.Enabled = True @@ -952,7 +954,6 @@ Public Class frmGameManager lblTags.Visible = True btnImport.Enabled = True btnExport.Enabled = True - btnSessions.Enabled = True Case eModes.ViewTemp grpFilter.Enabled = True lstGames.Enabled = True @@ -975,7 +976,6 @@ Public Class frmGameManager btnExclude.Text = frmGameManager_btnExclude btnImport.Enabled = True btnExport.Enabled = True - btnSessions.Enabled = False Case eModes.Disabled grpFilter.Enabled = True lstGames.Enabled = True @@ -1003,7 +1003,6 @@ Public Class frmGameManager btnExclude.Text = frmGameManager_btnExclude btnImport.Enabled = True btnExport.Enabled = True - btnSessions.Enabled = False Case eModes.MultiSelect lstGames.Enabled = True lblQuickFilter.Enabled = False @@ -1030,7 +1029,6 @@ Public Class frmGameManager lblTags.Visible = False btnImport.Enabled = True btnExport.Enabled = True - btnSessions.Enabled = False End Select lstGames.Focus() @@ -1555,7 +1553,6 @@ Public Class frmGameManager lblLimit.Text = frmGameManager_lblLimit cmsDeleteOne.Text = frmGameManager_cmsDeleteOne cmsDeleteAll.Text = frmGameManager_cmsDeleteAll - btnSessions.Text = frmGameManager_btnSessions 'Init Filter Timer tmFilterTimer = New Timer() @@ -1735,12 +1732,6 @@ Public Class frmGameManager ExportGameList() End Sub - Private Sub btnSessions_Click(sender As Object, e As EventArgs) Handles btnSessions.Click - Dim frm As New frmSession - frm.Game = CurrentGame - frm.ShowDialog() - End Sub - Private Sub txtQuickFilter_TextChanged(sender As Object, e As EventArgs) Handles txtQuickFilter.TextChanged If Not tmFilterTimer.Enabled Then tmFilterTimer.Enabled = True diff --git a/GBM/Forms/frmMain.Designer.vb b/GBM/Forms/frmMain.Designer.vb index 8ba204b..4ecf822 100644 --- a/GBM/Forms/frmMain.Designer.vb +++ b/GBM/Forms/frmMain.Designer.vb @@ -68,6 +68,7 @@ Partial Class frmMain Me.gMonToolsLog = New System.Windows.Forms.ToolStripMenuItem() Me.gMonLogClear = New System.Windows.Forms.ToolStripMenuItem() Me.gMonLogSave = New System.Windows.Forms.ToolStripMenuItem() + Me.gMonToolsSessions = New System.Windows.Forms.ToolStripMenuItem() Me.gMonHelp = New System.Windows.Forms.ToolStripMenuItem() Me.gMonHelpWebSite = New System.Windows.Forms.ToolStripMenuItem() Me.gMonHelpManual = New System.Windows.Forms.ToolStripMenuItem() @@ -84,6 +85,7 @@ Partial Class frmMain Me.lblStatus2 = New System.Windows.Forms.Label() Me.lblStatus3 = New System.Windows.Forms.Label() Me.pbTime = New System.Windows.Forms.PictureBox() + Me.gMonTrayToolsSessions = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTrayMenu.SuspendLayout() Me.gMonStatusStrip.SuspendLayout() Me.gMonMainMenu.SuspendLayout() @@ -103,7 +105,7 @@ Partial Class frmMain ' Me.gMonTrayMenu.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonTrayNotification, Me.gMonTrayShow, Me.gMonTraySep2, Me.gMonTrayMon, Me.gMonTraySettings, Me.gMonTraySetup, Me.gMonTrayTools, Me.gMonTraySep1, Me.gMonTrayExit}) Me.gMonTrayMenu.Name = "gMonTrayMenu" - Me.gMonTrayMenu.Size = New System.Drawing.Size(162, 170) + Me.gMonTrayMenu.Size = New System.Drawing.Size(162, 192) ' 'gMonTrayNotification ' @@ -168,7 +170,7 @@ Partial Class frmMain ' 'gMonTrayTools ' - Me.gMonTrayTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonTrayToolsCleanMan, Me.gMonTrayToolsCompact, Me.gMonTrayToolsLog}) + Me.gMonTrayTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonTrayToolsCleanMan, Me.gMonTrayToolsCompact, Me.gMonTrayToolsLog, Me.gMonTrayToolsSessions}) Me.gMonTrayTools.Name = "gMonTrayTools" Me.gMonTrayTools.Size = New System.Drawing.Size(161, 22) Me.gMonTrayTools.Text = "&Tools" @@ -195,13 +197,13 @@ Partial Class frmMain 'gMonTrayLogClear ' Me.gMonTrayLogClear.Name = "gMonTrayLogClear" - Me.gMonTrayLogClear.Size = New System.Drawing.Size(101, 22) + Me.gMonTrayLogClear.Size = New System.Drawing.Size(152, 22) Me.gMonTrayLogClear.Text = "&Clear" ' 'gMonTrayLogSave ' Me.gMonTrayLogSave.Name = "gMonTrayLogSave" - Me.gMonTrayLogSave.Size = New System.Drawing.Size(101, 22) + Me.gMonTrayLogSave.Size = New System.Drawing.Size(152, 22) Me.gMonTrayLogSave.Text = "&Save" ' 'gMonTraySep1 @@ -348,7 +350,7 @@ Partial Class frmMain ' 'gMonTools ' - Me.gMonTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonToolsCleanMan, Me.gMonToolsCompact, Me.gMonToolsLog}) + Me.gMonTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonToolsCleanMan, Me.gMonToolsCompact, Me.gMonToolsLog, Me.gMonToolsSessions}) Me.gMonTools.Name = "gMonTools" Me.gMonTools.Size = New System.Drawing.Size(47, 20) Me.gMonTools.Text = "&Tools" @@ -384,6 +386,12 @@ Partial Class frmMain Me.gMonLogSave.Size = New System.Drawing.Size(101, 22) Me.gMonLogSave.Text = "&Save" ' + 'gMonToolsSessions + ' + Me.gMonToolsSessions.Name = "gMonToolsSessions" + Me.gMonToolsSessions.Size = New System.Drawing.Size(184, 22) + Me.gMonToolsSessions.Text = "&Session Viewer..." + ' 'gMonHelp ' Me.gMonHelp.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonHelpWebSite, Me.gMonHelpManual, Me.gMonHelpCheckforUpdates, Me.gMonHelpAbout}) @@ -524,6 +532,12 @@ Partial Class frmMain Me.pbTime.TabIndex = 18 Me.pbTime.TabStop = False ' + 'gMonTrayToolsSessions + ' + Me.gMonTrayToolsSessions.Name = "gMonTrayToolsSessions" + Me.gMonTrayToolsSessions.Size = New System.Drawing.Size(184, 22) + Me.gMonTrayToolsSessions.Text = "&Session Viewer..." + ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -621,4 +635,6 @@ Partial Class frmMain Friend WithEvents gMonTrayLogSave As ToolStripMenuItem Friend WithEvents gMonStripAdminButton As System.Windows.Forms.ToolStripStatusLabel Friend WithEvents gMonStripStatusButton As System.Windows.Forms.ToolStripStatusLabel + Friend WithEvents gMonToolsSessions As ToolStripMenuItem + Friend WithEvents gMonTrayToolsSessions As ToolStripMenuItem End Class diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index db15ac7..95b698d 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -824,14 +824,13 @@ Public Class frmMain Private Sub OpenAbout() Dim iProcessType As System.Reflection.ProcessorArchitecture = System.Reflection.AssemblyName.GetAssemblyName(Application.ExecutablePath()).ProcessorArchitecture - 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 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) - mgrCommon.ShowMessage(frmMain_About, New String() {sVersion, sProcessType, sRevision, sSqliteVersion, sConstCopyright}, MsgBoxStyle.Information) + mgrCommon.ShowMessage(frmMain_About, New String() {mgrCommon.DisplayAppVersion, sProcessType, sRevision, sSqliteVersion, sConstCopyright}, MsgBoxStyle.Information) End Sub Private Sub OpenTags() @@ -879,6 +878,20 @@ Public Class frmMain ResumeScan() End Sub + Private Sub OpenSessions() + Dim frm As New frmSessions + PauseScan() + If oSettings.SessionTracking = False Then + mgrCommon.ShowMessage(frmMain_WarningSessionsDisabled, MsgBoxStyle.Exclamation) + End If + If mgrSessions.CountRows > 0 Then + frm.ShowDialog() + Else + mgrCommon.ShowMessage(frmMain_ErrorNoSessions, MsgBoxStyle.Information) + End If + ResumeScan() + End Sub + Private Sub OpenGameWizard() Dim frm As New frmAddWizard PauseScan() @@ -1288,6 +1301,7 @@ Public Class frmMain gMonToolsCleanMan.Text = frmMain_gMonToolsCleanMan gMonToolsCompact.Text = frmMain_gMonToolsCompact gMonToolsLog.Text = frmMain_gMonToolsLog + gMonToolsSessions.Text = frmMain_gMonToolsSessions gMonLogClear.Text = frmMain_gMonLogClear gMonLogSave.Text = frmMain_gMonLogSave gMonHelp.Text = frmMain_gMonHelp @@ -1309,6 +1323,7 @@ Public Class frmMain gMonTrayToolsCleanMan.Text = frmMain_gMonToolsCleanMan gMonTrayToolsCompact.Text = frmMain_gMonToolsCompact gMonTrayToolsLog.Text = frmMain_gMonToolsLog + gMonTrayToolsSessions.Text = frmMain_gMonToolsSessions gMonTrayLogClear.Text = frmMain_gMonLogClear gMonTrayLogSave.Text = frmMain_gMonLogSave gMonTrayExit.Text = frmMain_gMonFileExit @@ -1632,6 +1647,10 @@ Public Class frmMain SaveLog() End Sub + Private Sub gMonToolsSessions_Click(sender As Object, e As EventArgs) Handles gMonToolsSessions.Click, gMonTrayToolsSessions.Click + OpenSessions() + End Sub + Private Sub gMonNotification_Click(sender As Object, e As EventArgs) Handles gMonNotification.Click, gMonTrayNotification.Click gMonNotification.Visible = False gMonTrayNotification.Visible = False @@ -1775,10 +1794,8 @@ Public Class frmMain LoadGameSettings() Else bContinue = False - If oSettings.TimeTracking Then - HandleTimeSpent() - HandleSession() - End If + If oSettings.TimeTracking Then HandleTimeSpent() + If oSettings.SessionTracking Then HandleSession() UpdateLog(mgrCommon.FormatString(frmMain_ErrorBackupUnknownPath, oProcess.GameInfo.Name), False) oProcess.GameInfo = Nothing ResetGameInfo() @@ -1789,10 +1806,8 @@ Public Class frmMain If bContinue Then If DoMultiGameCheck() Then UpdateLog(mgrCommon.FormatString(frmMain_GameEnded, oProcess.GameInfo.Name), False) - If oSettings.TimeTracking Then - HandleTimeSpent() - HandleSession() - End If + If oSettings.TimeTracking Then HandleTimeSpent() + If oSettings.SessionTracking Then HandleSession() RunBackup() Else UpdateLog(frmMain_UnknownGameEnded, False) diff --git a/GBM/Forms/frmSession.Designer.vb b/GBM/Forms/frmSession.Designer.vb deleted file mode 100644 index 0af880c..0000000 --- a/GBM/Forms/frmSession.Designer.vb +++ /dev/null @@ -1,63 +0,0 @@ - _ -Partial Class frmSession - Inherits System.Windows.Forms.Form - - 'Form overrides dispose to clean up the component list. - _ - Protected Overrides Sub Dispose(ByVal disposing As Boolean) - Try - If disposing AndAlso components IsNot Nothing Then - components.Dispose() - End If - Finally - MyBase.Dispose(disposing) - End Try - End Sub - - 'Required by the Windows Form Designer - Private components As System.ComponentModel.IContainer - - 'NOTE: The following procedure is required by the Windows Form Designer - 'It can be modified using the Windows Form Designer. - 'Do not modify it using the code editor. - _ - Private Sub InitializeComponent() - Me.dgSessions = New System.Windows.Forms.DataGridView() - CType(Me.dgSessions, System.ComponentModel.ISupportInitialize).BeginInit() - Me.SuspendLayout() - ' - 'dgSessions - ' - Me.dgSessions.AllowUserToAddRows = False - Me.dgSessions.AllowUserToDeleteRows = False - Me.dgSessions.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize - Me.dgSessions.Location = New System.Drawing.Point(11, 11) - Me.dgSessions.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) - Me.dgSessions.Name = "dgSessions" - Me.dgSessions.ReadOnly = True - Me.dgSessions.RowHeadersVisible = False - Me.dgSessions.RowTemplate.Height = 24 - Me.dgSessions.Size = New System.Drawing.Size(612, 389) - Me.dgSessions.TabIndex = 0 - ' - 'frmSession - ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) - Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(634, 411) - Me.Controls.Add(Me.dgSessions) - Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle - Me.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) - Me.MaximizeBox = False - Me.MinimizeBox = False - Me.Name = "frmSession" - Me.ShowIcon = False - Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "Sessions" - CType(Me.dgSessions, System.ComponentModel.ISupportInitialize).EndInit() - Me.ResumeLayout(False) - - End Sub - - Friend WithEvents dgSessions As DataGridView -End Class diff --git a/GBM/Forms/frmSession.vb b/GBM/Forms/frmSession.vb deleted file mode 100644 index 0f62ec7..0000000 --- a/GBM/Forms/frmSession.vb +++ /dev/null @@ -1,37 +0,0 @@ -Imports GBM.My.Resources - -Public Class frmSession - - Private oGame As clsGame - - Property Game As clsGame - Set(value As clsGame) - oGame = value - End Set - Get - Return oGame - End Get - End Property - - Private Sub FormatGrid() - dgSessions.Columns.Add("Start", frmSession_ColumnStart) - dgSessions.Columns.Add("End", frmSession_ColumnEnd) - dgSessions.Columns.Add("Name", frmSession_ColumnComputerName) - End Sub - - Private Sub LoadData() - Me.Text = Game.Name & " " & frmSession_Name - - Dim oData As DataSet = mgrSessions.GetSessionsByGame(Game.ID) - - For Each dr As DataRow In oData.Tables(0).Rows - dgSessions.Rows.Add(New Object() {mgrCommon.UnixToDate(dr("Start")), mgrCommon.UnixToDate(dr("End")), dr("ComputerName")}) - Next - dgSessions.AutoResizeColumns() - End Sub - - Private Sub frmSession_Load(sender As Object, e As EventArgs) Handles MyBase.Load - FormatGrid() - LoadData() - End Sub -End Class \ No newline at end of file diff --git a/GBM/Forms/frmSessions.Designer.vb b/GBM/Forms/frmSessions.Designer.vb new file mode 100644 index 0000000..9c758f3 --- /dev/null +++ b/GBM/Forms/frmSessions.Designer.vb @@ -0,0 +1,173 @@ + _ +Partial Class frmSessions + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.lblFilter = New System.Windows.Forms.Label() + Me.txtFilter = New System.Windows.Forms.TextBox() + Me.dgSessions = New System.Windows.Forms.DataGridView() + Me.dtpStart = New System.Windows.Forms.DateTimePicker() + Me.dtpEnd = New System.Windows.Forms.DateTimePicker() + Me.lblTo = New System.Windows.Forms.Label() + Me.btnReset = New System.Windows.Forms.Button() + Me.btnDelete = New System.Windows.Forms.Button() + Me.btnClose = New System.Windows.Forms.Button() + Me.lblDateRange = New System.Windows.Forms.Label() + CType(Me.dgSessions, System.ComponentModel.ISupportInitialize).BeginInit() + Me.SuspendLayout() + ' + 'lblFilter + ' + Me.lblFilter.AutoSize = True + Me.lblFilter.Location = New System.Drawing.Point(12, 9) + Me.lblFilter.Name = "lblFilter" + Me.lblFilter.Size = New System.Drawing.Size(63, 13) + Me.lblFilter.TabIndex = 0 + Me.lblFilter.Text = "Game Filter:" + ' + 'txtFilter + ' + Me.txtFilter.Location = New System.Drawing.Point(80, 6) + Me.txtFilter.Name = "txtFilter" + Me.txtFilter.Size = New System.Drawing.Size(190, 20) + Me.txtFilter.TabIndex = 1 + ' + 'dgSessions + ' + Me.dgSessions.AllowUserToAddRows = False + Me.dgSessions.AllowUserToDeleteRows = False + Me.dgSessions.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.dgSessions.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize + Me.dgSessions.EditMode = System.Windows.Forms.DataGridViewEditMode.EditOnF2 + Me.dgSessions.Location = New System.Drawing.Point(12, 32) + Me.dgSessions.Name = "dgSessions" + Me.dgSessions.ReadOnly = True + Me.dgSessions.RowHeadersVisible = False + Me.dgSessions.SelectionMode = System.Windows.Forms.DataGridViewSelectionMode.FullRowSelect + Me.dgSessions.Size = New System.Drawing.Size(760, 488) + Me.dgSessions.TabIndex = 6 + ' + 'dtpStart + ' + Me.dtpStart.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.dtpStart.Location = New System.Drawing.Point(384, 6) + Me.dtpStart.Name = "dtpStart" + Me.dtpStart.Size = New System.Drawing.Size(175, 20) + Me.dtpStart.TabIndex = 3 + ' + 'dtpEnd + ' + Me.dtpEnd.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.dtpEnd.Location = New System.Drawing.Point(597, 6) + Me.dtpEnd.Name = "dtpEnd" + Me.dtpEnd.Size = New System.Drawing.Size(175, 20) + Me.dtpEnd.TabIndex = 5 + ' + 'lblTo + ' + Me.lblTo.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.lblTo.Location = New System.Drawing.Point(565, 9) + Me.lblTo.Name = "lblTo" + Me.lblTo.Size = New System.Drawing.Size(26, 17) + Me.lblTo.TabIndex = 4 + Me.lblTo.Text = "to" + Me.lblTo.TextAlign = System.Drawing.ContentAlignment.TopCenter + ' + 'btnReset + ' + Me.btnReset.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnReset.Location = New System.Drawing.Point(591, 526) + Me.btnReset.Name = "btnReset" + Me.btnReset.Size = New System.Drawing.Size(100, 23) + Me.btnReset.TabIndex = 2 + Me.btnReset.Text = "&Reset Filters" + Me.btnReset.UseVisualStyleBackColor = True + ' + 'btnDelete + ' + Me.btnDelete.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) + Me.btnDelete.Location = New System.Drawing.Point(12, 526) + Me.btnDelete.Name = "btnDelete" + Me.btnDelete.Size = New System.Drawing.Size(100, 23) + Me.btnDelete.TabIndex = 7 + Me.btnDelete.Text = "&Delete Session" + Me.btnDelete.UseVisualStyleBackColor = True + ' + 'btnClose + ' + Me.btnClose.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.btnClose.Location = New System.Drawing.Point(697, 526) + Me.btnClose.Name = "btnClose" + Me.btnClose.Size = New System.Drawing.Size(75, 23) + Me.btnClose.TabIndex = 8 + Me.btnClose.Text = "&Close" + Me.btnClose.UseVisualStyleBackColor = True + ' + 'lblDateRange + ' + Me.lblDateRange.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.lblDateRange.AutoSize = True + Me.lblDateRange.Location = New System.Drawing.Point(310, 9) + Me.lblDateRange.Name = "lblDateRange" + Me.lblDateRange.Size = New System.Drawing.Size(68, 13) + Me.lblDateRange.TabIndex = 9 + Me.lblDateRange.Text = "Date Range:" + ' + 'frmSessions + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(784, 561) + Me.Controls.Add(Me.lblDateRange) + Me.Controls.Add(Me.btnClose) + Me.Controls.Add(Me.btnDelete) + Me.Controls.Add(Me.btnReset) + Me.Controls.Add(Me.lblTo) + Me.Controls.Add(Me.dtpEnd) + Me.Controls.Add(Me.dtpStart) + Me.Controls.Add(Me.dgSessions) + Me.Controls.Add(Me.lblFilter) + Me.Controls.Add(Me.txtFilter) + Me.Name = "frmSessions" + Me.ShowIcon = False + Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Session Viewer" + CType(Me.dgSessions, System.ComponentModel.ISupportInitialize).EndInit() + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + + Friend WithEvents lblFilter As Label + Friend WithEvents txtFilter As TextBox + Friend WithEvents dgSessions As DataGridView + Friend WithEvents dtpStart As DateTimePicker + Friend WithEvents dtpEnd As DateTimePicker + Friend WithEvents lblTo As Label + Friend WithEvents btnReset As Button + Friend WithEvents btnDelete As Button + Friend WithEvents btnClose As Button + Friend WithEvents lblDateRange As Label +End Class diff --git a/GBM/Forms/frmSession.resx b/GBM/Forms/frmSessions.resx similarity index 100% rename from GBM/Forms/frmSession.resx rename to GBM/Forms/frmSessions.resx diff --git a/GBM/Forms/frmSessions.vb b/GBM/Forms/frmSessions.vb new file mode 100644 index 0000000..df6af55 --- /dev/null +++ b/GBM/Forms/frmSessions.vb @@ -0,0 +1,153 @@ +Imports GBM.My.Resources +Imports System.Globalization + +Public Class frmSessions + + Private bInitFinished As Boolean = False + Private WithEvents tmFilterTimer As Timer + + Private Sub FormatGrid() + dgSessions.Columns.Add("MonitorID", frmSessions_ColumnMonitorID) + dgSessions.Columns.Add("Name", frmSessions_ColumnGameName) + dgSessions.Columns.Add("Start", frmSessions_ColumnStart) + dgSessions.Columns.Add("End", frmSessions_ColumnEnd) + + 'Hide the ID + dgSessions.Columns("MonitorID").Visible = False + End Sub + + Private Sub LoadData() + Dim oData As DataSet + Dim sFilter As String + + If txtFilter.Text = String.Empty Then + oData = mgrSessions.GetSessionRange(dtpStart.Value, dtpEnd.Value) + Else + sFilter = txtFilter.Text.ToLower + oData = mgrSessions.GetSessionsByGameNameAndRange(sFilter, dtpStart.Value, dtpEnd.Value) + End If + + dgSessions.Rows.Clear() + + For Each dr As DataRow In oData.Tables(0).Rows + dgSessions.Rows.Add(New Object() {dr("MonitorID"), dr("Name"), mgrCommon.UnixToDate(dr("Start")), mgrCommon.UnixToDate(dr("End"))}) + Next + + dgSessions.AutoResizeColumns() + End Sub + + Private Sub SetForm() + Me.Text = frmSessions_Name + + 'Init Labels + lblFilter.Text = frmSessions_lblFilter + lblDateRange.Text = frmSessions_lblDateRange + btnDelete.Text = frmSessions_btnDelete + btnReset.Text = frmSessions_btnReset + btnClose.Text = frmSessions_btnClose + + 'Init Filter Timer + tmFilterTimer = New Timer() + tmFilterTimer.Interval = 1000 + tmFilterTimer.Enabled = False + + + End Sub + + Private Sub ResetFilterFields() + Dim dtMinDate As DateTime = mgrSessions.GetMinimumDateTime + Dim dtMaxDate As DateTime = mgrSessions.GetMaximumDateTime + Dim sDateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern & " " & CultureInfo.CurrentCulture.DateTimeFormat.LongTimePattern + + bInitFinished = False + + 'Init Date Fields + dtpStart.Format = DateTimePickerFormat.Custom + dtpEnd.Format = DateTimePickerFormat.Custom + dtpStart.CustomFormat = sDateTimeFormat + dtpEnd.CustomFormat = sDateTimeFormat + + 'Setting max or min dates breaks the control in Mono + If Not mgrCommon.IsUnix Then + dtpStart.MinDate = dtMinDate + dtpStart.MaxDate = dtMaxDate + dtpEnd.MinDate = dtMinDate + dtpEnd.MaxDate = dtMaxDate + End If + + dtpStart.Value = dtMinDate + dtpEnd.Value = dtMaxDate + + 'Init Text Filter + txtFilter.Text = String.Empty + + bInitFinished = True + End Sub + + Private Sub Reset() + ResetFilterFields() + LoadData() + End Sub + + Private Sub DeleteSession() + Dim oSession As clsSession + Dim oSessions As New List(Of clsSession) + + For Each dgvRow As DataGridViewRow In dgSessions.SelectedRows + oSession = New clsSession + oSession.MonitorID = dgvRow.Cells(0).Value + oSession.SessionStart = dgvRow.Cells(2).Value + oSession.SessionEnd = dgvRow.Cells(3).Value + oSessions.Add(oSession) + Next + + If oSessions.Count > 0 Then + mgrSessions.DeleteSession(oSessions) + End If + End Sub + + Private Sub frmSession_Load(sender As Object, e As EventArgs) Handles MyBase.Load + SetForm() + ResetFilterFields() + FormatGrid() + LoadData() + End Sub + + Private Sub tmFilterTimer_Tick(sender As Object, ByVal e As EventArgs) Handles tmFilterTimer.Tick + LoadData() + tmFilterTimer.Stop() + tmFilterTimer.Enabled = False + End Sub + + Private Sub txtFilter_TextChanged(sender As Object, e As EventArgs) Handles txtFilter.TextChanged + If Not tmFilterTimer.Enabled Then + tmFilterTimer.Enabled = True + tmFilterTimer.Start() + End If + End Sub + + Private Sub dtpStart_ValueChanged(sender As Object, e As EventArgs) Handles dtpStart.ValueChanged + If bInitFinished Then LoadData() + End Sub + + Private Sub dtpEnd_ValueChanged(sender As Object, e As EventArgs) Handles dtpEnd.ValueChanged + If bInitFinished Then LoadData() + End Sub + + Private Sub btnReset_Click(sender As Object, e As EventArgs) Handles btnReset.Click + Reset() + End Sub + + Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click + Me.Close() + End Sub + + Private Sub btnDelete_Click(sender As Object, e As EventArgs) Handles btnDelete.Click + If dgSessions.SelectedRows.Count > 0 Then + If mgrCommon.ShowMessage(frmSessions_ConfirmDelete, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then + DeleteSession() + Reset() + End If + End If + End Sub +End Class \ No newline at end of file diff --git a/GBM/Forms/frmSettings.Designer.vb b/GBM/Forms/frmSettings.Designer.vb index 74b7a54..4234be1 100644 --- a/GBM/Forms/frmSettings.Designer.vb +++ b/GBM/Forms/frmSettings.Designer.vb @@ -65,6 +65,7 @@ Partial Class frmSettings Me.pnlGeneral = New System.Windows.Forms.Panel() Me.grpGameData = New System.Windows.Forms.GroupBox() Me.lstSettings = New System.Windows.Forms.ListBox() + Me.chkSessionTracking = New System.Windows.Forms.CheckBox() Me.grpStartup.SuspendLayout() Me.grpFolderOptions.SuspendLayout() Me.grp7zGeneral.SuspendLayout() @@ -123,7 +124,7 @@ Partial Class frmSettings 'chkAutoSaveLog ' Me.chkAutoSaveLog.AutoSize = True - Me.chkAutoSaveLog.Location = New System.Drawing.Point(6, 204) + Me.chkAutoSaveLog.Location = New System.Drawing.Point(12, 228) Me.chkAutoSaveLog.Name = "chkAutoSaveLog" Me.chkAutoSaveLog.Size = New System.Drawing.Size(231, 17) Me.chkAutoSaveLog.TabIndex = 3 @@ -132,7 +133,7 @@ Partial Class frmSettings ' 'btnOptionalFields ' - Me.btnOptionalFields.Location = New System.Drawing.Point(110, 38) + Me.btnOptionalFields.Location = New System.Drawing.Point(103, 61) Me.btnOptionalFields.Name = "btnOptionalFields" Me.btnOptionalFields.Size = New System.Drawing.Size(134, 23) Me.btnOptionalFields.TabIndex = 2 @@ -152,7 +153,7 @@ Partial Class frmSettings 'chkSync ' Me.chkSync.AutoSize = True - Me.chkSync.Location = New System.Drawing.Point(6, 42) + Me.chkSync.Location = New System.Drawing.Point(6, 65) Me.chkSync.Name = "chkSync" Me.chkSync.Size = New System.Drawing.Size(98, 17) Me.chkSync.TabIndex = 1 @@ -162,7 +163,7 @@ Partial Class frmSettings 'chkShowDetectionTips ' Me.chkShowDetectionTips.AutoSize = True - Me.chkShowDetectionTips.Location = New System.Drawing.Point(6, 181) + Me.chkShowDetectionTips.Location = New System.Drawing.Point(12, 205) Me.chkShowDetectionTips.Name = "chkShowDetectionTips" Me.chkShowDetectionTips.Size = New System.Drawing.Size(159, 17) Me.chkShowDetectionTips.TabIndex = 2 @@ -401,9 +402,9 @@ Partial Class frmSettings Me.grpBackupHandling.Controls.Add(Me.chkRestoreNotify) Me.grpBackupHandling.Controls.Add(Me.chkAutoMark) Me.grpBackupHandling.Location = New System.Drawing.Point(6, 88) - Me.grpBackupHandling.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) + Me.grpBackupHandling.Margin = New System.Windows.Forms.Padding(2) Me.grpBackupHandling.Name = "grpBackupHandling" - Me.grpBackupHandling.Padding = New System.Windows.Forms.Padding(2, 2, 2, 2) + Me.grpBackupHandling.Padding = New System.Windows.Forms.Padding(2) Me.grpBackupHandling.Size = New System.Drawing.Size(354, 87) Me.grpBackupHandling.TabIndex = 1 Me.grpBackupHandling.TabStop = False @@ -413,7 +414,7 @@ Partial Class frmSettings ' Me.chkAutoRestore.AutoSize = True Me.chkAutoRestore.Location = New System.Drawing.Point(8, 41) - Me.chkAutoRestore.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) + Me.chkAutoRestore.Margin = New System.Windows.Forms.Padding(2) Me.chkAutoRestore.Name = "chkAutoRestore" Me.chkAutoRestore.Size = New System.Drawing.Size(190, 17) Me.chkAutoRestore.TabIndex = 1 @@ -424,7 +425,7 @@ Partial Class frmSettings ' Me.chkRestoreNotify.AutoSize = True Me.chkRestoreNotify.Location = New System.Drawing.Point(8, 19) - Me.chkRestoreNotify.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) + Me.chkRestoreNotify.Margin = New System.Windows.Forms.Padding(2) Me.chkRestoreNotify.Name = "chkRestoreNotify" Me.chkRestoreNotify.Size = New System.Drawing.Size(216, 17) Me.chkRestoreNotify.TabIndex = 0 @@ -489,12 +490,13 @@ Partial Class frmSettings ' 'grpGameData ' + Me.grpGameData.Controls.Add(Me.chkSessionTracking) Me.grpGameData.Controls.Add(Me.chkTimeTracking) Me.grpGameData.Controls.Add(Me.chkSync) Me.grpGameData.Controls.Add(Me.btnOptionalFields) Me.grpGameData.Location = New System.Drawing.Point(6, 106) Me.grpGameData.Name = "grpGameData" - Me.grpGameData.Size = New System.Drawing.Size(354, 69) + Me.grpGameData.Size = New System.Drawing.Size(354, 92) Me.grpGameData.TabIndex = 1 Me.grpGameData.TabStop = False Me.grpGameData.Text = "Game Data" @@ -507,6 +509,16 @@ Partial Class frmSettings Me.lstSettings.Size = New System.Drawing.Size(162, 303) Me.lstSettings.TabIndex = 0 ' + 'chkSessionTracking + ' + Me.chkSessionTracking.AutoSize = True + Me.chkSessionTracking.Location = New System.Drawing.Point(6, 42) + Me.chkSessionTracking.Name = "chkSessionTracking" + Me.chkSessionTracking.Size = New System.Drawing.Size(138, 17) + Me.chkSessionTracking.TabIndex = 3 + Me.chkSessionTracking.Text = "Enable session tracking" + Me.chkSessionTracking.UseVisualStyleBackColor = True + ' 'frmSettings ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -592,4 +604,5 @@ Partial Class frmSettings Friend WithEvents chkAutoMark As CheckBox Friend WithEvents chkAutoRestore As CheckBox Friend WithEvents chkRestoreNotify As CheckBox + Friend WithEvents chkSessionTracking As CheckBox End Class diff --git a/GBM/Forms/frmSettings.vb b/GBM/Forms/frmSettings.vb index a2ff9b3..42fa217 100644 --- a/GBM/Forms/frmSettings.vb +++ b/GBM/Forms/frmSettings.vb @@ -51,6 +51,7 @@ Public Class frmSettings oSettings.AutoRestore = chkAutoRestore.Checked oSettings.AutoMark = chkAutoMark.Checked oSettings.TimeTracking = chkTimeTracking.Checked + oSettings.SessionTracking = chkSessionTracking.Checked oSettings.SupressBackup = chkSupressBackup.Checked oSettings.SupressBackupThreshold = nudSupressBackupThreshold.Value oSettings.CompressionLevel = cboCompression.SelectedValue @@ -177,6 +178,7 @@ Public Class frmSettings txtBackupFolder.Text = oSettings.BackupFolder chkSync.Checked = oSettings.Sync chkTimeTracking.Checked = oSettings.TimeTracking + chkSessionTracking.Checked = oSettings.SessionTracking chkSupressBackup.Checked = oSettings.SupressBackup nudSupressBackupThreshold.Value = oSettings.SupressBackupThreshold nudSupressBackupThreshold.Enabled = chkSupressBackup.Checked @@ -289,6 +291,7 @@ Public Class frmSettings grpStartup.Text = frmSettings_grpStartup grpGameData.Text = frmSettings_grpGameData chkTimeTracking.Text = frmSettings_chkTimeTracking + chkSessionTracking.Text = frmSettings_chkSessionTracking chkStartWindows.Text = frmSettings_chkStartWindows chkSync.Text = frmSettings_chkSync chkShowDetectionTips.Text = frmSettings_chkShowDetectionTips diff --git a/GBM/Game Backup Monitor.vbproj b/GBM/Game Backup Monitor.vbproj index d747e38..5804d33 100644 --- a/GBM/Game Backup Monitor.vbproj +++ b/GBM/Game Backup Monitor.vbproj @@ -126,6 +126,7 @@ + @@ -169,10 +170,10 @@ Form - - frmSession.vb + + frmSessions.vb - + Form @@ -275,8 +276,8 @@ frmIncludeExclude.vb - - frmSession.vb + + frmSessions.vb frmStartUpWizard.vb diff --git a/GBM/Managers/mgrCommon.vb b/GBM/Managers/mgrCommon.vb index 2339d33..fa59326 100644 --- a/GBM/Managers/mgrCommon.vb +++ b/GBM/Managers/mgrCommon.vb @@ -37,6 +37,12 @@ Public Class mgrCommon End Get End Property + Public Shared ReadOnly Property DisplayAppVersion As String + Get + Return My.Application.Info.Version.Major & "." & My.Application.Info.Version.Minor & "." & My.Application.Info.Version.Build + End Get + End Property + 'Source - https://stackoverflow.com/questions/18873152/deep-copy-of-ordereddictionary Public Shared Function GenericClone(ByVal oOriginal As Object) As Object 'Construct a temporary memory stream diff --git a/GBM/Managers/mgrMonitorList.vb b/GBM/Managers/mgrMonitorList.vb index 2364f74..263aece 100644 --- a/GBM/Managers/mgrMonitorList.vb +++ b/GBM/Managers/mgrMonitorList.vb @@ -158,6 +158,10 @@ Public Class mgrMonitorList sSQL = "DELETE FROM gametags " sSQL &= "WHERE MonitorID = @MonitorID;" + If iSelectDB = mgrSQLite.Database.Local Then + sSQL &= "DELETE FROM sessions " + sSQL &= "WHERE MonitorID = @MonitorID;" + End If sSQL &= "DELETE FROM monitorlist " sSQL &= "WHERE MonitorID = @MonitorID;" @@ -185,6 +189,20 @@ Public Class mgrMonitorList sSQL = sSQL.TrimEnd(",") sSQL &= ");" + If iSelectDB = mgrSQLite.Database.Local Then + sSQL &= "DELETE FROM sessions " + sSQL &= "WHERE MonitorID IN (" + + For Each s As String In sMonitorIDs + sSQL &= "@MonitorID" & iCounter & "," + hshParams.Add("MonitorID" & iCounter, s) + iCounter += 1 + Next + + sSQL = sSQL.TrimEnd(",") + sSQL &= ");" + End If + sSQL &= "DELETE FROM monitorlist " sSQL &= "WHERE MonitorID IN (" @@ -407,6 +425,10 @@ Public Class mgrMonitorList sSQL = "DELETE FROM gametags " sSQL &= "WHERE MonitorID = @MonitorID;" + If iSelectDB = mgrSQLite.Database.Local Then + sSQL &= "DELETE FROM sessions " + sSQL &= "WHERE MonitorID = @MonitorID;" + End If sSQL &= "DELETE FROM monitorlist " sSQL &= "WHERE Name = @Name AND Process= @Process;" @@ -500,8 +522,9 @@ Public Class mgrMonitorList End Sub 'Filter Functions - Private Shared Function BuildFilterQuery(ByVal oTagFilters As List(Of clsTag), ByVal oFilters As List(Of clsGameFilter), ByVal eFilterType As frmFilter.eFilterType, ByVal bAndOperator As Boolean, - ByVal bSortAsc As Boolean, ByVal sSortField As String, ByRef hshParams As Hashtable) As String + Private Shared Function BuildFilterQuery(ByVal oIncludeTagFilters As List(Of clsTag), ByVal oExcludeTagFilters As List(Of clsTag), ByVal oFilters As List(Of clsGameFilter), + ByVal eFilterType As frmFilter.eFilterType, ByVal bAndOperator As Boolean, ByVal bSortAsc As Boolean, ByVal sSortField As String, + ByRef hshParams As Hashtable) As String Dim sSQL As String = String.Empty Dim iCounter As Integer = 0 Dim sBaseSelect As String = "MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter, Comments FROM monitorlist" @@ -517,28 +540,87 @@ Public Class mgrMonitorList Case frmFilter.eFilterType.BaseFilter sSQL = "SELECT " & sBaseSelect Case frmFilter.eFilterType.AnyTag - sSQL = "SELECT DISTINCT " & sBaseSelect - sSQL &= " NATURAL JOIN gametags WHERE gametags.TagID IN (" - For Each oTag As clsTag In oTagFilters - sSQL &= "@TagID" & iCounter & "," - hshParams.Add("TagID" & iCounter, oTag.ID) - iCounter += 1 - Next + If oExcludeTagFilters.Count > 0 And oIncludeTagFilters.Count = 0 Then + sSQL = "SELECT " & sBaseSelect - sSQL = sSQL.TrimEnd(",") - sSQL &= ")" - Case frmFilter.eFilterType.AllTags - sSQL = "SELECT " & sBaseSelect & " WHERE MonitorID IN " + sSQL &= " WHERE MonitorID NOT IN (SELECT MonitorID FROM monitorlist NATURAL JOIN gametags WHERE gametags.TagID IN (" - For Each oTag As clsTag In oTagFilters - sSQL &= "(SELECT MonitorID FROM gametags WHERE monitorlist.MonitorID = gametags.MonitorID And TagID = @TagID" & iCounter & ")" - If iCounter <> oTagFilters.Count - 1 Then - sSQL &= " AND MonitorID IN " + For Each oTag As clsTag In oExcludeTagFilters + sSQL &= "@TagID" & iCounter & "," + hshParams.Add("TagID" & iCounter, oTag.ID) + iCounter += 1 + Next + + sSQL = sSQL.TrimEnd(",") + sSQL &= "))" + Else + sSQL = "SELECT DISTINCT " & sBaseSelect + + sSQL &= " NATURAL JOIN gametags WHERE gametags.TagID IN (" + + For Each oTag As clsTag In oIncludeTagFilters + sSQL &= "@TagID" & iCounter & "," + hshParams.Add("TagID" & iCounter, oTag.ID) + iCounter += 1 + Next + + sSQL = sSQL.TrimEnd(",") + sSQL &= ")" + + If oExcludeTagFilters.Count > 0 Then + sSQL &= " AND MonitorID NOT IN (SELECT MonitorID FROM monitorlist NATURAL JOIN gametags WHERE gametags.TagID IN (" + + For Each oTag As clsTag In oExcludeTagFilters + sSQL &= "@TagID" & iCounter & "," + hshParams.Add("TagID" & iCounter, oTag.ID) + iCounter += 1 + Next + + sSQL = sSQL.TrimEnd(",") + sSQL &= "))" End If - hshParams.Add("TagID" & iCounter, oTag.ID) - iCounter += 1 - Next + End If + + Case frmFilter.eFilterType.AllTags + + If oExcludeTagFilters.Count > 0 And oIncludeTagFilters.Count = 0 Then + sSQL = "SELECT " & sBaseSelect & " WHERE MonitorID NOT IN " + + For Each oTag As clsTag In oExcludeTagFilters + sSQL &= "(SELECT MonitorID FROM gametags WHERE monitorlist.MonitorID = gametags.MonitorID And TagID = @TagID" & iCounter & ")" + If iCounter <> oExcludeTagFilters.Count - 1 Then + sSQL &= " AND MonitorID IN " + End If + hshParams.Add("TagID" & iCounter, oTag.ID) + iCounter += 1 + Next + Else + sSQL = "SELECT " & sBaseSelect & " WHERE MonitorID IN " + + For Each oTag As clsTag In oIncludeTagFilters + sSQL &= "(SELECT MonitorID FROM gametags WHERE monitorlist.MonitorID = gametags.MonitorID And TagID = @TagID" & iCounter & ")" + If iCounter <> oIncludeTagFilters.Count - 1 Then + sSQL &= " AND MonitorID IN " + End If + hshParams.Add("TagID" & iCounter, oTag.ID) + iCounter += 1 + Next + + If oExcludeTagFilters.Count > 0 Then + sSQL &= " AND MonitorID NOT IN (SELECT MonitorID FROM monitorlist NATURAL JOIN gametags WHERE gametags.TagID IN (" + + For Each oTag As clsTag In oExcludeTagFilters + sSQL &= "@TagID" & iCounter & "," + hshParams.Add("TagID" & iCounter, oTag.ID) + iCounter += 1 + Next + + sSQL = sSQL.TrimEnd(",") + sSQL &= "))" + End If + End If + Case frmFilter.eFilterType.NoTags sSQL = "SELECT " & sBaseSelect & " WHERE MonitorID NOT IN (SELECT MonitorID FROM gametags)" End Select @@ -553,6 +635,10 @@ Public Class mgrMonitorList iCounter = 0 For Each oFilter As clsGameFilter In oFilters + If oFilter.NotCondition Then + sSQL &= " NOT " + End If + Select Case oFilter.Field.Type Case clsGameFilterField.eDataType.fString sSQL &= oFilter.Field.FieldName & " LIKE @" & oFilter.ID @@ -584,7 +670,7 @@ Public Class mgrMonitorList End Function - Public Shared Function ReadFilteredList(ByVal oTagFilters As List(Of clsTag), ByVal oFilters As List(Of clsGameFilter), ByVal eFilterType As frmFilter.eFilterType, ByVal bAndOperator As Boolean, + Public Shared Function ReadFilteredList(ByVal oIncludeTagFilters As List(Of clsTag), ByVal oExcludeTagFilters As List(Of clsTag), ByVal oFilters As List(Of clsGameFilter), ByVal eFilterType As frmFilter.eFilterType, ByVal bAndOperator As Boolean, ByVal bSortAsc As Boolean, ByVal sSortField As String, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As OrderedDictionary Dim oDatabase As New mgrSQLite(iSelectDB) Dim oData As DataSet @@ -594,7 +680,7 @@ Public Class mgrMonitorList Dim hshParams As New Hashtable Dim iCounter As Integer = 0 - sSQL = BuildFilterQuery(oTagFilters, oFilters, eFilterType, bAndOperator, bSortAsc, sSortField, hshParams) + sSQL = BuildFilterQuery(oIncludeTagFilters, oExcludeTagFilters, oFilters, eFilterType, bAndOperator, bSortAsc, sSortField, hshParams) oData = oDatabase.ReadParamData(sSQL, hshParams) @@ -609,7 +695,7 @@ Public Class mgrMonitorList 'Import / Export Functions - Public Shared Function ReadListForExport(ByVal oTagFilters As List(Of clsTag), ByVal oFilters As List(Of clsGameFilter), ByVal eFilterType As frmFilter.eFilterType, ByVal bAndOperator As Boolean, + Public Shared Function ReadListForExport(ByVal oIncludeTagFilters As List(Of clsTag), ByVal oExcludeTagFilters As List(Of clsTag), ByVal oFilters As List(Of clsGameFilter), ByVal eFilterType As frmFilter.eFilterType, ByVal bAndOperator As Boolean, ByVal bSortAsc As Boolean, ByVal sSortField As String, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As List(Of Game) Dim oDatabase As New mgrSQLite(iSelectDB) Dim oData As DataSet @@ -619,7 +705,7 @@ Public Class mgrMonitorList Dim oGame As Game Dim hshParams As New Hashtable - sSQL = BuildFilterQuery(oTagFilters, oFilters, eFilterType, bAndOperator, bSortAsc, sSortField, hshParams) + sSQL = BuildFilterQuery(oIncludeTagFilters, oExcludeTagFilters, oFilters, eFilterType, bAndOperator, bSortAsc, sSortField, hshParams) oData = oDatabase.ReadParamData(sSQL, hshParams) @@ -671,11 +757,12 @@ Public Class mgrMonitorList Dim hshSyncItems As Hashtable Dim oFromItem As clsGame Dim oToItem As clsGame + Dim oExportInfo As New ExportData Cursor.Current = Cursors.WaitCursor 'Add / Update Sync - hshCompareFrom = mgrXML.ReadMonitorList(sLocation, bWebRead) + hshCompareFrom = mgrXML.ReadMonitorList(sLocation, oExportInfo, bWebRead) hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Local) hshSyncItems = hshCompareFrom.Clone @@ -693,6 +780,7 @@ Public Class mgrMonitorList If hshSyncItems.Count > 0 Then Dim frm As New frmAdvancedImport + frm.ImportInfo = oExportInfo frm.ImportData = hshSyncItems If frm.ShowDialog() = DialogResult.OK Then Cursor.Current = Cursors.WaitCursor @@ -713,7 +801,8 @@ Public Class mgrMonitorList Public Shared Sub ExportMonitorList(ByVal sLocation As String) Dim oList As List(Of Game) Dim bSuccess As Boolean = False - Dim oTagFilters As New List(Of clsTag) + Dim oIncludeTagFilters As New List(Of clsTag) + Dim oExcludeTagFilters As New List(Of clsTag) Dim oFilters As New List(Of clsGameFilter) Dim eCurrentFilter As frmFilter.eFilterType = frmFilter.eFilterType.BaseFilter Dim bAndOperator As Boolean = True @@ -723,7 +812,8 @@ Public Class mgrMonitorList If mgrCommon.ShowMessage(mgrMonitorList_ConfirmApplyFilter, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then Dim frm As New frmFilter frm.ShowDialog() - oTagFilters = frm.TagFilters + oIncludeTagFilters = frm.IncludeTagFilters + oExcludeTagFilters = frm.ExcludeTagFilters oFilters = frm.GameFilters eCurrentFilter = frm.FilterType bAndOperator = frm.AndOperator @@ -731,7 +821,7 @@ Public Class mgrMonitorList sSortField = frm.SortField End If - oList = ReadListForExport(oTagFilters, oFilters, eCurrentFilter, bAndOperator, bSortAsc, sSortField) + oList = ReadListForExport(oIncludeTagFilters, oExcludeTagFilters, oFilters, eCurrentFilter, bAndOperator, bSortAsc, sSortField) bSuccess = mgrXML.SerializeAndExport(oList, sLocation) diff --git a/GBM/Managers/mgrSQLite.vb b/GBM/Managers/mgrSQLite.vb index 937a0a1..bb6b928 100644 --- a/GBM/Managers/mgrSQLite.vb +++ b/GBM/Managers/mgrSQLite.vb @@ -74,7 +74,7 @@ Public Class mgrSQLite "DisableConfirmation BOOLEAN NOT NULL, CreateSubFolder BOOLEAN NOT NULL, ShowOverwriteWarning BOOLEAN NOT NULL, RestoreOnLaunch BOOLEAN NOT NULL, " & "BackupFolder TEXT NOT NULL, Sync BOOLEAN NOT NULL, StartWithWindows BOOLEAN NOT NULL, TimeTracking BOOLEAN NOT NULL, " & "SupressBackup BOOLEAN NOT NULL, SupressBackupThreshold INTEGER NOT NULL, CompressionLevel INTEGER NOT NULL, Custom7zArguments TEXT, " & - "Custom7zLocation TEXT, SyncFields INTEGER NOT NULL, AutoSaveLog BOOLEAN NOT NULL, AutoRestore BOOLEAN NOT NULL, AutoMark BOOLEAN NOT NULL);" + "Custom7zLocation TEXT, SyncFields INTEGER NOT NULL, AutoSaveLog BOOLEAN NOT NULL, AutoRestore BOOLEAN NOT NULL, AutoMark BOOLEAN NOT NULL, SessionTracking BOOLEAN NOT NULL);" 'Add Tables (SavedPath) sSql &= "CREATE TABLE savedpath (PathName TEXT NOT NULL PRIMARY KEY, Path TEXT NOT NULL);" @@ -98,6 +98,9 @@ Public Class mgrSQLite sSql &= "CREATE TABLE manifest (ManifestID TEXT NOT NULL PRIMARY KEY, Name TEXT NOT NULL, FileName TEXT NOT NULL, RestorePath TEXT NOT NULL, " & "AbsolutePath BOOLEAN NOT NULL, DateUpdated TEXT NOT NULL, UpdatedBy TEXT NOT NULL, CheckSum TEXT);" + 'Add Tables (Sessions) + sSql &= "CREATE TABLE sessions (MonitorID TEXT NOT NULL, Start INTEGER NOT NULL, End INTEGER NOT NULL, PRIMARY KEY(MonitorID, Start));" + 'Set Version sSql &= "PRAGMA user_version=" & mgrCommon.AppVersion @@ -132,10 +135,6 @@ Public Class mgrSQLite 'Add Tables (Remote Game Tags) sSql &= "CREATE TABLE gametags (TagID TEXT NOT NULL, MonitorID TEXT NOT NULL, PRIMARY KEY(TagID, MonitorID)); " - 'Add Tables (Sessions) - sSql &= "CREATE TABLE sessions (MonitorID TEXT NOT NULL, Start INTEGER NOT NULL, End INTEGER NOT NULL, " & - "ComputerName TEXT NOT NULL, PRIMARY KEY(MonitorID, Start));" - 'Set Version sSql &= "PRAGMA user_version=" & mgrCommon.AppVersion @@ -262,6 +261,27 @@ Public Class mgrSQLite Return oData End Function + Public Function ReadSingleValue(ByVal sSQL As String, ByVal hshParams As Hashtable) As Object + + Dim command As SqliteCommand + Dim oResult As New Object + + Connect() + Command = New SqliteCommand(sSQL, db) + BuildParams(command, hshParams) + + Try + oResult = command.ExecuteScalar() + Catch ex As Exception + mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Information) + Finally + command.Dispose() + Disconnect() + End Try + + Return oResult + End Function + Private Function GetDatabaseVersion() As Integer Dim sSQL As String Dim iVer As Integer @@ -690,8 +710,12 @@ Public Class mgrSQLite 'Backup DB before starting BackupDB("v102") + 'Add Tables (Sessions) + sSQL = "CREATE TABLE sessions (MonitorID TEXT NOT NULL, Start INTEGER NOT NULL, End INTEGER NOT NULL, PRIMARY KEY(MonitorID, Start));" + 'Add new field(s) - sSQL = "ALTER TABLE monitorlist ADD COLUMN Comments TEXT;" + sSQL &= "ALTER TABLE monitorlist ADD COLUMN Comments TEXT;" + sSQL &= "ALTER TABLE settings ADD COLUMN SessionTracking BOOLEAN DEFAULT 0;" sSQL &= "PRAGMA user_version=105" @@ -701,12 +725,8 @@ Public Class mgrSQLite 'Backup DB before starting BackupDB("v102") - 'Add Tables (Sessions) - sSQL = "CREATE TABLE sessions (MonitorID TEXT NOT NULL, Start INTEGER NOT NULL, End INTEGER NOT NULL, " & - "ComputerName TEXT NOT NULL, PRIMARY KEY(MonitorID, Start));" - 'Add new field(s) - sSQL &= "ALTER TABLE monitorlist ADD COLUMN Comments TEXT;" + sSQL = "ALTER TABLE monitorlist ADD COLUMN Comments TEXT;" sSQL &= "PRAGMA user_version=105" diff --git a/GBM/Managers/mgrSessions.vb b/GBM/Managers/mgrSessions.vb index ce92811..ab68b43 100644 --- a/GBM/Managers/mgrSessions.vb +++ b/GBM/Managers/mgrSessions.vb @@ -6,7 +6,6 @@ oSession.MonitorID = CStr(dr("MonitorID")) oSession.SessionStart = mgrCommon.UnixToDate(CInt(dr("Start"))) oSession.SessionEnd = mgrCommon.UnixToDate(CInt(dr("End"))) - oSession.ComputerName = CStr(dr("ComputerName")) Return oSession End Function @@ -17,33 +16,111 @@ hshParams.Add("MonitorID", oSession.MonitorID) hshParams.Add("Start", mgrCommon.DateToUnix(oSession.SessionStart)) hshParams.Add("End", mgrCommon.DateToUnix(oSession.SessionEnd)) - hshParams.Add("ComputerName", oSession.ComputerName) Return hshParams End Function - Public Shared Sub AddSession(ByVal oSession As clsSession) - Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Remote) + Public Shared Sub AddSession(ByVal oSession As clsSession, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) + Dim oDatabase As New mgrSQLite(iSelectDB) Dim sSQL As String Dim hshParams As Hashtable - sSQL = "INSERT INTO sessions (MonitorID, Start, End, ComputerName) VALUES (@MonitorID, @Start, @End, @ComputerName);" + sSQL = "INSERT INTO sessions (MonitorID, Start, End) VALUES (@MonitorID, @Start, @End);" hshParams = SetCoreParameters(oSession) oDatabase.RunParamQuery(sSQL, hshParams) End Sub - Public Shared Function GetSessionsByGame(ByVal sMonitorID As String) As DataSet - Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Remote) + Public Shared Function GetSessions(Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As DataSet + Dim oDatabase As New mgrSQLite(iSelectDB) Dim sSQL As String Dim hshParams As New Hashtable - sSQL = "SELECT Start, End, ComputerName FROM sessions WHERE MonitorID = @MonitorID;" - - hshParams.Add("MonitorID", sMonitorID) + sSQL = "SELECT sessions.MonitorID, monitorlist.Name, Start, End FROM sessions NATURAL JOIN monitorlist;" Return oDatabase.ReadParamData(sSQL, hshParams) End Function -End Class + Public Shared Function GetSessionRange(ByVal dtStart As DateTime, ByVal dtEnd As DateTime, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As DataSet + Dim oDatabase As New mgrSQLite(iSelectDB) + Dim sSQL As String + Dim hshParams As New Hashtable + + sSQL = "SELECT sessions.MonitorID, monitorlist.Name, Start, End FROM sessions NATURAL JOIN monitorlist WHERE Start >= @Start AND End <= @End;" + + hshParams.Add("Start", mgrCommon.DateToUnix(dtStart)) + hshParams.Add("End", mgrCommon.DateToUnix(dtEnd)) + + Return oDatabase.ReadParamData(sSQL, hshParams) + End Function + + Public Shared Function GetSessionsByGameNameAndRange(ByVal sGameName As String, ByVal dtStart As DateTime, ByVal dtEnd As DateTime, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As DataSet + Dim oDatabase As New mgrSQLite(iSelectDB) + Dim sSQL As String + Dim hshParams As New Hashtable + + sSQL = "SELECT sessions.MonitorID, monitorlist.Name, Start, End FROM sessions NATURAL JOIN monitorlist WHERE monitorlist.Name LIKE @Name AND (Start >= @Start AND End <= @End);" + + hshParams.Add("Name", "%" & sGameName & "%") + hshParams.Add("Start", mgrCommon.DateToUnix(dtStart)) + hshParams.Add("End", mgrCommon.DateToUnix(dtEnd)) + + Return oDatabase.ReadParamData(sSQL, hshParams) + End Function + + Public Shared Sub DeleteSession(ByVal oSessions As List(Of clsSession), Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) + Dim oDatabase As New mgrSQLite(iSelectDB) + Dim sSQL As String + Dim hshParams As Hashtable + Dim oParamList As New List(Of Hashtable) + + sSQL = "DELETE FROM sessions WHERE MonitorID = @MonitorID AND Start = @Start;" + + For Each oSession As clsSession In oSessions + hshParams = New Hashtable + hshParams.Add("MonitorID", oSession.MonitorID) + hshParams.Add("Start", mgrCommon.DateToUnix(oSession.SessionStart)) + oParamList.Add(hshParams) + Next + + oDatabase.RunMassParamQuery(sSQL, oParamList) + End Sub + + Public Shared Function GetMinimumDateTime(Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As DateTime + Dim oDatabase As New mgrSQLite(iSelectDB) + Dim sSQL As String + Dim hshParams As New Hashtable + Dim iUnixDate As Int64 + + sSQL = "SELECT Start FROM sessions ORDER BY Start ASC LIMIT 1" + + iUnixDate = CInt(oDatabase.ReadSingleValue(sSQL, hshParams)) + Return mgrCommon.UnixToDate(iUnixDate) + End Function + + Public Shared Function GetMaximumDateTime(Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As DateTime + Dim oDatabase As New mgrSQLite(iSelectDB) + Dim sSQL As String + Dim hshParams As New Hashtable + Dim iUnixDate As Int64 + + sSQL = "SELECT End FROM sessions ORDER BY Start DESC LIMIT 1" + + iUnixDate = CInt(oDatabase.ReadSingleValue(sSQL, hshParams)) + Return mgrCommon.UnixToDate(iUnixDate) + End Function + + Public Shared Function CountRows(Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As Integer + Dim oDatabase As New mgrSQLite(iSelectDB) + Dim sSQL As String + Dim hshParams As New Hashtable + Dim iRowCount As Integer + + sSQL = "SELECT COUNT(MonitorID) FROM sessions;" + + iRowCount = CInt(oDatabase.ReadSingleValue(sSQL, hshParams)) + + Return iRowCount + End Function +End Class \ No newline at end of file diff --git a/GBM/Managers/mgrSettings.vb b/GBM/Managers/mgrSettings.vb index 73da1f9..2d79a46 100644 --- a/GBM/Managers/mgrSettings.vb +++ b/GBM/Managers/mgrSettings.vb @@ -13,6 +13,7 @@ Public Class mgrSettings Private bAutoMark As Boolean = False Private bSync As Boolean = True Private bTimeTracking As Boolean = True + Private bSessionTracking As Boolean = False Private bSupressBackup As Boolean = False Private iSupressBackupThreshold As Integer = 10 Private iCompressionLevel As Integer = 5 @@ -130,6 +131,15 @@ Public Class mgrSettings End Set End Property + Property SessionTracking As Boolean + Get + Return bSessionTracking + End Get + Set(value As Boolean) + bSessionTracking = value + End Set + End Property + Property SupressBackup As Boolean Get Return bSupressBackup @@ -261,7 +271,7 @@ Public Class mgrSettings sSQL = "INSERT INTO settings VALUES (1, @MonitorOnStartup, @StartToTray, @ShowDetectionToolTips, @DisableConfirmation, " sSQL &= "@CreateSubFolder, @ShowOverwriteWarning, @RestoreOnLaunch, @BackupFolder, @Sync, @StartWithWindows, " sSQL &= "@TimeTracking, @SupressBackup, @SupressBackupThreshold, @CompressionLevel, @Custom7zArguments, @Custom7zLocation, " - sSQL &= "@SyncFields, @AutoSaveLog, @AutoRestore, @AutoMark)" + sSQL &= "@SyncFields, @AutoSaveLog, @AutoRestore, @AutoMark, @SessionTracking)" hshParams.Add("MonitorOnStartup", MonitorOnStartup) hshParams.Add("StartToTray", StartToTray) @@ -283,6 +293,7 @@ Public Class mgrSettings hshParams.Add("AutoSaveLog", AutoSaveLog) hshParams.Add("AutoRestore", AutoRestore) hshParams.Add("AutoMark", AutoMark) + hshParams.Add("SessionTracking", SessionTracking) oDatabase.RunParamQuery(sSQL, hshParams) End Sub @@ -317,6 +328,7 @@ Public Class mgrSettings AutoSaveLog = CBool(dr("AutoSaveLog")) AutoRestore = CBool(dr("AutoRestore")) AutoMark = CBool(dr("AutoMark")) + SessionTracking = CBool(dr("SessionTracking")) Next oDatabase.Disconnect() diff --git a/GBM/Managers/mgrXML.vb b/GBM/Managers/mgrXML.vb index 7b4258c..5f48229 100644 --- a/GBM/Managers/mgrXML.vb +++ b/GBM/Managers/mgrXML.vb @@ -6,18 +6,22 @@ Imports System.Net Public Class mgrXML - Public Shared Function ReadMonitorList(ByVal sLocation As String, Optional ByVal bWebRead As Boolean = False) As Hashtable + Public Shared Function ReadMonitorList(ByVal sLocation As String, ByRef oExportInfo As ExportData, Optional ByVal bWebRead As Boolean = False) As Hashtable Dim oList As List(Of Game) Dim hshList As New Hashtable Dim hshDupeList As New Hashtable + Dim oExportData As ExportData Dim oGame As clsGame + 'If the file doesn't exist return an empty list If Not File.Exists(sLocation) And Not bWebRead Then Return hshList End If - oList = ImportandDeserialize(sLocation, bWebRead) + oExportData = ImportandDeserialize(sLocation, bWebRead) + oList = oExportData.Configurations + oExportInfo = oExportData For Each g As Game In oList oGame = New clsGame @@ -46,38 +50,56 @@ Public Class mgrXML Return hshList End Function - Public Shared Function ImportandDeserialize(ByVal sLocation As String, Optional ByVal bWebRead As Boolean = False) As List(Of Game) + Private Shared Function ReadImportData(ByVal sLocation As String, ByVal bWebRead As Boolean) Dim oReader As StreamReader Dim oWebClient As WebClient + + If bWebRead Then + oWebClient = New WebClient + oReader = New StreamReader(oWebClient.OpenRead(sLocation)) + Else + oReader = New StreamReader(sLocation) + End If + + Return oReader + End Function + + Public Shared Function ImportandDeserialize(ByVal sLocation As String, Optional ByVal bWebRead As Boolean = False) As ExportData + Dim oReader As StreamReader Dim oSerializer As XmlSerializer - Dim oList As New List(Of Game) + Dim oExportData As New ExportData Try - If bWebRead Then - oWebClient = New WebClient - oReader = New StreamReader(oWebClient.OpenRead(sLocation)) - Else - oReader = New StreamReader(sLocation) + oReader = ReadImportData(sLocation, bWebRead) + oSerializer = New XmlSerializer(GetType(ExportData), New XmlRootAttribute("gbm")) + oExportData = oSerializer.Deserialize(oReader) + oReader.Close() + + 'Compatability Mode + If oExportData.AppVer = 0 Then + oReader = ReadImportData(sLocation, bWebRead) + oSerializer = New XmlSerializer(GetType(List(Of Game)), New XmlRootAttribute("gbm")) + oExportData.Configurations = oSerializer.Deserialize(oReader) + oReader.Close() End If - oSerializer = New XmlSerializer(oList.GetType(), New XmlRootAttribute("gbm")) - oList = oSerializer.Deserialize(oReader) - oReader.Close() Catch ex As Exception mgrCommon.ShowMessage(mgrXML_ErrorImportFailure, ex.Message, MsgBoxStyle.Exclamation) End Try - Return oList + Return oExportData End Function Public Shared Function SerializeAndExport(ByVal oList As List(Of Game), ByVal sLocation As String) As Boolean Dim oSerializer As XmlSerializer Dim oWriter As StreamWriter + Dim oExportData As ExportData Try - oSerializer = New XmlSerializer(oList.GetType(), New XmlRootAttribute("gbm")) + oExportData = New ExportData(mgrCommon.DateToUnix(Now), oList.Count, mgrCommon.AppVersion, oList) + oSerializer = New XmlSerializer(oExportData.GetType()) oWriter = New StreamWriter(sLocation) - oSerializer.Serialize(oWriter.BaseStream, oList) + oSerializer.Serialize(oWriter.BaseStream, oExportData) oWriter.Flush() oWriter.Close() Return True diff --git a/GBM/My Project/Application.Designer.vb b/GBM/My Project/Application.Designer.vb index cce8b29..c3dd7aa 100644 --- a/GBM/My Project/Application.Designer.vb +++ b/GBM/My Project/Application.Designer.vb @@ -24,7 +24,7 @@ Namespace My _ Public Sub New() MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) - Me.IsSingleInstance = false + Me.IsSingleInstance = true Me.EnableVisualStyles = true Me.SaveMySettingsOnExit = false Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses diff --git a/GBM/My Project/Application.myapp b/GBM/My Project/Application.myapp index 20701f6..6060cf8 100644 --- a/GBM/My Project/Application.myapp +++ b/GBM/My Project/Application.myapp @@ -2,7 +2,7 @@ true frmMain - false + true 0 true 0 diff --git a/GBM/My Project/Resources.Designer.vb b/GBM/My Project/Resources.Designer.vb index 9acc98a..05b6ea4 100644 --- a/GBM/My Project/Resources.Designer.vb +++ b/GBM/My Project/Resources.Designer.vb @@ -915,15 +915,6 @@ Namespace My.Resources End Get End Property - ''' - ''' Looks up a localized string similar to >. - ''' - Friend ReadOnly Property frmFilter_btnAdd() As String - Get - Return ResourceManager.GetString("frmFilter_btnAdd", resourceCulture) - End Get - End Property - ''' ''' Looks up a localized string similar to Add. ''' @@ -934,20 +925,47 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to &OK. + ''' Looks up a localized string similar to >. ''' - Friend ReadOnly Property frmFilter_btnOK() As String + Friend ReadOnly Property frmFilter_btnExcludeAdd() As String Get - Return ResourceManager.GetString("frmFilter_btnOK", resourceCulture) + Return ResourceManager.GetString("frmFilter_btnExcludeAdd", resourceCulture) End Get End Property ''' ''' Looks up a localized string similar to <. ''' - Friend ReadOnly Property frmFilter_btnRemove() As String + Friend ReadOnly Property frmFilter_btnExcludeRemove() As String Get - Return ResourceManager.GetString("frmFilter_btnRemove", resourceCulture) + Return ResourceManager.GetString("frmFilter_btnExcludeRemove", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to <. + ''' + Friend ReadOnly Property frmFilter_btnIncludeAdd() As String + Get + Return ResourceManager.GetString("frmFilter_btnIncludeAdd", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to >. + ''' + Friend ReadOnly Property frmFilter_btnIncludeRemove() As String + Get + Return ResourceManager.GetString("frmFilter_btnIncludeRemove", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to &OK. + ''' + Friend ReadOnly Property frmFilter_btnOK() As String + Get + Return ResourceManager.GetString("frmFilter_btnOK", resourceCulture) End Get End Property @@ -1195,7 +1213,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to Options. + ''' Looks up a localized string similar to Include Options. ''' Friend ReadOnly Property frmFilter_grpTagOptions() As String Get @@ -1212,6 +1230,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to Exclude Tags. + ''' + Friend ReadOnly Property frmFilter_lblExcludeTags() As String + Get + Return ResourceManager.GetString("frmFilter_lblExcludeTags", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Available Fields. ''' @@ -1231,11 +1258,20 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to Current Filter. + ''' Looks up a localized string similar to Include Tags. ''' - Friend ReadOnly Property frmFilter_lblGameTags() As String + Friend ReadOnly Property frmFilter_lblIncludeTags() As String Get - Return ResourceManager.GetString("frmFilter_lblGameTags", resourceCulture) + Return ResourceManager.GetString("frmFilter_lblIncludeTags", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Not. + ''' + Friend ReadOnly Property frmFilter_lblNot() As String + Get + Return ResourceManager.GetString("frmFilter_lblNot", resourceCulture) End Get End Property @@ -1536,15 +1572,6 @@ Namespace My.Resources End Get End Property - ''' - ''' Looks up a localized string similar to &View Sessions.... - ''' - Friend ReadOnly Property frmGameManager_btnSessions() As String - Get - Return ResourceManager.GetString("frmGameManager_btnSessions", resourceCulture) - End Get - End Property - ''' ''' Looks up a localized string similar to Tags.... ''' @@ -2922,6 +2949,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to There is currently no session data to display.. + ''' + Friend ReadOnly Property frmMain_ErrorNoSessions() As String + Get + Return ResourceManager.GetString("frmMain_ErrorNoSessions", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to [PARAM] uses a relative path and has never been detected on this computer.. ''' @@ -3210,6 +3246,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to &Session Viewer.... + ''' + Friend ReadOnly Property frmMain_gMonToolsSessions() As String + Get + Return ResourceManager.GetString("frmMain_gMonToolsSessions", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Show / Hide. ''' @@ -3571,38 +3616,110 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to Computer Name. + ''' Looks up a localized string similar to Session tracking is currently disabled.[BR][BR]Enable session tracking in Settings if you'd like to track data for individual gaming sessions.. ''' - Friend ReadOnly Property frmSession_ColumnComputerName() As String + Friend ReadOnly Property frmMain_WarningSessionsDisabled() As String Get - Return ResourceManager.GetString("frmSession_ColumnComputerName", resourceCulture) + Return ResourceManager.GetString("frmMain_WarningSessionsDisabled", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to &Close. + ''' + Friend ReadOnly Property frmSessions_btnClose() As String + Get + Return ResourceManager.GetString("frmSessions_btnClose", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to &Delete Session. + ''' + Friend ReadOnly Property frmSessions_btnDelete() As String + Get + Return ResourceManager.GetString("frmSessions_btnDelete", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to &Reset Filters. + ''' + Friend ReadOnly Property frmSessions_btnReset() As String + Get + Return ResourceManager.GetString("frmSessions_btnReset", resourceCulture) End Get End Property ''' ''' Looks up a localized string similar to End. ''' - Friend ReadOnly Property frmSession_ColumnEnd() As String + Friend ReadOnly Property frmSessions_ColumnEnd() As String Get - Return ResourceManager.GetString("frmSession_ColumnEnd", resourceCulture) + Return ResourceManager.GetString("frmSessions_ColumnEnd", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Game. + ''' + Friend ReadOnly Property frmSessions_ColumnGameName() As String + Get + Return ResourceManager.GetString("frmSessions_ColumnGameName", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to MonitorID. + ''' + Friend ReadOnly Property frmSessions_ColumnMonitorID() As String + Get + Return ResourceManager.GetString("frmSessions_ColumnMonitorID", resourceCulture) End Get End Property ''' ''' Looks up a localized string similar to Start. ''' - Friend ReadOnly Property frmSession_ColumnStart() As String + Friend ReadOnly Property frmSessions_ColumnStart() As String Get - Return ResourceManager.GetString("frmSession_ColumnStart", resourceCulture) + Return ResourceManager.GetString("frmSessions_ColumnStart", resourceCulture) End Get End Property ''' - ''' Looks up a localized string similar to Sessions. + ''' Looks up a localized string similar to Are you sure you want to delete the selected session(s)? This cannot be undone.. ''' - Friend ReadOnly Property frmSession_Name() As String + Friend ReadOnly Property frmSessions_ConfirmDelete() As String Get - Return ResourceManager.GetString("frmSession_Name", resourceCulture) + Return ResourceManager.GetString("frmSessions_ConfirmDelete", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Date Range:. + ''' + Friend ReadOnly Property frmSessions_lblDateRange() As String + Get + Return ResourceManager.GetString("frmSessions_lblDateRange", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Game Filter:. + ''' + Friend ReadOnly Property frmSessions_lblFilter() As String + Get + Return ResourceManager.GetString("frmSessions_lblFilter", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Session Viewer. + ''' + Friend ReadOnly Property frmSessions_Name() As String + Get + Return ResourceManager.GetString("frmSessions_Name", resourceCulture) End Get End Property @@ -3804,6 +3921,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to Enable session tracking. + ''' + Friend ReadOnly Property frmSettings_chkSessionTracking() As String + Get + Return ResourceManager.GetString("frmSettings_chkSessionTracking", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Show detection notifications. ''' diff --git a/GBM/My Project/Resources.resx b/GBM/My Project/Resources.resx index 06677f7..b68b8d0 100644 --- a/GBM/My Project/Resources.resx +++ b/GBM/My Project/Resources.resx @@ -883,20 +883,20 @@ Do you wish to search the [PARAM] drive? - - > + + < &OK - - < + + > Custom Filter - - Current Filter + + Include Tags Available Tags @@ -1010,7 +1010,7 @@ Filter Type - Options + Include Options Configuration @@ -1885,22 +1885,64 @@ Sort Options - - &View Sessions... - - - Computer Name - - - End - - - Start - - - Sessions - Comments + + > + + + < + + + Exclude Tags + + + Not + + + &Session Viewer... + + + End + + + Game + + + Start + + + Session Viewer + + + There is currently no session data to display. + + + &Close + + + &Delete Session + + + &Reset Filters + + + MonitorID + + + Are you sure you want to delete the selected session(s)? This cannot be undone. + + + Date Range: + + + Game Filter: + + + Session tracking is currently disabled.[BR][BR]Enable session tracking in Settings if you'd like to track data for individual gaming sessions. + + + Enable session tracking + \ No newline at end of file diff --git a/GBM/readme.txt b/GBM/readme.txt index 77c1e33..0502c48 100644 --- a/GBM/readme.txt +++ b/GBM/readme.txt @@ -1,20 +1,31 @@ -Game Backup Monitor v1.04 Readme +Game Backup Monitor v1.0.5 Readme http://mikemaximus.github.io/gbm-web/ gamebackupmonitor@gmail.com -September 26, 2017 +December 8, 2017 -New in 1.04 +New in 1.0.5 -- (All) The import feature now detects most saved games currently on your PC and automatically selects configurations for you. -- (All) The Game Manager's "Custom Filter" feature has received a major overhaul: - - More fields are now available for use. - - Added the ability to combine different filters. - - Added the ability to set a sort field and order. - - The current filter is now saved when the Custom Filter window is closed and re-opened. -- (All) The "Monitor Only" feature has been updated. This feature allows tracking play time for games that do not require a backup, such as MMOs or CCGs. - - The Game Manager now disables and ignores validation on fields that aren't needed for a Monitor Only configuration. - - Monitor Only is now included in the XML Import / Export. - - Monitor Only configurations may now be included in the official game lists. +All Platforms: + +- You can now add Comments to a game configuration. +- You can now exclude tags and use negative filters on the Game Manager. +- Fixed a bug causing backup size calculations to be incorrect when including sub-folders in a configuration. +- Fixed a bug causing GBM to calculate the backup size of an incorrect location when using a relative path configuration. This could cause very long delays when a backup was running. +- XML export files now contain the date, version and amount of configurations. The Import window will now display the date of the XML file in the title bar if applicable. +- Fixed a bug causing games not to be detected if more than one copy of the process was running. +- GBM can now save statistical data from each detected gaming session: + - This feature records the start and end time of each detected gaming session. In future versions more data may be available. + - You can view session data using the new "Session Viewer" available in the Tools menu. + - This feature is disabled by default. It can be enabled on the Setting screen. + - Session data is stored locally, it is currently not synced with the backup folder. + +Windows Only: + +- Only one instance of GBM can now be running. + +Linux Only: + +- Added makefile for easy Linux installation. Thanks basxto! The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html \ No newline at end of file