116 Commits

Author SHA1 Message Date
MikeMaximus
8907933285 Switched to VB method of single instance 2017-12-09 10:09:01 -06:00
MikeMaximus
7330c5bcba Fixes for issue #109 and #112 2017-12-08 22:09:08 -06:00
MikeMaximus
476ec70fe5 Added missing Linux changes to readme 2017-12-08 15:38:06 -06:00
MikeMaximus
b7b3d053c7 Fixed readme errors 2017-12-08 15:19:17 -06:00
MikeMaximus
8a41566b5f Updated readme for v1.0.5 2017-12-08 11:48:58 -06:00
MikeMaximus
ff0f3b9dd4 Fix for issue #112 2017-12-08 09:48:58 -06:00
MikeMaximus
5165ae27e7 Fixed some resize issues with session viewer 2017-12-07 22:23:42 -06:00
MikeMaximus
c55875e31a Fixed date control crash in Linux 2017-12-07 21:59:19 -06:00
MikeMaximus
08e8ed58d9 Added setting for session tracking 2017-12-07 21:46:16 -06:00
MikeMaximus
e6a73019ef Added functionality to session viewer for issue #99 2017-12-07 21:23:43 -06:00
MikeMaximus
11101f7f22 Added session viewer for issue #99 2017-12-07 15:50:37 -06:00
MikeMaximus
c8453c9cbd Change session storage to local 2017-12-07 11:54:03 -06:00
MikeMaximus
9a8350c2ed Removed useless class file 2017-12-06 22:58:52 -06:00
Michael J. Seiferling
ab06db102c Added basics for issue #99 2017-12-06 00:21:26 -06:00
Michael J. Seiferling
82f287f322 Changed date display for issue #109 2017-12-05 19:55:39 -06:00
Michael J. Seiferling
2c0fdb776e Changes for issue #109 2017-12-05 18:06:22 -06:00
MikeMaximus
e106d7c09c Added new export field for issue #109 2017-11-23 08:56:06 -06:00
MikeMaximus
bc1c9ecbd5 Small UI fix for issue #103 2017-11-21 13:58:45 -06:00
MikeMaximus
d610b2507e Changes for issue #103 2017-11-21 13:49:27 -06:00
MikeMaximus
ad4c666051 Revert all changes for issue #99 2017-11-20 12:56:28 -06:00
MikeMaximus
644d073af0 Changes for issue #109 2017-11-20 10:54:06 -06:00
MikeMaximus
bd2b828bd3 Merge pull request #108 from basxto/master
Tested with Lubuntu 16.04, works great.
2017-11-18 15:25:56 -06:00
Sebastian Riedel
4f3ed5c70e Execute gbm with mono and abstract installer more 2017-11-18 21:51:32 +01:00
Sebastian Riedel
438fe193b6 Install manually on Linux
`sudo make install`
`sudo make unistall`
2017-11-18 17:37:30 +01:00
MikeMaximus
c4a7f9bb2c Fixed issues #104 and #105 2017-11-18 10:01:35 -06:00
MikeMaximus
3e913cc091 Filter update for issue #97 2017-11-17 09:07:54 -06:00
MikeMaximus
5d3fa68fc3 Changes for issues #97 and #99 2017-11-16 23:01:44 -06:00
MikeMaximus
7c0a342f1d Changes for issues #97 and #99 2017-11-16 12:35:15 -06:00
MikeMaximus
65c613ffcb Merge pull request #102 from basxto/patch-1
Add license
2017-11-15 19:59:00 -06:00
Basxto
1e278497b8 Add license
Github can detect this file and shows the license in the repository head.
Also see `Insights > Community`
2017-11-16 02:12:25 +01:00
MikeMaximus
aab9b5718d Detection fix for issue #100 2017-11-15 15:54:20 -06:00
MikeMaximus
96eac6a100 Merge pull request #96 from MikeMaximus/v104
Merge v104 into master
2017-09-26 10:29:40 -06:00
MikeMaximus
af13d51557 Updates and tweaks for v104 release 2017-09-26 10:27:12 -06:00
Michael J. Seiferling
59748309ad Merge branch 'v104' of https://github.com/MikeMaximus/gbm into v104 2017-09-23 15:21:23 -06:00
Michael J. Seiferling
0f874ae74a Enhancement for issue #83 2017-09-23 15:20:53 -06:00
MikeMaximus
19de263050 Fixed another ui problem with issue #89 2017-08-11 10:36:18 -06:00
MikeMaximus
34a9159719 Fixed various problems caused by issue #89 2017-08-10 22:38:14 -06:00
MikeMaximus
f0bd3db4ad Revert "Disabled Monitor only restore for issue #89"
This reverts commit 0003ee1f11.
2017-08-10 22:22:20 -06:00
MikeMaximus
0003ee1f11 Disabled Monitor only restore for issue #89 2017-08-10 22:18:15 -06:00
MikeMaximus
a4fff6b900 Fixed missing control for issue #89 2017-08-10 22:13:27 -06:00
MikeMaximus
e3bfc6adb1 Changes for issue #89 2017-08-10 22:02:31 -06:00
Michael J. Seiferling
2ef141ee9b Fixed possible filter crash 2017-08-06 19:18:38 -06:00
Michael J. Seiferling
94086d0c05 Operator feature change and minor bug fixes 2017-08-05 14:00:52 -06:00
Michael J. Seiferling
6e2298df49 Custom Filter Enhancement Final Phase 2017-08-05 12:49:10 -06:00
Michael J. Seiferling
c0d6a79aa7 Custom Filter Enhancement Phase #3 2017-08-04 23:31:48 -06:00
Michael J. Seiferling
19812d1cd2 Custom Filter Enhancement Phase #2 2017-08-04 23:13:35 -06:00
Michael J. Seiferling
11cc244b18 Custom Filter Enhancement Phase #1 2017-08-04 18:17:07 -06:00
MikeMaximus
8e82024c29 Merge pull request #95 from MikeMaximus/v103
Merge v103 into master
2017-08-02 12:29:11 -06:00
Michael J. Seiferling
89aa57e6d6 Final v103 changes 2017-08-02 12:27:19 -06:00
Michael J. Seiferling
44fdc4160e Fixed some long standing system tray bugs 2017-08-02 11:39:19 -06:00
MikeMaximus
b5859d6541 Cleaned up fix for issue #94 2017-07-15 10:54:15 -06:00
MikeMaximus
d3d6482bfd Fix for issue #94 2017-07-15 10:46:37 -06:00
MikeMaximus
9c8cbad7d5 Fix for issue #93 2017-07-13 13:57:28 -06:00
Michael J. Seiferling
e09e38a5c4 Updated .gitignore for Visual Studio 2017 2017-07-07 18:45:15 -06:00
Michael J. Seiferling
f245dee781 Updated .gitignore for Visual Studio 2017 2017-07-07 18:19:59 -06:00
Michael J. Seiferling
fd815f0c46 Fixed incorrect tray menu options 2017-07-06 09:17:14 -06:00
Michael J. Seiferling
708e9ce1fe Cleaned up filter function 2017-07-04 20:46:59 -06:00
MikeMaximus
a68d2b718f Fixed Windows Alt-Tab issue 2017-07-03 17:01:17 -06:00
MikeMaximus
d11f468add Some final v102 changes 2017-07-01 12:23:28 -06:00
MikeMaximus
ef6997a2ab Fixed prevent shutdown while minimized bug with issue #77 2017-06-28 11:50:50 -06:00
MikeMaximus
9386da4a2a Enhancement for issue #91 2017-06-26 10:46:11 -06:00
MikeMaximus
d4210053ad Fix for issue #78 & #84 2017-06-26 10:23:57 -06:00
MikeMaximus
41d11cca8e Tweak for issue #84 2017-06-25 16:53:16 -06:00
MikeMaximus
22df153513 Fixed selection after saving bug caused by issue #80 2017-06-25 16:45:47 -06:00
MikeMaximus
2548d0dceb Fix for issue #90 2017-06-25 11:38:25 -06:00
MikeMaximus
4b0d4a62c8 Fixed hide to tray while maximized bug with issue #77 2017-06-23 22:02:57 -06:00
MikeMaximus
11d8e4594c Merge pull request #88 from MikeMaximus/v102
Merge v102 into master
2017-06-23 16:19:05 -06:00
MikeMaximus
7259f92ec1 Updated readme.txt for v102 2017-06-23 08:38:10 -06:00
MikeMaximus
024f17abe9 Updated readme.txt for v102 2017-06-22 15:28:27 -06:00
MikeMaximus
97cf2618e3 Tweaks for issue #79 2017-06-22 11:43:03 -06:00
MikeMaximus
5fa746da8e Enhancement for issue #87 2017-06-22 09:53:34 -06:00
MikeMaximus
91b9554f40 Enhancement for issue #79 2017-06-21 16:56:57 -06:00
MikeMaximus
b5c977e66c Fix for issue #77 2017-06-21 14:42:01 -06:00
MikeMaximus
15c33ca039 Changes for issue #77 2017-06-21 10:53:05 -06:00
Michael J. Seiferling
aa3237d0fa Enhancement for issue #76 2017-06-14 10:16:29 -06:00
Michael J. Seiferling
1f291bbcd8 Fixed bug found while testing issue #81 2017-06-14 09:06:53 -06:00
Michael J. Seiferling
9cd786c303 Enhancement for issue #78 2017-06-13 09:38:06 -06:00
Michael J. Seiferling
e701d67d79 Fix for issue #80 2017-06-12 10:31:10 -06:00
Michael J. Seiferling
be8cb66136 Enhancement for issue #81 2017-06-12 09:59:04 -06:00
Michael J. Seiferling
50563e3be0 Fix for issue #81 2017-06-12 08:35:45 -06:00
MikeMaximus
2623bf7f7a Fixed timer problem with issue #73 2017-03-24 12:22:10 -06:00
Michael J. Seiferling
6230d2f888 Added new change to the v101 readme 2017-03-23 11:32:10 -06:00
Michael J. Seiferling
adc857fe5e Cleaned up changes for issue #73 2017-03-23 11:10:25 -06:00
Michael J. Seiferling
bddf07ee44 Changes for issue #73 2017-03-23 10:57:11 -06:00
Michael J. Seiferling
63ed3dac67 Redesigned notifications for issue #67 2017-03-23 10:30:03 -06:00
Michael J. Seiferling
922103e5aa Reverted change on About display 2017-03-23 01:14:05 -06:00
Michael J. Seiferling
d0fe33e953 Fixed restore path mismatch with issue #67 2017-03-21 13:25:18 -06:00
MikeMaximus
934d17de47 Merge branch 'master' of https://github.com/MikeMaximus/gbm.git 2017-03-16 17:12:16 -06:00
MikeMaximus
2ccc10bb9c Fixed sync setting conflict with issue #67 2017-03-16 17:12:01 -06:00
Michael J. Seiferling
cc1db7e524 Updated readme for v101 2017-03-16 12:17:47 -06:00
Michael J. Seiferling
c2a9d3ee77 Fixed tab order on settings form 2017-03-15 17:31:29 -06:00
MikeMaximus
65fe7214eb Merge pull request #72 from MikeMaximus/v101
Merge v101 into master
2017-03-15 17:16:31 -06:00
MikeMaximus
71d09126c2 Update README.md 2017-03-14 20:17:20 -06:00
MikeMaximus
2eb0c30702 Update README.md 2017-03-14 20:14:21 -06:00
MikeMaximus
24e1c4b92f Changes for issue #71 2017-03-09 14:46:07 -06:00
Michael J. Seiferling
4e7eb58463 More label updates 2017-02-28 15:41:57 -06:00
MikeMaximus
3ae0d1ba82 Label changes in Game Manager 2017-02-28 14:42:35 -06:00
MikeMaximus
6f3ed9ab81 Added build date and removed revision in About display 2017-02-26 16:01:44 -06:00
MikeMaximus
a490e6d1f2 Fixed timer problem with issue #67 2017-02-26 15:48:48 -06:00
Michael J. Seiferling
a5dd1d547b Relative path fix for issue #67 2017-02-22 12:49:19 -06:00
MikeMaximus
974aaa3638 Updates for issue #67 2017-02-21 16:36:34 -06:00
MikeMaximus
c3b73a9953 Fixed event broken by last commit 2017-02-19 21:34:45 -06:00
MikeMaximus
3bd4cbd0bd Updates for issue #67 2017-02-19 21:22:57 -06:00
MikeMaximus
5a9b3c99b3 Changes for Issue #67 & #70 2017-02-19 14:36:52 -06:00
MikeMaximus
8ce1b00a8c Working fix for issue #68 2017-01-06 08:20:03 -06:00
Michael J. Seiferling
e4237a74bb Modified fix for issue #68 2017-01-05 09:01:40 -06:00
MikeMaximus
72f520f333 Fix for issue #68 2016-12-22 09:20:05 -06:00
Michael J. Seiferling
dc9ec7f190 Merge branch 'master' 2016-12-15 09:09:12 -06:00
Michael J. Seiferling
c0dbd95504 Updated readme.txt for release 2016-12-15 08:49:10 -06:00
MikeMaximus
6c5c54ea1b Merge Master into v101 2016-12-06 13:08:09 -06:00
MikeMaximus
d0c40fd341 Changed button sub-menu placement calculations 2016-12-06 09:25:33 -06:00
MikeMaximus
68855077cf Minor updates for 1.0 release 2016-12-05 10:23:31 -06:00
Michael J. Seiferling
3184cb61ec Removed some unused code 2016-11-14 15:43:16 -06:00
Michael J. Seiferling
8ebfed7ab7 Added experimental "Clean folder on restore" feature 2016-11-14 15:37:44 -06:00
MikeMaximus
229afa92fd Update README.md 2016-10-24 12:25:43 -06:00
MikeMaximus
db6c96a80b Changes for issue #64 2016-10-24 10:04:06 -06:00
56 changed files with 5341 additions and 1273 deletions
Vendored
+4
View File
@@ -186,3 +186,7 @@ FakesAssemblies/
GeneratedArtifacts/ GeneratedArtifacts/
_Pvt_Extensions/ _Pvt_Extensions/
ModelManifest.xml ModelManifest.xml
/.vs/slnx.sqlite
/.vs/VSWorkspaceState.json
/.vs/Game Backup Monitor/v15/sqlite3/storage.ide
/.vs/Game Backup Monitor/v15/sqlite3/storage.ide-journal
@@ -0,0 +1,63 @@
Imports System.Xml.Serialization
<XmlRoot("gbm")>
Public Class ExportData
Dim oConfigs As List(Of Game)
Private dExported As Int64
Private iTotalConfigs As Integer
Private iAppVer As Integer
<XmlAttribute("Exported")>
Property Exported As Int64
Set(value As Int64)
dExported = value
End Set
Get
Return dExported
End Get
End Property
<XmlAttribute("TotalConfigurations")>
Property TotalConfigurations As Integer
Set(value As Integer)
iTotalConfigs = value
End Set
Get
Return iTotalConfigs
End Get
End Property
<XmlAttribute("AppVer")>
Property AppVer As Integer
Set(value As Integer)
iAppVer = value
End Set
Get
Return iAppVer
End Get
End Property
<XmlElement("Game")>
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
+30
View File
@@ -1,11 +1,14 @@
Public Class Game Public Class Game
Private sGameName As String Private sGameName As String
Private sProcessName As String Private sProcessName As String
Private sParameter As String
Private sPath As String Private sPath As String
Private bAbsolutePath As Boolean Private bAbsolutePath As Boolean
Private bFolderSave As Boolean Private bFolderSave As Boolean
Private sFileType As String Private sFileType As String
Private sExcludeList As String Private sExcludeList As String
Private bMonitorOnly As Boolean
Private sComments As String
Private oTags As List(Of Tag) Private oTags As List(Of Tag)
Property Name As String Property Name As String
@@ -26,6 +29,15 @@
End Get End Get
End Property End Property
Property Parameter As String
Set(value As String)
sParameter = value
End Set
Get
Return sParameter
End Get
End Property
Property Path As String Property Path As String
Set(value As String) Set(value As String)
sPath = value sPath = value
@@ -71,6 +83,24 @@
End Get End Get
End Property End Property
Property MonitorOnly As Boolean
Set(value As Boolean)
bMonitorOnly = value
End Set
Get
Return bMonitorOnly
End Get
End Property
Property Comments As String
Set(value As String)
sComments = value
End Set
Get
Return sComments
End Get
End Property
Property Tags As List(Of Tag) Property Tags As List(Of Tag)
Get Get
Return oTags Return oTags
+2 -1
View File
@@ -1,4 +1,5 @@
Public Class Tag <Serializable()>
Public Class Tag
Private sTagName As String Private sTagName As String
Property Name As String Property Name As String
-20
View File
@@ -7,8 +7,6 @@
Private sRelativeRestorePath As String = String.Empty Private sRelativeRestorePath As String = String.Empty
Private dDateUpdated As DateTime = Date.Now Private dDateUpdated As DateTime = Date.Now
Private sUpdatedBy As String = String.Empty Private sUpdatedBy As String = String.Empty
Private dLastDateUpdated As DateTime = Date.Now
Private sLastUpdatedBy As String = String.Empty
Private sCheckSum As String = String.Empty Private sCheckSum As String = String.Empty
Property ID As String Property ID As String
@@ -109,24 +107,6 @@
End Set End Set
End Property End Property
Property LastDateUpdated As DateTime
Get
Return dLastDateUpdated
End Get
Set(value As DateTime)
dLastDateUpdated = value
End Set
End Property
Property LastUpdatedBy As String
Get
Return sLastUpdatedBy
End Get
Set(value As String)
sLastUpdatedBy = value
End Set
End Property
Property CheckSum As String Property CheckSum As String
Get Get
Return sCheckSum Return sCheckSum
+69 -1
View File
@@ -1,13 +1,16 @@
Public Class clsGame <Serializable()>
Public Class clsGame
Private sGameID As String = Guid.NewGuid.ToString Private sGameID As String = Guid.NewGuid.ToString
Private sGameName As String = String.Empty Private sGameName As String = String.Empty
Private sProcessName As String = String.Empty Private sProcessName As String = String.Empty
Private sParameter As String = String.Empty
Private sPath As String = String.Empty Private sPath As String = String.Empty
Private bAbsolutePath As Boolean = False Private bAbsolutePath As Boolean = False
Private bFolderSave As Boolean = False Private bFolderSave As Boolean = False
Private sFileType As String = String.Empty Private sFileType As String = String.Empty
Private bAppendTimeStamp As Boolean = False Private bAppendTimeStamp As Boolean = False
Private iBackupLimit As Integer = 2 Private iBackupLimit As Integer = 2
Private bCleanFolder As Boolean = False
Private sExcludeList As String = String.Empty Private sExcludeList As String = String.Empty
Private sProcessPath As String = String.Empty Private sProcessPath As String = String.Empty
Private sIcon As String = String.Empty Private sIcon As String = String.Empty
@@ -16,6 +19,7 @@
Private sCompany As String = String.Empty Private sCompany As String = String.Empty
Private bEnabled As Boolean = True Private bEnabled As Boolean = True
Private bMonitorOnly As Boolean = False Private bMonitorOnly As Boolean = False
Private sComments As String = String.Empty
Private bDuplicate As Boolean = False Private bDuplicate As Boolean = False
Private bTempGame As Boolean = False Private bTempGame As Boolean = False
Private oImportTags As New List(Of Tag) Private oImportTags As New List(Of Tag)
@@ -73,6 +77,15 @@
End Get End Get
End Property End Property
Property Parameter As String
Set(value As String)
sParameter = value
End Set
Get
Return sParameter
End Get
End Property
Property Path As String Property Path As String
Set(value As String) Set(value As String)
sPath = mgrPath.ReverseSpecialPaths(value) sPath = mgrPath.ReverseSpecialPaths(value)
@@ -127,6 +140,15 @@
End Set End Set
End Property End Property
Property CleanFolder As Boolean
Get
Return bCleanFolder
End Get
Set(value As Boolean)
bCleanFolder = value
End Set
End Property
Property ExcludeList As String Property ExcludeList As String
Set(value As String) Set(value As String)
sExcludeList = value sExcludeList = value
@@ -199,6 +221,15 @@
End Set End Set
End Property End Property
Property Comments As String
Get
Return sComments
End Get
Set(value As String)
sComments = value
End Set
End Property
Property Duplicate As Boolean Property Duplicate As Boolean
Get Get
Return bDuplicate Return bDuplicate
@@ -238,6 +269,26 @@
End Set End Set
End Property End Property
ReadOnly Property IncludeArray As String()
Get
If FileType = String.Empty Then
Return New String() {}
Else
Return FileType.Split(":")
End If
End Get
End Property
ReadOnly Property ExcludeArray As String()
Get
If ExcludeList = String.Empty Then
Return New String() {}
Else
Return ExcludeList.Split(":")
End If
End Get
End Property
Public Function SyncEquals(obj As Object, eSyncFields As eOptionalSyncFields) As Boolean Public Function SyncEquals(obj As Object, eSyncFields As eOptionalSyncFields) As Boolean
Dim oGame As clsGame = TryCast(obj, clsGame) Dim oGame As clsGame = TryCast(obj, clsGame)
If oGame Is Nothing Then If oGame Is Nothing Then
@@ -253,6 +304,9 @@
If ProcessName <> oGame.ProcessName Then If ProcessName <> oGame.ProcessName Then
Return False Return False
End If End If
If Parameter <> oGame.Parameter Then
Return False
End If
If Path <> oGame.Path Then If Path <> oGame.Path Then
Return False Return False
End If End If
@@ -268,6 +322,9 @@
If FolderSave <> oGame.FolderSave Then If FolderSave <> oGame.FolderSave Then
Return False Return False
End If End If
If CleanFolder <> oGame.CleanFolder Then
Return False
End If
If AppendTimeStamp <> oGame.AppendTimeStamp Then If AppendTimeStamp <> oGame.AppendTimeStamp Then
Return False Return False
End If End If
@@ -277,6 +334,9 @@
If MonitorOnly <> oGame.MonitorOnly Then If MonitorOnly <> oGame.MonitorOnly Then
Return False Return False
End If End If
If Comments <> oGame.Comments Then
Return False
End If
'Optional Sync Fields 'Optional Sync Fields
If (eSyncFields And eOptionalSyncFields.Company) = eOptionalSyncFields.Company Then If (eSyncFields And eOptionalSyncFields.Company) = eOptionalSyncFields.Company Then
@@ -359,4 +419,12 @@
Return sProcessName Return sProcessName
End Function End Function
Public Shared Function SetSyncField(ByVal eSyncFields As eOptionalSyncFields, ByVal eSyncField As eOptionalSyncFields) As eOptionalSyncFields
Return eSyncFields Or eSyncField
End Function
Public Shared Function RemoveSyncField(ByVal eSyncFields As eOptionalSyncFields, ByVal eSyncField As eOptionalSyncFields) As eOptionalSyncFields
Return eSyncFields And (Not eSyncField)
End Function
End Class End Class
+81
View File
@@ -0,0 +1,81 @@
Public Class clsGameFilter
Private sID As String
Private oField As clsGameFilterField
Private bNot As Boolean
Private oData As Object
Private eNumericOperator As eNumericOperators = eNumericOperators.Equals
Public Enum eNumericOperators
Equals = 1
Greater = 2
Lesser = 3
GreaterEquals = 4
LesserEquals = 5
End Enum
Public Property ID As String
Get
Return sID
End Get
Set(value As String)
sID = value
End Set
End Property
Public Property Field As clsGameFilterField
Get
Return oField
End Get
Set(value As clsGameFilterField)
oField = value
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
End Get
Set(value As Object)
oData = value
End Set
End Property
Public Property NumericOperator As eNumericOperators
Get
Return eNumericOperator
End Get
Set(value As eNumericOperators)
eNumericOperator = value
End Set
End Property
Public ReadOnly Property NumericOperatorAsString As String
Get
Select Case eNumericOperator
Case eNumericOperators.Equals
Return "="
Case eNumericOperators.Greater
Return ">"
Case eNumericOperators.GreaterEquals
Return ">="
Case eNumericOperators.Lesser
Return "<"
Case eNumericOperators.LesserEquals
Return "<="
Case Else
Return String.Empty
End Select
End Get
End Property
End Class
+77
View File
@@ -0,0 +1,77 @@
Public Class clsGameFilterField
Public Enum eDataType As Integer
fString = 1
fNumeric = 2
fBool = 3
End Enum
<Flags()> Public Enum eFieldStatus
None = 0
ValidFilter = 1
ValidSort = 2
End Enum
Private sFieldName As String
Private sFriendlyFieldName As String
Private eType As eDataType
Private eStatus As eFieldStatus
Public Property FieldName As String
Get
Return sFieldName
End Get
Set(value As String)
sFieldName = value
End Set
End Property
Public Property FriendlyFieldName As String
Get
Return sFriendlyFieldName
End Get
Set(value As String)
sFriendlyFieldName = value
End Set
End Property
Public Property Type As eDataType
Get
Return eType
End Get
Set(value As eDataType)
eType = value
End Set
End Property
'This is a flag property - Setting a value will toggle that flag on and off.
Public Property Status As eFieldStatus
Get
Return eStatus
End Get
Set(value As eFieldStatus)
If (eStatus And value) = value Then
eStatus = RemoveFieldStatus(value)
Else
eStatus = SetFieldStatus(value)
End If
End Set
End Property
Private Function SetFieldStatus(ByVal eFlag As eFieldStatus) As eFieldStatus
Return eStatus Or eFlag
End Function
Private Function RemoveFieldStatus(ByVal eFlag As eFieldStatus) As eFieldStatus
Return eStatus And (Not eFlag)
End Function
Public Function CheckStatus(ByVal eFlag As eFieldStatus) As Boolean
If (eStatus And eFlag) = eFlag Then
Return True
Else
Return False
End If
End Function
End Class
@@ -1,13 +1,13 @@
Public Class clsRestoreCache Public Class clsSavedPath
Private sName As String Private sPathName As String = String.Empty
Private sPath As String Private sPath As String = String.Empty
Property Name As String Property PathName As String
Get Get
Return sName Return sPathName
End Get End Get
Set(value As String) Set(value As String)
sName = value sPathName = value
End Set End Set
End Property End Property
@@ -19,5 +19,4 @@
sPath = value sPath = value
End Set End Set
End Property End Property
End Class End Class
+44
View File
@@ -0,0 +1,44 @@
Public Class clsSession
Private sMonitorID As String
Private dStart As DateTime
Private dEnd As DateTime
Private sComputerName As String = My.Computer.Name
Public Property MonitorID As String
Set(value As String)
sMonitorID = value
End Set
Get
Return sMonitorID
End Get
End Property
Public Property SessionStart As DateTime
Set(value As DateTime)
dStart = value
End Set
Get
Return dStart
End Get
End Property
Public Property SessionEnd As DateTime
Set(value As DateTime)
dEnd = value
End Set
Get
Return dEnd
End Get
End Property
Public Property ComputerName As String
Set(value As String)
sComputerName = value
End Set
Get
Return sComputerName
End Get
End Property
End Class
+3 -3
View File
@@ -425,8 +425,8 @@ Public Class frmAddWizard
End If End If
End If End If
sNewPath = mgrCommon.OpenFileBrowser(frmAddWizard_ChooseProcess, "exe", sNewPath = mgrCommon.OpenFileBrowser("Wizard_Process_Path", frmAddWizard_ChooseProcess, "exe",
frmAddWizard_Executable, sDefaultFolder, False) frmAddWizard_Executable, sDefaultFolder, False, False)
If sNewPath <> String.Empty Then txtProcessPath.Text = sNewPath If sNewPath <> String.Empty Then txtProcessPath.Text = sNewPath
End Sub End Sub
@@ -442,7 +442,7 @@ Public Class frmAddWizard
End If End If
End If End If
sNewPath = mgrCommon.OpenFolderBrowser(frmAddWizard_ChooseSavePath, sDefaultFolder, False) sNewPath = mgrCommon.OpenFolderBrowser("Wizard_Save_Path", frmAddWizard_ChooseSavePath, sDefaultFolder, False, False)
If sNewPath <> String.Empty Then txtSavePath.Text = sNewPath If sNewPath <> String.Empty Then txtSavePath.Text = sNewPath
End Sub End Sub
+6 -6
View File
@@ -1,9 +1,9 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class frmAdvancedImport Partial Class frmAdvancedImport
Inherits System.Windows.Forms.Form Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list. 'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _ <System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean) Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try Try
If disposing AndAlso components IsNot Nothing Then 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 'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer. 'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor. 'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _ <System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.btnImport = New System.Windows.Forms.Button() Me.btnImport = New System.Windows.Forms.Button()
Me.chkSelectAll = New System.Windows.Forms.CheckBox() Me.chkSelectAll = New System.Windows.Forms.CheckBox()
@@ -44,7 +44,7 @@ Partial Class frmAdvancedImport
'chkSelectAll 'chkSelectAll
' '
Me.chkSelectAll.AutoSize = True 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.Name = "chkSelectAll"
Me.chkSelectAll.Size = New System.Drawing.Size(70, 17) Me.chkSelectAll.Size = New System.Drawing.Size(70, 17)
Me.chkSelectAll.TabIndex = 0 Me.chkSelectAll.TabIndex = 0
@@ -98,9 +98,9 @@ Partial Class frmAdvancedImport
' '
'lblFilter '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.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.TabIndex = 0
Me.lblFilter.Text = "Filter:" Me.lblFilter.Text = "Filter:"
Me.lblFilter.TextAlign = System.Drawing.ContentAlignment.TopRight Me.lblFilter.TextAlign = System.Drawing.ContentAlignment.TopRight
+33 -4
View File
@@ -1,14 +1,25 @@
Imports GBM.My.Resources Imports GBM.My.Resources
Imports System.IO
Public Class frmAdvancedImport Public Class frmAdvancedImport
Private oImportData As ExportData
Private hshImportData As Hashtable Private hshImportData As Hashtable
Private hshFinalData As New Hashtable Private hshFinalData As New Hashtable
Private bSelectAll As Boolean = False Private bSelectAll As Boolean = True
Private bIsLoading As Boolean = False Private bIsLoading As Boolean = False
Private iCurrentSort As Integer = 0 Private iCurrentSort As Integer = 0
Private WithEvents tmFilterTimer As Timer 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 Public Property ImportData As Hashtable
Set(value As Hashtable) Set(value As Hashtable)
hshImportData = value hshImportData = value
@@ -44,7 +55,7 @@ Public Class frmAdvancedImport
End If End If
End Sub End Sub
Private Sub LoadData(Optional ByVal sFilter As String = "") Private Sub LoadData(Optional ByVal sFilter As String = "", Optional ByVal bAutoDetect As Boolean = False)
Dim oApp As clsGame Dim oApp As clsGame
Dim oListViewItem As ListViewItem Dim oListViewItem As ListViewItem
Dim sTags As String Dim sTags As String
@@ -79,6 +90,19 @@ Public Class frmAdvancedImport
oListViewItem.Checked = False oListViewItem.Checked = False
End If End If
If bAutoDetect Then
If oApp.AbsolutePath Then
If Directory.Exists(oApp.Path) Then
oListViewItem.Checked = True
SaveChecked(oListViewItem)
Else
oListViewItem.Checked = False
End If
Else
oListViewItem.Checked = False
End If
End If
If sFilter = String.Empty Then If sFilter = String.Empty Then
bAddItem = True bAddItem = True
Else Else
@@ -121,6 +145,11 @@ Public Class frmAdvancedImport
'Set Form Name 'Set Form Name
Me.Text = frmAdvancedImport_FormName 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 'Set Form Text
lblFilter.Text = frmAdvancedImport_lblFilter lblFilter.Text = frmAdvancedImport_lblFilter
btnCancel.Text = frmAdvancedImport_btnCancel btnCancel.Text = frmAdvancedImport_btnCancel
@@ -142,8 +171,7 @@ Public Class frmAdvancedImport
Private Sub frmAdvancedImport_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub frmAdvancedImport_Load(sender As Object, e As EventArgs) Handles MyBase.Load
bIsLoading = True bIsLoading = True
SetForm() SetForm()
LoadData() LoadData(String.Empty, True)
SelectToggle()
bIsLoading = False bIsLoading = False
End Sub End Sub
@@ -184,6 +212,7 @@ Public Class frmAdvancedImport
tmFilterTimer.Stop() tmFilterTimer.Stop()
tmFilterTimer.Enabled = False tmFilterTimer.Enabled = False
End Sub End Sub
End Class End Class
' Column Sorter ' Column Sorter
+385 -154
View File
@@ -22,75 +22,117 @@ Partial Class frmFilter
'Do not modify it using the code editor. 'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _ <System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.optGameInfo = New System.Windows.Forms.RadioButton()
Me.optTag = New System.Windows.Forms.RadioButton()
Me.grpTagFilter = New System.Windows.Forms.GroupBox() 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.grpTagOptions = New System.Windows.Forms.GroupBox()
Me.optAll = New System.Windows.Forms.RadioButton() Me.optAll = New System.Windows.Forms.RadioButton()
Me.optAny = 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.lblTags = New System.Windows.Forms.Label()
Me.btnRemove = New System.Windows.Forms.Button() Me.btnIncludeRemove = New System.Windows.Forms.Button()
Me.btnAdd = New System.Windows.Forms.Button() Me.btnIncludeAdd = New System.Windows.Forms.Button()
Me.lstFilter = New System.Windows.Forms.ListBox() Me.lstIncludeTags = New System.Windows.Forms.ListBox()
Me.lstTags = New System.Windows.Forms.ListBox() Me.lstTags = New System.Windows.Forms.ListBox()
Me.btnOK = New System.Windows.Forms.Button() Me.btnOK = New System.Windows.Forms.Button()
Me.grpGameFilter = New System.Windows.Forms.GroupBox() Me.grpGameFilter = New System.Windows.Forms.GroupBox()
Me.grpGameInfoOptions = 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()
Me.lblCurrentFilters = New System.Windows.Forms.Label()
Me.lblFilterData = New System.Windows.Forms.Label()
Me.lblFields = New System.Windows.Forms.Label()
Me.btnRemoveFilter = New System.Windows.Forms.Button()
Me.lstFilter = New System.Windows.Forms.ListBox()
Me.btnAddFilter = New System.Windows.Forms.Button()
Me.cboFilterField = New System.Windows.Forms.ComboBox()
Me.grpFilterType = New System.Windows.Forms.GroupBox()
Me.optOr = New System.Windows.Forms.RadioButton() Me.optOr = New System.Windows.Forms.RadioButton()
Me.optAnd = New System.Windows.Forms.RadioButton() Me.optAnd = New System.Windows.Forms.RadioButton()
Me.txtCompany = New System.Windows.Forms.TextBox() Me.txtStringFilter = New System.Windows.Forms.TextBox()
Me.lblCompany = New System.Windows.Forms.Label() Me.grpSorting = New System.Windows.Forms.GroupBox()
Me.txtProcess = New System.Windows.Forms.TextBox() Me.grpSortOptions = New System.Windows.Forms.GroupBox()
Me.lblProcess = New System.Windows.Forms.Label() Me.optSortAsc = New System.Windows.Forms.RadioButton()
Me.lblName = New System.Windows.Forms.Label() Me.optSortDesc = New System.Windows.Forms.RadioButton()
Me.txtName = New System.Windows.Forms.TextBox() Me.lblSortFields = New System.Windows.Forms.Label()
Me.cboSortField = New System.Windows.Forms.ComboBox()
Me.chkTag = New System.Windows.Forms.CheckBox()
Me.chkGameInfo = New System.Windows.Forms.CheckBox()
Me.Label1 = New System.Windows.Forms.Label()
Me.grpTagFilter.SuspendLayout() Me.grpTagFilter.SuspendLayout()
Me.grpTagOptions.SuspendLayout() Me.grpTagOptions.SuspendLayout()
Me.grpGameFilter.SuspendLayout() Me.grpGameFilter.SuspendLayout()
Me.grpGameInfoOptions.SuspendLayout() CType(Me.numFilter, System.ComponentModel.ISupportInitialize).BeginInit()
Me.grpFilterType.SuspendLayout()
Me.grpSorting.SuspendLayout()
Me.grpSortOptions.SuspendLayout()
Me.SuspendLayout() Me.SuspendLayout()
' '
'optGameInfo
'
Me.optGameInfo.AutoSize = True
Me.optGameInfo.Location = New System.Drawing.Point(12, 12)
Me.optGameInfo.Name = "optGameInfo"
Me.optGameInfo.Size = New System.Drawing.Size(108, 17)
Me.optGameInfo.TabIndex = 0
Me.optGameInfo.Text = "Game Information"
Me.optGameInfo.UseVisualStyleBackColor = True
'
'optTag
'
Me.optTag.AutoSize = True
Me.optTag.Location = New System.Drawing.Point(12, 190)
Me.optTag.Name = "optTag"
Me.optTag.Size = New System.Drawing.Size(44, 17)
Me.optTag.TabIndex = 2
Me.optTag.Text = "Tag"
Me.optTag.UseVisualStyleBackColor = True
'
'grpTagFilter '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.grpTagOptions)
Me.grpTagFilter.Controls.Add(Me.lblGameTags) Me.grpTagFilter.Controls.Add(Me.lblIncludeTags)
Me.grpTagFilter.Controls.Add(Me.lblTags) Me.grpTagFilter.Controls.Add(Me.lblTags)
Me.grpTagFilter.Controls.Add(Me.btnRemove) Me.grpTagFilter.Controls.Add(Me.btnIncludeRemove)
Me.grpTagFilter.Controls.Add(Me.btnAdd) Me.grpTagFilter.Controls.Add(Me.btnIncludeAdd)
Me.grpTagFilter.Controls.Add(Me.lstFilter) Me.grpTagFilter.Controls.Add(Me.lstIncludeTags)
Me.grpTagFilter.Controls.Add(Me.lstTags) Me.grpTagFilter.Controls.Add(Me.lstTags)
Me.grpTagFilter.Location = New System.Drawing.Point(12, 213) Me.grpTagFilter.Location = New System.Drawing.Point(12, 236)
Me.grpTagFilter.Name = "grpTagFilter" Me.grpTagFilter.Name = "grpTagFilter"
Me.grpTagFilter.Size = New System.Drawing.Size(385, 265) Me.grpTagFilter.Size = New System.Drawing.Size(410, 198)
Me.grpTagFilter.TabIndex = 3 Me.grpTagFilter.TabIndex = 3
Me.grpTagFilter.TabStop = False 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 'grpTagOptions
' '
Me.grpTagOptions.Controls.Add(Me.optAll) Me.grpTagOptions.Controls.Add(Me.optAll)
Me.grpTagOptions.Controls.Add(Me.optAny) Me.grpTagOptions.Controls.Add(Me.optAny)
Me.grpTagOptions.Location = New System.Drawing.Point(6, 211) Me.grpTagOptions.Location = New System.Drawing.Point(6, 146)
Me.grpTagOptions.Name = "grpTagOptions" Me.grpTagOptions.Name = "grpTagOptions"
Me.grpTagOptions.Size = New System.Drawing.Size(150, 46) Me.grpTagOptions.Size = New System.Drawing.Size(150, 46)
Me.grpTagOptions.TabIndex = 6 Me.grpTagOptions.TabIndex = 6
@@ -118,176 +160,342 @@ Partial Class frmFilter
Me.optAny.Text = "Any Tag" Me.optAny.Text = "Any Tag"
Me.optAny.UseVisualStyleBackColor = True Me.optAny.UseVisualStyleBackColor = True
' '
'lblGameTags 'lblIncludeTags
' '
Me.lblGameTags.AutoSize = True Me.lblIncludeTags.AutoSize = True
Me.lblGameTags.Location = New System.Drawing.Point(271, 16) Me.lblIncludeTags.Location = New System.Drawing.Point(23, 16)
Me.lblGameTags.Name = "lblGameTags" Me.lblIncludeTags.Name = "lblIncludeTags"
Me.lblGameTags.Size = New System.Drawing.Size(66, 13) Me.lblIncludeTags.Size = New System.Drawing.Size(69, 13)
Me.lblGameTags.TabIndex = 4 Me.lblIncludeTags.TabIndex = 4
Me.lblGameTags.Text = "Current Filter" Me.lblIncludeTags.Text = "Include Tags"
' '
'lblTags 'lblTags
' '
Me.lblTags.AutoSize = True 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.Name = "lblTags"
Me.lblTags.Size = New System.Drawing.Size(77, 13) Me.lblTags.Size = New System.Drawing.Size(77, 13)
Me.lblTags.TabIndex = 0 Me.lblTags.TabIndex = 0
Me.lblTags.Text = "Available Tags" Me.lblTags.Text = "Available Tags"
' '
'btnRemove 'btnIncludeRemove
' '
Me.btnRemove.Location = New System.Drawing.Point(162, 122) Me.btnIncludeRemove.Location = New System.Drawing.Point(115, 91)
Me.btnRemove.Name = "btnRemove" Me.btnIncludeRemove.Name = "btnIncludeRemove"
Me.btnRemove.Size = New System.Drawing.Size(61, 23) Me.btnIncludeRemove.Size = New System.Drawing.Size(31, 23)
Me.btnRemove.TabIndex = 3 Me.btnIncludeRemove.TabIndex = 3
Me.btnRemove.Text = "<" Me.btnIncludeRemove.Text = ">"
Me.btnRemove.UseVisualStyleBackColor = True Me.btnIncludeRemove.UseVisualStyleBackColor = True
' '
'btnAdd 'btnIncludeAdd
' '
Me.btnAdd.Location = New System.Drawing.Point(162, 93) Me.btnIncludeAdd.Location = New System.Drawing.Point(115, 62)
Me.btnAdd.Name = "btnAdd" Me.btnIncludeAdd.Name = "btnIncludeAdd"
Me.btnAdd.Size = New System.Drawing.Size(61, 23) Me.btnIncludeAdd.Size = New System.Drawing.Size(31, 23)
Me.btnAdd.TabIndex = 2 Me.btnIncludeAdd.TabIndex = 2
Me.btnAdd.Text = ">" Me.btnIncludeAdd.Text = "<"
Me.btnAdd.UseVisualStyleBackColor = True Me.btnIncludeAdd.UseVisualStyleBackColor = True
' '
'lstFilter 'lstIncludeTags
' '
Me.lstFilter.FormattingEnabled = True Me.lstIncludeTags.FormattingEnabled = True
Me.lstFilter.Location = New System.Drawing.Point(229, 32) Me.lstIncludeTags.Location = New System.Drawing.Point(6, 32)
Me.lstFilter.Name = "lstFilter" Me.lstIncludeTags.Name = "lstIncludeTags"
Me.lstFilter.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended Me.lstIncludeTags.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended
Me.lstFilter.Size = New System.Drawing.Size(150, 173) Me.lstIncludeTags.Size = New System.Drawing.Size(103, 108)
Me.lstFilter.Sorted = True Me.lstIncludeTags.Sorted = True
Me.lstFilter.TabIndex = 5 Me.lstIncludeTags.TabIndex = 5
' '
'lstTags 'lstTags
' '
Me.lstTags.FormattingEnabled = True 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.Name = "lstTags"
Me.lstTags.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended Me.lstTags.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended
Me.lstTags.Size = New System.Drawing.Size(150, 173) Me.lstTags.Size = New System.Drawing.Size(103, 108)
Me.lstTags.Sorted = True Me.lstTags.Sorted = True
Me.lstTags.TabIndex = 1 Me.lstTags.TabIndex = 1
' '
'btnOK 'btnOK
' '
Me.btnOK.Location = New System.Drawing.Point(322, 484) Me.btnOK.Location = New System.Drawing.Point(347, 526)
Me.btnOK.Name = "btnOK" Me.btnOK.Name = "btnOK"
Me.btnOK.Size = New System.Drawing.Size(75, 23) Me.btnOK.Size = New System.Drawing.Size(75, 23)
Me.btnOK.TabIndex = 4 Me.btnOK.TabIndex = 6
Me.btnOK.Text = "&OK" Me.btnOK.Text = "&OK"
Me.btnOK.UseVisualStyleBackColor = True Me.btnOK.UseVisualStyleBackColor = True
' '
'grpGameFilter 'grpGameFilter
' '
Me.grpGameFilter.Controls.Add(Me.grpGameInfoOptions) Me.grpGameFilter.Controls.Add(Me.lblNot)
Me.grpGameFilter.Controls.Add(Me.txtCompany) Me.grpGameFilter.Controls.Add(Me.chkNot)
Me.grpGameFilter.Controls.Add(Me.lblCompany) Me.grpGameFilter.Controls.Add(Me.cboBoolFilter)
Me.grpGameFilter.Controls.Add(Me.txtProcess) Me.grpGameFilter.Controls.Add(Me.numFilter)
Me.grpGameFilter.Controls.Add(Me.lblProcess) Me.grpGameFilter.Controls.Add(Me.cboNumericOps)
Me.grpGameFilter.Controls.Add(Me.lblName) Me.grpGameFilter.Controls.Add(Me.lblCurrentFilters)
Me.grpGameFilter.Controls.Add(Me.txtName) Me.grpGameFilter.Controls.Add(Me.lblFilterData)
Me.grpGameFilter.Controls.Add(Me.lblFields)
Me.grpGameFilter.Controls.Add(Me.btnRemoveFilter)
Me.grpGameFilter.Controls.Add(Me.lstFilter)
Me.grpGameFilter.Controls.Add(Me.btnAddFilter)
Me.grpGameFilter.Controls.Add(Me.cboFilterField)
Me.grpGameFilter.Controls.Add(Me.grpFilterType)
Me.grpGameFilter.Controls.Add(Me.txtStringFilter)
Me.grpGameFilter.Location = New System.Drawing.Point(12, 35) Me.grpGameFilter.Location = New System.Drawing.Point(12, 35)
Me.grpGameFilter.Name = "grpGameFilter" Me.grpGameFilter.Name = "grpGameFilter"
Me.grpGameFilter.Size = New System.Drawing.Size(385, 150) Me.grpGameFilter.Size = New System.Drawing.Size(410, 172)
Me.grpGameFilter.TabIndex = 1 Me.grpGameFilter.TabIndex = 1
Me.grpGameFilter.TabStop = False Me.grpGameFilter.TabStop = False
' '
'grpGameInfoOptions 'lblNot
' '
Me.grpGameInfoOptions.Controls.Add(Me.optOr) Me.lblNot.AutoSize = True
Me.grpGameInfoOptions.Controls.Add(Me.optAnd) Me.lblNot.Location = New System.Drawing.Point(161, 20)
Me.grpGameInfoOptions.Location = New System.Drawing.Point(14, 97) Me.lblNot.Name = "lblNot"
Me.grpGameInfoOptions.Name = "grpGameInfoOptions" Me.lblNot.Size = New System.Drawing.Size(24, 13)
Me.grpGameInfoOptions.Size = New System.Drawing.Size(106, 46) Me.lblNot.TabIndex = 11
Me.grpGameInfoOptions.TabIndex = 6 Me.lblNot.Text = "Not"
Me.grpGameInfoOptions.TabStop = False '
Me.grpGameInfoOptions.Text = "Options" '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(187, 36)
Me.cboBoolFilter.Name = "cboBoolFilter"
Me.cboBoolFilter.Size = New System.Drawing.Size(136, 21)
Me.cboBoolFilter.TabIndex = 3
'
'numFilter
'
Me.numFilter.DecimalPlaces = 1
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)
Me.numFilter.TabIndex = 4
'
'cboNumericOps
'
Me.cboNumericOps.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cboNumericOps.FormattingEnabled = True
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
'
'lblCurrentFilters
'
Me.lblCurrentFilters.AutoSize = True
Me.lblCurrentFilters.Location = New System.Drawing.Point(94, 65)
Me.lblCurrentFilters.Name = "lblCurrentFilters"
Me.lblCurrentFilters.Size = New System.Drawing.Size(71, 13)
Me.lblCurrentFilters.TabIndex = 6
Me.lblCurrentFilters.Text = "Current Filters"
'
'lblFilterData
'
Me.lblFilterData.AutoSize = True
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
Me.lblFilterData.Text = "Filter "
'
'lblFields
'
Me.lblFields.AutoSize = True
Me.lblFields.Location = New System.Drawing.Point(41, 20)
Me.lblFields.Name = "lblFields"
Me.lblFields.Size = New System.Drawing.Size(80, 13)
Me.lblFields.TabIndex = 0
Me.lblFields.Text = "Available Fields"
'
'btnRemoveFilter
'
Me.btnRemoveFilter.Location = New System.Drawing.Point(259, 140)
Me.btnRemoveFilter.Name = "btnRemoveFilter"
Me.btnRemoveFilter.Size = New System.Drawing.Size(75, 23)
Me.btnRemoveFilter.TabIndex = 9
Me.btnRemoveFilter.Text = "Remove"
Me.btnRemoveFilter.UseVisualStyleBackColor = True
'
'lstFilter
'
Me.lstFilter.FormattingEnabled = True
Me.lstFilter.Location = New System.Drawing.Point(6, 81)
Me.lstFilter.Name = "lstFilter"
Me.lstFilter.Size = New System.Drawing.Size(247, 82)
Me.lstFilter.TabIndex = 7
'
'btnAddFilter
'
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
Me.btnAddFilter.Text = "Add"
Me.btnAddFilter.UseVisualStyleBackColor = True
'
'cboFilterField
'
Me.cboFilterField.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cboFilterField.FormattingEnabled = True
Me.cboFilterField.Location = New System.Drawing.Point(6, 36)
Me.cboFilterField.Name = "cboFilterField"
Me.cboFilterField.Size = New System.Drawing.Size(150, 21)
Me.cboFilterField.TabIndex = 1
'
'grpFilterType
'
Me.grpFilterType.Controls.Add(Me.optOr)
Me.grpFilterType.Controls.Add(Me.optAnd)
Me.grpFilterType.Location = New System.Drawing.Point(259, 81)
Me.grpFilterType.Name = "grpFilterType"
Me.grpFilterType.Size = New System.Drawing.Size(105, 46)
Me.grpFilterType.TabIndex = 8
Me.grpFilterType.TabStop = False
Me.grpFilterType.Text = "Filter Type"
' '
'optOr 'optOr
' '
Me.optOr.Location = New System.Drawing.Point(56, 19) Me.optOr.Checked = True
Me.optOr.Location = New System.Drawing.Point(6, 19)
Me.optOr.Name = "optOr" Me.optOr.Name = "optOr"
Me.optOr.Size = New System.Drawing.Size(36, 17) Me.optOr.Size = New System.Drawing.Size(44, 17)
Me.optOr.TabIndex = 1 Me.optOr.TabIndex = 0
Me.optOr.TabStop = True Me.optOr.TabStop = True
Me.optOr.Text = "Or" Me.optOr.Text = "Any"
Me.optOr.UseVisualStyleBackColor = True Me.optOr.UseVisualStyleBackColor = True
' '
'optAnd 'optAnd
' '
Me.optAnd.Checked = True Me.optAnd.Location = New System.Drawing.Point(56, 19)
Me.optAnd.Location = New System.Drawing.Point(6, 19)
Me.optAnd.Name = "optAnd" Me.optAnd.Name = "optAnd"
Me.optAnd.Size = New System.Drawing.Size(44, 17) Me.optAnd.Size = New System.Drawing.Size(44, 17)
Me.optAnd.TabIndex = 0 Me.optAnd.TabIndex = 1
Me.optAnd.TabStop = True Me.optAnd.Text = "All"
Me.optAnd.Text = "And"
Me.optAnd.UseVisualStyleBackColor = True Me.optAnd.UseVisualStyleBackColor = True
' '
'txtCompany 'txtStringFilter
' '
Me.txtCompany.Location = New System.Drawing.Point(70, 71) Me.txtStringFilter.Location = New System.Drawing.Point(187, 36)
Me.txtCompany.Name = "txtCompany" Me.txtStringFilter.Name = "txtStringFilter"
Me.txtCompany.Size = New System.Drawing.Size(309, 20) Me.txtStringFilter.Size = New System.Drawing.Size(136, 20)
Me.txtCompany.TabIndex = 5 Me.txtStringFilter.TabIndex = 3
' '
'lblCompany 'grpSorting
' '
Me.lblCompany.AutoSize = True Me.grpSorting.Controls.Add(Me.grpSortOptions)
Me.lblCompany.Location = New System.Drawing.Point(11, 74) Me.grpSorting.Controls.Add(Me.lblSortFields)
Me.lblCompany.Name = "lblCompany" Me.grpSorting.Controls.Add(Me.cboSortField)
Me.lblCompany.Size = New System.Drawing.Size(54, 13) Me.grpSorting.Location = New System.Drawing.Point(12, 440)
Me.lblCompany.TabIndex = 4 Me.grpSorting.Name = "grpSorting"
Me.lblCompany.Text = "Company:" Me.grpSorting.Size = New System.Drawing.Size(410, 80)
Me.grpSorting.TabIndex = 4
Me.grpSorting.TabStop = False
Me.grpSorting.Text = "Sorting"
' '
'txtProcess 'grpSortOptions
' '
Me.txtProcess.Location = New System.Drawing.Point(70, 45) Me.grpSortOptions.Controls.Add(Me.optSortAsc)
Me.txtProcess.Name = "txtProcess" Me.grpSortOptions.Controls.Add(Me.optSortDesc)
Me.txtProcess.Size = New System.Drawing.Size(309, 20) Me.grpSortOptions.Location = New System.Drawing.Point(162, 19)
Me.txtProcess.TabIndex = 3 Me.grpSortOptions.Name = "grpSortOptions"
Me.grpSortOptions.Size = New System.Drawing.Size(189, 43)
Me.grpSortOptions.TabIndex = 3
Me.grpSortOptions.TabStop = False
Me.grpSortOptions.Text = "Sort Options"
' '
'lblProcess 'optSortAsc
' '
Me.lblProcess.AutoSize = True Me.optSortAsc.AutoSize = True
Me.lblProcess.Location = New System.Drawing.Point(11, 48) Me.optSortAsc.Location = New System.Drawing.Point(6, 17)
Me.lblProcess.Name = "lblProcess" Me.optSortAsc.Name = "optSortAsc"
Me.lblProcess.Size = New System.Drawing.Size(48, 13) Me.optSortAsc.Size = New System.Drawing.Size(75, 17)
Me.lblProcess.TabIndex = 2 Me.optSortAsc.TabIndex = 0
Me.lblProcess.Text = "Process:" Me.optSortAsc.TabStop = True
Me.optSortAsc.Text = "Ascending"
Me.optSortAsc.UseVisualStyleBackColor = True
' '
'lblName 'optSortDesc
' '
Me.lblName.AutoSize = True Me.optSortDesc.AutoSize = True
Me.lblName.Location = New System.Drawing.Point(11, 22) Me.optSortDesc.Location = New System.Drawing.Point(90, 17)
Me.lblName.Name = "lblName" Me.optSortDesc.Name = "optSortDesc"
Me.lblName.Size = New System.Drawing.Size(38, 13) Me.optSortDesc.Size = New System.Drawing.Size(82, 17)
Me.lblName.TabIndex = 0 Me.optSortDesc.TabIndex = 1
Me.lblName.Text = "Name:" Me.optSortDesc.TabStop = True
Me.optSortDesc.Text = "Descending"
Me.optSortDesc.UseVisualStyleBackColor = True
' '
'txtName 'lblSortFields
' '
Me.txtName.Location = New System.Drawing.Point(70, 19) Me.lblSortFields.AutoSize = True
Me.txtName.Name = "txtName" Me.lblSortFields.Location = New System.Drawing.Point(41, 19)
Me.txtName.Size = New System.Drawing.Size(309, 20) Me.lblSortFields.Name = "lblSortFields"
Me.txtName.TabIndex = 1 Me.lblSortFields.Size = New System.Drawing.Size(80, 13)
Me.lblSortFields.TabIndex = 1
Me.lblSortFields.Text = "Available Fields"
'
'cboSortField
'
Me.cboSortField.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cboSortField.FormattingEnabled = True
Me.cboSortField.Location = New System.Drawing.Point(6, 35)
Me.cboSortField.Name = "cboSortField"
Me.cboSortField.Size = New System.Drawing.Size(150, 21)
Me.cboSortField.TabIndex = 2
'
'chkTag
'
Me.chkTag.AutoSize = True
Me.chkTag.Location = New System.Drawing.Point(12, 213)
Me.chkTag.Name = "chkTag"
Me.chkTag.Size = New System.Drawing.Size(45, 17)
Me.chkTag.TabIndex = 2
Me.chkTag.Text = "Tag"
Me.chkTag.UseVisualStyleBackColor = True
'
'chkGameInfo
'
Me.chkGameInfo.AutoSize = True
Me.chkGameInfo.Location = New System.Drawing.Point(12, 12)
Me.chkGameInfo.Name = "chkGameInfo"
Me.chkGameInfo.Size = New System.Drawing.Size(109, 17)
Me.chkGameInfo.TabIndex = 0
Me.chkGameInfo.Text = "Game Information"
Me.chkGameInfo.UseVisualStyleBackColor = True
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(12, 531)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(249, 13)
Me.Label1.TabIndex = 5
Me.Label1.Text = "* Indicates a field that may give unexpected results."
' '
'frmFilter 'frmFilter
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(409, 516) Me.ClientSize = New System.Drawing.Size(434, 561)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.grpSorting)
Me.Controls.Add(Me.chkTag)
Me.Controls.Add(Me.grpGameFilter) Me.Controls.Add(Me.grpGameFilter)
Me.Controls.Add(Me.chkGameInfo)
Me.Controls.Add(Me.grpTagFilter) Me.Controls.Add(Me.grpTagFilter)
Me.Controls.Add(Me.btnOK) Me.Controls.Add(Me.btnOK)
Me.Controls.Add(Me.optTag)
Me.Controls.Add(Me.optGameInfo)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False Me.MaximizeBox = False
Me.MinimizeBox = False Me.MinimizeBox = False
@@ -300,32 +508,55 @@ Partial Class frmFilter
Me.grpTagOptions.ResumeLayout(False) Me.grpTagOptions.ResumeLayout(False)
Me.grpGameFilter.ResumeLayout(False) Me.grpGameFilter.ResumeLayout(False)
Me.grpGameFilter.PerformLayout() Me.grpGameFilter.PerformLayout()
Me.grpGameInfoOptions.ResumeLayout(False) CType(Me.numFilter, System.ComponentModel.ISupportInitialize).EndInit()
Me.grpFilterType.ResumeLayout(False)
Me.grpSorting.ResumeLayout(False)
Me.grpSorting.PerformLayout()
Me.grpSortOptions.ResumeLayout(False)
Me.grpSortOptions.PerformLayout()
Me.ResumeLayout(False) Me.ResumeLayout(False)
Me.PerformLayout() Me.PerformLayout()
End Sub End Sub
Friend WithEvents optGameInfo As System.Windows.Forms.RadioButton
Friend WithEvents optTag As System.Windows.Forms.RadioButton
Friend WithEvents grpTagFilter As System.Windows.Forms.GroupBox Friend WithEvents grpTagFilter As System.Windows.Forms.GroupBox
Friend WithEvents grpTagOptions As System.Windows.Forms.GroupBox Friend WithEvents grpTagOptions As System.Windows.Forms.GroupBox
Friend WithEvents optAll As System.Windows.Forms.RadioButton Friend WithEvents optAll As System.Windows.Forms.RadioButton
Friend WithEvents optAny 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 lblTags As System.Windows.Forms.Label
Friend WithEvents btnRemove As System.Windows.Forms.Button Friend WithEvents btnIncludeRemove As System.Windows.Forms.Button
Friend WithEvents btnAdd As System.Windows.Forms.Button Friend WithEvents btnIncludeAdd As System.Windows.Forms.Button
Friend WithEvents lstFilter As System.Windows.Forms.ListBox Friend WithEvents lstIncludeTags As System.Windows.Forms.ListBox
Friend WithEvents lstTags As System.Windows.Forms.ListBox Friend WithEvents lstTags As System.Windows.Forms.ListBox
Friend WithEvents btnOK As System.Windows.Forms.Button Friend WithEvents btnOK As System.Windows.Forms.Button
Friend WithEvents grpGameFilter As System.Windows.Forms.GroupBox Friend WithEvents grpGameFilter As System.Windows.Forms.GroupBox
Friend WithEvents txtProcess As System.Windows.Forms.TextBox Friend WithEvents txtStringFilter As System.Windows.Forms.TextBox
Friend WithEvents lblProcess As System.Windows.Forms.Label Friend WithEvents grpFilterType As System.Windows.Forms.GroupBox
Friend WithEvents lblName As System.Windows.Forms.Label
Friend WithEvents txtName As System.Windows.Forms.TextBox
Friend WithEvents txtCompany As System.Windows.Forms.TextBox
Friend WithEvents lblCompany As System.Windows.Forms.Label
Friend WithEvents grpGameInfoOptions As System.Windows.Forms.GroupBox
Friend WithEvents optOr As System.Windows.Forms.RadioButton Friend WithEvents optOr As System.Windows.Forms.RadioButton
Friend WithEvents optAnd As System.Windows.Forms.RadioButton Friend WithEvents optAnd As System.Windows.Forms.RadioButton
Friend WithEvents grpSorting As GroupBox
Friend WithEvents optSortDesc As RadioButton
Friend WithEvents optSortAsc As RadioButton
Friend WithEvents cboSortField As ComboBox
Friend WithEvents chkTag As CheckBox
Friend WithEvents chkGameInfo As CheckBox
Friend WithEvents cboFilterField As ComboBox
Friend WithEvents lstFilter As ListBox
Friend WithEvents btnAddFilter As Button
Friend WithEvents btnRemoveFilter As Button
Friend WithEvents lblCurrentFilters As Label
Friend WithEvents lblFilterData As Label
Friend WithEvents lblFields As Label
Friend WithEvents cboNumericOps As ComboBox
Friend WithEvents numFilter As NumericUpDown
Friend WithEvents cboBoolFilter As ComboBox
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 End Class
+533 -65
View File
@@ -3,45 +3,93 @@
Public Class frmFilter Public Class frmFilter
Public Enum eFilterType As Integer Public Enum eFilterType As Integer
NoFilter = 1 BaseFilter = 1
AnyTag = 2 AnyTag = 2
AllTags = 3 AllTags = 3
NoTags = 4 NoTags = 4
FieldAnd = 5
FieldOr = 6
End Enum End Enum
Dim oTagFilters As New List(Of clsTag) Dim oIncludeTagFilters As New List(Of clsTag)
Dim hshStringFilters As New Hashtable Dim oExcludeTagFilters As New List(Of clsTag)
Dim eCurrentFilterType As eFilterType = eFilterType.AnyTag Dim oGameFilters As New List(Of clsGameFilter)
Dim oValidFields As New List(Of clsGameFilterField)
Dim eCurrentFilterType As eFilterType = eFilterType.BaseFilter
Dim bAndOperator As Boolean = False
Dim bSortAsc As Boolean = True
Dim sSortField As String = "Name"
Dim hshTags As New Hashtable Dim hshTags As New Hashtable
Dim bShutdown As Boolean = False Dim bShutdown As Boolean = False
Public ReadOnly Property StringFilters As Hashtable Public Property GameFilters As List(Of clsGameFilter)
Get Get
Return hshStringFilters Return oGameFilters
End Get End Get
Set(value As List(Of clsGameFilter))
oGameFilters = value
End Set
End Property End Property
Public ReadOnly Property TagFilters As List(Of clsTag) Public Property IncludeTagFilters As List(Of clsTag)
Get Get
Return oTagFilters Return oIncludeTagFilters
End Get End Get
Set(value As List(Of clsTag))
oIncludeTagFilters = value
End Set
End Property End Property
Public ReadOnly Property FilterType As eFilterType Public Property ExcludeTagFilters As List(Of clsTag)
Get
Return oExcludeTagFilters
End Get
Set(value As List(Of clsTag))
oExcludeTagFilters = value
End Set
End Property
Public Property FilterType As eFilterType
Get Get
Return eCurrentFilterType Return eCurrentFilterType
End Get End Get
Set(value As eFilterType)
eCurrentFilterType = value
End Set
End Property End Property
Private Sub AddTag() Public Property AndOperator As Boolean
Get
Return bAndOperator
End Get
Set(value As Boolean)
bAndOperator = value
End Set
End Property
Public Property SortAsc As Boolean
Get
Return bSortAsc
End Get
Set(value As Boolean)
bSortAsc = value
End Set
End Property
Public Property SortField As String
Get
Return sSortField
End Get
Set(value As String)
sSortField = value
End Set
End Property
Private Sub AddTag(ByRef lst As ListBox)
Dim oData As KeyValuePair(Of String, String) Dim oData As KeyValuePair(Of String, String)
Dim oTags As List(Of KeyValuePair(Of String, String)) Dim oTags As List(Of KeyValuePair(Of String, String))
If lstTags.SelectedItems.Count = 1 Then If lstTags.SelectedItems.Count = 1 Then
oData = lstTags.SelectedItems(0) oData = lstTags.SelectedItems(0)
lstFilter.Items.Add(oData) lst.Items.Add(oData)
lstTags.Items.Remove(oData) lstTags.Items.Remove(oData)
ElseIf lstTags.SelectedItems.Count > 1 Then ElseIf lstTags.SelectedItems.Count > 1 Then
oTags = New List(Of KeyValuePair(Of String, String)) oTags = New List(Of KeyValuePair(Of String, String))
@@ -51,37 +99,192 @@ Public Class frmFilter
Next Next
For Each kp As KeyValuePair(Of String, String) In oTags For Each kp As KeyValuePair(Of String, String) In oTags
lstFilter.Items.Add(kp) lst.Items.Add(kp)
lstTags.Items.Remove(kp) lstTags.Items.Remove(kp)
Next Next
End If End If
End Sub End Sub
Private Sub RemoveTag() Private Sub RemoveTag(ByRef lst As ListBox)
Dim oData As KeyValuePair(Of String, String) Dim oData As KeyValuePair(Of String, String)
Dim oTags As List(Of KeyValuePair(Of String, String)) Dim oTags As List(Of KeyValuePair(Of String, String))
If lstFilter.SelectedItems.Count = 1 Then If lst.SelectedItems.Count = 1 Then
oData = lstFilter.SelectedItems(0) oData = lst.SelectedItems(0)
lstFilter.Items.Remove(oData) lst.Items.Remove(oData)
lstTags.Items.Add(oData) lstTags.Items.Add(oData)
ElseIf lstFilter.SelectedItems.Count > 1 Then ElseIf lst.SelectedItems.Count > 1 Then
oTags = New List(Of KeyValuePair(Of String, String)) oTags = New List(Of KeyValuePair(Of String, String))
For Each oData In lstFilter.SelectedItems For Each oData In lst.SelectedItems
oTags.Add(oData) oTags.Add(oData)
Next Next
For Each kp As KeyValuePair(Of String, String) In oTags For Each kp As KeyValuePair(Of String, String) In oTags
lstFilter.Items.Remove(kp) lst.Items.Remove(kp)
lstTags.Items.Add(kp) lstTags.Items.Add(kp)
Next Next
End If End If
End Sub End Sub
Private Sub LoadData() Private Sub LoadFilterFields()
Dim oField As clsGameFilterField
'Name
oField = New clsGameFilterField
oField.FieldName = "Name"
oField.FriendlyFieldName = frmFilter_FieldName
oField.Type = clsGameFilterField.eDataType.fString
oField.Status = clsGameFilterField.eFieldStatus.ValidSort
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Process
oField = New clsGameFilterField
oField.FieldName = "Process"
oField.FriendlyFieldName = frmFilter_FieldProcess
oField.Type = clsGameFilterField.eDataType.fString
oField.Status = clsGameFilterField.eFieldStatus.ValidSort
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Parameter
oField = New clsGameFilterField
oField.FieldName = "Parameter"
oField.FriendlyFieldName = frmFilter_FieldParameter
oField.Type = clsGameFilterField.eDataType.fString
oField.Status = clsGameFilterField.eFieldStatus.ValidSort
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Save Path
oField = New clsGameFilterField
oField.FieldName = "Path"
oField.FriendlyFieldName = frmFilter_FieldPath
oField.Type = clsGameFilterField.eDataType.fString
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Include Items
oField = New clsGameFilterField
oField.FieldName = "FileType"
oField.FriendlyFieldName = frmFilter_FieldFileType
oField.Type = clsGameFilterField.eDataType.fString
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Exclude Items
oField = New clsGameFilterField
oField.FieldName = "ExcludeList"
oField.FriendlyFieldName = frmFilter_FieldExcludeList
oField.Type = clsGameFilterField.eDataType.fString
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Save Entire Folder
oField = New clsGameFilterField
oField.FieldName = "FolderSave"
oField.FriendlyFieldName = frmFilter_FieldFolderSave
oField.Type = clsGameFilterField.eDataType.fBool
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Delete Folder on Restore
oField = New clsGameFilterField
oField.FieldName = "CleanFolder"
oField.FriendlyFieldName = frmFilter_FieldCleanFolder
oField.Type = clsGameFilterField.eDataType.fBool
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Save Multiple Backups
oField = New clsGameFilterField
oField.FieldName = "TimeStamp"
oField.FriendlyFieldName = frmFilter_FieldTimeStamp
oField.Type = clsGameFilterField.eDataType.fBool
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Backup Limit
oField = New clsGameFilterField
oField.FieldName = "BackupLimit"
oField.FriendlyFieldName = frmFilter_FieldBackupLimit
oField.Type = clsGameFilterField.eDataType.fNumeric
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Comments
oField = New clsGameFilterField
oField.FieldName = "Comments"
oField.FriendlyFieldName = frmFilter_FieldComments
oField.Type = clsGameFilterField.eDataType.fString
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Game Path
oField = New clsGameFilterField
oField.FieldName = "ProcessPath"
oField.FriendlyFieldName = frmFilter_FieldProcessPath
oField.Type = clsGameFilterField.eDataType.fString
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Company
oField = New clsGameFilterField
oField.FieldName = "Company"
oField.FriendlyFieldName = frmFilter_FieldCompany
oField.Type = clsGameFilterField.eDataType.fString
oField.Status = clsGameFilterField.eFieldStatus.ValidSort
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Version
oField = New clsGameFilterField
oField.FieldName = "Version"
oField.FriendlyFieldName = frmFilter_FieldVersion
oField.Type = clsGameFilterField.eDataType.fString
oField.Status = clsGameFilterField.eFieldStatus.ValidSort
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Icon
oField = New clsGameFilterField
oField.FieldName = "Icon"
oField.FriendlyFieldName = frmFilter_FieldIcon
oField.Type = clsGameFilterField.eDataType.fString
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Hours
oField = New clsGameFilterField
oField.FieldName = "Hours"
oField.FriendlyFieldName = frmFilter_FieldHours
oField.Type = clsGameFilterField.eDataType.fNumeric
oField.Status = clsGameFilterField.eFieldStatus.ValidSort
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Enabled
oField = New clsGameFilterField
oField.FieldName = "Enabled"
oField.FriendlyFieldName = frmFilter_FieldEnabled
oField.Type = clsGameFilterField.eDataType.fBool
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Monitor Only
oField = New clsGameFilterField
oField.FieldName = "MonitorOnly"
oField.FriendlyFieldName = frmFilter_FieldMonitorOnly
oField.Type = clsGameFilterField.eDataType.fBool
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
End Sub
Private Sub LoadTagData()
Dim oTag As clsTag Dim oTag As clsTag
Dim oData As KeyValuePair(Of String, String) Dim oData As KeyValuePair(Of String, String)
@@ -90,12 +293,17 @@ Public Class frmFilter
'Handle Lists 'Handle Lists
lstTags.Items.Clear() lstTags.Items.Clear()
lstFilter.Items.Clear() lstIncludeTags.Items.Clear()
lstExcludeTags.Items.Clear()
lstTags.ValueMember = "Key" lstTags.ValueMember = "Key"
lstTags.DisplayMember = "Value" lstTags.DisplayMember = "Value"
lstFilter.ValueMember = "Key"
lstFilter.DisplayMember = "Value" lstIncludeTags.ValueMember = "Key"
lstIncludeTags.DisplayMember = "Value"
lstExcludeTags.ValueMember = "Key"
lstExcludeTags.DisplayMember = "Value"
For Each de As DictionaryEntry In hshTags For Each de As DictionaryEntry In hshTags
oTag = DirectCast(de.Value, clsTag) oTag = DirectCast(de.Value, clsTag)
@@ -105,38 +313,178 @@ Public Class frmFilter
End Sub End Sub
Private Sub LoadExistingFilters()
Dim sFilter As String = String.Empty
Dim oListTag As KeyValuePair(Of String, String)
'Game Filters
If bAndOperator Then
optAnd.Checked = True
Else
optOr.Checked = True
End If
If oGameFilters.Count > 0 Then
chkGameInfo.Checked = True
For Each oFilter As clsGameFilter In oGameFilters
Select Case oFilter.Field.Type
Case clsGameFilterField.eDataType.fString
sFilter = oFilter.Field.FriendlyFieldName & " " & frmFilter_lstFilterContains & " """ & oFilter.Data & """"
Case clsGameFilterField.eDataType.fNumeric
sFilter = oFilter.Field.FriendlyFieldName & " " & oFilter.NumericOperatorAsString & " " & oFilter.Data
Case clsGameFilterField.eDataType.fBool
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 oIncludeTagFilters.Count > 0 Then
chkTag.Checked = True
For Each oTag As clsTag In oIncludeTagFilters
oListTag = New KeyValuePair(Of String, String)(oTag.ID, oTag.Name)
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
If eCurrentFilterType = eFilterType.AllTags Then
optAll.Checked = True
Else
optAny.Checked = True
End If
End If
'Sorting
cboSortField.SelectedValue = sSortField
If bSortAsc Then
optSortAsc.Checked = True
Else
optSortDesc.Checked = True
End If
End Sub
Private Sub ChangeFilterMode()
Dim oFilterType As clsGameFilterField.eDataType = DirectCast(cboFilterField.SelectedValue, clsGameFilterField).Type
'Reset
cboNumericOps.SelectedIndex = 0
cboBoolFilter.SelectedIndex = 0
numFilter.Value = 0
txtStringFilter.Text = String.Empty
chkNot.Checked = False
'Reset Visibilty
cboBoolFilter.Visible = False
cboNumericOps.Visible = False
numFilter.Visible = False
txtStringFilter.Visible = False
'Set Visiblity
Select Case oFilterType
Case clsGameFilterField.eDataType.fString
txtStringFilter.Visible = True
Case clsGameFilterField.eDataType.fNumeric
cboNumericOps.Visible = True
numFilter.Visible = True
txtStringFilter.Visible = False
Case clsGameFilterField.eDataType.fBool
cboBoolFilter.Visible = True
End Select
End Sub
Private Sub AddFilter()
Dim oFilter As New clsGameFilter
Dim sFilter As String = String.Empty
'Build Filter
oFilter.ID = Guid.NewGuid.ToString.Split("-")(0)
oFilter.Field = cboFilterField.SelectedValue
Select Case oFilter.Field.Type
Case clsGameFilterField.eDataType.fString
oFilter.Data = txtStringFilter.Text
sFilter = oFilter.Field.FriendlyFieldName & " " & frmFilter_lstFilterContains & " """ & oFilter.Data & """"
Case clsGameFilterField.eDataType.fNumeric
oFilter.Data = numFilter.Value
oFilter.NumericOperator = DirectCast(cboNumericOps.SelectedValue, clsGameFilter.eNumericOperators)
sFilter = oFilter.Field.FriendlyFieldName & " " & oFilter.NumericOperatorAsString & " " & oFilter.Data
Case clsGameFilterField.eDataType.fBool
oFilter.Data = cboBoolFilter.SelectedValue
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))
End Sub
Private Sub RemoveFilter()
Dim oFilter As Object
If lstFilter.SelectedIndex <> -1 Then
oFilter = lstFilter.SelectedItem
oGameFilters.Remove(DirectCast(oFilter, KeyValuePair(Of clsGameFilter, String)).Key)
lstFilter.Items.Remove(oFilter)
End If
End Sub
Private Sub GetFilters() Private Sub GetFilters()
Dim oData As KeyValuePair(Of String, String) Dim oData As KeyValuePair(Of String, String)
Dim oTag As clsTag Dim oTag As clsTag
If optGameInfo.Checked Then If chkGameInfo.Checked Then
'Set Filter Type 'Set Filter Type(s)
If optAnd.Checked Then eCurrentFilterType = eFilterType.BaseFilter
eCurrentFilterType = eFilterType.FieldAnd bAndOperator = optAnd.Checked
Else End If
eCurrentFilterType = eFilterType.FieldOr
End If
'Set String Filter If chkTag.Checked Then
If txtName.Text <> String.Empty Then
hshStringFilters.Add("Name", txtName.Text)
End If
If txtProcess.Text <> String.Empty Then
hshStringFilters.Add("Process", txtProcess.Text)
End If
If txtCompany.Text <> String.Empty Then
hshStringFilters.Add("Company", txtCompany.Text)
End If
Else
'Set Tags 'Set Tags
For Each oData In lstFilter.Items IncludeTagFilters.Clear()
For Each oData In lstIncludeTags.Items
oTag = DirectCast(hshTags(oData.Value), clsTag) 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 Next
'Set Filter Type 'Set Filter Type
If TagFilters.Count = 0 Then If IncludeTagFilters.Count = 0 And ExcludeTagFilters.Count = 0 Then
eCurrentFilterType = eFilterType.NoTags eCurrentFilterType = eFilterType.NoTags
ElseIf optAll.Checked Then ElseIf optAll.Checked Then
eCurrentFilterType = eFilterType.AllTags eCurrentFilterType = eFilterType.AllTags
@@ -145,6 +493,72 @@ Public Class frmFilter
End If End If
End If End If
'Sorting
If optSortAsc.Checked Then
bSortAsc = True
Else
bSortAsc = False
End If
sSortField = cboSortField.SelectedValue
End Sub
Private Sub LoadCombos()
Dim oFilterFields As New List(Of KeyValuePair(Of clsGameFilterField, String))
Dim oSortFields As New List(Of KeyValuePair(Of String, String))
Dim oNumericOperators As New List(Of KeyValuePair(Of clsGameFilter.eNumericOperators, String))
Dim oBoolOperators As New List(Of KeyValuePair(Of Boolean, String))
'cboBoolFilter
cboBoolFilter.ValueMember = "Key"
cboBoolFilter.DisplayMember = "Value"
oBoolOperators.Add(New KeyValuePair(Of Boolean, String)(True, frmFilter_cboBoolFilterEnabled))
oBoolOperators.Add(New KeyValuePair(Of Boolean, String)(False, frmFilter_cboBoolFilterDisabled))
cboBoolFilter.DataSource = oBoolOperators
'cboNumericOps
cboNumericOps.ValueMember = "Key"
cboNumericOps.DisplayMember = "Value"
oNumericOperators.Add(New KeyValuePair(Of clsGameFilter.eNumericOperators, String)(clsGameFilter.eNumericOperators.Equals, "="))
oNumericOperators.Add(New KeyValuePair(Of clsGameFilter.eNumericOperators, String)(clsGameFilter.eNumericOperators.Greater, ">"))
oNumericOperators.Add(New KeyValuePair(Of clsGameFilter.eNumericOperators, String)(clsGameFilter.eNumericOperators.Lesser, "<"))
oNumericOperators.Add(New KeyValuePair(Of clsGameFilter.eNumericOperators, String)(clsGameFilter.eNumericOperators.GreaterEquals, ">="))
oNumericOperators.Add(New KeyValuePair(Of clsGameFilter.eNumericOperators, String)(clsGameFilter.eNumericOperators.LesserEquals, "<="))
cboNumericOps.DataSource = oNumericOperators
'cboFilterField
cboFilterField.ValueMember = "Key"
cboFilterField.DisplayMember = "Value"
For Each oField As clsGameFilterField In oValidFields
If oField.CheckStatus(clsGameFilterField.eFieldStatus.ValidFilter) Then
oFilterFields.Add(New KeyValuePair(Of clsGameFilterField, String)(oField, oField.FriendlyFieldName))
End If
Next
cboFilterField.DataSource = oFilterFields
'cboSortField
cboSortField.ValueMember = "Key"
cboSortField.DisplayMember = "Value"
For Each oField As clsGameFilterField In oValidFields
If oField.CheckStatus(clsGameFilterField.eFieldStatus.ValidSort) Then
oSortFields.Add(New KeyValuePair(Of String, String)(oField.FieldName, oField.FriendlyFieldName))
End If
Next
cboSortField.DataSource = oSortFields
'Select Defaults
cboNumericOps.SelectedIndex = 0
cboFilterField.SelectedIndex = 0
cboSortField.SelectedIndex = 0
End Sub End Sub
Private Sub SetForm() Private Sub SetForm()
@@ -154,26 +568,48 @@ Public Class frmFilter
'Set Form Text 'Set Form Text
optOr.Text = frmFilter_optOr optOr.Text = frmFilter_optOr
optAnd.Text = frmFilter_optAnd optAnd.Text = frmFilter_optAnd
lblCompany.Text = frmFilter_lblCompany grpFilterType.Text = frmFilter_grpFilterType
lblProcess.Text = frmFilter_lblProcess
lblName.Text = frmFilter_lblName
grpGameInfoOptions.Text = frmFilter_grpGameInfoOptions
optAll.Text = frmFilter_optAll optAll.Text = frmFilter_optAll
optAny.Text = frmFilter_optAny optAny.Text = frmFilter_optAny
lblGameTags.Text = frmFilter_lblGameTags lblIncludeTags.Text = frmFilter_lblIncludeTags
lblExcludeTags.Text = frmFilter_lblExcludeTags
lblTags.Text = frmFilter_lblTags lblTags.Text = frmFilter_lblTags
btnRemove.Text = frmFilter_btnRemove btnIncludeRemove.Text = frmFilter_btnIncludeRemove
btnAdd.Text = frmFilter_btnAdd btnIncludeAdd.Text = frmFilter_btnIncludeAdd
btnExcludeRemove.Text = frmFilter_btnExcludeRemove
btnExcludeAdd.Text = frmFilter_btnExcludeAdd
btnOK.Text = frmFilter_btnOK btnOK.Text = frmFilter_btnOK
grpTagOptions.Text = frmFilter_grpTagOptions grpTagOptions.Text = frmFilter_grpTagOptions
optTag.Text = frmFilter_optTag chkTag.Text = frmFilter_chkTag
optGameInfo.Text = frmFilter_optGameInfo chkGameInfo.Text = frmFilter_chkGameInfo
grpSorting.Text = frmFilter_grpSorting
lblSortFields.Text = frmFilter_lblSortsFields
optSortAsc.Text = frmFilter_optSortAsc
optSortDesc.Text = frmFilter_optSortDesc
btnAddFilter.Text = frmFilter_btnAddFilter
btnRemoveFilter.Text = frmFilter_btnRemoveFilter
lblCurrentFilters.Text = frmFilter_lblCurrentFilters
lblFields.Text = frmFilter_lblFields
lblFilterData.Text = frmFilter_lblFilterData
grpSortOptions.Text = frmFilter_grpSortOptions
'Defaults
optOr.Checked = True
optSortAsc.Checked = True
grpGameFilter.Enabled = False
grpTagFilter.Enabled = False
'Init Game Filter
lstFilter.ValueMember = "Key"
lstFilter.DisplayMember = "Value"
End Sub End Sub
Private Sub frmGameTags_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub frmGameTags_Load(sender As Object, e As EventArgs) Handles MyBase.Load
SetForm() SetForm()
optGameInfo.Checked = True LoadFilterFields()
LoadData() LoadCombos()
LoadTagData()
LoadExistingFilters()
End Sub End Sub
Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click Private Sub btnOK_Click(sender As Object, e As EventArgs) Handles btnOK.Click
@@ -182,12 +618,20 @@ Public Class frmFilter
Me.Close() Me.Close()
End Sub End Sub
Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click Private Sub btnIncludeAdd_Click(sender As Object, e As EventArgs) Handles btnIncludeAdd.Click
AddTag() AddTag(lstIncludeTags)
End Sub End Sub
Private Sub btnRemove_Click(sender As Object, e As EventArgs) Handles btnRemove.Click Private Sub btnExcludeAdd_Click(sender As Object, e As EventArgs) Handles btnExcludeAdd.Click
RemoveTag() 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 End Sub
Private Sub frmFilter_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing Private Sub frmFilter_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
@@ -196,13 +640,37 @@ Public Class frmFilter
End If End If
End Sub End Sub
Private Sub optGameInfo_Click(sender As Object, e As EventArgs) Handles optGameInfo.Click, optTag.Click Private Sub chkGameInfo_CheckedChanged(sender As Object, e As EventArgs) Handles chkGameInfo.CheckedChanged
If optGameInfo.Checked = True Then If chkGameInfo.Checked Then
grpGameFilter.Enabled = True grpGameFilter.Enabled = True
grpTagFilter.Enabled = False
Else Else
optOr.Checked = True
grpGameFilter.Enabled = False grpGameFilter.Enabled = False
grpTagFilter.Enabled = True oGameFilters.Clear()
lstFilter.Items.Clear()
End If End If
End Sub End Sub
Private Sub chkTag_CheckedChanged(sender As Object, e As EventArgs) Handles chkTag.CheckedChanged
If chkTag.Checked Then
grpTagFilter.Enabled = True
Else
grpTagFilter.Enabled = False
oIncludeTagFilters.Clear()
LoadTagData()
End If
End Sub
Private Sub btnAddFilter_Click(sender As Object, e As EventArgs) Handles btnAddFilter.Click
AddFilter()
End Sub
Private Sub btnRemoveFilter_Click(sender As Object, e As EventArgs) Handles btnRemoveFilter.Click
RemoveFilter()
End Sub
Private Sub cboFilterField_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboFilterField.SelectedIndexChanged
ChangeFilterMode()
End Sub
End Class End Class
+96 -37
View File
@@ -1,9 +1,9 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _ <Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()>
Partial Class frmGameManager Partial Class frmGameManager
Inherits System.Windows.Forms.Form Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list. 'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _ <System.Diagnostics.DebuggerNonUserCode()>
Protected Overrides Sub Dispose(ByVal disposing As Boolean) Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try Try
If disposing AndAlso components IsNot Nothing Then If disposing AndAlso components IsNot Nothing Then
@@ -20,7 +20,7 @@ Partial Class frmGameManager
'NOTE: The following procedure is required by the Windows Form Designer 'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer. 'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor. 'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _ <System.Diagnostics.DebuggerStepThrough()>
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container() Me.components = New System.ComponentModel.Container()
Me.btnAdd = New System.Windows.Forms.Button() Me.btnAdd = New System.Windows.Forms.Button()
@@ -28,6 +28,11 @@ Partial Class frmGameManager
Me.btnBackup = New System.Windows.Forms.Button() Me.btnBackup = New System.Windows.Forms.Button()
Me.btnClose = New System.Windows.Forms.Button() Me.btnClose = New System.Windows.Forms.Button()
Me.grpConfig = New System.Windows.Forms.GroupBox() Me.grpConfig = New System.Windows.Forms.GroupBox()
Me.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()
Me.lblLimit = New System.Windows.Forms.Label() Me.lblLimit = New System.Windows.Forms.Label()
Me.nudLimit = New System.Windows.Forms.NumericUpDown() Me.nudLimit = New System.Windows.Forms.NumericUpDown()
Me.btnExclude = New System.Windows.Forms.Button() Me.btnExclude = New System.Windows.Forms.Button()
@@ -110,7 +115,7 @@ Partial Class frmGameManager
' '
Me.btnAdd.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.btnAdd.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btnAdd.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnAdd.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnAdd.Location = New System.Drawing.Point(12, 526) Me.btnAdd.Location = New System.Drawing.Point(12, 586)
Me.btnAdd.Name = "btnAdd" Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing.Size(30, 23) Me.btnAdd.Size = New System.Drawing.Size(30, 23)
Me.btnAdd.TabIndex = 4 Me.btnAdd.TabIndex = 4
@@ -121,7 +126,7 @@ Partial Class frmGameManager
' '
Me.btnDelete.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles) Me.btnDelete.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.btnDelete.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.btnDelete.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.btnDelete.Location = New System.Drawing.Point(48, 526) Me.btnDelete.Location = New System.Drawing.Point(48, 586)
Me.btnDelete.Name = "btnDelete" Me.btnDelete.Name = "btnDelete"
Me.btnDelete.Size = New System.Drawing.Size(30, 23) Me.btnDelete.Size = New System.Drawing.Size(30, 23)
Me.btnDelete.TabIndex = 5 Me.btnDelete.TabIndex = 5
@@ -131,26 +136,31 @@ Partial Class frmGameManager
'btnBackup 'btnBackup
' '
Me.btnBackup.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnBackup.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnBackup.Location = New System.Drawing.Point(616, 526) Me.btnBackup.Location = New System.Drawing.Point(616, 586)
Me.btnBackup.Name = "btnBackup" Me.btnBackup.Name = "btnBackup"
Me.btnBackup.Size = New System.Drawing.Size(75, 23) Me.btnBackup.Size = New System.Drawing.Size(75, 23)
Me.btnBackup.TabIndex = 19 Me.btnBackup.TabIndex = 18
Me.btnBackup.Text = "&Backup" Me.btnBackup.Text = "&Backup"
Me.btnBackup.UseVisualStyleBackColor = True Me.btnBackup.UseVisualStyleBackColor = True
' '
'btnClose 'btnClose
' '
Me.btnClose.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) 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.Location = New System.Drawing.Point(697, 586)
Me.btnClose.Name = "btnClose" Me.btnClose.Name = "btnClose"
Me.btnClose.Size = New System.Drawing.Size(75, 23) Me.btnClose.Size = New System.Drawing.Size(75, 23)
Me.btnClose.TabIndex = 20 Me.btnClose.TabIndex = 19
Me.btnClose.Text = "C&lose" Me.btnClose.Text = "C&lose"
Me.btnClose.UseVisualStyleBackColor = True Me.btnClose.UseVisualStyleBackColor = True
' '
'grpConfig 'grpConfig
' '
Me.grpConfig.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.grpConfig.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.grpConfig.Controls.Add(Me.lblComments)
Me.grpConfig.Controls.Add(Me.txtComments)
Me.grpConfig.Controls.Add(Me.txtParameter)
Me.grpConfig.Controls.Add(Me.lblParameter)
Me.grpConfig.Controls.Add(Me.chkCleanFolder)
Me.grpConfig.Controls.Add(Me.lblLimit) Me.grpConfig.Controls.Add(Me.lblLimit)
Me.grpConfig.Controls.Add(Me.nudLimit) Me.grpConfig.Controls.Add(Me.nudLimit)
Me.grpConfig.Controls.Add(Me.btnExclude) Me.grpConfig.Controls.Add(Me.btnExclude)
@@ -171,18 +181,62 @@ Partial Class frmGameManager
Me.grpConfig.Enabled = False Me.grpConfig.Enabled = False
Me.grpConfig.Location = New System.Drawing.Point(247, 12) Me.grpConfig.Location = New System.Drawing.Point(247, 12)
Me.grpConfig.Name = "grpConfig" Me.grpConfig.Name = "grpConfig"
Me.grpConfig.Size = New System.Drawing.Size(525, 157) Me.grpConfig.Size = New System.Drawing.Size(525, 215)
Me.grpConfig.TabIndex = 8 Me.grpConfig.TabIndex = 8
Me.grpConfig.TabStop = False Me.grpConfig.TabStop = False
Me.grpConfig.Text = "Configuration" 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)
Me.txtParameter.Name = "txtParameter"
Me.txtParameter.Size = New System.Drawing.Size(150, 20)
Me.txtParameter.TabIndex = 7
'
'lblParameter
'
Me.lblParameter.AutoSize = True
Me.lblParameter.Location = New System.Drawing.Point(269, 48)
Me.lblParameter.Name = "lblParameter"
Me.lblParameter.Size = New System.Drawing.Size(58, 13)
Me.lblParameter.TabIndex = 6
Me.lblParameter.Text = "Parameter:"
'
'chkCleanFolder
'
Me.chkCleanFolder.AutoSize = True
Me.chkCleanFolder.Location = New System.Drawing.Point(329, 101)
Me.chkCleanFolder.Name = "chkCleanFolder"
Me.chkCleanFolder.Size = New System.Drawing.Size(136, 17)
Me.chkCleanFolder.TabIndex = 13
Me.chkCleanFolder.Text = "Delete folder on restore"
Me.chkCleanFolder.UseVisualStyleBackColor = True
'
'lblLimit 'lblLimit
' '
Me.lblLimit.AutoSize = True Me.lblLimit.AutoSize = True
Me.lblLimit.Location = New System.Drawing.Point(375, 130) Me.lblLimit.Location = New System.Drawing.Point(375, 130)
Me.lblLimit.Name = "lblLimit" Me.lblLimit.Name = "lblLimit"
Me.lblLimit.Size = New System.Drawing.Size(68, 13) Me.lblLimit.Size = New System.Drawing.Size(68, 13)
Me.lblLimit.TabIndex = 13 Me.lblLimit.TabIndex = 16
Me.lblLimit.Text = "Backup Limit" Me.lblLimit.Text = "Backup Limit"
Me.lblLimit.Visible = False Me.lblLimit.Visible = False
' '
@@ -192,7 +246,7 @@ Partial Class frmGameManager
Me.nudLimit.Minimum = New Decimal(New Integer() {2, 0, 0, 0}) Me.nudLimit.Minimum = New Decimal(New Integer() {2, 0, 0, 0})
Me.nudLimit.Name = "nudLimit" Me.nudLimit.Name = "nudLimit"
Me.nudLimit.Size = New System.Drawing.Size(40, 20) Me.nudLimit.Size = New System.Drawing.Size(40, 20)
Me.nudLimit.TabIndex = 12 Me.nudLimit.TabIndex = 15
Me.nudLimit.Value = New Decimal(New Integer() {2, 0, 0, 0}) Me.nudLimit.Value = New Decimal(New Integer() {2, 0, 0, 0})
Me.nudLimit.Visible = False Me.nudLimit.Visible = False
' '
@@ -201,7 +255,7 @@ Partial Class frmGameManager
Me.btnExclude.Location = New System.Drawing.Point(9, 125) Me.btnExclude.Location = New System.Drawing.Point(9, 125)
Me.btnExclude.Name = "btnExclude" Me.btnExclude.Name = "btnExclude"
Me.btnExclude.Size = New System.Drawing.Size(175, 23) Me.btnExclude.Size = New System.Drawing.Size(175, 23)
Me.btnExclude.TabIndex = 9 Me.btnExclude.TabIndex = 11
Me.btnExclude.Text = "E&xclude Items..." Me.btnExclude.Text = "E&xclude Items..."
Me.btnExclude.UseVisualStyleBackColor = True Me.btnExclude.UseVisualStyleBackColor = True
' '
@@ -210,7 +264,7 @@ Partial Class frmGameManager
Me.btnInclude.Location = New System.Drawing.Point(9, 97) Me.btnInclude.Location = New System.Drawing.Point(9, 97)
Me.btnInclude.Name = "btnInclude" Me.btnInclude.Name = "btnInclude"
Me.btnInclude.Size = New System.Drawing.Size(175, 23) Me.btnInclude.Size = New System.Drawing.Size(175, 23)
Me.btnInclude.TabIndex = 8 Me.btnInclude.TabIndex = 10
Me.btnInclude.Text = "In&clude Items..." Me.btnInclude.Text = "In&clude Items..."
Me.btnInclude.UseVisualStyleBackColor = True Me.btnInclude.UseVisualStyleBackColor = True
' '
@@ -229,13 +283,13 @@ Partial Class frmGameManager
Me.btnSavePathBrowse.Location = New System.Drawing.Point(489, 71) Me.btnSavePathBrowse.Location = New System.Drawing.Point(489, 71)
Me.btnSavePathBrowse.Name = "btnSavePathBrowse" Me.btnSavePathBrowse.Name = "btnSavePathBrowse"
Me.btnSavePathBrowse.Size = New System.Drawing.Size(30, 20) Me.btnSavePathBrowse.Size = New System.Drawing.Size(30, 20)
Me.btnSavePathBrowse.TabIndex = 7 Me.btnSavePathBrowse.TabIndex = 9
Me.btnSavePathBrowse.Text = "..." Me.btnSavePathBrowse.Text = "..."
Me.btnSavePathBrowse.UseVisualStyleBackColor = True Me.btnSavePathBrowse.UseVisualStyleBackColor = True
' '
'btnProcessBrowse 'btnProcessBrowse
' '
Me.btnProcessBrowse.Location = New System.Drawing.Point(489, 45) Me.btnProcessBrowse.Location = New System.Drawing.Point(225, 44)
Me.btnProcessBrowse.Name = "btnProcessBrowse" Me.btnProcessBrowse.Name = "btnProcessBrowse"
Me.btnProcessBrowse.Size = New System.Drawing.Size(30, 20) Me.btnProcessBrowse.Size = New System.Drawing.Size(30, 20)
Me.btnProcessBrowse.TabIndex = 5 Me.btnProcessBrowse.TabIndex = 5
@@ -293,7 +347,7 @@ Partial Class frmGameManager
Me.chkTimeStamp.Location = New System.Drawing.Point(190, 129) Me.chkTimeStamp.Location = New System.Drawing.Point(190, 129)
Me.chkTimeStamp.Name = "chkTimeStamp" Me.chkTimeStamp.Name = "chkTimeStamp"
Me.chkTimeStamp.Size = New System.Drawing.Size(133, 17) Me.chkTimeStamp.Size = New System.Drawing.Size(133, 17)
Me.chkTimeStamp.TabIndex = 11 Me.chkTimeStamp.TabIndex = 14
Me.chkTimeStamp.Text = "Save multiple backups" Me.chkTimeStamp.Text = "Save multiple backups"
Me.chkTimeStamp.UseVisualStyleBackColor = True Me.chkTimeStamp.UseVisualStyleBackColor = True
' '
@@ -303,7 +357,7 @@ Partial Class frmGameManager
Me.chkFolderSave.Location = New System.Drawing.Point(190, 101) Me.chkFolderSave.Location = New System.Drawing.Point(190, 101)
Me.chkFolderSave.Name = "chkFolderSave" Me.chkFolderSave.Name = "chkFolderSave"
Me.chkFolderSave.Size = New System.Drawing.Size(109, 17) Me.chkFolderSave.Size = New System.Drawing.Size(109, 17)
Me.chkFolderSave.TabIndex = 10 Me.chkFolderSave.TabIndex = 12
Me.chkFolderSave.Text = "Save entire folder" Me.chkFolderSave.Text = "Save entire folder"
Me.chkFolderSave.UseVisualStyleBackColor = True Me.chkFolderSave.UseVisualStyleBackColor = True
' '
@@ -312,13 +366,13 @@ Partial Class frmGameManager
Me.txtSavePath.Location = New System.Drawing.Point(69, 71) Me.txtSavePath.Location = New System.Drawing.Point(69, 71)
Me.txtSavePath.Name = "txtSavePath" Me.txtSavePath.Name = "txtSavePath"
Me.txtSavePath.Size = New System.Drawing.Size(414, 20) Me.txtSavePath.Size = New System.Drawing.Size(414, 20)
Me.txtSavePath.TabIndex = 6 Me.txtSavePath.TabIndex = 8
' '
'txtProcess 'txtProcess
' '
Me.txtProcess.Location = New System.Drawing.Point(69, 45) Me.txtProcess.Location = New System.Drawing.Point(69, 45)
Me.txtProcess.Name = "txtProcess" Me.txtProcess.Name = "txtProcess"
Me.txtProcess.Size = New System.Drawing.Size(414, 20) Me.txtProcess.Size = New System.Drawing.Size(150, 20)
Me.txtProcess.TabIndex = 4 Me.txtProcess.TabIndex = 4
' '
'txtName 'txtName
@@ -331,7 +385,7 @@ Partial Class frmGameManager
'chkMonitorOnly 'chkMonitorOnly
' '
Me.chkMonitorOnly.AutoSize = True Me.chkMonitorOnly.AutoSize = True
Me.chkMonitorOnly.Location = New System.Drawing.Point(362, 340) Me.chkMonitorOnly.Location = New System.Drawing.Point(363, 398)
Me.chkMonitorOnly.Name = "chkMonitorOnly" Me.chkMonitorOnly.Name = "chkMonitorOnly"
Me.chkMonitorOnly.Size = New System.Drawing.Size(83, 17) Me.chkMonitorOnly.Size = New System.Drawing.Size(83, 17)
Me.chkMonitorOnly.TabIndex = 11 Me.chkMonitorOnly.TabIndex = 11
@@ -355,7 +409,7 @@ Partial Class frmGameManager
Me.grpExtra.Controls.Add(Me.txtAppPath) Me.grpExtra.Controls.Add(Me.txtAppPath)
Me.grpExtra.Controls.Add(Me.nudHours) Me.grpExtra.Controls.Add(Me.nudHours)
Me.grpExtra.Controls.Add(Me.lblHours) Me.grpExtra.Controls.Add(Me.lblHours)
Me.grpExtra.Location = New System.Drawing.Point(247, 175) Me.grpExtra.Location = New System.Drawing.Point(248, 233)
Me.grpExtra.Name = "grpExtra" Me.grpExtra.Name = "grpExtra"
Me.grpExtra.Size = New System.Drawing.Size(525, 155) Me.grpExtra.Size = New System.Drawing.Size(525, 155)
Me.grpExtra.TabIndex = 9 Me.grpExtra.TabIndex = 9
@@ -486,7 +540,7 @@ Partial Class frmGameManager
' '
'btnTags 'btnTags
' '
Me.btnTags.Location = New System.Drawing.Point(535, 336) Me.btnTags.Location = New System.Drawing.Point(535, 394)
Me.btnTags.Name = "btnTags" Me.btnTags.Name = "btnTags"
Me.btnTags.Size = New System.Drawing.Size(75, 23) Me.btnTags.Size = New System.Drawing.Size(75, 23)
Me.btnTags.TabIndex = 12 Me.btnTags.TabIndex = 12
@@ -507,7 +561,7 @@ Partial Class frmGameManager
Me.grpStats.Controls.Add(Me.lblBackupFile) Me.grpStats.Controls.Add(Me.lblBackupFile)
Me.grpStats.Controls.Add(Me.lblRemote) Me.grpStats.Controls.Add(Me.lblRemote)
Me.grpStats.Controls.Add(Me.lblLocalData) Me.grpStats.Controls.Add(Me.lblLocalData)
Me.grpStats.Location = New System.Drawing.Point(247, 365) Me.grpStats.Location = New System.Drawing.Point(247, 423)
Me.grpStats.Name = "grpStats" Me.grpStats.Name = "grpStats"
Me.grpStats.Size = New System.Drawing.Size(525, 154) Me.grpStats.Size = New System.Drawing.Size(525, 154)
Me.grpStats.TabIndex = 15 Me.grpStats.TabIndex = 15
@@ -622,27 +676,27 @@ Partial Class frmGameManager
'btnMarkAsRestored 'btnMarkAsRestored
' '
Me.btnMarkAsRestored.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnMarkAsRestored.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnMarkAsRestored.Location = New System.Drawing.Point(429, 526) Me.btnMarkAsRestored.Location = New System.Drawing.Point(429, 586)
Me.btnMarkAsRestored.Name = "btnMarkAsRestored" Me.btnMarkAsRestored.Name = "btnMarkAsRestored"
Me.btnMarkAsRestored.Size = New System.Drawing.Size(100, 23) 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.Text = "&Mark as Restored"
Me.btnMarkAsRestored.UseVisualStyleBackColor = True Me.btnMarkAsRestored.UseVisualStyleBackColor = True
' '
'btnRestore 'btnRestore
' '
Me.btnRestore.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnRestore.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnRestore.Location = New System.Drawing.Point(535, 526) Me.btnRestore.Location = New System.Drawing.Point(535, 586)
Me.btnRestore.Name = "btnRestore" Me.btnRestore.Name = "btnRestore"
Me.btnRestore.Size = New System.Drawing.Size(75, 23) Me.btnRestore.Size = New System.Drawing.Size(75, 23)
Me.btnRestore.TabIndex = 18 Me.btnRestore.TabIndex = 17
Me.btnRestore.Text = "&Restore" Me.btnRestore.Text = "&Restore"
Me.btnRestore.UseVisualStyleBackColor = True Me.btnRestore.UseVisualStyleBackColor = True
' '
'btnSave 'btnSave
' '
Me.btnSave.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnSave.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnSave.Location = New System.Drawing.Point(616, 336) Me.btnSave.Location = New System.Drawing.Point(616, 394)
Me.btnSave.Name = "btnSave" Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing.Size(75, 23) Me.btnSave.Size = New System.Drawing.Size(75, 23)
Me.btnSave.TabIndex = 13 Me.btnSave.TabIndex = 13
@@ -655,13 +709,13 @@ Partial Class frmGameManager
Me.lstGames.Location = New System.Drawing.Point(12, 160) Me.lstGames.Location = New System.Drawing.Point(12, 160)
Me.lstGames.Name = "lstGames" Me.lstGames.Name = "lstGames"
Me.lstGames.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended Me.lstGames.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended
Me.lstGames.Size = New System.Drawing.Size(228, 355) Me.lstGames.Size = New System.Drawing.Size(228, 420)
Me.lstGames.TabIndex = 3 Me.lstGames.TabIndex = 3
' '
'btnCancel 'btnCancel
' '
Me.btnCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) 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, 336) Me.btnCancel.Location = New System.Drawing.Point(697, 394)
Me.btnCancel.Name = "btnCancel" Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(75, 23) Me.btnCancel.Size = New System.Drawing.Size(75, 23)
Me.btnCancel.TabIndex = 14 Me.btnCancel.TabIndex = 14
@@ -671,7 +725,7 @@ Partial Class frmGameManager
'chkEnabled 'chkEnabled
' '
Me.chkEnabled.AutoSize = True Me.chkEnabled.AutoSize = True
Me.chkEnabled.Location = New System.Drawing.Point(247, 340) Me.chkEnabled.Location = New System.Drawing.Point(248, 398)
Me.chkEnabled.Name = "chkEnabled" Me.chkEnabled.Name = "chkEnabled"
Me.chkEnabled.Size = New System.Drawing.Size(109, 17) Me.chkEnabled.Size = New System.Drawing.Size(109, 17)
Me.chkEnabled.TabIndex = 10 Me.chkEnabled.TabIndex = 10
@@ -718,10 +772,10 @@ Partial Class frmGameManager
Me.optPendingRestores.AutoSize = True Me.optPendingRestores.AutoSize = True
Me.optPendingRestores.Location = New System.Drawing.Point(6, 64) Me.optPendingRestores.Location = New System.Drawing.Point(6, 64)
Me.optPendingRestores.Name = "optPendingRestores" Me.optPendingRestores.Name = "optPendingRestores"
Me.optPendingRestores.Size = New System.Drawing.Size(122, 17) Me.optPendingRestores.Size = New System.Drawing.Size(134, 17)
Me.optPendingRestores.TabIndex = 2 Me.optPendingRestores.TabIndex = 2
Me.optPendingRestores.TabStop = True Me.optPendingRestores.TabStop = True
Me.optPendingRestores.Text = "New Saves Pending" Me.optPendingRestores.Text = "New Backups Pending"
Me.optPendingRestores.UseVisualStyleBackColor = True Me.optPendingRestores.UseVisualStyleBackColor = True
' '
'optAllGames 'optAllGames
@@ -737,7 +791,7 @@ Partial Class frmGameManager
' '
'btnImport 'btnImport
' '
Me.btnImport.Location = New System.Drawing.Point(84, 526) Me.btnImport.Location = New System.Drawing.Point(84, 586)
Me.btnImport.Name = "btnImport" Me.btnImport.Name = "btnImport"
Me.btnImport.Size = New System.Drawing.Size(75, 23) Me.btnImport.Size = New System.Drawing.Size(75, 23)
Me.btnImport.TabIndex = 6 Me.btnImport.TabIndex = 6
@@ -746,7 +800,7 @@ Partial Class frmGameManager
' '
'btnExport 'btnExport
' '
Me.btnExport.Location = New System.Drawing.Point(165, 526) Me.btnExport.Location = New System.Drawing.Point(165, 586)
Me.btnExport.Name = "btnExport" Me.btnExport.Name = "btnExport"
Me.btnExport.Size = New System.Drawing.Size(75, 23) Me.btnExport.Size = New System.Drawing.Size(75, 23)
Me.btnExport.TabIndex = 7 Me.btnExport.TabIndex = 7
@@ -811,7 +865,7 @@ Partial Class frmGameManager
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(784, 561) Me.ClientSize = New System.Drawing.Size(784, 621)
Me.Controls.Add(Me.lblQuickFilter) Me.Controls.Add(Me.lblQuickFilter)
Me.Controls.Add(Me.txtQuickFilter) Me.Controls.Add(Me.txtQuickFilter)
Me.Controls.Add(Me.btnExport) Me.Controls.Add(Me.btnExport)
@@ -928,4 +982,9 @@ Partial Class frmGameManager
Friend WithEvents cmsDeleteBackup As ContextMenuStrip Friend WithEvents cmsDeleteBackup As ContextMenuStrip
Friend WithEvents cmsDeleteOne As ToolStripMenuItem Friend WithEvents cmsDeleteOne As ToolStripMenuItem
Friend WithEvents cmsDeleteAll As ToolStripMenuItem Friend WithEvents cmsDeleteAll As ToolStripMenuItem
Friend WithEvents chkCleanFolder As CheckBox
Friend WithEvents txtParameter As TextBox
Friend WithEvents lblParameter As Label
Friend WithEvents lblComments As Label
Friend WithEvents txtComments As TextBox
End Class End Class
+217 -78
View File
@@ -1,4 +1,5 @@
Imports GBM.My.Resources Imports GBM.My.Resources
Imports System.Collections.Specialized
Imports System.IO Imports System.IO
Public Class frmGameManager Public Class frmGameManager
@@ -7,19 +8,24 @@ Public Class frmGameManager
Private bPendingRestores As Boolean = False Private bPendingRestores As Boolean = False
Private oCurrentBackupItem As clsBackup Private oCurrentBackupItem As clsBackup
Private oCurrentGame As clsGame Private oCurrentGame As clsGame
Private oTagsToSave As New List(Of KeyValuePair(Of String, String))
Private bDisableExternalFunctions As Boolean = False Private bDisableExternalFunctions As Boolean = False
Private bTriggerBackup As Boolean = False Private bTriggerBackup As Boolean = False
Private bTriggerRestore As Boolean = False Private bTriggerRestore As Boolean = False
Private oBackupList As New List(Of clsGame) Private oBackupList As New List(Of clsGame)
Private oRestoreList As New Hashtable Private oRestoreList As New Hashtable
Private oAppData As Hashtable Private oGameData As OrderedDictionary
Private oLocalBackupData As SortedList Private oLocalBackupData As SortedList
Private oRemoteBackupData As SortedList Private oRemoteBackupData As SortedList
Private bIsDirty As Boolean = False Private bIsDirty As Boolean = False
Private bIsLoading As Boolean = False Private bIsLoading As Boolean = False
Private oCurrentTagFilters As New List(Of clsTag) Private oCurrentIncludeTagFilters As New List(Of clsTag)
Private oCurrentStringFilters As New Hashtable Private oCurrentExcludeTagFilters As New List(Of clsTag)
Private eCurrentFilter As frmFilter.eFilterType = frmFilter.eFilterType.NoFilter Private oCurrentFilters As New List(Of clsGameFilter)
Private eCurrentFilter As frmFilter.eFilterType = frmFilter.eFilterType.BaseFilter
Private bCurrentAndOperator As Boolean = False
Private bCurrentSortAsc As Boolean = True
Private sCurrentSortField As String = "Name"
Private WithEvents tmFilterTimer As Timer Private WithEvents tmFilterTimer As Timer
Private Enum eModes As Integer Private Enum eModes As Integer
@@ -69,12 +75,12 @@ Public Class frmGameManager
End Set End Set
End Property End Property
Private Property AppData As Hashtable Private Property GameData As OrderedDictionary
Get Get
Return oAppData Return oGameData
End Get End Get
Set(value As Hashtable) Set(value As OrderedDictionary)
oAppData = value oGameData = value
End Set End Set
End Property End Property
@@ -221,41 +227,58 @@ Public Class frmGameManager
If optCustom.Checked Then If optCustom.Checked Then
If Not bRetainFilter Then If Not bRetainFilter Then
frm = New frmFilter frm = New frmFilter
frm.IncludeTagFilters = oCurrentIncludeTagFilters
frm.ExcludeTagFilters = oCurrentExcludeTagFilters
frm.GameFilters = oCurrentFilters
frm.FilterType = eCurrentFilter
frm.AndOperator = bCurrentAndOperator
frm.SortAsc = bCurrentSortAsc
frm.SortField = sCurrentSortField
frm.ShowDialog() frm.ShowDialog()
oCurrentTagFilters = frm.TagFilters
oCurrentStringFilters = frm.StringFilters oCurrentIncludeTagFilters = frm.IncludeTagFilters
oCurrentExcludeTagFilters = frm.ExcludeTagFilters
oCurrentFilters = frm.GameFilters
eCurrentFilter = frm.FilterType eCurrentFilter = frm.FilterType
bCurrentAndOperator = frm.AndOperator
bCurrentSortAsc = frm.SortAsc
sCurrentSortField = frm.SortField
End If End If
Else Else
oCurrentTagFilters.Clear() oCurrentIncludeTagFilters.Clear()
oCurrentStringFilters.Clear() oCurrentExcludeTagFilters.Clear()
eCurrentFilter = frmFilter.eFilterType.NoFilter oCurrentFilters.Clear()
eCurrentFilter = frmFilter.eFilterType.BaseFilter
bCurrentSortAsc = True
sCurrentSortField = "Name"
End If End If
AppData = mgrMonitorList.ReadFilteredList(oCurrentTagFilters, oCurrentStringFilters, eCurrentFilter) GameData = mgrMonitorList.ReadFilteredList(oCurrentIncludeTagFilters, oCurrentExcludeTagFilters, oCurrentFilters, eCurrentFilter, bCurrentAndOperator, bCurrentSortAsc, sCurrentSortField)
If optPendingRestores.Checked Then If optPendingRestores.Checked Then
oRestoreData = mgrRestore.CompareManifests oRestoreData = mgrRestore.CompareManifests
'Only show games with data to restore 'Only show games with data to restore
Dim oTemporaryList As Hashtable = AppData.Clone Dim oTemporaryList As OrderedDictionary = mgrCommon.GenericClone(GameData)
For Each de As DictionaryEntry In oTemporaryList For Each de As DictionaryEntry In oTemporaryList
oGame = DirectCast(de.Value, clsGame) oGame = DirectCast(de.Value, clsGame)
If Not oRestoreData.ContainsKey(oGame.Name) Then If Not oRestoreData.ContainsKey(oGame.Name) Then
AppData.Remove(de.Key) GameData.Remove(de.Key)
Else Else
oRestoreData.Remove(oGame.Name) oRestoreData.Remove(oGame.Name)
End If End If
Next Next
ElseIf optBackupData.Checked Then ElseIf optBackupData.Checked Then
'Only show games with backup data 'Only show games with backup data
Dim oTemporaryList As Hashtable = AppData.Clone Dim oTemporaryList As OrderedDictionary = mgrCommon.GenericClone(GameData)
oRestoreData = oRemoteBackupData.Clone oRestoreData = oRemoteBackupData.Clone
For Each de As DictionaryEntry In oTemporaryList For Each de As DictionaryEntry In oTemporaryList
oGame = DirectCast(de.Value, clsGame) oGame = DirectCast(de.Value, clsGame)
If Not oRemoteBackupData.ContainsKey(oGame.Name) Then If Not oRemoteBackupData.ContainsKey(oGame.Name) Then
AppData.Remove(de.Key) GameData.Remove(de.Key)
Else Else
oRestoreData.Remove(oGame.Name) oRestoreData.Remove(oGame.Name)
End If End If
@@ -268,7 +291,7 @@ Public Class frmGameManager
oGame = New clsGame oGame = New clsGame
oGame.Name = oBackup.Name oGame.Name = oBackup.Name
oGame.Temporary = True oGame.Temporary = True
AppData.Add(oGame.ID, oGame) GameData.Add(oGame.ID, oGame)
Next Next
End If End If
@@ -287,8 +310,8 @@ Public Class frmGameManager
End If End If
End If End If
sNewPath = mgrCommon.OpenFileBrowser(frmGameManager_ChooseExe, "exe", sNewPath = mgrCommon.OpenFileBrowser("GM_Process", frmGameManager_ChooseExe, "exe",
frmGameManager_Executable, sDefaultFolder, False) frmGameManager_Executable, sDefaultFolder, False, False)
If sNewPath <> String.Empty Then If sNewPath <> String.Empty Then
txtAppPath.Text = Path.GetDirectoryName(sNewPath) txtAppPath.Text = Path.GetDirectoryName(sNewPath)
@@ -308,7 +331,7 @@ Public Class frmGameManager
End If End If
End If End If
sNewPath = mgrCommon.OpenFolderBrowser(frmGameManager_ChooseExePath, sDefaultFolder, False) sNewPath = mgrCommon.OpenFolderBrowser("GM_Process_Path", frmGameManager_ChooseExePath, sDefaultFolder, False, False)
If sNewPath <> String.Empty Then txtAppPath.Text = sNewPath If sNewPath <> String.Empty Then txtAppPath.Text = sNewPath
End Sub End Sub
@@ -324,7 +347,7 @@ Public Class frmGameManager
End If End If
End If End If
sNewPath = mgrCommon.OpenFolderBrowser(frmGameManager_ChooseSaveFolder, sDefaultFolder, False) sNewPath = mgrCommon.OpenFolderBrowser("GM_Save_Path", frmGameManager_ChooseSaveFolder, sDefaultFolder, False, False)
If sNewPath <> String.Empty Then If sNewPath <> String.Empty Then
txtSavePath.Text = sNewPath txtSavePath.Text = sNewPath
@@ -345,11 +368,11 @@ Public Class frmGameManager
'Unix Handler 'Unix Handler
If Not mgrCommon.IsUnix Then If Not mgrCommon.IsUnix Then
sNewPath = mgrCommon.OpenFileBrowser(frmGameManager_ChooseCustomIcon, "ico", sNewPath = mgrCommon.OpenFileBrowser("GM_Icon", frmGameManager_ChooseCustomIcon, "ico",
frmGameManager_Icon, sDefaultFolder, False) frmGameManager_Icon, sDefaultFolder, False, False)
Else Else
sNewPath = mgrCommon.OpenFileBrowser(frmGameManager_ChooseCustomIcon, "png", sNewPath = mgrCommon.OpenFileBrowser("GM_Icon", frmGameManager_ChooseCustomIcon, "png",
"PNG", sDefaultFolder, False) "PNG", sDefaultFolder, False, False)
End If End If
If sNewPath <> String.Empty Then If sNewPath <> String.Empty Then
@@ -386,7 +409,7 @@ Public Class frmGameManager
Dim oList As New List(Of KeyValuePair(Of String, String)) Dim oList As New List(Of KeyValuePair(Of String, String))
Dim sFilter As String = txtQuickFilter.Text Dim sFilter As String = txtQuickFilter.Text
For Each de As DictionaryEntry In AppData For Each de As DictionaryEntry In GameData
oApp = DirectCast(de.Value, clsGame) oApp = DirectCast(de.Value, clsGame)
oData = New KeyValuePair(Of String, String)(oApp.ID, oApp.Name) oData = New KeyValuePair(Of String, String)(oApp.ID, oApp.Name)
'Apply the quick filter if applicable 'Apply the quick filter if applicable
@@ -399,12 +422,20 @@ Public Class frmGameManager
End If End If
Next Next
oList.Sort(AddressOf mgrCommon.CompareByListBoxItemByValue)
lstGames.BeginUpdate() lstGames.BeginUpdate()
lstGames.DataSource = oList
lstGames.ValueMember = "Key" lstGames.ValueMember = "Key"
lstGames.DisplayMember = "Value" lstGames.DisplayMember = "Value"
'Due to a control bug with Mono we need to fill the list box differently on Linux
If mgrCommon.IsUnix Then
lstGames.Items.Clear()
For Each kp As KeyValuePair(Of String, String) In oList
lstGames.Items.Add(kp)
Next
Else
lstGames.DataSource = oList
End If
lstGames.EndUpdate() lstGames.EndUpdate()
lstGames.ClearSelected() lstGames.ClearSelected()
IsLoading = False IsLoading = False
@@ -470,6 +501,7 @@ Public Class frmGameManager
frm.ShowDialog() frm.ShowDialog()
txtBox.Text = frm.BuilderString txtBox.Text = frm.BuilderString
VerifyCleanFolder()
End Sub End Sub
Private Function FindRestorePath() As Boolean Private Function FindRestorePath() As Boolean
@@ -525,26 +557,41 @@ Public Class frmGameManager
Dim oApp As clsGame Dim oApp As clsGame
Dim sMonitorIDs As New List(Of String) Dim sMonitorIDs As New List(Of String)
For Each oData In lstGames.SelectedItems If eCurrentMode = eModes.Add Then
oApp = DirectCast(AppData(oData.Key), clsGame) 'Use a dummy ID
sMonitorIDs.Add(oApp.ID) sMonitorIDs.Add(Guid.NewGuid.ToString)
Next frm.GameName = txtName.Text
frm.NewMode = True
frm.IDList = sMonitorIDs frm.TagList = oTagsToSave
frm.GameName = CurrentGame.Name Else
frm.ShowDialog() For Each oData In lstGames.SelectedItems
oApp = DirectCast(GameData(oData.Key), clsGame)
'Only update visible tags if one item is selected sMonitorIDs.Add(oApp.ID)
If lstGames.SelectedItems.Count = 1 Then FillTags(CurrentGame.ID) Next
frm.GameName = CurrentGame.Name
'If a tag filter is enabled, reload list to reflect changes frm.NewMode = False
If optCustom.Checked Then End If
LoadData()
frm.IDList = sMonitorIDs
frm.ShowDialog()
If eCurrentMode = eModes.Add Then
oTagsToSave = frm.TagList
FillTagsbyList(frm.TagList)
Else
'Only update visible tags if one item is selected
If lstGames.SelectedItems.Count = 1 Then FillTagsbyID(CurrentGame.ID)
'If a tag filter is enabled, reload list to reflect changes
If optCustom.Checked Then
LoadData()
End If
'If the selected game(s) no longer match the filter, disable the form
If lstGames.SelectedIndex = -1 Then eCurrentMode = eModes.Disabled
ModeChange()
End If End If
'If the selected game(s) no longer match the filter, disable the form
If lstGames.SelectedIndex = -1 Then eCurrentMode = eModes.Disabled
ModeChange()
End Sub End Sub
Private Sub UpdateBackupInfo(ByVal sManifestID As String) Private Sub UpdateBackupInfo(ByVal sManifestID As String)
@@ -556,7 +603,7 @@ Public Class frmGameManager
sFileName = BackupFolder & CurrentBackupItem.FileName sFileName = BackupFolder & CurrentBackupItem.FileName
If File.Exists(sFileName) Then If File.Exists(sFileName) Then
lblBackupFileData.Text = Path.GetFileName(CurrentBackupItem.FileName) & " (" & mgrCommon.GetFileSize(sFileName) & ")" lblBackupFileData.Text = Path.GetFileName(CurrentBackupItem.FileName) & " (" & mgrCommon.FormatDiskSpace(mgrCommon.GetFileSize(sFileName)) & ")"
Else Else
lblBackupFileData.Text = frmGameManager_ErrorNoBackupExists lblBackupFileData.Text = frmGameManager_ErrorNoBackupExists
End If End If
@@ -598,7 +645,7 @@ Public Class frmGameManager
btnDeleteBackup.Enabled = True btnDeleteBackup.Enabled = True
If File.Exists(sFileName) Then If File.Exists(sFileName) Then
lblBackupFileData.Text = Path.GetFileName(CurrentBackupItem.FileName) & " (" & mgrCommon.GetFileSize(sFileName) & ")" lblBackupFileData.Text = Path.GetFileName(CurrentBackupItem.FileName) & " (" & mgrCommon.FormatDiskSpace(mgrCommon.GetFileSize(sFileName)) & ")"
Else Else
lblBackupFileData.Text = frmGameManager_ErrorNoBackupExists lblBackupFileData.Text = frmGameManager_ErrorNoBackupExists
End If End If
@@ -704,18 +751,21 @@ Public Class frmGameManager
IsLoading = True IsLoading = True
Dim oData As KeyValuePair(Of String, String) = lstGames.SelectedItems(0) Dim oData As KeyValuePair(Of String, String) = lstGames.SelectedItems(0)
Dim oApp As clsGame = DirectCast(AppData(oData.Key), clsGame) Dim oApp As clsGame = DirectCast(GameData(oData.Key), clsGame)
'Core 'Core
txtID.Text = oApp.ID txtID.Text = oApp.ID
txtName.Text = oApp.Name txtName.Text = oApp.Name
txtProcess.Text = oApp.TrueProcess txtProcess.Text = oApp.TrueProcess
txtParameter.Text = oApp.Parameter
txtSavePath.Text = oApp.Path txtSavePath.Text = oApp.Path
txtFileType.Text = oApp.FileType txtFileType.Text = oApp.FileType
txtExclude.Text = oApp.ExcludeList txtExclude.Text = oApp.ExcludeList
chkFolderSave.Checked = oApp.FolderSave chkFolderSave.Checked = oApp.FolderSave
chkCleanFolder.Checked = oApp.CleanFolder
chkTimeStamp.Checked = oApp.AppendTimeStamp chkTimeStamp.Checked = oApp.AppendTimeStamp
nudLimit.Value = oApp.BackupLimit nudLimit.Value = oApp.BackupLimit
txtComments.Text = oApp.Comments
chkEnabled.Checked = oApp.Enabled chkEnabled.Checked = oApp.Enabled
chkMonitorOnly.Checked = oApp.MonitorOnly chkMonitorOnly.Checked = oApp.MonitorOnly
@@ -729,7 +779,7 @@ Public Class frmGameManager
txtVersion.Text = oApp.Version txtVersion.Text = oApp.Version
txtIcon.Text = oApp.Icon txtIcon.Text = oApp.Icon
FillTags(oData.Key) FillTagsbyID(oData.Key)
'Icon 'Icon
If IO.File.Exists(oApp.Icon) Then If IO.File.Exists(oApp.Icon) Then
@@ -754,7 +804,7 @@ Public Class frmGameManager
IsLoading = False IsLoading = False
End Sub End Sub
Private Sub FillTags(ByVal sID As String) Private Sub FillTagsbyID(ByVal sID As String)
Dim hshTags As Hashtable Dim hshTags As Hashtable
Dim oTag As clsTag Dim oTag As clsTag
Dim sTags As String = String.Empty Dim sTags As String = String.Empty
@@ -770,6 +820,17 @@ Public Class frmGameManager
lblTags.Text = sTags.TrimEnd(cTrim) lblTags.Text = sTags.TrimEnd(cTrim)
End Sub End Sub
Private Sub FillTagsbyList(ByVal oList As List(Of KeyValuePair(Of String, String)))
Dim sTags As String = String.Empty
Dim cTrim() As Char = {",", " "}
For Each kp As KeyValuePair(Of String, String) In oList
sTags &= "#" & kp.Value & ", "
Next
lblTags.Text = sTags.TrimEnd(cTrim)
End Sub
Private Sub DirtyCheck_ValueChanged(sender As Object, e As EventArgs) Private Sub DirtyCheck_ValueChanged(sender As Object, e As EventArgs)
If Not IsLoading And Not eCurrentMode = eModes.MultiSelect Then If Not IsLoading And Not eCurrentMode = eModes.MultiSelect Then
IsDirty = True IsDirty = True
@@ -815,6 +876,7 @@ Public Class frmGameManager
Select Case eCurrentMode Select Case eCurrentMode
Case eModes.Add Case eModes.Add
oTagsToSave.Clear()
grpFilter.Enabled = False grpFilter.Enabled = False
lstGames.Enabled = False lstGames.Enabled = False
lblQuickFilter.Enabled = False lblQuickFilter.Enabled = False
@@ -826,6 +888,7 @@ Public Class frmGameManager
WipeControls(grpConfig.Controls) WipeControls(grpConfig.Controls)
WipeControls(grpExtra.Controls) WipeControls(grpExtra.Controls)
WipeControls(grpStats.Controls) WipeControls(grpStats.Controls)
chkCleanFolder.Enabled = False
pbIcon.Image = Icon_Unknown pbIcon.Image = Icon_Unknown
chkEnabled.Enabled = True chkEnabled.Enabled = True
chkMonitorOnly.Enabled = True chkMonitorOnly.Enabled = True
@@ -841,8 +904,9 @@ Public Class frmGameManager
btnOpenRestorePath.Enabled = False btnOpenRestorePath.Enabled = False
chkEnabled.Checked = True chkEnabled.Checked = True
chkMonitorOnly.Checked = False chkMonitorOnly.Checked = False
btnTags.Enabled = False btnTags.Enabled = True
lblTags.Visible = False lblTags.Text = String.Empty
lblTags.Visible = True
btnInclude.Text = frmGameManager_btnInclude btnInclude.Text = frmGameManager_btnInclude
btnExclude.Text = frmGameManager_btnExclude btnExclude.Text = frmGameManager_btnExclude
btnImport.Enabled = False btnImport.Enabled = False
@@ -982,6 +1046,28 @@ Public Class frmGameManager
Else Else
btnInclude.Enabled = True btnInclude.Enabled = True
End If End If
VerifyCleanFolder()
End Sub
Private Sub MonitorOnlyModeChange()
If chkMonitorOnly.Checked Then
chkFolderSave.Enabled = False
chkTimeStamp.Enabled = False
lblSavePath.Enabled = False
txtSavePath.Enabled = False
btnSavePathBrowse.Enabled = False
btnInclude.Enabled = False
btnExclude.Enabled = False
Else
chkFolderSave.Enabled = True
chkTimeStamp.Enabled = True
lblSavePath.Enabled = True
txtSavePath.Enabled = True
btnSavePathBrowse.Enabled = True
btnInclude.Enabled = True
btnExclude.Enabled = True
End If
VerifyCleanFolder()
End Sub End Sub
Private Sub TimeStampModeChange() Private Sub TimeStampModeChange()
@@ -996,6 +1082,17 @@ Public Class frmGameManager
End If End If
End Sub End Sub
Private Sub VerifyCleanFolder()
If Not bIsLoading Then
If (chkFolderSave.Checked = True And txtExclude.Text = String.Empty And txtSavePath.Text <> String.Empty) And Not chkMonitorOnly.Checked Then
chkCleanFolder.Enabled = True
Else
chkCleanFolder.Checked = False
chkCleanFolder.Enabled = False
End If
End If
End Sub
Private Sub EditApp() Private Sub EditApp()
eCurrentMode = eModes.Edit eCurrentMode = eModes.Edit
ModeChange() ModeChange()
@@ -1038,6 +1135,22 @@ Public Class frmGameManager
End If End If
End Sub End Sub
Private Sub SaveTags(ByVal sID As String)
Dim oGameTag As clsGameTag
Dim oGameTags As List(Of clsGameTag)
If oTagsToSave.Count > 0 Then
oGameTags = New List(Of clsGameTag)
For Each kp As KeyValuePair(Of String, String) In oTagsToSave
oGameTag = New clsGameTag
oGameTag.MonitorID = sID
oGameTag.TagID = kp.Key
oGameTags.Add(oGameTag)
Next
mgrGameTags.DoGameTagAddBatch(oGameTags)
End If
End Sub
Private Sub SaveApp() Private Sub SaveApp()
Dim oData As KeyValuePair(Of String, String) Dim oData As KeyValuePair(Of String, String)
Dim oApp As New clsGame Dim oApp As New clsGame
@@ -1056,14 +1169,17 @@ Public Class frmGameManager
Else Else
oApp.ProcessName = txtProcess.Text oApp.ProcessName = txtProcess.Text
End If End If
oApp.Parameter = txtParameter.Text
oApp.Path = txtSavePath.Text oApp.Path = txtSavePath.Text
'Only do a simple root check here in case the user doesn't really understand creating a proper configuration 'Only do a simple root check here in case the user doesn't really understand creating a proper configuration
oApp.AbsolutePath = Path.IsPathRooted(txtSavePath.Text) oApp.AbsolutePath = Path.IsPathRooted(txtSavePath.Text)
oApp.FileType = txtFileType.Text oApp.FileType = txtFileType.Text
oApp.ExcludeList = txtExclude.Text oApp.ExcludeList = txtExclude.Text
oApp.FolderSave = chkFolderSave.Checked oApp.FolderSave = chkFolderSave.Checked
oApp.CleanFolder = chkCleanFolder.Checked
oApp.AppendTimeStamp = chkTimeStamp.Checked oApp.AppendTimeStamp = chkTimeStamp.Checked
oApp.BackupLimit = nudLimit.Value oApp.BackupLimit = nudLimit.Value
oApp.Comments = txtComments.Text
oApp.Enabled = chkEnabled.Checked oApp.Enabled = chkEnabled.Checked
oApp.MonitorOnly = chkMonitorOnly.Checked oApp.MonitorOnly = chkMonitorOnly.Checked
oApp.ProcessPath = txtAppPath.Text oApp.ProcessPath = txtAppPath.Text
@@ -1077,6 +1193,7 @@ Public Class frmGameManager
If CoreValidatation(oApp) Then If CoreValidatation(oApp) Then
bSuccess = True bSuccess = True
mgrMonitorList.DoListAdd(oApp) mgrMonitorList.DoListAdd(oApp)
SaveTags(oApp.ID)
eCurrentMode = eModes.View eCurrentMode = eModes.View
End If End If
Case eModes.Edit Case eModes.Edit
@@ -1102,8 +1219,16 @@ Public Class frmGameManager
If bSuccess Then If bSuccess Then
IsDirty = False IsDirty = False
LoadData() LoadData()
ModeChange() If eCurrentMode = eModes.View Then
If eCurrentMode = eModes.View Then lstGames.SelectedValue = oApp.ID lstGames.SelectedItem = New KeyValuePair(Of String, String)(oApp.ID, oApp.Name)
Else
ModeChange()
End If
'If the addition doesn't match the current filter we should go into disabled mode as it can't be selected to view
If lstGames.SelectedIndex = -1 Then
eCurrentMode = eModes.Disabled
ModeChange()
End If
End If End If
End Sub End Sub
@@ -1113,7 +1238,7 @@ Public Class frmGameManager
If lstGames.SelectedItems.Count = 1 Then If lstGames.SelectedItems.Count = 1 Then
oData = lstGames.SelectedItems(0) oData = lstGames.SelectedItems(0)
oApp = DirectCast(AppData(oData.Key), clsGame) oApp = DirectCast(GameData(oData.Key), clsGame)
If mgrCommon.ShowMessage(frmGameManager_ConfirmGameDelete, oApp.Name, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then If mgrCommon.ShowMessage(frmGameManager_ConfirmGameDelete, oApp.Name, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
mgrMonitorList.DoListDelete(oApp.ID) mgrMonitorList.DoListDelete(oApp.ID)
@@ -1125,7 +1250,7 @@ Public Class frmGameManager
Dim sMonitorIDs As New List(Of String) Dim sMonitorIDs As New List(Of String)
For Each oData In lstGames.SelectedItems For Each oData In lstGames.SelectedItems
oApp = DirectCast(AppData(oData.Key), clsGame) oApp = DirectCast(GameData(oData.Key), clsGame)
sMonitorIDs.Add(oApp.ID) sMonitorIDs.Add(oApp.ID)
Next Next
@@ -1144,6 +1269,7 @@ Public Class frmGameManager
eCurrentMode = eModes.View eCurrentMode = eModes.View
FillData() FillData()
ModeChange() ModeChange()
VerifyCleanFolder()
ElseIf lstGames.SelectedItems.Count > 1 Then ElseIf lstGames.SelectedItems.Count > 1 Then
eCurrentMode = eModes.MultiSelect eCurrentMode = eModes.MultiSelect
ModeChange() ModeChange()
@@ -1164,7 +1290,7 @@ Public Class frmGameManager
Return False Return False
End If End If
If chkFolderSave.Checked = False And txtFileType.Text = String.Empty Then If (chkFolderSave.Checked = False And txtFileType.Text = String.Empty) And Not chkMonitorOnly.Checked Then
mgrCommon.ShowMessage(frmGameManager_ErrorNoItems, MsgBoxStyle.Exclamation) mgrCommon.ShowMessage(frmGameManager_ErrorNoItems, MsgBoxStyle.Exclamation)
btnInclude.Focus() btnInclude.Focus()
Return False Return False
@@ -1176,6 +1302,13 @@ Public Class frmGameManager
Return False Return False
End If End If
If oApp.Parameter <> String.Empty Then
If mgrMonitorList.DoDuplicateParameterCheck(oApp.ProcessName, oApp.Parameter, , oApp.ID) Then
mgrCommon.ShowMessage(frmGameManager_ErrorProcessParameterDupe, MsgBoxStyle.Exclamation)
Return False
End If
End If
Return True Return True
End Function End Function
@@ -1244,8 +1377,8 @@ Public Class frmGameManager
BackupList.Clear() BackupList.Clear()
For Each oData In lstGames.SelectedItems For Each oData In lstGames.SelectedItems
oGame = DirectCast(AppData(oData.Key), clsGame) oGame = DirectCast(GameData(oData.Key), clsGame)
BackupList.Add(oGame) If Not oGame.MonitorOnly Then BackupList.Add(oGame)
Next Next
If BackupList.Count = 1 Then If BackupList.Count = 1 Then
@@ -1282,17 +1415,14 @@ Public Class frmGameManager
If lstGames.SelectedItems.Count > 0 Then If lstGames.SelectedItems.Count > 0 Then
RestoreList.Clear() RestoreList.Clear()
If lstGames.SelectedItems.Count = 1 Then
RestoreList.Add(CurrentGame, CurrentBackupItem) For Each oData In lstGames.SelectedItems
Else If oRemoteBackupData.Contains(oData.Value) Then
For Each oData In lstGames.SelectedItems oGame = DirectCast(GameData(oData.Key), clsGame)
If oRemoteBackupData.Contains(oData.Value) Then oBackup = DirectCast(oRemoteBackupData(oData.Value), clsBackup)
oGame = DirectCast(AppData(oData.Key), clsGame) If Not oGame.MonitorOnly Then RestoreList.Add(oGame, oBackup)
oBackup = DirectCast(oRemoteBackupData(oData.Value), clsBackup) End If
RestoreList.Add(oGame, oBackup) Next
End If
Next
End If
If RestoreList.Count = 1 Then If RestoreList.Count = 1 Then
bDoRestore = True bDoRestore = True
@@ -1329,7 +1459,7 @@ Public Class frmGameManager
Private Sub ImportGameListFile() Private Sub ImportGameListFile()
Dim sLocation As String Dim sLocation As String
sLocation = mgrCommon.OpenFileBrowser(frmGameManager_ChooseImportXML, "xml", frmGameManager_XML, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), False) sLocation = mgrCommon.OpenFileBrowser("XML_Import", frmGameManager_ChooseImportXML, "xml", frmGameManager_XML, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), False)
If sLocation <> String.Empty Then If sLocation <> String.Empty Then
If mgrMonitorList.DoImport(sLocation) Then If mgrMonitorList.DoImport(sLocation) Then
@@ -1342,7 +1472,7 @@ Public Class frmGameManager
Private Sub ExportGameList() Private Sub ExportGameList()
Dim sLocation As String Dim sLocation As String
sLocation = mgrCommon.SaveFileBrowser(frmGameManager_ChooseExportXML, "xml", frmGameManager_XML, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), frmGameManager_DefaultExportFileName & " " & Date.Now.ToString("dd-MMM-yyyy")) sLocation = mgrCommon.SaveFileBrowser("XML_Export", frmGameManager_ChooseExportXML, "xml", frmGameManager_XML, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), frmGameManager_DefaultExportFileName & " " & Date.Now.ToString("dd-MMM-yyyy"))
If sLocation <> String.Empty Then If sLocation <> String.Empty Then
mgrMonitorList.ExportMonitorList(sLocation) mgrMonitorList.ExportMonitorList(sLocation)
@@ -1408,9 +1538,11 @@ Public Class frmGameManager
btnProcessBrowse.Text = frmGameManager_btnProcessBrowse btnProcessBrowse.Text = frmGameManager_btnProcessBrowse
lblSavePath.Text = frmGameManager_lblSavePath lblSavePath.Text = frmGameManager_lblSavePath
lblProcess.Text = frmGameManager_lblProcess lblProcess.Text = frmGameManager_lblProcess
lblParameter.Text = frmGameManager_lblParameter
lblName.Text = frmGameManager_lblName lblName.Text = frmGameManager_lblName
chkTimeStamp.Text = frmGameManager_chkTimeStamp chkTimeStamp.Text = frmGameManager_chkTimeStamp
chkFolderSave.Text = frmGameManager_chkFolderSave chkFolderSave.Text = frmGameManager_chkFolderSave
chkCleanFolder.Text = frmGameManager_chkCleanFolder
btnBackup.Text = frmGameManager_btnBackup btnBackup.Text = frmGameManager_btnBackup
btnClose.Text = frmGameManager_btnClose btnClose.Text = frmGameManager_btnClose
btnDelete.Text = frmGameManager_btnDelete btnDelete.Text = frmGameManager_btnDelete
@@ -1529,7 +1661,7 @@ Public Class frmGameManager
Private Sub btnDeleteBackup_Click(sender As Object, e As EventArgs) Handles btnDeleteBackup.Click Private Sub btnDeleteBackup_Click(sender As Object, e As EventArgs) Handles btnDeleteBackup.Click
If cboRemoteBackup.Items.Count > 1 Then If cboRemoteBackup.Items.Count > 1 Then
cmsDeleteBackup.Show(btnDeleteBackup, New Drawing.Point(109, 11), ToolStripDropDownDirection.AboveRight) cmsDeleteBackup.Show(btnDeleteBackup, New Drawing.Point(btnDeleteBackup.Size.Width - Math.Floor(btnDeleteBackup.Size.Width * 0.1), btnDeleteBackup.Size.Height - Math.Floor(btnDeleteBackup.Size.Height * 0.5)), ToolStripDropDownDirection.AboveRight)
Else Else
DeleteBackup() DeleteBackup()
End If End If
@@ -1585,7 +1717,7 @@ Public Class frmGameManager
End Sub End Sub
Private Sub btnImport_Click(sender As Object, e As EventArgs) Handles btnImport.Click Private Sub btnImport_Click(sender As Object, e As EventArgs) Handles btnImport.Click
cmsImport.Show(btnImport, New Drawing.Point(70, 11), ToolStripDropDownDirection.AboveRight) cmsImport.Show(btnImport, New Drawing.Point(btnImport.Size.Width - Math.Floor(btnImport.Size.Width * 0.1), btnImport.Size.Height - Math.Floor(btnImport.Size.Height * 0.5)), ToolStripDropDownDirection.AboveRight)
End Sub End Sub
Private Sub cmsOfficial_Click(sender As Object, e As EventArgs) Handles cmsOfficial.Click Private Sub cmsOfficial_Click(sender As Object, e As EventArgs) Handles cmsOfficial.Click
@@ -1607,6 +1739,10 @@ Public Class frmGameManager
End If End If
End Sub End Sub
Private Sub txtSavePath_TextChanged(sender As Object, e As EventArgs) Handles txtSavePath.TextChanged
VerifyCleanFolder()
End Sub
Private Sub tmFilterTimer_Tick(sender As Object, ByVal e As EventArgs) Handles tmFilterTimer.Tick Private Sub tmFilterTimer_Tick(sender As Object, ByVal e As EventArgs) Handles tmFilterTimer.Tick
lstGames.DataSource = Nothing lstGames.DataSource = Nothing
FormatAndFillList() FormatAndFillList()
@@ -1618,4 +1754,7 @@ Public Class frmGameManager
txtQuickFilter.Focus() txtQuickFilter.Focus()
End Sub End Sub
Private Sub chkMonitorOnly_CheckedChanged(sender As Object, e As EventArgs) Handles chkMonitorOnly.CheckedChanged
MonitorOnlyModeChange()
End Sub
End Class End Class
+70 -23
View File
@@ -2,8 +2,10 @@
Public Class frmGameTags Public Class frmGameTags
Dim sMonitorIDs As List(Of String) Private sMonitorIDs As List(Of String)
Dim sGameName As String = String.Empty Private sGameName As String = String.Empty
Private bNewMode As Boolean = False
Private oTagList As List(Of KeyValuePair(Of String, String))
Public Property IDList As List(Of String) Public Property IDList As List(Of String)
Get Get
@@ -23,6 +25,25 @@ Public Class frmGameTags
End Set End Set
End Property End Property
Public Property NewMode As Boolean
Get
Return bNewMode
End Get
Set(value As Boolean)
bNewMode = value
End Set
End Property
Public Property TagList As List(Of KeyValuePair(Of String, String))
Get
Return oTagList
End Get
Set(value As List(Of KeyValuePair(Of String, String)))
oTagList = value
End Set
End Property
Private Sub AddTag() Private Sub AddTag()
Dim oData As KeyValuePair(Of String, String) Dim oData As KeyValuePair(Of String, String)
Dim oTags As List(Of KeyValuePair(Of String, String)) Dim oTags As List(Of KeyValuePair(Of String, String))
@@ -40,7 +61,7 @@ Public Class frmGameTags
oGameTags.Add(oGameTag) oGameTags.Add(oGameTag)
Next Next
mgrGameTags.DoGameTagAddBatch(oGameTags) If Not bNewMode Then mgrGameTags.DoGameTagAddBatch(oGameTags)
lstGameTags.Items.Add(oData) lstGameTags.Items.Add(oData)
lstTags.Items.Remove(oData) lstTags.Items.Remove(oData)
@@ -60,7 +81,7 @@ Public Class frmGameTags
oGameTags.Add(oGameTag) oGameTags.Add(oGameTag)
Next Next
mgrGameTags.DoGameTagAddBatch(oGameTags) If Not bNewMode Then mgrGameTags.DoGameTagAddBatch(oGameTags)
lstGameTags.Items.Add(kp) lstGameTags.Items.Add(kp)
lstTags.Items.Remove(kp) lstTags.Items.Remove(kp)
@@ -86,12 +107,12 @@ Public Class frmGameTags
oGameTags.Add(oGameTag) oGameTags.Add(oGameTag)
Next Next
mgrGameTags.DoGameTagDelete(oGameTags) If Not bNewMode Then mgrGameTags.DoGameTagDelete(oGameTags)
lstGameTags.Items.Remove(oData) lstGameTags.Items.Remove(oData)
lstTags.Items.Add(oData) lstTags.Items.Add(oData)
ElseIf lstGameTags.SelectedItems.Count > 1 Then ElseIf lstGameTags.SelectedItems.Count > 1 Then
oTags = New List(Of KeyValuePair(Of String, String)) oTags = New List(Of KeyValuePair(Of String, String))
For Each oData In lstGameTags.SelectedItems For Each oData In lstGameTags.SelectedItems
oTags.Add(oData) oTags.Add(oData)
@@ -106,7 +127,7 @@ Public Class frmGameTags
oGameTags.Add(oGameTag) oGameTags.Add(oGameTag)
Next Next
mgrGameTags.DoGameTagDelete(oGameTags) If Not bNewMode Then mgrGameTags.DoGameTagDelete(oGameTags)
lstGameTags.Items.Remove(kp) lstGameTags.Items.Remove(kp)
lstTags.Items.Add(kp) lstTags.Items.Add(kp)
@@ -121,16 +142,8 @@ Public Class frmGameTags
Dim oTag As clsTag Dim oTag As clsTag
Dim oData As KeyValuePair(Of String, String) Dim oData As KeyValuePair(Of String, String)
'Handle Data 'Load Tags
hshTags = mgrTags.ReadTags() hshTags = mgrTags.ReadTags()
hshGameTags = mgrGameTags.GetTagsByGameMulti(IDList)
For Each de As DictionaryEntry In hshGameTags
oTag = DirectCast(de.Value, clsTag)
If hshTags.ContainsKey(oTag.Name) Then
hshTags.Remove(oTag.Name)
End If
Next
'Handle Lists 'Handle Lists
lstTags.Items.Clear() lstTags.Items.Clear()
@@ -141,11 +154,35 @@ Public Class frmGameTags
lstGameTags.ValueMember = "Key" lstGameTags.ValueMember = "Key"
lstGameTags.DisplayMember = "Value" lstGameTags.DisplayMember = "Value"
For Each de As DictionaryEntry In hshGameTags If bNewMode Then
oTag = DirectCast(de.Value, clsTag) For Each kp As KeyValuePair(Of String, String) In oTagList
oData = New KeyValuePair(Of String, String)(oTag.ID, oTag.Name) 'We need to be sure the tags still exist if the "Setup Tags" form was used
lstGameTags.Items.Add(oData) If hshTags.ContainsKey(kp.Value) Then
Next lstGameTags.Items.Add(kp)
End If
Next
For Each kp As KeyValuePair(Of String, String) In oTagList
If hshTags.ContainsKey(kp.Value) Then
hshTags.Remove(kp.Value)
End If
Next
Else
hshGameTags = mgrGameTags.GetTagsByGameMulti(IDList)
For Each de As DictionaryEntry In hshGameTags
oTag = DirectCast(de.Value, clsTag)
If hshTags.ContainsKey(oTag.Name) Then
hshTags.Remove(oTag.Name)
End If
Next
For Each de As DictionaryEntry In hshGameTags
oTag = DirectCast(de.Value, clsTag)
oData = New KeyValuePair(Of String, String)(oTag.ID, oTag.Name)
lstGameTags.Items.Add(oData)
Next
End If
For Each de As DictionaryEntry In hshTags For Each de As DictionaryEntry In hshTags
oTag = DirectCast(de.Value, clsTag) oTag = DirectCast(de.Value, clsTag)
@@ -155,6 +192,14 @@ Public Class frmGameTags
End Sub End Sub
Private Sub BuildTagList()
Dim oData As KeyValuePair(Of String, String)
oTagList.Clear()
For Each oData In lstGameTags.Items
oTagList.Add(oData)
Next
End Sub
Private Sub OpenTags() Private Sub OpenTags()
Dim frm As New frmTags Dim frm As New frmTags
frm.ShowDialog() frm.ShowDialog()
@@ -185,6 +230,7 @@ Public Class frmGameTags
End Sub End Sub
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
If bNewMode Then BuildTagList()
Me.Close() Me.Close()
End Sub End Sub
@@ -197,6 +243,7 @@ Public Class frmGameTags
End Sub End Sub
Private Sub btnOpenTags_Click(sender As Object, e As EventArgs) Handles btnOpenTags.Click Private Sub btnOpenTags_Click(sender As Object, e As EventArgs) Handles btnOpenTags.Click
If bNewMode Then BuildTagList()
OpenTags() OpenTags()
End Sub End Sub
End Class End Class
+3 -1
View File
@@ -108,7 +108,7 @@ Public Class frmIncludeExclude
End If End If
End If End If
sNewPath = mgrCommon.OpenFolderBrowser(frmIncludeExclude_BrowseSaveFolder, sDefaultFolder, False) sNewPath = mgrCommon.OpenFolderBrowser("IE_Save_Path", frmIncludeExclude_BrowseSaveFolder, sDefaultFolder, False, False)
If sNewPath <> String.Empty Then txtRootFolder.Text = sNewPath If sNewPath <> String.Empty Then txtRootFolder.Text = sNewPath
End Sub End Sub
@@ -226,6 +226,8 @@ Public Class frmIncludeExclude
sNewString = InputBox(frmIncludeExclude_RawEditInfo, mgrCommon.FormatString(frmIncludeExclude_RawEditTitle, FormName), sCurrentString) sNewString = InputBox(frmIncludeExclude_RawEditInfo, mgrCommon.FormatString(frmIncludeExclude_RawEditTitle, FormName), sCurrentString)
If sNewString <> String.Empty Then If sNewString <> String.Empty Then
ParseBuilderString(sNewString) ParseBuilderString(sNewString)
Else
lstBuilder.Clear()
End If End If
End Sub End Sub
+38 -22
View File
@@ -68,6 +68,7 @@ Partial Class frmMain
Me.gMonToolsLog = New System.Windows.Forms.ToolStripMenuItem() Me.gMonToolsLog = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonLogClear = New System.Windows.Forms.ToolStripMenuItem() Me.gMonLogClear = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonLogSave = 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.gMonHelp = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonHelpWebSite = New System.Windows.Forms.ToolStripMenuItem() Me.gMonHelpWebSite = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonHelpManual = New System.Windows.Forms.ToolStripMenuItem() Me.gMonHelpManual = New System.Windows.Forms.ToolStripMenuItem()
@@ -75,7 +76,6 @@ Partial Class frmMain
Me.gMonHelpAbout = New System.Windows.Forms.ToolStripMenuItem() Me.gMonHelpAbout = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonNotification = New System.Windows.Forms.ToolStripMenuItem() Me.gMonNotification = New System.Windows.Forms.ToolStripMenuItem()
Me.pbIcon = New System.Windows.Forms.PictureBox() Me.pbIcon = New System.Windows.Forms.PictureBox()
Me.btnLogToggle = New System.Windows.Forms.Button()
Me.lblGameTitle = New System.Windows.Forms.Label() Me.lblGameTitle = New System.Windows.Forms.Label()
Me.lblLastAction = New System.Windows.Forms.Label() Me.lblLastAction = New System.Windows.Forms.Label()
Me.lblLastActionTitle = New System.Windows.Forms.Label() Me.lblLastActionTitle = New System.Windows.Forms.Label()
@@ -85,6 +85,7 @@ Partial Class frmMain
Me.lblStatus2 = New System.Windows.Forms.Label() Me.lblStatus2 = New System.Windows.Forms.Label()
Me.lblStatus3 = New System.Windows.Forms.Label() Me.lblStatus3 = New System.Windows.Forms.Label()
Me.pbTime = New System.Windows.Forms.PictureBox() Me.pbTime = New System.Windows.Forms.PictureBox()
Me.gMonTrayToolsSessions = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTrayMenu.SuspendLayout() Me.gMonTrayMenu.SuspendLayout()
Me.gMonStatusStrip.SuspendLayout() Me.gMonStatusStrip.SuspendLayout()
Me.gMonMainMenu.SuspendLayout() Me.gMonMainMenu.SuspendLayout()
@@ -104,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.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.Name = "gMonTrayMenu"
Me.gMonTrayMenu.Size = New System.Drawing.Size(162, 170) Me.gMonTrayMenu.Size = New System.Drawing.Size(162, 192)
' '
'gMonTrayNotification 'gMonTrayNotification
' '
@@ -169,7 +170,7 @@ Partial Class frmMain
' '
'gMonTrayTools '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.Name = "gMonTrayTools"
Me.gMonTrayTools.Size = New System.Drawing.Size(161, 22) Me.gMonTrayTools.Size = New System.Drawing.Size(161, 22)
Me.gMonTrayTools.Text = "&Tools" Me.gMonTrayTools.Text = "&Tools"
@@ -196,13 +197,13 @@ Partial Class frmMain
'gMonTrayLogClear 'gMonTrayLogClear
' '
Me.gMonTrayLogClear.Name = "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" Me.gMonTrayLogClear.Text = "&Clear"
' '
'gMonTrayLogSave 'gMonTrayLogSave
' '
Me.gMonTrayLogSave.Name = "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" Me.gMonTrayLogSave.Text = "&Save"
' '
'gMonTraySep1 'gMonTraySep1
@@ -222,6 +223,9 @@ Partial Class frmMain
' '
'txtLog 'txtLog
' '
Me.txtLog.Anchor = CType((((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Bottom) _
Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.txtLog.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.txtLog.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtLog.Location = New System.Drawing.Point(12, 184) Me.txtLog.Location = New System.Drawing.Point(12, 184)
Me.txtLog.MaxLength = 524288 Me.txtLog.MaxLength = 524288
@@ -229,7 +233,7 @@ Partial Class frmMain
Me.txtLog.Name = "txtLog" Me.txtLog.Name = "txtLog"
Me.txtLog.ReadOnly = True Me.txtLog.ReadOnly = True
Me.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical Me.txtLog.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.txtLog.Size = New System.Drawing.Size(500, 177) Me.txtLog.Size = New System.Drawing.Size(500, 186)
Me.txtLog.TabIndex = 10 Me.txtLog.TabIndex = 10
Me.txtLog.TabStop = False Me.txtLog.TabStop = False
' '
@@ -346,7 +350,7 @@ Partial Class frmMain
' '
'gMonTools '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.Name = "gMonTools"
Me.gMonTools.Size = New System.Drawing.Size(47, 20) Me.gMonTools.Size = New System.Drawing.Size(47, 20)
Me.gMonTools.Text = "&Tools" Me.gMonTools.Text = "&Tools"
@@ -382,6 +386,12 @@ Partial Class frmMain
Me.gMonLogSave.Size = New System.Drawing.Size(101, 22) Me.gMonLogSave.Size = New System.Drawing.Size(101, 22)
Me.gMonLogSave.Text = "&Save" Me.gMonLogSave.Text = "&Save"
' '
'gMonToolsSessions
'
Me.gMonToolsSessions.Name = "gMonToolsSessions"
Me.gMonToolsSessions.Size = New System.Drawing.Size(184, 22)
Me.gMonToolsSessions.Text = "&Session Viewer..."
'
'gMonHelp 'gMonHelp
' '
Me.gMonHelp.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonHelpWebSite, Me.gMonHelpManual, Me.gMonHelpCheckforUpdates, Me.gMonHelpAbout}) Me.gMonHelp.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonHelpWebSite, Me.gMonHelpManual, Me.gMonHelpCheckforUpdates, Me.gMonHelpAbout})
@@ -430,17 +440,11 @@ Partial Class frmMain
Me.pbIcon.TabIndex = 9 Me.pbIcon.TabIndex = 9
Me.pbIcon.TabStop = False Me.pbIcon.TabStop = False
' '
'btnLogToggle
'
Me.btnLogToggle.Location = New System.Drawing.Point(437, 155)
Me.btnLogToggle.Name = "btnLogToggle"
Me.btnLogToggle.Size = New System.Drawing.Size(75, 23)
Me.btnLogToggle.TabIndex = 7
Me.btnLogToggle.Text = "Show &Log"
Me.btnLogToggle.UseVisualStyleBackColor = True
'
'lblGameTitle 'lblGameTitle
' '
Me.lblGameTitle.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lblGameTitle.AutoEllipsis = True
Me.lblGameTitle.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblGameTitle.Font = New System.Drawing.Font("Microsoft Sans Serif", 9.75!, System.Drawing.FontStyle.Bold, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblGameTitle.Location = New System.Drawing.Point(66, 36) Me.lblGameTitle.Location = New System.Drawing.Point(66, 36)
Me.lblGameTitle.Name = "lblGameTitle" Me.lblGameTitle.Name = "lblGameTitle"
@@ -450,6 +454,8 @@ Partial Class frmMain
' '
'lblLastAction 'lblLastAction
' '
Me.lblLastAction.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lblLastAction.AutoEllipsis = True Me.lblLastAction.AutoEllipsis = True
Me.lblLastAction.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte)) Me.lblLastAction.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.lblLastAction.Location = New System.Drawing.Point(12, 165) Me.lblLastAction.Location = New System.Drawing.Point(12, 165)
@@ -480,7 +486,8 @@ Partial Class frmMain
' '
'btnCancelOperation 'btnCancelOperation
' '
Me.btnCancelOperation.Location = New System.Drawing.Point(437, 126) Me.btnCancelOperation.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnCancelOperation.Location = New System.Drawing.Point(437, 155)
Me.btnCancelOperation.Name = "btnCancelOperation" Me.btnCancelOperation.Name = "btnCancelOperation"
Me.btnCancelOperation.Size = New System.Drawing.Size(75, 23) Me.btnCancelOperation.Size = New System.Drawing.Size(75, 23)
Me.btnCancelOperation.TabIndex = 6 Me.btnCancelOperation.TabIndex = 6
@@ -489,6 +496,8 @@ Partial Class frmMain
' '
'lblStatus1 'lblStatus1
' '
Me.lblStatus1.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lblStatus1.AutoEllipsis = True Me.lblStatus1.AutoEllipsis = True
Me.lblStatus1.Location = New System.Drawing.Point(66, 58) Me.lblStatus1.Location = New System.Drawing.Point(66, 58)
Me.lblStatus1.Name = "lblStatus1" Me.lblStatus1.Name = "lblStatus1"
@@ -497,6 +506,8 @@ Partial Class frmMain
' '
'lblStatus2 'lblStatus2
' '
Me.lblStatus2.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lblStatus2.AutoEllipsis = True Me.lblStatus2.AutoEllipsis = True
Me.lblStatus2.Location = New System.Drawing.Point(66, 74) Me.lblStatus2.Location = New System.Drawing.Point(66, 74)
Me.lblStatus2.Name = "lblStatus2" Me.lblStatus2.Name = "lblStatus2"
@@ -505,6 +516,8 @@ Partial Class frmMain
' '
'lblStatus3 'lblStatus3
' '
Me.lblStatus3.Anchor = CType(((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lblStatus3.AutoEllipsis = True Me.lblStatus3.AutoEllipsis = True
Me.lblStatus3.Location = New System.Drawing.Point(66, 90) Me.lblStatus3.Location = New System.Drawing.Point(66, 90)
Me.lblStatus3.Name = "lblStatus3" Me.lblStatus3.Name = "lblStatus3"
@@ -519,6 +532,12 @@ Partial Class frmMain
Me.pbTime.TabIndex = 18 Me.pbTime.TabIndex = 18
Me.pbTime.TabStop = False Me.pbTime.TabStop = False
' '
'gMonTrayToolsSessions
'
Me.gMonTrayToolsSessions.Name = "gMonTrayToolsSessions"
Me.gMonTrayToolsSessions.Size = New System.Drawing.Size(184, 22)
Me.gMonTrayToolsSessions.Text = "&Session Viewer..."
'
'frmMain 'frmMain
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -533,17 +552,13 @@ Partial Class frmMain
Me.Controls.Add(Me.lblLastActionTitle) Me.Controls.Add(Me.lblLastActionTitle)
Me.Controls.Add(Me.lblLastAction) Me.Controls.Add(Me.lblLastAction)
Me.Controls.Add(Me.lblGameTitle) Me.Controls.Add(Me.lblGameTitle)
Me.Controls.Add(Me.btnLogToggle)
Me.Controls.Add(Me.pbIcon) Me.Controls.Add(Me.pbIcon)
Me.Controls.Add(Me.gMonStatusStrip) Me.Controls.Add(Me.gMonStatusStrip)
Me.Controls.Add(Me.gMonMainMenu) Me.Controls.Add(Me.gMonMainMenu)
Me.Controls.Add(Me.txtLog) Me.Controls.Add(Me.txtLog)
Me.Font = New System.Drawing.Font("Microsoft Sans Serif", 8.25!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon) Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.KeyPreview = True Me.KeyPreview = True
Me.MainMenuStrip = Me.gMonMainMenu Me.MainMenuStrip = Me.gMonMainMenu
Me.MaximizeBox = False
Me.MinimizeBox = False Me.MinimizeBox = False
Me.Name = "frmMain" Me.Name = "frmMain"
Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide
@@ -586,7 +601,6 @@ Partial Class frmMain
Friend WithEvents gMonTraySetupGameManager As System.Windows.Forms.ToolStripMenuItem Friend WithEvents gMonTraySetupGameManager As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents gMonTraySetupCustomVariables As System.Windows.Forms.ToolStripMenuItem Friend WithEvents gMonTraySetupCustomVariables As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents pbIcon As System.Windows.Forms.PictureBox Friend WithEvents pbIcon As System.Windows.Forms.PictureBox
Friend WithEvents btnLogToggle As System.Windows.Forms.Button
Friend WithEvents lblGameTitle As System.Windows.Forms.Label Friend WithEvents lblGameTitle As System.Windows.Forms.Label
Friend WithEvents lblLastAction As System.Windows.Forms.Label Friend WithEvents lblLastAction As System.Windows.Forms.Label
Friend WithEvents lblLastActionTitle As System.Windows.Forms.Label Friend WithEvents lblLastActionTitle As System.Windows.Forms.Label
@@ -621,4 +635,6 @@ Partial Class frmMain
Friend WithEvents gMonTrayLogSave As ToolStripMenuItem Friend WithEvents gMonTrayLogSave As ToolStripMenuItem
Friend WithEvents gMonStripAdminButton As System.Windows.Forms.ToolStripStatusLabel Friend WithEvents gMonStripAdminButton As System.Windows.Forms.ToolStripStatusLabel
Friend WithEvents gMonStripStatusButton 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 End Class
+299 -107
View File
@@ -1,4 +1,5 @@
Imports GBM.My.Resources Imports GBM.My.Resources
Imports System.IO
'Name: frmMain 'Name: frmMain
'Description: Game Backup Monitor Main Screen 'Description: Game Backup Monitor Main Screen
@@ -38,12 +39,18 @@ Public Class frmMain
Private sPriorPath As String Private sPriorPath As String
Private sPriorCompany As String Private sPriorCompany As String
Private sPriorVersion As String Private sPriorVersion As String
Private iRestoreTimeOut As Integer
Private wState As FormWindowState = FormWindowState.Normal
'Developer Debug Flags 'Developer Debug Flags
Private bProcessDebugMode As Boolean = False Private bProcessDebugMode As Boolean = False
WithEvents oFileWatcher As New System.IO.FileSystemWatcher WithEvents oFileWatcher As New FileSystemWatcher
'Timers - There may only be one System.Windows.Forms.Timer and it must be tmScanTimer.
WithEvents tmScanTimer As New Timer WithEvents tmScanTimer As New Timer
WithEvents tmRestoreCheck As New System.Timers.Timer
WithEvents tmFileWatcherQueue As New System.Timers.Timer
Public WithEvents oProcess As New mgrProcesses Public WithEvents oProcess As New mgrProcesses
Public WithEvents oBackup As New mgrBackup Public WithEvents oBackup As New mgrBackup
@@ -51,6 +58,7 @@ Public Class frmMain
Public hshScanList As Hashtable Public hshScanList As Hashtable
Public oSettings As New mgrSettings Public oSettings As New mgrSettings
Delegate Sub UpdateNotifierCallBack(ByVal iCount As Integer)
Delegate Sub UpdateLogCallBack(ByVal sLogUpdate As String, ByVal bTrayUpdate As Boolean, ByVal objIcon As System.Windows.Forms.ToolTipIcon, ByVal bTimeStamp As Boolean) Delegate Sub UpdateLogCallBack(ByVal sLogUpdate As String, ByVal bTrayUpdate As Boolean, ByVal objIcon As System.Windows.Forms.ToolTipIcon, ByVal bTimeStamp As Boolean)
Delegate Sub WorkingGameInfoCallBack(ByVal sTitle As String, ByVal sStatus1 As String, ByVal sStatus2 As String, ByVal sStatus3 As String) Delegate Sub WorkingGameInfoCallBack(ByVal sTitle As String, ByVal sStatus1 As String, ByVal sStatus2 As String, ByVal sStatus3 As String)
Delegate Sub UpdateStatusCallBack(ByVal sStatus As String) Delegate Sub UpdateStatusCallBack(ByVal sStatus As String)
@@ -77,7 +85,7 @@ Public Class frmMain
Dim sStatus3 As String Dim sStatus3 As String
'Build Info 'Build Info
sStatus1 = IO.Path.GetFileName(oRestoreInfo.FileName) sStatus1 = Path.GetFileName(oRestoreInfo.FileName)
sStatus2 = mgrCommon.FormatString(frmMain_UpdatedBy, New String() {oRestoreInfo.UpdatedBy, oRestoreInfo.DateUpdated}) sStatus2 = mgrCommon.FormatString(frmMain_UpdatedBy, New String() {oRestoreInfo.UpdatedBy, oRestoreInfo.DateUpdated})
If oRestoreInfo.AbsolutePath Then If oRestoreInfo.AbsolutePath Then
sStatus3 = oRestoreInfo.RestorePath sStatus3 = oRestoreInfo.RestorePath
@@ -99,7 +107,7 @@ Public Class frmMain
If oGame.AbsolutePath Then If oGame.AbsolutePath Then
sStatus2 = oGame.Path sStatus2 = oGame.Path
Else Else
sStatus2 = oGame.ProcessPath & System.IO.Path.DirectorySeparatorChar & oGame.Path sStatus2 = oGame.ProcessPath & Path.DirectorySeparatorChar & oGame.Path
End If End If
sStatus3 = String.Empty sStatus3 = String.Empty
@@ -179,7 +187,7 @@ Public Class frmMain
End If End If
If bPathVerified Then If bPathVerified Then
If oRestore.CheckRestorePrereq(oRestoreInfo) Then If oRestore.CheckRestorePrereq(oRestoreInfo, oGame.CleanFolder) Then
oReadyList.Add(oRestoreInfo) oReadyList.Add(oRestoreInfo)
End If End If
End If End If
@@ -326,15 +334,17 @@ Public Class frmMain
End If End If
End Sub End Sub
Private Sub CheckRestore() Private Sub UpdateNotifier(ByVal iCount As Integer)
Dim slRestoreData As SortedList = mgrRestore.CompareManifests() 'Thread Safe
Dim sNotification As String If Me.InvokeRequired = True Then
Dim d As New UpdateNotifierCallBack(AddressOf UpdateNotifier)
If slRestoreData.Count > 0 Then Me.Invoke(d, New Object() {iCount})
If slRestoreData.Count > 1 Then Else
sNotification = mgrCommon.FormatString(frmMain_NewSaveNotificationMulti, slRestoreData.Count) Dim sNotification As String
If iCount > 1 Then
sNotification = mgrCommon.FormatString(frmMain_NewSaveNotificationMulti, iCount)
Else Else
sNotification = mgrCommon.FormatString(frmMain_NewSaveNotificationSingle, slRestoreData.Count) sNotification = mgrCommon.FormatString(frmMain_NewSaveNotificationSingle, iCount)
End If End If
gMonNotification.Image = Icon_Inbox gMonNotification.Image = Icon_Inbox
gMonTrayNotification.Image = Icon_Inbox gMonTrayNotification.Image = Icon_Inbox
@@ -345,6 +355,149 @@ Public Class frmMain
End If End If
End Sub End Sub
Private Sub StartRestoreCheck()
iRestoreTimeOut = -1
tmRestoreCheck.Interval = 60000
tmRestoreCheck.AutoReset = True
tmRestoreCheck.Start()
AutoRestoreCheck()
End Sub
Private Sub AutoRestoreCheck()
Dim slRestoreData As SortedList = mgrRestore.CompareManifests()
Dim sNotReady As New List(Of String)
Dim sNotInstalled As New List(Of String)
Dim sNoCheckSum As New List(Of String)
Dim oBackup As clsBackup
Dim sFileName As String
Dim sExtractPath As String
Dim bFinished As Boolean = True
Dim hshRestore As Hashtable
Dim hshGames As Hashtable
Dim oGame As clsGame
Dim sGame As String
'Shut down the timer and bail out if there's nothing to do
If slRestoreData.Count = 0 Then
tmRestoreCheck.Stop()
Exit Sub
End If
If oSettings.AutoMark Or oSettings.AutoRestore Then
'Increment Timer
iRestoreTimeOut += 1
'Check backup files
For Each de As DictionaryEntry In slRestoreData
oBackup = DirectCast(de.Value, clsBackup)
'Check if backup file is ready to restore
If oBackup.CheckSum <> String.Empty Then
sFileName = oSettings.BackupFolder & Path.DirectorySeparatorChar & oBackup.FileName
If mgrHash.Generate_SHA256_Hash(sFileName) <> oBackup.CheckSum Then
sNotReady.Add(de.Key)
bFinished = False
End If
Else
sNoCheckSum.Add(de.Key)
End If
'Check if the restore location exists, if not we assume the game is not installed and should be auto-marked.
hshGames = mgrMonitorList.DoListGetbyName(de.Key)
If hshGames.Count = 1 Then
oGame = DirectCast(hshGames(0), clsGame)
mgrRestore.DoPathOverride(oBackup, oGame)
If oGame.ProcessPath <> String.Empty Then
oBackup.RelativeRestorePath = oGame.ProcessPath & Path.DirectorySeparatorChar & oBackup.RestorePath
End If
End If
If oBackup.AbsolutePath Then
sExtractPath = oBackup.RestorePath
Else
sExtractPath = oBackup.RelativeRestorePath
End If
If Not Directory.Exists(sExtractPath) Then
If oSettings.AutoMark Then
If mgrManifest.DoGlobalManifestCheck(de.Key, mgrSQLite.Database.Local) Then
mgrManifest.DoManifestUpdateByName(de.Value, mgrSQLite.Database.Local)
Else
mgrManifest.DoManifestAdd(de.Value, mgrSQLite.Database.Local)
End If
End If
sNotInstalled.Add(de.Key)
End If
Next
'Remove any backup files that are not ready
For Each s As String In sNotReady
slRestoreData.Remove(s)
UpdateLog(mgrCommon.FormatString(frmMain_RestoreNotReady, s), False, ToolTipIcon.Info, True)
Next
'Remove any backup files that should not be automatically restored
For Each s As String In sNotInstalled
slRestoreData.Remove(s)
If oSettings.AutoMark Then
UpdateLog(mgrCommon.FormatString(frmMain_AutoMark, s), False, ToolTipIcon.Info, True)
Else
UpdateLog(mgrCommon.FormatString(frmMain_NoAutoMark, s), False, ToolTipIcon.Info, True)
End If
Next
For Each s As String In sNoCheckSum
slRestoreData.Remove(s)
UpdateLog(mgrCommon.FormatString(frmMain_NoCheckSum, s), False, ToolTipIcon.Info, True)
Next
'Automatically restore backup files
If oSettings.AutoRestore Then
If slRestoreData.Count > 0 Then
hshRestore = New Hashtable
sGame = String.Empty
For Each de As DictionaryEntry In slRestoreData
hshGames = mgrMonitorList.DoListGetbyName(de.Key)
If hshGames.Count = 1 Then
oGame = DirectCast(hshGames(0), clsGame)
sGame = oGame.CroppedName
hshRestore.Add(oGame, de.Value)
Else
UpdateLog(mgrCommon.FormatString(frmMain_AutoRestoreFailure, de.Key), False, ToolTipIcon.Info, True)
End If
Next
'Handle notifications
If oSettings.RestoreOnLaunch Then
If slRestoreData.Count > 1 Then
UpdateLog(mgrCommon.FormatString(frmMain_RestoreNotificationMulti, slRestoreData.Count), True, ToolTipIcon.Info, True)
Else
UpdateLog(mgrCommon.FormatString(frmMain_RestoreNotificationSingle, sGame), True, ToolTipIcon.Info, True)
End If
End If
RunRestore(hshRestore)
End If
End If
'Shutdown if we are finished
If bFinished Then
tmRestoreCheck.Stop()
End If
'Time out after 15 minutes
If iRestoreTimeOut = 15 Then
tmRestoreCheck.Stop()
End If
End If
'Update the menu notifier if we aren't using auto restore
If oSettings.RestoreOnLaunch And Not oSettings.AutoRestore Then
If slRestoreData.Count > 0 Then
UpdateNotifier(slRestoreData.Count)
End If
End If
End Sub
'Functions handling the display of game information 'Functions handling the display of game information
Private Sub SetIcon() Private Sub SetIcon()
Dim sIcon As String Dim sIcon As String
@@ -362,7 +515,7 @@ Public Class frmMain
End If End If
Try Try
fbBrowser.InitialDirectory = IO.Path.GetDirectoryName(oProcess.FoundProcess.MainModule.FileName) fbBrowser.InitialDirectory = Path.GetDirectoryName(oProcess.FoundProcess.MainModule.FileName)
Catch ex As Exception Catch ex As Exception
fbBrowser.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) fbBrowser.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
End Try End Try
@@ -370,7 +523,7 @@ Public Class frmMain
If fbBrowser.ShowDialog() = Windows.Forms.DialogResult.OK Then If fbBrowser.ShowDialog() = Windows.Forms.DialogResult.OK Then
sIcon = fbBrowser.FileName sIcon = fbBrowser.FileName
If IO.File.Exists(sIcon) Then If File.Exists(sIcon) Then
oProcess.GameInfo.Icon = sIcon oProcess.GameInfo.Icon = sIcon
pbIcon.Image = Image.FromFile(sIcon) pbIcon.Image = Image.FromFile(sIcon)
mgrMonitorList.DoListUpdate(oProcess.GameInfo) mgrMonitorList.DoListUpdate(oProcess.GameInfo)
@@ -380,7 +533,7 @@ Public Class frmMain
Private Sub ResetGameInfo(Optional ByVal bKeepInfo As Boolean = False) Private Sub ResetGameInfo(Optional ByVal bKeepInfo As Boolean = False)
If bKeepInfo And Not oProcess.GameInfo Is Nothing Then If bKeepInfo And Not oProcess.GameInfo Is Nothing Then
lblGameTitle.Text = mgrCommon.FormatString(frmMain_LastGame, oProcess.GameInfo.CroppedName) lblGameTitle.Text = mgrCommon.FormatString(frmMain_LastGame, oProcess.GameInfo.Name)
pbIcon.Image = oPriorImage pbIcon.Image = oPriorImage
lblStatus1.Text = sPriorPath lblStatus1.Text = sPriorPath
lblStatus2.Text = sPriorCompany lblStatus2.Text = sPriorCompany
@@ -445,7 +598,7 @@ Public Class frmMain
Else Else
bAllowIcon = True bAllowIcon = True
bAllowDetails = True bAllowDetails = True
lblGameTitle.Text = oProcess.GameInfo.CroppedName lblGameTitle.Text = oProcess.GameInfo.Name
Try Try
Dim ic As Icon = System.Drawing.Icon.ExtractAssociatedIcon(oProcess.FoundProcess.MainModule.FileName) Dim ic As Icon = System.Drawing.Icon.ExtractAssociatedIcon(oProcess.FoundProcess.MainModule.FileName)
@@ -461,7 +614,7 @@ Public Class frmMain
End Try End Try
'Check for a custom icon & details 'Check for a custom icon & details
If IO.File.Exists(oProcess.GameInfo.Icon) Then If File.Exists(oProcess.GameInfo.Icon) Then
pbIcon.Image = Image.FromFile(oProcess.GameInfo.Icon) pbIcon.Image = Image.FromFile(oProcess.GameInfo.Icon)
End If End If
If sFileName = String.Empty Then If sFileName = String.Empty Then
@@ -561,6 +714,17 @@ Public Class frmMain
UpdateTimeSpent(dCurrentHours, oProcess.TimeSpent.TotalHours) UpdateTimeSpent(dCurrentHours, oProcess.TimeSpent.TotalHours)
End Sub End Sub
Private Sub HandleSession()
Dim oSession As New clsSession
'Record Session
oSession.MonitorID = oProcess.GameInfo.ID
oSession.SessionStart = oProcess.StartTime
oSession.SessionEnd = oProcess.EndTime
mgrSessions.AddSession(oSession)
End Sub
Private Function SupressBackup() As Boolean Private Function SupressBackup() As Boolean
Dim iSession As Integer Dim iSession As Integer
If oSettings.SupressBackup Then If oSettings.SupressBackup Then
@@ -650,6 +814,7 @@ Public Class frmMain
bProcessDebugMode = bDebugEnable bProcessDebugMode = bDebugEnable
mgrCommon.ShowMessage(frmMain_CommandSucess, MsgBoxStyle.Exclamation) mgrCommon.ShowMessage(frmMain_CommandSucess, MsgBoxStyle.Exclamation)
End Select End Select
Case Else Case Else
mgrCommon.ShowMessage(frmMain_ErrorCommandInvalid, sMainCommand, MsgBoxStyle.Exclamation) mgrCommon.ShowMessage(frmMain_ErrorCommandInvalid, sMainCommand, MsgBoxStyle.Exclamation)
End Select End Select
@@ -659,12 +824,13 @@ Public Class frmMain
Private Sub OpenAbout() Private Sub OpenAbout()
Dim iProcessType As System.Reflection.ProcessorArchitecture = System.Reflection.AssemblyName.GetAssemblyName(Application.ExecutablePath()).ProcessorArchitecture 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
Dim sProcessType = [Enum].GetName(GetType(System.Reflection.ProcessorArchitecture), iProcessType) Dim sProcessType = [Enum].GetName(GetType(System.Reflection.ProcessorArchitecture), iProcessType)
Dim sRevision As String = My.Application.Info.Version.Build & "." & My.Application.Info.Version.Revision Dim sRevision As String = My.Application.Info.Version.Revision
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSqliteVersion As String = oDatabase.ReportVersion
Dim sConstCopyright As String = Chr(169) & mgrCommon.FormatString(App_Copyright, Now.Year.ToString) Dim sConstCopyright As String = Chr(169) & mgrCommon.FormatString(App_Copyright, Now.Year.ToString)
mgrCommon.ShowMessage(frmMain_About, New String() {sVersion, sProcessType, sRevision, sConstCopyright}, MsgBoxStyle.Information) mgrCommon.ShowMessage(frmMain_About, New String() {mgrCommon.DisplayAppVersion, sProcessType, sRevision, sSqliteVersion, sConstCopyright}, MsgBoxStyle.Information)
End Sub End Sub
Private Sub OpenTags() Private Sub OpenTags()
@@ -712,6 +878,20 @@ Public Class frmMain
ResumeScan() ResumeScan()
End Sub 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() Private Sub OpenGameWizard()
Dim frm As New frmAddWizard Dim frm As New frmAddWizard
PauseScan() PauseScan()
@@ -754,8 +934,8 @@ Public Class frmMain
End Sub End Sub
Private Sub CheckForNewBackups() Private Sub CheckForNewBackups()
If oSettings.RestoreOnLaunch Then If oSettings.RestoreOnLaunch Or oSettings.AutoRestore Or oSettings.AutoMark Then
CheckRestore() StartRestoreCheck()
End If End If
End Sub End Sub
@@ -768,32 +948,37 @@ Public Class frmMain
End Sub End Sub
Private Sub StartSyncWatcher() Private Sub StartSyncWatcher()
If oSettings.Sync Then oFileWatcher.EnableRaisingEvents = True
oFileWatcher.EnableRaisingEvents = True
End If
End Sub End Sub
Private Sub StopSyncWatcher() Private Sub StopSyncWatcher()
If oSettings.Sync Then oFileWatcher.EnableRaisingEvents = False
oFileWatcher.EnableRaisingEvents = False
End If
End Sub End Sub
Private Sub SetupSyncWatcher() Private Sub SetupSyncWatcher()
If oSettings.Sync Then oFileWatcher.Path = oSettings.BackupFolder
oFileWatcher.Path = oSettings.BackupFolder oFileWatcher.Filter = "gbm.s3db"
oFileWatcher.Filter = "gbm.s3db" oFileWatcher.NotifyFilter = NotifyFilters.LastWrite
oFileWatcher.NotifyFilter = IO.NotifyFilters.LastWrite
End If
End Sub End Sub
Private Sub HandleSyncWatcher() Handles oFileWatcher.Changed Private Sub QueueSyncWatcher() Handles oFileWatcher.Changed
tmFileWatcherQueue.Stop()
tmFileWatcherQueue.AutoReset = False
tmFileWatcherQueue.Interval = 30000
tmFileWatcherQueue.Start()
End Sub
Private Sub HandleSyncWatcher() Handles tmFileWatcherQueue.Elapsed
tmFileWatcherQueue.Stop()
StopSyncWatcher()
If oSettings.Sync Then If oSettings.Sync Then
UpdateLog(frmMain_MasterListChanged, False, ToolTipIcon.Info, True) UpdateLog(frmMain_MasterListChanged, False, ToolTipIcon.Info, True)
SyncGameSettings() SyncGameSettings()
LoadGameSettings() LoadGameSettings()
CheckForNewBackups()
End If End If
CheckForNewBackups()
StartSyncWatcher()
End Sub End Sub
Private Sub SyncGameSettings() Private Sub SyncGameSettings()
@@ -867,40 +1052,24 @@ Public Class frmMain
End Sub End Sub
'Functions that handle buttons, menus and other GUI features on this form 'Functions that handle buttons, menus and other GUI features on this form
Private Sub ToggleLog()
If bLogToggle = False Then
txtLog.Visible = True
'Unix Handler
If mgrCommon.IsUnix Then
Me.Size = New System.Drawing.Size(Me.Size.Width, 440)
Else
Me.Size = New System.Drawing.Size(Me.Size.Width, 425)
End If
bLogToggle = True
btnLogToggle.Text = frmMain_btnToggleLog_Hide
txtLog.Select(txtLog.TextLength, 0)
txtLog.ScrollToCaret()
Else
txtLog.Visible = False
Me.Size = New System.Drawing.Size(Me.Size.Width, 245)
bLogToggle = False
btnLogToggle.Text = frmMain_btnToggleLog_Show
End If
End Sub
Private Sub ToggleState() Private Sub ToggleState()
'Toggle State with Tray Clicks 'Toggle State with Tray Clicks
If Not bShowToggle Then If Not bShowToggle Then
bShowToggle = True bShowToggle = True
Me.Visible = True Me.Visible = True
Me.WindowState = wState
Me.ShowInTaskbar = True Me.ShowInTaskbar = True
Me.Focus() Me.Focus()
Else Else
bShowToggle = False If Me.CanFocus Then
Me.Visible = False bShowToggle = False
Me.ShowInTaskbar = False wState = Me.WindowState
Me.WindowState = FormWindowState.Minimized
Me.ShowInTaskbar = False
Me.Visible = False
Else
gMonTray.ShowBalloonTip(5000, App_NameLong, App_ErrorFocus, ToolTipIcon.Info)
End If
End If End If
End Sub End Sub
@@ -991,7 +1160,7 @@ Public Class frmMain
End If End If
End Sub End Sub
Private Sub ToggleMenuEnable() Private Sub ToggleMenuEnable(Optional ByVal bGameDetected As Boolean = False)
If bMenuEnabled Then If bMenuEnabled Then
ToggleMenuItems(False, gMonFile) ToggleMenuItems(False, gMonFile)
ToggleMenuItems(False, gMonSetup) ToggleMenuItems(False, gMonSetup)
@@ -1003,6 +1172,11 @@ Public Class frmMain
gMonNotification.Enabled = False gMonNotification.Enabled = False
gMonTrayNotification.Enabled = False gMonTrayNotification.Enabled = False
gMonTraySettings.Enabled = False gMonTraySettings.Enabled = False
If Not bGameDetected Then
gMonTrayMon.Enabled = False
gMonTrayShow.Enabled = False
gMonTrayExit.Enabled = False
End If
bMenuEnabled = False bMenuEnabled = False
Else Else
ToggleMenuItems(True, gMonFile) ToggleMenuItems(True, gMonFile)
@@ -1015,6 +1189,9 @@ Public Class frmMain
gMonNotification.Enabled = True gMonNotification.Enabled = True
gMonTrayNotification.Enabled = True gMonTrayNotification.Enabled = True
gMonTraySettings.Enabled = True gMonTraySettings.Enabled = True
gMonTrayMon.Enabled = True
gMonTrayShow.Enabled = True
gMonTrayExit.Enabled = True
bMenuEnabled = True bMenuEnabled = True
End If End If
End Sub End Sub
@@ -1082,7 +1259,7 @@ Public Class frmMain
txtLog.ScrollToCaret() txtLog.ScrollToCaret()
gMonTray.BalloonTipText = sLogUpdate gMonTray.BalloonTipText = sLogUpdate
gMonTray.BalloonTipIcon = objIcon gMonTray.BalloonTipIcon = objIcon
If bTrayUpdate Then gMonTray.ShowBalloonTip(5000) If bTrayUpdate Then gMonTray.ShowBalloonTip(10000)
End If End If
Application.DoEvents() Application.DoEvents()
End Sub End Sub
@@ -1096,7 +1273,7 @@ Public Class frmMain
Private Sub SaveLog() Private Sub SaveLog()
Dim sLocation As String Dim sLocation As String
sLocation = mgrCommon.SaveFileBrowser(frmMain_ChooseLogFile, "txt", frmMain_Text, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), frmMain_DefaultLogFileName & " " & Date.Now.ToString("dd-MMM-yyyy")) sLocation = mgrCommon.SaveFileBrowser("Log_File", frmMain_ChooseLogFile, "txt", frmMain_Text, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), frmMain_DefaultLogFileName & " " & Date.Now.ToString("dd-MMM-yyyy"))
If sLocation <> String.Empty Then If sLocation <> String.Empty Then
mgrCommon.SaveText(txtLog.Text, sLocation) mgrCommon.SaveText(txtLog.Text, sLocation)
@@ -1104,6 +1281,9 @@ Public Class frmMain
End Sub End Sub
Private Sub SetForm() Private Sub SetForm()
'Set Minimum Size
Me.MinimumSize = New Size(Me.Size.Width, Me.Size.Height - txtLog.Size.Height)
'Set Form Name 'Set Form Name
Me.Name = App_NameLong Me.Name = App_NameLong
@@ -1121,6 +1301,7 @@ Public Class frmMain
gMonToolsCleanMan.Text = frmMain_gMonToolsCleanMan gMonToolsCleanMan.Text = frmMain_gMonToolsCleanMan
gMonToolsCompact.Text = frmMain_gMonToolsCompact gMonToolsCompact.Text = frmMain_gMonToolsCompact
gMonToolsLog.Text = frmMain_gMonToolsLog gMonToolsLog.Text = frmMain_gMonToolsLog
gMonToolsSessions.Text = frmMain_gMonToolsSessions
gMonLogClear.Text = frmMain_gMonLogClear gMonLogClear.Text = frmMain_gMonLogClear
gMonLogSave.Text = frmMain_gMonLogSave gMonLogSave.Text = frmMain_gMonLogSave
gMonHelp.Text = frmMain_gMonHelp gMonHelp.Text = frmMain_gMonHelp
@@ -1142,6 +1323,7 @@ Public Class frmMain
gMonTrayToolsCleanMan.Text = frmMain_gMonToolsCleanMan gMonTrayToolsCleanMan.Text = frmMain_gMonToolsCleanMan
gMonTrayToolsCompact.Text = frmMain_gMonToolsCompact gMonTrayToolsCompact.Text = frmMain_gMonToolsCompact
gMonTrayToolsLog.Text = frmMain_gMonToolsLog gMonTrayToolsLog.Text = frmMain_gMonToolsLog
gMonTrayToolsSessions.Text = frmMain_gMonToolsSessions
gMonTrayLogClear.Text = frmMain_gMonLogClear gMonTrayLogClear.Text = frmMain_gMonLogClear
gMonTrayLogSave.Text = frmMain_gMonLogSave gMonTrayLogSave.Text = frmMain_gMonLogSave
gMonTrayExit.Text = frmMain_gMonFileExit gMonTrayExit.Text = frmMain_gMonFileExit
@@ -1161,12 +1343,10 @@ Public Class frmMain
gMonStripAdminButton.ToolTipText = frmMain_RunningAsNormal gMonStripAdminButton.ToolTipText = frmMain_RunningAsNormal
End If End If
btnCancelOperation.Visible = False btnCancelOperation.Visible = False
txtLog.Visible = False
lblLastActionTitle.Visible = False lblLastActionTitle.Visible = False
lblLastAction.Text = String.Empty lblLastAction.Text = String.Empty
pbTime.SizeMode = PictureBoxSizeMode.AutoSize pbTime.SizeMode = PictureBoxSizeMode.AutoSize
pbTime.Image = Icon_Clock pbTime.Image = Icon_Clock
Me.Size = New System.Drawing.Size(Me.Size.Width, 245)
AddHandler mgrMonitorList.UpdateLog, AddressOf UpdateLog AddHandler mgrMonitorList.UpdateLog, AddressOf UpdateLog
ResetGameInfo() ResetGameInfo()
End Sub End Sub
@@ -1196,7 +1376,7 @@ Public Class frmMain
ToggleMenuText() ToggleMenuText()
End Sub End Sub
Private Sub PauseScan() Private Sub PauseScan(Optional ByVal bGameDetected As Boolean = False)
If eCurrentStatus = eStatus.Running Then If eCurrentStatus = eStatus.Running Then
StopSyncWatcher() StopSyncWatcher()
tmScanTimer.Stop() tmScanTimer.Stop()
@@ -1206,7 +1386,7 @@ Public Class frmMain
gMonTray.Icon = GBM_Tray_Detected gMonTray.Icon = GBM_Tray_Detected
End If End If
ToggleMenuText() ToggleMenuText()
ToggleMenuEnable() ToggleMenuEnable(bGameDetected)
End Sub End Sub
Private Sub ResumeScan() Private Sub ResumeScan()
@@ -1261,9 +1441,9 @@ Public Class frmMain
Dim sSettingsRoot As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "/gbm" Dim sSettingsRoot As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "/gbm"
Dim sDBLocation As String = sSettingsRoot & "/gbm.s3db" Dim sDBLocation As String = sSettingsRoot & "/gbm.s3db"
If Not IO.Directory.Exists(sSettingsRoot) Then If Not Directory.Exists(sSettingsRoot) Then
Try Try
IO.Directory.CreateDirectory(sSettingsRoot) Directory.CreateDirectory(sSettingsRoot)
Catch ex As Exception Catch ex As Exception
mgrCommon.ShowMessage(frmMain_ErrorSettingsFolder, ex.Message, MsgBoxStyle.Critical) mgrCommon.ShowMessage(frmMain_ErrorSettingsFolder, ex.Message, MsgBoxStyle.Critical)
bShutdown = True bShutdown = True
@@ -1271,7 +1451,7 @@ Public Class frmMain
End Try End Try
End If End If
If Not IO.File.Exists(sDBLocation) Then bFirstRun = True If Not File.Exists(sDBLocation) Then bFirstRun = True
End Sub End Sub
Private Sub VerifyDBVersion(ByVal iDB As mgrSQLite.Database) Private Sub VerifyDBVersion(ByVal iDB As mgrSQLite.Database)
@@ -1314,7 +1494,7 @@ Public Class frmMain
Private Sub CheckForSavedDuplicate() Private Sub CheckForSavedDuplicate()
For Each o As clsGame In oProcess.DuplicateList For Each o As clsGame In oProcess.DuplicateList
If o.ProcessPath.ToLower = oProcess.GameInfo.ProcessPath.ToLower Then If o.ProcessPath.ToLower = oProcess.GameInfo.ProcessPath.ToLower And o.Parameter = String.Empty Then
oProcess.GameInfo = o oProcess.GameInfo = o
oProcess.Duplicate = False oProcess.Duplicate = False
End If End If
@@ -1467,16 +1647,16 @@ Public Class frmMain
SaveLog() SaveLog()
End Sub 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 Private Sub gMonNotification_Click(sender As Object, e As EventArgs) Handles gMonNotification.Click, gMonTrayNotification.Click
gMonNotification.Visible = False gMonNotification.Visible = False
gMonTrayNotification.Visible = False gMonTrayNotification.Visible = False
OpenGameManager(True) OpenGameManager(True)
End Sub End Sub
Private Sub btnLogToggle_Click(sender As Object, e As EventArgs) Handles btnLogToggle.Click
ToggleLog()
End Sub
Private Sub gMonStripSplitStatusButton_ButtonClick(sender As Object, e As EventArgs) Handles gMonStripStatusButton.Click Private Sub gMonStripSplitStatusButton_ButtonClick(sender As Object, e As EventArgs) Handles gMonStripStatusButton.Click
ScanToggle() ScanToggle()
End Sub End Sub
@@ -1487,13 +1667,6 @@ Public Class frmMain
End If End If
End Sub End Sub
Private Sub gMonTray_BalloonTipClicked(sender As System.Object, e As System.EventArgs) Handles gMonTray.BalloonTipClicked
bShowToggle = True
Me.Visible = True
Me.ShowInTaskbar = True
Me.Focus()
End Sub
Private Sub btnCancelOperation_Click(sender As Object, e As EventArgs) Handles btnCancelOperation.Click Private Sub btnCancelOperation_Click(sender As Object, e As EventArgs) Handles btnCancelOperation.Click
OperationCancel() OperationCancel()
End Sub End Sub
@@ -1513,14 +1686,27 @@ Public Class frmMain
ShutdownApp() ShutdownApp()
End If End If
'Intercept Exit Select Case e.CloseReason
If bShutdown = False Then Case CloseReason.UserClosing
e.Cancel = True If bShutdown = False Then
If Not mgrCommon.IsUnix Then e.Cancel = True
bShowToggle = False If Not mgrCommon.IsUnix Then
Me.Visible = False bShowToggle = False
Me.ShowInTaskbar = False wState = Me.WindowState
End If Me.WindowState = FormWindowState.Minimized
Me.ShowInTaskbar = False
Me.Visible = False
End If
End If
Case CloseReason.TaskManagerClosing, CloseReason.WindowsShutDown
'Do nothing and let the app close without warning
End Select
End Sub
Private Sub AutoRestoreEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles tmRestoreCheck.Elapsed
If eCurrentStatus <> eStatus.Paused Then
AutoRestoreCheck()
End If End If
End Sub End Sub
@@ -1531,7 +1717,7 @@ Public Class frmMain
Dim sErrorMessage As String = String.Empty Dim sErrorMessage As String = String.Empty
If oProcess.SearchRunningProcesses(hshScanList, bNeedsPath, iErrorCode, bProcessDebugMode) Then If oProcess.SearchRunningProcesses(hshScanList, bNeedsPath, iErrorCode, bProcessDebugMode) Then
PauseScan() PauseScan(True)
If bNeedsPath Then If bNeedsPath Then
bContinue = False bContinue = False
@@ -1563,18 +1749,18 @@ Public Class frmMain
If bContinue = True Then If bContinue = True Then
CheckForSavedDuplicate() CheckForSavedDuplicate()
If oProcess.Duplicate Then If oProcess.Duplicate Then
UpdateLog(frmMain_MultipleGamesDetected, oSettings.ShowDetectionToolTips) UpdateLog(frmMain_MultipleGamesDetected, oSettings.ShowDetectionToolTips)
UpdateStatus(frmMain_MultipleGamesDetected) UpdateStatus(frmMain_MultipleGamesDetected)
SetGameInfo(True) SetGameInfo(True)
Else
UpdateLog(mgrCommon.FormatString(frmMain_GameDetected, oProcess.GameInfo.Name), oSettings.ShowDetectionToolTips)
UpdateStatus(mgrCommon.FormatString(frmMain_GameDetected, oProcess.GameInfo.CroppedName))
SetGameInfo()
End If
oProcess.StartTime = Now
bwMonitor.RunWorkerAsync()
Else Else
UpdateLog(mgrCommon.FormatString(frmMain_GameDetected, oProcess.GameInfo.Name), oSettings.ShowDetectionToolTips) StopScan()
UpdateStatus(mgrCommon.FormatString(frmMain_GameDetected, oProcess.GameInfo.CroppedName))
SetGameInfo()
End If
oProcess.StartTime = Now
bwMonitor.RunWorkerAsync()
Else
StopScan()
End If End If
End If End If
End Sub End Sub
@@ -1609,6 +1795,7 @@ Public Class frmMain
Else Else
bContinue = False bContinue = False
If oSettings.TimeTracking Then HandleTimeSpent() If oSettings.TimeTracking Then HandleTimeSpent()
If oSettings.SessionTracking Then HandleSession()
UpdateLog(mgrCommon.FormatString(frmMain_ErrorBackupUnknownPath, oProcess.GameInfo.Name), False) UpdateLog(mgrCommon.FormatString(frmMain_ErrorBackupUnknownPath, oProcess.GameInfo.Name), False)
oProcess.GameInfo = Nothing oProcess.GameInfo = Nothing
ResetGameInfo() ResetGameInfo()
@@ -1620,6 +1807,7 @@ Public Class frmMain
If DoMultiGameCheck() Then If DoMultiGameCheck() Then
UpdateLog(mgrCommon.FormatString(frmMain_GameEnded, oProcess.GameInfo.Name), False) UpdateLog(mgrCommon.FormatString(frmMain_GameEnded, oProcess.GameInfo.Name), False)
If oSettings.TimeTracking Then HandleTimeSpent() If oSettings.TimeTracking Then HandleTimeSpent()
If oSettings.SessionTracking Then HandleSession()
RunBackup() RunBackup()
Else Else
UpdateLog(frmMain_UnknownGameEnded, False) UpdateLog(frmMain_UnknownGameEnded, False)
@@ -1686,14 +1874,18 @@ Public Class frmMain
End If End If
End Sub End Sub
Private Sub txtGameInfo_Enter(sender As Object, e As EventArgs)
btnLogToggle.Focus()
End Sub
Private Sub frmMain_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown Private Sub frmMain_KeyDown(sender As Object, e As KeyEventArgs) Handles MyBase.KeyDown
If e.KeyCode = Keys.Oemtilde AndAlso e.Modifiers = Keys.Control Then If e.KeyCode = Keys.Oemtilde AndAlso e.Modifiers = Keys.Control Then
OpenDevConsole() OpenDevConsole()
End If End If
End Sub End Sub
'This event handler lets the user clear focus from the log by clicking anywhere on the form.
'Due to txtLog being the only focusable control in most cases, it's impossible for it to lose focus unless a change is forced.
Private Sub ClearLogFocus(sender As Object, e As EventArgs) Handles MyBase.Click, lblGameTitle.Click, lblStatus1.Click, lblStatus2.Click,
lblStatus3.Click, pbTime.Click, lblTimeSpent.Click, lblLastActionTitle.Click, lblLastAction.Click, gMonMainMenu.Click, gMonStatusStrip.Click
'Move focus to first label
lblGameTitle.Focus()
End Sub
End Class End Class
-105
View File
@@ -1,105 +0,0 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmManifestViewer
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
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.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.dgView = New System.Windows.Forms.DataGridView()
Me.btnCancel = New System.Windows.Forms.Button()
Me.lblError = New System.Windows.Forms.Label()
Me.fbBrowser = New System.Windows.Forms.FolderBrowserDialog()
Me.cboManifest = New System.Windows.Forms.ComboBox()
CType(Me.dgView, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'dgView
'
Me.dgView.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.dgView.AutoSizeColumnsMode = System.Windows.Forms.DataGridViewAutoSizeColumnsMode.Fill
Me.dgView.BackgroundColor = System.Drawing.SystemColors.Window
Me.dgView.ColumnHeadersHeightSizeMode = System.Windows.Forms.DataGridViewColumnHeadersHeightSizeMode.AutoSize
Me.dgView.Location = New System.Drawing.Point(12, 12)
Me.dgView.Name = "dgView"
Me.dgView.RowHeadersVisible = False
Me.dgView.Size = New System.Drawing.Size(960, 338)
Me.dgView.TabIndex = 0
'
'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(897, 356)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
Me.btnCancel.TabIndex = 2
Me.btnCancel.Text = "C&lose"
Me.btnCancel.UseVisualStyleBackColor = True
'
'lblError
'
Me.lblError.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.lblError.AutoSize = True
Me.lblError.Location = New System.Drawing.Point(139, 362)
Me.lblError.Name = "lblError"
Me.lblError.Size = New System.Drawing.Size(54, 13)
Me.lblError.TabIndex = 5
Me.lblError.Text = "Info Label"
'
'fbBrowser
'
Me.fbBrowser.ShowNewFolderButton = False
'
'cboManifest
'
Me.cboManifest.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left), System.Windows.Forms.AnchorStyles)
Me.cboManifest.FormattingEnabled = True
Me.cboManifest.Location = New System.Drawing.Point(12, 359)
Me.cboManifest.Name = "cboManifest"
Me.cboManifest.Size = New System.Drawing.Size(121, 21)
Me.cboManifest.TabIndex = 6
'
'frmManifestViewer
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(984, 392)
Me.Controls.Add(Me.cboManifest)
Me.Controls.Add(Me.lblError)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.dgView)
Me.MinimizeBox = False
Me.Name = "frmManifestViewer"
Me.ShowIcon = False
Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Manifest Viewer"
CType(Me.dgView, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents dgView As System.Windows.Forms.DataGridView
Friend WithEvents btnCancel As System.Windows.Forms.Button
Friend WithEvents lblError As System.Windows.Forms.Label
Friend WithEvents fbBrowser As System.Windows.Forms.FolderBrowserDialog
Friend WithEvents cboManifest As System.Windows.Forms.ComboBox
End Class
-149
View File
@@ -1,149 +0,0 @@
Public Class frmManifestViewer
Private bShutdown As Boolean = False
Private oLocalManifest As SortedList
Private oRemoteManfiest As SortedList
Private oRestoreInfo As clsBackup
Private oDataTable As DataTable
Property RestoreInfo As clsBackup
Get
Return oRestoreInfo
End Get
Set(value As clsBackup)
oRestoreInfo = value
End Set
End Property
Property LocalManifestData As SortedList
Get
Return oLocalManifest
End Get
Set(value As SortedList)
oLocalManifest = value
End Set
End Property
Property RemoteManifestData As SortedList
Get
Return oRemoteManfiest
End Get
Set(value As SortedList)
oRemoteManfiest = value
End Set
End Property
Private Sub FormatManifest(ByVal iManifest As Integer)
Dim oRow As Object()
Dim oLoadData As SortedList
If iManifest = 1 Then
oLoadData = LocalManifestData
Else
oLoadData = RemoteManifestData
End If
oDataTable = New DataTable
'Setup Columns
oDataTable.Columns.Add("Name")
oDataTable.Columns.Add("Backup Path")
oDataTable.Columns.Add("Restore Path")
oDataTable.Columns.Add("Absolute Path")
oDataTable.Columns.Add("Date Updated")
oDataTable.Columns.Add("Updated By")
'Setup Data Types
oDataTable.Columns(0).DataType = GetType(String)
oDataTable.Columns(1).DataType = GetType(String)
oDataTable.Columns(2).DataType = GetType(String)
oDataTable.Columns(3).DataType = GetType(Boolean)
oDataTable.Columns(4).DataType = GetType(DateTime)
oDataTable.Columns(5).DataType = GetType(String)
For Each o As clsBackup In oLoadData.Values
oRow = New Object() {o.Name, o.FileName, o.RestorePath, o.AbsolutePath, o.DateUpdated, o.UpdatedBy}
oDataTable.Rows.Add(oRow)
Next
'Sort
oDataTable.DefaultView.Sort = "Name asc"
dgView.DataSource = oDataTable
'Setup Column Widths
dgView.Columns(0).MinimumWidth = 100
dgView.Columns(1).MinimumWidth = 175
dgView.Columns(2).MinimumWidth = 175
dgView.Columns(3).MinimumWidth = 60
dgView.Columns(4).MinimumWidth = 125
dgView.Columns(5).MinimumWidth = 100
dgView.Columns(0).FillWeight = 100
dgView.Columns(1).FillWeight = 100
dgView.Columns(2).FillWeight = 100
dgView.Columns(3).FillWeight = 25
dgView.Columns(4).FillWeight = 50
dgView.Columns(5).FillWeight = 50
End Sub
Private Sub LoadCombo()
Dim oCombo As New List(Of KeyValuePair(Of Integer, String))
oCombo.Add(New KeyValuePair(Of Integer, String)(1, "Local Manifest"))
oCombo.Add(New KeyValuePair(Of Integer, String)(2, "Remote Manifest"))
cboManifest.DataSource = oCombo
cboManifest.ValueMember = "key"
cboManifest.DisplayMember = "value"
End Sub
Private Sub frmManifestInfo_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
dgView.ReadOnly = True
dgView.AllowUserToAddRows = False
lblError.Text = String.Empty
LoadCombo()
FormatManifest(CInt(cboManifest.SelectedValue))
End Sub
Private Sub dgView_CellStateChanged(sender As Object, e As DataGridViewCellStateChangedEventArgs) Handles dgView.CellStateChanged
lblError.ForeColor = Color.Black
Select Case dgView.Columns(e.Cell.ColumnIndex).Index
Case 0
lblError.Text = "The name of the application."
Case 1
lblError.Text = "The location of the backup file to restore."
Case 2
lblError.Text = "When the backup file was updated from this computer."
Case 3
lblError.Text = "The name of this computer."
Case 4
lblError.Text = "When the local backup file was last updated."
Case 5
lblError.Text = "The name of the computer that performed the last backup."
End Select
End Sub
Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
Me.Close()
End Sub
Private Sub frmGameInfo_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
If Not bShutdown Then
If MsgBox("Are you sure you want to close?", MsgBoxStyle.YesNo, "ABM") = MsgBoxResult.Yes Then
bShutdown = True
End If
End If
If Not bShutdown Then
e.Cancel = True
End If
End Sub
Private Sub cboManifest_SelectionChangeCommitted(sender As Object, e As EventArgs) Handles cboManifest.SelectionChangeCommitted
FormatManifest(CInt(cboManifest.SelectedValue))
End Sub
End Class
+173
View File
@@ -0,0 +1,173 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmSessions
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
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.
<System.Diagnostics.DebuggerStepThrough()> _
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
@@ -117,7 +117,4 @@
<resheader name="writer"> <resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader> </resheader>
<metadata name="fbBrowser.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>17, 17</value>
</metadata>
</root> </root>
+153
View File
@@ -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
+154 -109
View File
@@ -23,7 +23,6 @@ Partial Class frmSettings
<System.Diagnostics.DebuggerStepThrough()> _ <System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent() Private Sub InitializeComponent()
Me.chkMonitorOnStartup = New System.Windows.Forms.CheckBox() Me.chkMonitorOnStartup = New System.Windows.Forms.CheckBox()
Me.chkBackupConfirm = New System.Windows.Forms.CheckBox()
Me.grpStartup = New System.Windows.Forms.GroupBox() Me.grpStartup = New System.Windows.Forms.GroupBox()
Me.chkStartWindows = New System.Windows.Forms.CheckBox() Me.chkStartWindows = New System.Windows.Forms.CheckBox()
Me.chkStartToTray = New System.Windows.Forms.CheckBox() Me.chkStartToTray = New System.Windows.Forms.CheckBox()
@@ -39,12 +38,6 @@ Partial Class frmSettings
Me.chkCreateFolder = New System.Windows.Forms.CheckBox() Me.chkCreateFolder = New System.Windows.Forms.CheckBox()
Me.btnSave = New System.Windows.Forms.Button() Me.btnSave = New System.Windows.Forms.Button()
Me.btnCancel = New System.Windows.Forms.Button() Me.btnCancel = New System.Windows.Forms.Button()
Me.lblMinutes = New System.Windows.Forms.Label()
Me.nudSupressBackupThreshold = New System.Windows.Forms.NumericUpDown()
Me.chkSupressBackup = New System.Windows.Forms.CheckBox()
Me.chkCheckSum = New System.Windows.Forms.CheckBox()
Me.chkRestoreOnLaunch = New System.Windows.Forms.CheckBox()
Me.chkOverwriteWarning = New System.Windows.Forms.CheckBox()
Me.grp7zGeneral = New System.Windows.Forms.GroupBox() Me.grp7zGeneral = New System.Windows.Forms.GroupBox()
Me.cboCompression = New System.Windows.Forms.ComboBox() Me.cboCompression = New System.Windows.Forms.ComboBox()
Me.lblCompression = New System.Windows.Forms.Label() Me.lblCompression = New System.Windows.Forms.Label()
@@ -57,17 +50,28 @@ Partial Class frmSettings
Me.lbl7zProduct = New System.Windows.Forms.Label() Me.lbl7zProduct = New System.Windows.Forms.Label()
Me.btnDefaults = New System.Windows.Forms.Button() Me.btnDefaults = New System.Windows.Forms.Button()
Me.pnlBackup = New System.Windows.Forms.Panel() Me.pnlBackup = New System.Windows.Forms.Panel()
Me.lblMinutes = New System.Windows.Forms.Label()
Me.nudSupressBackupThreshold = New System.Windows.Forms.NumericUpDown()
Me.chkSupressBackup = New System.Windows.Forms.CheckBox()
Me.chkBackupConfirm = New System.Windows.Forms.CheckBox()
Me.chkOverwriteWarning = New System.Windows.Forms.CheckBox()
Me.grpBackupHandling = New System.Windows.Forms.GroupBox()
Me.chkAutoRestore = New System.Windows.Forms.CheckBox()
Me.chkRestoreNotify = New System.Windows.Forms.CheckBox()
Me.chkAutoMark = New System.Windows.Forms.CheckBox()
Me.pnl7z = New System.Windows.Forms.Panel() Me.pnl7z = New System.Windows.Forms.Panel()
Me.grp7zAdvanced = New System.Windows.Forms.GroupBox() Me.grp7zAdvanced = New System.Windows.Forms.GroupBox()
Me.grp7zInformation = New System.Windows.Forms.GroupBox() Me.grp7zInformation = New System.Windows.Forms.GroupBox()
Me.pnlGeneral = New System.Windows.Forms.Panel() Me.pnlGeneral = New System.Windows.Forms.Panel()
Me.grpGameData = New System.Windows.Forms.GroupBox() Me.grpGameData = New System.Windows.Forms.GroupBox()
Me.lstSettings = New System.Windows.Forms.ListBox() Me.lstSettings = New System.Windows.Forms.ListBox()
Me.chkSessionTracking = New System.Windows.Forms.CheckBox()
Me.grpStartup.SuspendLayout() Me.grpStartup.SuspendLayout()
Me.grpFolderOptions.SuspendLayout() Me.grpFolderOptions.SuspendLayout()
CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).BeginInit()
Me.grp7zGeneral.SuspendLayout() Me.grp7zGeneral.SuspendLayout()
Me.pnlBackup.SuspendLayout() Me.pnlBackup.SuspendLayout()
CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).BeginInit()
Me.grpBackupHandling.SuspendLayout()
Me.pnl7z.SuspendLayout() Me.pnl7z.SuspendLayout()
Me.grp7zAdvanced.SuspendLayout() Me.grp7zAdvanced.SuspendLayout()
Me.grp7zInformation.SuspendLayout() Me.grp7zInformation.SuspendLayout()
@@ -85,16 +89,6 @@ Partial Class frmSettings
Me.chkMonitorOnStartup.Text = "Start monitoring at launch" Me.chkMonitorOnStartup.Text = "Start monitoring at launch"
Me.chkMonitorOnStartup.UseVisualStyleBackColor = True Me.chkMonitorOnStartup.UseVisualStyleBackColor = True
' '
'chkBackupConfirm
'
Me.chkBackupConfirm.AutoSize = True
Me.chkBackupConfirm.Location = New System.Drawing.Point(6, 88)
Me.chkBackupConfirm.Name = "chkBackupConfirm"
Me.chkBackupConfirm.Size = New System.Drawing.Size(160, 17)
Me.chkBackupConfirm.TabIndex = 1
Me.chkBackupConfirm.Text = "Disable backup confirmation"
Me.chkBackupConfirm.UseVisualStyleBackColor = True
'
'grpStartup 'grpStartup
' '
Me.grpStartup.Controls.Add(Me.chkStartWindows) Me.grpStartup.Controls.Add(Me.chkStartWindows)
@@ -130,19 +124,19 @@ Partial Class frmSettings
'chkAutoSaveLog 'chkAutoSaveLog
' '
Me.chkAutoSaveLog.AutoSize = True 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.Name = "chkAutoSaveLog"
Me.chkAutoSaveLog.Size = New System.Drawing.Size(231, 17) Me.chkAutoSaveLog.Size = New System.Drawing.Size(231, 17)
Me.chkAutoSaveLog.TabIndex = 7 Me.chkAutoSaveLog.TabIndex = 3
Me.chkAutoSaveLog.Text = "Autosave log when max length is exceeded" Me.chkAutoSaveLog.Text = "Autosave log when max length is exceeded"
Me.chkAutoSaveLog.UseVisualStyleBackColor = True Me.chkAutoSaveLog.UseVisualStyleBackColor = True
' '
'btnOptionalFields '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.Name = "btnOptionalFields"
Me.btnOptionalFields.Size = New System.Drawing.Size(134, 23) Me.btnOptionalFields.Size = New System.Drawing.Size(134, 23)
Me.btnOptionalFields.TabIndex = 6 Me.btnOptionalFields.TabIndex = 2
Me.btnOptionalFields.Text = "Choose &Optional Fields..." Me.btnOptionalFields.Text = "Choose &Optional Fields..."
Me.btnOptionalFields.UseVisualStyleBackColor = True Me.btnOptionalFields.UseVisualStyleBackColor = True
' '
@@ -152,27 +146,27 @@ Partial Class frmSettings
Me.chkTimeTracking.Location = New System.Drawing.Point(6, 19) Me.chkTimeTracking.Location = New System.Drawing.Point(6, 19)
Me.chkTimeTracking.Name = "chkTimeTracking" Me.chkTimeTracking.Name = "chkTimeTracking"
Me.chkTimeTracking.Size = New System.Drawing.Size(122, 17) Me.chkTimeTracking.Size = New System.Drawing.Size(122, 17)
Me.chkTimeTracking.TabIndex = 4 Me.chkTimeTracking.TabIndex = 0
Me.chkTimeTracking.Text = "Enable time tracking" Me.chkTimeTracking.Text = "Enable time tracking"
Me.chkTimeTracking.UseVisualStyleBackColor = True Me.chkTimeTracking.UseVisualStyleBackColor = True
' '
'chkSync 'chkSync
' '
Me.chkSync.AutoSize = True 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.Name = "chkSync"
Me.chkSync.Size = New System.Drawing.Size(98, 17) Me.chkSync.Size = New System.Drawing.Size(98, 17)
Me.chkSync.TabIndex = 5 Me.chkSync.TabIndex = 1
Me.chkSync.Text = "Enable syncing" Me.chkSync.Text = "Enable syncing"
Me.chkSync.UseVisualStyleBackColor = True Me.chkSync.UseVisualStyleBackColor = True
' '
'chkShowDetectionTips 'chkShowDetectionTips
' '
Me.chkShowDetectionTips.AutoSize = True 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.Name = "chkShowDetectionTips"
Me.chkShowDetectionTips.Size = New System.Drawing.Size(159, 17) Me.chkShowDetectionTips.Size = New System.Drawing.Size(159, 17)
Me.chkShowDetectionTips.TabIndex = 3 Me.chkShowDetectionTips.TabIndex = 2
Me.chkShowDetectionTips.Text = "Show detection notifications" Me.chkShowDetectionTips.Text = "Show detection notifications"
Me.chkShowDetectionTips.UseVisualStyleBackColor = True Me.chkShowDetectionTips.UseVisualStyleBackColor = True
' '
@@ -185,7 +179,7 @@ Partial Class frmSettings
Me.grpFolderOptions.Location = New System.Drawing.Point(6, 12) Me.grpFolderOptions.Location = New System.Drawing.Point(6, 12)
Me.grpFolderOptions.Name = "grpFolderOptions" Me.grpFolderOptions.Name = "grpFolderOptions"
Me.grpFolderOptions.Size = New System.Drawing.Size(354, 70) Me.grpFolderOptions.Size = New System.Drawing.Size(354, 70)
Me.grpFolderOptions.TabIndex = 1 Me.grpFolderOptions.TabIndex = 0
Me.grpFolderOptions.TabStop = False Me.grpFolderOptions.TabStop = False
Me.grpFolderOptions.Text = "Folders" Me.grpFolderOptions.Text = "Folders"
' '
@@ -194,7 +188,7 @@ Partial Class frmSettings
Me.btnBackupFolder.Location = New System.Drawing.Point(313, 17) Me.btnBackupFolder.Location = New System.Drawing.Point(313, 17)
Me.btnBackupFolder.Name = "btnBackupFolder" Me.btnBackupFolder.Name = "btnBackupFolder"
Me.btnBackupFolder.Size = New System.Drawing.Size(27, 20) Me.btnBackupFolder.Size = New System.Drawing.Size(27, 20)
Me.btnBackupFolder.TabIndex = 2 Me.btnBackupFolder.TabIndex = 1
Me.btnBackupFolder.Text = "..." Me.btnBackupFolder.Text = "..."
Me.btnBackupFolder.UseVisualStyleBackColor = True Me.btnBackupFolder.UseVisualStyleBackColor = True
' '
@@ -212,7 +206,7 @@ Partial Class frmSettings
Me.txtBackupFolder.Location = New System.Drawing.Point(91, 17) Me.txtBackupFolder.Location = New System.Drawing.Point(91, 17)
Me.txtBackupFolder.Name = "txtBackupFolder" Me.txtBackupFolder.Name = "txtBackupFolder"
Me.txtBackupFolder.Size = New System.Drawing.Size(216, 20) Me.txtBackupFolder.Size = New System.Drawing.Size(216, 20)
Me.txtBackupFolder.TabIndex = 1 Me.txtBackupFolder.TabIndex = 0
' '
'chkCreateFolder 'chkCreateFolder
' '
@@ -220,7 +214,7 @@ Partial Class frmSettings
Me.chkCreateFolder.Location = New System.Drawing.Point(9, 43) Me.chkCreateFolder.Location = New System.Drawing.Point(9, 43)
Me.chkCreateFolder.Name = "chkCreateFolder" Me.chkCreateFolder.Name = "chkCreateFolder"
Me.chkCreateFolder.Size = New System.Drawing.Size(186, 17) Me.chkCreateFolder.Size = New System.Drawing.Size(186, 17)
Me.chkCreateFolder.TabIndex = 3 Me.chkCreateFolder.TabIndex = 2
Me.chkCreateFolder.Text = "Create a sub-folder for each game" Me.chkCreateFolder.Text = "Create a sub-folder for each game"
Me.chkCreateFolder.UseVisualStyleBackColor = True Me.chkCreateFolder.UseVisualStyleBackColor = True
' '
@@ -244,63 +238,6 @@ Partial Class frmSettings
Me.btnCancel.Text = "&Cancel" Me.btnCancel.Text = "&Cancel"
Me.btnCancel.UseVisualStyleBackColor = True Me.btnCancel.UseVisualStyleBackColor = True
' '
'lblMinutes
'
Me.lblMinutes.AutoSize = True
Me.lblMinutes.Location = New System.Drawing.Point(286, 181)
Me.lblMinutes.Name = "lblMinutes"
Me.lblMinutes.Size = New System.Drawing.Size(43, 13)
Me.lblMinutes.TabIndex = 7
Me.lblMinutes.Text = "minutes"
'
'nudSupressBackupThreshold
'
Me.nudSupressBackupThreshold.Location = New System.Drawing.Point(229, 179)
Me.nudSupressBackupThreshold.Maximum = New Decimal(New Integer() {999, 0, 0, 0})
Me.nudSupressBackupThreshold.Name = "nudSupressBackupThreshold"
Me.nudSupressBackupThreshold.Size = New System.Drawing.Size(51, 20)
Me.nudSupressBackupThreshold.TabIndex = 6
'
'chkSupressBackup
'
Me.chkSupressBackup.AutoSize = True
Me.chkSupressBackup.Location = New System.Drawing.Point(6, 180)
Me.chkSupressBackup.Name = "chkSupressBackup"
Me.chkSupressBackup.Size = New System.Drawing.Size(217, 17)
Me.chkSupressBackup.TabIndex = 5
Me.chkSupressBackup.Text = "Backup only when session time exceeds"
Me.chkSupressBackup.UseVisualStyleBackColor = True
'
'chkCheckSum
'
Me.chkCheckSum.AutoSize = True
Me.chkCheckSum.Location = New System.Drawing.Point(6, 134)
Me.chkCheckSum.Name = "chkCheckSum"
Me.chkCheckSum.Size = New System.Drawing.Size(195, 17)
Me.chkCheckSum.TabIndex = 3
Me.chkCheckSum.Text = "Verify backup files with a checksum"
Me.chkCheckSum.UseVisualStyleBackColor = True
'
'chkRestoreOnLaunch
'
Me.chkRestoreOnLaunch.AutoSize = True
Me.chkRestoreOnLaunch.Location = New System.Drawing.Point(6, 157)
Me.chkRestoreOnLaunch.Name = "chkRestoreOnLaunch"
Me.chkRestoreOnLaunch.Size = New System.Drawing.Size(257, 17)
Me.chkRestoreOnLaunch.TabIndex = 4
Me.chkRestoreOnLaunch.Text = "Notify when there are new backup files to restore"
Me.chkRestoreOnLaunch.UseVisualStyleBackColor = True
'
'chkOverwriteWarning
'
Me.chkOverwriteWarning.AutoSize = True
Me.chkOverwriteWarning.Location = New System.Drawing.Point(6, 111)
Me.chkOverwriteWarning.Name = "chkOverwriteWarning"
Me.chkOverwriteWarning.Size = New System.Drawing.Size(139, 17)
Me.chkOverwriteWarning.TabIndex = 2
Me.chkOverwriteWarning.Text = "Show overwrite warning"
Me.chkOverwriteWarning.UseVisualStyleBackColor = True
'
'grp7zGeneral 'grp7zGeneral
' '
Me.grp7zGeneral.Controls.Add(Me.cboCompression) Me.grp7zGeneral.Controls.Add(Me.cboCompression)
@@ -319,7 +256,7 @@ Partial Class frmSettings
Me.cboCompression.Location = New System.Drawing.Point(110, 17) Me.cboCompression.Location = New System.Drawing.Point(110, 17)
Me.cboCompression.Name = "cboCompression" Me.cboCompression.Name = "cboCompression"
Me.cboCompression.Size = New System.Drawing.Size(238, 21) Me.cboCompression.Size = New System.Drawing.Size(238, 21)
Me.cboCompression.TabIndex = 1 Me.cboCompression.TabIndex = 0
' '
'lblCompression 'lblCompression
' '
@@ -335,7 +272,7 @@ Partial Class frmSettings
Me.btn7zLocation.Location = New System.Drawing.Point(313, 41) Me.btn7zLocation.Location = New System.Drawing.Point(313, 41)
Me.btn7zLocation.Name = "btn7zLocation" Me.btn7zLocation.Name = "btn7zLocation"
Me.btn7zLocation.Size = New System.Drawing.Size(27, 20) Me.btn7zLocation.Size = New System.Drawing.Size(27, 20)
Me.btn7zLocation.TabIndex = 5 Me.btn7zLocation.TabIndex = 2
Me.btn7zLocation.Text = "..." Me.btn7zLocation.Text = "..."
Me.btn7zLocation.UseVisualStyleBackColor = True Me.btn7zLocation.UseVisualStyleBackColor = True
' '
@@ -344,7 +281,7 @@ Partial Class frmSettings
Me.txt7zLocation.Location = New System.Drawing.Point(110, 41) Me.txt7zLocation.Location = New System.Drawing.Point(110, 41)
Me.txt7zLocation.Name = "txt7zLocation" Me.txt7zLocation.Name = "txt7zLocation"
Me.txt7zLocation.Size = New System.Drawing.Size(197, 20) Me.txt7zLocation.Size = New System.Drawing.Size(197, 20)
Me.txt7zLocation.TabIndex = 4 Me.txt7zLocation.TabIndex = 1
' '
'lblLocation 'lblLocation
' '
@@ -360,7 +297,7 @@ Partial Class frmSettings
Me.txt7zArguments.Location = New System.Drawing.Point(110, 15) Me.txt7zArguments.Location = New System.Drawing.Point(110, 15)
Me.txt7zArguments.Name = "txt7zArguments" Me.txt7zArguments.Name = "txt7zArguments"
Me.txt7zArguments.Size = New System.Drawing.Size(238, 20) Me.txt7zArguments.Size = New System.Drawing.Size(238, 20)
Me.txt7zArguments.TabIndex = 3 Me.txt7zArguments.TabIndex = 0
' '
'lblArguments 'lblArguments
' '
@@ -402,17 +339,109 @@ Partial Class frmSettings
' '
Me.pnlBackup.Controls.Add(Me.lblMinutes) Me.pnlBackup.Controls.Add(Me.lblMinutes)
Me.pnlBackup.Controls.Add(Me.nudSupressBackupThreshold) Me.pnlBackup.Controls.Add(Me.nudSupressBackupThreshold)
Me.pnlBackup.Controls.Add(Me.grpFolderOptions)
Me.pnlBackup.Controls.Add(Me.chkSupressBackup) Me.pnlBackup.Controls.Add(Me.chkSupressBackup)
Me.pnlBackup.Controls.Add(Me.chkBackupConfirm) Me.pnlBackup.Controls.Add(Me.chkBackupConfirm)
Me.pnlBackup.Controls.Add(Me.chkCheckSum)
Me.pnlBackup.Controls.Add(Me.chkOverwriteWarning) Me.pnlBackup.Controls.Add(Me.chkOverwriteWarning)
Me.pnlBackup.Controls.Add(Me.chkRestoreOnLaunch) Me.pnlBackup.Controls.Add(Me.grpBackupHandling)
Me.pnlBackup.Controls.Add(Me.grpFolderOptions)
Me.pnlBackup.Location = New System.Drawing.Point(180, 0) Me.pnlBackup.Location = New System.Drawing.Point(180, 0)
Me.pnlBackup.Name = "pnlBackup" Me.pnlBackup.Name = "pnlBackup"
Me.pnlBackup.Size = New System.Drawing.Size(367, 314) Me.pnlBackup.Size = New System.Drawing.Size(367, 314)
Me.pnlBackup.TabIndex = 3 Me.pnlBackup.TabIndex = 3
' '
'lblMinutes
'
Me.lblMinutes.AutoSize = True
Me.lblMinutes.Location = New System.Drawing.Point(286, 228)
Me.lblMinutes.Name = "lblMinutes"
Me.lblMinutes.Size = New System.Drawing.Size(43, 13)
Me.lblMinutes.TabIndex = 14
Me.lblMinutes.Text = "minutes"
'
'nudSupressBackupThreshold
'
Me.nudSupressBackupThreshold.Location = New System.Drawing.Point(229, 226)
Me.nudSupressBackupThreshold.Maximum = New Decimal(New Integer() {999, 0, 0, 0})
Me.nudSupressBackupThreshold.Name = "nudSupressBackupThreshold"
Me.nudSupressBackupThreshold.Size = New System.Drawing.Size(51, 20)
Me.nudSupressBackupThreshold.TabIndex = 5
'
'chkSupressBackup
'
Me.chkSupressBackup.AutoSize = True
Me.chkSupressBackup.Location = New System.Drawing.Point(6, 228)
Me.chkSupressBackup.Name = "chkSupressBackup"
Me.chkSupressBackup.Size = New System.Drawing.Size(217, 17)
Me.chkSupressBackup.TabIndex = 4
Me.chkSupressBackup.Text = "Backup only when session time exceeds"
Me.chkSupressBackup.UseVisualStyleBackColor = True
'
'chkBackupConfirm
'
Me.chkBackupConfirm.AutoSize = True
Me.chkBackupConfirm.Location = New System.Drawing.Point(6, 180)
Me.chkBackupConfirm.Name = "chkBackupConfirm"
Me.chkBackupConfirm.Size = New System.Drawing.Size(160, 17)
Me.chkBackupConfirm.TabIndex = 2
Me.chkBackupConfirm.Text = "Disable backup confirmation"
Me.chkBackupConfirm.UseVisualStyleBackColor = True
'
'chkOverwriteWarning
'
Me.chkOverwriteWarning.AutoSize = True
Me.chkOverwriteWarning.Location = New System.Drawing.Point(6, 204)
Me.chkOverwriteWarning.Name = "chkOverwriteWarning"
Me.chkOverwriteWarning.Size = New System.Drawing.Size(139, 17)
Me.chkOverwriteWarning.TabIndex = 3
Me.chkOverwriteWarning.Text = "Show overwrite warning"
Me.chkOverwriteWarning.UseVisualStyleBackColor = True
'
'grpBackupHandling
'
Me.grpBackupHandling.Controls.Add(Me.chkAutoRestore)
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)
Me.grpBackupHandling.Name = "grpBackupHandling"
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
Me.grpBackupHandling.Text = "Backup Handling"
'
'chkAutoRestore
'
Me.chkAutoRestore.AutoSize = True
Me.chkAutoRestore.Location = New System.Drawing.Point(8, 41)
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
Me.chkAutoRestore.Text = "Automatically restore new backups"
Me.chkAutoRestore.UseVisualStyleBackColor = True
'
'chkRestoreNotify
'
Me.chkRestoreNotify.AutoSize = True
Me.chkRestoreNotify.Location = New System.Drawing.Point(8, 19)
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
Me.chkRestoreNotify.Text = "Display notifications about new backups"
Me.chkRestoreNotify.UseVisualStyleBackColor = True
'
'chkAutoMark
'
Me.chkAutoMark.AutoSize = True
Me.chkAutoMark.Location = New System.Drawing.Point(8, 63)
Me.chkAutoMark.Name = "chkAutoMark"
Me.chkAutoMark.Size = New System.Drawing.Size(321, 17)
Me.chkAutoMark.TabIndex = 2
Me.chkAutoMark.Text = "Automatically mark new backups as restored when appropriate"
Me.chkAutoMark.UseVisualStyleBackColor = True
'
'pnl7z 'pnl7z
' '
Me.pnl7z.Controls.Add(Me.grp7zAdvanced) Me.pnl7z.Controls.Add(Me.grp7zAdvanced)
@@ -433,7 +462,7 @@ Partial Class frmSettings
Me.grp7zAdvanced.Location = New System.Drawing.Point(6, 68) Me.grp7zAdvanced.Location = New System.Drawing.Point(6, 68)
Me.grp7zAdvanced.Name = "grp7zAdvanced" Me.grp7zAdvanced.Name = "grp7zAdvanced"
Me.grp7zAdvanced.Size = New System.Drawing.Size(354, 73) Me.grp7zAdvanced.Size = New System.Drawing.Size(354, 73)
Me.grp7zAdvanced.TabIndex = 2 Me.grp7zAdvanced.TabIndex = 1
Me.grp7zAdvanced.TabStop = False Me.grp7zAdvanced.TabStop = False
Me.grp7zAdvanced.Text = "Advanced" Me.grp7zAdvanced.Text = "Advanced"
' '
@@ -444,7 +473,7 @@ Partial Class frmSettings
Me.grp7zInformation.Location = New System.Drawing.Point(6, 146) Me.grp7zInformation.Location = New System.Drawing.Point(6, 146)
Me.grp7zInformation.Name = "grp7zInformation" Me.grp7zInformation.Name = "grp7zInformation"
Me.grp7zInformation.Size = New System.Drawing.Size(354, 63) Me.grp7zInformation.Size = New System.Drawing.Size(354, 63)
Me.grp7zInformation.TabIndex = 1 Me.grp7zInformation.TabIndex = 2
Me.grp7zInformation.TabStop = False Me.grp7zInformation.TabStop = False
Me.grp7zInformation.Text = "Utility Information" Me.grp7zInformation.Text = "Utility Information"
' '
@@ -461,12 +490,13 @@ Partial Class frmSettings
' '
'grpGameData 'grpGameData
' '
Me.grpGameData.Controls.Add(Me.chkSessionTracking)
Me.grpGameData.Controls.Add(Me.chkTimeTracking) Me.grpGameData.Controls.Add(Me.chkTimeTracking)
Me.grpGameData.Controls.Add(Me.chkSync) Me.grpGameData.Controls.Add(Me.chkSync)
Me.grpGameData.Controls.Add(Me.btnOptionalFields) Me.grpGameData.Controls.Add(Me.btnOptionalFields)
Me.grpGameData.Location = New System.Drawing.Point(6, 106) Me.grpGameData.Location = New System.Drawing.Point(6, 106)
Me.grpGameData.Name = "grpGameData" 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.TabIndex = 1
Me.grpGameData.TabStop = False Me.grpGameData.TabStop = False
Me.grpGameData.Text = "Game Data" Me.grpGameData.Text = "Game Data"
@@ -479,18 +509,28 @@ Partial Class frmSettings
Me.lstSettings.Size = New System.Drawing.Size(162, 303) Me.lstSettings.Size = New System.Drawing.Size(162, 303)
Me.lstSettings.TabIndex = 0 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 'frmSettings
' '
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(554, 361) Me.ClientSize = New System.Drawing.Size(554, 361)
Me.Controls.Add(Me.pnlGeneral)
Me.Controls.Add(Me.pnlBackup)
Me.Controls.Add(Me.pnl7z)
Me.Controls.Add(Me.lstSettings) Me.Controls.Add(Me.lstSettings)
Me.Controls.Add(Me.btnDefaults) Me.Controls.Add(Me.btnDefaults)
Me.Controls.Add(Me.btnCancel) Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnSave) Me.Controls.Add(Me.btnSave)
Me.Controls.Add(Me.pnlGeneral)
Me.Controls.Add(Me.pnl7z)
Me.Controls.Add(Me.pnlBackup)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False Me.MaximizeBox = False
Me.MinimizeBox = False Me.MinimizeBox = False
@@ -503,11 +543,13 @@ Partial Class frmSettings
Me.grpStartup.PerformLayout() Me.grpStartup.PerformLayout()
Me.grpFolderOptions.ResumeLayout(False) Me.grpFolderOptions.ResumeLayout(False)
Me.grpFolderOptions.PerformLayout() Me.grpFolderOptions.PerformLayout()
CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).EndInit()
Me.grp7zGeneral.ResumeLayout(False) Me.grp7zGeneral.ResumeLayout(False)
Me.grp7zGeneral.PerformLayout() Me.grp7zGeneral.PerformLayout()
Me.pnlBackup.ResumeLayout(False) Me.pnlBackup.ResumeLayout(False)
Me.pnlBackup.PerformLayout() Me.pnlBackup.PerformLayout()
CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).EndInit()
Me.grpBackupHandling.ResumeLayout(False)
Me.grpBackupHandling.PerformLayout()
Me.pnl7z.ResumeLayout(False) Me.pnl7z.ResumeLayout(False)
Me.grp7zAdvanced.ResumeLayout(False) Me.grp7zAdvanced.ResumeLayout(False)
Me.grp7zAdvanced.PerformLayout() Me.grp7zAdvanced.PerformLayout()
@@ -520,7 +562,6 @@ Partial Class frmSettings
End Sub End Sub
Friend WithEvents chkMonitorOnStartup As System.Windows.Forms.CheckBox Friend WithEvents chkMonitorOnStartup As System.Windows.Forms.CheckBox
Friend WithEvents chkBackupConfirm As System.Windows.Forms.CheckBox
Friend WithEvents grpStartup As System.Windows.Forms.GroupBox Friend WithEvents grpStartup As System.Windows.Forms.GroupBox
Friend WithEvents grpFolderOptions As System.Windows.Forms.GroupBox Friend WithEvents grpFolderOptions As System.Windows.Forms.GroupBox
Friend WithEvents txtBackupFolder As System.Windows.Forms.TextBox Friend WithEvents txtBackupFolder As System.Windows.Forms.TextBox
@@ -530,16 +571,10 @@ Partial Class frmSettings
Friend WithEvents btnBackupFolder As System.Windows.Forms.Button Friend WithEvents btnBackupFolder As System.Windows.Forms.Button
Friend WithEvents chkShowDetectionTips As System.Windows.Forms.CheckBox Friend WithEvents chkShowDetectionTips As System.Windows.Forms.CheckBox
Friend WithEvents chkStartToTray As System.Windows.Forms.CheckBox Friend WithEvents chkStartToTray As System.Windows.Forms.CheckBox
Friend WithEvents chkOverwriteWarning As System.Windows.Forms.CheckBox
Friend WithEvents chkCreateFolder As System.Windows.Forms.CheckBox Friend WithEvents chkCreateFolder As System.Windows.Forms.CheckBox
Friend WithEvents chkRestoreOnLaunch As System.Windows.Forms.CheckBox
Friend WithEvents chkSync As System.Windows.Forms.CheckBox Friend WithEvents chkSync As System.Windows.Forms.CheckBox
Friend WithEvents chkCheckSum As System.Windows.Forms.CheckBox
Friend WithEvents chkStartWindows As System.Windows.Forms.CheckBox Friend WithEvents chkStartWindows As System.Windows.Forms.CheckBox
Friend WithEvents chkTimeTracking As System.Windows.Forms.CheckBox Friend WithEvents chkTimeTracking As System.Windows.Forms.CheckBox
Friend WithEvents lblMinutes As Label
Friend WithEvents nudSupressBackupThreshold As NumericUpDown
Friend WithEvents chkSupressBackup As CheckBox
Friend WithEvents grp7zGeneral As GroupBox Friend WithEvents grp7zGeneral As GroupBox
Friend WithEvents cboCompression As ComboBox Friend WithEvents cboCompression As ComboBox
Friend WithEvents lblCompression As Label Friend WithEvents lblCompression As Label
@@ -560,4 +595,14 @@ Partial Class frmSettings
Friend WithEvents lstSettings As ListBox Friend WithEvents lstSettings As ListBox
Friend WithEvents grp7zAdvanced As GroupBox Friend WithEvents grp7zAdvanced As GroupBox
Friend WithEvents grp7zInformation As GroupBox Friend WithEvents grp7zInformation As GroupBox
Friend WithEvents lblMinutes As Label
Friend WithEvents nudSupressBackupThreshold As NumericUpDown
Friend WithEvents chkSupressBackup As CheckBox
Friend WithEvents chkBackupConfirm As CheckBox
Friend WithEvents chkOverwriteWarning As CheckBox
Friend WithEvents grpBackupHandling As GroupBox
Friend WithEvents chkAutoMark As CheckBox
Friend WithEvents chkAutoRestore As CheckBox
Friend WithEvents chkRestoreNotify As CheckBox
Friend WithEvents chkSessionTracking As CheckBox
End Class End Class
+16 -15
View File
@@ -4,7 +4,6 @@ Imports System.IO
Public Class frmSettings Public Class frmSettings
Dim bShutdown As Boolean = False Dim bShutdown As Boolean = False
Dim bSyncSettingsChanged As Boolean = False Dim bSyncSettingsChanged As Boolean = False
Dim bCheckSumDisabled As Boolean = False
Dim eCurrentSyncFields As clsGame.eOptionalSyncFields Dim eCurrentSyncFields As clsGame.eOptionalSyncFields
Private oSettings As mgrSettings Private oSettings As mgrSettings
@@ -48,8 +47,11 @@ Public Class frmSettings
oSettings.DisableConfirmation = chkBackupConfirm.Checked oSettings.DisableConfirmation = chkBackupConfirm.Checked
oSettings.CreateSubFolder = chkCreateFolder.Checked oSettings.CreateSubFolder = chkCreateFolder.Checked
oSettings.ShowOverwriteWarning = chkOverwriteWarning.Checked oSettings.ShowOverwriteWarning = chkOverwriteWarning.Checked
oSettings.RestoreOnLaunch = chkRestoreOnLaunch.Checked oSettings.RestoreOnLaunch = chkRestoreNotify.Checked
oSettings.AutoRestore = chkAutoRestore.Checked
oSettings.AutoMark = chkAutoMark.Checked
oSettings.TimeTracking = chkTimeTracking.Checked oSettings.TimeTracking = chkTimeTracking.Checked
oSettings.SessionTracking = chkSessionTracking.Checked
oSettings.SupressBackup = chkSupressBackup.Checked oSettings.SupressBackup = chkSupressBackup.Checked
oSettings.SupressBackupThreshold = nudSupressBackupThreshold.Value oSettings.SupressBackupThreshold = nudSupressBackupThreshold.Value
oSettings.CompressionLevel = cboCompression.SelectedValue oSettings.CompressionLevel = cboCompression.SelectedValue
@@ -61,12 +63,6 @@ Public Class frmSettings
oSettings.Custom7zArguments = txt7zArguments.Text.Trim oSettings.Custom7zArguments = txt7zArguments.Text.Trim
oSettings.Custom7zLocation = txt7zLocation.Text.Trim oSettings.Custom7zLocation = txt7zLocation.Text.Trim
'We need to clear all checksums its turned off
If chkCheckSum.Checked = False And oSettings.CheckSum = True Then
bCheckSumDisabled = True
End If
oSettings.CheckSum = chkCheckSum.Checked
'Turning syncing from off to on is the same as changing the backup folder 'Turning syncing from off to on is the same as changing the backup folder
If chkSync.Checked = True And oSettings.Sync = False Then If chkSync.Checked = True And oSettings.Sync = False Then
bSyncSettingsChanged = True bSyncSettingsChanged = True
@@ -106,7 +102,6 @@ Public Class frmSettings
If ValidateSettings() Then If ValidateSettings() Then
oSettings.SaveSettings() oSettings.SaveSettings()
If bSyncSettingsChanged Then mgrMonitorList.HandleBackupLocationChange(Settings) If bSyncSettingsChanged Then mgrMonitorList.HandleBackupLocationChange(Settings)
If bCheckSumDisabled Then mgrManifest.DoManifestHashWipe()
Return True Return True
Else Else
Return False Return False
@@ -177,11 +172,13 @@ Public Class frmSettings
chkBackupConfirm.Checked = oSettings.DisableConfirmation chkBackupConfirm.Checked = oSettings.DisableConfirmation
chkCreateFolder.Checked = oSettings.CreateSubFolder chkCreateFolder.Checked = oSettings.CreateSubFolder
chkOverwriteWarning.Checked = oSettings.ShowOverwriteWarning chkOverwriteWarning.Checked = oSettings.ShowOverwriteWarning
chkRestoreOnLaunch.Checked = oSettings.RestoreOnLaunch chkRestoreNotify.Checked = oSettings.RestoreOnLaunch
chkAutoRestore.Checked = oSettings.AutoRestore
chkAutoMark.Checked = oSettings.AutoMark
txtBackupFolder.Text = oSettings.BackupFolder txtBackupFolder.Text = oSettings.BackupFolder
chkSync.Checked = oSettings.Sync chkSync.Checked = oSettings.Sync
chkCheckSum.Checked = oSettings.CheckSum
chkTimeTracking.Checked = oSettings.TimeTracking chkTimeTracking.Checked = oSettings.TimeTracking
chkSessionTracking.Checked = oSettings.SessionTracking
chkSupressBackup.Checked = oSettings.SupressBackup chkSupressBackup.Checked = oSettings.SupressBackup
nudSupressBackupThreshold.Value = oSettings.SupressBackupThreshold nudSupressBackupThreshold.Value = oSettings.SupressBackupThreshold
nudSupressBackupThreshold.Enabled = chkSupressBackup.Checked nudSupressBackupThreshold.Enabled = chkSupressBackup.Checked
@@ -279,8 +276,10 @@ Public Class frmSettings
'Set Form Text 'Set Form Text
lblMinutes.Text = frmSettings_lblMinutes lblMinutes.Text = frmSettings_lblMinutes
chkSupressBackup.Text = frmSettings_chkSupressBackup chkSupressBackup.Text = frmSettings_chkSupressBackup
chkCheckSum.Text = frmSettings_chkCheckSum grpBackupHandling.Text = frmSettings_grpBackupHandling
chkRestoreOnLaunch.Text = frmSettings_chkRestoreOnLaunch chkRestoreNotify.Text = frmSettings_chkRestoreNotify
chkAutoRestore.Text = frmSettings_chkAutoRestore
chkAutoMark.Text = frmSettings_chkAutoMark
chkOverwriteWarning.Text = frmSettings_chkOverwriteWarning chkOverwriteWarning.Text = frmSettings_chkOverwriteWarning
chkCreateFolder.Text = frmSettings_chkCreateFolder chkCreateFolder.Text = frmSettings_chkCreateFolder
chkBackupConfirm.Text = frmSettings_chkBackupConfirm chkBackupConfirm.Text = frmSettings_chkBackupConfirm
@@ -292,6 +291,7 @@ Public Class frmSettings
grpStartup.Text = frmSettings_grpStartup grpStartup.Text = frmSettings_grpStartup
grpGameData.Text = frmSettings_grpGameData grpGameData.Text = frmSettings_grpGameData
chkTimeTracking.Text = frmSettings_chkTimeTracking chkTimeTracking.Text = frmSettings_chkTimeTracking
chkSessionTracking.Text = frmSettings_chkSessionTracking
chkStartWindows.Text = frmSettings_chkStartWindows chkStartWindows.Text = frmSettings_chkStartWindows
chkSync.Text = frmSettings_chkSync chkSync.Text = frmSettings_chkSync
chkShowDetectionTips.Text = frmSettings_chkShowDetectionTips chkShowDetectionTips.Text = frmSettings_chkShowDetectionTips
@@ -339,13 +339,13 @@ Public Class frmSettings
Private Sub btnBackupFolder_Click(sender As System.Object, e As System.EventArgs) Handles btnBackupFolder.Click Private Sub btnBackupFolder_Click(sender As System.Object, e As System.EventArgs) Handles btnBackupFolder.Click
Dim sNewFolder As String Dim sNewFolder As String
sNewFolder = mgrCommon.OpenFolderBrowser(frmSettings_BrowseFolder, oSettings.BackupFolder, True) sNewFolder = mgrCommon.OpenFolderBrowser("Settings_Backup_Path", frmSettings_BrowseFolder, oSettings.BackupFolder, True, False)
If sNewFolder <> String.Empty Then txtBackupFolder.Text = sNewFolder If sNewFolder <> String.Empty Then txtBackupFolder.Text = sNewFolder
End Sub End Sub
Private Sub btn7zLocation_Click(sender As Object, e As EventArgs) Handles btn7zLocation.Click Private Sub btn7zLocation_Click(sender As Object, e As EventArgs) Handles btn7zLocation.Click
Dim sNewLocation As String Dim sNewLocation As String
sNewLocation = mgrCommon.OpenFileBrowser(frmSettings_Browse7za, "exe", frmSettings_7zaFileType, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), False) sNewLocation = mgrCommon.OpenFileBrowser("7z_Browse", frmSettings_Browse7za, "exe", frmSettings_7zaFileType, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), False)
If sNewLocation <> String.Empty Then If sNewLocation <> String.Empty Then
txt7zLocation.Text = sNewLocation txt7zLocation.Text = sNewLocation
GetUtilityInfo(txt7zLocation.Text) GetUtilityInfo(txt7zLocation.Text)
@@ -375,4 +375,5 @@ Public Class frmSettings
Private Sub lstSettings_SelectedValueChanged(sender As Object, e As EventArgs) Handles lstSettings.SelectedValueChanged Private Sub lstSettings_SelectedValueChanged(sender As Object, e As EventArgs) Handles lstSettings.SelectedValueChanged
ChangePanel() ChangePanel()
End Sub End Sub
End Class End Class
+1 -1
View File
@@ -215,7 +215,7 @@ Public Class frmStartUpWizard
End If End If
End If End If
sNewPath = mgrCommon.OpenFolderBrowser(frmStartUpWizard_BrowseFolder, sDefaultFolder, True) sNewPath = mgrCommon.OpenFolderBrowser("Wizard_Backup_Path", frmStartUpWizard_BrowseFolder, sDefaultFolder, True, False)
If sNewPath <> String.Empty Then txtBackupPath.Text = sNewPath If sNewPath <> String.Empty Then txtBackupPath.Text = sNewPath
End Sub End Sub
+12 -12
View File
@@ -67,49 +67,49 @@ Public Class frmSyncFields
Private Sub chkTimeStamp_CheckedChanged(sender As Object, e As EventArgs) Handles chkTimeStamp.CheckedChanged Private Sub chkTimeStamp_CheckedChanged(sender As Object, e As EventArgs) Handles chkTimeStamp.CheckedChanged
If chkTimeStamp.Checked Then If chkTimeStamp.Checked Then
SyncFields = mgrCommon.SetSyncField(SyncFields, clsGame.eOptionalSyncFields.TimeStamp) SyncFields = clsGame.SetSyncField(SyncFields, clsGame.eOptionalSyncFields.TimeStamp)
Else Else
SyncFields = mgrCommon.RemoveSyncField(SyncFields, clsGame.eOptionalSyncFields.TimeStamp) SyncFields = clsGame.RemoveSyncField(SyncFields, clsGame.eOptionalSyncFields.TimeStamp)
End If End If
End Sub End Sub
Private Sub chkGamePath_CheckedChanged(sender As Object, e As EventArgs) Handles chkGamePath.CheckedChanged Private Sub chkGamePath_CheckedChanged(sender As Object, e As EventArgs) Handles chkGamePath.CheckedChanged
If chkGamePath.Checked Then If chkGamePath.Checked Then
SyncFields = mgrCommon.SetSyncField(SyncFields, clsGame.eOptionalSyncFields.GamePath) SyncFields = clsGame.SetSyncField(SyncFields, clsGame.eOptionalSyncFields.GamePath)
Else Else
SyncFields = mgrCommon.RemoveSyncField(SyncFields, clsGame.eOptionalSyncFields.GamePath) SyncFields = clsGame.RemoveSyncField(SyncFields, clsGame.eOptionalSyncFields.GamePath)
End If End If
End Sub End Sub
Private Sub chkCompany_CheckedChanged(sender As Object, e As EventArgs) Handles chkCompany.CheckedChanged Private Sub chkCompany_CheckedChanged(sender As Object, e As EventArgs) Handles chkCompany.CheckedChanged
If chkCompany.Checked Then If chkCompany.Checked Then
SyncFields = mgrCommon.SetSyncField(SyncFields, clsGame.eOptionalSyncFields.Company) SyncFields = clsGame.SetSyncField(SyncFields, clsGame.eOptionalSyncFields.Company)
Else Else
SyncFields = mgrCommon.RemoveSyncField(SyncFields, clsGame.eOptionalSyncFields.Company) SyncFields = clsGame.RemoveSyncField(SyncFields, clsGame.eOptionalSyncFields.Company)
End If End If
End Sub End Sub
Private Sub chkVersion_CheckedChanged(sender As Object, e As EventArgs) Handles chkVersion.CheckedChanged Private Sub chkVersion_CheckedChanged(sender As Object, e As EventArgs) Handles chkVersion.CheckedChanged
If chkVersion.Checked Then If chkVersion.Checked Then
SyncFields = mgrCommon.SetSyncField(SyncFields, clsGame.eOptionalSyncFields.Version) SyncFields = clsGame.SetSyncField(SyncFields, clsGame.eOptionalSyncFields.Version)
Else Else
SyncFields = mgrCommon.RemoveSyncField(SyncFields, clsGame.eOptionalSyncFields.Version) SyncFields = clsGame.RemoveSyncField(SyncFields, clsGame.eOptionalSyncFields.Version)
End If End If
End Sub End Sub
Private Sub chkIcon_CheckedChanged(sender As Object, e As EventArgs) Handles chkIcon.CheckedChanged Private Sub chkIcon_CheckedChanged(sender As Object, e As EventArgs) Handles chkIcon.CheckedChanged
If chkIcon.Checked Then If chkIcon.Checked Then
SyncFields = mgrCommon.SetSyncField(SyncFields, clsGame.eOptionalSyncFields.Icon) SyncFields = clsGame.SetSyncField(SyncFields, clsGame.eOptionalSyncFields.Icon)
Else Else
SyncFields = mgrCommon.RemoveSyncField(SyncFields, clsGame.eOptionalSyncFields.Icon) SyncFields = clsGame.RemoveSyncField(SyncFields, clsGame.eOptionalSyncFields.Icon)
End If End If
End Sub End Sub
Private Sub chkMonitorGame_CheckedChanged(sender As Object, e As EventArgs) Handles chkMonitorGame.CheckedChanged Private Sub chkMonitorGame_CheckedChanged(sender As Object, e As EventArgs) Handles chkMonitorGame.CheckedChanged
If chkMonitorGame.Checked Then If chkMonitorGame.Checked Then
SyncFields = mgrCommon.SetSyncField(SyncFields, clsGame.eOptionalSyncFields.MonitorGame) SyncFields = clsGame.SetSyncField(SyncFields, clsGame.eOptionalSyncFields.MonitorGame)
Else Else
SyncFields = mgrCommon.RemoveSyncField(SyncFields, clsGame.eOptionalSyncFields.MonitorGame) SyncFields = clsGame.RemoveSyncField(SyncFields, clsGame.eOptionalSyncFields.MonitorGame)
End If End If
End Sub End Sub
End Class End Class
+1 -1
View File
@@ -54,7 +54,7 @@ Public Class frmVariableManager
End If End If
End If End If
sNewPath = mgrCommon.OpenFolderBrowser(frmVariableManager_PathBrowse, sDefaultFolder, False) sNewPath = mgrCommon.OpenFolderBrowser("VM_Path", frmVariableManager_PathBrowse, sDefaultFolder, False, False)
If sNewPath <> String.Empty Then txtPath.Text = sNewPath If sNewPath <> String.Empty Then txtPath.Text = sNewPath
End Sub End Sub
+18 -1
View File
@@ -106,6 +106,7 @@
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Data" /> <Reference Include="System.Data" />
<Reference Include="System.Drawing" /> <Reference Include="System.Drawing" />
<Reference Include="System.Management" />
<Reference Include="System.Windows.Forms" /> <Reference Include="System.Windows.Forms" />
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
@@ -121,6 +122,11 @@
<Import Include="System.Windows.Forms" /> <Import Include="System.Windows.Forms" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Classes\clsGameFilter.vb" />
<Compile Include="Classes\clsGameFilterField.vb" />
<Compile Include="Classes\clsSavedPath.vb" />
<Compile Include="Classes\clsSession.vb" />
<Compile Include="Classes\XML Serialize Classes\ExportData.vb" />
<Compile Include="Classes\XML Serialize Classes\Tag.vb" /> <Compile Include="Classes\XML Serialize Classes\Tag.vb" />
<Compile Include="Classes\XML Serialize Classes\Game.vb" /> <Compile Include="Classes\XML Serialize Classes\Game.vb" />
<Compile Include="Classes\clsGameTag.vb" /> <Compile Include="Classes\clsGameTag.vb" />
@@ -164,6 +170,12 @@
<Compile Include="Forms\frmIncludeExclude.vb"> <Compile Include="Forms\frmIncludeExclude.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Forms\frmSessions.Designer.vb">
<DependentUpon>frmSessions.vb</DependentUpon>
</Compile>
<Compile Include="Forms\frmSessions.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\frmStartUpWizard.Designer.vb"> <Compile Include="Forms\frmStartUpWizard.Designer.vb">
<DependentUpon>frmStartUpWizard.vb</DependentUpon> <DependentUpon>frmStartUpWizard.vb</DependentUpon>
</Compile> </Compile>
@@ -220,6 +232,8 @@
<Compile Include="Managers\mgrMonitorList.vb" /> <Compile Include="Managers\mgrMonitorList.vb" />
<Compile Include="Managers\mgrPath.vb" /> <Compile Include="Managers\mgrPath.vb" />
<Compile Include="Managers\mgrRestore.vb" /> <Compile Include="Managers\mgrRestore.vb" />
<Compile Include="Managers\mgrSavedPath.vb" />
<Compile Include="Managers\mgrSessions.vb" />
<Compile Include="Managers\mgrSettings.vb" /> <Compile Include="Managers\mgrSettings.vb" />
<Compile Include="Managers\mgrBackup.vb" /> <Compile Include="Managers\mgrBackup.vb" />
<Compile Include="Managers\mgrSQLite.vb" /> <Compile Include="Managers\mgrSQLite.vb" />
@@ -262,6 +276,9 @@
<EmbeddedResource Include="Forms\frmIncludeExclude.resx"> <EmbeddedResource Include="Forms\frmIncludeExclude.resx">
<DependentUpon>frmIncludeExclude.vb</DependentUpon> <DependentUpon>frmIncludeExclude.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Forms\frmSessions.resx">
<DependentUpon>frmSessions.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\frmStartUpWizard.resx"> <EmbeddedResource Include="Forms\frmStartUpWizard.resx">
<DependentUpon>frmStartUpWizard.vb</DependentUpon> <DependentUpon>frmStartUpWizard.vb</DependentUpon>
<SubType>Designer</SubType> <SubType>Designer</SubType>
@@ -344,6 +361,7 @@
<Content Include="Utilities\x86\7za.exe"> <Content Include="Utilities\x86\7za.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="x64\sqlite3.dll" />
<Content Include="x86\sqlite3.dll" /> <Content Include="x86\sqlite3.dll" />
<None Include="Resources\gbm.ico" /> <None Include="Resources\gbm.ico" />
<Content Include="Resources\Admin.png" /> <Content Include="Resources\Admin.png" />
@@ -356,7 +374,6 @@
<Content Include="Resources\Inbox.png" /> <Content Include="Resources\Inbox.png" />
<Content Include="Resources\type.ico" /> <Content Include="Resources\type.ico" />
<Content Include="Resources\User.png" /> <Content Include="Resources\User.png" />
<Content Include="x64\sqlite3.dll" />
<None Include="Resources\Stopped.png" /> <None Include="Resources\Stopped.png" />
<None Include="Resources\Detected.png" /> <None Include="Resources\Detected.png" />
<None Include="Resources\Ready.png" /> <None Include="Resources\Ready.png" />
+60 -20
View File
@@ -85,11 +85,51 @@ Public Class mgrBackup
End Try End Try
End Sub End Sub
Private Function VerifySavePath(ByVal oGame As clsGame) As String
Dim sSavePath As String
If oGame.AbsolutePath = False Then
If oGame.Path <> String.Empty Then
sSavePath = oGame.ProcessPath & Path.DirectorySeparatorChar & oGame.Path
Else
sSavePath = oGame.ProcessPath
End If
Else
sSavePath = oGame.Path
End If
Return sSavePath
End Function
Public Function CheckBackupPrereq(ByVal oGame As clsGame) As Boolean Public Function CheckBackupPrereq(ByVal oGame As clsGame) As Boolean
Dim sBackupFile As String = oSettings.BackupFolder Dim sBackupFile As String = oSettings.BackupFolder
Dim sSavePath As String
Dim lAvailableSpace As Long
Dim lFolderSize As Long
If oSettings.CreateSubFolder Then sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name If oSettings.CreateSubFolder Then sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name & ".7z" sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name & ".7z"
'Verify saved game path
sSavePath = VerifySavePath(oGame)
'Calculate space
lAvailableSpace = mgrCommon.GetAvailableDiskSpace(sBackupFile)
lFolderSize = mgrCommon.GetFolderSize(sSavePath, oGame.IncludeArray, oGame.ExcludeArray)
'Show Available Space
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrCommon_AvailableDiskSpace, mgrCommon.FormatDiskSpace(lAvailableSpace)), False, ToolTipIcon.Info, True)
'Show Save Folder Size
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrCommon_SavedGameFolderSize, New String() {oGame.Name, mgrCommon.FormatDiskSpace(lFolderSize)}), False, ToolTipIcon.Info, True)
If lFolderSize >= lAvailableSpace Then
If mgrCommon.ShowMessage(mgrBackup_ConfirmDiskSpace, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
RaiseEvent UpdateLog(mgrBackup_ErrorDiskSpace, False, ToolTipIcon.Error, True)
Return False
End If
End If
If mgrRestore.CheckManifest(oGame.Name) Then If mgrRestore.CheckManifest(oGame.Name) Then
If mgrCommon.ShowMessage(mgrBackup_ConfirmManifestConflict, oGame.Name, MsgBoxStyle.YesNo) = MsgBoxResult.No Then If mgrCommon.ShowMessage(mgrBackup_ConfirmManifestConflict, oGame.Name, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
RaiseEvent UpdateLog(mgrBackup_ErrorManifestConflict, False, ToolTipIcon.Error, True) RaiseEvent UpdateLog(mgrBackup_ErrorManifestConflict, False, ToolTipIcon.Error, True)
@@ -178,15 +218,8 @@ Public Class mgrBackup
End If End If
If bDoBackup Then If bDoBackup Then
If oGame.AbsolutePath = False Then
If oGame.Path <> String.Empty Then sSavePath = VerifySavePath(oGame)
sSavePath = oGame.ProcessPath & Path.DirectorySeparatorChar & oGame.Path
Else
sSavePath = oGame.ProcessPath
End If
Else
sSavePath = oGame.Path
End If
If oGame.FolderSave = True Then If oGame.FolderSave = True Then
BuildFileList(sSavePath, "*", mgrPath.IncludeFileLocation) BuildFileList(sSavePath, "*", mgrPath.IncludeFileLocation)
@@ -222,13 +255,20 @@ Public Class mgrBackup
End While End While
prs7z.WaitForExit() prs7z.WaitForExit()
If Not CancelOperation Then If Not CancelOperation Then
If prs7z.ExitCode = 0 Then Select Case prs7z.ExitCode
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_BackupComplete, New String() {oGame.Name, mgrCommon.GetFileSize(sBackupFile)}), False, ToolTipIcon.Info, True) Case 0
bBackupCompleted = True RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_BackupComplete, New String() {oGame.Name, mgrCommon.FormatDiskSpace(mgrCommon.GetFileSize(sBackupFile))}), False, ToolTipIcon.Info, True)
Else bBackupCompleted = True
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_BackupWarnings, oGame.Name), True, ToolTipIcon.Warning, True) Case 1
bBackupCompleted = False RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_7zWarnings, oGame.Name), True, ToolTipIcon.Warning, True)
End If bBackupCompleted = True
Case 2
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_7zFatalError, oGame.Name), True, ToolTipIcon.Error, True)
bBackupCompleted = False
Case 7
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_7zCommandFailure, oGame.Name), True, ToolTipIcon.Error, True)
bBackupCompleted = False
End Select
End If End If
prs7z.Dispose() prs7z.Dispose()
Else Else
@@ -242,10 +282,10 @@ Public Class mgrBackup
'Write Main Manifest 'Write Main Manifest
If bBackupCompleted Then If bBackupCompleted Then
If oSettings.CheckSum Then
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_GenerateHash, oGame.Name), False, ToolTipIcon.Info, True) 'Generate checksum for new backup
sHash = mgrHash.Generate_SHA256_Hash(sBackupFile) RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_GenerateHash, oGame.Name), False, ToolTipIcon.Info, True)
End If sHash = mgrHash.Generate_SHA256_Hash(sBackupFile)
If Not DoManifestUpdate(oGame, sBackupFile, dTimeStamp, sHash) Then If Not DoManifestUpdate(oGame, sBackupFile, dTimeStamp, sHash) Then
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorManifestFailure, oGame.Name), True, ToolTipIcon.Error, True) RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorManifestFailure, oGame.Name), True, ToolTipIcon.Error, True)
+239 -31
View File
@@ -2,6 +2,9 @@
Imports System.Net Imports System.Net
Imports System.IO Imports System.IO
Imports System.Security.Principal Imports System.Security.Principal
Imports System.Text.RegularExpressions
Imports System.Runtime.Serialization
Imports System.Runtime.Serialization.Formatters.Binary
Public Class mgrCommon Public Class mgrCommon
@@ -30,10 +33,38 @@ Public Class mgrCommon
Public Shared ReadOnly Property AppVersion As Integer Public Shared ReadOnly Property AppVersion As Integer
Get Get
Return (My.Application.Info.Version.Major * 100) + My.Application.Info.Version.Minor Return (My.Application.Info.Version.Major * 100) + (My.Application.Info.Version.Minor * 10) + My.Application.Info.Version.Build
End Get End Get
End Property 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
Dim oStream As MemoryStream = New MemoryStream()
'Construct a serialization formatter that does all the hard work
Dim oFormatter As BinaryFormatter = New BinaryFormatter()
'This line Is explained in the "Streaming Contexts" section
oFormatter.Context = New StreamingContext(StreamingContextStates.Clone)
'Serialize the object graph into the memory stream
oFormatter.Serialize(oStream, oOriginal)
'Seek back to the start of the memory stream before deserializing
oStream.Position = 0
'Deserialize the graph into a New set of objects
'Return the root of the graph (deep copy) to the caller
Return oFormatter.Deserialize(oStream)
End Function
Public Shared Function CheckAddress(ByVal URL As String) As Boolean Public Shared Function CheckAddress(ByVal URL As String) As Boolean
Try Try
Dim request As WebRequest = WebRequest.Create(URL) Dim request As WebRequest = WebRequest.Create(URL)
@@ -61,30 +92,66 @@ Public Class mgrCommon
End If End If
End Function End Function
Public Shared Function SaveFileBrowser(ByVal sTitle As String, ByVal sExtension As String, ByVal sFileType As String, ByVal sDefaultFolder As String, ByVal sDefaultFile As String) As String Public Shared Function SaveFileBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sExtension As String, ByVal sFileType As String, ByVal sDefaultFolder As String,
ByVal sDefaultFile As String, Optional ByVal bSavedPath As Boolean = True) As String
Dim fbBrowser As New SaveFileDialog Dim fbBrowser As New SaveFileDialog
Dim oSavedPath As New clsSavedPath
fbBrowser.Title = sTitle fbBrowser.Title = sTitle
fbBrowser.DefaultExt = sExtension fbBrowser.DefaultExt = sExtension
fbBrowser.Filter = FormatString(mgrCommon_FilesFilter, New String() {sFileType, sExtension, sExtension}) fbBrowser.Filter = FormatString(mgrCommon_FilesFilter, New String() {sFileType, sExtension, sExtension})
fbBrowser.InitialDirectory = sDefaultFolder
fbBrowser.FileName = sDefaultFile fbBrowser.FileName = sDefaultFile
fbBrowser.InitialDirectory = sDefaultFolder
If fbBrowser.ShowDialog() = Windows.Forms.DialogResult.OK Then If bSavedPath Then
Return fbBrowser.FileName oSavedPath = mgrSavedPath.GetPathByName(sName)
If oSavedPath.Path <> String.Empty Then
If Directory.Exists(oSavedPath.Path) Then
fbBrowser.InitialDirectory = oSavedPath.Path
End If
End If
End If End If
Return String.Empty If fbBrowser.ShowDialog() = Windows.Forms.DialogResult.OK Then
If bSavedPath Then
oSavedPath.PathName = sName
oSavedPath.Path = Path.GetDirectoryName(fbBrowser.FileName)
mgrSavedPath.AddUpdatePath(oSavedPath)
End If
Return fbBrowser.FileName
End If
Return String.Empty
End Function End Function
Public Shared Function OpenFileBrowser(ByVal sTitle As String, ByVal sExtension As String, ByVal sFileType As String, ByVal sDefaultFolder As String, ByVal bMulti As Boolean) As String Public Shared Function OpenFileBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sExtension As String, ByVal sFileType As String, ByVal sDefaultFolder As String,
ByVal bMulti As Boolean, Optional ByVal bSavedPath As Boolean = True) As String
Dim fbBrowser As New OpenFileDialog Dim fbBrowser As New OpenFileDialog
Dim oSavedPath As New clsSavedPath
fbBrowser.Title = sTitle fbBrowser.Title = sTitle
fbBrowser.DefaultExt = sExtension fbBrowser.DefaultExt = sExtension
fbBrowser.Filter = FormatString(mgrCommon_FilesFilter, New String() {sFileType, sExtension, sExtension}) fbBrowser.Filter = FormatString(mgrCommon_FilesFilter, New String() {sFileType, sExtension, sExtension})
fbBrowser.InitialDirectory = sDefaultFolder
fbBrowser.Multiselect = bMulti fbBrowser.Multiselect = bMulti
fbBrowser.InitialDirectory = sDefaultFolder
If bSavedPath Then
oSavedPath = mgrSavedPath.GetPathByName(sName)
If oSavedPath.Path <> String.Empty Then
If Directory.Exists(oSavedPath.Path) Then
fbBrowser.InitialDirectory = oSavedPath.Path
End If
End If
End If
If fbBrowser.ShowDialog() = Windows.Forms.DialogResult.OK Then If fbBrowser.ShowDialog() = Windows.Forms.DialogResult.OK Then
If bSavedPath Then
oSavedPath.PathName = sName
oSavedPath.Path = Path.GetDirectoryName(fbBrowser.FileName)
mgrSavedPath.AddUpdatePath(oSavedPath)
End If
If bMulti Then If bMulti Then
Dim sFileNames As String = String.Empty Dim sFileNames As String = String.Empty
For Each sFileName As String In fbBrowser.FileNames For Each sFileName As String In fbBrowser.FileNames
@@ -100,12 +167,31 @@ Public Class mgrCommon
Return String.Empty Return String.Empty
End Function End Function
Public Shared Function OpenFolderBrowser(ByVal sTitle As String, ByVal sDefaultFolder As String, ByVal bEnableNewFolder As Boolean) As String Public Shared Function OpenFolderBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sDefaultFolder As String, ByVal bEnableNewFolder As Boolean,
Optional ByVal bSavedPath As Boolean = True) As String
Dim fbBrowser As New FolderBrowserDialog Dim fbBrowser As New FolderBrowserDialog
Dim oSavedPath As New clsSavedPath
fbBrowser.Description = sTitle fbBrowser.Description = sTitle
fbBrowser.SelectedPath = sDefaultFolder fbBrowser.SelectedPath = sDefaultFolder
fbBrowser.ShowNewFolderButton = bEnableNewFolder fbBrowser.ShowNewFolderButton = bEnableNewFolder
If bSavedPath Then
oSavedPath = mgrSavedPath.GetPathByName(sName)
If oSavedPath.Path <> String.Empty Then
If Directory.Exists(oSavedPath.Path) Then
fbBrowser.SelectedPath = oSavedPath.Path
End If
End If
End If
If fbBrowser.ShowDialog() = Windows.Forms.DialogResult.OK Then If fbBrowser.ShowDialog() = Windows.Forms.DialogResult.OK Then
If bSavedPath Then
oSavedPath.PathName = sName
oSavedPath.Path = fbBrowser.SelectedPath
mgrSavedPath.AddUpdatePath(oSavedPath)
End If
Return fbBrowser.SelectedPath Return fbBrowser.SelectedPath
End If End If
@@ -157,12 +243,152 @@ Public Class mgrCommon
oProcess.Start() oProcess.Start()
End Sub End Sub
Public Shared Function SetSyncField(ByVal eSyncFields As clsGame.eOptionalSyncFields, ByVal eSyncField As clsGame.eOptionalSyncFields) As clsGame.eOptionalSyncFields 'Get a file size
Return eSyncFields Or eSyncField Public Shared Function GetFileSize(ByVal sFile As String) As Long
Dim oFileInfo As FileInfo
Dim dFileSize As Long = 0
Try
oFileInfo = New FileInfo(sFile)
dFileSize = oFileInfo.Length
Catch ex As Exception
'Do Nothing
End Try
Return dFileSize
End Function End Function
Public Shared Function RemoveSyncField(ByVal eSyncFields As clsGame.eOptionalSyncFields, ByVal eSyncField As clsGame.eOptionalSyncFields) As clsGame.eOptionalSyncFields Public Shared Function WildcardToRegex(ByVal sPattern As String) As String
Return eSyncFields And (Not eSyncField) Dim sRegEx As String
sRegEx = sPattern.Replace("*", ".*")
sRegEx = sRegEx.Replace("?", ".")
Return sRegEx
End Function
Public Shared Function CompareValueToArrayRegEx(ByVal sValue As String, ByVal sValues As String()) As Boolean
For Each se As String In sValues
If Regex.IsMatch(sValue, WildcardToRegex(se)) Then
Return True
End If
Next
Return False
End Function
'Calculate the current size of a folder
Public Shared Function GetFolderSize(ByVal sPath As String, ByVal sInclude As String(), ByVal sExclude As String()) As Long
Dim oFolder As DirectoryInfo
Dim bInclude As Boolean
Dim bExclude As Boolean
Dim lSize As Long = 0
Try
If Not Directory.Exists(sPath) Then Return lSize
oFolder = New DirectoryInfo(sPath)
'Files
For Each fi As FileInfo In oFolder.EnumerateFiles()
If sInclude.Length > 0 Then
bInclude = CompareValueToArrayRegEx(fi.Name, sInclude) Or CompareValueToArrayRegEx(fi.DirectoryName, sInclude)
Else
bInclude = True
End If
If sExclude.Length > 0 Then
bExclude = CompareValueToArrayRegEx(fi.Name, sExclude) Or CompareValueToArrayRegEx(fi.DirectoryName, sExclude)
Else
bExclude = False
End If
If bInclude And Not bExclude Then
lSize += fi.Length
End If
Next
'Sub Folders
For Each di As DirectoryInfo In oFolder.EnumerateDirectories()
If Not ((di.Attributes And FileAttributes.ReparsePoint) = FileAttributes.ReparsePoint) Then
If sExclude.Length > 0 Then
bExclude = CompareValueToArrayRegEx(di.Name, sExclude)
Else
bExclude = False
End If
If Not bExclude Then
lSize += GetFolderSize(di.FullName, sInclude, sExclude)
End If
End If
Next
Catch
'Do Nothing
End Try
Return lSize
End Function
'Format Disk Space Amounts
Public Shared Function FormatDiskSpace(ByVal lSize As Long)
Select Case lSize
Case >= 1125899906842624
Return FormatString(mgrCommon_PB, Math.Round(lSize / 1125899906842624, 2))
Case >= 1099511627776
Return FormatString(mgrCommon_TB, Math.Round(lSize / 1099511627776, 2))
Case >= 1073741824
Return FormatString(mgrCommon_GB, Math.Round(lSize / 1073741824, 2))
Case >= 1048576
Return FormatString(mgrCommon_MB, Math.Round(lSize / 1048576, 2))
Case >= 1024
Return FormatString(mgrCommon_KB, Math.Round(lSize / 1024, 2))
Case >= 0
Return FormatString(mgrCommon_B, lSize)
End Select
Return lSize
End Function
'Get available disk space on a drive (Unix)
Private Shared Function GetAvailableDiskSpaceUnix(ByVal sPath As String) As Long
Dim prsdf As Process
Dim sOutput As String
Dim sAvailableSpace As String
Try
prsdf = New Process
prsdf.StartInfo.FileName = "/bin/df"
prsdf.StartInfo.Arguments = sPath
prsdf.StartInfo.UseShellExecute = False
prsdf.StartInfo.RedirectStandardOutput = True
prsdf.StartInfo.CreateNoWindow = True
prsdf.Start()
sOutput = prsdf.StandardOutput.ReadToEnd
'Parse df output to grab "Available" value
sAvailableSpace = sOutput.Split(vbLf)(1).Split(New Char() {" "}, StringSplitOptions.RemoveEmptyEntries)(3)
'Return value in bytes
Return CLng(sAvailableSpace) * 1024
Catch
Return 0
End Try
End Function
'Get available disk space on a drive (Windows)
Private Shared Function GetAvailableDiskSpaceWindows(ByVal sPath As String) As Long
Dim oDrive As DriveInfo
Dim lAvailableSpace As Long = 0
Try
oDrive = New DriveInfo(Path.GetPathRoot(sPath))
lAvailableSpace = oDrive.AvailableFreeSpace
Catch
'Do Nothing
End Try
Return lAvailableSpace
End Function
'Get available disk space on a drive
Public Shared Function GetAvailableDiskSpace(ByVal sPath As String) As Long
If IsUnix() Then
Return GetAvailableDiskSpaceUnix(sPath)
Else
Return GetAvailableDiskSpaceWindows(sPath)
End If
End Function End Function
'Delete file based on OS type 'Delete file based on OS type
@@ -224,24 +450,6 @@ Public Class mgrCommon
End Try End Try
End Sub End Sub
'Get a file size
Public Shared Function GetFileSize(ByVal sFile As String) As String
Dim oFileInfo As FileInfo
Dim dFileSize As Double
Try
oFileInfo = New FileInfo(sFile)
dFileSize = oFileInfo.Length
If dFileSize > 1048576 Then
Return FormatString(App_MB, Math.Round(dFileSize / 1048576, 2).ToString)
Else
Return FormatString(App_KB, Math.Round(dFileSize / 1024, 2).ToString)
End If
Catch ex As Exception
Return String.Empty
End Try
End Function
'Handles no extra parameters 'Handles no extra parameters
Public Shared Function ShowMessage(ByVal sMsg As String, ByVal oType As MsgBoxStyle) As MsgBoxResult Public Shared Function ShowMessage(ByVal sMsg As String, ByVal oType As MsgBoxStyle) As MsgBoxResult
Dim oResult As MsgBoxResult Dim oResult As MsgBoxResult
-4
View File
@@ -1,4 +0,0 @@
Public Class mgrGlobals
Public Shared LocalDatabaseHash As String = String.Empty
Public Shared RemoteDatabaseHash As String = String.Empty
End Class
+221 -63
View File
@@ -1,4 +1,5 @@
Imports GBM.My.Resources Imports GBM.My.Resources
Imports System.Collections.Specialized
Imports System.IO Imports System.IO
Public Class mgrMonitorList Public Class mgrMonitorList
@@ -30,6 +31,9 @@ Public Class mgrMonitorList
oGame.Enabled = CBool(dr("Enabled")) oGame.Enabled = CBool(dr("Enabled"))
oGame.MonitorOnly = CBool(dr("MonitorOnly")) oGame.MonitorOnly = CBool(dr("MonitorOnly"))
oGame.BackupLimit = CInt(dr("BackupLimit")) oGame.BackupLimit = CInt(dr("BackupLimit"))
oGame.CleanFolder = CBool(dr("CleanFolder"))
If Not IsDBNull(dr("Parameter")) Then oGame.Parameter = CStr(dr("Parameter"))
If Not IsDBNull(dr("Comments")) Then oGame.Comments = CStr(dr("Comments"))
Return oGame Return oGame
End Function End Function
@@ -54,6 +58,9 @@ Public Class mgrMonitorList
hshParams.Add("Enabled", oGame.Enabled) hshParams.Add("Enabled", oGame.Enabled)
hshParams.Add("MonitorOnly", oGame.MonitorOnly) hshParams.Add("MonitorOnly", oGame.MonitorOnly)
hshParams.Add("BackupLimit", oGame.BackupLimit) hshParams.Add("BackupLimit", oGame.BackupLimit)
hshParams.Add("CleanFolder", oGame.CleanFolder)
hshParams.Add("Parameter", oGame.Parameter)
hshParams.Add("Comments", oGame.Comments)
Return hshParams Return hshParams
End Function End Function
@@ -94,7 +101,7 @@ Public Class mgrMonitorList
Dim hshParams As Hashtable Dim hshParams As Hashtable
sSQL = "INSERT INTO monitorlist VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, @TimeStamp, " sSQL = "INSERT INTO monitorlist VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, @TimeStamp, "
sSQL &= "@ExcludeList, @ProcessPath, @Icon, @Hours, @Version, @Company, @Enabled, @MonitorOnly, @BackupLimit)" sSQL &= "@ExcludeList, @ProcessPath, @Icon, @Hours, @Version, @Company, @Enabled, @MonitorOnly, @BackupLimit, @CleanFolder, @Parameter, @Comments)"
'Parameters 'Parameters
hshParams = SetCoreParameters(oGame) hshParams = SetCoreParameters(oGame)
@@ -110,7 +117,7 @@ Public Class mgrMonitorList
sSQL = "UPDATE monitorlist SET Name=@Name, Process=@Process, Path=@Path, AbsolutePath=@AbsolutePath, FolderSave=@FolderSave, " sSQL = "UPDATE monitorlist SET Name=@Name, Process=@Process, Path=@Path, AbsolutePath=@AbsolutePath, FolderSave=@FolderSave, "
sSQL &= "FileType=@FileType, TimeStamp=@TimeStamp, ExcludeList=@ExcludeList, ProcessPath=@ProcessPath, Icon=@Icon, " sSQL &= "FileType=@FileType, TimeStamp=@TimeStamp, ExcludeList=@ExcludeList, ProcessPath=@ProcessPath, Icon=@Icon, "
sSQL &= "Hours=@Hours, Version=@Version, Company=@Company, Enabled=@Enabled, MonitorOnly=@MonitorOnly, BackupLimit=@BackupLimit WHERE MonitorID=@ID" sSQL &= "Hours=@Hours, Version=@Version, Company=@Company, Enabled=@Enabled, MonitorOnly=@MonitorOnly, BackupLimit=@BackupLimit, CleanFolder=@CleanFolder, Parameter=@Parameter, Comments=@Comments WHERE MonitorID=@ID"
'Parameters 'Parameters
hshParams = SetCoreParameters(oGame) hshParams = SetCoreParameters(oGame)
@@ -151,6 +158,10 @@ Public Class mgrMonitorList
sSQL = "DELETE FROM gametags " sSQL = "DELETE FROM gametags "
sSQL &= "WHERE MonitorID = @MonitorID;" 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 &= "DELETE FROM monitorlist "
sSQL &= "WHERE MonitorID = @MonitorID;" sSQL &= "WHERE MonitorID = @MonitorID;"
@@ -178,6 +189,20 @@ Public Class mgrMonitorList
sSQL = sSQL.TrimEnd(",") sSQL = sSQL.TrimEnd(",")
sSQL &= ");" 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 &= "DELETE FROM monitorlist "
sSQL &= "WHERE MonitorID IN (" sSQL &= "WHERE MonitorID IN ("
@@ -264,6 +289,31 @@ Public Class mgrMonitorList
End If End If
End Function End Function
Public Shared Function DoDuplicateParameterCheck(ByVal sProcess As String, ByVal sParameter As String, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local, Optional ByVal sExcludeID As String = "") As Boolean
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String
Dim oData As DataSet
Dim hshParams As New Hashtable
sSQL = "SELECT * FROM monitorlist WHERE Process = @Process AND Parameter = @Parameter"
hshParams.Add("Process", sProcess)
hshParams.Add("Parameter", sParameter)
If sExcludeID <> String.Empty Then
sSQL &= " AND MonitorID <> @MonitorID"
hshParams.Add("MonitorID", sExcludeID)
End If
oData = oDatabase.ReadParamData(sSQL, hshParams)
If oData.Tables(0).Rows.Count > 0 Then
Return True
Else
Return False
End If
End Function
'Sync Functions 'Sync Functions
Public Shared Sub DoListAddUpdateSync(ByVal hshGames As Hashtable, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local, Public Shared Sub DoListAddUpdateSync(ByVal hshGames As Hashtable, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local,
Optional ByVal eSyncFields As clsGame.eOptionalSyncFields = clsGame.eOptionalSyncFields.None) Optional ByVal eSyncFields As clsGame.eOptionalSyncFields = clsGame.eOptionalSyncFields.None)
@@ -315,11 +365,11 @@ Public Class mgrMonitorList
sVersion = "(SELECT Version FROM monitorlist WHERE MonitorID=@ID)" sVersion = "(SELECT Version FROM monitorlist WHERE MonitorID=@ID)"
End If End If
sSQL = "INSERT OR REPLACE INTO monitorlist (MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit) " sSQL = "INSERT OR REPLACE INTO monitorlist (MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter, Comments) "
sSQL &= "VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, " sSQL &= "VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, "
sSQL &= sTimeStamp & ", @ExcludeList, " & sGamePath & ", " sSQL &= sTimeStamp & ", @ExcludeList, " & sGamePath & ", "
sSQL &= sIcon & ", @Hours, " & sVersion & ", " sSQL &= sIcon & ", @Hours, " & sVersion & ", "
sSQL &= sCompany & ", " & sMonitorGame & ", @MonitorOnly, " & sBackupLimit & ");" sSQL &= sCompany & ", " & sMonitorGame & ", @MonitorOnly, " & sBackupLimit & ", @CleanFolder, @Parameter, @Comments);"
For Each oGame As clsGame In hshGames.Values For Each oGame As clsGame In hshGames.Values
hshParams = New Hashtable hshParams = New Hashtable
@@ -335,6 +385,9 @@ Public Class mgrMonitorList
hshParams.Add("ExcludeList", oGame.ExcludeList) hshParams.Add("ExcludeList", oGame.ExcludeList)
hshParams.Add("Hours", oGame.Hours) hshParams.Add("Hours", oGame.Hours)
hshParams.Add("MonitorOnly", oGame.MonitorOnly) hshParams.Add("MonitorOnly", oGame.MonitorOnly)
hshParams.Add("CleanFolder", oGame.CleanFolder)
hshParams.Add("Parameter", oGame.Parameter)
hshParams.Add("Comments", oGame.Comments)
'Optional Parameters 'Optional Parameters
If (eSyncFields And clsGame.eOptionalSyncFields.Company) = clsGame.eOptionalSyncFields.Company Then If (eSyncFields And clsGame.eOptionalSyncFields.Company) = clsGame.eOptionalSyncFields.Company Then
@@ -372,6 +425,10 @@ Public Class mgrMonitorList
sSQL = "DELETE FROM gametags " sSQL = "DELETE FROM gametags "
sSQL &= "WHERE MonitorID = @MonitorID;" 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 &= "DELETE FROM monitorlist "
sSQL &= "WHERE Name = @Name AND Process= @Process;" sSQL &= "WHERE Name = @Name AND Process= @Process;"
@@ -465,93 +522,181 @@ Public Class mgrMonitorList
End Sub End Sub
'Filter Functions 'Filter Functions
Private Shared Function BuildFilterQuery(ByVal oTagFilters As List(Of clsTag), ByVal hshStringFilters As Hashtable, eFilterType As frmFilter.eFilterType, 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 sSQL As String = String.Empty
Dim iCounter As Integer = 0 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"
Dim sSort As String = " ORDER BY " & sSortField
If bSortAsc Then
sSort &= " ASC"
Else
sSort &= " DESC"
End If
Select Case eFilterType Select Case eFilterType
Case frmFilter.eFilterType.NoFilter Case frmFilter.eFilterType.BaseFilter
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit FROM monitorlist ORDER BY Name Asc" sSQL = "SELECT " & sBaseSelect
Case frmFilter.eFilterType.FieldAnd, frmFilter.eFilterType.FieldOr
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit FROM monitorlist"
If hshStringFilters.Count > 0 Then
sSQL &= " WHERE ("
For Each de As DictionaryEntry In hshStringFilters
sSQL &= de.Key & " LIKE @" & de.Key
hshParams.Add(de.Key, "%" & de.Value.ToString & "%")
iCounter += 1
If iCounter <> hshStringFilters.Count Then
Select Case eFilterType
Case frmFilter.eFilterType.FieldAnd
sSQL &= " AND "
Case frmFilter.eFilterType.FieldOr
sSQL &= " OR "
End Select
End If
Next
sSQL &= ")"
End If
sSQL &= " ORDER BY Name Asc"
Case frmFilter.eFilterType.AnyTag Case frmFilter.eFilterType.AnyTag
sSQL = "SELECT DISTINCT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit FROM monitorlist "
sSQL &= "NATURAL JOIN gametags WHERE gametags.TagID IN ("
For Each oTag As clsTag In oTagFilters If oExcludeTagFilters.Count > 0 And oIncludeTagFilters.Count = 0 Then
sSQL &= "@TagID" & iCounter & "," sSQL = "SELECT " & sBaseSelect
hshParams.Add("TagID" & iCounter, oTag.ID)
iCounter += 1
Next
sSQL = sSQL.TrimEnd(",") sSQL &= " WHERE MonitorID NOT IN (SELECT MonitorID FROM monitorlist NATURAL JOIN gametags WHERE gametags.TagID IN ("
sSQL &= ") ORDER BY Name Asc"
Case frmFilter.eFilterType.AllTags
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit FROM monitorlist WHERE MonitorID IN "
For Each oTag As clsTag In oTagFilters For Each oTag As clsTag In oExcludeTagFilters
sSQL &= "(SELECT MonitorID FROM gametags WHERE monitorlist.MonitorID = gametags.MonitorID And TagID = @TagID" & iCounter & ")" sSQL &= "@TagID" & iCounter & ","
If iCounter <> oTagFilters.Count - 1 Then hshParams.Add("TagID" & iCounter, oTag.ID)
sSQL &= " AND MonitorID IN " 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 End If
hshParams.Add("TagID" & iCounter, oTag.ID) End If
iCounter += 1
Next 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
sSQL &= " ORDER BY Name Asc"
Case frmFilter.eFilterType.NoTags Case frmFilter.eFilterType.NoTags
sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit FROM monitorlist WHERE MonitorID NOT IN (SELECT MonitorID FROM gametags) ORDER BY Name Asc" sSQL = "SELECT " & sBaseSelect & " WHERE MonitorID NOT IN (SELECT MonitorID FROM gametags)"
End Select End Select
'Handle Other Filters
If oFilters.Count > 0 Then
If eFilterType = frmFilter.eFilterType.BaseFilter Then
sSQL &= " WHERE ("
Else
sSQL &= " AND ("
End If
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
hshParams.Add(oFilter.ID, "%" & oFilter.Data & "%")
Case clsGameFilterField.eDataType.fNumeric
sSQL &= oFilter.Field.FieldName & " " & oFilter.NumericOperatorAsString & " @" & oFilter.ID
hshParams.Add(oFilter.ID, oFilter.Data)
Case clsGameFilterField.eDataType.fBool
sSQL &= oFilter.Field.FieldName & " = @" & oFilter.ID
hshParams.Add(oFilter.ID, oFilter.Data)
End Select
iCounter += 1
If iCounter <> oFilters.Count Then
If bAndOperator Then
sSQL &= " AND "
Else
sSQL &= " OR "
End If
End If
Next
sSQL &= ")"
End If
'Handle Sorting
sSQL &= sSort
Return sSQL Return sSQL
End Function End Function
Public Shared Function ReadFilteredList(ByVal oTagFilters As List(Of clsTag), ByVal hshStringFilters As Hashtable, eFilterType As frmFilter.eFilterType, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As Hashtable 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 oDatabase As New mgrSQLite(iSelectDB)
Dim oData As DataSet Dim oData As DataSet
Dim sSQL As String = String.Empty Dim sSQL As String = String.Empty
Dim hshList As New Hashtable Dim oList As New OrderedDictionary
Dim oGame As clsGame Dim oGame As clsGame
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
Dim iCounter As Integer = 0 Dim iCounter As Integer = 0
sSQL = BuildFilterQuery(oTagFilters, hshStringFilters, eFilterType, hshParams) sSQL = BuildFilterQuery(oIncludeTagFilters, oExcludeTagFilters, oFilters, eFilterType, bAndOperator, bSortAsc, sSortField, hshParams)
oData = oDatabase.ReadParamData(sSQL, hshParams) oData = oDatabase.ReadParamData(sSQL, hshParams)
For Each dr As DataRow In oData.Tables(0).Rows For Each dr As DataRow In oData.Tables(0).Rows
oGame = MapToObject(dr) oGame = MapToObject(dr)
hshList.Add(oGame.ID, oGame) oList.Add(oGame.ID, oGame)
Next Next
Return hshList Return oList
End Function End Function
'Import / Export Functions 'Import / Export Functions
Public Shared Function ReadListForExport(ByVal oTagFilters As List(Of clsTag), ByVal hshStringFilters As Hashtable, ByVal eFilterType As frmFilter.eFilterType, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As List(Of Game) 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 oDatabase As New mgrSQLite(iSelectDB)
Dim oData As DataSet Dim oData As DataSet
Dim sSQL As String = String.Empty Dim sSQL As String = String.Empty
@@ -560,7 +705,7 @@ Public Class mgrMonitorList
Dim oGame As Game Dim oGame As Game
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
sSQL = BuildFilterQuery(oTagFilters, hshStringFilters, eFilterType, hshParams) sSQL = BuildFilterQuery(oIncludeTagFilters, oExcludeTagFilters, oFilters, eFilterType, bAndOperator, bSortAsc, sSortField, hshParams)
oData = oDatabase.ReadParamData(sSQL, hshParams) oData = oDatabase.ReadParamData(sSQL, hshParams)
@@ -574,6 +719,9 @@ Public Class mgrMonitorList
oGame.FolderSave = CBool(dr("FolderSave")) oGame.FolderSave = CBool(dr("FolderSave"))
If Not IsDBNull(dr("FileType")) Then oGame.FileType = CStr(dr("FileType")) If Not IsDBNull(dr("FileType")) Then oGame.FileType = CStr(dr("FileType"))
If Not IsDBNull(dr("ExcludeList")) Then oGame.ExcludeList = CStr(dr("ExcludeList")) If Not IsDBNull(dr("ExcludeList")) Then oGame.ExcludeList = CStr(dr("ExcludeList"))
oGame.MonitorOnly = CBool(dr("MonitorOnly"))
If Not IsDBNull(dr("Parameter")) Then oGame.Parameter = CStr(dr("Parameter"))
If Not IsDBNull(dr("Comments")) Then oGame.Comments = CStr(dr("Comments"))
oGame.Tags = mgrGameTags.GetTagsByGameForExport(sID) oGame.Tags = mgrGameTags.GetTagsByGameForExport(sID)
oList.Add(oGame) oList.Add(oGame)
Next Next
@@ -609,11 +757,12 @@ Public Class mgrMonitorList
Dim hshSyncItems As Hashtable Dim hshSyncItems As Hashtable
Dim oFromItem As clsGame Dim oFromItem As clsGame
Dim oToItem As clsGame Dim oToItem As clsGame
Dim oExportInfo As New ExportData
Cursor.Current = Cursors.WaitCursor Cursor.Current = Cursors.WaitCursor
'Add / Update Sync 'Add / Update Sync
hshCompareFrom = mgrXML.ReadMonitorList(sLocation, bWebRead) hshCompareFrom = mgrXML.ReadMonitorList(sLocation, oExportInfo, bWebRead)
hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Local) hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Local)
hshSyncItems = hshCompareFrom.Clone hshSyncItems = hshCompareFrom.Clone
@@ -631,6 +780,7 @@ Public Class mgrMonitorList
If hshSyncItems.Count > 0 Then If hshSyncItems.Count > 0 Then
Dim frm As New frmAdvancedImport Dim frm As New frmAdvancedImport
frm.ImportInfo = oExportInfo
frm.ImportData = hshSyncItems frm.ImportData = hshSyncItems
If frm.ShowDialog() = DialogResult.OK Then If frm.ShowDialog() = DialogResult.OK Then
Cursor.Current = Cursors.WaitCursor Cursor.Current = Cursors.WaitCursor
@@ -651,19 +801,27 @@ Public Class mgrMonitorList
Public Shared Sub ExportMonitorList(ByVal sLocation As String) Public Shared Sub ExportMonitorList(ByVal sLocation As String)
Dim oList As List(Of Game) Dim oList As List(Of Game)
Dim bSuccess As Boolean = False Dim bSuccess As Boolean = False
Dim oTagFilters As New List(Of clsTag) Dim oIncludeTagFilters As New List(Of clsTag)
Dim oStringFilters As New Hashtable Dim oExcludeTagFilters As New List(Of clsTag)
Dim eCurrentFilter As frmFilter.eFilterType = frmFilter.eFilterType.NoFilter Dim oFilters As New List(Of clsGameFilter)
Dim eCurrentFilter As frmFilter.eFilterType = frmFilter.eFilterType.BaseFilter
Dim bAndOperator As Boolean = True
Dim bSortAsc As Boolean = True
Dim sSortField As String = "Name"
If mgrCommon.ShowMessage(mgrMonitorList_ConfirmApplyFilter, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then If mgrCommon.ShowMessage(mgrMonitorList_ConfirmApplyFilter, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
Dim frm As New frmFilter Dim frm As New frmFilter
frm.ShowDialog() frm.ShowDialog()
oTagFilters = frm.TagFilters oIncludeTagFilters = frm.IncludeTagFilters
oStringFilters = frm.StringFilters oExcludeTagFilters = frm.ExcludeTagFilters
oFilters = frm.GameFilters
eCurrentFilter = frm.FilterType eCurrentFilter = frm.FilterType
bAndOperator = frm.AndOperator
bSortAsc = frm.SortAsc
sSortField = frm.SortField
End If End If
oList = ReadListForExport(oTagFilters, oStringFilters, eCurrentFilter) oList = ReadListForExport(oIncludeTagFilters, oExcludeTagFilters, oFilters, eCurrentFilter, bAndOperator, bSortAsc, sSortField)
bSuccess = mgrXML.SerializeAndExport(oList, sLocation) bSuccess = mgrXML.SerializeAndExport(oList, sLocation)
+1 -1
View File
@@ -335,7 +335,7 @@ Public Class mgrPath
Dim sDefaultFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop) Dim sDefaultFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim sNewPath As String Dim sNewPath As String
sNewPath = mgrCommon.OpenFolderBrowser(mgrPath_ChoosePath, sDefaultFolder, False) sNewPath = mgrCommon.OpenFolderBrowser("Manual_Game_Location", mgrPath_ChoosePath, sDefaultFolder, False)
Return sNewPath Return sNewPath
End Function End Function
+82 -14
View File
@@ -1,6 +1,5 @@
Imports System.Diagnostics Imports System.IO
Imports System.IO Imports System.Management
Imports System.Threading
Public Class mgrProcesses Public Class mgrProcesses
@@ -11,6 +10,7 @@ Public Class mgrProcesses
Private oDuplicateGames As New ArrayList Private oDuplicateGames As New ArrayList
Private bDuplicates As Boolean Private bDuplicates As Boolean
Private bVerified As Boolean = False Private bVerified As Boolean = False
Private sFullCommand As String = String.Empty
Property FoundProcess As Process Property FoundProcess As Process
Get Get
@@ -72,17 +72,63 @@ Public Class mgrProcesses
End Set End Set
End Property End Property
Private Sub VerifyDuplicate(oGame As clsGame, hshScanList As Hashtable) Property FullCommand As String
Get
Return sFullCommand
End Get
Set(value As String)
sFullCommand = value
End Set
End Property
Private Function HandleDuplicates(hshScanList As Hashtable) As Boolean
Dim sProcess As String Dim sProcess As String
bDuplicates = True bDuplicates = True
oDuplicateGames.Clear() oDuplicateGames.Clear()
For Each o As clsGame In hshScanList.Values For Each o As clsGame In hshScanList.Values
sProcess = o.ProcessName.Split(":")(0) sProcess = o.ProcessName.Split(":")(0)
If o.Duplicate = True And sProcess = oGame.TrueProcess Then If o.Duplicate = True And sProcess = oGame.TrueProcess Then
oDuplicateGames.Add(o.ShallowCopy) If o.Parameter <> String.Empty And FullCommand.Contains(o.Parameter) Then
oGame = o.ShallowCopy
Return True
ElseIf o.Parameter = String.Empty Then
oDuplicateGames.Add(o.ShallowCopy)
End If
End If End If
Next Next
If oDuplicateGames.Count = 1 Then
oGame = DirectCast(oDuplicateGames(0), clsGame).ShallowCopy
Return True
End If
Return False
End Function
'This function will only work correctly on Windows
Private Sub GetWindowsCommand(ByVal prs As Process)
FullCommand = String.Empty
Try
Using searcher As New ManagementObjectSearcher("SELECT CommandLine FROM Win32_Process WHERE ProcessId = " + prs.Id.ToString)
For Each o As ManagementObject In searcher.Get()
FullCommand &= o("CommandLine") & " "
Next
End Using
Catch ex As Exception
'Do Nothing
End Try
End Sub
'This function will only work correctly on Unix
Private Sub GetUnixCommand(ByVal prs As Process)
FullCommand = String.Empty
Try
FullCommand = File.ReadAllText("/proc/" & prs.Id.ToString() & "/cmdline").Replace(vbNullChar, " ")
Catch ex As Exception
'Do Nothing
End Try
End Sub End Sub
'This function will only work correctly on Unix 'This function will only work correctly on Unix
@@ -99,19 +145,18 @@ Public Class mgrProcesses
'This function will only work correctly on Unix 'This function will only work correctly on Unix
Private Function GetUnixSymLinkDirectory(ByVal prs As Process) As String Private Function GetUnixSymLinkDirectory(ByVal prs As Process) As String
Dim prsls As Process Dim prsls As Process
Dim slsinfo As String() Dim slsinfo As String
'This is the best way I can think of to determine the end point of a symlink without doing even more crazy shit
Try Try
prsls = New Process prsls = New Process
prsls.StartInfo.FileName = "/bin/bash" prsls.StartInfo.FileName = "/bin/readlink"
prsls.StartInfo.Arguments = "-c ""ls -l /proc/" & prs.Id.ToString & " | grep cwd""" prsls.StartInfo.Arguments = "-f /proc/" & prs.Id.ToString & "/cwd"
prsls.StartInfo.UseShellExecute = False prsls.StartInfo.UseShellExecute = False
prsls.StartInfo.RedirectStandardOutput = True prsls.StartInfo.RedirectStandardOutput = True
prsls.StartInfo.CreateNoWindow = True prsls.StartInfo.CreateNoWindow = True
prsls.Start() prsls.Start()
slsinfo = prsls.StandardOutput.ReadToEnd().Split(">") slsinfo = prsls.StandardOutput.ReadToEnd()
Return slsinfo(slsinfo.Length - 1).Trim Return slsinfo.Trim()
Catch ex As Exception Catch ex As Exception
Return String.Empty Return String.Empty
End Try End Try
@@ -122,8 +167,11 @@ Public Class mgrProcesses
Dim sProcessCheck As String = String.Empty Dim sProcessCheck As String = String.Empty
Dim sProcessList As String = String.Empty Dim sProcessList As String = String.Empty
Dim bWineProcess As Boolean = False Dim bWineProcess As Boolean = False
Dim bPass As Boolean
For Each prsCurrent As Process In prsList For Each prsCurrent As Process In prsList
bPass = False
'This needs to be wrapped due to issues with Mono. 'This needs to be wrapped due to issues with Mono.
Try Try
sProcessCheck = prsCurrent.ProcessName sProcessCheck = prsCurrent.ProcessName
@@ -149,17 +197,37 @@ Public Class mgrProcesses
'Do Nothing 'Do Nothing
End Try End Try
'Detection Pass 1
If hshScanList.ContainsKey(sProcessCheck) Then If hshScanList.ContainsKey(sProcessCheck) Then
prsFoundProcess = prsCurrent prsFoundProcess = prsCurrent
oGame = DirectCast(hshScanList.Item(sProcessCheck), clsGame).ShallowCopy oGame = DirectCast(hshScanList.Item(sProcessCheck), clsGame).ShallowCopy
bPass = True
If mgrCommon.IsUnix Then
GetUnixCommand(prsCurrent)
Else
GetWindowsCommand(prsCurrent)
End If
If oGame.Duplicate = True Then If oGame.Duplicate = True Then
VerifyDuplicate(oGame, hshScanList) If HandleDuplicates(hshScanList) Then
bDuplicates = False
oDuplicateGames.Clear()
End If
Else Else
bDuplicates = False bDuplicates = False
oDuplicateGames.Clear() oDuplicateGames.Clear()
End If End If
If Duplicate And DuplicateList.Count = 0 Then bPass = False
If oGame.Parameter <> String.Empty And Not Duplicate And Not FullCommand.Contains(oGame.Parameter) Then bPass = False
End If
'Detection Pass 2
If bPass Then
'Determine the process path if we need it
If Not oGame.AbsolutePath Or oGame.Duplicate Then If Not oGame.AbsolutePath Or oGame.Duplicate Then
Try Try
If Not bWineProcess Then If Not bWineProcess Then
@@ -180,12 +248,12 @@ Public Class mgrProcesses
Else Else
If bDebugMode Then mgrCommon.ShowMessage(exWin32.NativeErrorCode & " " & exWin32.Message & vbCrLf & vbCrLf & exWin32.StackTrace, MsgBoxStyle.Critical) If bDebugMode Then mgrCommon.ShowMessage(exWin32.NativeErrorCode & " " & exWin32.Message & vbCrLf & vbCrLf & exWin32.StackTrace, MsgBoxStyle.Critical)
'A different failure occured, drop out and continue to scan. 'A different failure occured, drop out and continue to scan.
Return False bPass = False
End If End If
Catch exAll As Exception Catch exAll As Exception
If bDebugMode Then mgrCommon.ShowMessage(exAll.Message & vbCrLf & vbCrLf & exAll.StackTrace, MsgBoxStyle.Critical) If bDebugMode Then mgrCommon.ShowMessage(exAll.Message & vbCrLf & vbCrLf & exAll.StackTrace, MsgBoxStyle.Critical)
'A different failure occured, drop out and continue to scan. 'A different failure occured, drop out and continue to scan.
Return False bPass = False
End Try End Try
End If End If
+19 -25
View File
@@ -96,8 +96,6 @@ Public Class mgrRestore
If bLocal And bRemote Then If bLocal And bRemote Then
'Compare 'Compare
If oRemoteItem.DateUpdated > oLocalItem.DateUpdated Then If oRemoteItem.DateUpdated > oLocalItem.DateUpdated Then
oRemoteItem.LastDateUpdated = oLocalItem.DateUpdated
oRemoteItem.LastUpdatedBy = oLocalItem.UpdatedBy
Return True Return True
End If End If
End If End If
@@ -125,18 +123,10 @@ Public Class mgrRestore
oLocalItem = DirectCast(slLocalManifest(oItem.Name), clsBackup) oLocalItem = DirectCast(slLocalManifest(oItem.Name), clsBackup)
If oItem.DateUpdated > oLocalItem.DateUpdated Then If oItem.DateUpdated > oLocalItem.DateUpdated Then
oLocalItem.FileName = oItem.FileName slRestoreItems.Add(oItem.Name, oItem)
oLocalItem.LastDateUpdated = oItem.DateUpdated
oLocalItem.LastUpdatedBy = oItem.UpdatedBy
slRestoreItems.Add(oLocalItem.Name, oLocalItem)
End If End If
Else Else
oLocalItem = oItem slRestoreItems.Add(oItem.Name, oItem)
oLocalItem.LastDateUpdated = oItem.DateUpdated
oLocalItem.LastUpdatedBy = oItem.UpdatedBy
oLocalItem.DateUpdated = Nothing
oLocalItem.UpdatedBy = Nothing
slRestoreItems.Add(oLocalItem.Name, oLocalItem)
End If End If
Next Next
@@ -161,7 +151,7 @@ Public Class mgrRestore
Return slRemovedItems Return slRemovedItems
End Function End Function
Public Function CheckRestorePrereq(ByVal oBackupInfo As clsBackup) As Boolean Public Function CheckRestorePrereq(ByVal oBackupInfo As clsBackup, ByVal bCleanFolder As Boolean) As Boolean
Dim sHash As String Dim sHash As String
Dim sExtractPath As String Dim sExtractPath As String
Dim sBackupFile As String = oSettings.BackupFolder & Path.DirectorySeparatorChar & oBackupInfo.FileName Dim sBackupFile As String = oSettings.BackupFolder & Path.DirectorySeparatorChar & oBackupInfo.FileName
@@ -185,26 +175,30 @@ Public Class mgrRestore
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorNoPath, sExtractPath), False, ToolTipIcon.Error, True) RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorNoPath, sExtractPath), False, ToolTipIcon.Error, True)
Return False Return False
End If End If
Else
If bCleanFolder Then
mgrCommon.DeleteDirectory(sExtractPath, True)
Directory.CreateDirectory(sExtractPath)
End If
End If End If
'Check file integrity 'Check file integrity
If oSettings.CheckSum Then If oBackupInfo.CheckSum <> String.Empty Then
If oBackupInfo.CheckSum <> String.Empty Then sHash = mgrHash.Generate_SHA256_Hash(sBackupFile)
sHash = mgrHash.Generate_SHA256_Hash(sBackupFile) If sHash <> oBackupInfo.CheckSum Then
If sHash <> oBackupInfo.CheckSum Then RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorFailedCheck, oBackupInfo.Name), False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorFailedCheck, oBackupInfo.Name), False, ToolTipIcon.Info, True) If mgrCommon.ShowMessage(mgrRestore_ConfirmFailedCheck, oBackupInfo.Name, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
If mgrCommon.ShowMessage(mgrRestore_ConfirmFailedCheck, oBackupInfo.Name, MsgBoxStyle.YesNo) = MsgBoxResult.No Then RaiseEvent UpdateLog(mgrRestore_ErrorCheckAbort, False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrRestore_ErrorCheckAbort, False, ToolTipIcon.Info, True) Return False
Return False
End If
Else
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_Verified, oBackupInfo.Name), False, ToolTipIcon.Info, True)
End If End If
Else Else
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_NoVerify, oBackupInfo.Name), False, ToolTipIcon.Info, True) RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_Verified, oBackupInfo.Name), False, ToolTipIcon.Info, True)
End If End If
Else
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_NoVerify, oBackupInfo.Name), False, ToolTipIcon.Info, True)
End If End If
Return True Return True
End Function End Function
+144 -6
View File
@@ -72,15 +72,18 @@ Public Class mgrSQLite
'Add Tables (Settings) 'Add Tables (Settings)
sSql = "CREATE TABLE settings (SettingsID INTEGER NOT NULL PRIMARY KEY, MonitorOnStartup BOOLEAN NOT NULL, StartToTray BOOLEAN NOT NULL, ShowDetectionToolTips BOOLEAN NOT NULL, " & sSql = "CREATE TABLE settings (SettingsID INTEGER NOT NULL PRIMARY KEY, MonitorOnStartup BOOLEAN NOT NULL, StartToTray BOOLEAN NOT NULL, ShowDetectionToolTips BOOLEAN NOT NULL, " &
"DisableConfirmation BOOLEAN NOT NULL, CreateSubFolder BOOLEAN NOT NULL, ShowOverwriteWarning BOOLEAN NOT NULL, RestoreOnLaunch BOOLEAN NOT NULL, " & "DisableConfirmation BOOLEAN NOT NULL, CreateSubFolder BOOLEAN NOT NULL, ShowOverwriteWarning BOOLEAN NOT NULL, RestoreOnLaunch BOOLEAN NOT NULL, " &
"BackupFolder TEXT NOT NULL, Sync BOOLEAN NOT NULL, CheckSum BOOLEAN NOT NULL, StartWithWindows BOOLEAN NOT NULL, TimeTracking 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, " & "SupressBackup BOOLEAN NOT NULL, SupressBackupThreshold INTEGER NOT NULL, CompressionLevel INTEGER NOT NULL, Custom7zArguments TEXT, " &
"Custom7zLocation TEXT, SyncFields INTEGER NOT NULL, AutoSaveLog 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);"
'Add Tables (Monitor List) 'Add Tables (Monitor List)
sSql &= "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " & sSql &= "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " &
"AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " & "AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " &
"ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " & "ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " &
"BackupLimit INTEGER NOT NULL, PRIMARY KEY(Name, Process));" "BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, Parameter TEXT, Comments TEXT, PRIMARY KEY(Name, Process));"
'Add Tables (Tags) 'Add Tables (Tags)
sSql &= "CREATE TABLE tags (TagID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY); " sSql &= "CREATE TABLE tags (TagID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY); "
@@ -95,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, " & 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);" "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 'Set Version
sSql &= "PRAGMA user_version=" & mgrCommon.AppVersion sSql &= "PRAGMA user_version=" & mgrCommon.AppVersion
@@ -117,7 +123,7 @@ Public Class mgrSQLite
sSql = "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " & sSql = "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " &
"AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " & "AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " &
"ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " & "ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " &
"BackupLimit INTEGER NOT NULL, PRIMARY KEY(Name, Process));" "BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, Parameter TEXT, Comments TEXT, PRIMARY KEY(Name, Process));"
'Add Tables (Remote Manifest) 'Add Tables (Remote Manifest)
sSql &= "CREATE TABLE manifest (ManifestID TEXT NOT NULL PRIMARY KEY, Name TEXT NOT NULL, FileName TEXT NOT NULL, RestorePath TEXT NOT NULL, " & sSql &= "CREATE TABLE manifest (ManifestID TEXT NOT NULL PRIMARY KEY, Name TEXT NOT NULL, FileName TEXT NOT NULL, RestorePath TEXT NOT NULL, " &
@@ -167,6 +173,15 @@ Public Class mgrSQLite
db.Close() db.Close()
End Sub End Sub
Private Sub RollBack(ByRef trans As SqliteTransaction)
Try
trans.Rollback()
Catch
'SQLite may or may not perform an auto-rollback when certain failures occur, such as disk full or out of memory.
'Multiple rollbacks will cause an exception, therefore lets just do nothing when that happens.
End Try
End Sub
Private Sub BuildParams(ByRef command As SqliteCommand, ByRef hshParams As Hashtable) Private Sub BuildParams(ByRef command As SqliteCommand, ByRef hshParams As Hashtable)
For Each de As DictionaryEntry In hshParams For Each de As DictionaryEntry In hshParams
command.Parameters.AddWithValue(de.Key, de.Value) command.Parameters.AddWithValue(de.Key, de.Value)
@@ -186,7 +201,7 @@ Public Class mgrSQLite
command.ExecuteNonQuery() command.ExecuteNonQuery()
trans.Commit() trans.Commit()
Catch ex As Exception Catch ex As Exception
trans.Rollback() RollBack(trans)
mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Exclamation) mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Exclamation)
Return False Return False
Finally Finally
@@ -212,7 +227,7 @@ Public Class mgrSQLite
Next Next
trans.Commit() trans.Commit()
Catch ex As Exception Catch ex As Exception
trans.Rollback() RollBack(trans)
mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Exclamation) mgrCommon.ShowMessage(mgrSQLite_ErrorQueryFailure, New String() {sSQL, ex.Message}, MsgBoxStyle.Exclamation)
Return False Return False
Finally Finally
@@ -246,6 +261,27 @@ Public Class mgrSQLite
Return oData Return oData
End Function 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 Private Function GetDatabaseVersion() As Integer
Dim sSQL As String Dim sSQL As String
Dim iVer As Integer Dim iVer As Integer
@@ -600,6 +636,104 @@ Public Class mgrSQLite
End If End If
End If End If
'1.01 Upgrade
If GetDatabaseVersion() < 101 Then
If eDatabase = Database.Local Then
'Backup DB before starting
BackupDB("v98")
'Remove checksum field
sSQL = "CREATE TABLE settings_new (SettingsID INTEGER NOT NULL PRIMARY KEY, MonitorOnStartup BOOLEAN NOT NULL, StartToTray BOOLEAN NOT NULL, ShowDetectionToolTips BOOLEAN NOT NULL, " &
"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);"
sSQL &= "INSERT INTO settings_new (SettingsID, MonitorOnStartup, StartToTray, ShowDetectionToolTips, DisableConfirmation, CreateSubFolder, " &
"ShowOverwriteWarning, RestoreOnLaunch, BackupFolder, Sync, StartWithWindows, TimeTracking, SupressBackup, SupressBackupThreshold, " &
"CompressionLevel, Custom7zArguments, Custom7zLocation, SyncFields, AutoSaveLog) " &
"SELECT SettingsID, MonitorOnStartup, StartToTray, ShowDetectionToolTips, DisableConfirmation, CreateSubFolder, " &
"ShowOverwriteWarning, RestoreOnLaunch, BackupFolder, Sync, StartWithWindows, TimeTracking, SupressBackup, SupressBackupThreshold, " &
"CompressionLevel, Custom7zArguments, Custom7zLocation, SyncFields, AutoSaveLog FROM settings;" &
"DROP TABLE settings; ALTER TABLE settings_new RENAME TO settings;"
'Add new field(s)
sSQL &= "ALTER TABLE monitorlist ADD COLUMN CleanFolder BOOLEAN NOT NULL DEFAULT 0;"
sSQL &= "ALTER TABLE settings ADD COLUMN AutoRestore BOOLEAN NOT NULL DEFAULT 0;"
sSQL &= "ALTER TABLE settings ADD COLUMN AutoMark BOOLEAN NOT NULL DEFAULT 0;"
sSQL &= "PRAGMA user_version=101"
RunParamQuery(sSQL, New Hashtable)
End If
If eDatabase = Database.Remote Then
'Backup DB before starting
BackupDB("v98")
'Add new field(s)
sSQL = "ALTER TABLE monitorlist ADD COLUMN CleanFolder BOOLEAN NOT NULL DEFAULT 0;"
sSQL &= "PRAGMA user_version=101"
RunParamQuery(sSQL, New Hashtable)
End If
End If
'1.02 Upgrade
If GetDatabaseVersion() < 102 Then
If eDatabase = Database.Local Then
'Backup DB before starting
BackupDB("v101")
'Add Table (SavedPath)
sSQL = "CREATE TABLE savedpath (PathName TEXT NOT NULL PRIMARY KEY, Path TEXT NOT NULL);"
'Add new field(s)
sSQL &= "ALTER TABLE monitorlist ADD COLUMN Parameter TEXT;"
sSQL &= "PRAGMA user_version=102"
RunParamQuery(sSQL, New Hashtable)
End If
If eDatabase = Database.Remote Then
'Backup DB before starting
BackupDB("v101")
'Add new field(s)
sSQL = "ALTER TABLE monitorlist ADD COLUMN Parameter TEXT;"
sSQL &= "PRAGMA user_version=102"
RunParamQuery(sSQL, New Hashtable)
End If
End If
'1.05 Upgrade
If GetDatabaseVersion() < 105 Then
If eDatabase = Database.Local Then
'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 settings ADD COLUMN SessionTracking BOOLEAN DEFAULT 0;"
sSQL &= "PRAGMA user_version=105"
RunParamQuery(sSQL, New Hashtable)
End If
If eDatabase = Database.Remote Then
'Backup DB before starting
BackupDB("v102")
'Add new field(s)
sSQL = "ALTER TABLE monitorlist ADD COLUMN Comments TEXT;"
sSQL &= "PRAGMA user_version=105"
RunParamQuery(sSQL, New Hashtable)
End If
End If
End Sub End Sub
Public Function GetDBSize() As Long Public Function GetDBSize() As Long
@@ -607,6 +741,10 @@ Public Class mgrSQLite
Return Math.Round(oFileInfo.Length / 1024, 2) Return Math.Round(oFileInfo.Length / 1024, 2)
End Function End Function
Public Function ReportVersion() As String
Return SqliteConnection.SQLiteVersion
End Function
Public Sub CompactDatabase() Public Sub CompactDatabase()
Dim sSQL As String Dim sSQL As String
Dim command As SQLiteCommand Dim command As SQLiteCommand
+54
View File
@@ -0,0 +1,54 @@
Public Class mgrSavedPath
Private Shared Function MapToObject(ByVal dr As DataRow) As clsSavedPath
Dim oSavedPath As New clsSavedPath
oSavedPath.PathName = CStr(dr("PathName"))
oSavedPath.Path = CStr(dr("Path"))
Return oSavedPath
End Function
Private Shared Function SetCoreParameters(ByVal oSavedPath As clsSavedPath) As Hashtable
Dim hshParams As New Hashtable
hshParams.Add("PathName", oSavedPath.PathName)
hshParams.Add("Path", oSavedPath.Path)
Return hshParams
End Function
Public Shared Function GetPathByName(ByVal sPathName As String) As clsSavedPath
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim oData As DataSet
Dim sSQL As String
Dim hshParams As New Hashtable
Dim oSavedPath As New clsSavedPath
sSQL = "SELECT PathName, Path from savedpath WHERE PathName=@PathName;"
hshParams.Add("PathName", sPathName)
oData = oDatabase.ReadParamData(sSQL, hshParams)
For Each dr As DataRow In oData.Tables(0).Rows
oSavedPath = MapToObject(dr)
Next
Return oSavedPath
End Function
Public Shared Sub AddUpdatePath(ByVal oSavedPath As clsSavedPath)
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim hshParams As Hashtable
sSQL = "INSERT OR REPLACE INTO savedpath (PathName, Path) VALUES (@PathName, @Path);"
hshParams = SetCoreParameters(oSavedPath)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
End Class
+126
View File
@@ -0,0 +1,126 @@
Public Class mgrSessions
Private Shared Function MapToObject(ByVal dr As DataRow) As clsSession
Dim oSession As New clsSession
oSession.MonitorID = CStr(dr("MonitorID"))
oSession.SessionStart = mgrCommon.UnixToDate(CInt(dr("Start")))
oSession.SessionEnd = mgrCommon.UnixToDate(CInt(dr("End")))
Return oSession
End Function
Private Shared Function SetCoreParameters(ByVal oSession As clsSession) As Hashtable
Dim hshParams As New Hashtable
hshParams.Add("MonitorID", oSession.MonitorID)
hshParams.Add("Start", mgrCommon.DateToUnix(oSession.SessionStart))
hshParams.Add("End", mgrCommon.DateToUnix(oSession.SessionEnd))
Return hshParams
End Function
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) VALUES (@MonitorID, @Start, @End);"
hshParams = SetCoreParameters(oSession)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
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 sessions.MonitorID, monitorlist.Name, Start, End FROM sessions NATURAL JOIN monitorlist;"
Return oDatabase.ReadParamData(sSQL, hshParams)
End Function
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
+38 -14
View File
@@ -9,9 +9,11 @@ Public Class mgrSettings
Private bCreateSubFolder As Boolean = False Private bCreateSubFolder As Boolean = False
Private bShowOverwriteWarning As Boolean = True Private bShowOverwriteWarning As Boolean = True
Private bRestoreOnLaunch As Boolean = False Private bRestoreOnLaunch As Boolean = False
Private bAutoRestore As Boolean = False
Private bAutoMark As Boolean = False
Private bSync As Boolean = True Private bSync As Boolean = True
Private bCheckSum As Boolean = True
Private bTimeTracking As Boolean = True Private bTimeTracking As Boolean = True
Private bSessionTracking As Boolean = False
Private bSupressBackup As Boolean = False Private bSupressBackup As Boolean = False
Private iSupressBackupThreshold As Integer = 10 Private iSupressBackupThreshold As Integer = 10
Private iCompressionLevel As Integer = 5 Private iCompressionLevel As Integer = 5
@@ -93,6 +95,24 @@ Public Class mgrSettings
End Set End Set
End Property End Property
Property AutoRestore As Boolean
Get
Return bAutoRestore
End Get
Set(value As Boolean)
bAutoRestore = value
End Set
End Property
Property AutoMark As Boolean
Get
Return bAutoMark
End Get
Set(value As Boolean)
bAutoMark = value
End Set
End Property
Property Sync As Boolean Property Sync As Boolean
Get Get
Return bSync Return bSync
@@ -102,15 +122,6 @@ Public Class mgrSettings
End Set End Set
End Property End Property
Property CheckSum As Boolean
Get
Return bCheckSum
End Get
Set(value As Boolean)
bCheckSum = value
End Set
End Property
Property TimeTracking As Boolean Property TimeTracking As Boolean
Get Get
Return bTimeTracking Return bTimeTracking
@@ -120,6 +131,15 @@ Public Class mgrSettings
End Set End Set
End Property 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 Property SupressBackup As Boolean
Get Get
Return bSupressBackup Return bSupressBackup
@@ -249,9 +269,9 @@ Public Class mgrSettings
oDatabase.RunParamQuery(sSQL, New Hashtable) oDatabase.RunParamQuery(sSQL, New Hashtable)
sSQL = "INSERT INTO settings VALUES (1, @MonitorOnStartup, @StartToTray, @ShowDetectionToolTips, @DisableConfirmation, " sSQL = "INSERT INTO settings VALUES (1, @MonitorOnStartup, @StartToTray, @ShowDetectionToolTips, @DisableConfirmation, "
sSQL &= "@CreateSubFolder, @ShowOverwriteWarning, @RestoreOnLaunch, @BackupFolder, @Sync, @CheckSum, @StartWithWindows, " sSQL &= "@CreateSubFolder, @ShowOverwriteWarning, @RestoreOnLaunch, @BackupFolder, @Sync, @StartWithWindows, "
sSQL &= "@TimeTracking, @SupressBackup, @SupressBackupThreshold, @CompressionLevel, @Custom7zArguments, @Custom7zLocation, " sSQL &= "@TimeTracking, @SupressBackup, @SupressBackupThreshold, @CompressionLevel, @Custom7zArguments, @Custom7zLocation, "
sSQL &= "@SyncFields,@AutoSaveLog)" sSQL &= "@SyncFields, @AutoSaveLog, @AutoRestore, @AutoMark, @SessionTracking)"
hshParams.Add("MonitorOnStartup", MonitorOnStartup) hshParams.Add("MonitorOnStartup", MonitorOnStartup)
hshParams.Add("StartToTray", StartToTray) hshParams.Add("StartToTray", StartToTray)
@@ -262,7 +282,6 @@ Public Class mgrSettings
hshParams.Add("RestoreOnLaunch", RestoreOnLaunch) hshParams.Add("RestoreOnLaunch", RestoreOnLaunch)
hshParams.Add("BackupFolder", BackupFolder) hshParams.Add("BackupFolder", BackupFolder)
hshParams.Add("Sync", Sync) hshParams.Add("Sync", Sync)
hshParams.Add("CheckSum", CheckSum)
hshParams.Add("StartWithWindows", StartWithWindows) hshParams.Add("StartWithWindows", StartWithWindows)
hshParams.Add("TimeTracking", TimeTracking) hshParams.Add("TimeTracking", TimeTracking)
hshParams.Add("SupressBackup", SupressBackup) hshParams.Add("SupressBackup", SupressBackup)
@@ -272,6 +291,9 @@ Public Class mgrSettings
hshParams.Add("Custom7zLocation", Custom7zLocation) hshParams.Add("Custom7zLocation", Custom7zLocation)
hshParams.Add("SyncFields", SyncFields) hshParams.Add("SyncFields", SyncFields)
hshParams.Add("AutoSaveLog", AutoSaveLog) hshParams.Add("AutoSaveLog", AutoSaveLog)
hshParams.Add("AutoRestore", AutoRestore)
hshParams.Add("AutoMark", AutoMark)
hshParams.Add("SessionTracking", SessionTracking)
oDatabase.RunParamQuery(sSQL, hshParams) oDatabase.RunParamQuery(sSQL, hshParams)
End Sub End Sub
@@ -295,7 +317,6 @@ Public Class mgrSettings
RestoreOnLaunch = CBool(dr("RestoreOnLaunch")) RestoreOnLaunch = CBool(dr("RestoreOnLaunch"))
BackupFolder = CStr(dr("BackupFolder")) BackupFolder = CStr(dr("BackupFolder"))
Sync = CBool(dr("Sync")) Sync = CBool(dr("Sync"))
CheckSum = CBool(dr("CheckSum"))
StartWithWindows = CBool(dr("StartWithWindows")) StartWithWindows = CBool(dr("StartWithWindows"))
TimeTracking = CBool(dr("TimeTracking")) TimeTracking = CBool(dr("TimeTracking"))
SupressBackup = CBool(dr("SupressBackup")) SupressBackup = CBool(dr("SupressBackup"))
@@ -305,6 +326,9 @@ Public Class mgrSettings
If Not IsDBNull(dr("Custom7zLocation")) Then Custom7zLocation = CStr(dr("Custom7zLocation")) If Not IsDBNull(dr("Custom7zLocation")) Then Custom7zLocation = CStr(dr("Custom7zLocation"))
SyncFields = CInt(dr("SyncFields")) SyncFields = CInt(dr("SyncFields"))
AutoSaveLog = CBool(dr("AutoSaveLog")) AutoSaveLog = CBool(dr("AutoSaveLog"))
AutoRestore = CBool(dr("AutoRestore"))
AutoMark = CBool(dr("AutoMark"))
SessionTracking = CBool(dr("SessionTracking"))
Next Next
oDatabase.Disconnect() oDatabase.Disconnect()
+40 -15
View File
@@ -6,18 +6,22 @@ Imports System.Net
Public Class mgrXML 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 oList As List(Of Game)
Dim hshList As New Hashtable Dim hshList As New Hashtable
Dim hshDupeList As New Hashtable Dim hshDupeList As New Hashtable
Dim oExportData As ExportData
Dim oGame As clsGame Dim oGame As clsGame
'If the file doesn't exist return an empty list 'If the file doesn't exist return an empty list
If Not File.Exists(sLocation) And Not bWebRead Then If Not File.Exists(sLocation) And Not bWebRead Then
Return hshList Return hshList
End If End If
oList = ImportandDeserialize(sLocation, bWebRead) oExportData = ImportandDeserialize(sLocation, bWebRead)
oList = oExportData.Configurations
oExportInfo = oExportData
For Each g As Game In oList For Each g As Game In oList
oGame = New clsGame oGame = New clsGame
@@ -28,6 +32,9 @@ Public Class mgrXML
oGame.FolderSave = g.FolderSave oGame.FolderSave = g.FolderSave
oGame.FileType = g.FileType oGame.FileType = g.FileType
oGame.ExcludeList = g.ExcludeList oGame.ExcludeList = g.ExcludeList
oGame.MonitorOnly = g.MonitorOnly
oGame.Parameter = g.Parameter
oGame.Comments = g.Comments
For Each t As Tag In g.Tags For Each t As Tag In g.Tags
oGame.ImportTags.Add(t) oGame.ImportTags.Add(t)
Next Next
@@ -43,38 +50,56 @@ Public Class mgrXML
Return hshList Return hshList
End Function 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 oReader As StreamReader
Dim oWebClient As WebClient 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 oSerializer As XmlSerializer
Dim oList As New List(Of Game) Dim oExportData As New ExportData
Try Try
If bWebRead Then oReader = ReadImportData(sLocation, bWebRead)
oWebClient = New WebClient oSerializer = New XmlSerializer(GetType(ExportData), New XmlRootAttribute("gbm"))
oReader = New StreamReader(oWebClient.OpenRead(sLocation)) oExportData = oSerializer.Deserialize(oReader)
Else oReader.Close()
oReader = New StreamReader(sLocation)
'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 End If
oSerializer = New XmlSerializer(oList.GetType(), New XmlRootAttribute("gbm"))
oList = oSerializer.Deserialize(oReader)
oReader.Close()
Catch ex As Exception Catch ex As Exception
mgrCommon.ShowMessage(mgrXML_ErrorImportFailure, ex.Message, MsgBoxStyle.Exclamation) mgrCommon.ShowMessage(mgrXML_ErrorImportFailure, ex.Message, MsgBoxStyle.Exclamation)
End Try End Try
Return oList Return oExportData
End Function End Function
Public Shared Function SerializeAndExport(ByVal oList As List(Of Game), ByVal sLocation As String) As Boolean Public Shared Function SerializeAndExport(ByVal oList As List(Of Game), ByVal sLocation As String) As Boolean
Dim oSerializer As XmlSerializer Dim oSerializer As XmlSerializer
Dim oWriter As StreamWriter Dim oWriter As StreamWriter
Dim oExportData As ExportData
Try 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) oWriter = New StreamWriter(sLocation)
oSerializer.Serialize(oWriter.BaseStream, oList) oSerializer.Serialize(oWriter.BaseStream, oExportData)
oWriter.Flush() oWriter.Flush()
oWriter.Close() oWriter.Close()
Return True Return True
+1 -1
View File
@@ -24,7 +24,7 @@ Namespace My
<Global.System.Diagnostics.DebuggerStepThroughAttribute()> _ <Global.System.Diagnostics.DebuggerStepThroughAttribute()> _
Public Sub New() Public Sub New()
MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows) MyBase.New(Global.Microsoft.VisualBasic.ApplicationServices.AuthenticationMode.Windows)
Me.IsSingleInstance = false Me.IsSingleInstance = true
Me.EnableVisualStyles = true Me.EnableVisualStyles = true
Me.SaveMySettingsOnExit = false Me.SaveMySettingsOnExit = false
Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses Me.ShutDownStyle = Global.Microsoft.VisualBasic.ApplicationServices.ShutdownMode.AfterMainFormCloses
+1 -1
View File
@@ -2,7 +2,7 @@
<MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema"> <MyApplicationData xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<MySubMain>true</MySubMain> <MySubMain>true</MySubMain>
<MainForm>frmMain</MainForm> <MainForm>frmMain</MainForm>
<SingleInstance>false</SingleInstance> <SingleInstance>true</SingleInstance>
<ShutdownMode>0</ShutdownMode> <ShutdownMode>0</ShutdownMode>
<EnableVisualStyles>true</EnableVisualStyles> <EnableVisualStyles>true</EnableVisualStyles>
<AuthenticationMode>0</AuthenticationMode> <AuthenticationMode>0</AuthenticationMode>
+3 -3
View File
@@ -14,7 +14,7 @@ Imports System.Runtime.InteropServices
<Assembly: AssemblyDescription("Game Backup Monitor")> <Assembly: AssemblyDescription("Game Backup Monitor")>
<Assembly: AssemblyCompany("Michael J. Seiferling")> <Assembly: AssemblyCompany("Michael J. Seiferling")>
<Assembly: AssemblyProduct("Game Backup Monitor")> <Assembly: AssemblyProduct("Game Backup Monitor")>
<Assembly: AssemblyCopyright("Copyright © 2016 Michael J. Seiferling")> <Assembly: AssemblyCopyright("Copyright © 2017 Michael J. Seiferling")>
<Assembly: AssemblyTrademark("")> <Assembly: AssemblyTrademark("")>
<Assembly: ComVisible(False)> <Assembly: ComVisible(False)>
@@ -33,7 +33,7 @@ Imports System.Runtime.InteropServices
' by using the '*' as shown below: ' by using the '*' as shown below:
' <Assembly: AssemblyVersion("1.0.*")> ' <Assembly: AssemblyVersion("1.0.*")>
<Assembly: AssemblyVersion("0.98.*")> <Assembly: AssemblyVersion("1.0.5.*")>
<Assembly: AssemblyFileVersion("0.98.0.0")> <Assembly: AssemblyFileVersion("1.0.5.0")>
<Assembly: NeutralResourcesLanguageAttribute("en")> <Assembly: NeutralResourcesLanguageAttribute("en")>
+712 -73
View File
File diff suppressed because it is too large Load Diff
+252 -39
View File
@@ -122,7 +122,7 @@
<value>..\Resources\Admin.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value> <value>..\Resources\Admin.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data> </data>
<data name="frmMain_About" xml:space="preserve"> <data name="frmMain_About" xml:space="preserve">
<value>Game Backup Monitor[BR]Version: [PARAM] Beta ([PARAM])[BR]Build: [PARAM][BR][PARAM][BR][BR]This program comes with ABSOLUTELY NO WARRANTY.[BR]This is free software, and you are welcome to redistribute it under certain conditions.[BR][BR]See gpl-3.0.html in the program folder for details.</value> <value>Game Backup Monitor[BR]Version: [PARAM] ([PARAM])[BR]Build: [PARAM][BR]SQLite: [PARAM][BR][BR][PARAM][BR][BR]This program comes with ABSOLUTELY NO WARRANTY.[BR]This is free software, and you are welcome to redistribute it under certain conditions.[BR][BR]See gpl-3.0.html in the program folder for details.</value>
</data> </data>
<data name="frmMain_ManifestAreadyClean" xml:space="preserve"> <data name="frmMain_ManifestAreadyClean" xml:space="preserve">
<value>The local manifest is clean.</value> <value>The local manifest is clean.</value>
@@ -287,10 +287,10 @@
<value>Multiple Games Detected</value> <value>Multiple Games Detected</value>
</data> </data>
<data name="frmMain_NewSaveNotificationMulti" xml:space="preserve"> <data name="frmMain_NewSaveNotificationMulti" xml:space="preserve">
<value>[PARAM] New Saves Pending</value> <value>[PARAM] New Backups Pending</value>
</data> </data>
<data name="frmMain_NewSaveNotificationSingle" xml:space="preserve"> <data name="frmMain_NewSaveNotificationSingle" xml:space="preserve">
<value>[PARAM] New Save Pending</value> <value>[PARAM] New Backup Pending</value>
</data> </data>
<data name="frmMain_NoDetails" xml:space="preserve"> <data name="frmMain_NoDetails" xml:space="preserve">
<value>Game details are unavailable.</value> <value>Game details are unavailable.</value>
@@ -424,12 +424,6 @@
<data name="App_ConfirmDirty" xml:space="preserve"> <data name="App_ConfirmDirty" xml:space="preserve">
<value>There are unsaved changes on this form. Do you want to save?</value> <value>There are unsaved changes on this form. Do you want to save?</value>
</data> </data>
<data name="App_KB" xml:space="preserve">
<value>[PARAM] KB</value>
</data>
<data name="App_MB" xml:space="preserve">
<value>[PARAM] MB</value>
</data>
<data name="frmGameManager_BackupTimeAndName" xml:space="preserve"> <data name="frmGameManager_BackupTimeAndName" xml:space="preserve">
<value>[PARAM] ([PARAM])</value> <value>[PARAM] ([PARAM])</value>
</data> </data>
@@ -659,7 +653,7 @@
<value>Custom</value> <value>Custom</value>
</data> </data>
<data name="frmGameManager_optPendingRestores" xml:space="preserve"> <data name="frmGameManager_optPendingRestores" xml:space="preserve">
<value>New Saves Pending</value> <value>New Backups Pending</value>
</data> </data>
<data name="frmGameManager_OutofSync" xml:space="preserve"> <data name="frmGameManager_OutofSync" xml:space="preserve">
<value>Out of Sync</value> <value>Out of Sync</value>
@@ -889,29 +883,20 @@
<data name="frmFileFolderSearch_SwitchDrives" xml:space="preserve"> <data name="frmFileFolderSearch_SwitchDrives" xml:space="preserve">
<value>Do you wish to search the [PARAM] drive?</value> <value>Do you wish to search the [PARAM] drive?</value>
</data> </data>
<data name="frmFilter_btnAdd" xml:space="preserve"> <data name="frmFilter_btnIncludeAdd" xml:space="preserve">
<value>&gt;</value> <value>&lt;</value>
</data> </data>
<data name="frmFilter_btnOK" xml:space="preserve"> <data name="frmFilter_btnOK" xml:space="preserve">
<value>&amp;OK</value> <value>&amp;OK</value>
</data> </data>
<data name="frmFilter_btnRemove" xml:space="preserve"> <data name="frmFilter_btnIncludeRemove" xml:space="preserve">
<value>&lt;</value> <value>&gt;</value>
</data> </data>
<data name="frmFilter_FormName" xml:space="preserve"> <data name="frmFilter_FormName" xml:space="preserve">
<value>Custom Filter</value> <value>Custom Filter</value>
</data> </data>
<data name="frmFilter_lblCompany" xml:space="preserve"> <data name="frmFilter_lblIncludeTags" xml:space="preserve">
<value>Company:</value> <value>Include Tags</value>
</data>
<data name="frmFilter_lblGameTags" xml:space="preserve">
<value>Current Filter</value>
</data>
<data name="frmFilter_lblName" xml:space="preserve">
<value>Name:</value>
</data>
<data name="frmFilter_lblProcess" xml:space="preserve">
<value>Process:</value>
</data> </data>
<data name="frmFilter_lblTags" xml:space="preserve"> <data name="frmFilter_lblTags" xml:space="preserve">
<value>Available Tags</value> <value>Available Tags</value>
@@ -920,18 +905,18 @@
<value>All Tags</value> <value>All Tags</value>
</data> </data>
<data name="frmFilter_optAnd" xml:space="preserve"> <data name="frmFilter_optAnd" xml:space="preserve">
<value>And</value> <value>All</value>
</data> </data>
<data name="frmFilter_optAny" xml:space="preserve"> <data name="frmFilter_optAny" xml:space="preserve">
<value>Any Tag</value> <value>Any Tag</value>
</data> </data>
<data name="frmFilter_optGameInfo" xml:space="preserve"> <data name="frmFilter_chkGameInfo" xml:space="preserve">
<value>Game Information</value> <value>Game Information</value>
</data> </data>
<data name="frmFilter_optOr" xml:space="preserve"> <data name="frmFilter_optOr" xml:space="preserve">
<value>Or</value> <value>Any</value>
</data> </data>
<data name="frmFilter_optTag" xml:space="preserve"> <data name="frmFilter_chkTag" xml:space="preserve">
<value>Tag</value> <value>Tag</value>
</data> </data>
<data name="frmGameTags_btnAdd" xml:space="preserve"> <data name="frmGameTags_btnAdd" xml:space="preserve">
@@ -1021,11 +1006,11 @@
<data name="frmIncludeExclude_ToolTipTitle" xml:space="preserve"> <data name="frmIncludeExclude_ToolTipTitle" xml:space="preserve">
<value>Saved Game Explorer</value> <value>Saved Game Explorer</value>
</data> </data>
<data name="frmFilter_grpGameInfoOptions" xml:space="preserve"> <data name="frmFilter_grpFilterType" xml:space="preserve">
<value>Options</value> <value>Filter Type</value>
</data> </data>
<data name="frmFilter_grpTagOptions" xml:space="preserve"> <data name="frmFilter_grpTagOptions" xml:space="preserve">
<value>Options</value> <value>Include Options</value>
</data> </data>
<data name="frmGameManager_grpConfig" xml:space="preserve"> <data name="frmGameManager_grpConfig" xml:space="preserve">
<value>Configuration</value> <value>Configuration</value>
@@ -1075,9 +1060,6 @@
<data name="frmSettings_chkBackupConfirm" xml:space="preserve"> <data name="frmSettings_chkBackupConfirm" xml:space="preserve">
<value>Disable backup confirmation</value> <value>Disable backup confirmation</value>
</data> </data>
<data name="frmSettings_chkCheckSum" xml:space="preserve">
<value>Verify backup files with a checksum</value>
</data>
<data name="frmSettings_chkCreateFolder" xml:space="preserve"> <data name="frmSettings_chkCreateFolder" xml:space="preserve">
<value>Create a sub-folder for each game</value> <value>Create a sub-folder for each game</value>
</data> </data>
@@ -1087,8 +1069,8 @@
<data name="frmSettings_chkOverwriteWarning" xml:space="preserve"> <data name="frmSettings_chkOverwriteWarning" xml:space="preserve">
<value>Show overwrite warning</value> <value>Show overwrite warning</value>
</data> </data>
<data name="frmSettings_chkRestoreOnLaunch" xml:space="preserve"> <data name="frmSettings_chkRestoreNotify" xml:space="preserve">
<value>Notify when there are new backup files to restore</value> <value>Display notifications about new backups</value>
</data> </data>
<data name="frmSettings_chkShowDetectionTips" xml:space="preserve"> <data name="frmSettings_chkShowDetectionTips" xml:space="preserve">
<value>Show detection notifications</value> <value>Show detection notifications</value>
@@ -1306,8 +1288,8 @@
<data name="mgrBackup_BackupInProgress" xml:space="preserve"> <data name="mgrBackup_BackupInProgress" xml:space="preserve">
<value>Backup of [PARAM] in progress...</value> <value>Backup of [PARAM] in progress...</value>
</data> </data>
<data name="mgrBackup_BackupWarnings" xml:space="preserve"> <data name="mgrBackup_7zWarnings" xml:space="preserve">
<value>[PARAM] backup finished with warnings or errors.</value> <value>[PARAM] backup completed with warnings.</value>
</data> </data>
<data name="mgrBackup_ConfirmManifestConflict" xml:space="preserve"> <data name="mgrBackup_ConfirmManifestConflict" xml:space="preserve">
<value>The manifest shows the backup folder contains a backup for [PARAM] that has not been restored on this computer.[BR][BR]Do you want to overwrite this file anyway?</value> <value>The manifest shows the backup folder contains a backup for [PARAM] that has not been restored on this computer.[BR][BR]Do you want to overwrite this file anyway?</value>
@@ -1732,4 +1714,235 @@
<data name="frmGameManager_Unknown" xml:space="preserve"> <data name="frmGameManager_Unknown" xml:space="preserve">
<value>Unknown</value> <value>Unknown</value>
</data> </data>
<data name="frmGameManager_chkCleanFolder" xml:space="preserve">
<value>Delete folder on restore</value>
</data>
<data name="frmMain_AutoMark" xml:space="preserve">
<value>The saved game folder for [PARAM] does not exist or could not be determined, the backup has been automatically marked as restored.</value>
</data>
<data name="frmMain_RestoreNotReady" xml:space="preserve">
<value>The backup file for [PARAM] is not ready to restore.</value>
</data>
<data name="frmSettings_chkAutoMark" xml:space="preserve">
<value>Automatically mark new backups as restored when appropriate</value>
</data>
<data name="frmSettings_grpBackupHandling" xml:space="preserve">
<value>Backup Handling</value>
</data>
<data name="frmSettings_chkAutoRestore" xml:space="preserve">
<value>Automatically restore new backups</value>
</data>
<data name="frmMain_AutoRestoreFailure" xml:space="preserve">
<value>[PARAM] has multiple configurations and cannot be automatically restored.</value>
</data>
<data name="frmMain_RestoreNotificationMulti" xml:space="preserve">
<value>[PARAM] new saved game backups are being automatically restored.</value>
</data>
<data name="frmMain_RestoreNotificationSingle" xml:space="preserve">
<value>A new saved game backup for [PARAM] is being automatically restored.</value>
</data>
<data name="frmMain_NoAutoMark" xml:space="preserve">
<value>The saved game folder for [PARAM] does not exist or could not be determined, this backup has been skipped.</value>
</data>
<data name="frmMain_NoCheckSum" xml:space="preserve">
<value>The backup file for [PARAM] has no checksum, it cannot be automatically restored.</value>
</data>
<data name="mgrBackup_ConfirmDiskSpace" xml:space="preserve">
<value>You may not have enough disk space available to perform a backup.[BR][BR]Do you want to continue anyway?</value>
</data>
<data name="mgrBackup_ErrorDiskSpace" xml:space="preserve">
<value>Backup aborted due to lack of disk space.</value>
</data>
<data name="mgrCommon_AvailableDiskSpace" xml:space="preserve">
<value>Available Disk Space: [PARAM]</value>
</data>
<data name="mgrCommon_GB" xml:space="preserve">
<value>[PARAM] GB</value>
</data>
<data name="mgrCommon_KB" xml:space="preserve">
<value>[PARAM] KB</value>
</data>
<data name="mgrCommon_MB" xml:space="preserve">
<value>[PARAM] MB</value>
</data>
<data name="mgrCommon_PB" xml:space="preserve">
<value>[PARAM] PB</value>
</data>
<data name="mgrCommon_SavedGameFolderSize" xml:space="preserve">
<value>[PARAM] Save Folder Size: [PARAM]</value>
</data>
<data name="mgrCommon_TB" xml:space="preserve">
<value>[PARAM] TB</value>
</data>
<data name="frmGameManager_lblParameter" xml:space="preserve">
<value>Parameter:</value>
</data>
<data name="frmGameManager_ErrorProcessParameterDupe" xml:space="preserve">
<value>A game with this exact process and parameter already exists.</value>
</data>
<data name="mgrCommon_B" xml:space="preserve">
<value>[PARAM] B</value>
</data>
<data name="mgrBackup_7zCommandFailure" xml:space="preserve">
<value>[PARAM] backup failed due to a malformed command.</value>
</data>
<data name="mgrBackup_7zFatalError" xml:space="preserve">
<value>[PARAM] backup failed due to an error.</value>
</data>
<data name="App_ErrorFocus" xml:space="preserve">
<value>GBM is busy with an open window on your desktop.</value>
</data>
<data name="frmFilter_grpSorting" xml:space="preserve">
<value>Sorting</value>
</data>
<data name="frmFilter_optSortAsc" xml:space="preserve">
<value>Ascending</value>
</data>
<data name="frmFilter_optSortDesc" xml:space="preserve">
<value>Descending</value>
</data>
<data name="frmFilter_FieldCompany" xml:space="preserve">
<value>Company</value>
</data>
<data name="frmFilter_FieldHours" xml:space="preserve">
<value>Hours</value>
</data>
<data name="frmFilter_FieldName" xml:space="preserve">
<value>Name</value>
</data>
<data name="frmFilter_FieldProcess" xml:space="preserve">
<value>Process</value>
</data>
<data name="frmFilter_btnAddFilter" xml:space="preserve">
<value>Add</value>
</data>
<data name="frmFilter_btnRemoveFilter" xml:space="preserve">
<value>Remove</value>
</data>
<data name="frmFilter_FieldParameter" xml:space="preserve">
<value>Parameter</value>
</data>
<data name="frmFilter_FieldVersion" xml:space="preserve">
<value>Version</value>
</data>
<data name="frmFilter_lblCurrentFilters" xml:space="preserve">
<value>Current Filters</value>
</data>
<data name="frmFilter_lblFields" xml:space="preserve">
<value>Available Fields</value>
</data>
<data name="frmFilter_lblFilterData" xml:space="preserve">
<value>Filter</value>
</data>
<data name="frmFilter_cboBoolFilterDisabled" xml:space="preserve">
<value>Disabled</value>
</data>
<data name="frmFilter_cboBoolFilterEnabled" xml:space="preserve">
<value>Enabled</value>
</data>
<data name="frmFilter_FieldBackupLimit" xml:space="preserve">
<value>Backup Limit *</value>
</data>
<data name="frmFilter_FieldCleanFolder" xml:space="preserve">
<value>Delete Folder on Restore</value>
</data>
<data name="frmFilter_FieldEnabled" xml:space="preserve">
<value>Monitor Game</value>
</data>
<data name="frmFilter_FieldExcludeList" xml:space="preserve">
<value>Exclude Items</value>
</data>
<data name="frmFilter_FieldFileType" xml:space="preserve">
<value>Include Items</value>
</data>
<data name="frmFilter_FieldFolderSave" xml:space="preserve">
<value>Save Entire Folder</value>
</data>
<data name="frmFilter_FieldIcon" xml:space="preserve">
<value>Icon</value>
</data>
<data name="frmFilter_FieldMonitorOnly" xml:space="preserve">
<value>Monitor Only</value>
</data>
<data name="frmFilter_FieldPath" xml:space="preserve">
<value>Save Path *</value>
</data>
<data name="frmFilter_FieldProcessPath" xml:space="preserve">
<value>Game Path</value>
</data>
<data name="frmFilter_FieldTimeStamp" xml:space="preserve">
<value>Save Multiple Backups</value>
</data>
<data name="frmFilter_lblSortsFields" xml:space="preserve">
<value>Available Fields</value>
</data>
<data name="frmFilter_lblWarning" xml:space="preserve">
<value>* Indicates a field that may give unexpected results.</value>
</data>
<data name="frmFilter_lstFilterContains" xml:space="preserve">
<value>contains</value>
</data>
<data name="frmFilter_grpSortOptions" xml:space="preserve">
<value>Sort Options</value>
</data>
<data name="frmFilter_FieldComments" xml:space="preserve">
<value>Comments</value>
</data>
<data name="frmFilter_btnExcludeAdd" xml:space="preserve">
<value>&gt;</value>
</data>
<data name="frmFilter_btnExcludeRemove" xml:space="preserve">
<value>&lt;</value>
</data>
<data name="frmFilter_lblExcludeTags" xml:space="preserve">
<value>Exclude Tags</value>
</data>
<data name="frmFilter_lblNot" xml:space="preserve">
<value>Not</value>
</data>
<data name="frmMain_gMonToolsSessions" xml:space="preserve">
<value>&amp;Session Viewer...</value>
</data>
<data name="frmSessions_ColumnEnd" xml:space="preserve">
<value>End</value>
</data>
<data name="frmSessions_ColumnGameName" xml:space="preserve">
<value>Game</value>
</data>
<data name="frmSessions_ColumnStart" xml:space="preserve">
<value>Start</value>
</data>
<data name="frmSessions_Name" xml:space="preserve">
<value>Session Viewer</value>
</data>
<data name="frmMain_ErrorNoSessions" xml:space="preserve">
<value>There is currently no session data to display.</value>
</data>
<data name="frmSessions_btnClose" xml:space="preserve">
<value>&amp;Close</value>
</data>
<data name="frmSessions_btnDelete" xml:space="preserve">
<value>&amp;Delete Session</value>
</data>
<data name="frmSessions_btnReset" xml:space="preserve">
<value>&amp;Reset Filters</value>
</data>
<data name="frmSessions_ColumnMonitorID" xml:space="preserve">
<value>MonitorID</value>
</data>
<data name="frmSessions_ConfirmDelete" xml:space="preserve">
<value>Are you sure you want to delete the selected session(s)? This cannot be undone.</value>
</data>
<data name="frmSessions_lblDateRange" xml:space="preserve">
<value>Date Range:</value>
</data>
<data name="frmSessions_lblFilter" xml:space="preserve">
<value>Game Filter:</value>
</data>
<data name="frmMain_WarningSessionsDisabled" xml:space="preserve">
<value>Session tracking is currently disabled.[BR][BR]Enable session tracking in Settings if you'd like to track data for individual gaming sessions.</value>
</data>
<data name="frmSettings_chkSessionTracking" xml:space="preserve">
<value>Enable session tracking</value>
</data>
</root> </root>
+19 -21
View File
@@ -1,33 +1,31 @@
Game Backup Monitor v0.98 Readme Game Backup Monitor v1.0.5 Readme
http://mikemaximus.github.io/gbm-web/ http://mikemaximus.github.io/gbm-web/
gamebackupmonitor@gmail.com gamebackupmonitor@gmail.com
September 1, 2016 December 8, 2017
Disclaimer: New in 1.0.5
This is beta release software. You may still encounter some bugs. All Platforms:
New in 0.98 - 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.
- (All) Redesigned GBM's ability to manage multiple backups per game. Windows Only:
- The "Timestamp each backup" option has been renamed "Save multiple backups".
- You can limit the amount of backups you keep for each game by setting a limit (2 to 100).
- GBM will keep your backup folder clean by automatically deleting old backups as limits are reached or modified.
- The Game Manager now allows you to browse and manage ALL backups for each game, not just the latest backup.
- (All) Using "Monitor Only" no longer puts anys limitations on the game configuration or available features.
- (Windows Installer) The installer will now properly go into upgrade mode if a prior version of GBM is installed. Note: 32-bit and 64-bit qualify as different versions.
- (Windows Installer) The installer will now create an uninstall entry in Add/Remove Programs (Apps & Features).
- (Linux) 64-bit games running in Wine will now be properly detected.
- (Linux) Add Game Wizard will no longer remove all extensions when selecting an executable.
- (Linux) GBM now prefers to use an absolute path when creating Linux game configurations.
Important Upgrade Information: - Only one instance of GBM can now be running.
- The v0.98 Game Manager will not detect old backup files made using the "Timestamp each backup" setting in prior versions. Linux Only:
- Configurations using the "Timestamp each backup" option will have "Save multiple backups" automatically enabled with a backup limit of 5.
- If "Timestamp each backup" is currently set to sync, then "Save multiple backups" will also be set to sync after upgrading.
For more information regarding Linux support read the FAQ at http://mikemaximus.github.io/gbm-web/linux.html - 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 The entire version history of GBM releases is available at http://mikemaximus.github.io/gbm-web/versionhistory.html
Binary file not shown.
Binary file not shown.
+674
View File
@@ -0,0 +1,674 @@
GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
The GNU General Public License is a free, copyleft license for
software and other kinds of works.
The licenses for most software and other practical works are designed
to take away your freedom to share and change the works. By contrast,
the GNU General Public License is intended to guarantee your freedom to
share and change all versions of a program--to make sure it remains free
software for all its users. We, the Free Software Foundation, use the
GNU General Public License for most of our software; it applies also to
any other work released this way by its authors. You can apply it to
your programs, too.
When we speak of free software, we are referring to freedom, not
price. Our General Public Licenses are designed to make sure that you
have the freedom to distribute copies of free software (and charge for
them if you wish), that you receive source code or can get it if you
want it, that you can change the software or use pieces of it in new
free programs, and that you know you can do these things.
To protect your rights, we need to prevent others from denying you
these rights or asking you to surrender the rights. Therefore, you have
certain responsibilities if you distribute copies of the software, or if
you modify it: responsibilities to respect the freedom of others.
For example, if you distribute copies of such a program, whether
gratis or for a fee, you must pass on to the recipients the same
freedoms that you received. You must make sure that they, too, receive
or can get the source code. And you must show them these terms so they
know their rights.
Developers that use the GNU GPL protect your rights with two steps:
(1) assert copyright on the software, and (2) offer you this License
giving you legal permission to copy, distribute and/or modify it.
For the developers' and authors' protection, the GPL clearly explains
that there is no warranty for this free software. For both users' and
authors' sake, the GPL requires that modified versions be marked as
changed, so that their problems will not be attributed erroneously to
authors of previous versions.
Some devices are designed to deny users access to install or run
modified versions of the software inside them, although the manufacturer
can do so. This is fundamentally incompatible with the aim of
protecting users' freedom to change the software. The systematic
pattern of such abuse occurs in the area of products for individuals to
use, which is precisely where it is most unacceptable. Therefore, we
have designed this version of the GPL to prohibit the practice for those
products. If such problems arise substantially in other domains, we
stand ready to extend this provision to those domains in future versions
of the GPL, as needed to protect the freedom of users.
Finally, every program is threatened constantly by software patents.
States should not allow patents to restrict development and use of
software on general-purpose computers, but in those that do, we wish to
avoid the special danger that patents applied to a free program could
make it effectively proprietary. To prevent this, the GPL assures that
patents cannot be used to render the program non-free.
The precise terms and conditions for copying, distribution and
modification follow.
TERMS AND CONDITIONS
0. Definitions.
"This License" refers to version 3 of the GNU General Public License.
"Copyright" also means copyright-like laws that apply to other kinds of
works, such as semiconductor masks.
"The Program" refers to any copyrightable work licensed under this
License. Each licensee is addressed as "you". "Licensees" and
"recipients" may be individuals or organizations.
To "modify" a work means to copy from or adapt all or part of the work
in a fashion requiring copyright permission, other than the making of an
exact copy. The resulting work is called a "modified version" of the
earlier work or a work "based on" the earlier work.
A "covered work" means either the unmodified Program or a work based
on the Program.
To "propagate" a work means to do anything with it that, without
permission, would make you directly or secondarily liable for
infringement under applicable copyright law, except executing it on a
computer or modifying a private copy. Propagation includes copying,
distribution (with or without modification), making available to the
public, and in some countries other activities as well.
To "convey" a work means any kind of propagation that enables other
parties to make or receive copies. Mere interaction with a user through
a computer network, with no transfer of a copy, is not conveying.
An interactive user interface displays "Appropriate Legal Notices"
to the extent that it includes a convenient and prominently visible
feature that (1) displays an appropriate copyright notice, and (2)
tells the user that there is no warranty for the work (except to the
extent that warranties are provided), that licensees may convey the
work under this License, and how to view a copy of this License. If
the interface presents a list of user commands or options, such as a
menu, a prominent item in the list meets this criterion.
1. Source Code.
The "source code" for a work means the preferred form of the work
for making modifications to it. "Object code" means any non-source
form of a work.
A "Standard Interface" means an interface that either is an official
standard defined by a recognized standards body, or, in the case of
interfaces specified for a particular programming language, one that
is widely used among developers working in that language.
The "System Libraries" of an executable work include anything, other
than the work as a whole, that (a) is included in the normal form of
packaging a Major Component, but which is not part of that Major
Component, and (b) serves only to enable use of the work with that
Major Component, or to implement a Standard Interface for which an
implementation is available to the public in source code form. A
"Major Component", in this context, means a major essential component
(kernel, window system, and so on) of the specific operating system
(if any) on which the executable work runs, or a compiler used to
produce the work, or an object code interpreter used to run it.
The "Corresponding Source" for a work in object code form means all
the source code needed to generate, install, and (for an executable
work) run the object code and to modify the work, including scripts to
control those activities. However, it does not include the work's
System Libraries, or general-purpose tools or generally available free
programs which are used unmodified in performing those activities but
which are not part of the work. For example, Corresponding Source
includes interface definition files associated with source files for
the work, and the source code for shared libraries and dynamically
linked subprograms that the work is specifically designed to require,
such as by intimate data communication or control flow between those
subprograms and other parts of the work.
The Corresponding Source need not include anything that users
can regenerate automatically from other parts of the Corresponding
Source.
The Corresponding Source for a work in source code form is that
same work.
2. Basic Permissions.
All rights granted under this License are granted for the term of
copyright on the Program, and are irrevocable provided the stated
conditions are met. This License explicitly affirms your unlimited
permission to run the unmodified Program. The output from running a
covered work is covered by this License only if the output, given its
content, constitutes a covered work. This License acknowledges your
rights of fair use or other equivalent, as provided by copyright law.
You may make, run and propagate covered works that you do not
convey, without conditions so long as your license otherwise remains
in force. You may convey covered works to others for the sole purpose
of having them make modifications exclusively for you, or provide you
with facilities for running those works, provided that you comply with
the terms of this License in conveying all material for which you do
not control copyright. Those thus making or running the covered works
for you must do so exclusively on your behalf, under your direction
and control, on terms that prohibit them from making any copies of
your copyrighted material outside their relationship with you.
Conveying under any other circumstances is permitted solely under
the conditions stated below. Sublicensing is not allowed; section 10
makes it unnecessary.
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
No covered work shall be deemed part of an effective technological
measure under any applicable law fulfilling obligations under article
11 of the WIPO copyright treaty adopted on 20 December 1996, or
similar laws prohibiting or restricting circumvention of such
measures.
When you convey a covered work, you waive any legal power to forbid
circumvention of technological measures to the extent such circumvention
is effected by exercising rights under this License with respect to
the covered work, and you disclaim any intention to limit operation or
modification of the work as a means of enforcing, against the work's
users, your or third parties' legal rights to forbid circumvention of
technological measures.
4. Conveying Verbatim Copies.
You may convey verbatim copies of the Program's source code as you
receive it, in any medium, provided that you conspicuously and
appropriately publish on each copy an appropriate copyright notice;
keep intact all notices stating that this License and any
non-permissive terms added in accord with section 7 apply to the code;
keep intact all notices of the absence of any warranty; and give all
recipients a copy of this License along with the Program.
You may charge any price or no price for each copy that you convey,
and you may offer support or warranty protection for a fee.
5. Conveying Modified Source Versions.
You may convey a work based on the Program, or the modifications to
produce it from the Program, in the form of source code under the
terms of section 4, provided that you also meet all of these conditions:
a) The work must carry prominent notices stating that you modified
it, and giving a relevant date.
b) The work must carry prominent notices stating that it is
released under this License and any conditions added under section
7. This requirement modifies the requirement in section 4 to
"keep intact all notices".
c) You must license the entire work, as a whole, under this
License to anyone who comes into possession of a copy. This
License will therefore apply, along with any applicable section 7
additional terms, to the whole of the work, and all its parts,
regardless of how they are packaged. This License gives no
permission to license the work in any other way, but it does not
invalidate such permission if you have separately received it.
d) If the work has interactive user interfaces, each must display
Appropriate Legal Notices; however, if the Program has interactive
interfaces that do not display Appropriate Legal Notices, your
work need not make them do so.
A compilation of a covered work with other separate and independent
works, which are not by their nature extensions of the covered work,
and which are not combined with it such as to form a larger program,
in or on a volume of a storage or distribution medium, is called an
"aggregate" if the compilation and its resulting copyright are not
used to limit the access or legal rights of the compilation's users
beyond what the individual works permit. Inclusion of a covered work
in an aggregate does not cause this License to apply to the other
parts of the aggregate.
6. Conveying Non-Source Forms.
You may convey a covered work in object code form under the terms
of sections 4 and 5, provided that you also convey the
machine-readable Corresponding Source under the terms of this License,
in one of these ways:
a) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by the
Corresponding Source fixed on a durable physical medium
customarily used for software interchange.
b) Convey the object code in, or embodied in, a physical product
(including a physical distribution medium), accompanied by a
written offer, valid for at least three years and valid for as
long as you offer spare parts or customer support for that product
model, to give anyone who possesses the object code either (1) a
copy of the Corresponding Source for all the software in the
product that is covered by this License, on a durable physical
medium customarily used for software interchange, for a price no
more than your reasonable cost of physically performing this
conveying of source, or (2) access to copy the
Corresponding Source from a network server at no charge.
c) Convey individual copies of the object code with a copy of the
written offer to provide the Corresponding Source. This
alternative is allowed only occasionally and noncommercially, and
only if you received the object code with such an offer, in accord
with subsection 6b.
d) Convey the object code by offering access from a designated
place (gratis or for a charge), and offer equivalent access to the
Corresponding Source in the same way through the same place at no
further charge. You need not require recipients to copy the
Corresponding Source along with the object code. If the place to
copy the object code is a network server, the Corresponding Source
may be on a different server (operated by you or a third party)
that supports equivalent copying facilities, provided you maintain
clear directions next to the object code saying where to find the
Corresponding Source. Regardless of what server hosts the
Corresponding Source, you remain obligated to ensure that it is
available for as long as needed to satisfy these requirements.
e) Convey the object code using peer-to-peer transmission, provided
you inform other peers where the object code and Corresponding
Source of the work are being offered to the general public at no
charge under subsection 6d.
A separable portion of the object code, whose source code is excluded
from the Corresponding Source as a System Library, need not be
included in conveying the object code work.
A "User Product" is either (1) a "consumer product", which means any
tangible personal property which is normally used for personal, family,
or household purposes, or (2) anything designed or sold for incorporation
into a dwelling. In determining whether a product is a consumer product,
doubtful cases shall be resolved in favor of coverage. For a particular
product received by a particular user, "normally used" refers to a
typical or common use of that class of product, regardless of the status
of the particular user or of the way in which the particular user
actually uses, or expects or is expected to use, the product. A product
is a consumer product regardless of whether the product has substantial
commercial, industrial or non-consumer uses, unless such uses represent
the only significant mode of use of the product.
"Installation Information" for a User Product means any methods,
procedures, authorization keys, or other information required to install
and execute modified versions of a covered work in that User Product from
a modified version of its Corresponding Source. The information must
suffice to ensure that the continued functioning of the modified object
code is in no case prevented or interfered with solely because
modification has been made.
If you convey an object code work under this section in, or with, or
specifically for use in, a User Product, and the conveying occurs as
part of a transaction in which the right of possession and use of the
User Product is transferred to the recipient in perpetuity or for a
fixed term (regardless of how the transaction is characterized), the
Corresponding Source conveyed under this section must be accompanied
by the Installation Information. But this requirement does not apply
if neither you nor any third party retains the ability to install
modified object code on the User Product (for example, the work has
been installed in ROM).
The requirement to provide Installation Information does not include a
requirement to continue to provide support service, warranty, or updates
for a work that has been modified or installed by the recipient, or for
the User Product in which it has been modified or installed. Access to a
network may be denied when the modification itself materially and
adversely affects the operation of the network or violates the rules and
protocols for communication across the network.
Corresponding Source conveyed, and Installation Information provided,
in accord with this section must be in a format that is publicly
documented (and with an implementation available to the public in
source code form), and must require no special password or key for
unpacking, reading or copying.
7. Additional Terms.
"Additional permissions" are terms that supplement the terms of this
License by making exceptions from one or more of its conditions.
Additional permissions that are applicable to the entire Program shall
be treated as though they were included in this License, to the extent
that they are valid under applicable law. If additional permissions
apply only to part of the Program, that part may be used separately
under those permissions, but the entire Program remains governed by
this License without regard to the additional permissions.
When you convey a copy of a covered work, you may at your option
remove any additional permissions from that copy, or from any part of
it. (Additional permissions may be written to require their own
removal in certain cases when you modify the work.) You may place
additional permissions on material, added by you to a covered work,
for which you have or can give appropriate copyright permission.
Notwithstanding any other provision of this License, for material you
add to a covered work, you may (if authorized by the copyright holders of
that material) supplement the terms of this License with terms:
a) Disclaiming warranty or limiting liability differently from the
terms of sections 15 and 16 of this License; or
b) Requiring preservation of specified reasonable legal notices or
author attributions in that material or in the Appropriate Legal
Notices displayed by works containing it; or
c) Prohibiting misrepresentation of the origin of that material, or
requiring that modified versions of such material be marked in
reasonable ways as different from the original version; or
d) Limiting the use for publicity purposes of names of licensors or
authors of the material; or
e) Declining to grant rights under trademark law for use of some
trade names, trademarks, or service marks; or
f) Requiring indemnification of licensors and authors of that
material by anyone who conveys the material (or modified versions of
it) with contractual assumptions of liability to the recipient, for
any liability that these contractual assumptions directly impose on
those licensors and authors.
All other non-permissive additional terms are considered "further
restrictions" within the meaning of section 10. If the Program as you
received it, or any part of it, contains a notice stating that it is
governed by this License along with a term that is a further
restriction, you may remove that term. If a license document contains
a further restriction but permits relicensing or conveying under this
License, you may add to a covered work material governed by the terms
of that license document, provided that the further restriction does
not survive such relicensing or conveying.
If you add terms to a covered work in accord with this section, you
must place, in the relevant source files, a statement of the
additional terms that apply to those files, or a notice indicating
where to find the applicable terms.
Additional terms, permissive or non-permissive, may be stated in the
form of a separately written license, or stated as exceptions;
the above requirements apply either way.
8. Termination.
You may not propagate or modify a covered work except as expressly
provided under this License. Any attempt otherwise to propagate or
modify it is void, and will automatically terminate your rights under
this License (including any patent licenses granted under the third
paragraph of section 11).
However, if you cease all violation of this License, then your
license from a particular copyright holder is reinstated (a)
provisionally, unless and until the copyright holder explicitly and
finally terminates your license, and (b) permanently, if the copyright
holder fails to notify you of the violation by some reasonable means
prior to 60 days after the cessation.
Moreover, your license from a particular copyright holder is
reinstated permanently if the copyright holder notifies you of the
violation by some reasonable means, this is the first time you have
received notice of violation of this License (for any work) from that
copyright holder, and you cure the violation prior to 30 days after
your receipt of the notice.
Termination of your rights under this section does not terminate the
licenses of parties who have received copies or rights from you under
this License. If your rights have been terminated and not permanently
reinstated, you do not qualify to receive new licenses for the same
material under section 10.
9. Acceptance Not Required for Having Copies.
You are not required to accept this License in order to receive or
run a copy of the Program. Ancillary propagation of a covered work
occurring solely as a consequence of using peer-to-peer transmission
to receive a copy likewise does not require acceptance. However,
nothing other than this License grants you permission to propagate or
modify any covered work. These actions infringe copyright if you do
not accept this License. Therefore, by modifying or propagating a
covered work, you indicate your acceptance of this License to do so.
10. Automatic Licensing of Downstream Recipients.
Each time you convey a covered work, the recipient automatically
receives a license from the original licensors, to run, modify and
propagate that work, subject to this License. You are not responsible
for enforcing compliance by third parties with this License.
An "entity transaction" is a transaction transferring control of an
organization, or substantially all assets of one, or subdividing an
organization, or merging organizations. If propagation of a covered
work results from an entity transaction, each party to that
transaction who receives a copy of the work also receives whatever
licenses to the work the party's predecessor in interest had or could
give under the previous paragraph, plus a right to possession of the
Corresponding Source of the work from the predecessor in interest, if
the predecessor has it or can get it with reasonable efforts.
You may not impose any further restrictions on the exercise of the
rights granted or affirmed under this License. For example, you may
not impose a license fee, royalty, or other charge for exercise of
rights granted under this License, and you may not initiate litigation
(including a cross-claim or counterclaim in a lawsuit) alleging that
any patent claim is infringed by making, using, selling, offering for
sale, or importing the Program or any portion of it.
11. Patents.
A "contributor" is a copyright holder who authorizes use under this
License of the Program or a work on which the Program is based. The
work thus licensed is called the contributor's "contributor version".
A contributor's "essential patent claims" are all patent claims
owned or controlled by the contributor, whether already acquired or
hereafter acquired, that would be infringed by some manner, permitted
by this License, of making, using, or selling its contributor version,
but do not include claims that would be infringed only as a
consequence of further modification of the contributor version. For
purposes of this definition, "control" includes the right to grant
patent sublicenses in a manner consistent with the requirements of
this License.
Each contributor grants you a non-exclusive, worldwide, royalty-free
patent license under the contributor's essential patent claims, to
make, use, sell, offer for sale, import and otherwise run, modify and
propagate the contents of its contributor version.
In the following three paragraphs, a "patent license" is any express
agreement or commitment, however denominated, not to enforce a patent
(such as an express permission to practice a patent or covenant not to
sue for patent infringement). To "grant" such a patent license to a
party means to make such an agreement or commitment not to enforce a
patent against the party.
If you convey a covered work, knowingly relying on a patent license,
and the Corresponding Source of the work is not available for anyone
to copy, free of charge and under the terms of this License, through a
publicly available network server or other readily accessible means,
then you must either (1) cause the Corresponding Source to be so
available, or (2) arrange to deprive yourself of the benefit of the
patent license for this particular work, or (3) arrange, in a manner
consistent with the requirements of this License, to extend the patent
license to downstream recipients. "Knowingly relying" means you have
actual knowledge that, but for the patent license, your conveying the
covered work in a country, or your recipient's use of the covered work
in a country, would infringe one or more identifiable patents in that
country that you have reason to believe are valid.
If, pursuant to or in connection with a single transaction or
arrangement, you convey, or propagate by procuring conveyance of, a
covered work, and grant a patent license to some of the parties
receiving the covered work authorizing them to use, propagate, modify
or convey a specific copy of the covered work, then the patent license
you grant is automatically extended to all recipients of the covered
work and works based on it.
A patent license is "discriminatory" if it does not include within
the scope of its coverage, prohibits the exercise of, or is
conditioned on the non-exercise of one or more of the rights that are
specifically granted under this License. You may not convey a covered
work if you are a party to an arrangement with a third party that is
in the business of distributing software, under which you make payment
to the third party based on the extent of your activity of conveying
the work, and under which the third party grants, to any of the
parties who would receive the covered work from you, a discriminatory
patent license (a) in connection with copies of the covered work
conveyed by you (or copies made from those copies), or (b) primarily
for and in connection with specific products or compilations that
contain the covered work, unless you entered into that arrangement,
or that patent license was granted, prior to 28 March 2007.
Nothing in this License shall be construed as excluding or limiting
any implied license or other defenses to infringement that may
otherwise be available to you under applicable patent law.
12. No Surrender of Others' Freedom.
If conditions are imposed on you (whether by court order, agreement or
otherwise) that contradict the conditions of this License, they do not
excuse you from the conditions of this License. If you cannot convey a
covered work so as to satisfy simultaneously your obligations under this
License and any other pertinent obligations, then as a consequence you may
not convey it at all. For example, if you agree to terms that obligate you
to collect a royalty for further conveying from those to whom you convey
the Program, the only way you could satisfy both those terms and this
License would be to refrain entirely from conveying the Program.
13. Use with the GNU Affero General Public License.
Notwithstanding any other provision of this License, you have
permission to link or combine any covered work with a work licensed
under version 3 of the GNU Affero General Public License into a single
combined work, and to convey the resulting work. The terms of this
License will continue to apply to the part which is the covered work,
but the special requirements of the GNU Affero General Public License,
section 13, concerning interaction through a network will apply to the
combination as such.
14. Revised Versions of this License.
The Free Software Foundation may publish revised and/or new versions of
the GNU General Public License from time to time. Such new versions will
be similar in spirit to the present version, but may differ in detail to
address new problems or concerns.
Each version is given a distinguishing version number. If the
Program specifies that a certain numbered version of the GNU General
Public License "or any later version" applies to it, you have the
option of following the terms and conditions either of that numbered
version or of any later version published by the Free Software
Foundation. If the Program does not specify a version number of the
GNU General Public License, you may choose any version ever published
by the Free Software Foundation.
If the Program specifies that a proxy can decide which future
versions of the GNU General Public License can be used, that proxy's
public statement of acceptance of a version permanently authorizes you
to choose that version for the Program.
Later license versions may give you additional or different
permissions. However, no additional obligations are imposed on any
author or copyright holder as a result of your choosing to follow a
later version.
15. Disclaimer of Warranty.
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
16. Limitation of Liability.
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
SUCH DAMAGES.
17. Interpretation of Sections 15 and 16.
If the disclaimer of warranty and limitation of liability provided
above cannot be given local legal effect according to their terms,
reviewing courts shall apply local law that most closely approximates
an absolute waiver of all civil liability in connection with the
Program, unless a warranty or assumption of liability accompanies a
copy of the Program in return for a fee.
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.
To do so, attach the following notices to the program. It is safest
to attach them to the start of each source file to most effectively
state the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.
<one line to give the program's name and a brief idea of what it does.>
Copyright (C) <year> <name of author>
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
Also add information on how to contact you by electronic and paper mail.
If the program does terminal interaction, make it output a short
notice like this when it starts in an interactive mode:
<program> Copyright (C) <year> <name of author>
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
This is free software, and you are welcome to redistribute it
under certain conditions; type `show c' for details.
The hypothetical commands `show w' and `show c' should show the appropriate
parts of the General Public License. Of course, your program's commands
might be different; for a GUI interface, you would use an "about box".
You should also get your employer (if you work as a programmer) or school,
if any, to sign a "copyright disclaimer" for the program, if necessary.
For more information on this, and how to apply and follow the GNU GPL, see
<http://www.gnu.org/licenses/>.
The GNU General Public License does not permit incorporating your program
into proprietary programs. If your program is a subroutine library, you
may consider it more useful to permit linking proprietary applications with
the library. If this is what you want to do, use the GNU Lesser General
Public License instead of this License. But first, please read
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
+8 -8
View File
@@ -1,15 +1,15 @@
# [Game Backup Monitor] (http://mikemaximus.github.io/gbm-web/) # [Game Backup Monitor](http://mikemaximus.github.io/gbm-web/)
![Screenshot] (http://mikemaximus.github.io/gbm-web/images/manual/manual_01.jpg) ![Screenshot](http://mikemaximus.github.io/gbm-web/images/manual/manual_01.jpg)
Game Backup Monitor is a simple, but flexible application that detects games as you play them. Once you finish playing a game, a backup of the saved games will be made automatically using 7-Zip compression. GBM can be used on a single computer, or on multiple computers to effectively add cloud support to any game or application. Game Backup Monitor is a simple, but flexible application that detects games as you play them. Once you finish playing a game, a backup of the saved games will be made automatically using 7-Zip compression. GBM can be used on a single computer, or on multiple computers to effectively add cloud support to any game or application.
**License**: GNU General Public License version 3.0 (GPLv3)<br /> **License**: GNU General Public License version 3.0 (GPLv3)<br />
**Language**: English Only<br /> **Language**: English ([Translation FAQ](http://mikemaximus.github.io/gbm-web/translations.html))<br />
**Platform**: Windows (.NET 4) & Linux (Mono) **Platform**: Windows (.NET 4) & Linux (Mono)
[About Game Backup Monitor] (http://mikemaximus.github.io/gbm-web/about.html) <br /> [About Game Backup Monitor](http://mikemaximus.github.io/gbm-web/about.html) <br />
[Game Backup Monitor FAQ] (http://mikemaximus.github.io/gbm-web/faq.html) <br /> [Game Backup Monitor FAQ](http://mikemaximus.github.io/gbm-web/faq.html) <br />
[Game Backup Monitor Manual] (http://mikemaximus.github.io/gbm-web/manual.html) <br /> [Game Backup Monitor Manual](http://mikemaximus.github.io/gbm-web/manual.html) <br />
[List of Preconfigured Games] (http://mikemaximus.github.io/gbm-web/GBM_Official.xml) <br /> <br /> [List of Preconfigured Games](http://mikemaximus.github.io/gbm-web/GBM_Official.xml) <br /> <br />
Updates regarding this project are available via the [Game Backup Monitor web site] (http://mikemaximus.github.io/gbm-web/). Updates regarding this project are available via the [Game Backup Monitor web site](http://mikemaximus.github.io/gbm-web/).
+15
View File
@@ -0,0 +1,15 @@
[Desktop Entry]
Encoding=UTF-8
Type=Application
Version=1.0
Name=Game Backup Monitor
Comment=Monitors games and backs up their savegames
Comment[de]=Beobachtet Spiele und sichert ihre Spielstände
Path=/usr/local/bin
TryExec=mono
Exec=mono gbm
Terminal=false
Icon=gbm
Categories=Utility;Archiving;Monitor
+36
View File
@@ -0,0 +1,36 @@
ICONSIZES := 16 24 32 48 64 72 96 128 256
IMGMAGICK := $(shell command -v convert 2> /dev/null)
XDGUTILS := $(shell command -v xdg-desktop-menu 2> /dev/null)
define \n
endef
install: GBM.exe $(foreach size,$(ICONSIZES),gbm_$(size)x$(size).png)
ifndef XDGUTILS
$(error "xdg-desktop-menu is not available, please install xdg-utils")
endif
#rename it in a way, it can easily started from terminal
install GBM.exe /usr/local/bin/gbm;
#install icon in different sizes
$(foreach size,$(ICONSIZES),xdg-icon-resource install --mode system --novendor --noupdate --size $(size) gbm_$(size)x$(size).png gbm;$(\n))
xdg-icon-resource forceupdate --mode system;
#install .desktop file, which is used for running gbm from desktop and menus
xdg-desktop-menu install --mode system --novendor gbm.desktop;
uninstall: /usr/local/bin/gbm
ifndef XDGUTILS
$(error "xdg-desktop-menu is not available, please install xdg-utils")
endif
rm /usr/local/bin/gbm;
$(foreach size,$(ICONSIZES),xdg-icon-resource uninstall --mode system --novendor --noupdate --size $(size) gbm;$(\n))
xdg-icon-resource forceupdate --mode system;
xdg-desktop-menu uninstall --mode system --novendor gbm.desktop;
gbm_%.png: gbm.ico
ifndef IMGMAGICK
$(error "convert is not available, please install imagemagick")
endif
#extracts the correct ico index appended to the filename from identifys output
$(eval INDEX := $(shell identify gbm.ico | grep $* | cut -d" " -f1;))
convert '$(INDEX)' '$@';