201 Commits

Author SHA1 Message Date
MikeMaximus
d8aa35491d Updated readme.txt for v115 release 2018-10-10 13:21:37 -06:00
MikeMaximus
b7d62f38af Fixed broken process debugging 2018-10-09 20:43:28 -06:00
MikeMaximus
58e4c3f3f2 Merge branch 'master' of https://github.com/MikeMaximus/gbm 2018-10-04 23:47:05 -06:00
MikeMaximus
9d439e3d12 Fixed include/exclude builder not resolving paths 2018-10-04 23:46:10 -06:00
Michael J. Seiferling
9a046bcb4c Changed label for new path setting 2018-10-04 10:33:49 -06:00
Michael J. Seiferling
a556fa5da1 Improved import backup file functionality for #150 2018-10-04 09:51:57 -06:00
MikeMaximus
42726ac0ab Merge pull request #157 from MikeMaximus/v115_linux_changes
Merge v115 changes into master
2018-10-01 10:19:50 -06:00
Michael J. Seiferling
58ac76eba0 Fixed broken filtering on import 2018-10-01 09:02:48 -06:00
Michael J. Seiferling
f9b325ae67 Import tag mods for #148 2018-09-30 14:58:53 -06:00
Michael J. Seiferling
8d82b2efd3 Updated import version warning 2018-09-30 13:37:58 -06:00
MikeMaximus
cb49434a46 Allow importing official Windows configurations in Linux for #148 2018-09-28 10:34:48 -06:00
MikeMaximus
f659edff64 Updated readme.txt with current changes 2018-09-22 11:15:32 -06:00
Michael J. Seiferling
e325678e76 Handle LocalLow save locations for #148 2018-09-14 14:41:54 -06:00
Michael J. Seiferling
854d2ed537 Changed wine save path detection for #148 2018-09-14 12:43:57 -06:00
Michael J. Seiferling
c7e3e62ce1 Fix Windows save path detection for #148 2018-09-14 12:33:14 -06:00
Michael J. Seiferling
898e72f163 Restricted backup import functionality for #150 2018-09-14 11:46:20 -06:00
Michael J. Seiferling
333f7ac36a Prevent use of reserved variable names for custom variables for #148 and #152 2018-09-14 09:50:24 -06:00
Michael J. Seiferling
ace287f42a Fixed restore path display issue with multiple backups for #152 2018-09-14 09:01:56 -06:00
MikeMaximus
0f800565fe Added one-time warning for #150 2018-09-09 11:34:25 -06:00
MikeMaximus
7a4caab5a5 FIxed broken custom variable feature 2018-09-09 11:04:02 -06:00
MikeMaximus
c1b81585a0 Fixed Include button shortcut key 2018-09-09 09:11:58 -06:00
MikeMaximus
0fcbfbe430 Minor form design fixes 2018-09-08 23:52:06 -06:00
MikeMaximus
26d33206df Changes for issue #150 - Pass 1 2018-09-08 23:35:11 -06:00
MikeMaximus
dcbfad7513 Add path display support to "Restore Path" field for #152 2018-09-08 13:44:58 -06:00
MikeMaximus
8ab209c1a9 Added path display tooltip and options for #152 2018-09-08 13:20:02 -06:00
MikeMaximus
b674e4e82b Display variable path on Game Manager for #152 2018-09-08 11:30:55 -06:00
MikeMaximus
9fc53e74b1 Use linux variables in db upgrade for issue #152 2018-09-08 09:35:46 -06:00
MikeMaximus
fd6ddd4b85 Updated path replacing for #152 2018-09-08 08:16:34 -06:00
MikeMaximus
8800c4ebf4 Merge pull request #155 from basxto/v115_linux_changes
Export with Linux variables
2018-09-07 23:37:56 -06:00
Sebastian Riedel
9b89af931f Keep Windows variables untouched on Linux 2018-09-08 06:31:46 +02:00
Sebastian Riedel
874dfd4c86 Replace ~ only outside of variables 2018-09-08 06:11:50 +02:00
Sebastian Riedel
cc8d16f4a9 Export with Linux variables for #152 2018-09-08 05:11:13 +02:00
MikeMaximus
748a921d1c Changes for issue #152 - Pass 1 2018-09-06 12:35:14 -06:00
MikeMaximus
d74a6d50b1 Detection rewrite for issue #153 - Pass 3 2018-09-04 09:16:49 -06:00
MikeMaximus
7ca4178631 Detection rewrite for issue #153 - Pass 2 2018-09-03 15:57:01 -06:00
MikeMaximus
63da6eba19 Detection rewrite for issue #153 - Pass 1 2018-09-03 12:36:25 -06:00
MikeMaximus
3e141cebb5 Changes for issue #153 2018-09-01 14:40:05 -06:00
Michael J. Seiferling
52c9fe506f More detection fixes for issue #149 2018-08-31 08:54:54 -06:00
Michael J. Seiferling
b04c1bc18b Added new strings for issue #148 and #149 2018-08-30 10:53:29 -06:00
Michael J. Seiferling
647193f933 Changes for issues #148 and#149 2018-08-30 10:26:27 -06:00
Michael J. Seiferling
e6277f1ae4 Typo and comment fixes for issue #147 2018-08-25 19:58:09 -06:00
Michael J. Seiferling
ccd6d1fd39 Changes for issue #147 2018-08-25 19:40:17 -06:00
Michael J. Seiferling
0ed067e36f Updated readme for v1.1.4 2018-08-23 13:27:53 -06:00
Michael J. Seiferling
bca2fe2239 Removed ico compression for issue #146 2018-08-23 12:42:28 -06:00
Michael J. Seiferling
fa5d03ef52 Fixed sort logic for issue #145 2018-08-23 10:26:50 -06:00
Michael J. Seiferling
998a680999 Removed icon file extraction 2018-08-22 11:18:58 -06:00
Michael J. Seiferling
f5972da9eb Prevent file locking of custom icons 2018-08-22 10:26:19 -06:00
MikeMaximus
794b0f9908 Stop useless manifest conflict checks 2018-08-01 10:02:46 -06:00
Michael J. Seiferling
daa5f928bf Fixes and changes for issue #142 2018-07-30 08:44:39 -06:00
Michael J. Seiferling
72e3ccb661 Fixed precision of total hours on session viewer 2018-07-29 16:00:57 -06:00
Michael J. Seiferling
9e7a4b5efc Tweaks to icon extraction and error handling 2018-07-29 09:06:33 -06:00
Michael J. Seiferling
692deaaef9 Changes for issue #142 2018-07-25 09:21:50 -06:00
Michael J. Seiferling
a3572abb3d Add special folder verification for issue #144 2018-07-24 13:53:52 -06:00
MikeMaximus
2680f857a9 Update README.md 2018-07-08 09:43:18 -06:00
Michael J. Seiferling
1e2f4de816 Fixed another issue with renaming backups 2018-07-05 11:04:44 -06:00
MikeMaximus
b9b959f96c Fixed renaming backup files and sub-folders 2018-07-02 10:05:58 -06:00
MikeMaximus
2ae705be18 Fixed removing sub-folders when game name includes unsafe characters 2018-07-02 09:23:39 -06:00
MikeMaximus
ccade84b65 Removed sync warning when manually deleting all game configurations 2018-07-02 09:08:56 -06:00
MikeMaximus
017c5def56 Fixed removing empty sub-folders 2018-07-02 08:39:16 -06:00
MikeMaximus
1f9dc18c49 Updated readme.txt 2018-07-01 08:53:15 -06:00
MikeMaximus
bc1630a122 Changes for issue #141 2018-07-01 08:39:27 -06:00
MikeMaximus
478721dbd1 Fixed updated import flag for issue #140 2018-06-26 09:48:57 -06:00
MikeMaximus
8ad4810011 Updated readme.txt 2018-06-26 09:32:25 -06:00
MikeMaximus
93bc974cc3 Changes for issues #138 and #140 2018-06-26 09:24:22 -06:00
MikeMaximus
c9463c3a36 Fixes for issue #138 and #139 2018-06-25 18:56:48 -06:00
MikeMaximus
8b2c5f376b Updated readme.txt 2018-06-25 14:31:21 -06:00
MikeMaximus
9e329476a2 Allow restoring selected backups for issue #138 2018-06-25 13:47:28 -06:00
MikeMaximus
626fca3e1e Allow infinite backups for issue #138 2018-06-25 13:15:20 -06:00
MikeMaximus
039f91cd6f Fixed an optional sync field issue 2018-06-25 13:02:21 -06:00
MikeMaximus
f98a98af99 Added backup file verify for issue #138 2018-06-25 12:48:42 -06:00
MikeMaximus
d9bd7f38f5 Merge pull request #136 from basxto/master
Check in linux start script whether gbm is running
2018-06-21 22:28:14 -06:00
Sebastian Riedel
4e2ab9a0fb Check in linux start script whether gbm is running
Fix #112 for linux
2018-06-22 04:45:15 +02:00
MikeMaximus
218ce3f367 Changes for issue #135 2018-06-21 11:08:10 -06:00
MikeMaximus
b3cfab7ee6 Merge pull request #134 from basxto/master
Fix info for raw edit, colon is the delimiter
2018-06-20 15:04:03 -06:00
Sebastian Riedel
39440e1f98 Fix info for raw edit, colon is the delimiter 2018-06-20 01:21:24 +02:00
MikeMaximus
9b9d3f9125 Changes for issue #131 2018-06-15 16:02:31 -06:00
Michael J. Seiferling
7eab3b8841 Updated readme.txt for v1.1.2 2018-06-07 10:50:26 -06:00
Michael J. Seiferling
539009c5de Updated SQLite to 3.23.1 2018-05-20 21:07:00 -06:00
MikeMaximus
01b46107ad Fixed a possible issue with Game Manager quick filter 2018-05-12 23:14:31 -06:00
MikeMaximus
a5d2ce2255 Minor UI change for Game Manager 2018-05-07 20:59:06 -06:00
MikeMaximus
c0764d0c08 Fixed rare crash situation in Game Manager 2018-05-07 16:24:23 -06:00
MikeMaximus
35ea6fb74b Updated 7z to 18.05 / v1.1.1 Release 2018-05-04 08:45:55 -06:00
MikeMaximus
a51a7bea89 Merge pull request #128 from elonbing/master
Fixed minor typo ("manaul"=>"manual")
2018-04-25 15:45:37 -06:00
Elon Bing
b5f3408261 Fixed minor typo ("manaul"=>"manual") 2018-04-25 14:12:32 +02:00
MikeMaximus
f859449a99 Last minute database upgrade fixes 2018-04-01 08:40:17 -06:00
MikeMaximus
796f68d1a8 Added archive link to readme.txt 2018-03-31 09:30:21 -06:00
MikeMaximus
155759f7bd Minor message changes 2018-03-25 08:55:35 -06:00
MikeMaximus
405237f1d5 Fixed tab order issues on Settings 2018-03-22 09:03:23 -06:00
MikeMaximus
a0ba4637f2 Merge branch 'master' of https://github.com/MikeMaximus/gbm 2018-03-22 08:58:59 -06:00
MikeMaximus
76a11d8f2e Revert "Fixed tab order issues on Settings"
This reverts commit 48b4dbea43.
2018-03-22 08:58:42 -06:00
MikeMaximus
48b4dbea43 Fixed tab order issues on Settings 2018-03-22 08:56:52 -06:00
Michael J. Seiferling
e8b0650a9a Updated official configurations notice in readme.txt 2018-03-19 09:24:17 -06:00
Michael J. Seiferling
de157d516c Fixed a triggering spelling error 2018-03-19 08:38:26 -06:00
MikeMaximus
8ced2d157f Added "Disable sync event messages" setting and tweaked the Settings form 2018-03-18 22:33:40 -06:00
Michael J. Seiferling
4d83be9ef3 Updated some text and validation on Add Game Wizard 2018-03-17 16:10:13 -06:00
Michael J. Seiferling
52f7088ed7 Fixed some filename and path validation problems 2018-03-17 08:27:01 -06:00
Michael J. Seiferling
e07b2d226f Merge branch 'master' of https://github.com/MikeMaximus/gbm 2018-03-16 12:51:54 -06:00
Michael J. Seiferling
a5fe556108 Fixed potential issue with game ID sync 2018-03-16 12:51:05 -06:00
MikeMaximus
1d57bc0cc4 Added protection against empty syncs, fiddled with upgrade again 2018-03-16 11:04:54 -06:00
Michael J. Seiferling
907e3e309a Reverted prior database upgrade fix 2018-03-15 18:11:15 -06:00
Michael J. Seiferling
5cf6d1c270 Fixed border style on process manager 2018-03-15 16:16:07 -06:00
Michael J. Seiferling
189976e892 Fixed some database upgrade issues 2018-03-15 16:08:51 -06:00
Michael J. Seiferling
251ea3b060 Tweaks for issue #125 2018-03-13 11:58:44 -06:00
MikeMaximus
a2c96ee5e4 Merge pull request #126 from MikeMaximus/v1.1.0
Merge v1.1.0 into master
2018-03-12 20:19:16 -06:00
Michael J. Seiferling
79fd874f60 Updated readme.txt 2018-03-12 20:17:34 -06:00
MikeMaximus
2f66855166 Changes to new setting 2018-03-12 14:49:18 -06:00
Michael J. Seiferling
8e26e97fd4 Added file name option to settings 2018-03-12 13:03:32 -06:00
MikeMaximus
9eb095523e Fixed some settings and database update issues 2018-03-10 10:52:39 -06:00
MikeMaximus
5ae238360d Fixed process launching when dupes are detected 2018-03-09 09:01:16 -06:00
MikeMaximus
bba4d3a0a8 Fixed adding processes on a new game config 2018-03-09 08:50:36 -06:00
MikeMaximus
f4a54f8781 Minor label updates and updated readme.txt 2018-03-08 21:53:01 -06:00
MikeMaximus
108ab4931f Minor changes to process and tag features 2018-03-08 18:49:11 -06:00
MikeMaximus
28a260bdfc Added the ability to launch other processes when a game is detected 2018-03-08 16:02:58 -06:00
MikeMaximus
6461c80ae0 Updated import/id sync error handling and messaging 2018-03-08 09:04:48 -06:00
MikeMaximus
9807094af6 Fixed database upgrade issue 2018-03-07 12:41:21 -06:00
MikeMaximus
259cc2c5dd Removed unrequired parameter validation 2018-03-07 10:03:44 -06:00
MikeMaximus
c6ded1a349 Updated readme.txt with another known issue 2018-03-07 09:40:49 -06:00
MikeMaximus
7430551145 Added a known issue to readme.txt 2018-03-06 13:49:24 -06:00
MikeMaximus
b9244eeeae Added "Backup GBM data files on launch" feature 2018-03-06 13:19:47 -06:00
MikeMaximus
ebc185d7b8 Disable game id sync message when database is new 2018-03-06 10:24:12 -06:00
MikeMaximus
ad538da1d1 Fixed some issues with game id sync 2018-03-06 10:18:08 -06:00
MikeMaximus
95acce428a Added missing sync to tag updates 2018-03-06 10:02:47 -06:00
MikeMaximus
afb479044c Added icons to import 2018-03-06 10:02:15 -06:00
MikeMaximus
5245cc3ab3 Fixed database upgrade errors 2018-03-05 21:35:07 -06:00
MikeMaximus
4caa2df312 Fixed "Mark as Restored" functionality on Game Manager 2018-03-05 19:03:39 -06:00
MikeMaximus
7d874f0079 Added message supression support and refined game id sync 2018-03-05 18:58:51 -06:00
MikeMaximus
b23ace4b54 Updated game id sync confirmations 2018-03-05 13:51:32 -06:00
MikeMaximus
fe6b90311a Fixed duplicate check on game id sync 2018-03-05 13:06:50 -06:00
MikeMaximus
ddee737222 Added game id sync to import 2018-03-04 21:23:01 -06:00
MikeMaximus
2e5fa70f58 Fixed orphaned sessions issue when game id is changed 2018-03-04 09:43:49 -06:00
MikeMaximus
b76a7dd6ab Fixed orphaned tags issue when game id is changed 2018-03-04 09:27:00 -06:00
MikeMaximus
9907565145 Revised remote manifest updates 2018-03-03 20:04:59 -06:00
MikeMaximus
9a024349f5 Added Game ID to custom filter 2018-03-03 15:14:16 -06:00
MikeMaximus
7c73b27af0 Updated readme.txt with current changes 2018-03-03 09:22:27 -06:00
MikeMaximus
07b46f10f5 Removed "Clean Local Manifest" tool 2018-03-02 21:09:47 -06:00
MikeMaximus
c94b8b83da Fixed database upgrade for users with sync diabled 2018-03-02 19:23:07 -06:00
MikeMaximus
1b6b2fa3a0 Updates for sync becoming mandatory 2018-03-02 15:56:12 -06:00
MikeMaximus
609ee09cfa Added ability to edit game ID and updated validation 2018-03-02 12:00:00 -06:00
MikeMaximus
c2a752573a Fixed import crash when importing old xml files 2018-03-01 21:15:33 -06:00
MikeMaximus
b7b23cba4a Updated Import / Export / Sync with game id changes 2018-03-01 20:45:43 -06:00
MikeMaximus
848679c1b1 Fixed manifest issues with auto-restore and game manager 2018-03-01 13:42:26 -06:00
MikeMaximus
d07fc57dad Core changes for games and backup manifest 2018-03-01 10:11:32 -06:00
MikeMaximus
dff3432c27 Fixed possible database state problem after issue #123 2018-02-24 15:40:26 -06:00
MikeMaximus
b54f98d82b Fix for rename crash after issue #123 2018-02-24 15:09:42 -06:00
MikeMaximus
a745624e83 Tweaks for issue #125 2018-02-24 13:22:07 -06:00
MikeMaximus
2d0e4a136d Changes for #125 2018-02-24 11:13:21 -06:00
MikeMaximus
9f99b32200 Force LF for deb control and postinst script 2018-02-24 10:19:36 -06:00
MikeMaximus
866f6005dc Minor change for #125 and readme.txt update 2018-02-24 09:49:33 -06:00
MikeMaximus
dca86beebe Changes for issue #125 2018-02-24 09:28:06 -06:00
MikeMaximus
bb6e292c6f Re-done duplicate detection fixes for issue #98 2018-02-23 13:32:58 -06:00
MikeMaximus
0dbda50291 Updated CSV export for RFC 4180 2018-02-23 11:14:49 -06:00
MikeMaximus
1c54085d6c Changes for issue #123 (Pass 1) 2018-02-18 09:38:52 -06:00
Michael J. Seiferling
e897fda8e8 Force LF for makefile and sh 2018-02-17 08:36:06 -06:00
Michael J. Seiferling
978242d0dd Fixed more problems with issue #98 2018-02-14 10:23:18 -06:00
Michael J. Seiferling
1ab0e77918 Fixed detecting duplicate games with regex for issue #98 2018-02-13 20:22:03 -06:00
MikeMaximus
b3d9510edd Fixed some control locations on Game Manager 2018-02-11 10:48:58 -06:00
MikeMaximus
31b50afc84 Updated readme for v108 pre-release 2018-02-11 10:32:54 -06:00
MikeMaximus
7b17093cd8 Updated 7-Zip to 18.01 2018-02-08 10:03:47 -06:00
MikeMaximus
c63a188738 Fixed potential issue with parameter detection 2018-02-07 17:40:13 -06:00
MikeMaximus
e7b3f809f1 Added regex validation and help for issue #98 2018-02-06 09:40:57 -06:00
MikeMaximus
66d280df49 Changes for issue #98 2018-02-05 12:50:13 -06:00
MikeMaximus
7d4514c677 Merge pull request #122 from basxto/master
Fix line ending issues in shell scripts
2018-02-04 17:20:17 -06:00
Sebastian Riedel
2581883827 Fix line ending issues in shell scripts 2018-02-04 21:29:13 +01:00
MikeMaximus
248efa8878 Fixed some export issues 2018-02-02 10:28:17 -06:00
MikeMaximus
93517f5236 Updated readme.txt for v107 2018-02-02 09:32:52 -06:00
Michael J. Seiferling
5be80b2f02 Better fix for issue #94 2018-01-28 23:14:54 -06:00
Michael J. Seiferling
2f2177fb84 Fixed issue #94 again 2018-01-28 22:43:44 -06:00
MikeMaximus
636c1495a4 Fixed sessions form tab order 2018-01-20 14:09:15 -06:00
MikeMaximus
f69d10065a Changes for issue #121 2018-01-20 14:05:10 -06:00
MikeMaximus
99d70b96fb Cleaned up column sorting for cross-platform 2018-01-19 09:26:30 -06:00
MikeMaximus
f88cf1bd18 Linux sorting fix for issue #120 2018-01-18 14:08:22 -06:00
MikeMaximus
b4d9c84c36 Update version 2018-01-18 12:06:03 -06:00
MikeMaximus
5996e28edf Changes for issue #120 2018-01-18 12:04:48 -06:00
MikeMaximus
6b9ebaab36 Fixed issue #117 again 2018-01-18 09:17:14 -06:00
MikeMaximus
85588686cd Updated readme.txt for v106 2018-01-15 11:28:07 -06:00
Michael J. Seiferling
2cab8b7ec4 Stop resetting filters on session delete 2018-01-05 22:52:15 -06:00
MikeMaximus
93361bcd87 Fixed ignoring sessions 2018-01-01 10:57:23 -06:00
MikeMaximus
a89fdceb1a Fixed bad practice issues with sessions 2018-01-01 09:56:12 -06:00
MikeMaximus
fa2910e184 Updated version and copyright 2018-01-01 09:06:57 -06:00
MikeMaximus
ef6df6e89e Updated credits.txt 2018-01-01 09:05:29 -06:00
MikeMaximus
36af55cacc Added Start with Windows setting admin warning 2017-12-29 14:21:27 -06:00
MikeMaximus
f6a5d7bba1 Update makefile
Change deb DESTDIR
2017-12-29 14:05:12 -06:00
MikeMaximus
27917f5859 Merge pull request #118 from basxto/master
Add debian package
2017-12-29 14:01:35 -06:00
MikeMaximus
2c8e0a1275 Fix for session delete 2017-12-28 13:18:10 -06:00
MikeMaximus
04f7b76456 Reset settings form to normal DPI 2017-12-27 20:05:34 -06:00
MikeMaximus
477c1fa623 Changes for issue #117 2017-12-27 19:51:54 -06:00
MikeMaximus
a5d7d6697a Changes for issue #115 2017-12-27 17:03:00 -06:00
MikeMaximus
b1e6e7a9e6 Changes for issue #116 2017-12-27 16:23:50 -06:00
Sebastian Riedel
c8db7ae4e4 Correct run path for package manager installation 2017-12-27 15:31:06 +01:00
Sebastian Riedel
f9a9074e56 Adapt to changed package directory name 2017-12-27 14:42:02 +01:00
Sebastian Riedel
77df7cf3dc Merge branch 'deb' 2017-12-27 14:34:37 +01:00
Sebastian Riedel
1122499609 Update icon and application database after install 2017-12-27 14:33:31 +01:00
Sebastian Riedel
ecedda0779 Build .deb package with 'make deb' 2017-12-19 01:24:12 +01:00
MikeMaximus
40e36aaafd Merge pull request #113 from basxto/master
Start GBM via script
2017-12-18 15:41:36 -06:00
Sebastian Riedel
3c72799ceb Fix script path detection 2017-12-18 22:36:35 +01:00
Sebastian Riedel
0779132be9 Avoid wrong paths 2017-12-18 21:25:03 +01:00
Sebastian Riedel
35cb711ca1 Remove BASHisms from start script 2017-12-18 21:14:41 +01:00
Sebastian Riedel
aacda9eeb9 Use changeable paths 2017-12-15 01:20:10 +01:00
Sebastian Riedel
1ec5439c5d Fix checking for needed libraries 2017-12-14 23:19:55 +01:00
Sebastian Riedel
ebd7081b29 Merge github.com:MikeMaximus/gbm 2017-12-10 03:20:35 +01:00
Sebastian Riedel
03becc209c Run GBM.exe with a script 2017-11-19 22:31:55 +01:00
74 changed files with 6957 additions and 1456 deletions
+4
View File
@@ -1,6 +1,10 @@
############################################################################### ###############################################################################
# Set default behavior to automatically normalize line endings. # Set default behavior to automatically normalize line endings.
############################################################################### ###############################################################################
*.sh -text eol=lf
makefile -text eol=lf
control -text eol=lf
postinst -text eol=lf
* text=auto * text=auto
############################################################################### ###############################################################################
Vendored
+1 -4
View File
@@ -186,7 +186,4 @@ FakesAssemblies/
GeneratedArtifacts/ GeneratedArtifacts/
_Pvt_Extensions/ _Pvt_Extensions/
ModelManifest.xml ModelManifest.xml
/.vs/slnx.sqlite /.vs
/.vs/VSWorkspaceState.json
/.vs/Game Backup Monitor/v15/sqlite3/storage.ide
/.vs/Game Backup Monitor/v15/sqlite3/storage.ide-journal
+40
View File
@@ -1,16 +1,29 @@
Public Class Game Public Class Game
Private sGameID As String
Private sGameName As String Private sGameName As String
Private sProcessName As String Private sProcessName As String
Private sParameter 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 bAppendTimeStamp As Boolean
Private iBackupLimit As Integer
Private sFileType As String Private sFileType As String
Private sExcludeList As String Private sExcludeList As String
Private bMonitorOnly As Boolean Private bMonitorOnly As Boolean
Private sComments As String Private sComments As String
Private bIsRegEx As Boolean
Private oTags As List(Of Tag) Private oTags As List(Of Tag)
Property ID As String
Set(value As String)
sGameID = value
End Set
Get
Return sGameID
End Get
End Property
Property Name As String Property Name As String
Set(value As String) Set(value As String)
sGameName = value sGameName = value
@@ -65,6 +78,24 @@
End Get End Get
End Property End Property
Property AppendTimeStamp As Boolean
Set(value As Boolean)
bAppendTimeStamp = value
End Set
Get
Return bAppendTimeStamp
End Get
End Property
Property BackupLimit As Integer
Set(value As Integer)
iBackupLimit = value
End Set
Get
Return iBackupLimit
End Get
End Property
Property FileType As String Property FileType As String
Set(value As String) Set(value As String)
sFileType = value sFileType = value
@@ -101,6 +132,15 @@
End Get End Get
End Property End Property
Property IsRegEx As Boolean
Set(value As Boolean)
bIsRegEx = value
End Set
Get
Return bIsRegEx
End Get
End Property
Property Tags As List(Of Tag) Property Tags As List(Of Tag)
Get Get
Return oTags Return oTags
@@ -0,0 +1,49 @@
Imports System.Xml.Serialization
<XmlRoot("Session")>
Public Class Session
Private sGame As String
Private sStart As String
Private sEnd As String
Private sHours As String
<XmlElement("Game")>
Public Property GameName As String
Set(value As String)
sGame = value
End Set
Get
Return sGame
End Get
End Property
<XmlElement("Start")>
Public Property StartDate As String
Set(value As String)
sStart = value
End Set
Get
Return sStart
End Get
End Property
<XmlElement("End")>
Public Property EndDate As String
Set(value As String)
sEnd = value
End Set
Get
Return sEnd
End Get
End Property
<XmlElement("Hours")>
Public Property Hours As String
Set(value As String)
sHours = value
End Set
Get
Return sHours
End Get
End Property
End Class
+17 -1
View File
@@ -1,5 +1,6 @@
Public Class clsBackup Public Class clsBackup
Private sBackupID As String = Guid.NewGuid.ToString Private sBackupID As String = Guid.NewGuid.ToString
Private sMonitorID As String = String.Empty
Private sName As String = String.Empty Private sName As String = String.Empty
Private sFileName As String = String.Empty Private sFileName As String = String.Empty
Private sRestorePath As String = String.Empty Private sRestorePath As String = String.Empty
@@ -9,7 +10,7 @@
Private sUpdatedBy As String = String.Empty Private sUpdatedBy As String = String.Empty
Private sCheckSum As String = String.Empty Private sCheckSum As String = String.Empty
Property ID As String Property ManifestID As String
Get Get
Return sBackupID Return sBackupID
End Get End Get
@@ -18,6 +19,15 @@
End Set End Set
End Property End Property
Property MonitorID As String
Get
Return sMonitorID
End Get
Set(value As String)
sMonitorID = value
End Set
End Property
Property Name As String Property Name As String
Get Get
Return sName Return sName
@@ -37,6 +47,12 @@
End Get End Get
End Property End Property
ReadOnly Property FileSafeName As String
Get
Return mgrPath.ValidateFileNameForOS(sName)
End Get
End Property
Property FileName As String Property FileName As String
Get Get
If mgrCommon.IsUnix Then If mgrCommon.IsUnix Then
+71 -52
View File
@@ -9,7 +9,7 @@ Public Class clsGame
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 = 0
Private bCleanFolder As Boolean = False 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
@@ -20,9 +20,9 @@ Public Class clsGame
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 sComments As String = String.Empty
Private bDuplicate As Boolean = False Private bIsRegEx As Boolean = False
Private bTempGame As Boolean = False
Private oImportTags As New List(Of Tag) Private oImportTags As New List(Of Tag)
Private bImportUpdate As Boolean = False
<Flags()> Public Enum eOptionalSyncFields <Flags()> Public Enum eOptionalSyncFields
None = 0 None = 0
@@ -30,25 +30,21 @@ Public Class clsGame
Company = 2 Company = 2
Version = 4 Version = 4
Icon = 16 Icon = 16
TimeStamp = 32 Unused = 32 'Do not remove to maintain compatability, re-use for a future field.
MonitorGame = 64 MonitorGame = 64
End Enum End Enum
Property ID As String Property ID As String
Set(value As String) Set(value As String)
sGameID = value If Not value Is Nothing Then
sGameID = mgrPath.ValidateFileNameForOS(value)
End If
End Set End Set
Get Get
Return sGameID Return sGameID
End Get End Get
End Property End Property
ReadOnly Property CompoundKey As String
Get
Return ProcessName & ":" & Name
End Get
End Property
ReadOnly Property CroppedName As String ReadOnly Property CroppedName As String
Get Get
If Name.Length > 40 Then If Name.Length > 40 Then
@@ -59,6 +55,12 @@ Public Class clsGame
End Get End Get
End Property End Property
ReadOnly Property FileSafeName As String
Get
Return mgrPath.ValidateFileNameForOS(sGameName)
End Get
End Property
Property Name As String Property Name As String
Set(value As String) Set(value As String)
sGameName = value sGameName = value
@@ -230,36 +232,24 @@ Public Class clsGame
End Set End Set
End Property End Property
Property Duplicate As Boolean Property IsRegEx As Boolean
Get Get
Return bDuplicate Return bIsRegEx
End Get End Get
Set(value As Boolean) Set(value As Boolean)
bDuplicate = value bIsRegEx = value
End Set End Set
End Property End Property
ReadOnly Property TruePath As String Property TruePath As String
Set(value As String)
sPath = value
End Set
Get Get
Return sPath Return sPath
End Get End Get
End Property End Property
ReadOnly Property TrueProcess As String
Get
Return HandleProcessDuplicates()
End Get
End Property
Property Temporary As Boolean
Get
Return bTempGame
End Get
Set(value As Boolean)
bTempGame = value
End Set
End Property
Property ImportTags As List(Of Tag) Property ImportTags As List(Of Tag)
Get Get
Return oImportTags Return oImportTags
@@ -269,6 +259,15 @@ Public Class clsGame
End Set End Set
End Property End Property
Property ImportUpdate As Boolean
Get
Return bImportUpdate
End Get
Set(value As Boolean)
bImportUpdate = value
End Set
End Property
ReadOnly Property IncludeArray As String() ReadOnly Property IncludeArray As String()
Get Get
If FileType = String.Empty Then If FileType = String.Empty Then
@@ -322,10 +321,13 @@ Public Class clsGame
If FolderSave <> oGame.FolderSave Then If FolderSave <> oGame.FolderSave Then
Return False Return False
End If End If
If CleanFolder <> oGame.CleanFolder Then If AppendTimeStamp <> oGame.AppendTimeStamp Then
Return False Return False
End If End If
If AppendTimeStamp <> oGame.AppendTimeStamp Then If BackupLimit <> oGame.BackupLimit Then
Return False
End If
If CleanFolder <> oGame.CleanFolder Then
Return False Return False
End If End If
If Hours <> oGame.Hours Then If Hours <> oGame.Hours Then
@@ -337,6 +339,9 @@ Public Class clsGame
If Comments <> oGame.Comments Then If Comments <> oGame.Comments Then
Return False Return False
End If End If
If IsRegEx <> oGame.IsRegEx 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,14 +364,6 @@ Public Class clsGame
Return False Return False
End If End If
End If End If
If (eSyncFields And eOptionalSyncFields.TimeStamp) = eOptionalSyncFields.TimeStamp Then
If AppendTimeStamp <> oGame.AppendTimeStamp Then
Return False
End If
If BackupLimit <> oGame.BackupLimit Then
Return False
End If
End If
If (eSyncFields And eOptionalSyncFields.Version) = eOptionalSyncFields.Version Then If (eSyncFields And eOptionalSyncFields.Version) = eOptionalSyncFields.Version Then
If Version <> oGame.Version Then If Version <> oGame.Version Then
Return False Return False
@@ -381,12 +378,46 @@ Public Class clsGame
If oGame Is Nothing Then If oGame Is Nothing Then
Return False Return False
Else Else
'Core Fields
If ID <> oGame.ID Then
Return False
End If
If Name <> oGame.Name Then If Name <> oGame.Name Then
Return False Return False
End If End If
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
Return False
End If
If FileType <> oGame.FileType Then
Return False
End If
If ExcludeList <> oGame.ExcludeList Then
Return False
End If
If AbsolutePath <> oGame.AbsolutePath Then
Return False
End If
If FolderSave <> oGame.FolderSave Then
Return False
End If
If AppendTimeStamp <> oGame.AppendTimeStamp Then
Return False
End If
If MonitorOnly <> oGame.MonitorOnly Then
Return False
End If
If Comments <> oGame.Comments Then
Return False
End If
If IsRegEx <> oGame.IsRegEx Then
Return False
End If
Return True Return True
End If End If
End Function End Function
@@ -407,18 +438,6 @@ Public Class clsGame
Return DirectCast(Me.MemberwiseClone(), clsGame) Return DirectCast(Me.MemberwiseClone(), clsGame)
End Function End Function
Private Function HandleProcessDuplicates() As String
Dim sProcessName As String
'Handle Duplicates
sProcessName = Me.ProcessName
If Me.Duplicate Then
sProcessName = Me.ProcessName.Split(":")(0)
End If
Return sProcessName
End Function
Public Shared Function SetSyncField(ByVal eSyncFields As eOptionalSyncFields, ByVal eSyncField As eOptionalSyncFields) As eOptionalSyncFields Public Shared Function SetSyncField(ByVal eSyncFields As eOptionalSyncFields, ByVal eSyncField As eOptionalSyncFields) As eOptionalSyncFields
Return eSyncFields Or eSyncField Return eSyncFields Or eSyncField
End Function End Function
+22
View File
@@ -0,0 +1,22 @@
Public Class clsGameProcess
Private sProcessID As String
Private sMonitorID As String
Public Property ProcessID As String
Get
Return sProcessID
End Get
Set(value As String)
sProcessID = value
End Set
End Property
Public Property MonitorID As String
Get
Return sMonitorID
End Get
Set(value As String)
sMonitorID = value
End Set
End Property
End Class
+1 -1
View File
@@ -24,7 +24,7 @@
ReadOnly Property FormattedName As String ReadOnly Property FormattedName As String
Get Get
Return "*" & sVariableName & "*" Return "%" & sVariableName & "%"
End Get End Get
End Property End Property
+53
View File
@@ -0,0 +1,53 @@
<Serializable()>
Public Class clsProcess
Private sProcessID As String = Guid.NewGuid.ToString
Private sName As String = String.Empty
Private sPath As String = String.Empty
Private sArgs As String = String.Empty
Private bKill As Boolean = True
Public Property ID As String
Get
Return sProcessID
End Get
Set(value As String)
sProcessID = value
End Set
End Property
Public Property Name As String
Get
Return sName
End Get
Set(value As String)
sName = value
End Set
End Property
Public Property Path As String
Get
Return sPath
End Get
Set(value As String)
sPath = value
End Set
End Property
Public Property Args As String
Get
Return sArgs
End Get
Set(value As String)
sArgs = value
End Set
End Property
Public Property Kill As Boolean
Get
Return bKill
End Get
Set(value As Boolean)
bKill = value
End Set
End Property
End Class
+30 -17
View File
@@ -1,9 +1,8 @@
Public Class clsSession Public Class clsSession
Private sMonitorID As String Private sMonitorID As String
Private dStart As DateTime Private iStart As Int64
Private dEnd As DateTime Private iEnd As Int64
Private sComputerName As String = My.Computer.Name
Public Property MonitorID As String Public Property MonitorID As String
Set(value As String) Set(value As String)
@@ -14,31 +13,45 @@
End Get End Get
End Property End Property
Public Property SessionStart As DateTime Public Property SessionStart As Int64
Set(value As Int64)
iStart = value
End Set
Get
Return iStart
End Get
End Property
Public WriteOnly Property SessionStartFromDate As DateTime
Set(value As DateTime) Set(value As DateTime)
dStart = value iStart = mgrCommon.DateToUnix(value)
End Set End Set
End Property
Public ReadOnly Property SessionStartFormatted As DateTime
Get Get
Return dStart Return mgrCommon.UnixToDate(iStart)
End Get End Get
End Property End Property
Public Property SessionEnd As DateTime Public Property SessionEnd As Int64
Set(value As Int64)
iEnd = value
End Set
Get
Return iEnd
End Get
End Property
Public WriteOnly Property SessionEndFromDate As DateTime
Set(value As DateTime) Set(value As DateTime)
dEnd = value iEnd = mgrCommon.DateToUnix(value)
End Set End Set
Get
Return dEnd
End Get
End Property End Property
Public Property ComputerName As String Public ReadOnly Property SessionEndFormatted As DateTime
Set(value As String)
sComputerName = value
End Set
Get Get
Return sComputerName Return mgrCommon.UnixToDate(iEnd)
End Get End Get
End Property End Property
End Class End Class
+2 -3
View File
@@ -124,9 +124,8 @@ Partial Class frmAddWizard
Me.lblStep1Instructions.Name = "lblStep1Instructions" Me.lblStep1Instructions.Name = "lblStep1Instructions"
Me.lblStep1Instructions.Size = New System.Drawing.Size(303, 85) Me.lblStep1Instructions.Size = New System.Drawing.Size(303, 85)
Me.lblStep1Instructions.TabIndex = 6 Me.lblStep1Instructions.TabIndex = 6
Me.lblStep1Instructions.Text = "The name will be automatically filtered for length and invalid characters. You m" & Me.lblStep1Instructions.Text = "You may drag and drop a shortcut here to complete this step, only Windows shortcu" &
"ay drag and drop a shortcut here to complete this step, only Windows shortcuts a" & "ts are currently supported."
"re currently supported."
' '
'txtName 'txtName
' '
+13 -23
View File
@@ -195,10 +195,7 @@ Public Class frmAddWizard
End Sub End Sub
Private Function ValidateName(ByVal strName As String, ByRef sErrorMessage As String) As Boolean Private Function ValidateName(ByVal strName As String, ByRef sErrorMessage As String) As Boolean
If txtName.Text <> String.Empty Then If txtName.Text.Trim = String.Empty Then
txtName.Text = mgrPath.ValidateForFileSystem(txtName.Text)
Return True
Else
sErrorMessage = frmAddWizard_ErrorValidName sErrorMessage = frmAddWizard_ErrorValidName
txtName.Focus() txtName.Focus()
Return False Return False
@@ -207,7 +204,9 @@ Public Class frmAddWizard
End Function End Function
Private Function ValidateProcessPath(ByVal strPath As String, ByRef sErrorMessage As String) As Boolean Private Function ValidateProcessPath(ByVal strPath As String, ByRef sErrorMessage As String) As Boolean
If strPath = String.Empty Then strPath = mgrPath.ValidatePathForOS(strPath)
If strPath.Trim = String.Empty Then
sErrorMessage = frmAddWizard_ErrorValidProcess sErrorMessage = frmAddWizard_ErrorValidProcess
txtProcessPath.Focus() txtProcessPath.Focus()
Return False Return False
@@ -235,7 +234,9 @@ Public Class frmAddWizard
End Function End Function
Private Function ValidateSavePath(ByVal strPath As String, ByRef sErrorMessage As String) As Boolean Private Function ValidateSavePath(ByVal strPath As String, ByRef sErrorMessage As String) As Boolean
If strPath = String.Empty Then strPath = mgrPath.ValidatePathForOS(strPath)
If strPath.Trim = String.Empty Then
sErrorMessage = frmAddWizard_ErrorValidSavePath sErrorMessage = frmAddWizard_ErrorValidSavePath
txtSavePath.Focus() txtSavePath.Focus()
Return False Return False
@@ -257,7 +258,7 @@ Public Class frmAddWizard
End Function End Function
Private Function ValidateSaveType(ByVal strSaveType As String, ByRef sErrorMessage As String) Private Function ValidateSaveType(ByVal strSaveType As String, ByRef sErrorMessage As String)
If strSaveType = String.Empty Then If strSaveType.Trim = String.Empty Then
sErrorMessage = frmAddWizard_ErrorValidSaveType sErrorMessage = frmAddWizard_ErrorValidSaveType
txtFileTypes.Focus() txtFileTypes.Focus()
Return False Return False
@@ -267,22 +268,11 @@ Public Class frmAddWizard
End Function End Function
Private Sub DoSave() Private Sub DoSave()
Dim hshDupeCheck As New Hashtable mgrMonitorList.DoListAdd(oGameToSave)
Dim sNewGame As String = oGameToSave.ProcessName & ":" & oGameToSave.Name If mgrCommon.ShowMessage(frmAddWizard_ConfirmSaveTags, New String() {oGameToSave.Name, oGameToSave.Name}, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
OpenTags(oGameToSave)
For Each o As clsGame In GameData.Values
hshDupeCheck.Add(o.CompoundKey, String.Empty)
Next
If hshDupeCheck.Contains(sNewGame) Then
mgrCommon.ShowMessage(frmAddWizard_ErrorGameDupe, MsgBoxStyle.Exclamation)
Else
mgrMonitorList.DoListAdd(oGameToSave)
If mgrCommon.ShowMessage(frmAddWizard_ConfirmSaveTags, New String() {oGameToSave.Name, oGameToSave.Name}, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
OpenTags(oGameToSave)
End If
Me.Close()
End If End If
Me.Close()
End Sub End Sub
Private Sub ValidateBack() Private Sub ValidateBack()
@@ -426,7 +416,7 @@ Public Class frmAddWizard
End If End If
sNewPath = mgrCommon.OpenFileBrowser("Wizard_Process_Path", frmAddWizard_ChooseProcess, "exe", sNewPath = mgrCommon.OpenFileBrowser("Wizard_Process_Path", frmAddWizard_ChooseProcess, "exe",
frmAddWizard_Executable, sDefaultFolder, False, False) frmAddWizard_Executable, sDefaultFolder, False)
If sNewPath <> String.Empty Then txtProcessPath.Text = sNewPath If sNewPath <> String.Empty Then txtProcessPath.Text = sNewPath
End Sub End Sub
+96 -4
View File
@@ -6,9 +6,11 @@ Public Class frmAdvancedImport
Private oImportData As ExportData Private oImportData As ExportData
Private hshImportData As Hashtable Private hshImportData As Hashtable
Private hshFinalData As New Hashtable Private hshFinalData As New Hashtable
Private bModWinConfigsForLinux As Boolean
Private bSelectAll As Boolean = True 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 oImageList As ImageList
Private WithEvents tmFilterTimer As Timer Private WithEvents tmFilterTimer As Timer
Public Property ImportInfo As ExportData Public Property ImportInfo As ExportData
@@ -29,6 +31,15 @@ Public Class frmAdvancedImport
End Get End Get
End Property End Property
Public Property ModWinConfigsForLinux As Boolean
Set(value As Boolean)
bModWinConfigsForLinux = value
End Set
Get
Return bModWinConfigsForLinux
End Get
End Property
Public ReadOnly Property FinalData As Hashtable Public ReadOnly Property FinalData As Hashtable
Get Get
Return hshFinalData Return hshFinalData
@@ -55,6 +66,62 @@ Public Class frmAdvancedImport
End If End If
End Sub End Sub
Private Sub ModTags(ByRef oTags As List(Of Tag))
Dim bExists As Boolean
Dim oTag As Tag
Dim oNewTag As Tag
Dim oRemoveTag As New Tag
Dim sTag As String
Dim sAddTags() As String = {"Wine"}
Dim sRemoveTags() As String = {"Official"}
For Each sTag In sAddTags
bExists = False
For Each oTag In oTags
If oTag.Name = sTag Then
bExists = True
Exit For
End If
Next
If Not bExists Then
oNewTag = New Tag
oNewTag.Name = sTag
oTags.Add(oNewTag)
End If
Next
For Each sTag In sRemoveTags
bExists = False
For Each oTag In oTags
If oTag.Name = sTag Then
bExists = True
oRemoveTag = oTag
Exit For
End If
Next
If bExists Then
oTags.Remove(oRemoveTag)
End If
Next
End Sub
Private Function CheckIgnoreTags(ByVal oTags As List(Of Tag)) As Boolean
Dim oTag As Tag
Dim sTag As String
Dim sIgnoreTags() As String = {"DOSBox", "ScummVM"}
For Each oTag In oTags
For Each sTag In sIgnoreTags
If oTag.Name = sTag Then
Return False
End If
Next
Next
Return True
End Function
Private Sub LoadData(Optional ByVal sFilter As String = "", Optional ByVal bAutoDetect As Boolean = False) 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
@@ -74,6 +141,12 @@ Public Class frmAdvancedImport
For Each de As DictionaryEntry In ImportData For Each de As DictionaryEntry In ImportData
bAddItem = False bAddItem = False
oApp = DirectCast(de.Value, clsGame) oApp = DirectCast(de.Value, clsGame)
'Run any required tag mods
If ModWinConfigsForLinux Then
ModTags(oApp.ImportTags)
End If
sTags = String.Empty sTags = String.Empty
oApp.ImportTags.Sort(AddressOf mgrCommon.CompareImportTagsByName) oApp.ImportTags.Sort(AddressOf mgrCommon.CompareImportTagsByName)
For Each oTag As Tag In oApp.ImportTags For Each oTag As Tag In oApp.ImportTags
@@ -81,10 +154,10 @@ Public Class frmAdvancedImport
Next Next
sTags = sTags.TrimEnd(New Char() {",", " "}) sTags = sTags.TrimEnd(New Char() {",", " "})
oListViewItem = New ListViewItem(New String() {oApp.Name, oApp.TrueProcess, sTags}) oListViewItem = New ListViewItem(New String() {oApp.Name, oApp.ProcessName, sTags})
oListViewItem.Tag = oApp.CompoundKey oListViewItem.Tag = oApp.ID
If FinalData.ContainsKey(oApp.CompoundKey) Then If FinalData.ContainsKey(oApp.ID) Then
oListViewItem.Checked = True oListViewItem.Checked = True
Else Else
oListViewItem.Checked = False oListViewItem.Checked = False
@@ -103,14 +176,26 @@ Public Class frmAdvancedImport
End If End If
End If End If
If oApp.ImportUpdate Then
oListViewItem.ImageIndex = 1
oListViewItem.Checked = True
Else
oListViewItem.ImageIndex = 0
End If
If sFilter = String.Empty Then If sFilter = String.Empty Then
bAddItem = True bAddItem = True
Else Else
If oApp.Name.ToLower.Contains(sFilter.ToLower) Or oApp.TrueProcess.ToLower.Contains(sFilter.ToLower) Or sTags.ToLower.Contains(sFilter.ToLower) Then If oApp.Name.ToLower.Contains(sFilter.ToLower) Or oApp.ProcessName.ToLower.Contains(sFilter.ToLower) Or sTags.ToLower.Contains(sFilter.ToLower) Then
bAddItem = True bAddItem = True
End If End If
End If End If
'Check for hardcoded ignore tags
If bAddItem And ModWinConfigsForLinux Then
bAddItem = CheckIgnoreTags(oApp.ImportTags)
End If
If bAddItem Then If bAddItem Then
If oListViewItem.Checked Then bResetSelectAll = True If oListViewItem.Checked Then bResetSelectAll = True
lstGames.Items.Add(oListViewItem) lstGames.Items.Add(oListViewItem)
@@ -156,6 +241,13 @@ Public Class frmAdvancedImport
btnImport.Text = frmAdvancedImport_btnImport btnImport.Text = frmAdvancedImport_btnImport
chkSelectAll.Text = frmAdvancedImport_chkSelectAll chkSelectAll.Text = frmAdvancedImport_chkSelectAll
'Set Icons
oImageList = New ImageList()
oImageList.Images.Add(Icon_New)
oImageList.Images.Add(Icon_Update)
lstGames.SmallImageList = oImageList
chkSelectAll.Checked = True chkSelectAll.Checked = True
'Init Filter Timer 'Init Filter Timer
+4 -4
View File
@@ -2,16 +2,16 @@
Public Class frmChooseGame Public Class frmChooseGame
Private oProcess As mgrProcesses Private oProcess As mgrProcessDetection
Private oGame As clsGame Private oGame As clsGame
Private oGamesHash As New Hashtable Private oGamesHash As New Hashtable
Private bGameSelected As Boolean = False Private bGameSelected As Boolean = False
Property Process As mgrProcesses Property Process As mgrProcessDetection
Get Get
Return oProcess Return oProcess
End Get End Get
Set(value As mgrProcesses) Set(value As mgrProcessDetection)
oProcess = value oProcess = value
End Set End Set
End Property End Property
@@ -38,7 +38,7 @@ Public Class frmChooseGame
End Sub End Sub
Private Sub SaveSelection() Private Sub SaveSelection()
oGame.ProcessPath = oProcess.GameInfo.ProcessPath oGame.ProcessPath = oProcess.ProcessPath
mgrMonitorList.DoListUpdate(oGame) mgrMonitorList.DoListUpdate(oGame)
End Sub End Sub
+19
View File
@@ -132,6 +132,17 @@ Public Class frmFilter
Private Sub LoadFilterFields() Private Sub LoadFilterFields()
Dim oField As clsGameFilterField Dim oField As clsGameFilterField
'Game ID
oField = New clsGameFilterField
oField.FieldName = "MonitorID"
oField.FriendlyFieldName = frmFilter_FieldGameID
oField.Type = clsGameFilterField.eDataType.fString
oField.Status = clsGameFilterField.eFieldStatus.ValidSort
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Name 'Name
oField = New clsGameFilterField oField = New clsGameFilterField
oField.FieldName = "Name" oField.FieldName = "Name"
@@ -223,6 +234,14 @@ Public Class frmFilter
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField) oValidFields.Add(oField)
'IsRegEx
oField = New clsGameFilterField
oField.FieldName = "IsRegEx"
oField.FriendlyFieldName = frmFilter_FieldIsRegEx
oField.Type = clsGameFilterField.eDataType.fBool
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'Game Path 'Game Path
oField = New clsGameFilterField oField = New clsGameFilterField
oField.FieldName = "ProcessPath" oField.FieldName = "ProcessPath"
+146 -74
View File
@@ -28,6 +28,8 @@ Partial Class frmGameManager
Me.btnBackup = New System.Windows.Forms.Button() Me.btnBackup = New System.Windows.Forms.Button()
Me.btnClose = New System.Windows.Forms.Button() Me.btnClose = New System.Windows.Forms.Button()
Me.grpConfig = New System.Windows.Forms.GroupBox() Me.grpConfig = New System.Windows.Forms.GroupBox()
Me.btnGameID = New System.Windows.Forms.Button()
Me.chkRegEx = New System.Windows.Forms.CheckBox()
Me.lblComments = New System.Windows.Forms.Label() Me.lblComments = New System.Windows.Forms.Label()
Me.txtComments = New System.Windows.Forms.TextBox() Me.txtComments = New System.Windows.Forms.TextBox()
Me.txtParameter = New System.Windows.Forms.TextBox() Me.txtParameter = New System.Windows.Forms.TextBox()
@@ -68,6 +70,7 @@ Partial Class frmGameManager
Me.lblHours = New System.Windows.Forms.Label() Me.lblHours = New System.Windows.Forms.Label()
Me.btnTags = New System.Windows.Forms.Button() Me.btnTags = New System.Windows.Forms.Button()
Me.grpStats = New System.Windows.Forms.GroupBox() Me.grpStats = New System.Windows.Forms.GroupBox()
Me.btnImportBackup = New System.Windows.Forms.Button()
Me.cboRemoteBackup = New System.Windows.Forms.ComboBox() Me.cboRemoteBackup = New System.Windows.Forms.ComboBox()
Me.lblRestorePathData = New System.Windows.Forms.Label() Me.lblRestorePathData = New System.Windows.Forms.Label()
Me.lblBackupFileData = New System.Windows.Forms.Label() Me.lblBackupFileData = New System.Windows.Forms.Label()
@@ -94,12 +97,16 @@ Partial Class frmGameManager
Me.btnExport = New System.Windows.Forms.Button() Me.btnExport = New System.Windows.Forms.Button()
Me.cmsImport = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.cmsImport = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.cmsOfficial = New System.Windows.Forms.ToolStripMenuItem() Me.cmsOfficial = New System.Windows.Forms.ToolStripMenuItem()
Me.cmsOfficialWindows = New System.Windows.Forms.ToolStripMenuItem()
Me.cmsOfficialLinux = New System.Windows.Forms.ToolStripMenuItem()
Me.cmsFile = New System.Windows.Forms.ToolStripMenuItem() Me.cmsFile = New System.Windows.Forms.ToolStripMenuItem()
Me.txtQuickFilter = New System.Windows.Forms.TextBox() Me.txtQuickFilter = New System.Windows.Forms.TextBox()
Me.lblQuickFilter = New System.Windows.Forms.Label() Me.lblQuickFilter = New System.Windows.Forms.Label()
Me.cmsDeleteBackup = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.cmsDeleteBackup = New System.Windows.Forms.ContextMenuStrip(Me.components)
Me.cmsDeleteOne = New System.Windows.Forms.ToolStripMenuItem() Me.cmsDeleteOne = New System.Windows.Forms.ToolStripMenuItem()
Me.cmsDeleteAll = New System.Windows.Forms.ToolStripMenuItem() Me.cmsDeleteAll = New System.Windows.Forms.ToolStripMenuItem()
Me.btnProcesses = New System.Windows.Forms.Button()
Me.ttFullPath = New System.Windows.Forms.ToolTip(Me.components)
Me.grpConfig.SuspendLayout() Me.grpConfig.SuspendLayout()
CType(Me.nudLimit, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.nudLimit, System.ComponentModel.ISupportInitialize).BeginInit()
Me.grpExtra.SuspendLayout() Me.grpExtra.SuspendLayout()
@@ -115,7 +122,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, 586) Me.btnAdd.Location = New System.Drawing.Point(12, 626)
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
@@ -126,7 +133,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, 586) Me.btnDelete.Location = New System.Drawing.Point(48, 626)
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
@@ -136,26 +143,28 @@ 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, 586) Me.btnBackup.Location = New System.Drawing.Point(616, 626)
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 = 18 Me.btnBackup.TabIndex = 19
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, 586) Me.btnClose.Location = New System.Drawing.Point(697, 626)
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 = 19 Me.btnClose.TabIndex = 20
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.btnGameID)
Me.grpConfig.Controls.Add(Me.chkRegEx)
Me.grpConfig.Controls.Add(Me.lblComments) Me.grpConfig.Controls.Add(Me.lblComments)
Me.grpConfig.Controls.Add(Me.txtComments) Me.grpConfig.Controls.Add(Me.txtComments)
Me.grpConfig.Controls.Add(Me.txtParameter) Me.grpConfig.Controls.Add(Me.txtParameter)
@@ -181,97 +190,114 @@ 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, 215) Me.grpConfig.Size = New System.Drawing.Size(525, 258)
Me.grpConfig.TabIndex = 8 Me.grpConfig.TabIndex = 8
Me.grpConfig.TabStop = False Me.grpConfig.TabStop = False
Me.grpConfig.Text = "Configuration" Me.grpConfig.Text = "Configuration"
' '
'btnGameID
'
Me.btnGameID.Location = New System.Drawing.Point(402, 17)
Me.btnGameID.Name = "btnGameID"
Me.btnGameID.Size = New System.Drawing.Size(117, 23)
Me.btnGameID.TabIndex = 2
Me.btnGameID.Text = "&Game ID..."
Me.btnGameID.UseVisualStyleBackColor = True
'
'chkRegEx
'
Me.chkRegEx.AutoSize = True
Me.chkRegEx.Location = New System.Drawing.Point(402, 46)
Me.chkRegEx.Name = "chkRegEx"
Me.chkRegEx.Size = New System.Drawing.Size(117, 17)
Me.chkRegEx.TabIndex = 6
Me.chkRegEx.Text = "Regular Expression"
Me.chkRegEx.UseVisualStyleBackColor = True
'
'lblComments 'lblComments
' '
Me.lblComments.AutoSize = True Me.lblComments.AutoSize = True
Me.lblComments.Location = New System.Drawing.Point(7, 157) Me.lblComments.Location = New System.Drawing.Point(7, 181)
Me.lblComments.Name = "lblComments" Me.lblComments.Name = "lblComments"
Me.lblComments.Size = New System.Drawing.Size(59, 13) Me.lblComments.Size = New System.Drawing.Size(59, 13)
Me.lblComments.TabIndex = 18 Me.lblComments.TabIndex = 19
Me.lblComments.Text = "Comments:" Me.lblComments.Text = "Comments:"
' '
'txtComments 'txtComments
' '
Me.txtComments.Location = New System.Drawing.Point(70, 154) Me.txtComments.Location = New System.Drawing.Point(70, 181)
Me.txtComments.Multiline = True Me.txtComments.Multiline = True
Me.txtComments.Name = "txtComments" Me.txtComments.Name = "txtComments"
Me.txtComments.ScrollBars = System.Windows.Forms.ScrollBars.Vertical Me.txtComments.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.txtComments.Size = New System.Drawing.Size(413, 54) Me.txtComments.Size = New System.Drawing.Size(413, 71)
Me.txtComments.TabIndex = 17 Me.txtComments.TabIndex = 20
' '
'txtParameter 'txtParameter
' '
Me.txtParameter.Location = New System.Drawing.Point(333, 45) Me.txtParameter.Location = New System.Drawing.Point(70, 71)
Me.txtParameter.Name = "txtParameter" Me.txtParameter.Name = "txtParameter"
Me.txtParameter.Size = New System.Drawing.Size(150, 20) Me.txtParameter.Size = New System.Drawing.Size(414, 20)
Me.txtParameter.TabIndex = 7 Me.txtParameter.TabIndex = 8
' '
'lblParameter 'lblParameter
' '
Me.lblParameter.AutoSize = True Me.lblParameter.AutoSize = True
Me.lblParameter.Location = New System.Drawing.Point(269, 48) Me.lblParameter.Location = New System.Drawing.Point(7, 74)
Me.lblParameter.Name = "lblParameter" Me.lblParameter.Name = "lblParameter"
Me.lblParameter.Size = New System.Drawing.Size(58, 13) Me.lblParameter.Size = New System.Drawing.Size(58, 13)
Me.lblParameter.TabIndex = 6 Me.lblParameter.TabIndex = 7
Me.lblParameter.Text = "Parameter:" Me.lblParameter.Text = "Parameter:"
' '
'chkCleanFolder 'chkCleanFolder
' '
Me.chkCleanFolder.AutoSize = True Me.chkCleanFolder.AutoSize = True
Me.chkCleanFolder.Location = New System.Drawing.Point(329, 101) Me.chkCleanFolder.Location = New System.Drawing.Point(330, 127)
Me.chkCleanFolder.Name = "chkCleanFolder" Me.chkCleanFolder.Name = "chkCleanFolder"
Me.chkCleanFolder.Size = New System.Drawing.Size(136, 17) Me.chkCleanFolder.Size = New System.Drawing.Size(136, 17)
Me.chkCleanFolder.TabIndex = 13 Me.chkCleanFolder.TabIndex = 14
Me.chkCleanFolder.Text = "Delete folder on restore" Me.chkCleanFolder.Text = "Delete folder on restore"
Me.chkCleanFolder.UseVisualStyleBackColor = True 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(376, 157)
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 = 16 Me.lblLimit.TabIndex = 18
Me.lblLimit.Text = "Backup Limit" Me.lblLimit.Text = "Backup Limit"
Me.lblLimit.Visible = False Me.lblLimit.Visible = False
' '
'nudLimit 'nudLimit
' '
Me.nudLimit.Location = New System.Drawing.Point(329, 128) Me.nudLimit.Location = New System.Drawing.Point(330, 155)
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 = 15 Me.nudLimit.TabIndex = 17
Me.nudLimit.Value = New Decimal(New Integer() {2, 0, 0, 0})
Me.nudLimit.Visible = False Me.nudLimit.Visible = False
' '
'btnExclude 'btnExclude
' '
Me.btnExclude.Location = New System.Drawing.Point(9, 125) Me.btnExclude.Location = New System.Drawing.Point(10, 152)
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 = 11 Me.btnExclude.TabIndex = 15
Me.btnExclude.Text = "E&xclude Items..." Me.btnExclude.Text = "E&xclude Items..."
Me.btnExclude.UseVisualStyleBackColor = True Me.btnExclude.UseVisualStyleBackColor = True
' '
'btnInclude 'btnInclude
' '
Me.btnInclude.Location = New System.Drawing.Point(9, 97) Me.btnInclude.Location = New System.Drawing.Point(10, 123)
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 = 10 Me.btnInclude.TabIndex = 12
Me.btnInclude.Text = "In&clude Items..." Me.btnInclude.Text = "Incl&ude Items..."
Me.btnInclude.UseVisualStyleBackColor = True Me.btnInclude.UseVisualStyleBackColor = True
' '
'txtID 'txtID
' '
Me.txtID.Enabled = False Me.txtID.Enabled = False
Me.txtID.Location = New System.Drawing.Point(489, 19) Me.txtID.Location = New System.Drawing.Point(489, 180)
Me.txtID.Name = "txtID" Me.txtID.Name = "txtID"
Me.txtID.Size = New System.Drawing.Size(30, 20) Me.txtID.Size = New System.Drawing.Size(30, 20)
Me.txtID.TabIndex = 0 Me.txtID.TabIndex = 0
@@ -280,16 +306,16 @@ Partial Class frmGameManager
' '
'btnSavePathBrowse 'btnSavePathBrowse
' '
Me.btnSavePathBrowse.Location = New System.Drawing.Point(489, 71) Me.btnSavePathBrowse.Location = New System.Drawing.Point(490, 97)
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 = 9 Me.btnSavePathBrowse.TabIndex = 11
Me.btnSavePathBrowse.Text = "..." Me.btnSavePathBrowse.Text = "..."
Me.btnSavePathBrowse.UseVisualStyleBackColor = True Me.btnSavePathBrowse.UseVisualStyleBackColor = True
' '
'btnProcessBrowse 'btnProcessBrowse
' '
Me.btnProcessBrowse.Location = New System.Drawing.Point(225, 44) Me.btnProcessBrowse.Location = New System.Drawing.Point(366, 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
@@ -299,25 +325,25 @@ Partial Class frmGameManager
'lblSavePath 'lblSavePath
' '
Me.lblSavePath.AutoSize = True Me.lblSavePath.AutoSize = True
Me.lblSavePath.Location = New System.Drawing.Point(6, 74) Me.lblSavePath.Location = New System.Drawing.Point(7, 101)
Me.lblSavePath.Name = "lblSavePath" Me.lblSavePath.Name = "lblSavePath"
Me.lblSavePath.Size = New System.Drawing.Size(60, 13) Me.lblSavePath.Size = New System.Drawing.Size(60, 13)
Me.lblSavePath.TabIndex = 2 Me.lblSavePath.TabIndex = 9
Me.lblSavePath.Text = "Save Path:" Me.lblSavePath.Text = "Save Path:"
' '
'lblProcess 'lblProcess
' '
Me.lblProcess.AutoSize = True Me.lblProcess.AutoSize = True
Me.lblProcess.Location = New System.Drawing.Point(6, 48) Me.lblProcess.Location = New System.Drawing.Point(7, 47)
Me.lblProcess.Name = "lblProcess" Me.lblProcess.Name = "lblProcess"
Me.lblProcess.Size = New System.Drawing.Size(48, 13) Me.lblProcess.Size = New System.Drawing.Size(48, 13)
Me.lblProcess.TabIndex = 1 Me.lblProcess.TabIndex = 3
Me.lblProcess.Text = "Process:" Me.lblProcess.Text = "Process:"
' '
'lblName 'lblName
' '
Me.lblName.AutoSize = True Me.lblName.AutoSize = True
Me.lblName.Location = New System.Drawing.Point(6, 22) Me.lblName.Location = New System.Drawing.Point(7, 22)
Me.lblName.Name = "lblName" Me.lblName.Name = "lblName"
Me.lblName.Size = New System.Drawing.Size(38, 13) Me.lblName.Size = New System.Drawing.Size(38, 13)
Me.lblName.TabIndex = 0 Me.lblName.TabIndex = 0
@@ -325,7 +351,7 @@ Partial Class frmGameManager
' '
'txtExclude 'txtExclude
' '
Me.txtExclude.Location = New System.Drawing.Point(489, 122) Me.txtExclude.Location = New System.Drawing.Point(489, 154)
Me.txtExclude.Name = "txtExclude" Me.txtExclude.Name = "txtExclude"
Me.txtExclude.Size = New System.Drawing.Size(30, 20) Me.txtExclude.Size = New System.Drawing.Size(30, 20)
Me.txtExclude.TabIndex = 0 Me.txtExclude.TabIndex = 0
@@ -334,7 +360,7 @@ Partial Class frmGameManager
' '
'txtFileType 'txtFileType
' '
Me.txtFileType.Location = New System.Drawing.Point(489, 99) Me.txtFileType.Location = New System.Drawing.Point(489, 125)
Me.txtFileType.Name = "txtFileType" Me.txtFileType.Name = "txtFileType"
Me.txtFileType.Size = New System.Drawing.Size(30, 20) Me.txtFileType.Size = New System.Drawing.Size(30, 20)
Me.txtFileType.TabIndex = 0 Me.txtFileType.TabIndex = 0
@@ -344,48 +370,48 @@ Partial Class frmGameManager
'chkTimeStamp 'chkTimeStamp
' '
Me.chkTimeStamp.AutoSize = True Me.chkTimeStamp.AutoSize = True
Me.chkTimeStamp.Location = New System.Drawing.Point(190, 129) Me.chkTimeStamp.Location = New System.Drawing.Point(191, 156)
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 = 14 Me.chkTimeStamp.TabIndex = 16
Me.chkTimeStamp.Text = "Save multiple backups" Me.chkTimeStamp.Text = "Save multiple backups"
Me.chkTimeStamp.UseVisualStyleBackColor = True Me.chkTimeStamp.UseVisualStyleBackColor = True
' '
'chkFolderSave 'chkFolderSave
' '
Me.chkFolderSave.AutoSize = True Me.chkFolderSave.AutoSize = True
Me.chkFolderSave.Location = New System.Drawing.Point(190, 101) Me.chkFolderSave.Location = New System.Drawing.Point(191, 127)
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 = 12 Me.chkFolderSave.TabIndex = 13
Me.chkFolderSave.Text = "Save entire folder" Me.chkFolderSave.Text = "Save entire folder"
Me.chkFolderSave.UseVisualStyleBackColor = True Me.chkFolderSave.UseVisualStyleBackColor = True
' '
'txtSavePath 'txtSavePath
' '
Me.txtSavePath.Location = New System.Drawing.Point(69, 71) Me.txtSavePath.Location = New System.Drawing.Point(70, 97)
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 = 8 Me.txtSavePath.TabIndex = 10
' '
'txtProcess 'txtProcess
' '
Me.txtProcess.Location = New System.Drawing.Point(69, 45) Me.txtProcess.Location = New System.Drawing.Point(70, 44)
Me.txtProcess.Name = "txtProcess" Me.txtProcess.Name = "txtProcess"
Me.txtProcess.Size = New System.Drawing.Size(150, 20) Me.txtProcess.Size = New System.Drawing.Size(290, 20)
Me.txtProcess.TabIndex = 4 Me.txtProcess.TabIndex = 4
' '
'txtName 'txtName
' '
Me.txtName.Location = New System.Drawing.Point(69, 19) Me.txtName.Location = New System.Drawing.Point(70, 19)
Me.txtName.Name = "txtName" Me.txtName.Name = "txtName"
Me.txtName.Size = New System.Drawing.Size(414, 20) Me.txtName.Size = New System.Drawing.Size(326, 20)
Me.txtName.TabIndex = 3 Me.txtName.TabIndex = 1
' '
'chkMonitorOnly 'chkMonitorOnly
' '
Me.chkMonitorOnly.AutoSize = True Me.chkMonitorOnly.AutoSize = True
Me.chkMonitorOnly.Location = New System.Drawing.Point(363, 398) Me.chkMonitorOnly.Location = New System.Drawing.Point(363, 441)
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
@@ -409,7 +435,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(248, 233) Me.grpExtra.Location = New System.Drawing.Point(248, 276)
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
@@ -540,16 +566,17 @@ Partial Class frmGameManager
' '
'btnTags 'btnTags
' '
Me.btnTags.Location = New System.Drawing.Point(535, 394) Me.btnTags.Location = New System.Drawing.Point(535, 437)
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 = 13
Me.btnTags.Text = "Tags..." Me.btnTags.Text = "&Tags..."
Me.btnTags.UseVisualStyleBackColor = True Me.btnTags.UseVisualStyleBackColor = True
' '
'grpStats 'grpStats
' '
Me.grpStats.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.grpStats.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.grpStats.Controls.Add(Me.btnImportBackup)
Me.grpStats.Controls.Add(Me.cboRemoteBackup) Me.grpStats.Controls.Add(Me.cboRemoteBackup)
Me.grpStats.Controls.Add(Me.lblRestorePathData) Me.grpStats.Controls.Add(Me.lblRestorePathData)
Me.grpStats.Controls.Add(Me.lblBackupFileData) Me.grpStats.Controls.Add(Me.lblBackupFileData)
@@ -561,13 +588,22 @@ 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, 423) Me.grpStats.Location = New System.Drawing.Point(248, 466)
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 = 16
Me.grpStats.TabStop = False Me.grpStats.TabStop = False
Me.grpStats.Text = "Backup Information" Me.grpStats.Text = "Backup Information"
' '
'btnImportBackup
'
Me.btnImportBackup.Location = New System.Drawing.Point(9, 125)
Me.btnImportBackup.Name = "btnImportBackup"
Me.btnImportBackup.Size = New System.Drawing.Size(114, 23)
Me.btnImportBackup.TabIndex = 8
Me.btnImportBackup.Text = "Import B&ackup Files"
Me.btnImportBackup.UseVisualStyleBackColor = True
'
'cboRemoteBackup 'cboRemoteBackup
' '
Me.cboRemoteBackup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cboRemoteBackup.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
@@ -642,7 +678,7 @@ Partial Class frmGameManager
Me.btnDeleteBackup.Location = New System.Drawing.Point(129, 125) Me.btnDeleteBackup.Location = New System.Drawing.Point(129, 125)
Me.btnDeleteBackup.Name = "btnDeleteBackup" Me.btnDeleteBackup.Name = "btnDeleteBackup"
Me.btnDeleteBackup.Size = New System.Drawing.Size(114, 23) Me.btnDeleteBackup.Size = New System.Drawing.Size(114, 23)
Me.btnDeleteBackup.TabIndex = 8 Me.btnDeleteBackup.TabIndex = 9
Me.btnDeleteBackup.Text = "&Delete Backup" Me.btnDeleteBackup.Text = "&Delete Backup"
Me.btnDeleteBackup.UseVisualStyleBackColor = True Me.btnDeleteBackup.UseVisualStyleBackColor = True
' '
@@ -676,30 +712,30 @@ 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, 586) Me.btnMarkAsRestored.Location = New System.Drawing.Point(429, 626)
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 = 16 Me.btnMarkAsRestored.TabIndex = 17
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, 586) Me.btnRestore.Location = New System.Drawing.Point(535, 626)
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 = 17 Me.btnRestore.TabIndex = 18
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, 394) Me.btnSave.Location = New System.Drawing.Point(616, 437)
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 = 14
Me.btnSave.Text = "&Save" Me.btnSave.Text = "&Save"
Me.btnSave.UseVisualStyleBackColor = True Me.btnSave.UseVisualStyleBackColor = True
' '
@@ -709,23 +745,23 @@ 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, 420) Me.lstGames.Size = New System.Drawing.Size(228, 459)
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, 394) Me.btnCancel.Location = New System.Drawing.Point(697, 437)
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 = 15
Me.btnCancel.Text = "&Cancel" Me.btnCancel.Text = "Ca&ncel"
Me.btnCancel.UseVisualStyleBackColor = True Me.btnCancel.UseVisualStyleBackColor = True
' '
'chkEnabled 'chkEnabled
' '
Me.chkEnabled.AutoSize = True Me.chkEnabled.AutoSize = True
Me.chkEnabled.Location = New System.Drawing.Point(248, 398) Me.chkEnabled.Location = New System.Drawing.Point(248, 441)
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
@@ -791,7 +827,7 @@ Partial Class frmGameManager
' '
'btnImport 'btnImport
' '
Me.btnImport.Location = New System.Drawing.Point(84, 586) Me.btnImport.Location = New System.Drawing.Point(84, 626)
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
@@ -800,7 +836,7 @@ Partial Class frmGameManager
' '
'btnExport 'btnExport
' '
Me.btnExport.Location = New System.Drawing.Point(165, 586) Me.btnExport.Location = New System.Drawing.Point(165, 626)
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
@@ -816,10 +852,23 @@ Partial Class frmGameManager
' '
'cmsOfficial 'cmsOfficial
' '
Me.cmsOfficial.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cmsOfficialWindows, Me.cmsOfficialLinux})
Me.cmsOfficial.Name = "cmsOfficial" Me.cmsOfficial.Name = "cmsOfficial"
Me.cmsOfficial.Size = New System.Drawing.Size(117, 22) Me.cmsOfficial.Size = New System.Drawing.Size(117, 22)
Me.cmsOfficial.Text = "&Official List..." Me.cmsOfficial.Text = "&Official List..."
' '
'cmsOfficialWindows
'
Me.cmsOfficialWindows.Name = "cmsOfficialWindows"
Me.cmsOfficialWindows.Size = New System.Drawing.Size(180, 22)
Me.cmsOfficialWindows.Text = "&Windows..."
'
'cmsOfficialLinux
'
Me.cmsOfficialLinux.Name = "cmsOfficialLinux"
Me.cmsOfficialLinux.Size = New System.Drawing.Size(180, 22)
Me.cmsOfficialLinux.Text = "&Linux..."
'
'cmsFile 'cmsFile
' '
Me.cmsFile.Name = "cmsFile" Me.cmsFile.Name = "cmsFile"
@@ -861,11 +910,27 @@ Partial Class frmGameManager
Me.cmsDeleteAll.Size = New System.Drawing.Size(114, 22) Me.cmsDeleteAll.Size = New System.Drawing.Size(114, 22)
Me.cmsDeleteAll.Text = "&All Files" Me.cmsDeleteAll.Text = "&All Files"
' '
'btnProcesses
'
Me.btnProcesses.Location = New System.Drawing.Point(454, 437)
Me.btnProcesses.Name = "btnProcesses"
Me.btnProcesses.Size = New System.Drawing.Size(75, 23)
Me.btnProcesses.TabIndex = 12
Me.btnProcesses.Text = "Pro&cesses..."
Me.btnProcesses.UseVisualStyleBackColor = True
'
'ttFullPath
'
Me.ttFullPath.AutoPopDelay = 5000
Me.ttFullPath.InitialDelay = 300
Me.ttFullPath.ReshowDelay = 60
'
'frmGameManager '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, 621) Me.ClientSize = New System.Drawing.Size(784, 661)
Me.Controls.Add(Me.btnProcesses)
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)
@@ -987,4 +1052,11 @@ Partial Class frmGameManager
Friend WithEvents lblParameter As Label Friend WithEvents lblParameter As Label
Friend WithEvents lblComments As Label Friend WithEvents lblComments As Label
Friend WithEvents txtComments As TextBox Friend WithEvents txtComments As TextBox
Friend WithEvents chkRegEx As CheckBox
Friend WithEvents btnGameID As Button
Friend WithEvents btnProcesses As Button
Friend WithEvents ttFullPath As ToolTip
Friend WithEvents btnImportBackup As Button
Friend WithEvents cmsOfficialWindows As ToolStripMenuItem
Friend WithEvents cmsOfficialLinux As ToolStripMenuItem
End Class End Class
+3
View File
@@ -123,4 +123,7 @@
<metadata name="cmsDeleteBackup.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"> <metadata name="cmsDeleteBackup.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>127, 17</value> <value>127, 17</value>
</metadata> </metadata>
<metadata name="ttFullPath.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
<value>275, 17</value>
</metadata>
</root> </root>
File diff suppressed because it is too large Load Diff
+142
View File
@@ -0,0 +1,142 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmGameProcesses
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.btnOpenProcesses = New System.Windows.Forms.Button()
Me.btnClose = New System.Windows.Forms.Button()
Me.lblGameProcesses = New System.Windows.Forms.Label()
Me.lblProcesses = New System.Windows.Forms.Label()
Me.btnRemove = New System.Windows.Forms.Button()
Me.btnAdd = New System.Windows.Forms.Button()
Me.lstGameProcesses = New System.Windows.Forms.ListBox()
Me.lstProcesses = New System.Windows.Forms.ListBox()
Me.SuspendLayout()
'
'btnOpenProcesses
'
Me.btnOpenProcesses.Location = New System.Drawing.Point(12, 229)
Me.btnOpenProcesses.Name = "btnOpenProcesses"
Me.btnOpenProcesses.Size = New System.Drawing.Size(110, 23)
Me.btnOpenProcesses.TabIndex = 4
Me.btnOpenProcesses.Text = "&Process Manager..."
Me.btnOpenProcesses.UseVisualStyleBackColor = True
'
'btnClose
'
Me.btnClose.Location = New System.Drawing.Point(297, 229)
Me.btnClose.Name = "btnClose"
Me.btnClose.Size = New System.Drawing.Size(75, 23)
Me.btnClose.TabIndex = 5
Me.btnClose.Text = "&Close"
Me.btnClose.UseVisualStyleBackColor = True
'
'lblGameProcesses
'
Me.lblGameProcesses.AutoSize = True
Me.lblGameProcesses.Location = New System.Drawing.Point(251, 8)
Me.lblGameProcesses.Name = "lblGameProcesses"
Me.lblGameProcesses.Size = New System.Drawing.Size(93, 13)
Me.lblGameProcesses.TabIndex = 0
Me.lblGameProcesses.Text = "Current Processes"
'
'lblProcesses
'
Me.lblProcesses.AutoSize = True
Me.lblProcesses.Location = New System.Drawing.Point(36, 8)
Me.lblProcesses.Name = "lblProcesses"
Me.lblProcesses.Size = New System.Drawing.Size(102, 13)
Me.lblProcesses.TabIndex = 0
Me.lblProcesses.Text = "Available Processes"
'
'btnRemove
'
Me.btnRemove.Location = New System.Drawing.Point(168, 114)
Me.btnRemove.Name = "btnRemove"
Me.btnRemove.Size = New System.Drawing.Size(48, 23)
Me.btnRemove.TabIndex = 2
Me.btnRemove.Text = "<"
Me.btnRemove.UseVisualStyleBackColor = True
'
'btnAdd
'
Me.btnAdd.Location = New System.Drawing.Point(168, 85)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing.Size(48, 23)
Me.btnAdd.TabIndex = 1
Me.btnAdd.Text = ">"
Me.btnAdd.UseVisualStyleBackColor = True
'
'lstGameProcesses
'
Me.lstGameProcesses.FormattingEnabled = True
Me.lstGameProcesses.Location = New System.Drawing.Point(222, 24)
Me.lstGameProcesses.Name = "lstGameProcesses"
Me.lstGameProcesses.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended
Me.lstGameProcesses.Size = New System.Drawing.Size(150, 199)
Me.lstGameProcesses.Sorted = True
Me.lstGameProcesses.TabIndex = 3
'
'lstProcesses
'
Me.lstProcesses.FormattingEnabled = True
Me.lstProcesses.Location = New System.Drawing.Point(12, 24)
Me.lstProcesses.Name = "lstProcesses"
Me.lstProcesses.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended
Me.lstProcesses.Size = New System.Drawing.Size(150, 199)
Me.lstProcesses.Sorted = True
Me.lstProcesses.TabIndex = 0
'
'frmGameProcesses
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(384, 261)
Me.Controls.Add(Me.btnOpenProcesses)
Me.Controls.Add(Me.btnClose)
Me.Controls.Add(Me.lblGameProcesses)
Me.Controls.Add(Me.lblProcesses)
Me.Controls.Add(Me.btnRemove)
Me.Controls.Add(Me.btnAdd)
Me.Controls.Add(Me.lstGameProcesses)
Me.Controls.Add(Me.lstProcesses)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmGameProcesses"
Me.ShowIcon = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Edit Processes"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents btnOpenProcesses As Button
Friend WithEvents btnClose As Button
Friend WithEvents lblGameProcesses As Label
Friend WithEvents lblProcesses As Label
Friend WithEvents btnRemove As Button
Friend WithEvents btnAdd As Button
Friend WithEvents lstGameProcesses As ListBox
Friend WithEvents lstProcesses As ListBox
End Class
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+247
View File
@@ -0,0 +1,247 @@
Imports GBM.My.Resources
Public Class frmGameProcesses
Private sMonitorIDs As List(Of String)
Private sGameName As String = String.Empty
Private bNewMode As Boolean = False
Private oProcessList As List(Of KeyValuePair(Of String, String))
Public Property IDList As List(Of String)
Get
Return sMonitorIDs
End Get
Set(value As List(Of String))
sMonitorIDs = value
End Set
End Property
Public Property GameName As String
Get
Return sGameName
End Get
Set(value As String)
sGameName = value
End Set
End Property
Public Property NewMode As Boolean
Get
Return bNewMode
End Get
Set(value As Boolean)
bNewMode = value
End Set
End Property
Public Property ProcessList As List(Of KeyValuePair(Of String, String))
Get
Return oProcessList
End Get
Set(value As List(Of KeyValuePair(Of String, String)))
oProcessList = value
End Set
End Property
Private Sub AddProcess()
Dim oData As KeyValuePair(Of String, String)
Dim oProcesss As List(Of KeyValuePair(Of String, String))
Dim oGameProcess As clsGameProcess
Dim oGameProcesses As List(Of clsGameProcess)
If lstProcesses.SelectedItems.Count = 1 Then
oData = lstProcesses.SelectedItems(0)
oGameProcesses = New List(Of clsGameProcess)
For Each sID As String In IDList
oGameProcess = New clsGameProcess
oGameProcess.MonitorID = sID
oGameProcess.ProcessID = oData.Key
oGameProcesses.Add(oGameProcess)
Next
If Not bNewMode Then mgrGameProcesses.DoGameProcessAddBatch(oGameProcesses)
lstGameProcesses.Items.Add(oData)
lstProcesses.Items.Remove(oData)
ElseIf lstProcesses.SelectedItems.Count > 1 Then
oProcesss = New List(Of KeyValuePair(Of String, String))
For Each oData In lstProcesses.SelectedItems
oProcesss.Add(oData)
Next
For Each kp As KeyValuePair(Of String, String) In oProcesss
oGameProcesses = New List(Of clsGameProcess)
For Each sID As String In IDList
oGameProcess = New clsGameProcess
oGameProcess.MonitorID = sID
oGameProcess.ProcessID = kp.Key
oGameProcesses.Add(oGameProcess)
Next
If Not bNewMode Then mgrGameProcesses.DoGameProcessAddBatch(oGameProcesses)
lstGameProcesses.Items.Add(kp)
lstProcesses.Items.Remove(kp)
Next
End If
End Sub
Private Sub RemoveProcess()
Dim oData As KeyValuePair(Of String, String)
Dim oProcesses As List(Of KeyValuePair(Of String, String))
Dim oGameProcess As clsGameProcess
Dim oGameProcesses As List(Of clsGameProcess)
If lstGameProcesses.SelectedItems.Count = 1 Then
oData = lstGameProcesses.SelectedItems(0)
oGameProcesses = New List(Of clsGameProcess)
For Each sID As String In IDList
oGameProcess = New clsGameProcess
oGameProcess.MonitorID = sID
oGameProcess.ProcessID = oData.Key
oGameProcesses.Add(oGameProcess)
Next
If Not bNewMode Then mgrGameProcesses.DoGameProcessDelete(oGameProcesses)
lstGameProcesses.Items.Remove(oData)
lstProcesses.Items.Add(oData)
ElseIf lstGameProcesses.SelectedItems.Count > 1 Then
oProcesses = New List(Of KeyValuePair(Of String, String))
For Each oData In lstGameProcesses.SelectedItems
oProcesses.Add(oData)
Next
For Each kp As KeyValuePair(Of String, String) In oProcesses
oGameProcesses = New List(Of clsGameProcess)
For Each sID As String In IDList
oGameProcess = New clsGameProcess
oGameProcess.MonitorID = sID
oGameProcess.ProcessID = kp.Key
oGameProcesses.Add(oGameProcess)
Next
If Not bNewMode Then mgrGameProcesses.DoGameProcessDelete(oGameProcesses)
lstGameProcesses.Items.Remove(kp)
lstProcesses.Items.Add(kp)
Next
End If
End Sub
Private Sub LoadData()
Dim hshProcesses As Hashtable
Dim hshGameProcesses As Hashtable
Dim oProcess As clsProcess
Dim oData As KeyValuePair(Of String, String)
'Load Processes
hshProcesses = mgrProcess.ReadProcesses()
'Handle Lists
lstProcesses.Items.Clear()
lstGameProcesses.Items.Clear()
lstProcesses.ValueMember = "Key"
lstProcesses.DisplayMember = "Value"
lstGameProcesses.ValueMember = "Key"
lstGameProcesses.DisplayMember = "Value"
If bNewMode Then
For Each kp As KeyValuePair(Of String, String) In oProcessList
'We need to be sure the tags still exist if the "Process Manager" form was used
If hshProcesses.ContainsKey(kp.Value) Then
lstGameProcesses.Items.Add(kp)
End If
Next
For Each kp As KeyValuePair(Of String, String) In oProcessList
If hshProcesses.ContainsKey(kp.Value) Then
hshProcesses.Remove(kp.Value)
End If
Next
Else
hshGameProcesses = mgrGameProcesses.GetProcessesByGameMulti(IDList)
For Each de As DictionaryEntry In hshGameProcesses
oProcess = DirectCast(de.Value, clsProcess)
If hshProcesses.ContainsKey(oProcess.Name) Then
hshProcesses.Remove(oProcess.Name)
End If
Next
For Each de As DictionaryEntry In hshGameProcesses
oProcess = DirectCast(de.Value, clsProcess)
oData = New KeyValuePair(Of String, String)(oProcess.ID, oProcess.Name)
lstGameProcesses.Items.Add(oData)
Next
End If
For Each de As DictionaryEntry In hshProcesses
oProcess = DirectCast(de.Value, clsProcess)
oData = New KeyValuePair(Of String, String)(oProcess.ID, oProcess.Name)
lstProcesses.Items.Add(oData)
Next
End Sub
Private Sub BuildProcessList()
Dim oData As KeyValuePair(Of String, String)
oProcessList.Clear()
For Each oData In lstGameProcesses.Items
oProcessList.Add(oData)
Next
End Sub
Private Sub OpenProcessManager()
Dim frm As New frmProcessManager
frm.ShowDialog()
LoadData()
End Sub
Private Sub SetForm()
'Set Form Name
If IDList.Count > 1 Then
Me.Text = frmGameProcesses_FormNameMulti
Else
Me.Text = mgrCommon.FormatString(frmGameProcesses_FormNameSingle, GameName)
End If
'Set Form Text
btnOpenProcesses.Text = frmGameProcesses_btnOpenProcesses
btnClose.Text = frmGameProcesses_btnClose
lblGameProcesses.Text = frmGameProcesses_lblGameProccesses
lblProcesses.Text = frmGameProcesses_lblProcesses
btnRemove.Text = frmGameProcesses_btnRemove
btnAdd.Text = frmGameProcesses_btnAdd
End Sub
Private Sub frmGameProcesses_Load(sender As Object, e As EventArgs) Handles MyBase.Load
LoadData()
SetForm()
End Sub
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
If bNewMode Then BuildProcessList()
Me.Close()
End Sub
Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click
AddProcess()
End Sub
Private Sub btnRemove_Click(sender As Object, e As EventArgs) Handles btnRemove.Click
RemoveProcess()
End Sub
Private Sub btnOpenProcesses_Click(sender As Object, e As EventArgs) Handles btnOpenProcesses.Click
If bNewMode Then BuildProcessList()
OpenProcessManager()
End Sub
End Class
+89 -39
View File
@@ -36,12 +36,16 @@ Partial Class frmMain
Me.gMonTraySetupGameManager = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTraySetupGameManager = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTraySetupCustomVariables = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTraySetupCustomVariables = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTraySetupTags = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTraySetupTags = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTraySetupProcessManager = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTrayTools = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTrayTools = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTrayToolsCleanMan = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTrayToolsCompact = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTrayToolsCompact = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTrayToolsLog = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTrayToolsLog = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTrayLogClear = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTrayLogClear = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTrayLogSave = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTrayLogSave = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTrayToolsSessions = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTrayToolsSyncGameID = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTrayToolsSyncGameIDOfficial = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTrayToolsSyncGameIDFile = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTraySep1 = New System.Windows.Forms.ToolStripSeparator() Me.gMonTraySep1 = New System.Windows.Forms.ToolStripSeparator()
Me.gMonTrayExit = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTrayExit = New System.Windows.Forms.ToolStripMenuItem()
Me.bwMonitor = New System.ComponentModel.BackgroundWorker() Me.bwMonitor = New System.ComponentModel.BackgroundWorker()
@@ -62,13 +66,16 @@ Partial Class frmMain
Me.gMonSetupAddWizard = New System.Windows.Forms.ToolStripMenuItem() Me.gMonSetupAddWizard = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonSetupCustomVariables = New System.Windows.Forms.ToolStripMenuItem() Me.gMonSetupCustomVariables = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonSetupTags = New System.Windows.Forms.ToolStripMenuItem() Me.gMonSetupTags = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonSetupProcessManager = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonTools = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTools = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonToolsCleanMan = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonToolsCompact = New System.Windows.Forms.ToolStripMenuItem() Me.gMonToolsCompact = New System.Windows.Forms.ToolStripMenuItem()
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.gMonToolsSessions = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonToolsSyncGameID = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonToolsSyncGameIDOfficial = New System.Windows.Forms.ToolStripMenuItem()
Me.gMonToolsSyncGameIDFile = 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()
@@ -85,7 +92,6 @@ 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()
@@ -105,7 +111,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, 192) Me.gMonTrayMenu.Size = New System.Drawing.Size(162, 170)
' '
'gMonTrayNotification 'gMonTrayNotification
' '
@@ -139,7 +145,7 @@ Partial Class frmMain
' '
'gMonTraySetup 'gMonTraySetup
' '
Me.gMonTraySetup.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonTraySetupAddWizard, Me.gMonTraySetupGameManager, Me.gMonTraySetupCustomVariables, Me.gMonTraySetupTags}) Me.gMonTraySetup.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonTraySetupAddWizard, Me.gMonTraySetupGameManager, Me.gMonTraySetupTags, Me.gMonTraySetupProcessManager, Me.gMonTraySetupCustomVariables})
Me.gMonTraySetup.Name = "gMonTraySetup" Me.gMonTraySetup.Name = "gMonTraySetup"
Me.gMonTraySetup.Size = New System.Drawing.Size(161, 22) Me.gMonTraySetup.Size = New System.Drawing.Size(161, 22)
Me.gMonTraySetup.Text = "&Setup" Me.gMonTraySetup.Text = "&Setup"
@@ -160,52 +166,77 @@ Partial Class frmMain
' '
Me.gMonTraySetupCustomVariables.Name = "gMonTraySetupCustomVariables" Me.gMonTraySetupCustomVariables.Name = "gMonTraySetupCustomVariables"
Me.gMonTraySetupCustomVariables.Size = New System.Drawing.Size(201, 22) Me.gMonTraySetupCustomVariables.Size = New System.Drawing.Size(201, 22)
Me.gMonTraySetupCustomVariables.Text = "Custom &Path Variables..." Me.gMonTraySetupCustomVariables.Text = "Custom Path &Variables..."
' '
'gMonTraySetupTags 'gMonTraySetupTags
' '
Me.gMonTraySetupTags.Name = "gMonTraySetupTags" Me.gMonTraySetupTags.Name = "gMonTraySetupTags"
Me.gMonTraySetupTags.Size = New System.Drawing.Size(201, 22) Me.gMonTraySetupTags.Size = New System.Drawing.Size(201, 22)
Me.gMonTraySetupTags.Text = "&Tags..." Me.gMonTraySetupTags.Text = "&Tag Manager..."
'
'gMonTraySetupProcessManager
'
Me.gMonTraySetupProcessManager.Name = "gMonTraySetupProcessManager"
Me.gMonTraySetupProcessManager.Size = New System.Drawing.Size(201, 22)
Me.gMonTraySetupProcessManager.Text = "&Process Manager..."
' '
'gMonTrayTools 'gMonTrayTools
' '
Me.gMonTrayTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonTrayToolsCleanMan, Me.gMonTrayToolsCompact, Me.gMonTrayToolsLog, Me.gMonTrayToolsSessions}) Me.gMonTrayTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonTrayToolsCompact, Me.gMonTrayToolsLog, Me.gMonTrayToolsSessions, Me.gMonTrayToolsSyncGameID})
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"
' '
'gMonTrayToolsCleanMan
'
Me.gMonTrayToolsCleanMan.Name = "gMonTrayToolsCleanMan"
Me.gMonTrayToolsCleanMan.Size = New System.Drawing.Size(184, 22)
Me.gMonTrayToolsCleanMan.Text = "Clean Local Ma&nifest"
'
'gMonTrayToolsCompact 'gMonTrayToolsCompact
' '
Me.gMonTrayToolsCompact.Name = "gMonTrayToolsCompact" Me.gMonTrayToolsCompact.Name = "gMonTrayToolsCompact"
Me.gMonTrayToolsCompact.Size = New System.Drawing.Size(184, 22) Me.gMonTrayToolsCompact.Size = New System.Drawing.Size(179, 22)
Me.gMonTrayToolsCompact.Text = "&Compact Databases" Me.gMonTrayToolsCompact.Text = "&Compact Databases"
' '
'gMonTrayToolsLog 'gMonTrayToolsLog
' '
Me.gMonTrayToolsLog.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonTrayLogClear, Me.gMonTrayLogSave}) Me.gMonTrayToolsLog.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonTrayLogClear, Me.gMonTrayLogSave})
Me.gMonTrayToolsLog.Name = "gMonTrayToolsLog" Me.gMonTrayToolsLog.Name = "gMonTrayToolsLog"
Me.gMonTrayToolsLog.Size = New System.Drawing.Size(184, 22) Me.gMonTrayToolsLog.Size = New System.Drawing.Size(179, 22)
Me.gMonTrayToolsLog.Text = "&Log" Me.gMonTrayToolsLog.Text = "&Log"
' '
'gMonTrayLogClear 'gMonTrayLogClear
' '
Me.gMonTrayLogClear.Name = "gMonTrayLogClear" Me.gMonTrayLogClear.Name = "gMonTrayLogClear"
Me.gMonTrayLogClear.Size = New System.Drawing.Size(152, 22) Me.gMonTrayLogClear.Size = New System.Drawing.Size(101, 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(152, 22) Me.gMonTrayLogSave.Size = New System.Drawing.Size(101, 22)
Me.gMonTrayLogSave.Text = "&Save" Me.gMonTrayLogSave.Text = "&Save"
' '
'gMonTrayToolsSessions
'
Me.gMonTrayToolsSessions.Name = "gMonTrayToolsSessions"
Me.gMonTrayToolsSessions.Size = New System.Drawing.Size(179, 22)
Me.gMonTrayToolsSessions.Text = "&Session Viewer..."
'
'gMonTrayToolsSyncGameID
'
Me.gMonTrayToolsSyncGameID.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonTrayToolsSyncGameIDOfficial, Me.gMonTrayToolsSyncGameIDFile})
Me.gMonTrayToolsSyncGameID.Name = "gMonTrayToolsSyncGameID"
Me.gMonTrayToolsSyncGameID.Size = New System.Drawing.Size(179, 22)
Me.gMonTrayToolsSyncGameID.Text = "S&ync Game IDs"
'
'gMonTrayToolsSyncGameIDOfficial
'
Me.gMonTrayToolsSyncGameIDOfficial.Name = "gMonTrayToolsSyncGameIDOfficial"
Me.gMonTrayToolsSyncGameIDOfficial.Size = New System.Drawing.Size(142, 22)
Me.gMonTrayToolsSyncGameIDOfficial.Text = "&Official List..."
'
'gMonTrayToolsSyncGameIDFile
'
Me.gMonTrayToolsSyncGameIDFile.Name = "gMonTrayToolsSyncGameIDFile"
Me.gMonTrayToolsSyncGameIDFile.Size = New System.Drawing.Size(142, 22)
Me.gMonTrayToolsSyncGameIDFile.Text = "&File..."
'
'gMonTraySep1 'gMonTraySep1
' '
Me.gMonTraySep1.Name = "gMonTraySep1" Me.gMonTraySep1.Name = "gMonTraySep1"
@@ -319,7 +350,7 @@ Partial Class frmMain
' '
'gMonSetup 'gMonSetup
' '
Me.gMonSetup.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonSetupGameManager, Me.gMonSetupAddWizard, Me.gMonSetupCustomVariables, Me.gMonSetupTags}) Me.gMonSetup.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonSetupGameManager, Me.gMonSetupAddWizard, Me.gMonSetupTags, Me.gMonSetupProcessManager, Me.gMonSetupCustomVariables})
Me.gMonSetup.Name = "gMonSetup" Me.gMonSetup.Name = "gMonSetup"
Me.gMonSetup.Size = New System.Drawing.Size(49, 20) Me.gMonSetup.Size = New System.Drawing.Size(49, 20)
Me.gMonSetup.Text = "&Setup" Me.gMonSetup.Text = "&Setup"
@@ -340,38 +371,38 @@ Partial Class frmMain
' '
Me.gMonSetupCustomVariables.Name = "gMonSetupCustomVariables" Me.gMonSetupCustomVariables.Name = "gMonSetupCustomVariables"
Me.gMonSetupCustomVariables.Size = New System.Drawing.Size(201, 22) Me.gMonSetupCustomVariables.Size = New System.Drawing.Size(201, 22)
Me.gMonSetupCustomVariables.Text = "Custom &Path Variables..." Me.gMonSetupCustomVariables.Text = "Custom Path &Variables..."
' '
'gMonSetupTags 'gMonSetupTags
' '
Me.gMonSetupTags.Name = "gMonSetupTags" Me.gMonSetupTags.Name = "gMonSetupTags"
Me.gMonSetupTags.Size = New System.Drawing.Size(201, 22) Me.gMonSetupTags.Size = New System.Drawing.Size(201, 22)
Me.gMonSetupTags.Text = "&Tags..." Me.gMonSetupTags.Text = "&Tag Manager..."
'
'gMonSetupProcessManager
'
Me.gMonSetupProcessManager.Name = "gMonSetupProcessManager"
Me.gMonSetupProcessManager.Size = New System.Drawing.Size(201, 22)
Me.gMonSetupProcessManager.Text = "&Process Manager..."
' '
'gMonTools 'gMonTools
' '
Me.gMonTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonToolsCleanMan, Me.gMonToolsCompact, Me.gMonToolsLog, Me.gMonToolsSessions}) Me.gMonTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonToolsCompact, Me.gMonToolsLog, Me.gMonToolsSessions, Me.gMonToolsSyncGameID})
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"
' '
'gMonToolsCleanMan
'
Me.gMonToolsCleanMan.Name = "gMonToolsCleanMan"
Me.gMonToolsCleanMan.Size = New System.Drawing.Size(184, 22)
Me.gMonToolsCleanMan.Text = "Clean Local Ma&nifest"
'
'gMonToolsCompact 'gMonToolsCompact
' '
Me.gMonToolsCompact.Name = "gMonToolsCompact" Me.gMonToolsCompact.Name = "gMonToolsCompact"
Me.gMonToolsCompact.Size = New System.Drawing.Size(184, 22) Me.gMonToolsCompact.Size = New System.Drawing.Size(179, 22)
Me.gMonToolsCompact.Text = "&Compact Databases" Me.gMonToolsCompact.Text = "&Compact Databases"
' '
'gMonToolsLog 'gMonToolsLog
' '
Me.gMonToolsLog.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonLogClear, Me.gMonLogSave}) Me.gMonToolsLog.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonLogClear, Me.gMonLogSave})
Me.gMonToolsLog.Name = "gMonToolsLog" Me.gMonToolsLog.Name = "gMonToolsLog"
Me.gMonToolsLog.Size = New System.Drawing.Size(184, 22) Me.gMonToolsLog.Size = New System.Drawing.Size(179, 22)
Me.gMonToolsLog.Text = "&Log" Me.gMonToolsLog.Text = "&Log"
' '
'gMonLogClear 'gMonLogClear
@@ -389,9 +420,28 @@ Partial Class frmMain
'gMonToolsSessions 'gMonToolsSessions
' '
Me.gMonToolsSessions.Name = "gMonToolsSessions" Me.gMonToolsSessions.Name = "gMonToolsSessions"
Me.gMonToolsSessions.Size = New System.Drawing.Size(184, 22) Me.gMonToolsSessions.Size = New System.Drawing.Size(179, 22)
Me.gMonToolsSessions.Text = "&Session Viewer..." Me.gMonToolsSessions.Text = "&Session Viewer..."
' '
'gMonToolsSyncGameID
'
Me.gMonToolsSyncGameID.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonToolsSyncGameIDOfficial, Me.gMonToolsSyncGameIDFile})
Me.gMonToolsSyncGameID.Name = "gMonToolsSyncGameID"
Me.gMonToolsSyncGameID.Size = New System.Drawing.Size(179, 22)
Me.gMonToolsSyncGameID.Text = "S&ync Game IDs"
'
'gMonToolsSyncGameIDOfficial
'
Me.gMonToolsSyncGameIDOfficial.Name = "gMonToolsSyncGameIDOfficial"
Me.gMonToolsSyncGameIDOfficial.Size = New System.Drawing.Size(142, 22)
Me.gMonToolsSyncGameIDOfficial.Text = "&Official List..."
'
'gMonToolsSyncGameIDFile
'
Me.gMonToolsSyncGameIDFile.Name = "gMonToolsSyncGameIDFile"
Me.gMonToolsSyncGameIDFile.Size = New System.Drawing.Size(142, 22)
Me.gMonToolsSyncGameIDFile.Text = "&File..."
'
'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})
@@ -532,12 +582,6 @@ 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!)
@@ -625,8 +669,6 @@ Partial Class frmMain
Friend WithEvents gMonTrayNotification As System.Windows.Forms.ToolStripMenuItem Friend WithEvents gMonTrayNotification As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents gMonHelpWebSite As System.Windows.Forms.ToolStripMenuItem Friend WithEvents gMonHelpWebSite As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents pbTime As System.Windows.Forms.PictureBox Friend WithEvents pbTime As System.Windows.Forms.PictureBox
Friend WithEvents gMonTrayToolsCleanMan As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents gMonToolsCleanMan As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents gMonToolsLog As ToolStripMenuItem Friend WithEvents gMonToolsLog As ToolStripMenuItem
Friend WithEvents gMonLogClear As ToolStripMenuItem Friend WithEvents gMonLogClear As ToolStripMenuItem
Friend WithEvents gMonLogSave As ToolStripMenuItem Friend WithEvents gMonLogSave As ToolStripMenuItem
@@ -637,4 +679,12 @@ Partial Class frmMain
Friend WithEvents gMonStripStatusButton As System.Windows.Forms.ToolStripStatusLabel Friend WithEvents gMonStripStatusButton As System.Windows.Forms.ToolStripStatusLabel
Friend WithEvents gMonToolsSessions As ToolStripMenuItem Friend WithEvents gMonToolsSessions As ToolStripMenuItem
Friend WithEvents gMonTrayToolsSessions As ToolStripMenuItem Friend WithEvents gMonTrayToolsSessions As ToolStripMenuItem
Friend WithEvents gMonToolsSyncGameID As ToolStripMenuItem
Friend WithEvents gMonToolsSyncGameIDOfficial As ToolStripMenuItem
Friend WithEvents gMonToolsSyncGameIDFile As ToolStripMenuItem
Friend WithEvents gMonTrayToolsSyncGameID As ToolStripMenuItem
Friend WithEvents gMonTrayToolsSyncGameIDOfficial As ToolStripMenuItem
Friend WithEvents gMonTrayToolsSyncGameIDFile As ToolStripMenuItem
Friend WithEvents gMonTraySetupProcessManager As ToolStripMenuItem
Friend WithEvents gMonSetupProcessManager As ToolStripMenuItem
End Class End Class
+330 -125
View File
@@ -40,6 +40,7 @@ Public Class frmMain
Private sPriorCompany As String Private sPriorCompany As String
Private sPriorVersion As String Private sPriorVersion As String
Private iRestoreTimeOut As Integer Private iRestoreTimeOut As Integer
Private oChildProcesses As New Hashtable
Private wState As FormWindowState = FormWindowState.Normal Private wState As FormWindowState = FormWindowState.Normal
'Developer Debug Flags 'Developer Debug Flags
@@ -52,7 +53,7 @@ Public Class frmMain
WithEvents tmRestoreCheck As New System.Timers.Timer WithEvents tmRestoreCheck As New System.Timers.Timer
WithEvents tmFileWatcherQueue As New System.Timers.Timer WithEvents tmFileWatcherQueue As New System.Timers.Timer
Public WithEvents oProcess As New mgrProcesses Public WithEvents oProcess As New mgrProcessDetection
Public WithEvents oBackup As New mgrBackup Public WithEvents oBackup As New mgrBackup
Public WithEvents oRestore As New mgrRestore Public WithEvents oRestore As New mgrRestore
Public hshScanList As Hashtable Public hshScanList As Hashtable
@@ -227,7 +228,7 @@ Public Class frmMain
If oGame.AbsolutePath = False Then If oGame.AbsolutePath = False Then
If oGame.ProcessPath = String.Empty Then If oGame.ProcessPath = String.Empty Then
If mgrCommon.IsProcessNotSearchable(oGame) Then bNoAuto = True If mgrCommon.IsProcessNotSearchable(oGame) Then bNoAuto = True
oGame.ProcessPath = mgrPath.ProcessPathSearch(oGame.Name, oGame.TrueProcess, mgrCommon.FormatString(frmMain_ErrorRelativePath, oGame.Name), bNoAuto) oGame.ProcessPath = mgrPath.ProcessPathSearch(oGame.Name, oGame.ProcessName, mgrCommon.FormatString(frmMain_ErrorRelativePath, oGame.Name), bNoAuto)
End If End If
If oGame.ProcessPath <> String.Empty Then If oGame.ProcessPath <> String.Empty Then
@@ -257,6 +258,12 @@ Public Class frmMain
End Sub End Sub
Private Sub RunImportBackup(ByVal oImportBackupList As Hashtable)
PauseScan()
oBackup.ImportBackupFiles(oImportBackupList)
ResumeScan()
End Sub
Private Function DoMultiGameCheck() As Boolean Private Function DoMultiGameCheck() As Boolean
Dim oResult As DialogResult Dim oResult As DialogResult
@@ -265,14 +272,9 @@ Public Class frmMain
frm.Process = oProcess frm.Process = oProcess
oResult = frm.ShowDialog() oResult = frm.ShowDialog()
If oResult = DialogResult.OK Then If oResult = DialogResult.OK Then
Dim sProcessPath As String
'Reload settings 'Reload settings
LoadGameSettings() LoadGameSettings()
'Retain the process path from old object
sProcessPath = oProcess.GameInfo.ProcessPath
oProcess.GameInfo = frm.Game oProcess.GameInfo = frm.Game
'Set the process path into the new object
oProcess.GameInfo.ProcessPath = sProcessPath
'A game was set, return and continue 'A game was set, return and continue
Return True Return True
Else Else
@@ -294,7 +296,7 @@ Public Class frmMain
OperationStarted(False) OperationStarted(False)
If oProcess.GameInfo.MonitorOnly = False Then If oProcess.GameInfo.MonitorOnly = False Then
If SupressBackup() Then If SuppressSession() Then
bDoBackup = False bDoBackup = False
UpdateLog(mgrCommon.FormatString(frmMain_ErrorBackupSessionLength, oProcess.GameInfo.Name), False) UpdateLog(mgrCommon.FormatString(frmMain_ErrorBackupSessionLength, oProcess.GameInfo.Name), False)
SetLastAction(mgrCommon.FormatString(frmMain_ErrorBackupSessionLength, oProcess.GameInfo.CroppedName)) SetLastAction(mgrCommon.FormatString(frmMain_ErrorBackupSessionLength, oProcess.GameInfo.CroppedName))
@@ -365,9 +367,9 @@ Public Class frmMain
Private Sub AutoRestoreCheck() Private Sub AutoRestoreCheck()
Dim slRestoreData As SortedList = mgrRestore.CompareManifests() Dim slRestoreData As SortedList = mgrRestore.CompareManifests()
Dim sNotReady As New List(Of String) Dim oNotReady As New List(Of clsBackup)
Dim sNotInstalled As New List(Of String) Dim oNotInstalled As New List(Of clsBackup)
Dim sNoCheckSum As New List(Of String) Dim oNoCheckSum As New List(Of clsBackup)
Dim oBackup As clsBackup Dim oBackup As clsBackup
Dim sFileName As String Dim sFileName As String
Dim sExtractPath As String Dim sExtractPath As String
@@ -395,18 +397,17 @@ Public Class frmMain
If oBackup.CheckSum <> String.Empty Then If oBackup.CheckSum <> String.Empty Then
sFileName = oSettings.BackupFolder & Path.DirectorySeparatorChar & oBackup.FileName sFileName = oSettings.BackupFolder & Path.DirectorySeparatorChar & oBackup.FileName
If mgrHash.Generate_SHA256_Hash(sFileName) <> oBackup.CheckSum Then If mgrHash.Generate_SHA256_Hash(sFileName) <> oBackup.CheckSum Then
sNotReady.Add(de.Key) oNotReady.Add(oBackup)
bFinished = False bFinished = False
End If End If
Else Else
sNoCheckSum.Add(de.Key) oNoCheckSum.Add(oBackup)
End If End If
'Check if the restore location exists, if not we assume the game is not installed and should be auto-marked. '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) hshGames = mgrMonitorList.DoListGetbyMonitorID(de.Key)
If hshGames.Count = 1 Then If hshGames.Count = 1 Then
oGame = DirectCast(hshGames(0), clsGame) oGame = DirectCast(hshGames(0), clsGame)
mgrRestore.DoPathOverride(oBackup, oGame)
If oGame.ProcessPath <> String.Empty Then If oGame.ProcessPath <> String.Empty Then
oBackup.RelativeRestorePath = oGame.ProcessPath & Path.DirectorySeparatorChar & oBackup.RestorePath oBackup.RelativeRestorePath = oGame.ProcessPath & Path.DirectorySeparatorChar & oBackup.RestorePath
End If End If
@@ -420,34 +421,34 @@ Public Class frmMain
If Not Directory.Exists(sExtractPath) Then If Not Directory.Exists(sExtractPath) Then
If oSettings.AutoMark Then If oSettings.AutoMark Then
If mgrManifest.DoGlobalManifestCheck(de.Key, mgrSQLite.Database.Local) Then If mgrManifest.DoManifestCheck(de.Key, mgrSQLite.Database.Local) Then
mgrManifest.DoManifestUpdateByName(de.Value, mgrSQLite.Database.Local) mgrManifest.DoManifestUpdateByMonitorID(de.Value, mgrSQLite.Database.Local)
Else Else
mgrManifest.DoManifestAdd(de.Value, mgrSQLite.Database.Local) mgrManifest.DoManifestAdd(de.Value, mgrSQLite.Database.Local)
End If End If
End If End If
sNotInstalled.Add(de.Key) oNotInstalled.Add(oBackup)
End If End If
Next Next
'Remove any backup files that are not ready 'Remove any backup files that are not ready
For Each s As String In sNotReady For Each o As clsBackup In oNotReady
slRestoreData.Remove(s) slRestoreData.Remove(o.MonitorID)
UpdateLog(mgrCommon.FormatString(frmMain_RestoreNotReady, s), False, ToolTipIcon.Info, True) UpdateLog(mgrCommon.FormatString(frmMain_RestoreNotReady, o.Name), False, ToolTipIcon.Info, True)
Next Next
'Remove any backup files that should not be automatically restored 'Remove any backup files that should not be automatically restored
For Each s As String In sNotInstalled For Each o As clsBackup In oNotInstalled
slRestoreData.Remove(s) slRestoreData.Remove(o.MonitorID)
If oSettings.AutoMark Then If oSettings.AutoMark Then
UpdateLog(mgrCommon.FormatString(frmMain_AutoMark, s), False, ToolTipIcon.Info, True) UpdateLog(mgrCommon.FormatString(frmMain_AutoMark, o.Name), False, ToolTipIcon.Info, True)
Else Else
UpdateLog(mgrCommon.FormatString(frmMain_NoAutoMark, s), False, ToolTipIcon.Info, True) UpdateLog(mgrCommon.FormatString(frmMain_NoAutoMark, o.Name), False, ToolTipIcon.Info, True)
End If End If
Next Next
For Each s As String In sNoCheckSum For Each o As clsBackup In oNoCheckSum
slRestoreData.Remove(s) slRestoreData.Remove(o.MonitorID)
UpdateLog(mgrCommon.FormatString(frmMain_NoCheckSum, s), False, ToolTipIcon.Info, True) UpdateLog(mgrCommon.FormatString(frmMain_NoCheckSum, o.Name), False, ToolTipIcon.Info, True)
Next Next
'Automatically restore backup files 'Automatically restore backup files
@@ -456,13 +457,14 @@ Public Class frmMain
hshRestore = New Hashtable hshRestore = New Hashtable
sGame = String.Empty sGame = String.Empty
For Each de As DictionaryEntry In slRestoreData For Each de As DictionaryEntry In slRestoreData
hshGames = mgrMonitorList.DoListGetbyName(de.Key) oBackup = DirectCast(de.Value, clsBackup)
hshGames = mgrMonitorList.DoListGetbyMonitorID(de.Key)
If hshGames.Count = 1 Then If hshGames.Count = 1 Then
oGame = DirectCast(hshGames(0), clsGame) oGame = DirectCast(hshGames(0), clsGame)
sGame = oGame.CroppedName sGame = oGame.CroppedName
hshRestore.Add(oGame, de.Value) hshRestore.Add(oGame, de.Value)
Else Else
UpdateLog(mgrCommon.FormatString(frmMain_AutoRestoreFailure, de.Key), False, ToolTipIcon.Info, True) UpdateLog(mgrCommon.FormatString(frmMain_AutoRestoreFailure, oBackup.Name), False, ToolTipIcon.Info, True)
End If End If
Next Next
@@ -525,7 +527,7 @@ Public Class frmMain
sIcon = fbBrowser.FileName sIcon = fbBrowser.FileName
If File.Exists(sIcon) Then If File.Exists(sIcon) Then
oProcess.GameInfo.Icon = sIcon oProcess.GameInfo.Icon = sIcon
pbIcon.Image = Image.FromFile(sIcon) pbIcon.Image = mgrCommon.SafeIconFromFile(sIcon)
mgrMonitorList.DoListUpdate(oProcess.GameInfo) mgrMonitorList.DoListUpdate(oProcess.GameInfo)
End If End If
End If End If
@@ -576,6 +578,25 @@ Public Class frmMain
End If End If
End Sub End Sub
Private Sub SetGameIcon()
Dim ic As Icon
Dim oBitmap As Bitmap
Try
'Grab icon from the executable
ic = System.Drawing.Icon.ExtractAssociatedIcon(oProcess.FoundProcess.MainModule.FileName)
oBitmap = New Bitmap(ic.ToBitmap)
ic.Dispose()
'Set the icon, we need to use an intermediary object to prevent file locking
pbIcon.Image = oBitmap
Catch ex As Exception
UpdateLog(mgrCommon.FormatString(frmMain_ErrorGameIcon), False, ToolTipIcon.Error)
UpdateLog(mgrCommon.FormatString(App_GenericError, ex.Message), False,, False)
End Try
End Sub
Private Sub SetGameInfo(Optional ByVal bMulti As Boolean = False) Private Sub SetGameInfo(Optional ByVal bMulti As Boolean = False)
Dim sFileName As String = String.Empty Dim sFileName As String = String.Empty
Dim sFileVersion As String = String.Empty Dim sFileVersion As String = String.Empty
@@ -585,6 +606,20 @@ Public Class frmMain
lblStatus1.Text = String.Empty lblStatus1.Text = String.Empty
lblStatus2.Text = String.Empty lblStatus2.Text = String.Empty
lblStatus3.Text = String.Empty lblStatus3.Text = String.Empty
pbIcon.Image = Icon_Unknown
'Set Game Icon
If Not mgrCommon.IsUnix Then SetGameIcon()
Try
'Set Game Details
sFileName = oProcess.FoundProcess.MainModule.FileName
sFileVersion = oProcess.FoundProcess.MainModule.FileVersionInfo.FileVersion
sCompanyName = oProcess.FoundProcess.MainModule.FileVersionInfo.CompanyName
Catch ex As Exception
UpdateLog(mgrCommon.FormatString(frmMain_ErrorGameDetails), False, ToolTipIcon.Error)
UpdateLog(mgrCommon.FormatString(App_GenericError, ex.Message), False,, False)
End Try
'Get Game Details 'Get Game Details
If bMulti Then If bMulti Then
@@ -594,28 +629,19 @@ Public Class frmMain
pbTime.Visible = False pbTime.Visible = False
lblTimeSpent.Visible = False lblTimeSpent.Visible = False
pbIcon.Image = Icon_Unknown pbIcon.Image = Icon_Unknown
lblStatus1.Text = frmMain_NoDetails If sFileName = String.Empty Then
lblStatus1.Text = frmMain_NoDetails
Else
lblStatus1.Text = sFileName
End If
Else Else
bAllowIcon = True bAllowIcon = True
bAllowDetails = True bAllowDetails = True
lblGameTitle.Text = oProcess.GameInfo.Name lblGameTitle.Text = oProcess.GameInfo.Name
Try
Dim ic As Icon = System.Drawing.Icon.ExtractAssociatedIcon(oProcess.FoundProcess.MainModule.FileName)
pbIcon.Image = ic.ToBitmap
'Set Game Details
sFileName = oProcess.FoundProcess.MainModule.FileName
sFileVersion = oProcess.FoundProcess.MainModule.FileVersionInfo.FileVersion
sCompanyName = oProcess.FoundProcess.MainModule.FileVersionInfo.CompanyName
Catch ex As Exception
pbIcon.Image = Icon_Unknown
End Try
'Check for a custom icon & details 'Check for a custom icon & details
If File.Exists(oProcess.GameInfo.Icon) Then If File.Exists(oProcess.GameInfo.Icon) Then
pbIcon.Image = Image.FromFile(oProcess.GameInfo.Icon) pbIcon.Image = mgrCommon.SafeIconFromFile(oProcess.GameInfo.Icon)
End If End If
If sFileName = String.Empty Then If sFileName = String.Empty Then
If oProcess.GameInfo.ProcessPath <> String.Empty Then If oProcess.GameInfo.ProcessPath <> String.Empty Then
@@ -709,27 +735,30 @@ Public Class frmMain
End If End If
mgrMonitorList.DoListUpdate(oProcess.GameInfo) mgrMonitorList.DoListUpdate(oProcess.GameInfo)
If oSettings.Sync Then mgrMonitorList.SyncMonitorLists(oSettings.SyncFields) mgrMonitorList.SyncMonitorLists(oSettings)
UpdateTimeSpent(dCurrentHours, oProcess.TimeSpent.TotalHours) UpdateTimeSpent(dCurrentHours, oProcess.TimeSpent.TotalHours)
End Sub End Sub
Private Sub HandleSession() Private Sub HandleSession()
Dim oSession As New clsSession Dim oSession As clsSession
'Record Session If Not SuppressSession() Then
oSession.MonitorID = oProcess.GameInfo.ID 'Record Session
oSession.SessionStart = oProcess.StartTime oSession = New clsSession
oSession.SessionEnd = oProcess.EndTime oSession.MonitorID = oProcess.GameInfo.ID
oSession.SessionStartFromDate = oProcess.StartTime
oSession.SessionEndFromDate = oProcess.EndTime
mgrSessions.AddSession(oSession) mgrSessions.AddSession(oSession)
End If
End Sub End Sub
Private Function SupressBackup() As Boolean Private Function SuppressSession() As Boolean
Dim iSession As Integer Dim iSession As Integer
If oSettings.SupressBackup Then If oSettings.SuppressBackup Then
iSession = Math.Ceiling(oProcess.TimeSpent.TotalMinutes) iSession = Math.Ceiling(oProcess.TimeSpent.TotalMinutes)
If iSession > oSettings.SupressBackupThreshold Then If iSession > oSettings.SuppressBackupThreshold Then
Return False Return False
Else Else
Return True Return True
@@ -837,18 +866,24 @@ Public Class frmMain
Dim frm As New frmTags Dim frm As New frmTags
PauseScan() PauseScan()
frm.ShowDialog() frm.ShowDialog()
If oSettings.Sync Then mgrMonitorList.SyncMonitorLists(oSettings.SyncFields) mgrMonitorList.SyncMonitorLists(oSettings)
ResumeScan()
End Sub
Private Sub OpenProcessManager()
Dim frm As New frmProcessManager
PauseScan()
frm.ShowDialog()
ResumeScan() ResumeScan()
End Sub End Sub
Private Sub OpenGameManager(Optional ByVal bPendingRestores As Boolean = False) Private Sub OpenGameManager(Optional ByVal bPendingRestores As Boolean = False)
Dim frm As New frmGameManager Dim frm As New frmGameManager
PauseScan() PauseScan()
frm.BackupFolder = oSettings.BackupFolder frm.Settings = oSettings
frm.PendingRestores = bPendingRestores frm.PendingRestores = bPendingRestores
frm.ShowDialog() frm.ShowDialog()
LoadGameSettings() LoadGameSettings()
If oSettings.Sync Then mgrMonitorList.SyncMonitorLists(oSettings.SyncFields)
ResumeScan() ResumeScan()
'Handle backup trigger 'Handle backup trigger
@@ -860,6 +895,11 @@ Public Class frmMain
If frm.TriggerRestore Then If frm.TriggerRestore Then
RunRestore(frm.RestoreList) RunRestore(frm.RestoreList)
End If End If
'Handle import backup trigger
If frm.TriggerImportBackup Then
RunImportBackup(frm.ImportBackupList)
End If
End Sub End Sub
Private Sub OpenSettings() Private Sub OpenSettings()
@@ -898,7 +938,7 @@ Public Class frmMain
frm.GameData = mgrMonitorList.ReadList(mgrMonitorList.eListTypes.FullList) frm.GameData = mgrMonitorList.ReadList(mgrMonitorList.eListTypes.FullList)
frm.ShowDialog() frm.ShowDialog()
LoadGameSettings() LoadGameSettings()
If oSettings.Sync Then mgrMonitorList.SyncMonitorLists(oSettings.SyncFields) mgrMonitorList.SyncMonitorLists(oSettings)
ResumeScan() ResumeScan()
End Sub End Sub
@@ -906,8 +946,8 @@ Public Class frmMain
Dim frm As New frmVariableManager Dim frm As New frmVariableManager
PauseScan() PauseScan()
frm.ShowDialog() frm.ShowDialog()
mgrPath.CustomVariablesReload() mgrPath.LoadCustomVariables()
If oSettings.Sync Then mgrMonitorList.SyncMonitorLists(oSettings.SyncFields) mgrMonitorList.SyncMonitorLists(oSettings)
ResumeScan() ResumeScan()
End Sub End Sub
@@ -972,18 +1012,42 @@ Public Class frmMain
Private Sub HandleSyncWatcher() Handles tmFileWatcherQueue.Elapsed Private Sub HandleSyncWatcher() Handles tmFileWatcherQueue.Elapsed
tmFileWatcherQueue.Stop() tmFileWatcherQueue.Stop()
StopSyncWatcher() StopSyncWatcher()
If oSettings.Sync Then
UpdateLog(frmMain_MasterListChanged, False, ToolTipIcon.Info, True) UpdateLog(frmMain_MasterListChanged, False, ToolTipIcon.Info, True)
SyncGameSettings() SyncGameSettings()
LoadGameSettings() LoadGameSettings()
End If
CheckForNewBackups() CheckForNewBackups()
StartSyncWatcher() StartSyncWatcher()
End Sub End Sub
Private Sub SyncGameSettings() Private Sub SyncGameSettings()
'Sync Monitor List 'Sync Monitor List
If oSettings.Sync Then mgrMonitorList.SyncMonitorLists(oSettings.SyncFields, False) mgrMonitorList.SyncMonitorLists(oSettings, False)
End Sub
Private Sub SyncGameIDs(ByVal bOfficial As Boolean)
Dim sLocation As String
PauseScan()
If mgrCommon.IsUnix Then
sLocation = App_URLImportLinux
Else
sLocation = App_URLImport
End If
If bOfficial Then
mgrMonitorList.SyncGameIDs(sLocation, oSettings, True)
Else
sLocation = mgrCommon.OpenFileBrowser("XML_Import", frmGameManager_ChooseImportXML, "xml", frmGameManager_XML, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), False)
If sLocation <> String.Empty Then
mgrMonitorList.SyncGameIDs(sLocation, oSettings, False)
End If
End If
ResumeScan()
End Sub End Sub
Private Sub LocalDatabaseCheck() Private Sub LocalDatabaseCheck()
@@ -996,6 +1060,13 @@ Public Class frmMain
oRemoteDatabase.DatabaseUpgrade() oRemoteDatabase.DatabaseUpgrade()
End Sub End Sub
Private Sub BackupDatabases()
Dim oLocalDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim oRemoteDatabase As New mgrSQLite(mgrSQLite.Database.Remote)
oLocalDatabase.BackupDB(App_BackupOnLaunchFileDescription, True)
oRemoteDatabase.BackupDB(App_BackupOnLaunchFileDescription, True)
End Sub
Private Sub LoadAndVerify() Private Sub LoadAndVerify()
'If the default utility is missing we cannot continue 'If the default utility is missing we cannot continue
@@ -1005,6 +1076,12 @@ Public Class frmMain
Exit Sub Exit Sub
End If End If
'Check Special Paths
If Not mgrPath.CheckSpecialPaths Then
bInitFail = True
Exit Sub
End If
'Local Database Check 'Local Database Check
VerifyDBVersion(mgrSQLite.Database.Local) VerifyDBVersion(mgrSQLite.Database.Local)
LocalDatabaseCheck() LocalDatabaseCheck()
@@ -1025,6 +1102,11 @@ Public Class frmMain
VerifyDBVersion(mgrSQLite.Database.Remote) VerifyDBVersion(mgrSQLite.Database.Remote)
RemoteDatabaseCheck() RemoteDatabaseCheck()
'Backup GBM data
If oSettings.BackupOnLaunch Then
BackupDatabases()
End If
'Sync Game Settings 'Sync Game Settings
SyncGameSettings() SyncGameSettings()
End If End If
@@ -1221,7 +1303,52 @@ Public Class frmMain
End If End If
End Sub End Sub
Private Function NotifySendUnix(ByVal sLogUpdate As String, ByVal objIcon As System.Windows.Forms.ToolTipIcon) As Boolean
Dim prsNotify As Process
Dim sUrgency As String
Dim sNotifyArgs As String
Dim bNotifyFailed As Boolean
'Build args for notify-send
Select Case objIcon
Case ToolTipIcon.Error
sUrgency = "critical"
Case ToolTipIcon.Warning
sUrgency = "normal"
Case ToolTipIcon.Info
sUrgency = "low"
Case Else
sUrgency = "low"
End Select
sNotifyArgs = "-i gbm " & "-u " & sUrgency & " """ & App_NameLong & """ ""<i>" & sLogUpdate.Replace("""", "\""") & "</i>"""
Try
'Execute notify-send
prsNotify = New Process
prsNotify.StartInfo.FileName = "/usr/bin/notify-send"
prsNotify.StartInfo.Arguments = sNotifyArgs
prsNotify.StartInfo.UseShellExecute = False
prsNotify.StartInfo.RedirectStandardOutput = True
prsNotify.StartInfo.CreateNoWindow = True
prsNotify.Start()
prsNotify.WaitForExit()
Select Case prsNotify.ExitCode
Case 0
bNotifyFailed = False
Case Else
bNotifyFailed = True
End Select
Catch
bNotifyFailed = True
End Try
Return bNotifyFailed
End Function
Public Sub UpdateLog(sLogUpdate As String, Optional bTrayUpdate As Boolean = True, Optional objIcon As System.Windows.Forms.ToolTipIcon = ToolTipIcon.Info, Optional bTimeStamp As Boolean = True) Handles oBackup.UpdateLog, oRestore.UpdateLog Public Sub UpdateLog(sLogUpdate As String, Optional bTrayUpdate As Boolean = True, Optional objIcon As System.Windows.Forms.ToolTipIcon = ToolTipIcon.Info, Optional bTimeStamp As Boolean = True) Handles oBackup.UpdateLog, oRestore.UpdateLog
Dim bNotifyFailed As Boolean
'Thread Safe (If one control requires an invoke assume they all do) 'Thread Safe (If one control requires an invoke assume they all do)
If txtLog.InvokeRequired = True Then If txtLog.InvokeRequired = True Then
Dim d As New UpdateLogCallBack(AddressOf UpdateLog) Dim d As New UpdateLogCallBack(AddressOf UpdateLog)
@@ -1257,9 +1384,18 @@ Public Class frmMain
txtLog.Select(txtLog.TextLength, 0) txtLog.Select(txtLog.TextLength, 0)
txtLog.ScrollToCaret() txtLog.ScrollToCaret()
gMonTray.BalloonTipText = sLogUpdate
gMonTray.BalloonTipIcon = objIcon If bTrayUpdate Then
If bTrayUpdate Then gMonTray.ShowBalloonTip(10000) If mgrCommon.IsUnix Then
bNotifyFailed = NotifySendUnix(sLogUpdate, objIcon)
End If
If Not mgrCommon.IsUnix Or bNotifyFailed Then
gMonTray.BalloonTipText = sLogUpdate
gMonTray.BalloonTipIcon = objIcon
gMonTray.ShowBalloonTip(10000)
End If
End If
End If End If
Application.DoEvents() Application.DoEvents()
End Sub End Sub
@@ -1297,11 +1433,14 @@ Public Class frmMain
gMonSetupAddWizard.Text = frmMain_gMonSetupAddWizard gMonSetupAddWizard.Text = frmMain_gMonSetupAddWizard
gMonSetupCustomVariables.Text = frmMain_gMonSetupCustomVariables gMonSetupCustomVariables.Text = frmMain_gMonSetupCustomVariables
gMonSetupTags.Text = frmMain_gMonSetupTags gMonSetupTags.Text = frmMain_gMonSetupTags
gMonSetupProcessManager.Text = frmMain_gMonSetupProcessManager
gMonTools.Text = frmMain_gMonTools gMonTools.Text = frmMain_gMonTools
gMonToolsCleanMan.Text = frmMain_gMonToolsCleanMan
gMonToolsCompact.Text = frmMain_gMonToolsCompact gMonToolsCompact.Text = frmMain_gMonToolsCompact
gMonToolsLog.Text = frmMain_gMonToolsLog gMonToolsLog.Text = frmMain_gMonToolsLog
gMonToolsSessions.Text = frmMain_gMonToolsSessions gMonToolsSessions.Text = frmMain_gMonToolsSessions
gMonToolsSyncGameID.Text = frmMain_gMonToolsSyncGameID
gMonToolsSyncGameIDOfficial.Text = frmMain_gMonToolsSyncGameIDOfficial
gMonToolsSyncGameIDFile.Text = frmMain_gMonToolsSyncGameIDFile
gMonLogClear.Text = frmMain_gMonLogClear gMonLogClear.Text = frmMain_gMonLogClear
gMonLogSave.Text = frmMain_gMonLogSave gMonLogSave.Text = frmMain_gMonLogSave
gMonHelp.Text = frmMain_gMonHelp gMonHelp.Text = frmMain_gMonHelp
@@ -1319,11 +1458,14 @@ Public Class frmMain
gMonTraySetupAddWizard.Text = frmMain_gMonSetupAddWizard gMonTraySetupAddWizard.Text = frmMain_gMonSetupAddWizard
gMonTraySetupCustomVariables.Text = frmMain_gMonSetupCustomVariables gMonTraySetupCustomVariables.Text = frmMain_gMonSetupCustomVariables
gMonTraySetupTags.Text = frmMain_gMonSetupTags gMonTraySetupTags.Text = frmMain_gMonSetupTags
gMonTraySetupProcessManager.Text = frmMain_gMonSetupProcessManager
gMonTrayTools.Text = frmMain_gMonTools gMonTrayTools.Text = frmMain_gMonTools
gMonTrayToolsCleanMan.Text = frmMain_gMonToolsCleanMan
gMonTrayToolsCompact.Text = frmMain_gMonToolsCompact gMonTrayToolsCompact.Text = frmMain_gMonToolsCompact
gMonTrayToolsLog.Text = frmMain_gMonToolsLog gMonTrayToolsLog.Text = frmMain_gMonToolsLog
gMonTrayToolsSessions.Text = frmMain_gMonToolsSessions gMonTrayToolsSessions.Text = frmMain_gMonToolsSessions
gMonTrayToolsSyncGameID.Text = frmMain_gMonToolsSyncGameID
gMonTrayToolsSyncGameIDOfficial.Text = frmMain_gMonToolsSyncGameIDOfficial
gMonTrayToolsSyncGameIDFile.Text = frmMain_gMonToolsSyncGameIDFile
gMonTrayLogClear.Text = frmMain_gMonLogClear gMonTrayLogClear.Text = frmMain_gMonLogClear
gMonTrayLogSave.Text = frmMain_gMonLogSave gMonTrayLogSave.Text = frmMain_gMonLogSave
gMonTrayExit.Text = frmMain_gMonFileExit gMonTrayExit.Text = frmMain_gMonFileExit
@@ -1351,6 +1493,67 @@ Public Class frmMain
ResetGameInfo() ResetGameInfo()
End Sub End Sub
Private Function BuildChildProcesses() As Integer
Dim oCurrentProcess As clsProcess
Dim oProcessList As Hashtable
Dim prsChild As Process
oChildProcesses.Clear()
oProcessList = mgrGameProcesses.GetProcessesByGame(oProcess.GameInfo.ID)
If oProcessList.Count > 0 Then
For Each oCurrentProcess In oProcessList.Values
prsChild = New Process
prsChild.StartInfo.Arguments = oCurrentProcess.Args
prsChild.StartInfo.FileName = oCurrentProcess.Path
prsChild.StartInfo.UseShellExecute = False
prsChild.StartInfo.RedirectStandardOutput = True
prsChild.StartInfo.CreateNoWindow = True
oChildProcesses.Add(oCurrentProcess, prsChild)
Next
End If
Return oChildProcesses.Count
End Function
Private Sub StartChildProcesses()
Dim oCurrentProcess As clsProcess
Dim prsChild As Process
Try
For Each de As DictionaryEntry In oChildProcesses
oCurrentProcess = DirectCast(de.Key, clsProcess)
prsChild = DirectCast(de.Value, Process)
prsChild.Start()
UpdateLog(mgrCommon.FormatString(frmMain_ProcessStarted, oCurrentProcess.Name), False)
Next
Catch ex As Exception
UpdateLog(mgrCommon.FormatString(frmMain_ErrorStartChildProcess, oProcess.GameInfo.CroppedName), True, ToolTipIcon.Error)
UpdateLog(mgrCommon.FormatString(App_GenericError, ex.Message), False,, False)
End Try
End Sub
Private Sub EndChildProcesses()
Dim oCurrentProcess As clsProcess
Dim prsChild As Process
Try
For Each de As DictionaryEntry In oChildProcesses
oCurrentProcess = DirectCast(de.Key, clsProcess)
prsChild = DirectCast(de.Value, Process)
If oCurrentProcess.Kill Then
prsChild.Kill()
UpdateLog(mgrCommon.FormatString(frmMain_ProcessKilled, oCurrentProcess.Name), False)
End If
Next
Catch ex As Exception
UpdateLog(mgrCommon.FormatString(frmMain_ErrorEndChildProcess, oProcess.GameInfo.CroppedName), True, ToolTipIcon.Error)
UpdateLog(mgrCommon.FormatString(App_GenericError, ex.Message), False,, False)
End Try
End Sub
'Functions that control the scanning for games 'Functions that control the scanning for games
Private Sub StartScan() Private Sub StartScan()
tmScanTimer.Interval = 5000 tmScanTimer.Interval = 5000
@@ -1428,7 +1631,7 @@ Public Class frmMain
oSettings.BackupFolder = sBackupPath oSettings.BackupFolder = sBackupPath
oSettings.SaveSettings() oSettings.SaveSettings()
oSettings.LoadSettings() oSettings.LoadSettings()
If oSettings.Sync Then mgrMonitorList.HandleBackupLocationChange(oSettings) mgrMonitorList.HandleBackupLocationChange(oSettings)
End If End If
Return True Return True
Else Else
@@ -1492,15 +1695,6 @@ Public Class frmMain
End Function End Function
Private Sub CheckForSavedDuplicate()
For Each o As clsGame In oProcess.DuplicateList
If o.ProcessPath.ToLower = oProcess.GameInfo.ProcessPath.ToLower And o.Parameter = String.Empty Then
oProcess.GameInfo = o
oProcess.Duplicate = False
End If
Next
End Sub
Private Function CheckForSavedPath() As Boolean Private Function CheckForSavedPath() As Boolean
If oProcess.GameInfo.ProcessPath <> String.Empty Then If oProcess.GameInfo.ProcessPath <> String.Empty Then
Return True Return True
@@ -1527,29 +1721,6 @@ Public Class frmMain
End If End If
End Sub End Sub
Private Sub CleanLocalManifest()
Dim slItems As SortedList
PauseScan()
If mgrCommon.ShowMessage(frmMain_ConfirmManifestClean, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
slItems = mgrRestore.SyncLocalManifest()
If slItems.Count > 0 Then
For Each oItem As clsBackup In slItems.Values
UpdateLog(mgrCommon.FormatString(frmMain_ManifestRemovedEntry, oItem.Name), False)
Next
mgrCommon.ShowMessage(frmMain_ManifestTotalRemoved, slItems.Count, MsgBoxStyle.Information)
Else
mgrCommon.ShowMessage(frmMain_ManifestAreadyClean, MsgBoxStyle.Information)
End If
End If
ResumeScan()
End Sub
Private Sub CompactDatabases() Private Sub CompactDatabases()
Dim oLocalDatabase As mgrSQLite Dim oLocalDatabase As mgrSQLite
Dim oRemoteDatabase As mgrSQLite Dim oRemoteDatabase As mgrSQLite
@@ -1603,10 +1774,6 @@ Public Class frmMain
OpenGameManager() OpenGameManager()
End Sub End Sub
Private Sub gMonToolsSync_Click(sender As Object, e As EventArgs) Handles gMonTrayToolsCleanMan.Click, gMonToolsCleanMan.Click
CleanLocalManifest()
End Sub
Private Sub gMonToolsCompact_Click(sender As Object, e As EventArgs) Handles gMonToolsCompact.Click, gMonTrayToolsCompact.Click Private Sub gMonToolsCompact_Click(sender As Object, e As EventArgs) Handles gMonToolsCompact.Click, gMonTrayToolsCompact.Click
CompactDatabases() CompactDatabases()
End Sub End Sub
@@ -1623,6 +1790,10 @@ Public Class frmMain
OpenTags() OpenTags()
End Sub End Sub
Private Sub gMonSetupProcessManager_Click(sender As Object, e As EventArgs) Handles gMonSetupProcessManager.Click, gMonTraySetupProcessManager.Click
OpenProcessManager()
End Sub
Private Sub gMonHelpAbout_Click(sender As Object, e As EventArgs) Handles gMonHelpAbout.Click Private Sub gMonHelpAbout_Click(sender As Object, e As EventArgs) Handles gMonHelpAbout.Click
OpenAbout() OpenAbout()
End Sub End Sub
@@ -1651,6 +1822,14 @@ Public Class frmMain
OpenSessions() OpenSessions()
End Sub End Sub
Private Sub gMonToolsSyncGameIDOfficial_Click(sender As Object, e As EventArgs) Handles gMonToolsSyncGameIDOfficial.Click, gMonTrayToolsSyncGameIDOfficial.Click
SyncGameIDs(True)
End Sub
Private Sub gMonToolsSyncGameIDFile_Click(sender As Object, e As EventArgs) Handles gMonToolsSyncGameIDFile.Click, gMonTrayToolsSyncGameIDFile.Click
SyncGameIDs(False)
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
@@ -1712,11 +1891,12 @@ Public Class frmMain
Private Sub ScanTimerEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles tmScanTimer.Tick Private Sub ScanTimerEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles tmScanTimer.Tick
Dim bNeedsPath As Boolean = False Dim bNeedsPath As Boolean = False
Dim bWineProcess As Boolean = False
Dim bContinue As Boolean = True Dim bContinue As Boolean = True
Dim iErrorCode As Integer = 0 Dim iErrorCode As Integer = 0
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, bWineProcess, iErrorCode, bProcessDebugMode) Then
PauseScan(True) PauseScan(True)
If bNeedsPath Then If bNeedsPath Then
@@ -1746,21 +1926,42 @@ Public Class frmMain
End If End If
End If End If
If bContinue = True Then If bWineProcess Then
CheckForSavedDuplicate() 'Attempt a path conversion if the game configuration is using an absolute windows path that we can convert
If oProcess.Duplicate Then If mgrVariables.CheckForReservedVariables(oProcess.GameInfo.TruePath) Then
UpdateLog(frmMain_MultipleGamesDetected, oSettings.ShowDetectionToolTips) Dim sWinePrefix As String = mgrPath.GetWinePrefix(oProcess.FoundProcess)
UpdateStatus(frmMain_MultipleGamesDetected) Dim sWineSavePath As String
SetGameInfo(True) If Not sWinePrefix = String.Empty Then
Else UpdateLog(mgrCommon.FormatString(frmMain_WinePrefix, New String() {oProcess.GameInfo.Name, sWinePrefix}), False)
UpdateLog(mgrCommon.FormatString(frmMain_GameDetected, oProcess.GameInfo.Name), oSettings.ShowDetectionToolTips) sWineSavePath = mgrPath.GetWineSavePath(sWinePrefix, oProcess.GameInfo.TruePath)
UpdateStatus(mgrCommon.FormatString(frmMain_GameDetected, oProcess.GameInfo.CroppedName)) If Not sWineSavePath = oProcess.GameInfo.TruePath Then
SetGameInfo() oProcess.GameInfo.TruePath = sWineSavePath
oProcess.GameInfo.AbsolutePath = True
UpdateLog(mgrCommon.FormatString(frmMain_WineSavePath, New String() {oProcess.GameInfo.Name, sWineSavePath}), False)
End If
End If End If
oProcess.StartTime = Now End If
bwMonitor.RunWorkerAsync() End If
If bContinue = True Then
If oProcess.Duplicate Then
UpdateLog(frmMain_MultipleGamesDetected, oSettings.ShowDetectionToolTips)
UpdateStatus(frmMain_MultipleGamesDetected)
SetGameInfo(True)
Else Else
StopScan() UpdateLog(mgrCommon.FormatString(frmMain_GameDetected, oProcess.GameInfo.Name), oSettings.ShowDetectionToolTips)
UpdateStatus(mgrCommon.FormatString(frmMain_GameDetected, oProcess.GameInfo.CroppedName))
SetGameInfo()
End If
If BuildChildProcesses() > 0 And Not oProcess.Duplicate Then
StartChildProcesses()
End If
oProcess.StartTime = Now
bwMonitor.RunWorkerAsync()
Else
StopScan()
End If End If
End If End If
End Sub End Sub
@@ -1782,6 +1983,11 @@ Public Class frmMain
Private Sub bwMain_RunWorkerCompleted(sender As System.Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles bwMonitor.RunWorkerCompleted Private Sub bwMain_RunWorkerCompleted(sender As System.Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles bwMonitor.RunWorkerCompleted
Dim bContinue As Boolean = True Dim bContinue As Boolean = True
If oChildProcesses.Count > 0 And Not oProcess.Duplicate Then
EndChildProcesses()
End If
oProcess.EndTime = Now oProcess.EndTime = Now
If Not bCancelledByUser Then If Not bCancelledByUser Then
@@ -1887,5 +2093,4 @@ Public Class frmMain
'Move focus to first label 'Move focus to first label
lblGameTitle.Focus() lblGameTitle.Focus()
End Sub End Sub
End Class End Class
+242
View File
@@ -0,0 +1,242 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmProcessManager
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.grpProcess = New System.Windows.Forms.GroupBox()
Me.chkKillProcess = New System.Windows.Forms.CheckBox()
Me.txtArguments = New System.Windows.Forms.TextBox()
Me.lblArguments = New System.Windows.Forms.Label()
Me.btnProcessBrowse = New System.Windows.Forms.Button()
Me.txtName = New System.Windows.Forms.TextBox()
Me.txtPath = New System.Windows.Forms.TextBox()
Me.lblProcess = New System.Windows.Forms.Label()
Me.lblName = New System.Windows.Forms.Label()
Me.btnClose = New System.Windows.Forms.Button()
Me.btnDelete = New System.Windows.Forms.Button()
Me.btnAdd = New System.Windows.Forms.Button()
Me.lstProcesses = New System.Windows.Forms.ListBox()
Me.txtID = New System.Windows.Forms.TextBox()
Me.btnCancel = New System.Windows.Forms.Button()
Me.btnSave = New System.Windows.Forms.Button()
Me.grpProcess.SuspendLayout()
Me.SuspendLayout()
'
'grpProcess
'
Me.grpProcess.Controls.Add(Me.chkKillProcess)
Me.grpProcess.Controls.Add(Me.txtArguments)
Me.grpProcess.Controls.Add(Me.lblArguments)
Me.grpProcess.Controls.Add(Me.btnProcessBrowse)
Me.grpProcess.Controls.Add(Me.txtName)
Me.grpProcess.Controls.Add(Me.txtPath)
Me.grpProcess.Controls.Add(Me.lblProcess)
Me.grpProcess.Controls.Add(Me.lblName)
Me.grpProcess.Location = New System.Drawing.Point(238, 12)
Me.grpProcess.Name = "grpProcess"
Me.grpProcess.Size = New System.Drawing.Size(334, 120)
Me.grpProcess.TabIndex = 3
Me.grpProcess.TabStop = False
Me.grpProcess.Text = "Configuration"
'
'chkKillProcess
'
Me.chkKillProcess.AutoSize = True
Me.chkKillProcess.Location = New System.Drawing.Point(72, 96)
Me.chkKillProcess.Name = "chkKillProcess"
Me.chkKillProcess.Size = New System.Drawing.Size(181, 17)
Me.chkKillProcess.TabIndex = 4
Me.chkKillProcess.Text = "Kill process when game is closed"
Me.chkKillProcess.UseVisualStyleBackColor = True
'
'txtArguments
'
Me.txtArguments.Location = New System.Drawing.Point(72, 70)
Me.txtArguments.Name = "txtArguments"
Me.txtArguments.Size = New System.Drawing.Size(256, 20)
Me.txtArguments.TabIndex = 3
'
'lblArguments
'
Me.lblArguments.AutoSize = True
Me.lblArguments.Location = New System.Drawing.Point(6, 73)
Me.lblArguments.Name = "lblArguments"
Me.lblArguments.Size = New System.Drawing.Size(60, 13)
Me.lblArguments.TabIndex = 0
Me.lblArguments.Text = "Arguments:"
'
'btnProcessBrowse
'
Me.btnProcessBrowse.Location = New System.Drawing.Point(298, 45)
Me.btnProcessBrowse.Name = "btnProcessBrowse"
Me.btnProcessBrowse.Size = New System.Drawing.Size(30, 20)
Me.btnProcessBrowse.TabIndex = 2
Me.btnProcessBrowse.Text = "..."
Me.btnProcessBrowse.UseVisualStyleBackColor = True
'
'txtName
'
Me.txtName.Location = New System.Drawing.Point(72, 19)
Me.txtName.Name = "txtName"
Me.txtName.Size = New System.Drawing.Size(256, 20)
Me.txtName.TabIndex = 0
'
'txtPath
'
Me.txtPath.Location = New System.Drawing.Point(72, 45)
Me.txtPath.Name = "txtPath"
Me.txtPath.Size = New System.Drawing.Size(220, 20)
Me.txtPath.TabIndex = 1
'
'lblProcess
'
Me.lblProcess.AutoSize = True
Me.lblProcess.Location = New System.Drawing.Point(6, 48)
Me.lblProcess.Name = "lblProcess"
Me.lblProcess.Size = New System.Drawing.Size(48, 13)
Me.lblProcess.TabIndex = 0
Me.lblProcess.Text = "Process:"
'
'lblName
'
Me.lblName.AutoSize = True
Me.lblName.Location = New System.Drawing.Point(6, 22)
Me.lblName.Name = "lblName"
Me.lblName.Size = New System.Drawing.Size(38, 13)
Me.lblName.TabIndex = 0
Me.lblName.Text = "Name:"
'
'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(497, 226)
Me.btnClose.Name = "btnClose"
Me.btnClose.Size = New System.Drawing.Size(75, 23)
Me.btnClose.TabIndex = 6
Me.btnClose.Text = "C&lose"
Me.btnClose.UseVisualStyleBackColor = True
'
'btnDelete
'
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.Location = New System.Drawing.Point(48, 226)
Me.btnDelete.Name = "btnDelete"
Me.btnDelete.Size = New System.Drawing.Size(30, 23)
Me.btnDelete.TabIndex = 2
Me.btnDelete.Text = "-"
Me.btnDelete.UseVisualStyleBackColor = True
'
'btnAdd
'
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.Location = New System.Drawing.Point(12, 226)
Me.btnAdd.Name = "btnAdd"
Me.btnAdd.Size = New System.Drawing.Size(30, 23)
Me.btnAdd.TabIndex = 1
Me.btnAdd.Text = "+"
Me.btnAdd.UseVisualStyleBackColor = True
'
'lstProcesses
'
Me.lstProcesses.FormattingEnabled = True
Me.lstProcesses.Location = New System.Drawing.Point(12, 12)
Me.lstProcesses.Name = "lstProcesses"
Me.lstProcesses.Size = New System.Drawing.Size(220, 212)
Me.lstProcesses.Sorted = True
Me.lstProcesses.TabIndex = 0
'
'txtID
'
Me.txtID.Enabled = False
Me.txtID.Location = New System.Drawing.Point(374, 150)
Me.txtID.Name = "txtID"
Me.txtID.Size = New System.Drawing.Size(33, 20)
Me.txtID.TabIndex = 0
Me.txtID.TabStop = False
Me.txtID.Visible = False
'
'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(494, 149)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
Me.btnCancel.TabIndex = 5
Me.btnCancel.Text = "&Cancel"
Me.btnCancel.UseVisualStyleBackColor = True
'
'btnSave
'
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(413, 149)
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing.Size(75, 23)
Me.btnSave.TabIndex = 4
Me.btnSave.Text = "&Save"
Me.btnSave.UseVisualStyleBackColor = True
'
'frmProcessManager
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(584, 261)
Me.Controls.Add(Me.grpProcess)
Me.Controls.Add(Me.btnClose)
Me.Controls.Add(Me.btnDelete)
Me.Controls.Add(Me.btnAdd)
Me.Controls.Add(Me.lstProcesses)
Me.Controls.Add(Me.txtID)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnSave)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmProcessManager"
Me.ShowIcon = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Process Manager"
Me.grpProcess.ResumeLayout(False)
Me.grpProcess.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents grpProcess As GroupBox
Friend WithEvents txtArguments As TextBox
Friend WithEvents lblArguments As Label
Friend WithEvents btnProcessBrowse As Button
Friend WithEvents txtName As TextBox
Friend WithEvents txtPath As TextBox
Friend WithEvents lblProcess As Label
Friend WithEvents lblName As Label
Friend WithEvents btnClose As Button
Friend WithEvents btnDelete As Button
Friend WithEvents btnAdd As Button
Friend WithEvents lstProcesses As ListBox
Friend WithEvents txtID As TextBox
Friend WithEvents btnCancel As Button
Friend WithEvents btnSave As Button
Friend WithEvents chkKillProcess As CheckBox
End Class
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+371
View File
@@ -0,0 +1,371 @@
Imports GBM.My.Resources
Imports System.IO
Public Class frmProcessManager
Dim hshProcessData As Hashtable
Private bIsDirty As Boolean = False
Private bIsLoading As Boolean = False
Private oCurrentProcess As clsProcess
Private Property IsDirty As Boolean
Get
Return bIsDirty
End Get
Set(value As Boolean)
bIsDirty = value
End Set
End Property
Private Property IsLoading As Boolean
Get
Return bIsLoading
End Get
Set(value As Boolean)
bIsLoading = value
End Set
End Property
Private Enum eModes As Integer
View = 1
Edit = 2
Add = 3
Disabled = 4
End Enum
Private eCurrentMode As eModes = eModes.Disabled
Private Property ProcessData As Hashtable
Get
Return hshProcessData
End Get
Set(value As Hashtable)
hshProcessData = value
End Set
End Property
Private Sub ProcessBrowse()
Dim sDefaultFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.Desktop)
Dim sCurrentPath As String = txtPath.Text
Dim sNewPath As String
If sCurrentPath <> String.Empty Then
sCurrentPath = Path.GetDirectoryName(txtPath.Text)
If Directory.Exists(sCurrentPath) Then
sDefaultFolder = sCurrentPath
End If
End If
sNewPath = mgrCommon.OpenFileBrowser("PM_Process", frmProcessManager_ChooseProcess, "exe",
frmProcessManager_Executable, sDefaultFolder, True)
If sNewPath <> String.Empty Then
txtPath.Text = sNewPath
End If
End Sub
Private Sub LoadData()
ProcessData = mgrProcess.ReadProcesses
lstProcesses.Items.Clear()
FormatAndFillList()
End Sub
Private Function HandleDirty() As MsgBoxResult
Dim oResult As MsgBoxResult
oResult = mgrCommon.ShowMessage(App_ConfirmDirty, MsgBoxStyle.YesNoCancel)
Select Case oResult
Case MsgBoxResult.Yes
IsDirty = False
Case MsgBoxResult.No
IsDirty = False
Case MsgBoxResult.Cancel
'No Change
End Select
Return oResult
End Function
Private Sub FormatAndFillList()
IsLoading = True
For Each oProcess As clsProcess In ProcessData.Values
lstProcesses.Items.Add(oProcess.Name)
Next
IsLoading = False
End Sub
Private Sub FillData()
IsLoading = True
oCurrentProcess = DirectCast(ProcessData(lstProcesses.SelectedItems(0).ToString), clsProcess)
txtID.Text = oCurrentProcess.ID
txtName.Text = oCurrentProcess.Name
txtPath.Text = oCurrentProcess.Path
txtArguments.Text = oCurrentProcess.Args
chkKillProcess.Checked = oCurrentProcess.Kill
IsLoading = False
End Sub
Private Sub DirtyCheck_ValueChanged(sender As Object, e As EventArgs)
If Not IsLoading Then
IsDirty = True
If Not eCurrentMode = eModes.Add Then EditProcess()
End If
End Sub
Private Sub AssignDirtyHandlers(ByVal oCtls As GroupBox.ControlCollection)
For Each ctl As Control In oCtls
If TypeOf ctl Is TextBox Then
AddHandler DirectCast(ctl, TextBox).TextChanged, AddressOf DirtyCheck_ValueChanged
End If
Next
End Sub
Private Sub WipeControls(ByVal oCtls As GroupBox.ControlCollection)
For Each ctl As Control In oCtls
If TypeOf ctl Is TextBox Then
DirectCast(ctl, TextBox).Text = String.Empty
End If
Next
txtID.Text = String.Empty
End Sub
Private Sub ModeChange()
IsLoading = True
Select Case eCurrentMode
Case eModes.Add
grpProcess.Enabled = True
WipeControls(grpProcess.Controls)
btnSave.Enabled = True
btnCancel.Enabled = True
btnAdd.Enabled = False
btnDelete.Enabled = False
lstProcesses.Enabled = False
chkKillProcess.Checked = True
Case eModes.Edit
lstProcesses.Enabled = False
grpProcess.Enabled = True
btnSave.Enabled = True
btnCancel.Enabled = True
btnAdd.Enabled = False
btnDelete.Enabled = False
Case eModes.View
lstProcesses.Enabled = True
grpProcess.Enabled = True
btnSave.Enabled = False
btnCancel.Enabled = False
btnAdd.Enabled = True
btnDelete.Enabled = True
Case eModes.Disabled
lstProcesses.Enabled = True
WipeControls(grpProcess.Controls)
grpProcess.Enabled = False
btnSave.Enabled = False
btnCancel.Enabled = False
btnAdd.Enabled = True
btnDelete.Enabled = True
End Select
IsLoading = False
End Sub
Private Sub EditProcess()
eCurrentMode = eModes.Edit
ModeChange()
End Sub
Private Sub AddProcess()
eCurrentMode = eModes.Add
ModeChange()
txtName.Focus()
End Sub
Private Sub CancelEdit()
If bIsDirty Then
Select Case HandleDirty()
Case MsgBoxResult.Yes
SaveProcess()
Case MsgBoxResult.No
If lstProcesses.SelectedItems.Count > 0 Then
eCurrentMode = eModes.View
ModeChange()
FillData()
lstProcesses.Focus()
Else
eCurrentMode = eModes.Disabled
ModeChange()
End If
Case MsgBoxResult.Cancel
'Do Nothing
End Select
Else
If lstProcesses.SelectedItems.Count > 0 Then
eCurrentMode = eModes.View
ModeChange()
FillData()
lstProcesses.Focus()
Else
eCurrentMode = eModes.Disabled
ModeChange()
End If
End If
End Sub
Private Sub SaveProcess()
Dim oProcess As New clsProcess
Dim bSuccess As Boolean = False
If txtID.Text <> String.Empty Then
oProcess.ID = txtID.Text
End If
oProcess.Name = txtName.Text
oProcess.Path = txtPath.Text
oProcess.Args = txtArguments.Text
oProcess.Kill = chkKillProcess.Checked
Select Case eCurrentMode
Case eModes.Add
If CoreValidatation(oProcess) Then
bSuccess = True
mgrProcess.DoProcessAdd(oProcess)
eCurrentMode = eModes.View
End If
Case eModes.Edit
If CoreValidatation(oProcess) Then
bSuccess = True
mgrProcess.DoProcessUpdate(oProcess)
eCurrentMode = eModes.View
End If
End Select
If bSuccess Then
IsDirty = False
LoadData()
ModeChange()
If eCurrentMode = eModes.View Then lstProcesses.SelectedIndex = lstProcesses.Items.IndexOf(oProcess.Name)
End If
End Sub
Private Sub DeleteProcess()
Dim oProcess As clsProcess
If lstProcesses.SelectedItems.Count > 0 Then
oProcess = DirectCast(ProcessData(lstProcesses.SelectedItems(0).ToString), clsProcess)
If mgrCommon.ShowMessage(frmProcessManager_ConfirmDelete, oProcess.Name, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
mgrProcess.DoProcessDelete(oProcess.ID)
LoadData()
eCurrentMode = eModes.Disabled
ModeChange()
End If
End If
End Sub
Private Sub SwitchProcess()
If lstProcesses.SelectedItems.Count > 0 Then
eCurrentMode = eModes.View
FillData()
ModeChange()
End If
End Sub
Private Function CoreValidatation(ByVal oProcess As clsProcess) As Boolean
If txtName.Text.Trim = String.Empty Then
mgrCommon.ShowMessage(frmProcessManager_ErrorValidName, MsgBoxStyle.Exclamation)
txtName.Focus()
Return False
End If
If txtPath.Text.Trim = String.Empty Then
mgrCommon.ShowMessage(frmProcessManager_ErrorValidPath, MsgBoxStyle.Exclamation)
txtPath.Focus()
Return False
Else
If Not File.Exists(txtPath.Text.Trim) Then
mgrCommon.ShowMessage(frmProcessManager_ErrorPathNotFound, MsgBoxStyle.Exclamation)
txtPath.Focus()
Return False
End If
End If
If mgrProcess.DoCheckDuplicate(oProcess.Name, oProcess.ID) Then
mgrCommon.ShowMessage(frmProcessManager_ErrorDupe, MsgBoxStyle.Exclamation)
txtName.Focus()
Return False
End If
Return True
End Function
Private Sub SetForm()
'Set Form Name
Me.Text = frmProcessManager_FormName
'Set Form Text
btnCancel.Text = frmProcessManager_btnCancel
btnSave.Text = frmProcessManager_btnSave
grpProcess.Text = frmProcessManager_grpProcess
btnProcessBrowse.Text = frmProcessManager_btnProcessBrowse
lblProcess.Text = frmProcessManager_lblPath
lblName.Text = frmProcessManager_lblName
btnClose.Text = frmProcessManager_btnClose
btnDelete.Text = frmProcessManager_btnDelete
btnAdd.Text = frmProcessManager_btnAdd
chkKillProcess.Text = frmProcessManager_chkKillProcess
End Sub
Private Sub frmProcessManager_Load(sender As Object, e As EventArgs) Handles MyBase.Load
SetForm()
LoadData()
ModeChange()
AssignDirtyHandlers(grpProcess.Controls)
End Sub
Private Sub lstProcesses_SelectedIndexChanged(sender As Object, e As EventArgs) Handles lstProcesses.SelectedIndexChanged
SwitchProcess()
End Sub
Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click
AddProcess()
End Sub
Private Sub btnDelete_Click(sender As Object, e As EventArgs) Handles btnDelete.Click
DeleteProcess()
End Sub
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
SaveProcess()
End Sub
Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
CancelEdit()
End Sub
Private Sub btnClose_Click(sender As Object, e As EventArgs) Handles btnClose.Click
Me.Close()
End Sub
Private Sub btnPathBrowse_Click(sender As Object, e As EventArgs) Handles btnProcessBrowse.Click
ProcessBrowse()
End Sub
Private Sub frmProcessManager_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
If bIsDirty Then
Select Case HandleDirty()
Case MsgBoxResult.Yes
SaveProcess()
Case MsgBoxResult.No
'Do Nothing
Case MsgBoxResult.Cancel
e.Cancel = True
End Select
End If
End Sub
End Class
+180
View File
@@ -0,0 +1,180 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmSessionExport
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.btnExport = New System.Windows.Forms.Button()
Me.btnCancel = New System.Windows.Forms.Button()
Me.grpExportType = New System.Windows.Forms.GroupBox()
Me.grpDateType = New System.Windows.Forms.GroupBox()
Me.optCSV = New System.Windows.Forms.RadioButton()
Me.optXML = New System.Windows.Forms.RadioButton()
Me.optCurrentLocale = New System.Windows.Forms.RadioButton()
Me.optUnix = New System.Windows.Forms.RadioButton()
Me.grpOptions = New System.Windows.Forms.GroupBox()
Me.chkCSVHeaders = New System.Windows.Forms.CheckBox()
Me.grpExportType.SuspendLayout()
Me.grpDateType.SuspendLayout()
Me.grpOptions.SuspendLayout()
Me.SuspendLayout()
'
'btnExport
'
Me.btnExport.Location = New System.Drawing.Point(116, 226)
Me.btnExport.Name = "btnExport"
Me.btnExport.Size = New System.Drawing.Size(75, 23)
Me.btnExport.TabIndex = 3
Me.btnExport.Text = "&Export"
Me.btnExport.UseVisualStyleBackColor = True
'
'btnCancel
'
Me.btnCancel.Location = New System.Drawing.Point(197, 226)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
Me.btnCancel.TabIndex = 4
Me.btnCancel.Text = "&Cancel"
Me.btnCancel.UseVisualStyleBackColor = True
'
'grpExportType
'
Me.grpExportType.Controls.Add(Me.optXML)
Me.grpExportType.Controls.Add(Me.optCSV)
Me.grpExportType.Location = New System.Drawing.Point(12, 12)
Me.grpExportType.Name = "grpExportType"
Me.grpExportType.Size = New System.Drawing.Size(260, 70)
Me.grpExportType.TabIndex = 0
Me.grpExportType.TabStop = False
Me.grpExportType.Text = "Export Type"
'
'grpDateType
'
Me.grpDateType.Controls.Add(Me.optUnix)
Me.grpDateType.Controls.Add(Me.optCurrentLocale)
Me.grpDateType.Location = New System.Drawing.Point(12, 88)
Me.grpDateType.Name = "grpDateType"
Me.grpDateType.Size = New System.Drawing.Size(260, 70)
Me.grpDateType.TabIndex = 1
Me.grpDateType.TabStop = False
Me.grpDateType.Text = "Date Type"
'
'optCSV
'
Me.optCSV.AutoSize = True
Me.optCSV.Location = New System.Drawing.Point(6, 19)
Me.optCSV.Name = "optCSV"
Me.optCSV.Size = New System.Drawing.Size(46, 17)
Me.optCSV.TabIndex = 0
Me.optCSV.TabStop = True
Me.optCSV.Text = "CSV"
Me.optCSV.UseVisualStyleBackColor = True
'
'optXML
'
Me.optXML.AutoSize = True
Me.optXML.Location = New System.Drawing.Point(6, 42)
Me.optXML.Name = "optXML"
Me.optXML.Size = New System.Drawing.Size(47, 17)
Me.optXML.TabIndex = 1
Me.optXML.TabStop = True
Me.optXML.Text = "XML"
Me.optXML.UseVisualStyleBackColor = True
'
'optCurrentLocale
'
Me.optCurrentLocale.AutoEllipsis = True
Me.optCurrentLocale.Location = New System.Drawing.Point(6, 19)
Me.optCurrentLocale.Name = "optCurrentLocale"
Me.optCurrentLocale.Size = New System.Drawing.Size(248, 17)
Me.optCurrentLocale.TabIndex = 0
Me.optCurrentLocale.TabStop = True
Me.optCurrentLocale.Text = "Current Locale"
Me.optCurrentLocale.UseVisualStyleBackColor = True
'
'optUnix
'
Me.optUnix.AutoEllipsis = True
Me.optUnix.Location = New System.Drawing.Point(6, 42)
Me.optUnix.Name = "optUnix"
Me.optUnix.Size = New System.Drawing.Size(248, 17)
Me.optUnix.TabIndex = 1
Me.optUnix.TabStop = True
Me.optUnix.Text = "Unix Timestamp"
Me.optUnix.UseVisualStyleBackColor = True
'
'grpOptions
'
Me.grpOptions.Controls.Add(Me.chkCSVHeaders)
Me.grpOptions.Location = New System.Drawing.Point(12, 164)
Me.grpOptions.Name = "grpOptions"
Me.grpOptions.Size = New System.Drawing.Size(260, 45)
Me.grpOptions.TabIndex = 2
Me.grpOptions.TabStop = False
Me.grpOptions.Text = "Other Options"
'
'chkCSVHeaders
'
Me.chkCSVHeaders.AutoSize = True
Me.chkCSVHeaders.Location = New System.Drawing.Point(6, 19)
Me.chkCSVHeaders.Name = "chkCSVHeaders"
Me.chkCSVHeaders.Size = New System.Drawing.Size(167, 17)
Me.chkCSVHeaders.TabIndex = 0
Me.chkCSVHeaders.Text = "Export Column Headers (CSV)"
Me.chkCSVHeaders.UseVisualStyleBackColor = True
'
'frmSessionExport
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(284, 261)
Me.Controls.Add(Me.grpOptions)
Me.Controls.Add(Me.grpDateType)
Me.Controls.Add(Me.grpExportType)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnExport)
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmSessionExport"
Me.ShowIcon = False
Me.SizeGripStyle = System.Windows.Forms.SizeGripStyle.Hide
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "Session Export Options"
Me.grpExportType.ResumeLayout(False)
Me.grpExportType.PerformLayout()
Me.grpDateType.ResumeLayout(False)
Me.grpOptions.ResumeLayout(False)
Me.grpOptions.PerformLayout()
Me.ResumeLayout(False)
End Sub
Friend WithEvents btnExport As Button
Friend WithEvents btnCancel As Button
Friend WithEvents grpExportType As GroupBox
Friend WithEvents optXML As RadioButton
Friend WithEvents optCSV As RadioButton
Friend WithEvents grpDateType As GroupBox
Friend WithEvents optUnix As RadioButton
Friend WithEvents optCurrentLocale As RadioButton
Friend WithEvents grpOptions As GroupBox
Friend WithEvents chkCSVHeaders As CheckBox
End Class
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+90
View File
@@ -0,0 +1,90 @@
Imports GBM.My.Resources
Public Class frmSessionExport
Private bXML As Boolean = True
Private bUnix As Boolean = False
Private bCSVHeaders As Boolean = True
Public ReadOnly Property XML As Boolean
Get
Return bXML
End Get
End Property
Public ReadOnly Property Unix As Boolean
Get
Return bUnix
End Get
End Property
Public ReadOnly Property Headers As Boolean
Get
Return bCSVHeaders
End Get
End Property
Private Sub SetOptions()
If optXML.Checked Then
bXML = True
Else
bXML = False
End If
If optUnix.Checked Then
bUnix = True
Else
bUnix = False
End If
If chkCSVHeaders.Checked Then
bCSVHeaders = True
Else
bCSVHeaders = False
End If
End Sub
Private Sub SetForm()
Me.Text = frmSessionExport_FormName
grpExportType.Text = frmSessionExport_grpExportType
grpDateType.Text = frmSessionExport_grpDateType
grpOptions.Text = frmSessionExport_grpOptions
optCSV.Text = frmSessionExport_optCSV
optXML.Text = frmSessionExport_optXML
optCurrentLocale.Text = frmSessionExport_optCurrentLocale & " - " & Now
optUnix.Text = frmSessionExport_optUnix & " - " & mgrCommon.DateToUnix(Now)
chkCSVHeaders.Text = frmSessionExport_chkCSVHeaders
btnExport.Text = frmSessionExport_btnExport
btnCancel.Text = frmSessionExport_btnCancel
optCSV.Checked = True
optCurrentLocale.Checked = True
End Sub
Private Sub frmSessionExport_Load(sender As Object, e As EventArgs) Handles MyBase.Load
SetForm()
End Sub
Private Sub btnExport_Click(sender As Object, e As EventArgs) Handles btnExport.Click
SetOptions()
Me.DialogResult = DialogResult.OK
End Sub
Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
Me.DialogResult = DialogResult.Cancel
End Sub
Private Sub optCSV_CheckedChanged(sender As Object, e As EventArgs) Handles optCSV.CheckedChanged
If Not optCSV.Checked Then
chkCSVHeaders.Checked = False
chkCSVHeaders.Enabled = False
Else
chkCSVHeaders.Checked = True
chkCSVHeaders.Enabled = True
End If
End Sub
End Class
+31 -4
View File
@@ -32,6 +32,8 @@ Partial Class frmSessions
Me.btnDelete = New System.Windows.Forms.Button() Me.btnDelete = New System.Windows.Forms.Button()
Me.btnClose = New System.Windows.Forms.Button() Me.btnClose = New System.Windows.Forms.Button()
Me.lblDateRange = New System.Windows.Forms.Label() Me.lblDateRange = New System.Windows.Forms.Label()
Me.lblTotalHours = New System.Windows.Forms.Label()
Me.btnExport = New System.Windows.Forms.Button()
CType(Me.dgSessions, System.ComponentModel.ISupportInitialize).BeginInit() CType(Me.dgSessions, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout() Me.SuspendLayout()
' '
@@ -41,7 +43,7 @@ Partial Class frmSessions
Me.lblFilter.Location = New System.Drawing.Point(12, 9) Me.lblFilter.Location = New System.Drawing.Point(12, 9)
Me.lblFilter.Name = "lblFilter" Me.lblFilter.Name = "lblFilter"
Me.lblFilter.Size = New System.Drawing.Size(63, 13) Me.lblFilter.Size = New System.Drawing.Size(63, 13)
Me.lblFilter.TabIndex = 0 Me.lblFilter.TabIndex = 1
Me.lblFilter.Text = "Game Filter:" Me.lblFilter.Text = "Game Filter:"
' '
'txtFilter 'txtFilter
@@ -100,7 +102,7 @@ Partial Class frmSessions
Me.btnReset.Location = New System.Drawing.Point(591, 526) Me.btnReset.Location = New System.Drawing.Point(591, 526)
Me.btnReset.Name = "btnReset" Me.btnReset.Name = "btnReset"
Me.btnReset.Size = New System.Drawing.Size(100, 23) Me.btnReset.Size = New System.Drawing.Size(100, 23)
Me.btnReset.TabIndex = 2 Me.btnReset.TabIndex = 10
Me.btnReset.Text = "&Reset Filters" Me.btnReset.Text = "&Reset Filters"
Me.btnReset.UseVisualStyleBackColor = True Me.btnReset.UseVisualStyleBackColor = True
' '
@@ -120,7 +122,7 @@ Partial Class frmSessions
Me.btnClose.Location = New System.Drawing.Point(697, 526) Me.btnClose.Location = New System.Drawing.Point(697, 526)
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 = 8 Me.btnClose.TabIndex = 11
Me.btnClose.Text = "&Close" Me.btnClose.Text = "&Close"
Me.btnClose.UseVisualStyleBackColor = True Me.btnClose.UseVisualStyleBackColor = True
' '
@@ -131,14 +133,37 @@ Partial Class frmSessions
Me.lblDateRange.Location = New System.Drawing.Point(310, 9) Me.lblDateRange.Location = New System.Drawing.Point(310, 9)
Me.lblDateRange.Name = "lblDateRange" Me.lblDateRange.Name = "lblDateRange"
Me.lblDateRange.Size = New System.Drawing.Size(68, 13) Me.lblDateRange.Size = New System.Drawing.Size(68, 13)
Me.lblDateRange.TabIndex = 9 Me.lblDateRange.TabIndex = 2
Me.lblDateRange.Text = "Date Range:" Me.lblDateRange.Text = "Date Range:"
' '
'lblTotalHours
'
Me.lblTotalHours.Anchor = CType(((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Left) _
Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.lblTotalHours.Location = New System.Drawing.Point(118, 531)
Me.lblTotalHours.Name = "lblTotalHours"
Me.lblTotalHours.Size = New System.Drawing.Size(361, 13)
Me.lblTotalHours.TabIndex = 8
Me.lblTotalHours.Text = "Total Hours:"
Me.lblTotalHours.TextAlign = System.Drawing.ContentAlignment.TopCenter
'
'btnExport
'
Me.btnExport.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles)
Me.btnExport.Location = New System.Drawing.Point(485, 526)
Me.btnExport.Name = "btnExport"
Me.btnExport.Size = New System.Drawing.Size(100, 23)
Me.btnExport.TabIndex = 9
Me.btnExport.Text = "&Export Grid"
Me.btnExport.UseVisualStyleBackColor = True
'
'frmSessions 'frmSessions
' '
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, 561)
Me.Controls.Add(Me.btnExport)
Me.Controls.Add(Me.lblTotalHours)
Me.Controls.Add(Me.lblDateRange) Me.Controls.Add(Me.lblDateRange)
Me.Controls.Add(Me.btnClose) Me.Controls.Add(Me.btnClose)
Me.Controls.Add(Me.btnDelete) Me.Controls.Add(Me.btnDelete)
@@ -170,4 +195,6 @@ Partial Class frmSessions
Friend WithEvents btnDelete As Button Friend WithEvents btnDelete As Button
Friend WithEvents btnClose As Button Friend WithEvents btnClose As Button
Friend WithEvents lblDateRange As Label Friend WithEvents lblDateRange As Label
Friend WithEvents lblTotalHours As Label
Friend WithEvents btnExport As Button
End Class End Class
+172 -7
View File
@@ -1,24 +1,55 @@
Imports GBM.My.Resources Imports GBM.My.Resources
Imports System.Globalization Imports System.Globalization
Imports System.ComponentModel
Public Class frmSessions Public Class frmSessions
Private bInitFinished As Boolean = False Private bInitFinished As Boolean = False
Private WithEvents tmFilterTimer As Timer Private WithEvents tmFilterTimer As Timer
Private bStartSortAsc As Boolean = True
Private iStartDataCol As Integer
Private iStartDisplayCol As Integer
Private bEndSortAsc As Boolean = True
Private iEndDataCol As Integer
Private iEndDisplayCol As Integer
Private bHoursSortAsc As Boolean = True
Private iHoursCol As Integer
Private Sub FormatGrid() Private Sub FormatGrid()
'Build Columns
dgSessions.Columns.Add("MonitorID", frmSessions_ColumnMonitorID) dgSessions.Columns.Add("MonitorID", frmSessions_ColumnMonitorID)
dgSessions.Columns.Add("Name", frmSessions_ColumnGameName) dgSessions.Columns.Add("Name", frmSessions_ColumnGameName)
dgSessions.Columns.Add("StartUnix", frmSessions_ColumnStart)
dgSessions.Columns.Add("Start", frmSessions_ColumnStart) dgSessions.Columns.Add("Start", frmSessions_ColumnStart)
dgSessions.Columns.Add("EndUnix", frmSessions_ColumnEnd)
dgSessions.Columns.Add("End", frmSessions_ColumnEnd) dgSessions.Columns.Add("End", frmSessions_ColumnEnd)
dgSessions.Columns.Add("Hours", frmSessions_ColumnHours)
'Hide the ID 'Get Column Indexes
iStartDataCol = dgSessions.Columns.IndexOf(dgSessions.Columns("StartUnix"))
iStartDisplayCol = dgSessions.Columns.IndexOf(dgSessions.Columns("Start"))
iEndDataCol = dgSessions.Columns.IndexOf(dgSessions.Columns("EndUnix"))
iEndDisplayCol = dgSessions.Columns.IndexOf(dgSessions.Columns("End"))
iHoursCol = dgSessions.Columns.IndexOf(dgSessions.Columns("Hours"))
'Set Sorting
dgSessions.Columns("Start").SortMode = DataGridViewColumnSortMode.Programmatic
dgSessions.Columns("End").SortMode = DataGridViewColumnSortMode.Programmatic
dgSessions.Columns("Hours").SortMode = DataGridViewColumnSortMode.Programmatic
'Hide Columns
dgSessions.Columns("MonitorID").Visible = False dgSessions.Columns("MonitorID").Visible = False
dgSessions.Columns("StartUnix").Visible = False
dgSessions.Columns("EndUnix").Visible = False
End Sub End Sub
Private Sub LoadData() Private Sub LoadData()
Dim oData As DataSet Dim oData As DataSet
Dim sFilter As String Dim sFilter As String
Dim dStart As DateTime
Dim dEnd As DateTime
Dim dHours As Double
Dim dTotalHours As Double
If txtFilter.Text = String.Empty Then If txtFilter.Text = String.Empty Then
oData = mgrSessions.GetSessionRange(dtpStart.Value, dtpEnd.Value) oData = mgrSessions.GetSessionRange(dtpStart.Value, dtpEnd.Value)
@@ -30,9 +61,15 @@ Public Class frmSessions
dgSessions.Rows.Clear() dgSessions.Rows.Clear()
For Each dr As DataRow In oData.Tables(0).Rows 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"))}) dStart = mgrCommon.UnixToDate(dr("Start"))
dEnd = mgrCommon.UnixToDate(dr("End"))
dHours = Math.Round(dEnd.Subtract(dStart).TotalHours, 2)
dTotalHours += dHours
dgSessions.Rows.Add(New Object() {dr("MonitorID"), dr("Name"), dr("Start"), dStart, dr("End"), dEnd, dHours})
Next Next
lblTotalHours.Text = mgrCommon.FormatString(frmSessions_lblTotalHours, Math.Round(dTotalHours, 2))
dgSessions.AutoResizeColumns() dgSessions.AutoResizeColumns()
End Sub End Sub
@@ -51,14 +88,18 @@ Public Class frmSessions
tmFilterTimer.Interval = 1000 tmFilterTimer.Interval = 1000
tmFilterTimer.Enabled = False tmFilterTimer.Enabled = False
End Sub End Sub
Private Sub ResetFilterFields() Private Sub ResetFilterFields()
Dim dtMinDate As DateTime = mgrSessions.GetMinimumDateTime Dim dtMinDate As DateTime = mgrSessions.GetMinimumDateTime
Dim dtMaxDate As DateTime = mgrSessions.GetMaximumDateTime Dim dtMaxDate As DateTime = mgrSessions.GetMaximumDateTime
Dim dtRecent As DateTime = dtMaxDate.Subtract(TimeSpan.FromDays(7))
Dim sDateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern & " " & CultureInfo.CurrentCulture.DateTimeFormat.LongTimePattern Dim sDateTimeFormat = CultureInfo.CurrentCulture.DateTimeFormat.ShortDatePattern & " " & CultureInfo.CurrentCulture.DateTimeFormat.LongTimePattern
If dtRecent < dtMinDate Then
dtRecent = dtMinDate
End If
bInitFinished = False bInitFinished = False
'Init Date Fields 'Init Date Fields
@@ -75,7 +116,7 @@ Public Class frmSessions
dtpEnd.MaxDate = dtMaxDate dtpEnd.MaxDate = dtMaxDate
End If End If
dtpStart.Value = dtMinDate dtpStart.Value = dtRecent
dtpEnd.Value = dtMaxDate dtpEnd.Value = dtMaxDate
'Init Text Filter 'Init Text Filter
@@ -85,6 +126,7 @@ Public Class frmSessions
End Sub End Sub
Private Sub Reset() Private Sub Reset()
ClearManualSortGlyphs()
ResetFilterFields() ResetFilterFields()
LoadData() LoadData()
End Sub End Sub
@@ -96,8 +138,8 @@ Public Class frmSessions
For Each dgvRow As DataGridViewRow In dgSessions.SelectedRows For Each dgvRow As DataGridViewRow In dgSessions.SelectedRows
oSession = New clsSession oSession = New clsSession
oSession.MonitorID = dgvRow.Cells(0).Value oSession.MonitorID = dgvRow.Cells(0).Value
oSession.SessionStart = dgvRow.Cells(2).Value oSession.SessionStart = CInt(dgvRow.Cells(iStartDataCol).Value)
oSession.SessionEnd = dgvRow.Cells(3).Value oSession.SessionEnd = CInt(dgvRow.Cells(iEndDataCol).Value)
oSessions.Add(oSession) oSessions.Add(oSession)
Next Next
@@ -106,6 +148,60 @@ Public Class frmSessions
End If End If
End Sub End Sub
Private Sub ClearManualSortGlyphs()
dgSessions.Columns(iStartDisplayCol).HeaderCell.SortGlyphDirection = SortOrder.None
dgSessions.Columns(iEndDisplayCol).HeaderCell.SortGlyphDirection = SortOrder.None
dgSessions.Columns(iHoursCol).HeaderCell.SortGlyphDirection = SortOrder.None
End Sub
Private Sub DoSort(ByRef bToggle As Boolean, ByVal iCol As Integer, ByVal iType As RowCompareHelper.iDataType)
bToggle = Not bToggle
If bToggle Then
dgSessions.Sort(New RowCompareHelper(SortOrder.Ascending, iCol, iType))
dgSessions.Columns(iCol).HeaderCell.SortGlyphDirection = SortOrder.Ascending
Else
dgSessions.Sort(New RowCompareHelper(SortOrder.Descending, iCol, iType))
dgSessions.Columns(iCol).HeaderCell.SortGlyphDirection = SortOrder.Descending
End If
End Sub
Private Sub HandleSort(ByVal iCol As Integer)
ClearManualSortGlyphs()
Select Case iCol
Case iStartDisplayCol
DoSort(bStartSortAsc, iStartDisplayCol, RowCompareHelper.iDataType.DateTimeType)
Case iEndDisplayCol
DoSort(bEndSortAsc, iEndDisplayCol, RowCompareHelper.iDataType.DateTimeType)
Case iHoursCol
DoSort(bHoursSortAsc, iHoursCol, RowCompareHelper.iDataType.DecimalType)
End Select
End Sub
Private Sub ExportGrid()
Dim frm As New frmSessionExport
Dim sLocation As String
frm.ShowDialog()
If frm.DialogResult = DialogResult.OK Then
If frm.XML Then
sLocation = mgrCommon.SaveFileBrowser("Session_Export", frmSessions_ChooseExportLocation, "xml", frmSessions_XML, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), frmSessions_DefaultExportFileName)
Else
sLocation = mgrCommon.SaveFileBrowser("Session_Export", frmSessions_ChooseExportLocation, "csv", frmSessions_CSV, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), frmSessions_DefaultExportFileName)
End If
If sLocation <> String.Empty Then
If frm.XML Then
mgrSessions.ExportAsXML(sLocation, frm.Unix, dgSessions)
Else
mgrSessions.ExportAsCSV(sLocation, frm.Unix, frm.Headers, dgSessions)
End If
End If
End If
End Sub
Private Sub frmSession_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub frmSession_Load(sender As Object, e As EventArgs) Handles MyBase.Load
SetForm() SetForm()
ResetFilterFields() ResetFilterFields()
@@ -146,8 +242,77 @@ Public Class frmSessions
If dgSessions.SelectedRows.Count > 0 Then If dgSessions.SelectedRows.Count > 0 Then
If mgrCommon.ShowMessage(frmSessions_ConfirmDelete, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then If mgrCommon.ShowMessage(frmSessions_ConfirmDelete, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
DeleteSession() DeleteSession()
Reset() LoadData()
End If End If
End If End If
End Sub End Sub
Private Sub btnExport_Click(sender As Object, e As EventArgs) Handles btnExport.Click
ExportGrid()
End Sub
Private Sub dgSessions_ColumnHeaderMouseClick(sender As Object, e As DataGridViewCellMouseEventArgs) Handles dgSessions.ColumnHeaderMouseClick
HandleSort(e.ColumnIndex)
End Sub
'The Mono version of the DataGridView control automatically treats all data as a string for sorting purposes.
'This class manually handles column sorting by data type.
Private Class RowCompareHelper
Implements System.Collections.IComparer
'We need to manually define data types as the column ValueType doesn't work in Mono either.
Public Enum iDataType As Integer
StringType = 1
DateTimeType = 2
IntType = 3
DecimalType = 4
End Enum
Private iSortOrderModifier As Integer = 1
Private iSortCol As Integer = 0
Private iDataTypeCol As iDataType = iDataType.StringType
Public Sub New(ByVal sortOrder As SortOrder, ByVal iCol As Integer, ByVal iType As iDataType)
iSortCol = iCol
iDataTypeCol = iType
If sortOrder = SortOrder.Descending Then
iSortOrderModifier = -1
ElseIf sortOrder = SortOrder.Ascending Then
iSortOrderModifier = 1
End If
End Sub
Public Function Compare(ByVal x As Object, ByVal y As Object) As Integer Implements System.Collections.IComparer.Compare
Dim iCompareResult As Integer
Dim dgRow1 As DataGridViewRow = CType(x, DataGridViewRow)
Dim dgRow2 As DataGridViewRow = CType(y, DataGridViewRow)
Select Case iDataTypeCol
Case iDataType.DecimalType
If (CDec(dgRow1.Cells(iSortCol).Value) = CDec(dgRow2.Cells(iSortCol).Value)) Then
iCompareResult = 0
ElseIf (CDec(dgRow1.Cells(iSortCol).Value) < CDec(dgRow2.Cells(iSortCol).Value)) Then
iCompareResult = -1
Else
iCompareResult = 1
End If
Case iDataType.IntType
If (CInt(dgRow1.Cells(iSortCol).Value) = CInt(dgRow2.Cells(iSortCol).Value)) Then
iCompareResult = 0
ElseIf (CInt(dgRow1.Cells(iSortCol).Value) < CInt(dgRow2.Cells(iSortCol).Value)) Then
iCompareResult = -1
Else
iCompareResult = 1
End If
Case iDataType.StringType
iCompareResult = String.Compare(CStr(dgRow1.Cells(iSortCol).Value), CStr(dgRow2.Cells(iSortCol).Value))
Case iDataType.DateTimeType
iCompareResult = Date.Compare(CDate(dgRow1.Cells(iSortCol).Value), CDate(dgRow2.Cells(iSortCol).Value))
End Select
Return iCompareResult * iSortOrderModifier
End Function
End Class
End Class End Class
+249 -143
View File
@@ -22,16 +22,12 @@ Partial Class frmSettings
'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.chkMonitorOnStartup = New System.Windows.Forms.CheckBox()
Me.grpStartup = New System.Windows.Forms.GroupBox()
Me.chkStartWindows = New System.Windows.Forms.CheckBox()
Me.chkStartToTray = New System.Windows.Forms.CheckBox()
Me.chkAutoSaveLog = New System.Windows.Forms.CheckBox() Me.chkAutoSaveLog = New System.Windows.Forms.CheckBox()
Me.btnOptionalFields = New System.Windows.Forms.Button() Me.btnOptionalFields = New System.Windows.Forms.Button()
Me.chkTimeTracking = New System.Windows.Forms.CheckBox() Me.chkTimeTracking = New System.Windows.Forms.CheckBox()
Me.chkSync = New System.Windows.Forms.CheckBox()
Me.chkShowDetectionTips = New System.Windows.Forms.CheckBox() Me.chkShowDetectionTips = New System.Windows.Forms.CheckBox()
Me.grpFolderOptions = New System.Windows.Forms.GroupBox() Me.grpFolderOptions = New System.Windows.Forms.GroupBox()
Me.chkUseGameID = New System.Windows.Forms.CheckBox()
Me.btnBackupFolder = New System.Windows.Forms.Button() Me.btnBackupFolder = New System.Windows.Forms.Button()
Me.lblBackupFolder = New System.Windows.Forms.Label() Me.lblBackupFolder = New System.Windows.Forms.Label()
Me.txtBackupFolder = New System.Windows.Forms.TextBox() Me.txtBackupFolder = New System.Windows.Forms.TextBox()
@@ -50,9 +46,7 @@ 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.grpBackupConfirmations = New System.Windows.Forms.GroupBox()
Me.nudSupressBackupThreshold = New System.Windows.Forms.NumericUpDown()
Me.chkSupressBackup = New System.Windows.Forms.CheckBox()
Me.chkBackupConfirm = New System.Windows.Forms.CheckBox() Me.chkBackupConfirm = New System.Windows.Forms.CheckBox()
Me.chkOverwriteWarning = New System.Windows.Forms.CheckBox() Me.chkOverwriteWarning = New System.Windows.Forms.CheckBox()
Me.grpBackupHandling = New System.Windows.Forms.GroupBox() Me.grpBackupHandling = New System.Windows.Forms.GroupBox()
@@ -63,81 +57,57 @@ Partial Class frmSettings
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.grpGameMonitoringOptions = New System.Windows.Forms.GroupBox()
Me.chkSuppressBackup = New System.Windows.Forms.CheckBox()
Me.lblMinutes = New System.Windows.Forms.Label()
Me.nudSuppressBackupThreshold = New System.Windows.Forms.NumericUpDown()
Me.grpLogOptions = New System.Windows.Forms.GroupBox()
Me.chkDisableSyncMessages = New System.Windows.Forms.CheckBox()
Me.grpGameData = New System.Windows.Forms.GroupBox() Me.grpGameData = New System.Windows.Forms.GroupBox()
Me.lstSettings = New System.Windows.Forms.ListBox() Me.chkShowResolvedPaths = New System.Windows.Forms.CheckBox()
Me.chkSessionTracking = New System.Windows.Forms.CheckBox() Me.chkSessionTracking = New System.Windows.Forms.CheckBox()
Me.grpStartup.SuspendLayout() Me.lstSettings = New System.Windows.Forms.ListBox()
Me.btnResetMessages = New System.Windows.Forms.Button()
Me.pnlStartup = New System.Windows.Forms.Panel()
Me.grpStartup = New System.Windows.Forms.GroupBox()
Me.chkBackupOnLaunch = New System.Windows.Forms.CheckBox()
Me.chkStartWindows = New System.Windows.Forms.CheckBox()
Me.chkStartToTray = New System.Windows.Forms.CheckBox()
Me.chkMonitorOnStartup = New System.Windows.Forms.CheckBox()
Me.grpFolderOptions.SuspendLayout() Me.grpFolderOptions.SuspendLayout()
Me.grp7zGeneral.SuspendLayout() Me.grp7zGeneral.SuspendLayout()
Me.pnlBackup.SuspendLayout() Me.pnlBackup.SuspendLayout()
CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).BeginInit() Me.grpBackupConfirmations.SuspendLayout()
Me.grpBackupHandling.SuspendLayout() Me.grpBackupHandling.SuspendLayout()
Me.pnl7z.SuspendLayout() Me.pnl7z.SuspendLayout()
Me.grp7zAdvanced.SuspendLayout() Me.grp7zAdvanced.SuspendLayout()
Me.grp7zInformation.SuspendLayout() Me.grp7zInformation.SuspendLayout()
Me.pnlGeneral.SuspendLayout() Me.pnlGeneral.SuspendLayout()
Me.grpGameMonitoringOptions.SuspendLayout()
CType(Me.nudSuppressBackupThreshold, System.ComponentModel.ISupportInitialize).BeginInit()
Me.grpLogOptions.SuspendLayout()
Me.grpGameData.SuspendLayout() Me.grpGameData.SuspendLayout()
Me.pnlStartup.SuspendLayout()
Me.grpStartup.SuspendLayout()
Me.SuspendLayout() Me.SuspendLayout()
' '
'chkMonitorOnStartup
'
Me.chkMonitorOnStartup.AutoSize = True
Me.chkMonitorOnStartup.Location = New System.Drawing.Point(6, 65)
Me.chkMonitorOnStartup.Name = "chkMonitorOnStartup"
Me.chkMonitorOnStartup.Size = New System.Drawing.Size(146, 17)
Me.chkMonitorOnStartup.TabIndex = 2
Me.chkMonitorOnStartup.Text = "Start monitoring at launch"
Me.chkMonitorOnStartup.UseVisualStyleBackColor = True
'
'grpStartup
'
Me.grpStartup.Controls.Add(Me.chkStartWindows)
Me.grpStartup.Controls.Add(Me.chkStartToTray)
Me.grpStartup.Controls.Add(Me.chkMonitorOnStartup)
Me.grpStartup.Location = New System.Drawing.Point(6, 12)
Me.grpStartup.Name = "grpStartup"
Me.grpStartup.Size = New System.Drawing.Size(354, 90)
Me.grpStartup.TabIndex = 0
Me.grpStartup.TabStop = False
Me.grpStartup.Text = "Startup"
'
'chkStartWindows
'
Me.chkStartWindows.AutoSize = True
Me.chkStartWindows.Location = New System.Drawing.Point(6, 19)
Me.chkStartWindows.Name = "chkStartWindows"
Me.chkStartWindows.Size = New System.Drawing.Size(117, 17)
Me.chkStartWindows.TabIndex = 0
Me.chkStartWindows.Text = "Start with Windows"
Me.chkStartWindows.UseVisualStyleBackColor = True
'
'chkStartToTray
'
Me.chkStartToTray.AutoSize = True
Me.chkStartToTray.Location = New System.Drawing.Point(6, 42)
Me.chkStartToTray.Name = "chkStartToTray"
Me.chkStartToTray.Size = New System.Drawing.Size(115, 17)
Me.chkStartToTray.TabIndex = 1
Me.chkStartToTray.Text = "Start to system tray"
Me.chkStartToTray.UseVisualStyleBackColor = True
'
'chkAutoSaveLog 'chkAutoSaveLog
' '
Me.chkAutoSaveLog.AutoSize = True Me.chkAutoSaveLog.AutoSize = True
Me.chkAutoSaveLog.Location = New System.Drawing.Point(12, 228) Me.chkAutoSaveLog.Location = New System.Drawing.Point(6, 42)
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 = 3 Me.chkAutoSaveLog.TabIndex = 1
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(103, 61) Me.btnOptionalFields.Location = New System.Drawing.Point(6, 88)
Me.btnOptionalFields.Name = "btnOptionalFields" Me.btnOptionalFields.Name = "btnOptionalFields"
Me.btnOptionalFields.Size = New System.Drawing.Size(134, 23) Me.btnOptionalFields.Size = New System.Drawing.Size(216, 23)
Me.btnOptionalFields.TabIndex = 2 Me.btnOptionalFields.TabIndex = 3
Me.btnOptionalFields.Text = "Choose &Optional Fields..." Me.btnOptionalFields.Text = "Choose &Optional Sync Fields..."
Me.btnOptionalFields.UseVisualStyleBackColor = True Me.btnOptionalFields.UseVisualStyleBackColor = True
' '
'chkTimeTracking 'chkTimeTracking
@@ -150,38 +120,39 @@ Partial Class frmSettings
Me.chkTimeTracking.Text = "Enable time tracking" Me.chkTimeTracking.Text = "Enable time tracking"
Me.chkTimeTracking.UseVisualStyleBackColor = True Me.chkTimeTracking.UseVisualStyleBackColor = True
' '
'chkSync
'
Me.chkSync.AutoSize = True
Me.chkSync.Location = New System.Drawing.Point(6, 65)
Me.chkSync.Name = "chkSync"
Me.chkSync.Size = New System.Drawing.Size(98, 17)
Me.chkSync.TabIndex = 1
Me.chkSync.Text = "Enable syncing"
Me.chkSync.UseVisualStyleBackColor = True
'
'chkShowDetectionTips 'chkShowDetectionTips
' '
Me.chkShowDetectionTips.AutoSize = True Me.chkShowDetectionTips.AutoSize = True
Me.chkShowDetectionTips.Location = New System.Drawing.Point(12, 205) Me.chkShowDetectionTips.Location = New System.Drawing.Point(6, 41)
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 = 2 Me.chkShowDetectionTips.TabIndex = 4
Me.chkShowDetectionTips.Text = "Show detection notifications" Me.chkShowDetectionTips.Text = "Show detection notifications"
Me.chkShowDetectionTips.UseVisualStyleBackColor = True Me.chkShowDetectionTips.UseVisualStyleBackColor = True
' '
'grpFolderOptions 'grpFolderOptions
' '
Me.grpFolderOptions.Controls.Add(Me.chkUseGameID)
Me.grpFolderOptions.Controls.Add(Me.btnBackupFolder) Me.grpFolderOptions.Controls.Add(Me.btnBackupFolder)
Me.grpFolderOptions.Controls.Add(Me.lblBackupFolder) Me.grpFolderOptions.Controls.Add(Me.lblBackupFolder)
Me.grpFolderOptions.Controls.Add(Me.txtBackupFolder) Me.grpFolderOptions.Controls.Add(Me.txtBackupFolder)
Me.grpFolderOptions.Controls.Add(Me.chkCreateFolder) Me.grpFolderOptions.Controls.Add(Me.chkCreateFolder)
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, 90)
Me.grpFolderOptions.TabIndex = 0 Me.grpFolderOptions.TabIndex = 0
Me.grpFolderOptions.TabStop = False Me.grpFolderOptions.TabStop = False
Me.grpFolderOptions.Text = "Folders" Me.grpFolderOptions.Text = "Files and Folders"
'
'chkUseGameID
'
Me.chkUseGameID.AutoSize = True
Me.chkUseGameID.Location = New System.Drawing.Point(9, 65)
Me.chkUseGameID.Name = "chkUseGameID"
Me.chkUseGameID.Size = New System.Drawing.Size(205, 17)
Me.chkUseGameID.TabIndex = 3
Me.chkUseGameID.Text = "Use Game ID for folder and file names"
Me.chkUseGameID.UseVisualStyleBackColor = True
' '
'btnBackupFolder 'btnBackupFolder
' '
@@ -224,7 +195,7 @@ Partial Class frmSettings
Me.btnSave.Location = New System.Drawing.Point(384, 321) Me.btnSave.Location = New System.Drawing.Point(384, 321)
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 = 5 Me.btnSave.TabIndex = 7
Me.btnSave.Text = "&Save" Me.btnSave.Text = "&Save"
Me.btnSave.UseVisualStyleBackColor = True Me.btnSave.UseVisualStyleBackColor = True
' '
@@ -234,7 +205,7 @@ Partial Class frmSettings
Me.btnCancel.Location = New System.Drawing.Point(465, 321) Me.btnCancel.Location = New System.Drawing.Point(465, 321)
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 = 6 Me.btnCancel.TabIndex = 8
Me.btnCancel.Text = "&Cancel" Me.btnCancel.Text = "&Cancel"
Me.btnCancel.UseVisualStyleBackColor = True Me.btnCancel.UseVisualStyleBackColor = True
' '
@@ -331,68 +302,48 @@ Partial Class frmSettings
Me.btnDefaults.Location = New System.Drawing.Point(12, 321) Me.btnDefaults.Location = New System.Drawing.Point(12, 321)
Me.btnDefaults.Name = "btnDefaults" Me.btnDefaults.Name = "btnDefaults"
Me.btnDefaults.Size = New System.Drawing.Size(110, 23) Me.btnDefaults.Size = New System.Drawing.Size(110, 23)
Me.btnDefaults.TabIndex = 4 Me.btnDefaults.TabIndex = 5
Me.btnDefaults.Text = "Set &Defaults" Me.btnDefaults.Text = "Set &Defaults"
Me.btnDefaults.UseVisualStyleBackColor = True Me.btnDefaults.UseVisualStyleBackColor = True
' '
'pnlBackup 'pnlBackup
' '
Me.pnlBackup.Controls.Add(Me.lblMinutes) Me.pnlBackup.Controls.Add(Me.grpBackupConfirmations)
Me.pnlBackup.Controls.Add(Me.nudSupressBackupThreshold)
Me.pnlBackup.Controls.Add(Me.chkSupressBackup)
Me.pnlBackup.Controls.Add(Me.chkBackupConfirm)
Me.pnlBackup.Controls.Add(Me.chkOverwriteWarning)
Me.pnlBackup.Controls.Add(Me.grpBackupHandling) Me.pnlBackup.Controls.Add(Me.grpBackupHandling)
Me.pnlBackup.Controls.Add(Me.grpFolderOptions) 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 = 2
' '
'lblMinutes 'grpBackupConfirmations
' '
Me.lblMinutes.AutoSize = True Me.grpBackupConfirmations.Controls.Add(Me.chkBackupConfirm)
Me.lblMinutes.Location = New System.Drawing.Point(286, 228) Me.grpBackupConfirmations.Controls.Add(Me.chkOverwriteWarning)
Me.lblMinutes.Name = "lblMinutes" Me.grpBackupConfirmations.Location = New System.Drawing.Point(6, 200)
Me.lblMinutes.Size = New System.Drawing.Size(43, 13) Me.grpBackupConfirmations.Name = "grpBackupConfirmations"
Me.lblMinutes.TabIndex = 14 Me.grpBackupConfirmations.Size = New System.Drawing.Size(354, 65)
Me.lblMinutes.Text = "minutes" Me.grpBackupConfirmations.TabIndex = 2
' Me.grpBackupConfirmations.TabStop = False
'nudSupressBackupThreshold Me.grpBackupConfirmations.Text = "Backup Confirmations"
'
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 'chkBackupConfirm
' '
Me.chkBackupConfirm.AutoSize = True Me.chkBackupConfirm.AutoSize = True
Me.chkBackupConfirm.Location = New System.Drawing.Point(6, 180) Me.chkBackupConfirm.Location = New System.Drawing.Point(9, 18)
Me.chkBackupConfirm.Name = "chkBackupConfirm" Me.chkBackupConfirm.Name = "chkBackupConfirm"
Me.chkBackupConfirm.Size = New System.Drawing.Size(160, 17) Me.chkBackupConfirm.Size = New System.Drawing.Size(160, 17)
Me.chkBackupConfirm.TabIndex = 2 Me.chkBackupConfirm.TabIndex = 0
Me.chkBackupConfirm.Text = "Disable backup confirmation" Me.chkBackupConfirm.Text = "Disable backup confirmation"
Me.chkBackupConfirm.UseVisualStyleBackColor = True Me.chkBackupConfirm.UseVisualStyleBackColor = True
' '
'chkOverwriteWarning 'chkOverwriteWarning
' '
Me.chkOverwriteWarning.AutoSize = True Me.chkOverwriteWarning.AutoSize = True
Me.chkOverwriteWarning.Location = New System.Drawing.Point(6, 204) Me.chkOverwriteWarning.Location = New System.Drawing.Point(9, 41)
Me.chkOverwriteWarning.Name = "chkOverwriteWarning" Me.chkOverwriteWarning.Name = "chkOverwriteWarning"
Me.chkOverwriteWarning.Size = New System.Drawing.Size(139, 17) Me.chkOverwriteWarning.Size = New System.Drawing.Size(139, 17)
Me.chkOverwriteWarning.TabIndex = 3 Me.chkOverwriteWarning.TabIndex = 1
Me.chkOverwriteWarning.Text = "Show overwrite warning" Me.chkOverwriteWarning.Text = "Show overwrite warning"
Me.chkOverwriteWarning.UseVisualStyleBackColor = True Me.chkOverwriteWarning.UseVisualStyleBackColor = True
' '
@@ -401,7 +352,7 @@ Partial Class frmSettings
Me.grpBackupHandling.Controls.Add(Me.chkAutoRestore) Me.grpBackupHandling.Controls.Add(Me.chkAutoRestore)
Me.grpBackupHandling.Controls.Add(Me.chkRestoreNotify) Me.grpBackupHandling.Controls.Add(Me.chkRestoreNotify)
Me.grpBackupHandling.Controls.Add(Me.chkAutoMark) Me.grpBackupHandling.Controls.Add(Me.chkAutoMark)
Me.grpBackupHandling.Location = New System.Drawing.Point(6, 88) Me.grpBackupHandling.Location = New System.Drawing.Point(6, 107)
Me.grpBackupHandling.Margin = New System.Windows.Forms.Padding(2) Me.grpBackupHandling.Margin = New System.Windows.Forms.Padding(2)
Me.grpBackupHandling.Name = "grpBackupHandling" Me.grpBackupHandling.Name = "grpBackupHandling"
Me.grpBackupHandling.Padding = New System.Windows.Forms.Padding(2) Me.grpBackupHandling.Padding = New System.Windows.Forms.Padding(2)
@@ -450,7 +401,7 @@ Partial Class frmSettings
Me.pnl7z.Location = New System.Drawing.Point(180, 0) Me.pnl7z.Location = New System.Drawing.Point(180, 0)
Me.pnl7z.Name = "pnl7z" Me.pnl7z.Name = "pnl7z"
Me.pnl7z.Size = New System.Drawing.Size(367, 314) Me.pnl7z.Size = New System.Drawing.Size(367, 314)
Me.pnl7z.TabIndex = 2 Me.pnl7z.TabIndex = 4
' '
'grp7zAdvanced 'grp7zAdvanced
' '
@@ -479,27 +430,107 @@ Partial Class frmSettings
' '
'pnlGeneral 'pnlGeneral
' '
Me.pnlGeneral.Controls.Add(Me.chkAutoSaveLog) Me.pnlGeneral.Controls.Add(Me.grpGameMonitoringOptions)
Me.pnlGeneral.Controls.Add(Me.grpLogOptions)
Me.pnlGeneral.Controls.Add(Me.grpGameData) Me.pnlGeneral.Controls.Add(Me.grpGameData)
Me.pnlGeneral.Controls.Add(Me.chkShowDetectionTips)
Me.pnlGeneral.Controls.Add(Me.grpStartup)
Me.pnlGeneral.Location = New System.Drawing.Point(180, 0) Me.pnlGeneral.Location = New System.Drawing.Point(180, 0)
Me.pnlGeneral.Name = "pnlGeneral" Me.pnlGeneral.Name = "pnlGeneral"
Me.pnlGeneral.Size = New System.Drawing.Size(367, 314) Me.pnlGeneral.Size = New System.Drawing.Size(367, 314)
Me.pnlGeneral.TabIndex = 1 Me.pnlGeneral.TabIndex = 1
' '
'grpGameMonitoringOptions
'
Me.grpGameMonitoringOptions.Controls.Add(Me.chkSuppressBackup)
Me.grpGameMonitoringOptions.Controls.Add(Me.lblMinutes)
Me.grpGameMonitoringOptions.Controls.Add(Me.chkShowDetectionTips)
Me.grpGameMonitoringOptions.Controls.Add(Me.nudSuppressBackupThreshold)
Me.grpGameMonitoringOptions.Location = New System.Drawing.Point(6, 141)
Me.grpGameMonitoringOptions.Name = "grpGameMonitoringOptions"
Me.grpGameMonitoringOptions.Size = New System.Drawing.Size(354, 65)
Me.grpGameMonitoringOptions.TabIndex = 1
Me.grpGameMonitoringOptions.TabStop = False
Me.grpGameMonitoringOptions.Text = "Game Monitoring Options"
'
'chkSuppressBackup
'
Me.chkSuppressBackup.AutoSize = True
Me.chkSuppressBackup.Location = New System.Drawing.Point(6, 18)
Me.chkSuppressBackup.Name = "chkSuppressBackup"
Me.chkSuppressBackup.Size = New System.Drawing.Size(158, 17)
Me.chkSuppressBackup.TabIndex = 2
Me.chkSuppressBackup.Text = "Ignore sessions shorter than"
Me.chkSuppressBackup.UseVisualStyleBackColor = True
'
'lblMinutes
'
Me.lblMinutes.AutoSize = True
Me.lblMinutes.Location = New System.Drawing.Point(226, 19)
Me.lblMinutes.Name = "lblMinutes"
Me.lblMinutes.Size = New System.Drawing.Size(43, 13)
Me.lblMinutes.TabIndex = 17
Me.lblMinutes.Text = "minutes"
'
'nudSuppressBackupThreshold
'
Me.nudSuppressBackupThreshold.Location = New System.Drawing.Point(170, 17)
Me.nudSuppressBackupThreshold.Maximum = New Decimal(New Integer() {999, 0, 0, 0})
Me.nudSuppressBackupThreshold.Name = "nudSuppressBackupThreshold"
Me.nudSuppressBackupThreshold.Size = New System.Drawing.Size(51, 20)
Me.nudSuppressBackupThreshold.TabIndex = 3
'
'grpLogOptions
'
Me.grpLogOptions.Controls.Add(Me.chkDisableSyncMessages)
Me.grpLogOptions.Controls.Add(Me.chkAutoSaveLog)
Me.grpLogOptions.Location = New System.Drawing.Point(6, 212)
Me.grpLogOptions.Name = "grpLogOptions"
Me.grpLogOptions.Size = New System.Drawing.Size(354, 65)
Me.grpLogOptions.TabIndex = 2
Me.grpLogOptions.TabStop = False
Me.grpLogOptions.Text = "Log Options"
'
'chkDisableSyncMessages
'
Me.chkDisableSyncMessages.AutoSize = True
Me.chkDisableSyncMessages.Location = New System.Drawing.Point(6, 19)
Me.chkDisableSyncMessages.Name = "chkDisableSyncMessages"
Me.chkDisableSyncMessages.Size = New System.Drawing.Size(166, 17)
Me.chkDisableSyncMessages.TabIndex = 0
Me.chkDisableSyncMessages.Text = "Disable sync event messages"
Me.chkDisableSyncMessages.UseVisualStyleBackColor = True
'
'grpGameData 'grpGameData
' '
Me.grpGameData.Controls.Add(Me.chkShowResolvedPaths)
Me.grpGameData.Controls.Add(Me.chkSessionTracking) 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.btnOptionalFields) Me.grpGameData.Controls.Add(Me.btnOptionalFields)
Me.grpGameData.Location = New System.Drawing.Point(6, 106) Me.grpGameData.Location = New System.Drawing.Point(6, 12)
Me.grpGameData.Name = "grpGameData" Me.grpGameData.Name = "grpGameData"
Me.grpGameData.Size = New System.Drawing.Size(354, 92) Me.grpGameData.Size = New System.Drawing.Size(354, 123)
Me.grpGameData.TabIndex = 1 Me.grpGameData.TabIndex = 0
Me.grpGameData.TabStop = False Me.grpGameData.TabStop = False
Me.grpGameData.Text = "Game Data" Me.grpGameData.Text = "Game Data Options"
'
'chkShowResolvedPaths
'
Me.chkShowResolvedPaths.AutoSize = True
Me.chkShowResolvedPaths.Location = New System.Drawing.Point(6, 65)
Me.chkShowResolvedPaths.Name = "chkShowResolvedPaths"
Me.chkShowResolvedPaths.Size = New System.Drawing.Size(238, 17)
Me.chkShowResolvedPaths.TabIndex = 2
Me.chkShowResolvedPaths.Text = "Show resolved save paths in Game Manager"
Me.chkShowResolvedPaths.UseVisualStyleBackColor = True
'
'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 = 1
Me.chkSessionTracking.Text = "Enable session tracking"
Me.chkSessionTracking.UseVisualStyleBackColor = True
' '
'lstSettings 'lstSettings
' '
@@ -509,15 +540,75 @@ 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 'btnResetMessages
' '
Me.chkSessionTracking.AutoSize = True Me.btnResetMessages.Location = New System.Drawing.Point(128, 321)
Me.chkSessionTracking.Location = New System.Drawing.Point(6, 42) Me.btnResetMessages.Name = "btnResetMessages"
Me.chkSessionTracking.Name = "chkSessionTracking" Me.btnResetMessages.Size = New System.Drawing.Size(110, 23)
Me.chkSessionTracking.Size = New System.Drawing.Size(138, 17) Me.btnResetMessages.TabIndex = 6
Me.chkSessionTracking.TabIndex = 3 Me.btnResetMessages.Text = "&Reset Warnings"
Me.chkSessionTracking.Text = "Enable session tracking" Me.btnResetMessages.UseVisualStyleBackColor = True
Me.chkSessionTracking.UseVisualStyleBackColor = True '
'pnlStartup
'
Me.pnlStartup.Controls.Add(Me.grpStartup)
Me.pnlStartup.Location = New System.Drawing.Point(180, 0)
Me.pnlStartup.Name = "pnlStartup"
Me.pnlStartup.Size = New System.Drawing.Size(367, 314)
Me.pnlStartup.TabIndex = 3
'
'grpStartup
'
Me.grpStartup.Controls.Add(Me.chkBackupOnLaunch)
Me.grpStartup.Controls.Add(Me.chkStartWindows)
Me.grpStartup.Controls.Add(Me.chkStartToTray)
Me.grpStartup.Controls.Add(Me.chkMonitorOnStartup)
Me.grpStartup.Location = New System.Drawing.Point(6, 12)
Me.grpStartup.Name = "grpStartup"
Me.grpStartup.Size = New System.Drawing.Size(354, 112)
Me.grpStartup.TabIndex = 1
Me.grpStartup.TabStop = False
Me.grpStartup.Text = "Startup Options"
'
'chkBackupOnLaunch
'
Me.chkBackupOnLaunch.AutoSize = True
Me.chkBackupOnLaunch.Location = New System.Drawing.Point(6, 88)
Me.chkBackupOnLaunch.Name = "chkBackupOnLaunch"
Me.chkBackupOnLaunch.Size = New System.Drawing.Size(185, 17)
Me.chkBackupOnLaunch.TabIndex = 3
Me.chkBackupOnLaunch.Text = "Backup GBM data files on launch"
Me.chkBackupOnLaunch.UseVisualStyleBackColor = True
'
'chkStartWindows
'
Me.chkStartWindows.AutoSize = True
Me.chkStartWindows.Location = New System.Drawing.Point(6, 19)
Me.chkStartWindows.Name = "chkStartWindows"
Me.chkStartWindows.Size = New System.Drawing.Size(117, 17)
Me.chkStartWindows.TabIndex = 0
Me.chkStartWindows.Text = "Start with Windows"
Me.chkStartWindows.UseVisualStyleBackColor = True
'
'chkStartToTray
'
Me.chkStartToTray.AutoSize = True
Me.chkStartToTray.Location = New System.Drawing.Point(6, 42)
Me.chkStartToTray.Name = "chkStartToTray"
Me.chkStartToTray.Size = New System.Drawing.Size(115, 17)
Me.chkStartToTray.TabIndex = 1
Me.chkStartToTray.Text = "Start to system tray"
Me.chkStartToTray.UseVisualStyleBackColor = True
'
'chkMonitorOnStartup
'
Me.chkMonitorOnStartup.AutoSize = True
Me.chkMonitorOnStartup.Location = New System.Drawing.Point(6, 65)
Me.chkMonitorOnStartup.Name = "chkMonitorOnStartup"
Me.chkMonitorOnStartup.Size = New System.Drawing.Size(149, 17)
Me.chkMonitorOnStartup.TabIndex = 2
Me.chkMonitorOnStartup.Text = "Start monitoring on launch"
Me.chkMonitorOnStartup.UseVisualStyleBackColor = True
' '
'frmSettings 'frmSettings
' '
@@ -525,8 +616,10 @@ Partial Class frmSettings
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.pnlGeneral)
Me.Controls.Add(Me.pnlBackup) Me.Controls.Add(Me.pnlStartup)
Me.Controls.Add(Me.pnl7z) Me.Controls.Add(Me.pnl7z)
Me.Controls.Add(Me.pnlBackup)
Me.Controls.Add(Me.btnResetMessages)
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)
@@ -539,15 +632,13 @@ Partial Class frmSettings
Me.ShowInTaskbar = False Me.ShowInTaskbar = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Settings" Me.Text = "Settings"
Me.grpStartup.ResumeLayout(False)
Me.grpStartup.PerformLayout()
Me.grpFolderOptions.ResumeLayout(False) Me.grpFolderOptions.ResumeLayout(False)
Me.grpFolderOptions.PerformLayout() Me.grpFolderOptions.PerformLayout()
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.grpBackupConfirmations.ResumeLayout(False)
CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).EndInit() Me.grpBackupConfirmations.PerformLayout()
Me.grpBackupHandling.ResumeLayout(False) Me.grpBackupHandling.ResumeLayout(False)
Me.grpBackupHandling.PerformLayout() Me.grpBackupHandling.PerformLayout()
Me.pnl7z.ResumeLayout(False) Me.pnl7z.ResumeLayout(False)
@@ -555,14 +646,19 @@ Partial Class frmSettings
Me.grp7zAdvanced.PerformLayout() Me.grp7zAdvanced.PerformLayout()
Me.grp7zInformation.ResumeLayout(False) Me.grp7zInformation.ResumeLayout(False)
Me.pnlGeneral.ResumeLayout(False) Me.pnlGeneral.ResumeLayout(False)
Me.pnlGeneral.PerformLayout() Me.grpGameMonitoringOptions.ResumeLayout(False)
Me.grpGameMonitoringOptions.PerformLayout()
CType(Me.nudSuppressBackupThreshold, System.ComponentModel.ISupportInitialize).EndInit()
Me.grpLogOptions.ResumeLayout(False)
Me.grpLogOptions.PerformLayout()
Me.grpGameData.ResumeLayout(False) Me.grpGameData.ResumeLayout(False)
Me.grpGameData.PerformLayout() Me.grpGameData.PerformLayout()
Me.pnlStartup.ResumeLayout(False)
Me.grpStartup.ResumeLayout(False)
Me.grpStartup.PerformLayout()
Me.ResumeLayout(False) Me.ResumeLayout(False)
End Sub End Sub
Friend WithEvents chkMonitorOnStartup As System.Windows.Forms.CheckBox
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
Friend WithEvents btnSave As System.Windows.Forms.Button Friend WithEvents btnSave As System.Windows.Forms.Button
@@ -570,10 +666,7 @@ Partial Class frmSettings
Friend WithEvents lblBackupFolder As System.Windows.Forms.Label Friend WithEvents lblBackupFolder As System.Windows.Forms.Label
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 chkCreateFolder As System.Windows.Forms.CheckBox Friend WithEvents chkCreateFolder As System.Windows.Forms.CheckBox
Friend WithEvents chkSync 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 grp7zGeneral As GroupBox Friend WithEvents grp7zGeneral As GroupBox
Friend WithEvents cboCompression As ComboBox Friend WithEvents cboCompression As ComboBox
@@ -595,9 +688,6 @@ 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 chkBackupConfirm As CheckBox
Friend WithEvents chkOverwriteWarning As CheckBox Friend WithEvents chkOverwriteWarning As CheckBox
Friend WithEvents grpBackupHandling As GroupBox Friend WithEvents grpBackupHandling As GroupBox
@@ -605,4 +695,20 @@ Partial Class frmSettings
Friend WithEvents chkAutoRestore As CheckBox Friend WithEvents chkAutoRestore As CheckBox
Friend WithEvents chkRestoreNotify As CheckBox Friend WithEvents chkRestoreNotify As CheckBox
Friend WithEvents chkSessionTracking As CheckBox Friend WithEvents chkSessionTracking As CheckBox
Friend WithEvents lblMinutes As Label
Friend WithEvents nudSuppressBackupThreshold As NumericUpDown
Friend WithEvents chkSuppressBackup As CheckBox
Friend WithEvents btnResetMessages As Button
Friend WithEvents chkUseGameID As CheckBox
Friend WithEvents grpBackupConfirmations As GroupBox
Friend WithEvents grpLogOptions As GroupBox
Friend WithEvents chkDisableSyncMessages As CheckBox
Friend WithEvents pnlStartup As Panel
Friend WithEvents grpStartup As GroupBox
Friend WithEvents chkBackupOnLaunch As CheckBox
Friend WithEvents chkStartWindows As CheckBox
Friend WithEvents chkStartToTray As CheckBox
Friend WithEvents chkMonitorOnStartup As CheckBox
Friend WithEvents grpGameMonitoringOptions As GroupBox
Friend WithEvents chkShowResolvedPaths As CheckBox
End Class End Class
+52 -34
View File
@@ -34,6 +34,11 @@ Public Class frmSettings
Private Function ValidateSettings() As Boolean Private Function ValidateSettings() As Boolean
'Show Start with Windows warning if running as admin
If chkStartWindows.Checked And mgrCommon.IsElevated Then
mgrCommon.ShowMessage(frmSettings_WarningAdminStart, MsgBoxStyle.Exclamation)
End If
'Only modify registry key when the value changed 'Only modify registry key when the value changed
If chkStartWindows.Checked <> oSettings.StartWithWindows Then If chkStartWindows.Checked <> oSettings.StartWithWindows Then
HandleRegistryUpdate(chkStartWindows.Checked) HandleRegistryUpdate(chkStartWindows.Checked)
@@ -42,18 +47,22 @@ Public Class frmSettings
oSettings.MonitorOnStartup = chkMonitorOnStartup.Checked oSettings.MonitorOnStartup = chkMonitorOnStartup.Checked
oSettings.StartToTray = chkStartToTray.Checked oSettings.StartToTray = chkStartToTray.Checked
oSettings.BackupOnLaunch = chkBackupOnLaunch.Checked
oSettings.ShowDetectionToolTips = chkShowDetectionTips.Checked oSettings.ShowDetectionToolTips = chkShowDetectionTips.Checked
oSettings.DisableSyncMessages = chkDisableSyncMessages.Checked
oSettings.AutoSaveLog = chkAutoSaveLog.Checked oSettings.AutoSaveLog = chkAutoSaveLog.Checked
oSettings.DisableConfirmation = chkBackupConfirm.Checked oSettings.DisableConfirmation = chkBackupConfirm.Checked
oSettings.CreateSubFolder = chkCreateFolder.Checked oSettings.CreateSubFolder = chkCreateFolder.Checked
oSettings.UseGameID = chkUseGameID.Checked
oSettings.ShowOverwriteWarning = chkOverwriteWarning.Checked oSettings.ShowOverwriteWarning = chkOverwriteWarning.Checked
oSettings.RestoreOnLaunch = chkRestoreNotify.Checked oSettings.RestoreOnLaunch = chkRestoreNotify.Checked
oSettings.AutoRestore = chkAutoRestore.Checked oSettings.AutoRestore = chkAutoRestore.Checked
oSettings.AutoMark = chkAutoMark.Checked oSettings.AutoMark = chkAutoMark.Checked
oSettings.TimeTracking = chkTimeTracking.Checked oSettings.TimeTracking = chkTimeTracking.Checked
oSettings.SessionTracking = chkSessionTracking.Checked oSettings.SessionTracking = chkSessionTracking.Checked
oSettings.SupressBackup = chkSupressBackup.Checked oSettings.ShowResolvedPaths = chkShowResolvedPaths.Checked
oSettings.SupressBackupThreshold = nudSupressBackupThreshold.Value oSettings.SuppressBackup = chkSuppressBackup.Checked
oSettings.SuppressBackupThreshold = nudSuppressBackupThreshold.Value
oSettings.CompressionLevel = cboCompression.SelectedValue oSettings.CompressionLevel = cboCompression.SelectedValue
If oSettings.Custom7zArguments <> txt7zArguments.Text.Trim And txt7zArguments.Text.Trim <> String.Empty Then If oSettings.Custom7zArguments <> txt7zArguments.Text.Trim And txt7zArguments.Text.Trim <> String.Empty Then
@@ -63,15 +72,9 @@ Public Class frmSettings
oSettings.Custom7zArguments = txt7zArguments.Text.Trim oSettings.Custom7zArguments = txt7zArguments.Text.Trim
oSettings.Custom7zLocation = txt7zLocation.Text.Trim oSettings.Custom7zLocation = txt7zLocation.Text.Trim
'Turning syncing from off to on is the same as changing the backup folder
If chkSync.Checked = True And oSettings.Sync = False Then
bSyncSettingsChanged = True
End If
oSettings.Sync = chkSync.Checked
If Directory.Exists(txtBackupFolder.Text) Then If Directory.Exists(txtBackupFolder.Text) Then
If oSettings.BackupFolder <> txtBackupFolder.Text Then If oSettings.BackupFolder <> txtBackupFolder.Text Then
If chkSync.Checked Then bSyncSettingsChanged = True bSyncSettingsChanged = True
End If End If
oSettings.BackupFolder = txtBackupFolder.Text oSettings.BackupFolder = txtBackupFolder.Text
Else Else
@@ -91,7 +94,7 @@ Public Class frmSettings
End If End If
'We must trigger a sync if optional fields have changed 'We must trigger a sync if optional fields have changed
If Settings.Sync And (eCurrentSyncFields <> Settings.SyncFields) Then If eCurrentSyncFields <> Settings.SyncFields Then
bSyncSettingsChanged = True bSyncSettingsChanged = True
End If End If
@@ -163,25 +166,34 @@ Public Class frmSettings
End If End If
End Sub End Sub
Private Sub ResetMessages()
If mgrCommon.ShowMessage(frmSettings_ConfirmMessageReset, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
oSettings.SuppressMessages = mgrSettings.eSuppressMessages.None
End If
End Sub
Private Sub LoadSettings() Private Sub LoadSettings()
chkStartWindows.Checked = oSettings.StartWithWindows chkStartWindows.Checked = oSettings.StartWithWindows
chkMonitorOnStartup.Checked = oSettings.MonitorOnStartup chkMonitorOnStartup.Checked = oSettings.MonitorOnStartup
chkStartToTray.Checked = oSettings.StartToTray chkStartToTray.Checked = oSettings.StartToTray
chkBackupOnLaunch.Checked = oSettings.BackupOnLaunch
chkShowDetectionTips.Checked = oSettings.ShowDetectionToolTips chkShowDetectionTips.Checked = oSettings.ShowDetectionToolTips
chkDisableSyncMessages.Checked = oSettings.DisableSyncMessages
chkAutoSaveLog.Checked = oSettings.AutoSaveLog chkAutoSaveLog.Checked = oSettings.AutoSaveLog
chkBackupConfirm.Checked = oSettings.DisableConfirmation chkBackupConfirm.Checked = oSettings.DisableConfirmation
chkCreateFolder.Checked = oSettings.CreateSubFolder chkCreateFolder.Checked = oSettings.CreateSubFolder
chkUseGameID.Checked = oSettings.UseGameID
chkOverwriteWarning.Checked = oSettings.ShowOverwriteWarning chkOverwriteWarning.Checked = oSettings.ShowOverwriteWarning
chkRestoreNotify.Checked = oSettings.RestoreOnLaunch chkRestoreNotify.Checked = oSettings.RestoreOnLaunch
chkAutoRestore.Checked = oSettings.AutoRestore chkAutoRestore.Checked = oSettings.AutoRestore
chkAutoMark.Checked = oSettings.AutoMark chkAutoMark.Checked = oSettings.AutoMark
txtBackupFolder.Text = oSettings.BackupFolder txtBackupFolder.Text = oSettings.BackupFolder
chkSync.Checked = oSettings.Sync
chkTimeTracking.Checked = oSettings.TimeTracking chkTimeTracking.Checked = oSettings.TimeTracking
chkSessionTracking.Checked = oSettings.SessionTracking chkSessionTracking.Checked = oSettings.SessionTracking
chkSupressBackup.Checked = oSettings.SupressBackup chkShowResolvedPaths.Checked = oSettings.ShowResolvedPaths
nudSupressBackupThreshold.Value = oSettings.SupressBackupThreshold chkSuppressBackup.Checked = oSettings.SuppressBackup
nudSupressBackupThreshold.Enabled = chkSupressBackup.Checked nudSuppressBackupThreshold.Value = oSettings.SuppressBackupThreshold
nudSuppressBackupThreshold.Enabled = chkSuppressBackup.Checked
cboCompression.SelectedValue = oSettings.CompressionLevel cboCompression.SelectedValue = oSettings.CompressionLevel
txt7zArguments.Text = oSettings.Custom7zArguments txt7zArguments.Text = oSettings.Custom7zArguments
txt7zLocation.Text = oSettings.Custom7zLocation txt7zLocation.Text = oSettings.Custom7zLocation
@@ -196,8 +208,6 @@ Public Class frmSettings
'Retrieve 7z Info 'Retrieve 7z Info
GetUtilityInfo(oSettings.Custom7zLocation) GetUtilityInfo(oSettings.Custom7zLocation)
'Toggle Sync Button
ToggleSyncButton()
End Sub End Sub
Private Sub LoadCombos() Private Sub LoadCombos()
@@ -223,7 +233,8 @@ Public Class frmSettings
oSettingsItems.Add(New KeyValuePair(Of Integer, String)(0, frmSettings_lstSettings_General)) oSettingsItems.Add(New KeyValuePair(Of Integer, String)(0, frmSettings_lstSettings_General))
oSettingsItems.Add(New KeyValuePair(Of Integer, String)(1, frmSettings_lstSettings_BackupRestore)) oSettingsItems.Add(New KeyValuePair(Of Integer, String)(1, frmSettings_lstSettings_BackupRestore))
oSettingsItems.Add(New KeyValuePair(Of Integer, String)(2, frmSettings_lstSettings_7z)) oSettingsItems.Add(New KeyValuePair(Of Integer, String)(2, frmSettings_lstSettings_Startup))
oSettingsItems.Add(New KeyValuePair(Of Integer, String)(3, frmSettings_lstSettings_7z))
lstSettings.DataSource = oSettingsItems lstSettings.DataSource = oSettingsItems
@@ -231,14 +242,6 @@ Public Class frmSettings
lstSettings.SelectedIndex = 0 lstSettings.SelectedIndex = 0
End Sub End Sub
Private Sub ToggleSyncButton()
If chkSync.Checked Then
btnOptionalFields.Enabled = True
Else
btnOptionalFields.Enabled = False
End If
End Sub
Private Sub OpenOptionalFields() Private Sub OpenOptionalFields()
Dim frm As New frmSyncFields Dim frm As New frmSyncFields
frm.SyncFields = Settings.SyncFields frm.SyncFields = Settings.SyncFields
@@ -255,15 +258,24 @@ Public Class frmSettings
Select Case oSettingsItem.Key Select Case oSettingsItem.Key
Case 0 Case 0
pnlGeneral.Visible = True pnlGeneral.Visible = True
pnlStartup.Visible = False
pnlBackup.Visible = False pnlBackup.Visible = False
pnl7z.Visible = False pnl7z.Visible = False
Case 1 Case 1
pnlGeneral.Visible = False pnlGeneral.Visible = False
pnlBackup.Visible = True pnlBackup.Visible = True
pnlStartup.Visible = False
pnl7z.Visible = False pnl7z.Visible = False
Case 2 Case 2
pnlGeneral.Visible = False pnlGeneral.Visible = False
pnlBackup.Visible = False pnlBackup.Visible = False
pnlStartup.Visible = True
pnl7z.Visible = False
Case 3
pnlGeneral.Visible = False
pnlBackup.Visible = False
pnlStartup.Visible = False
pnl7z.Visible = True pnl7z.Visible = True
End Select End Select
End If End If
@@ -275,13 +287,14 @@ Public Class frmSettings
'Set Form Text 'Set Form Text
lblMinutes.Text = frmSettings_lblMinutes lblMinutes.Text = frmSettings_lblMinutes
chkSupressBackup.Text = frmSettings_chkSupressBackup chkSuppressBackup.Text = frmSettings_chkSuppressBackup
grpBackupHandling.Text = frmSettings_grpBackupHandling grpBackupHandling.Text = frmSettings_grpBackupHandling
chkRestoreNotify.Text = frmSettings_chkRestoreNotify chkRestoreNotify.Text = frmSettings_chkRestoreNotify
chkAutoRestore.Text = frmSettings_chkAutoRestore chkAutoRestore.Text = frmSettings_chkAutoRestore
chkAutoMark.Text = frmSettings_chkAutoMark chkAutoMark.Text = frmSettings_chkAutoMark
chkOverwriteWarning.Text = frmSettings_chkOverwriteWarning chkOverwriteWarning.Text = frmSettings_chkOverwriteWarning
chkCreateFolder.Text = frmSettings_chkCreateFolder chkCreateFolder.Text = frmSettings_chkCreateFolder
chkUseGameID.Text = frmSettings_chkUseGameID
chkBackupConfirm.Text = frmSettings_chkBackupConfirm chkBackupConfirm.Text = frmSettings_chkBackupConfirm
btnCancel.Text = frmSettings_btnCancel btnCancel.Text = frmSettings_btnCancel
btnSave.Text = frmSettings_btnSave btnSave.Text = frmSettings_btnSave
@@ -293,7 +306,6 @@ Public Class frmSettings
chkTimeTracking.Text = frmSettings_chkTimeTracking chkTimeTracking.Text = frmSettings_chkTimeTracking
chkSessionTracking.Text = frmSettings_chkSessionTracking chkSessionTracking.Text = frmSettings_chkSessionTracking
chkStartWindows.Text = frmSettings_chkStartWindows chkStartWindows.Text = frmSettings_chkStartWindows
chkSync.Text = frmSettings_chkSync
chkShowDetectionTips.Text = frmSettings_chkShowDetectionTips chkShowDetectionTips.Text = frmSettings_chkShowDetectionTips
chkAutoSaveLog.Text = frmSettings_chkAutoSaveLog chkAutoSaveLog.Text = frmSettings_chkAutoSaveLog
chkStartToTray.Text = frmSettings_chkStartToTray chkStartToTray.Text = frmSettings_chkStartToTray
@@ -306,6 +318,13 @@ Public Class frmSettings
lblArguments.Text = frmSettings_lblArguments lblArguments.Text = frmSettings_lblArguments
lblLocation.Text = frmSettings_lblLocation lblLocation.Text = frmSettings_lblLocation
btnOptionalFields.Text = frmSettings_btnOptionalFields btnOptionalFields.Text = frmSettings_btnOptionalFields
btnResetMessages.Text = frmSettings_btnResetMessages
chkBackupOnLaunch.Text = frmSettings_chkBackupOnLaunch
grpBackupConfirmations.Text = frmSettings_grpBackupConfirmations
grpLogOptions.Text = frmSettings_grpLogOptions
chkDisableSyncMessages.Text = frmSettings_chkDisableSyncMessages
grpGameMonitoringOptions.Text = frmSettings_grpGameMonitoringOptions
chkShowResolvedPaths.Text = frmSettings_chkShowResolvedPaths
'Unix Handler 'Unix Handler
If mgrCommon.IsUnix Then If mgrCommon.IsUnix Then
@@ -352,8 +371,8 @@ Public Class frmSettings
End If End If
End Sub End Sub
Private Sub chkSupressBackup_CheckedChanged(sender As Object, e As EventArgs) Handles chkSupressBackup.CheckedChanged Private Sub chkSuppressBackup_CheckedChanged(sender As Object, e As EventArgs) Handles chkSuppressBackup.CheckedChanged
nudSupressBackupThreshold.Enabled = chkSupressBackup.Checked nudSuppressBackupThreshold.Enabled = chkSuppressBackup.Checked
End Sub End Sub
Private Sub txt7zLocation_Leave(sender As Object, e As EventArgs) Handles txt7zLocation.Leave Private Sub txt7zLocation_Leave(sender As Object, e As EventArgs) Handles txt7zLocation.Leave
@@ -364,16 +383,15 @@ Public Class frmSettings
SetDefaults() SetDefaults()
End Sub End Sub
Private Sub btnOptionalFields_Click(sender As Object, e As EventArgs) Handles btnOptionalFields.Click Private Sub btnResetMessages_Click(sender As Object, e As EventArgs) Handles btnResetMessages.Click
OpenOptionalFields() ResetMessages()
End Sub End Sub
Private Sub chkSync_CheckedChanged(sender As Object, e As EventArgs) Handles chkSync.CheckedChanged Private Sub btnOptionalFields_Click(sender As Object, e As EventArgs) Handles btnOptionalFields.Click
ToggleSyncButton() OpenOptionalFields()
End Sub End Sub
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
+7 -19
View File
@@ -30,7 +30,6 @@ Partial Class frmStartUpWizard
Me.lblStep1Title = New System.Windows.Forms.Label() Me.lblStep1Title = New System.Windows.Forms.Label()
Me.lblStep1Instructions = New System.Windows.Forms.Label() Me.lblStep1Instructions = New System.Windows.Forms.Label()
Me.tbPage2 = New System.Windows.Forms.TabPage() Me.tbPage2 = New System.Windows.Forms.TabPage()
Me.chkSync = New System.Windows.Forms.CheckBox()
Me.chkCreateFolder = New System.Windows.Forms.CheckBox() Me.chkCreateFolder = New System.Windows.Forms.CheckBox()
Me.lblStep2Title = New System.Windows.Forms.Label() Me.lblStep2Title = New System.Windows.Forms.Label()
Me.lblStep2Instructions = New System.Windows.Forms.Label() Me.lblStep2Instructions = New System.Windows.Forms.Label()
@@ -91,7 +90,7 @@ Partial Class frmStartUpWizard
Me.lblStep1Instructions2.Name = "lblStep1Instructions2" Me.lblStep1Instructions2.Name = "lblStep1Instructions2"
Me.lblStep1Instructions2.Size = New System.Drawing.Size(303, 53) Me.lblStep1Instructions2.Size = New System.Drawing.Size(303, 53)
Me.lblStep1Instructions2.TabIndex = 2 Me.lblStep1Instructions2.TabIndex = 2
Me.lblStep1Instructions2.Text = "If you'd like to learn about advanced features or have any other questions before" & _ Me.lblStep1Instructions2.Text = "If you'd like to learn about advanced features or have any other questions before" &
" you get started, there is a detailed online manual available." " you get started, there is a detailed online manual available."
' '
'llbManual 'llbManual
@@ -126,7 +125,6 @@ Partial Class frmStartUpWizard
'tbPage2 'tbPage2
' '
Me.tbPage2.BackColor = System.Drawing.SystemColors.Control Me.tbPage2.BackColor = System.Drawing.SystemColors.Control
Me.tbPage2.Controls.Add(Me.chkSync)
Me.tbPage2.Controls.Add(Me.chkCreateFolder) Me.tbPage2.Controls.Add(Me.chkCreateFolder)
Me.tbPage2.Controls.Add(Me.lblStep2Title) Me.tbPage2.Controls.Add(Me.lblStep2Title)
Me.tbPage2.Controls.Add(Me.lblStep2Instructions) Me.tbPage2.Controls.Add(Me.lblStep2Instructions)
@@ -140,16 +138,6 @@ Partial Class frmStartUpWizard
Me.tbPage2.TabIndex = 1 Me.tbPage2.TabIndex = 1
Me.tbPage2.Text = "TabPage2" Me.tbPage2.Text = "TabPage2"
' '
'chkSync
'
Me.chkSync.AutoSize = True
Me.chkSync.Location = New System.Drawing.Point(17, 105)
Me.chkSync.Name = "chkSync"
Me.chkSync.Size = New System.Drawing.Size(261, 17)
Me.chkSync.TabIndex = 5
Me.chkSync.Text = "Import any existing GBM data in the backup folder"
Me.chkSync.UseVisualStyleBackColor = True
'
'chkCreateFolder 'chkCreateFolder
' '
Me.chkCreateFolder.AutoSize = True Me.chkCreateFolder.AutoSize = True
@@ -172,12 +160,13 @@ Partial Class frmStartUpWizard
' '
'lblStep2Instructions 'lblStep2Instructions
' '
Me.lblStep2Instructions.Location = New System.Drawing.Point(14, 151) Me.lblStep2Instructions.Location = New System.Drawing.Point(14, 103)
Me.lblStep2Instructions.Name = "lblStep2Instructions" Me.lblStep2Instructions.Name = "lblStep2Instructions"
Me.lblStep2Instructions.Size = New System.Drawing.Size(335, 31) Me.lblStep2Instructions.Size = New System.Drawing.Size(335, 50)
Me.lblStep2Instructions.TabIndex = 6 Me.lblStep2Instructions.TabIndex = 6
Me.lblStep2Instructions.Text = "GBM will store all your backup files along with a manifest database (gbm.s3db) in" & _ Me.lblStep2Instructions.Text = "GBM will store all your backup files along with a manifest database (gbm.s3db) in" &
" this location. " " this location. Any existing GBM data in this folder will be automatically impo" &
"rted."
' '
'btnFolderBrowse 'btnFolderBrowse
' '
@@ -283,7 +272,7 @@ Partial Class frmStartUpWizard
Me.lblStep4Instructions3.Name = "lblStep4Instructions3" Me.lblStep4Instructions3.Name = "lblStep4Instructions3"
Me.lblStep4Instructions3.Size = New System.Drawing.Size(303, 33) Me.lblStep4Instructions3.Size = New System.Drawing.Size(303, 33)
Me.lblStep4Instructions3.TabIndex = 18 Me.lblStep4Instructions3.TabIndex = 18
Me.lblStep4Instructions3.Text = "You can change anything you've setup in this wizard and find more settings and fe" & _ Me.lblStep4Instructions3.Text = "You can change anything you've setup in this wizard and find more settings and fe" &
"atures by exploring the menus. Thanks!" "atures by exploring the menus. Thanks!"
' '
'lblStep4Instructions2 'lblStep4Instructions2
@@ -381,7 +370,6 @@ Partial Class frmStartUpWizard
Friend WithEvents btnOpenMonitorList As System.Windows.Forms.Button Friend WithEvents btnOpenMonitorList As System.Windows.Forms.Button
Friend WithEvents lblStep4Instructions3 As System.Windows.Forms.Label Friend WithEvents lblStep4Instructions3 As System.Windows.Forms.Label
Friend WithEvents lblStep4Instructions2 As System.Windows.Forms.Label Friend WithEvents lblStep4Instructions2 As System.Windows.Forms.Label
Friend WithEvents chkSync As System.Windows.Forms.CheckBox
Friend WithEvents lblStep1Instructions2 As System.Windows.Forms.Label Friend WithEvents lblStep1Instructions2 As System.Windows.Forms.Label
Friend WithEvents llbManual As System.Windows.Forms.LinkLabel Friend WithEvents llbManual As System.Windows.Forms.LinkLabel
End Class End Class
+6 -10
View File
@@ -38,7 +38,6 @@ Public Class frmStartUpWizard
llbManual.Text = frmStartUpWizard_llbManual llbManual.Text = frmStartUpWizard_llbManual
lblStep1Title.Text = frmStartUpWizard_lblStep1Title lblStep1Title.Text = frmStartUpWizard_lblStep1Title
lblStep1Instructions.Text = frmStartUpWizard_lblStep1Instructions lblStep1Instructions.Text = frmStartUpWizard_lblStep1Instructions
chkSync.Text = frmStartUpWizard_chkSync
chkCreateFolder.Text = frmStartUpWizard_chkCreateFolder chkCreateFolder.Text = frmStartUpWizard_chkCreateFolder
lblStep2Title.Text = frmStartUpWizard_lblStep2Title lblStep2Title.Text = frmStartUpWizard_lblStep2Title
lblStep2Instructions.Text = frmStartUpWizard_lblStep2Instructions lblStep2Instructions.Text = frmStartUpWizard_lblStep2Instructions
@@ -66,7 +65,7 @@ Public Class frmStartUpWizard
If oDatabase.CheckDB() Then If oDatabase.CheckDB() Then
'Make sure database is the latest version 'Make sure database is the latest version
oDatabase.DatabaseUpgrade() oDatabase.DatabaseUpgrade()
mgrMonitorList.SyncMonitorLists(oSettings.SyncFields, False) mgrMonitorList.SyncMonitorLists(oSettings, False)
mgrCommon.ShowMessage(frmStartUpWizard_ExistingData, MsgBoxStyle.Information) mgrCommon.ShowMessage(frmStartUpWizard_ExistingData, MsgBoxStyle.Information)
End If End If
End Sub End Sub
@@ -80,7 +79,6 @@ Public Class frmStartUpWizard
Case eSteps.Step2 Case eSteps.Step2
txtBackupPath.Text = oSettings.BackupFolder txtBackupPath.Text = oSettings.BackupFolder
chkCreateFolder.Checked = oSettings.CreateSubFolder chkCreateFolder.Checked = oSettings.CreateSubFolder
chkSync.Checked = oSettings.Sync
btnBack.Enabled = True btnBack.Enabled = True
btnNext.Enabled = True btnNext.Enabled = True
tabWizard.SelectTab(1) tabWizard.SelectTab(1)
@@ -107,9 +105,9 @@ Public Class frmStartUpWizard
End If End If
If mgrCommon.ShowMessage(frmStartUpWizard_ConfirmOfficialImport, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then If mgrCommon.ShowMessage(frmStartUpWizard_ConfirmOfficialImport, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
If mgrMonitorList.DoImport(sImportURL) Then If mgrMonitorList.DoImport(sImportURL, True, Settings, True) Then
oGameData = mgrMonitorList.ReadList(mgrMonitorList.eListTypes.FullList) oGameData = mgrMonitorList.ReadList(mgrMonitorList.eListTypes.FullList)
If oSettings.Sync Then mgrMonitorList.SyncMonitorLists(oSettings.SyncFields) mgrMonitorList.SyncMonitorLists(oSettings)
End If End If
End If End If
End Sub End Sub
@@ -124,16 +122,15 @@ Public Class frmStartUpWizard
frm.GameData = oGameData frm.GameData = oGameData
frm.ShowDialog() frm.ShowDialog()
LoadGameSettings() LoadGameSettings()
If oSettings.Sync Then mgrMonitorList.SyncMonitorLists(oSettings.SyncFields) mgrMonitorList.SyncMonitorLists(oSettings)
End Sub End Sub
Private Sub OpenMonitorList() Private Sub OpenMonitorList()
Dim frm As New frmGameManager Dim frm As New frmGameManager
frm.BackupFolder = oSettings.BackupFolder frm.Settings = oSettings
frm.DisableExternalFunctions = True frm.DisableExternalFunctions = True
frm.ShowDialog() frm.ShowDialog()
LoadGameSettings() LoadGameSettings()
If oSettings.Sync Then mgrMonitorList.SyncMonitorLists(oSettings.SyncFields)
End Sub End Sub
Private Function ValidateBackupPath(ByVal strPath As String, ByRef sErrorMessage As String) As Boolean Private Function ValidateBackupPath(ByVal strPath As String, ByRef sErrorMessage As String) As Boolean
@@ -183,10 +180,9 @@ Public Class frmStartUpWizard
If ValidateBackupPath(txtBackupPath.Text, sErrorMessage) Then If ValidateBackupPath(txtBackupPath.Text, sErrorMessage) Then
oSettings.BackupFolder = txtBackupPath.Text oSettings.BackupFolder = txtBackupPath.Text
oSettings.CreateSubFolder = chkCreateFolder.Checked oSettings.CreateSubFolder = chkCreateFolder.Checked
oSettings.Sync = chkSync.Checked
oSettings.SaveSettings() oSettings.SaveSettings()
oSettings.LoadSettings() oSettings.LoadSettings()
If oSettings.Sync Then CheckSync() CheckSync()
eCurrentStep = eSteps.Step3 eCurrentStep = eSteps.Step3
Else Else
bError = True bError = True
+9 -22
View File
@@ -28,7 +28,6 @@ Partial Class frmSyncFields
Me.chkVersion = New System.Windows.Forms.CheckBox() Me.chkVersion = New System.Windows.Forms.CheckBox()
Me.chkCompany = New System.Windows.Forms.CheckBox() Me.chkCompany = New System.Windows.Forms.CheckBox()
Me.chkGamePath = New System.Windows.Forms.CheckBox() Me.chkGamePath = New System.Windows.Forms.CheckBox()
Me.chkTimeStamp = New System.Windows.Forms.CheckBox()
Me.btnCancel = New System.Windows.Forms.Button() Me.btnCancel = New System.Windows.Forms.Button()
Me.btnSave = New System.Windows.Forms.Button() Me.btnSave = New System.Windows.Forms.Button()
Me.grpFields.SuspendLayout() Me.grpFields.SuspendLayout()
@@ -41,10 +40,9 @@ Partial Class frmSyncFields
Me.grpFields.Controls.Add(Me.chkVersion) Me.grpFields.Controls.Add(Me.chkVersion)
Me.grpFields.Controls.Add(Me.chkCompany) Me.grpFields.Controls.Add(Me.chkCompany)
Me.grpFields.Controls.Add(Me.chkGamePath) Me.grpFields.Controls.Add(Me.chkGamePath)
Me.grpFields.Controls.Add(Me.chkTimeStamp)
Me.grpFields.Location = New System.Drawing.Point(12, 12) Me.grpFields.Location = New System.Drawing.Point(12, 12)
Me.grpFields.Name = "grpFields" Me.grpFields.Name = "grpFields"
Me.grpFields.Size = New System.Drawing.Size(195, 162) Me.grpFields.Size = New System.Drawing.Size(195, 135)
Me.grpFields.TabIndex = 0 Me.grpFields.TabIndex = 0
Me.grpFields.TabStop = False Me.grpFields.TabStop = False
Me.grpFields.Text = "Available Fields" Me.grpFields.Text = "Available Fields"
@@ -52,7 +50,7 @@ Partial Class frmSyncFields
'chkMonitorGame 'chkMonitorGame
' '
Me.chkMonitorGame.AutoSize = True Me.chkMonitorGame.AutoSize = True
Me.chkMonitorGame.Location = New System.Drawing.Point(6, 134) Me.chkMonitorGame.Location = New System.Drawing.Point(6, 111)
Me.chkMonitorGame.Name = "chkMonitorGame" Me.chkMonitorGame.Name = "chkMonitorGame"
Me.chkMonitorGame.Size = New System.Drawing.Size(109, 17) Me.chkMonitorGame.Size = New System.Drawing.Size(109, 17)
Me.chkMonitorGame.TabIndex = 5 Me.chkMonitorGame.TabIndex = 5
@@ -62,7 +60,7 @@ Partial Class frmSyncFields
'chkIcon 'chkIcon
' '
Me.chkIcon.AutoSize = True Me.chkIcon.AutoSize = True
Me.chkIcon.Location = New System.Drawing.Point(6, 111) Me.chkIcon.Location = New System.Drawing.Point(6, 88)
Me.chkIcon.Name = "chkIcon" Me.chkIcon.Name = "chkIcon"
Me.chkIcon.Size = New System.Drawing.Size(148, 17) Me.chkIcon.Size = New System.Drawing.Size(148, 17)
Me.chkIcon.TabIndex = 4 Me.chkIcon.TabIndex = 4
@@ -72,7 +70,7 @@ Partial Class frmSyncFields
'chkVersion 'chkVersion
' '
Me.chkVersion.AutoSize = True Me.chkVersion.AutoSize = True
Me.chkVersion.Location = New System.Drawing.Point(6, 88) Me.chkVersion.Location = New System.Drawing.Point(6, 65)
Me.chkVersion.Name = "chkVersion" Me.chkVersion.Name = "chkVersion"
Me.chkVersion.Size = New System.Drawing.Size(61, 17) Me.chkVersion.Size = New System.Drawing.Size(61, 17)
Me.chkVersion.TabIndex = 3 Me.chkVersion.TabIndex = 3
@@ -82,7 +80,7 @@ Partial Class frmSyncFields
'chkCompany 'chkCompany
' '
Me.chkCompany.AutoSize = True Me.chkCompany.AutoSize = True
Me.chkCompany.Location = New System.Drawing.Point(6, 65) Me.chkCompany.Location = New System.Drawing.Point(6, 42)
Me.chkCompany.Name = "chkCompany" Me.chkCompany.Name = "chkCompany"
Me.chkCompany.Size = New System.Drawing.Size(70, 17) Me.chkCompany.Size = New System.Drawing.Size(70, 17)
Me.chkCompany.TabIndex = 2 Me.chkCompany.TabIndex = 2
@@ -92,27 +90,17 @@ Partial Class frmSyncFields
'chkGamePath 'chkGamePath
' '
Me.chkGamePath.AutoSize = True Me.chkGamePath.AutoSize = True
Me.chkGamePath.Location = New System.Drawing.Point(6, 42) Me.chkGamePath.Location = New System.Drawing.Point(6, 19)
Me.chkGamePath.Name = "chkGamePath" Me.chkGamePath.Name = "chkGamePath"
Me.chkGamePath.Size = New System.Drawing.Size(180, 17) Me.chkGamePath.Size = New System.Drawing.Size(180, 17)
Me.chkGamePath.TabIndex = 1 Me.chkGamePath.TabIndex = 1
Me.chkGamePath.Text = "Game Path (Not Recommended)" Me.chkGamePath.Text = "Game Path (Not Recommended)"
Me.chkGamePath.UseVisualStyleBackColor = True Me.chkGamePath.UseVisualStyleBackColor = True
' '
'chkTimeStamp
'
Me.chkTimeStamp.AutoSize = True
Me.chkTimeStamp.Location = New System.Drawing.Point(6, 19)
Me.chkTimeStamp.Name = "chkTimeStamp"
Me.chkTimeStamp.Size = New System.Drawing.Size(133, 17)
Me.chkTimeStamp.TabIndex = 0
Me.chkTimeStamp.Text = "Save multiple backups"
Me.chkTimeStamp.UseVisualStyleBackColor = True
'
'btnCancel 'btnCancel
' '
Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
Me.btnCancel.Location = New System.Drawing.Point(132, 180) Me.btnCancel.Location = New System.Drawing.Point(132, 153)
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 = 2 Me.btnCancel.TabIndex = 2
@@ -122,7 +110,7 @@ Partial Class frmSyncFields
'btnSave 'btnSave
' '
Me.btnSave.DialogResult = System.Windows.Forms.DialogResult.OK Me.btnSave.DialogResult = System.Windows.Forms.DialogResult.OK
Me.btnSave.Location = New System.Drawing.Point(52, 180) Me.btnSave.Location = New System.Drawing.Point(52, 153)
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 = 1 Me.btnSave.TabIndex = 1
@@ -133,7 +121,7 @@ Partial Class frmSyncFields
' '
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(219, 211) Me.ClientSize = New System.Drawing.Size(219, 186)
Me.Controls.Add(Me.btnCancel) Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnSave) Me.Controls.Add(Me.btnSave)
Me.Controls.Add(Me.grpFields) Me.Controls.Add(Me.grpFields)
@@ -157,7 +145,6 @@ Partial Class frmSyncFields
Friend WithEvents chkVersion As CheckBox Friend WithEvents chkVersion As CheckBox
Friend WithEvents chkCompany As CheckBox Friend WithEvents chkCompany As CheckBox
Friend WithEvents chkGamePath As CheckBox Friend WithEvents chkGamePath As CheckBox
Friend WithEvents chkTimeStamp As CheckBox
Friend WithEvents btnCancel As Button Friend WithEvents btnCancel As Button
Friend WithEvents btnSave As Button Friend WithEvents btnSave As Button
End Class End Class
-12
View File
@@ -26,9 +26,6 @@ Public Class frmSyncFields
If (eSyncFields And clsGame.eOptionalSyncFields.MonitorGame) = clsGame.eOptionalSyncFields.MonitorGame Then If (eSyncFields And clsGame.eOptionalSyncFields.MonitorGame) = clsGame.eOptionalSyncFields.MonitorGame Then
chkMonitorGame.Checked = True chkMonitorGame.Checked = True
End If End If
If (eSyncFields And clsGame.eOptionalSyncFields.TimeStamp) = clsGame.eOptionalSyncFields.TimeStamp Then
chkTimeStamp.Checked = True
End If
If (eSyncFields And clsGame.eOptionalSyncFields.Version) = clsGame.eOptionalSyncFields.Version Then If (eSyncFields And clsGame.eOptionalSyncFields.Version) = clsGame.eOptionalSyncFields.Version Then
chkVersion.Checked = True chkVersion.Checked = True
End If End If
@@ -47,7 +44,6 @@ Public Class frmSyncFields
chkVersion.Text = frmSyncFields_chkVersion chkVersion.Text = frmSyncFields_chkVersion
chkCompany.Text = frmSyncFields_chkCompany chkCompany.Text = frmSyncFields_chkCompany
chkGamePath.Text = frmSyncFields_chkGamePath chkGamePath.Text = frmSyncFields_chkGamePath
chkTimeStamp.Text = frmSyncFields_chkTimeStamp
End Sub End Sub
Private Sub frmSyncFields_Load(sender As Object, e As EventArgs) Handles MyBase.Load Private Sub frmSyncFields_Load(sender As Object, e As EventArgs) Handles MyBase.Load
@@ -65,14 +61,6 @@ Public Class frmSyncFields
Me.Close() Me.Close()
End Sub End Sub
Private Sub chkTimeStamp_CheckedChanged(sender As Object, e As EventArgs) Handles chkTimeStamp.CheckedChanged
If chkTimeStamp.Checked Then
SyncFields = clsGame.SetSyncField(SyncFields, clsGame.eOptionalSyncFields.TimeStamp)
Else
SyncFields = clsGame.RemoveSyncField(SyncFields, clsGame.eOptionalSyncFields.TimeStamp)
End If
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 = clsGame.SetSyncField(SyncFields, clsGame.eOptionalSyncFields.GamePath) SyncFields = clsGame.SetSyncField(SyncFields, clsGame.eOptionalSyncFields.GamePath)
+6
View File
@@ -289,6 +289,12 @@ Public Class frmVariableManager
Return False Return False
End If End If
If mgrVariables.GetReservedVariables.Contains(txtName.Text.ToUpper) Then
mgrCommon.ShowMessage(frmVariableManager_ErrorVariableReserved, txtName.Text, MsgBoxStyle.Exclamation)
txtName.Focus()
Return False
End If
Return True Return True
End Function End Function
+35 -1
View File
@@ -122,11 +122,14 @@
<Import Include="System.Windows.Forms" /> <Import Include="System.Windows.Forms" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Classes\clsGameProcess.vb" />
<Compile Include="Classes\clsProcess.vb" />
<Compile Include="Classes\clsGameFilter.vb" /> <Compile Include="Classes\clsGameFilter.vb" />
<Compile Include="Classes\clsGameFilterField.vb" /> <Compile Include="Classes\clsGameFilterField.vb" />
<Compile Include="Classes\clsSavedPath.vb" /> <Compile Include="Classes\clsSavedPath.vb" />
<Compile Include="Classes\clsSession.vb" /> <Compile Include="Classes\clsSession.vb" />
<Compile Include="Classes\XML Serialize Classes\ExportData.vb" /> <Compile Include="Classes\XML Serialize Classes\ExportData.vb" />
<Compile Include="Classes\XML Serialize Classes\Session.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" />
@@ -158,6 +161,12 @@
<Compile Include="Forms\frmFileFolderSearch.vb"> <Compile Include="Forms\frmFileFolderSearch.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Forms\frmGameProcesses.Designer.vb">
<DependentUpon>frmGameProcesses.vb</DependentUpon>
</Compile>
<Compile Include="Forms\frmGameProcesses.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\frmGameTags.Designer.vb"> <Compile Include="Forms\frmGameTags.Designer.vb">
<DependentUpon>frmGameTags.vb</DependentUpon> <DependentUpon>frmGameTags.vb</DependentUpon>
</Compile> </Compile>
@@ -170,6 +179,18 @@
<Compile Include="Forms\frmIncludeExclude.vb"> <Compile Include="Forms\frmIncludeExclude.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Forms\frmProcessManager.Designer.vb">
<DependentUpon>frmProcessManager.vb</DependentUpon>
</Compile>
<Compile Include="Forms\frmProcessManager.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\frmSessionExport.Designer.vb">
<DependentUpon>frmSessionExport.vb</DependentUpon>
</Compile>
<Compile Include="Forms\frmSessionExport.vb">
<SubType>Form</SubType>
</Compile>
<Compile Include="Forms\frmSessions.Designer.vb"> <Compile Include="Forms\frmSessions.Designer.vb">
<DependentUpon>frmSessions.vb</DependentUpon> <DependentUpon>frmSessions.vb</DependentUpon>
</Compile> </Compile>
@@ -225,6 +246,8 @@
<Compile Include="Forms\frmVariableManager.vb"> <Compile Include="Forms\frmVariableManager.vb">
<SubType>Form</SubType> <SubType>Form</SubType>
</Compile> </Compile>
<Compile Include="Managers\mgrGameProcesses.vb" />
<Compile Include="Managers\mgrProcess.vb" />
<Compile Include="Managers\mgrCommon.vb" /> <Compile Include="Managers\mgrCommon.vb" />
<Compile Include="Managers\mgrGameTags.vb" /> <Compile Include="Managers\mgrGameTags.vb" />
<Compile Include="Managers\mgrHash.vb" /> <Compile Include="Managers\mgrHash.vb" />
@@ -240,7 +263,7 @@
<Compile Include="Managers\mgrTags.vb" /> <Compile Include="Managers\mgrTags.vb" />
<Compile Include="Managers\mgrVariables.vb" /> <Compile Include="Managers\mgrVariables.vb" />
<Compile Include="Managers\mgrXML.vb" /> <Compile Include="Managers\mgrXML.vb" />
<Compile Include="Managers\mgrProcesses.vb" /> <Compile Include="Managers\mgrProcessDetection.vb" />
<Compile Include="My Project\AssemblyInfo.vb" /> <Compile Include="My Project\AssemblyInfo.vb" />
<Compile Include="My Project\Application.Designer.vb"> <Compile Include="My Project\Application.Designer.vb">
<AutoGen>True</AutoGen> <AutoGen>True</AutoGen>
@@ -270,12 +293,21 @@
<EmbeddedResource Include="Forms\frmFileFolderSearch.resx"> <EmbeddedResource Include="Forms\frmFileFolderSearch.resx">
<DependentUpon>frmFileFolderSearch.vb</DependentUpon> <DependentUpon>frmFileFolderSearch.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Forms\frmGameProcesses.resx">
<DependentUpon>frmGameProcesses.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\frmGameTags.resx"> <EmbeddedResource Include="Forms\frmGameTags.resx">
<DependentUpon>frmGameTags.vb</DependentUpon> <DependentUpon>frmGameTags.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Forms\frmIncludeExclude.resx"> <EmbeddedResource Include="Forms\frmIncludeExclude.resx">
<DependentUpon>frmIncludeExclude.vb</DependentUpon> <DependentUpon>frmIncludeExclude.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
<EmbeddedResource Include="Forms\frmProcessManager.resx">
<DependentUpon>frmProcessManager.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\frmSessionExport.resx">
<DependentUpon>frmSessionExport.vb</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Forms\frmSessions.resx"> <EmbeddedResource Include="Forms\frmSessions.resx">
<DependentUpon>frmSessions.vb</DependentUpon> <DependentUpon>frmSessions.vb</DependentUpon>
</EmbeddedResource> </EmbeddedResource>
@@ -355,6 +387,8 @@
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
<Content Include="References\Mono.Data.Sqlite.dll" /> <Content Include="References\Mono.Data.Sqlite.dll" />
<Content Include="Resources\New.png" />
<Content Include="Resources\Update.png" />
<Content Include="Utilities\x64\7za.exe"> <Content Include="Utilities\x64\7za.exe">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content> </Content>
+1 -1
View File
@@ -3,7 +3,7 @@
License for use and distribution License for use and distribution
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copyright (C) 1999-2016 Igor Pavlov. Copyright (C) 1999-2018 Igor Pavlov.
7-Zip Extra files are under the GNU LGPL license. 7-Zip Extra files are under the GNU LGPL license.
+8 -1
View File
@@ -1,5 +1,12 @@
Game Backup Monitor would like to credit the following people/organizations: Game Backup Monitor would like to credit the following people/organizations:
7-zip - Igor Pavlov Contributors:
Michael J. Seiferling (MikeMaximus) - Design, Programming and Windows Game Configuration Maintainer.
Sebastian Riedel (basxto) - Linux Packaging, Installation and Game Configuration Maintainer.
Special Thanks:
7-Zip - Igor Pavlov
Sixpack Status Icons - JankoAtWarpSpeed.com Sixpack Status Icons - JankoAtWarpSpeed.com
Primo Icon Set - webdesignerdepot.com Primo Icon Set - webdesignerdepot.com
+126 -34
View File
@@ -40,25 +40,25 @@ Public Class mgrBackup
Dim oItem As New clsBackup Dim oItem As New clsBackup
'Create manifest item 'Create manifest item
oItem.Name = oGameInfo.Name oItem.MonitorID = oGameInfo.ID
'Keep the path relative to the manifest location 'Keep the path relative to the manifest location
oItem.FileName = sBackupFile.Replace(Path.GetDirectoryName(mgrPath.RemoteDatabaseLocation) & Path.DirectorySeparatorChar, "") oItem.FileName = sBackupFile.Replace(Settings.BackupFolder & Path.DirectorySeparatorChar, String.Empty)
oItem.RestorePath = oGameInfo.TruePath
oItem.AbsolutePath = oGameInfo.AbsolutePath
oItem.DateUpdated = dTimeStamp oItem.DateUpdated = dTimeStamp
oItem.UpdatedBy = My.Computer.Name oItem.UpdatedBy = My.Computer.Name
oItem.CheckSum = sCheckSum oItem.CheckSum = sCheckSum
'Save Remote Manifest 'Save Remote Manifest
If mgrManifest.DoSpecificManifestCheck(oItem, mgrSQLite.Database.Remote) Then If Not oGameInfo.AppendTimeStamp Then
mgrManifest.DoManifestUpdateByID(oItem, mgrSQLite.Database.Remote) If Not mgrManifest.DoUpdateLatestManifest(oItem, mgrSQLite.Database.Remote) Then
mgrManifest.DoManifestAdd(oItem, mgrSQLite.Database.Remote)
End If
Else Else
mgrManifest.DoManifestAdd(oItem, mgrSQLite.Database.Remote) mgrManifest.DoManifestAdd(oItem, mgrSQLite.Database.Remote)
End If End If
'Save Local Manifest 'Save Local Manifest
If mgrManifest.DoGlobalManifestCheck(oItem.Name, mgrSQLite.Database.Local) Then If mgrManifest.DoManifestCheck(oItem.MonitorID, mgrSQLite.Database.Local) Then
mgrManifest.DoManifestUpdateByName(oItem, mgrSQLite.Database.Local) mgrManifest.DoManifestUpdateByMonitorID(oItem, mgrSQLite.Database.Local)
Else Else
mgrManifest.DoManifestAdd(oItem, mgrSQLite.Database.Local) mgrManifest.DoManifestAdd(oItem, mgrSQLite.Database.Local)
End If End If
@@ -101,20 +101,33 @@ Public Class mgrBackup
Return sSavePath Return sSavePath
End Function End Function
Private Function GetFileName(ByVal oGame As clsGame) As String
Dim sName As String
If oSettings.UseGameID Then
sName = oGame.ID
Else
sName = oGame.FileSafeName
End If
Return sName
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 sSavePath As String
Dim sOverwriteMessage As String
Dim lAvailableSpace As Long Dim lAvailableSpace As Long
Dim lFolderSize As Long Dim lFolderSize As Long
If oSettings.CreateSubFolder Then sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name If oSettings.CreateSubFolder Then sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame)
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name & ".7z" sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame) & ".7z"
'Verify saved game path 'Verify saved game path
sSavePath = VerifySavePath(oGame) sSavePath = VerifySavePath(oGame)
'Calculate space 'Calculate space
lAvailableSpace = mgrCommon.GetAvailableDiskSpace(sBackupFile) lAvailableSpace = mgrCommon.GetAvailableDiskSpace(oSettings.BackupFolder)
lFolderSize = mgrCommon.GetFolderSize(sSavePath, oGame.IncludeArray, oGame.ExcludeArray) lFolderSize = mgrCommon.GetFolderSize(sSavePath, oGame.IncludeArray, oGame.ExcludeArray)
'Show Available Space 'Show Available Space
@@ -130,25 +143,34 @@ Public Class mgrBackup
End If End If
End If End If
If mgrRestore.CheckManifest(oGame.Name) Then 'A manifest check is only required when "Save Multiple Backups" is disabled
If mgrCommon.ShowMessage(mgrBackup_ConfirmManifestConflict, oGame.Name, MsgBoxStyle.YesNo) = MsgBoxResult.No Then If Not oGame.AppendTimeStamp Then
RaiseEvent UpdateLog(mgrBackup_ErrorManifestConflict, False, ToolTipIcon.Error, True) If mgrRestore.CheckManifest(oGame.ID) Then
Return False If mgrCommon.ShowMessage(mgrBackup_ConfirmManifestConflict, oGame.Name, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
RaiseEvent UpdateLog(mgrBackup_ErrorManifestConflict, False, ToolTipIcon.Error, True)
Return False
End If
End If End If
End If End If
If oSettings.ShowOverwriteWarning And File.Exists(sBackupFile) And Not oGame.AppendTimeStamp Then If oSettings.ShowOverwriteWarning And File.Exists(sBackupFile) And Not oGame.AppendTimeStamp Then
If mgrCommon.ShowMessage(mgrBackup_ConfirmOverwrite, MsgBoxStyle.YesNo) = MsgBoxResult.No Then If oGame.AbsolutePath Then
sOverwriteMessage = mgrBackup_ConfirmOverwrite
Else
sOverwriteMessage = mgrBackup_ConfirmOverwriteRelative
End If
If mgrCommon.ShowMessage(sOverwriteMessage, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorOverwriteAbort, oGame.Name), False, ToolTipIcon.Error, True) RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorOverwriteAbort, oGame.Name), False, ToolTipIcon.Error, True)
Return False Return False
End If End If
End If End If
Return True Return True
End Function End Function
Private Sub CheckOldBackups(ByVal oGame As clsGame) Private Sub CheckOldBackups(ByVal oGame As clsGame)
Dim oGameBackups As List(Of clsBackup) = mgrManifest.DoManifestGetByName(oGame.Name, mgrSQLite.Database.Remote) Dim oGameBackups As List(Of clsBackup) = mgrManifest.DoManifestGetByMonitorID(oGame.ID, mgrSQLite.Database.Remote)
Dim oGameBackup As clsBackup Dim oGameBackup As clsBackup
Dim sOldBackup As String Dim sOldBackup As String
Dim iBackupCount As Integer = oGameBackups.Count Dim iBackupCount As Integer = oGameBackups.Count
@@ -164,8 +186,8 @@ Public Class mgrBackup
oGameBackup = oGameBackups(oGameBackups.Count - i) oGameBackup = oGameBackups(oGameBackups.Count - i)
sOldBackup = Settings.BackupFolder & Path.DirectorySeparatorChar & oGameBackup.FileName sOldBackup = Settings.BackupFolder & Path.DirectorySeparatorChar & oGameBackup.FileName
mgrManifest.DoManifestDeletebyID(oGameBackup, mgrSQLite.Database.Remote) mgrManifest.DoManifestDeleteByManifestID(oGameBackup, mgrSQLite.Database.Remote)
mgrManifest.DoManifestDeletebyID(oGameBackup, mgrSQLite.Database.Local) mgrManifest.DoManifestDeleteByManifestID(oGameBackup, mgrSQLite.Database.Local)
mgrCommon.DeleteFile(sOldBackup) mgrCommon.DeleteFile(sOldBackup)
mgrCommon.DeleteDirectoryByBackup(Settings.BackupFolder & Path.DirectorySeparatorChar, oGameBackup) mgrCommon.DeleteDirectoryByBackup(Settings.BackupFolder & Path.DirectorySeparatorChar, oGameBackup)
@@ -174,6 +196,83 @@ Public Class mgrBackup
End If End If
End Sub End Sub
Private Function BuildFileTimeStamp(ByVal dDate As Date) As String
Return " " & dDate.Month & "-" & dDate.Day & "-" & dDate.Year & "-" & dDate.Hour & "-" & dDate.Minute & "-" & dDate.Second
End Function
Private Function HandleSubFolder(ByVal oGame As clsGame, ByVal sPath As String) As Boolean
Try
If Not Directory.Exists(sPath) Then
Directory.CreateDirectory(sPath)
End If
Catch ex As Exception
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorSubFolderCreate, New String() {oGame.Name, ex.Message}), False, ToolTipIcon.Error, True)
Return False
End Try
Return True
End Function
Public Sub ImportBackupFiles(ByVal hshImportList As Hashtable)
Dim oGame As clsGame
Dim bOverwriteCurrent As Boolean = False
Dim bContinue As Boolean = True
Dim sFileToImport As String
Dim sBackupFile As String
Dim oBackup As clsBackup
For Each de As DictionaryEntry In hshImportList
sFileToImport = CStr(de.Key)
oGame = DirectCast(de.Value, clsGame)
'Enter overwite mode if we are importing a single backup and "Save Multiple Backups" is not enabled.
If hshImportList.Count = 1 And Not oGame.AppendTimeStamp Then bOverwriteCurrent = True
If File.Exists(sFileToImport) Then
sBackupFile = oSettings.BackupFolder
If oSettings.CreateSubFolder Then
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame)
bContinue = HandleSubFolder(oGame, sBackupFile)
End If
If bContinue Then
oBackup = New clsBackup
oBackup.MonitorID = oGame.ID
oBackup.DateUpdated = File.GetLastWriteTime(sFileToImport)
oBackup.UpdatedBy = mgrBackup_ImportedFile
If bOverwriteCurrent Then
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame) & ".7z"
Else
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame) & BuildFileTimeStamp(oBackup.DateUpdated) & ".7z"
End If
oBackup.FileName = sBackupFile.Replace(Settings.BackupFolder & Path.DirectorySeparatorChar, String.Empty)
If bOverwriteCurrent Then
If mgrCommon.CopyFile(sFileToImport, sBackupFile, True) Then
oBackup.CheckSum = mgrHash.Generate_SHA256_Hash(sBackupFile)
If Not mgrManifest.DoUpdateLatestManifest(oBackup, mgrSQLite.Database.Remote) Then
mgrManifest.DoManifestAdd(oBackup, mgrSQLite.Database.Remote)
End If
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ImportSuccess, New String() {sFileToImport, oGame.Name}), False, ToolTipIcon.Info, True)
Else
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorImportBackupCopy, sFileToImport), False, ToolTipIcon.Error, True)
End If
Else
If mgrCommon.CopyFile(sFileToImport, sBackupFile, False) Then
oBackup.CheckSum = mgrHash.Generate_SHA256_Hash(sBackupFile)
mgrManifest.DoManifestAdd(oBackup, mgrSQLite.Database.Remote)
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ImportSuccess, New String() {sFileToImport, oGame.Name}), False, ToolTipIcon.Info, True)
Else
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorImportBackupCopy, sFileToImport), False, ToolTipIcon.Error, True)
End If
End If
End If
End If
Next
End Sub
Public Sub DoBackup(ByVal oBackupList As List(Of clsGame)) Public Sub DoBackup(ByVal oBackupList As List(Of clsGame))
Dim oGame As clsGame Dim oGame As clsGame
Dim bDoBackup As Boolean Dim bDoBackup As Boolean
@@ -191,7 +290,7 @@ Public Class mgrBackup
sBackupFile = oSettings.BackupFolder sBackupFile = oSettings.BackupFolder
sSavePath = String.Empty sSavePath = String.Empty
dTimeStamp = Date.Now dTimeStamp = Date.Now
sTimeStamp = " " & dTimeStamp.Month & "-" & dTimeStamp.Day & "-" & dTimeStamp.Year & "-" & dTimeStamp.Hour & "-" & dTimeStamp.Minute & "-" & dTimeStamp.Second sTimeStamp = BuildFileTimeStamp(dTimeStamp)
sHash = String.Empty sHash = String.Empty
bDoBackup = True bDoBackup = True
bBackupCompleted = False bBackupCompleted = False
@@ -199,22 +298,15 @@ Public Class mgrBackup
RaiseEvent UpdateBackupInfo(oGame) RaiseEvent UpdateBackupInfo(oGame)
If oSettings.CreateSubFolder Then If oSettings.CreateSubFolder Then
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame)
Try bDoBackup = HandleSubFolder(oGame, sBackupFile)
If Not Directory.Exists(sBackupFile) Then
Directory.CreateDirectory(sBackupFile)
End If
Catch ex As Exception
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorSubFolderCreate, New String() {oGame.Name, ex.Message}), False, ToolTipIcon.Error, True)
bDoBackup = False
End Try
End If End If
If oGame.AppendTimeStamp Then If oGame.AppendTimeStamp Then
CheckOldBackups(oGame) If oGame.BackupLimit > 0 Then CheckOldBackups(oGame)
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name & sTimeStamp & ".7z" sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame) & sTimeStamp & ".7z"
Else Else
sBackupFile = sBackupFile & Path.DirectorySeparatorChar & oGame.Name & ".7z" sBackupFile = sBackupFile & Path.DirectorySeparatorChar & GetFileName(oGame) & ".7z"
End If End If
If bDoBackup Then If bDoBackup Then
+97 -33
View File
@@ -9,8 +9,8 @@ Imports System.Runtime.Serialization.Formatters.Binary
Public Class mgrCommon Public Class mgrCommon
'These need to be updated when upgrading the packaged 7z utility 'These need to be updated when upgrading the packaged 7z utility
Private Shared sUtility64Hash As String = "05ACEE3BAC0C6C4E396116EF27B953F992DE8D28DD14D317977F45692304C318" 'v16.02 7za.exe x64 Private Shared sUtility64Hash As String = "8BC2A3D6C37C4DB9BD487AD35039AE0DC8A1DDF2C3B1F0B76B3E678FEBB9F223" 'v18.05 7za.exe x64
Private Shared sUtility32Hash As String = "7AA7056DB4348229A288EEF49027B94C0D8D1A3C3AEDC6FA89B640334C7B37E9" 'v16.02 7za.exe x86 Private Shared sUtility32Hash As String = "77613CCA716EDF68B9D5BAB951463ED7FADE5BC0EC465B36190A76299C50F117" 'v18.05 7za.exe x86
Public Shared ReadOnly Property UtilityHash As String Public Shared ReadOnly Property UtilityHash As String
Get Get
@@ -65,9 +65,28 @@ Public Class mgrCommon
Return oFormatter.Deserialize(oStream) Return oFormatter.Deserialize(oStream)
End Function End Function
Public Shared Function CheckAddress(ByVal URL As String) As Boolean Public Shared Function SafeIconFromFile(ByVal sPath As String) As Image
Dim oImage As Image
Dim oReturnImage As Image
Dim oImageSize As Size = New Size(48, 48)
oImage = Image.FromFile(sPath)
oReturnImage = New Bitmap(oImage, oImageSize)
oImage.Dispose()
Return oReturnImage
End Function
Public Shared Function IsAddress(ByVal sURL As String) As Boolean
If (sURL.IndexOf("http://", 0, StringComparison.CurrentCultureIgnoreCase) > -1) Or (sURL.IndexOf("https://", 0, StringComparison.CurrentCultureIgnoreCase) > -1) Then
Return True
End If
Return False
End Function
Public Shared Function CheckAddress(ByVal sURL As String) As Boolean
Try Try
Dim request As WebRequest = WebRequest.Create(URL) Dim request As WebRequest = WebRequest.Create(sURL)
Dim response As WebResponse = request.GetResponse() Dim response As WebResponse = request.GetResponse()
response.Close() response.Close()
Catch ex As Exception Catch ex As Exception
@@ -125,9 +144,9 @@ Public Class mgrCommon
Return String.Empty Return String.Empty
End Function End Function
Public Shared Function OpenFileBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sExtension As String, ByVal sFileType As String, ByVal sDefaultFolder As String, Private Shared Function BuildFileBrowser(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 ByVal bMulti As Boolean, ByRef fbBrowser As OpenFileDialog, Optional ByVal bSavedPath As Boolean = True) As Boolean
Dim fbBrowser As New OpenFileDialog
Dim oSavedPath As New clsSavedPath Dim oSavedPath As New clsSavedPath
fbBrowser.Title = sTitle fbBrowser.Title = sTitle
@@ -152,21 +171,40 @@ Public Class mgrCommon
mgrSavedPath.AddUpdatePath(oSavedPath) mgrSavedPath.AddUpdatePath(oSavedPath)
End If End If
If bMulti Then Return True
Dim sFileNames As String = String.Empty End If
For Each sFileName As String In fbBrowser.FileNames
sFileNames &= sFileName & "|" Return False
Next End Function
sFileNames = sFileNames.TrimEnd("|")
Return sFileNames Public Shared Function OpenFileBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sExtension As String, ByVal sFileType As String, ByVal sDefaultFolder As String,
Else Optional ByVal bSavedPath As Boolean = True) As String
Return fbBrowser.FileName Dim fbBrowser As New OpenFileDialog
End If Dim bResult As Boolean
bResult = BuildFileBrowser(sName, sTitle, sExtension, sFileType, sDefaultFolder, False, fbBrowser, bSavedPath)
If bResult Then
Return fbBrowser.FileName
End If End If
Return String.Empty Return String.Empty
End Function End Function
Public Shared Function OpenMultiFileBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sExtension As String, ByVal sFileType As String, ByVal sDefaultFolder As String,
Optional ByVal bSavedPath As Boolean = True) As String()
Dim fbBrowser As New OpenFileDialog
Dim bResult As Boolean
bResult = BuildFileBrowser(sName, sTitle, sExtension, sFileType, sDefaultFolder, True, fbBrowser, bSavedPath)
If bResult Then
Return fbBrowser.FileNames
End If
Return New String() {}
End Function
Public Shared Function OpenFolderBrowser(ByVal sName As String, ByVal sTitle As String, ByVal sDefaultFolder As String, ByVal bEnableNewFolder As Boolean, 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 Optional ByVal bSavedPath As Boolean = True) As String
Dim fbBrowser As New FolderBrowserDialog Dim fbBrowser As New FolderBrowserDialog
@@ -202,16 +240,11 @@ Public Class mgrCommon
Dim sExemptList As String() = {"dosbox", "scummvm"} Dim sExemptList As String() = {"dosbox", "scummvm"}
Dim bFound As Boolean = False Dim bFound As Boolean = False
'We can't search if we don't have a configuration
If oGame.Temporary Then
Return True
End If
For Each s As String In sExemptList For Each s As String In sExemptList
If oGame.ProcessName.ToLower.Contains(s) Then bFound = True If oGame.ProcessName.ToLower.Contains(s) Then bFound = True
Next Next
If bFound Or oGame.Duplicate = True Then If bFound Then
Return True Return True
Else Else
Return False Return False
@@ -274,6 +307,16 @@ Public Class mgrCommon
Return False Return False
End Function End Function
Public Shared Function IsRegExValid(ByVal sPattern As String) As Boolean
Dim oRegEx As Regex
Try
oRegEx = New Regex(sPattern)
Return True
Catch ex As Exception
Return False
End Try
End Function
'Calculate the current size of a folder '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 Public Shared Function GetFolderSize(ByVal sPath As String, ByVal sInclude As String(), ByVal sExclude As String()) As Long
Dim oFolder As DirectoryInfo Dim oFolder As DirectoryInfo
@@ -391,6 +434,21 @@ Public Class mgrCommon
End If End If
End Function End Function
'Copy a file
Public Shared Function CopyFile(ByVal sSourcePath As String, ByVal sDestinationPath As String, ByVal bOverWrite As Boolean) As Boolean
Try
If File.Exists(sSourcePath) Then
File.Copy(sSourcePath, sDestinationPath, bOverWrite)
Else
Return False
End If
Catch
Return False
End Try
Return True
End Function
'Delete file based on OS type 'Delete file based on OS type
Public Shared Sub DeleteFile(ByVal sPath As String, Optional ByVal bRecycle As Boolean = True) Public Shared Sub DeleteFile(ByVal sPath As String, Optional ByVal bRecycle As Boolean = True)
If File.Exists(sPath) Then If File.Exists(sPath) Then
@@ -420,17 +478,24 @@ Public Class mgrCommon
'Delete a sub-folder based on the provided backup information 'Delete a sub-folder based on the provided backup information
Public Shared Sub DeleteDirectoryByBackup(ByVal sBackupFolder As String, ByVal oBackup As clsBackup) Public Shared Sub DeleteDirectoryByBackup(ByVal sBackupFolder As String, ByVal oBackup As clsBackup)
Dim oDir As DirectoryInfo Dim oDir As DirectoryInfo
Dim sDir As String = sBackupFolder & oBackup.Name Dim sDir As String = sBackupFolder & oBackup.MonitorID
'Check if the sub-folder is an ID or Name
If oBackup.FileName.StartsWith(oBackup.MonitorID & Path.DirectorySeparatorChar) Then
sDir = sBackupFolder & oBackup.MonitorID
ElseIf oBackup.FileName.StartsWith(oBackup.FileSafeName & Path.DirectorySeparatorChar) Then
sDir = sBackupFolder & oBackup.FileSafeName
Else
Exit Sub
End If
'Delete sub directory if it's empty 'Delete sub directory if it's empty
If oBackup.FileName.StartsWith(oBackup.Name & Path.DirectorySeparatorChar) Then If Directory.Exists(sDir) Then
If Directory.Exists(sDir) Then 'Check if there's any sub-directories or files remaining
'Check if there's any sub-directories or files remaining oDir = New DirectoryInfo(sDir)
oDir = New DirectoryInfo(sDir) If oDir.GetDirectories.Length = 0 And oDir.GetFiles.Length = 0 Then
If oDir.GetDirectories.Length = 0 And oDir.GetFiles.Length = 0 Then 'Folder is empty, delete the empty sub-folder
'Folder is empty, delete the empty sub-folder If Directory.Exists(sDir) Then DeleteDirectory(sDir)
If Directory.Exists(sDir) Then DeleteDirectory(sDir)
End If
End If End If
End If End If
End Sub End Sub
@@ -478,7 +543,6 @@ Public Class mgrCommon
Return sString Return sString
End Function End Function
'Handles single parameter stings 'Handles single parameter stings
Public Shared Function FormatString(ByVal sString As String, ByVal sParam As String) As String Public Shared Function FormatString(ByVal sString As String, ByVal sParam As String) As String
sString = sString.Replace("[BR]", vbCrLf) sString = sString.Replace("[BR]", vbCrLf)
+163
View File
@@ -0,0 +1,163 @@
Public Class mgrGameProcesses
Public Shared Sub DoGameProcessAdd(ByVal oGameProcess As clsGameProcess)
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim hshParams As New Hashtable
sSQL = "INSERT INTO gameprocesses VALUES (@ProcessID, @MonitorID)"
hshParams.Add("ProcessID", oGameProcess.ProcessID)
hshParams.Add("MonitorID", oGameProcess.MonitorID)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
Public Shared Sub DoGameProcessAddBatch(ByVal oGameProcesss As List(Of clsGameProcess))
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim hshParams As Hashtable
Dim oParamList As New List(Of Hashtable)
sSQL = "INSERT INTO gameprocesses VALUES (@ProcessID, @MonitorID);"
For Each oGameProcess As clsGameProcess In oGameProcesss
hshParams = New Hashtable
hshParams.Add("ProcessID", oGameProcess.ProcessID)
hshParams.Add("MonitorID", oGameProcess.MonitorID)
oParamList.Add(hshParams)
Next
oDatabase.RunMassParamQuery(sSQL, oParamList)
End Sub
Public Shared Sub DoGameProcessDelete(ByVal oGameProcesss As List(Of clsGameProcess))
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim hshParams As Hashtable
Dim oParamList As New List(Of Hashtable)
sSQL = "DELETE FROM gameprocesses "
sSQL &= "WHERE ProcessID = @ProcessID AND MonitorID = @MonitorID;"
For Each oGameProcess As clsGameProcess In oGameProcesss
hshParams = New Hashtable
hshParams.Add("ProcessID", oGameProcess.ProcessID)
hshParams.Add("MonitorID", oGameProcess.MonitorID)
oParamList.Add(hshParams)
Next
oDatabase.RunMassParamQuery(sSQL, oParamList)
End Sub
Public Shared Sub DoGameProcessDeleteByGame(ByVal sMonitorID As String)
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim hshParams As New Hashtable
sSQL = "DELETE FROM gameprocesses "
sSQL &= "WHERE MonitorID = @ID;"
hshParams.Add("ID", sMonitorID)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
Public Shared Sub DoGameProcessDeleteByProcess(ByVal sProcessID As String)
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim hshParams As New Hashtable
sSQL = "DELETE FROM gameprocesses "
sSQL &= "WHERE ProcessID = @ID;"
hshParams.Add("ID", sProcessID)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
Public Shared Function GetProcessesByGame(ByVal sMonitorID As String) As Hashtable
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim oData As DataSet
Dim sSQL As String
Dim hshList As New Hashtable
Dim hshParams As New Hashtable
Dim oProcess As clsProcess
sSQL = "SELECT ProcessID, processes.Name, processes.Path, processes.Args, processes.Kill FROM gameprocesses NATURAL JOIN processes WHERE MonitorID = @ID"
hshParams.Add("ID", sMonitorID)
oData = oDatabase.ReadParamData(sSQL, hshParams)
For Each dr As DataRow In oData.Tables(0).Rows
oProcess = New clsProcess
oProcess.ID = CStr(dr("ProcessID"))
oProcess.Name = CStr(dr("Name"))
oProcess.Path = CStr(dr("Path"))
If Not IsDBNull(dr("Args")) Then oProcess.Args = CStr(dr("Args"))
oProcess.Kill = CBool(dr("Kill"))
hshList.Add(oProcess.ID, oProcess)
Next
Return hshList
End Function
Public Shared Function GetProcessesByGameMulti(ByVal sMonitorIDs As List(Of String)) As Hashtable
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim oData As DataSet
Dim sSQL As String
Dim hshList As New Hashtable
Dim hshParams As New Hashtable
Dim oProcess As clsProcess
Dim iCounter As Integer
sSQL = "SELECT DISTINCT ProcessID, processes.Name, processes.Path, processes.Args, processes.Kill FROM gameprocesses NATURAL JOIN processes 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 &= ")"
oData = oDatabase.ReadParamData(sSQL, hshParams)
For Each dr As DataRow In oData.Tables(0).Rows
oProcess = New clsProcess
oProcess.ID = CStr(dr("ProcessID"))
oProcess.Name = CStr(dr("Name"))
oProcess.Path = CStr(dr("Path"))
If Not IsDBNull(dr("Args")) Then oProcess.Args = CStr(dr("Args"))
oProcess.Kill = CBool(dr("Kill"))
hshList.Add(oProcess.ID, oProcess)
Next
Return hshList
End Function
Public Shared Function ReadGameProcesss() As Hashtable
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim oData As DataSet
Dim sSQL As String
Dim sCompoundKey As String
Dim hshList As New Hashtable
Dim oGameProcess As clsGameProcess
sSQL = "SELECT * from gameprocesses"
oData = oDatabase.ReadParamData(sSQL, New Hashtable)
For Each dr As DataRow In oData.Tables(0).Rows
oGameProcess = New clsGameProcess
oGameProcess.ProcessID = CStr(dr("ProcessID"))
oGameProcess.MonitorID = CStr(dr("MonitorID"))
sCompoundKey = oGameProcess.ProcessID & ":" & oGameProcess.MonitorID
hshList.Add(sCompoundKey, oGameProcess)
Next
Return hshList
End Function
End Class
+5 -5
View File
@@ -76,11 +76,11 @@
End Sub End Sub
Public Shared Function GetTagsByGame(ByVal sMonitorID As String) As Hashtable Public Shared Function GetTagsByGame(ByVal sMonitorID As String) As SortedList
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local) Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim oData As DataSet Dim oData As DataSet
Dim sSQL As String Dim sSQL As String
Dim hshList As New Hashtable Dim slList As New SortedList
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
Dim oTag As clsTag Dim oTag As clsTag
@@ -94,10 +94,10 @@
oTag = New clsTag oTag = New clsTag
oTag.ID = CStr(dr("TagID")) oTag.ID = CStr(dr("TagID"))
oTag.Name = CStr(dr("Name")) oTag.Name = CStr(dr("Name"))
hshList.Add(oTag.Name, oTag) slList.Add(oTag.Name, oTag)
Next Next
Return hshList Return slList
End Function End Function
Public Shared Function GetTagsByGameForExport(ByVal sMonitorID As String) As List(Of Tag) Public Shared Function GetTagsByGameForExport(ByVal sMonitorID As String) As List(Of Tag)
@@ -108,7 +108,7 @@
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
Dim oTag As Tag Dim oTag As Tag
sSQL = "SELECT TagID, tags.Name FROM gametags NATURAL JOIN tags WHERE MonitorID = @ID" sSQL = "SELECT TagID, tags.Name FROM gametags NATURAL JOIN tags WHERE MonitorID = @ID ORDER BY tags.Name ASC"
hshParams.Add("ID", sMonitorID) hshParams.Add("ID", sMonitorID)
+45 -71
View File
@@ -4,10 +4,11 @@
Dim oBackupItem As clsBackup Dim oBackupItem As clsBackup
oBackupItem = New clsBackup oBackupItem = New clsBackup
oBackupItem.ID = CStr(dr("ManifestID")) oBackupItem.ManifestID = CStr(dr("ManifestID"))
oBackupItem.MonitorID = CStr(dr("MonitorID"))
oBackupItem.Name = CStr(dr("Name")) oBackupItem.Name = CStr(dr("Name"))
oBackupItem.FileName = CStr(dr("FileName")) oBackupItem.FileName = CStr(dr("FileName"))
oBackupItem.RestorePath = CStr(dr("RestorePath")) oBackupItem.RestorePath = CStr(dr("Path"))
oBackupItem.AbsolutePath = CBool(dr("AbsolutePath")) oBackupItem.AbsolutePath = CBool(dr("AbsolutePath"))
oBackupItem.DateUpdated = mgrCommon.UnixToDate(dr("DateUpdated")) oBackupItem.DateUpdated = mgrCommon.UnixToDate(dr("DateUpdated"))
oBackupItem.UpdatedBy = CStr(dr("UpdatedBy")) oBackupItem.UpdatedBy = CStr(dr("UpdatedBy"))
@@ -19,11 +20,9 @@
Private Shared Function SetCoreParameters(ByVal oBackupItem As clsBackup) As Hashtable Private Shared Function SetCoreParameters(ByVal oBackupItem As clsBackup) As Hashtable
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
hshParams.Add("ID", oBackupItem.ID) hshParams.Add("ManifestID", oBackupItem.ManifestID)
hshParams.Add("Name", oBackupItem.Name) hshParams.Add("MonitorID", oBackupItem.MonitorID)
hshParams.Add("FileName", oBackupItem.FileName) hshParams.Add("FileName", oBackupItem.FileName)
hshParams.Add("Path", oBackupItem.TruePath)
hshParams.Add("AbsolutePath", oBackupItem.AbsolutePath)
hshParams.Add("DateUpdated", oBackupItem.DateUpdatedUnix) hshParams.Add("DateUpdated", oBackupItem.DateUpdatedUnix)
hshParams.Add("UpdatedBy", oBackupItem.UpdatedBy) hshParams.Add("UpdatedBy", oBackupItem.UpdatedBy)
hshParams.Add("CheckSum", oBackupItem.CheckSum) hshParams.Add("CheckSum", oBackupItem.CheckSum)
@@ -38,12 +37,12 @@
Dim oBackupItem As clsBackup Dim oBackupItem As clsBackup
Dim slList As New SortedList Dim slList As New SortedList
sSQL = "SELECT * from manifest ORDER BY Name Asc" sSQL = "SELECT * from manifest NATURAL JOIN monitorlist ORDER BY Name Asc"
oData = oDatabase.ReadParamData(sSQL, New Hashtable) oData = oDatabase.ReadParamData(sSQL, New Hashtable)
For Each dr As DataRow In oData.Tables(0).Rows For Each dr As DataRow In oData.Tables(0).Rows
oBackupItem = MapToObject(dr) oBackupItem = MapToObject(dr)
slList.Add(oBackupItem.ID, oBackupItem) slList.Add(oBackupItem.ManifestID, oBackupItem)
Next Next
Return slList Return slList
@@ -57,19 +56,19 @@
Dim oBackupItem As clsBackup Dim oBackupItem As clsBackup
Dim slList As New SortedList Dim slList As New SortedList
sSQL = "SELECT ManifestID, Name, FileName, RestorePath, AbsolutePath, Max(DateUpdated) As DateUpdated, UpdatedBy, CheckSum FROM manifest GROUP BY Name ORDER By Name ASC" sSQL = "SELECT ManifestID, MonitorID, Name, FileName, Path, AbsolutePath, Max(DateUpdated) As DateUpdated, UpdatedBy, CheckSum FROM manifest NATURAL JOIN monitorlist GROUP BY Name ORDER By Name ASC"
oData = oDatabase.ReadParamData(sSQL, New Hashtable) oData = oDatabase.ReadParamData(sSQL, New Hashtable)
For Each dr As DataRow In oData.Tables(0).Rows For Each dr As DataRow In oData.Tables(0).Rows
oBackupItem = MapToObject(dr) oBackupItem = MapToObject(dr)
slList.Add(oBackupItem.Name, oBackupItem) slList.Add(oBackupItem.MonitorID, oBackupItem)
Next Next
Return slList Return slList
End Function End Function
Public Shared Function DoManifestGetByName(ByVal sName As String, ByVal iSelectDB As mgrSQLite.Database) As List(Of clsBackup) Public Shared Function DoManifestGetByMonitorID(ByVal sMonitorID As String, ByVal iSelectDB As mgrSQLite.Database) As List(Of clsBackup)
Dim oDatabase As New mgrSQLite(iSelectDB) Dim oDatabase As New mgrSQLite(iSelectDB)
Dim oData As DataSet Dim oData As DataSet
Dim sSQL As String Dim sSQL As String
@@ -78,10 +77,10 @@
Dim oList As New List(Of clsBackup) Dim oList As New List(Of clsBackup)
sSQL = "SELECT * from manifest " sSQL = "SELECT * FROM manifest NATURAL JOIN monitorlist "
sSQL &= "WHERE Name = @Name ORDER BY DateUpdated Desc" sSQL &= "WHERE MonitorID = @MonitorID ORDER BY DateUpdated Desc"
hshParams.Add("Name", sName) hshParams.Add("MonitorID", sMonitorID)
oData = oDatabase.ReadParamData(sSQL, hshParams) oData = oDatabase.ReadParamData(sSQL, hshParams)
@@ -93,7 +92,7 @@
Return oList Return oList
End Function End Function
Public Shared Function DoManifestGetByID(ByVal sID As String, ByVal iSelectDB As mgrSQLite.Database) As clsBackup Public Shared Function DoManifestGetByManifestID(ByVal sManifestID As String, ByVal iSelectDB As mgrSQLite.Database) As clsBackup
Dim oDatabase As New mgrSQLite(iSelectDB) Dim oDatabase As New mgrSQLite(iSelectDB)
Dim oData As DataSet Dim oData As DataSet
Dim sSQL As String Dim sSQL As String
@@ -101,10 +100,10 @@
Dim oBackupItem As New clsBackup Dim oBackupItem As New clsBackup
Dim oList As New List(Of clsBackup) Dim oList As New List(Of clsBackup)
sSQL = "SELECT * from manifest " sSQL = "SELECT * FROM manifest NATURAL JOIN monitorlist "
sSQL &= "WHERE ManifestID = @ID ORDER BY DateUpdated Desc" sSQL &= "WHERE ManifestID = @ManifestID ORDER BY DateUpdated Desc"
hshParams.Add("ID", sID) hshParams.Add("ManifestID", sManifestID)
oData = oDatabase.ReadParamData(sSQL, hshParams) oData = oDatabase.ReadParamData(sSQL, hshParams)
@@ -115,25 +114,22 @@
Return oBackupItem Return oBackupItem
End Function End Function
'This should only be used to update specific entries in the remote manifest Public Shared Function DoUpdateLatestManifest(ByRef oItem As clsBackup, ByVal iSelectDB As mgrSQLite.Database) As Boolean
Public Shared Function DoSpecificManifestCheck(ByRef oItem As clsBackup, ByVal iSelectDB As mgrSQLite.Database) As Boolean
Dim oDatabase As New mgrSQLite(iSelectDB) Dim oDatabase As New mgrSQLite(iSelectDB)
Dim oData As DataSet Dim oData As Object
Dim sSQL As String Dim sSQL As String
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
sSQL = "SELECT * from manifest " sSQL = "SELECT ManifestID FROM manifest NATURAL JOIN monitorlist "
sSQL &= "WHERE Name = @Name AND FileName = @FileName" sSQL &= "WHERE MonitorID = @MonitorID ORDER BY DateUpdated DESC LIMIT 1"
hshParams.Add("Name", oItem.Name) hshParams.Add("MonitorID", oItem.MonitorID)
hshParams.Add("FileName", oItem.FileName)
oData = oDatabase.ReadParamData(sSQL, hshParams) oData = oDatabase.ReadSingleValue(sSQL, hshParams)
If oData.Tables(0).Rows.Count > 0 Then If Not oData Is Nothing Then
For Each dr As DataRow In oData.Tables(0).Rows oItem.ManifestID = CStr(oData)
oItem.ID = CStr(dr("ManifestID")) DoManifestUpdateByManifestID(oItem, mgrSQLite.Database.Remote)
Next
Return True Return True
Else Else
Return False Return False
@@ -141,38 +137,16 @@
End Function End Function
'This should only be used to update entries in the local manifest Public Shared Function DoManifestCheck(ByVal sMonitorID As String, ByVal iSelectDB As mgrSQLite.Database) As Boolean
Public Shared Function DoGlobalManifestCheck(ByVal sName As String, ByVal iSelectDB As mgrSQLite.Database) As Boolean
Dim oDatabase As New mgrSQLite(iSelectDB) Dim oDatabase As New mgrSQLite(iSelectDB)
Dim oData As DataSet Dim oData As DataSet
Dim sSQL As String Dim sSQL As String
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
sSQL = "SELECT * from manifest " sSQL = "SELECT * FROM manifest "
sSQL &= "WHERE Name = @Name" sSQL &= "WHERE MonitorID = @MonitorID"
hshParams.Add("Name", sName) hshParams.Add("MonitorID", sMonitorID)
oData = oDatabase.ReadParamData(sSQL, hshParams)
If oData.Tables(0).Rows.Count > 0 Then
Return True
Else
Return False
End If
End Function
Public Shared Function DoManifestNameCheck(ByVal sName As String, ByVal iSelectDB As mgrSQLite.Database) As Boolean
Dim oDatabase As New mgrSQLite(iSelectDB)
Dim oData As DataSet
Dim sSQL As String
Dim hshParams As New Hashtable
sSQL = "SELECT * from manifest "
sSQL &= "WHERE Name = @Name"
hshParams.Add("Name", sName)
oData = oDatabase.ReadParamData(sSQL, hshParams) oData = oDatabase.ReadParamData(sSQL, hshParams)
@@ -189,63 +163,63 @@
Dim sSQL As String Dim sSQL As String
Dim hshParams As Hashtable Dim hshParams As Hashtable
sSQL = "INSERT INTO manifest VALUES (@ID, @Name, @FileName, @Path, @AbsolutePath, @DateUpdated, @UpdatedBy, @CheckSum)" sSQL = "INSERT INTO manifest VALUES (@ManifestID, @MonitorID, @FileName, @DateUpdated, @UpdatedBy, @CheckSum)"
hshParams = SetCoreParameters(oBackupItem) hshParams = SetCoreParameters(oBackupItem)
oDatabase.RunParamQuery(sSQL, hshParams) oDatabase.RunParamQuery(sSQL, hshParams)
End Sub End Sub
Public Shared Sub DoManifestUpdateByName(ByVal oBackupItem As clsBackup, ByVal iSelectDB As mgrSQLite.Database) Public Shared Sub DoManifestUpdateByMonitorID(ByVal oBackupItem As clsBackup, ByVal iSelectDB As mgrSQLite.Database)
Dim oDatabase As New mgrSQLite(iSelectDB) Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String Dim sSQL As String
Dim hshParams As Hashtable Dim hshParams As Hashtable
sSQL = "UPDATE manifest SET Name = @Name, FileName = @FileName, RestorePath = @Path, AbsolutePath = @AbsolutePath, " sSQL = "UPDATE manifest SET MonitorID = @MonitorID, FileName = @FileName, DateUpdated = @DateUpdated, "
sSQL &= "DateUpdated = @DateUpdated, UpdatedBy = @UpdatedBy, CheckSum = @CheckSum WHERE Name = @QueryName" sSQL &= "UpdatedBy = @UpdatedBy, CheckSum = @CheckSum WHERE MonitorID = @QueryID"
hshParams = SetCoreParameters(oBackupItem) hshParams = SetCoreParameters(oBackupItem)
hshParams.Add("QueryName", oBackupItem.Name) hshParams.Add("QueryID", oBackupItem.MonitorID)
oDatabase.RunParamQuery(sSQL, hshParams) oDatabase.RunParamQuery(sSQL, hshParams)
End Sub End Sub
Public Shared Sub DoManifestUpdateByID(ByVal oBackupItem As clsBackup, ByVal iSelectDB As mgrSQLite.Database) Public Shared Sub DoManifestUpdateByManifestID(ByVal oBackupItem As clsBackup, ByVal iSelectDB As mgrSQLite.Database)
Dim oDatabase As New mgrSQLite(iSelectDB) Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String Dim sSQL As String
Dim hshParams As Hashtable Dim hshParams As Hashtable
sSQL = "UPDATE manifest SET Name = @Name, FileName = @FileName, RestorePath = @Path, AbsolutePath = @AbsolutePath, " sSQL = "UPDATE manifest SET MonitorID = @MonitorID, FileName = @FileName, DateUpdated = @DateUpdated, "
sSQL &= "DateUpdated = @DateUpdated, UpdatedBy = @UpdatedBy, CheckSum = @CheckSum WHERE ManifestID = @QueryID" sSQL &= "UpdatedBy = @UpdatedBy, CheckSum = @CheckSum WHERE ManifestID = @QueryID"
hshParams = SetCoreParameters(oBackupItem) hshParams = SetCoreParameters(oBackupItem)
hshParams.Add("QueryID", oBackupItem.ID) hshParams.Add("QueryID", oBackupItem.ManifestID)
oDatabase.RunParamQuery(sSQL, hshParams) oDatabase.RunParamQuery(sSQL, hshParams)
End Sub End Sub
Public Shared Sub DoManifestDeletebyName(ByVal oBackupItem As clsBackup, ByVal iSelectDB As mgrSQLite.Database) Public Shared Sub DoManifestDeleteByMonitorID(ByVal oBackupItem As clsBackup, ByVal iSelectDB As mgrSQLite.Database)
Dim oDatabase As New mgrSQLite(iSelectDB) Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String Dim sSQL As String
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
sSQL = "DELETE FROM manifest " sSQL = "DELETE FROM manifest "
sSQL &= "WHERE Name = @Name" sSQL &= "WHERE MonitorID = @MonitorID"
hshParams.Add("Name", oBackupItem.Name) hshParams.Add("MonitorID", oBackupItem.MonitorID)
oDatabase.RunParamQuery(sSQL, hshParams) oDatabase.RunParamQuery(sSQL, hshParams)
End Sub End Sub
Public Shared Sub DoManifestDeletebyID(ByVal oBackupItem As clsBackup, ByVal iSelectDB As mgrSQLite.Database) Public Shared Sub DoManifestDeleteByManifestID(ByVal oBackupItem As clsBackup, ByVal iSelectDB As mgrSQLite.Database)
Dim oDatabase As New mgrSQLite(iSelectDB) Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String Dim sSQL As String
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
sSQL = "DELETE FROM manifest " sSQL = "DELETE FROM manifest "
sSQL &= "WHERE ManifestID = @ID" sSQL &= "WHERE ManifestID = @ManifestID"
hshParams.Add("ID", oBackupItem.ID) hshParams.Add("ManifestID", oBackupItem.ManifestID)
oDatabase.RunParamQuery(sSQL, hshParams) oDatabase.RunParamQuery(sSQL, hshParams)
End Sub End Sub
+251 -109
View File
@@ -1,4 +1,5 @@
Imports GBM.My.Resources Imports GBM.My.Resources
Imports System.Text.RegularExpressions
Imports System.Collections.Specialized Imports System.Collections.Specialized
Imports System.IO Imports System.IO
@@ -34,6 +35,7 @@ Public Class mgrMonitorList
oGame.CleanFolder = CBool(dr("CleanFolder")) oGame.CleanFolder = CBool(dr("CleanFolder"))
If Not IsDBNull(dr("Parameter")) Then oGame.Parameter = CStr(dr("Parameter")) If Not IsDBNull(dr("Parameter")) Then oGame.Parameter = CStr(dr("Parameter"))
If Not IsDBNull(dr("Comments")) Then oGame.Comments = CStr(dr("Comments")) If Not IsDBNull(dr("Comments")) Then oGame.Comments = CStr(dr("Comments"))
oGame.IsRegEx = CBool(dr("IsRegEx"))
Return oGame Return oGame
End Function End Function
@@ -43,7 +45,7 @@ Public Class mgrMonitorList
hshParams.Add("ID", oGame.ID) hshParams.Add("ID", oGame.ID)
hshParams.Add("Name", oGame.Name) hshParams.Add("Name", oGame.Name)
hshParams.Add("Process", oGame.TrueProcess) hshParams.Add("Process", oGame.ProcessName)
hshParams.Add("Path", oGame.TruePath) hshParams.Add("Path", oGame.TruePath)
hshParams.Add("AbsolutePath", oGame.AbsolutePath) hshParams.Add("AbsolutePath", oGame.AbsolutePath)
hshParams.Add("FolderSave", oGame.FolderSave) hshParams.Add("FolderSave", oGame.FolderSave)
@@ -61,6 +63,7 @@ Public Class mgrMonitorList
hshParams.Add("CleanFolder", oGame.CleanFolder) hshParams.Add("CleanFolder", oGame.CleanFolder)
hshParams.Add("Parameter", oGame.Parameter) hshParams.Add("Parameter", oGame.Parameter)
hshParams.Add("Comments", oGame.Comments) hshParams.Add("Comments", oGame.Comments)
hshParams.Add("IsRegEx", oGame.IsRegEx)
Return hshParams Return hshParams
End Function End Function
@@ -73,22 +76,16 @@ Public Class mgrMonitorList
Dim hshDupeList As New Hashtable Dim hshDupeList As New Hashtable
Dim oGame As clsGame Dim oGame As clsGame
sSQL = "Select * from monitorlist ORDER BY Name Asc" sSQL = "SELECT * FROM monitorlist ORDER BY Name ASC"
oData = oDatabase.ReadParamData(sSQL, New Hashtable) oData = oDatabase.ReadParamData(sSQL, New Hashtable)
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)
Select Case eListType Select Case eListType
Case eListTypes.FullList Case eListTypes.FullList
'Don't wrap this, if it fails there's a problem with the database hshList.Add(oGame.ID, oGame)
hshList.Add(oGame.ProcessName & ":" & oGame.Name, oGame)
Case eListTypes.ScanList Case eListTypes.ScanList
If hshList.Contains(oGame.ProcessName) Then If oGame.Enabled Then hshList.Add(oGame.ID, oGame)
DirectCast(hshList.Item(oGame.ProcessName), clsGame).Duplicate = True
oGame.ProcessName = oGame.ProcessName & ":" & oGame.Name
oGame.Duplicate = True
End If
If oGame.Enabled Then hshList.Add(oGame.ProcessName, oGame)
End Select End Select
Next Next
@@ -101,7 +98,8 @@ Public Class mgrMonitorList
Dim hshParams As Hashtable Dim hshParams As Hashtable
sSQL = "INSERT INTO monitorlist VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, @TimeStamp, " sSQL = "INSERT INTO monitorlist VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, @TimeStamp, "
sSQL &= "@ExcludeList, @ProcessPath, @Icon, @Hours, @Version, @Company, @Enabled, @MonitorOnly, @BackupLimit, @CleanFolder, @Parameter, @Comments)" sSQL &= "@ExcludeList, @ProcessPath, @Icon, @Hours, @Version, @Company, @Enabled, @MonitorOnly, @BackupLimit, @CleanFolder, "
sSQL &= "@Parameter, @Comments, @IsRegEx)"
'Parameters 'Parameters
hshParams = SetCoreParameters(oGame) hshParams = SetCoreParameters(oGame)
@@ -110,20 +108,31 @@ Public Class mgrMonitorList
End Sub End Sub
Public Shared Sub DoListUpdate(ByVal oGame As clsGame, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) Public Shared Sub DoListUpdate(ByVal oGame As clsGame, Optional ByVal sQueryID As String = "", Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
Dim oDatabase As New mgrSQLite(iSelectDB) Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String Dim sSQL As String
Dim hshParams As Hashtable Dim hshParams As Hashtable
sSQL = "UPDATE monitorlist SET Name=@Name, Process=@Process, Path=@Path, AbsolutePath=@AbsolutePath, FolderSave=@FolderSave, " sSQL = "UPDATE monitorlist SET MonitorID=@ID, Name=@Name, Process=@Process, Path=@Path, AbsolutePath=@AbsolutePath, FolderSave=@FolderSave, "
sSQL &= "FileType=@FileType, TimeStamp=@TimeStamp, ExcludeList=@ExcludeList, ProcessPath=@ProcessPath, Icon=@Icon, " sSQL &= "FileType=@FileType, TimeStamp=@TimeStamp, ExcludeList=@ExcludeList, ProcessPath=@ProcessPath, Icon=@Icon, "
sSQL &= "Hours=@Hours, Version=@Version, Company=@Company, Enabled=@Enabled, MonitorOnly=@MonitorOnly, BackupLimit=@BackupLimit, CleanFolder=@CleanFolder, Parameter=@Parameter, Comments=@Comments WHERE MonitorID=@ID" sSQL &= "Hours=@Hours, Version=@Version, Company=@Company, Enabled=@Enabled, MonitorOnly=@MonitorOnly, BackupLimit=@BackupLimit, "
sSQL &= "CleanFolder=@CleanFolder, Parameter=@Parameter, Comments=@Comments, IsRegEx=@IsRegEx WHERE MonitorID=@QueryID;"
sSQL &= "UPDATE gametags SET MonitorID=@ID WHERE MonitorID=@QueryID;"
If iSelectDB = mgrSQLite.Database.Local Then
sSQL &= "UPDATE gameprocesses SET MonitorID=@ID WHERE MonitorID=@QueryID;"
sSQL &= "UPDATE sessions SET MonitorID=@ID WHERE MonitorID=@QueryID;"
End If
'Parameters 'Parameters
hshParams = SetCoreParameters(oGame) hshParams = SetCoreParameters(oGame)
If sQueryID <> String.Empty Then
hshParams.Add("QueryID", sQueryID)
Else
hshParams.Add("QueryID", oGame.ID)
End If
oDatabase.RunParamQuery(sSQL, hshParams) oDatabase.RunParamQuery(sSQL, hshParams)
End Sub End Sub
Public Shared Sub DoListUpdateMulti(ByVal sMonitorIDs As List(Of String), ByVal oGame As clsGame, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) Public Shared Sub DoListUpdateMulti(ByVal sMonitorIDs As List(Of String), ByVal oGame As clsGame, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local)
@@ -156,9 +165,13 @@ Public Class mgrMonitorList
Dim sSQL As String Dim sSQL As String
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
sSQL = "DELETE FROM gametags " sSQL = "DELETE FROM manifest "
sSQL &= "WHERE MonitorID = @MonitorID;"
sSQL &= "DELETE FROM gametags "
sSQL &= "WHERE MonitorID = @MonitorID;" sSQL &= "WHERE MonitorID = @MonitorID;"
If iSelectDB = mgrSQLite.Database.Local Then If iSelectDB = mgrSQLite.Database.Local Then
sSQL &= "DELETE FROM gameprocesses "
sSQL &= "WHERE MonitorID = @MonitorID;"
sSQL &= "DELETE FROM sessions " sSQL &= "DELETE FROM sessions "
sSQL &= "WHERE MonitorID = @MonitorID;" sSQL &= "WHERE MonitorID = @MonitorID;"
End If End If
@@ -177,7 +190,19 @@ Public Class mgrMonitorList
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
Dim iCounter As Integer Dim iCounter As Integer
sSQL = "DELETE FROM gametags " sSQL = "DELETE FROM manifest "
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 &= ");"
sSQL &= "DELETE FROM gametags "
sSQL &= "WHERE MonitorID IN (" sSQL &= "WHERE MonitorID IN ("
For Each s As String In sMonitorIDs For Each s As String In sMonitorIDs
@@ -190,6 +215,18 @@ Public Class mgrMonitorList
sSQL &= ");" sSQL &= ");"
If iSelectDB = mgrSQLite.Database.Local Then If iSelectDB = mgrSQLite.Database.Local Then
sSQL &= "DELETE FROM gameprocesses "
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 &= ");"
sSQL &= "DELETE FROM sessions " sSQL &= "DELETE FROM sessions "
sSQL &= "WHERE MonitorID IN (" sSQL &= "WHERE MonitorID IN ("
@@ -239,7 +276,7 @@ Public Class mgrMonitorList
Return oGame Return oGame
End Function End Function
Public Shared Function DoListGetbyName(ByVal sName As String, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As Hashtable Public Shared Function DoListGetbyMonitorID(ByVal sMonitorID As String, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local) As Hashtable
Dim oDatabase As New mgrSQLite(iSelectDB) Dim oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String Dim sSQL As String
Dim oData As DataSet Dim oData As DataSet
@@ -248,10 +285,10 @@ Public Class mgrMonitorList
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
Dim iCounter As Integer = 0 Dim iCounter As Integer = 0
sSQL = "SELECT * from monitorlist " sSQL = "SELECT * FROM monitorlist "
sSQL &= "WHERE Name = @Name" sSQL &= "WHERE MonitorID = @MonitorID"
hshParams.Add("Name", sName) hshParams.Add("MonitorID", sMonitorID)
oData = oDatabase.ReadParamData(sSQL, hshParams) oData = oDatabase.ReadParamData(sSQL, hshParams)
@@ -264,45 +301,19 @@ Public Class mgrMonitorList
Return hshGames Return hshGames
End Function End Function
Public Shared Function DoDuplicateListCheck(ByVal sName As String, ByVal sProcess As String, Optional ByVal iSelectDB As mgrSQLite.Database = mgrSQLite.Database.Local, Optional ByVal sExcludeID As String = "") As Boolean Public Shared Function DoDuplicateListCheck(ByVal sMonitorID 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 oDatabase As New mgrSQLite(iSelectDB)
Dim sSQL As String Dim sSQL As String
Dim oData As DataSet Dim oData As DataSet
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
sSQL = "SELECT * FROM monitorlist WHERE Name = @Name AND Process= @Process" sSQL = "SELECT * FROM monitorlist WHERE MonitorID = @MonitorID"
hshParams.Add("Name", sName) hshParams.Add("MonitorID", sMonitorID)
hshParams.Add("Process", sProcess)
If sExcludeID <> String.Empty Then If sExcludeID <> String.Empty Then
sSQL &= " AND MonitorID <> @MonitorID" sSQL &= " AND MonitorID <> @QueryID"
hshParams.Add("MonitorID", sExcludeID) hshParams.Add("QueryID", 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
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 End If
oData = oDatabase.ReadParamData(sSQL, hshParams) oData = oDatabase.ReadParamData(sSQL, hshParams)
@@ -328,8 +339,6 @@ Public Class mgrMonitorList
Dim sVersion As String Dim sVersion As String
Dim sCompany As String Dim sCompany As String
Dim sMonitorGame As String Dim sMonitorGame As String
Dim sTimeStamp As String
Dim sBackupLimit As String
'Setup SQL for optional fields 'Setup SQL for optional fields
If (eSyncFields And clsGame.eOptionalSyncFields.Company) = clsGame.eOptionalSyncFields.Company Then If (eSyncFields And clsGame.eOptionalSyncFields.Company) = clsGame.eOptionalSyncFields.Company Then
@@ -352,24 +361,17 @@ Public Class mgrMonitorList
Else Else
sMonitorGame = "COALESCE((SELECT Enabled FROM monitorlist WHERE MonitorID=@ID),1)" sMonitorGame = "COALESCE((SELECT Enabled FROM monitorlist WHERE MonitorID=@ID),1)"
End If End If
If (eSyncFields And clsGame.eOptionalSyncFields.TimeStamp) = clsGame.eOptionalSyncFields.TimeStamp Then
sTimeStamp = "@TimeStamp"
sBackupLimit = "@BackupLimit"
Else
sTimeStamp = "COALESCE((SELECT TimeStamp FROM monitorlist WHERE MonitorID=@ID),0)"
sBackupLimit = "COALESCE((SELECT BackupLimit FROM monitorlist WHERE MonitorID=@ID),2)"
End If
If (eSyncFields And clsGame.eOptionalSyncFields.Version) = clsGame.eOptionalSyncFields.Version Then If (eSyncFields And clsGame.eOptionalSyncFields.Version) = clsGame.eOptionalSyncFields.Version Then
sVersion = "@Version" sVersion = "@Version"
Else Else
sVersion = "(SELECT Version FROM monitorlist WHERE MonitorID=@ID)" sVersion = "(SELECT Version FROM monitorlist WHERE MonitorID=@ID)"
End If End If
sSQL = "INSERT OR REPLACE INTO monitorlist (MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter, Comments) " 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, IsRegEx) "
sSQL &= "VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, " sSQL &= "VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, "
sSQL &= sTimeStamp & ", @ExcludeList, " & sGamePath & ", " sSQL &= "@TimeStamp, @ExcludeList, " & sGamePath & ", "
sSQL &= sIcon & ", @Hours, " & sVersion & ", " sSQL &= sIcon & ", @Hours, " & sVersion & ", "
sSQL &= sCompany & ", " & sMonitorGame & ", @MonitorOnly, " & sBackupLimit & ", @CleanFolder, @Parameter, @Comments);" sSQL &= sCompany & ", " & sMonitorGame & ", @MonitorOnly, @BackupLimit, @CleanFolder, @Parameter, @Comments, @IsRegEx);"
For Each oGame As clsGame In hshGames.Values For Each oGame As clsGame In hshGames.Values
hshParams = New Hashtable hshParams = New Hashtable
@@ -377,10 +379,12 @@ Public Class mgrMonitorList
'Core Parameters 'Core Parameters
hshParams.Add("ID", oGame.ID) hshParams.Add("ID", oGame.ID)
hshParams.Add("Name", oGame.Name) hshParams.Add("Name", oGame.Name)
hshParams.Add("Process", oGame.TrueProcess) hshParams.Add("Process", oGame.ProcessName)
hshParams.Add("Path", oGame.TruePath) hshParams.Add("Path", oGame.TruePath)
hshParams.Add("AbsolutePath", oGame.AbsolutePath) hshParams.Add("AbsolutePath", oGame.AbsolutePath)
hshParams.Add("FolderSave", oGame.FolderSave) hshParams.Add("FolderSave", oGame.FolderSave)
hshParams.Add("TimeStamp", oGame.AppendTimeStamp)
hshParams.Add("BackupLimit", oGame.BackupLimit)
hshParams.Add("FileType", oGame.FileType) hshParams.Add("FileType", oGame.FileType)
hshParams.Add("ExcludeList", oGame.ExcludeList) hshParams.Add("ExcludeList", oGame.ExcludeList)
hshParams.Add("Hours", oGame.Hours) hshParams.Add("Hours", oGame.Hours)
@@ -388,6 +392,7 @@ Public Class mgrMonitorList
hshParams.Add("CleanFolder", oGame.CleanFolder) hshParams.Add("CleanFolder", oGame.CleanFolder)
hshParams.Add("Parameter", oGame.Parameter) hshParams.Add("Parameter", oGame.Parameter)
hshParams.Add("Comments", oGame.Comments) hshParams.Add("Comments", oGame.Comments)
hshParams.Add("IsRegEx", oGame.IsRegEx)
'Optional Parameters 'Optional Parameters
If (eSyncFields And clsGame.eOptionalSyncFields.Company) = clsGame.eOptionalSyncFields.Company Then If (eSyncFields And clsGame.eOptionalSyncFields.Company) = clsGame.eOptionalSyncFields.Company Then
@@ -402,10 +407,6 @@ Public Class mgrMonitorList
If (eSyncFields And clsGame.eOptionalSyncFields.MonitorGame) = clsGame.eOptionalSyncFields.MonitorGame Then If (eSyncFields And clsGame.eOptionalSyncFields.MonitorGame) = clsGame.eOptionalSyncFields.MonitorGame Then
hshParams.Add("Enabled", oGame.Enabled) hshParams.Add("Enabled", oGame.Enabled)
End If End If
If (eSyncFields And clsGame.eOptionalSyncFields.TimeStamp) = clsGame.eOptionalSyncFields.TimeStamp Then
hshParams.Add("TimeStamp", oGame.AppendTimeStamp)
hshParams.Add("BackupLimit", oGame.BackupLimit)
End If
If (eSyncFields And clsGame.eOptionalSyncFields.Version) = clsGame.eOptionalSyncFields.Version Then If (eSyncFields And clsGame.eOptionalSyncFields.Version) = clsGame.eOptionalSyncFields.Version Then
hshParams.Add("Version", oGame.Version) hshParams.Add("Version", oGame.Version)
End If End If
@@ -423,27 +424,29 @@ Public Class mgrMonitorList
Dim hshParams As Hashtable Dim hshParams As Hashtable
Dim oParamList As New List(Of Hashtable) Dim oParamList As New List(Of Hashtable)
sSQL = "DELETE FROM gametags " sSQL = "DELETE FROM manifest "
sSQL &= "WHERE MonitorID = @MonitorID;"
sSQL &= "DELETE FROM gametags "
sSQL &= "WHERE MonitorID = @MonitorID;" sSQL &= "WHERE MonitorID = @MonitorID;"
If iSelectDB = mgrSQLite.Database.Local Then If iSelectDB = mgrSQLite.Database.Local Then
sSQL &= "DELETE FROM gameprocesses "
sSQL &= "WHERE MonitorID = @MonitorID;"
sSQL &= "DELETE FROM sessions " sSQL &= "DELETE FROM sessions "
sSQL &= "WHERE MonitorID = @MonitorID;" sSQL &= "WHERE MonitorID = @MonitorID;"
End If End If
sSQL &= "DELETE FROM monitorlist " sSQL &= "DELETE FROM monitorlist "
sSQL &= "WHERE Name = @Name AND Process= @Process;" sSQL &= "WHERE MonitorID = @MonitorID;"
For Each oGame As clsGame In hshGames.Values For Each oGame As clsGame In hshGames.Values
hshParams = New Hashtable hshParams = New Hashtable
hshParams.Add("MonitorID", oGame.ID) hshParams.Add("MonitorID", oGame.ID)
hshParams.Add("Name", oGame.Name)
hshParams.Add("Process", oGame.TrueProcess)
oParamList.Add(hshParams) oParamList.Add(hshParams)
Next Next
oDatabase.RunMassParamQuery(sSQL, oParamList) oDatabase.RunMassParamQuery(sSQL, oParamList)
End Sub End Sub
Public Shared Sub SyncMonitorLists(ByVal eSyncFields As clsGame.eOptionalSyncFields, Optional ByVal bToRemote As Boolean = True) Public Shared Sub SyncMonitorLists(ByVal oSettings As mgrSettings, Optional ByVal bToRemote As Boolean = True, Optional ByVal bSyncProtection As Boolean = True)
Dim hshCompareFrom As Hashtable Dim hshCompareFrom As Hashtable
Dim hshCompareTo As Hashtable Dim hshCompareTo As Hashtable
Dim hshSyncItems As Hashtable Dim hshSyncItems As Hashtable
@@ -454,10 +457,12 @@ Public Class mgrMonitorList
Cursor.Current = Cursors.WaitCursor Cursor.Current = Cursors.WaitCursor
If bToRemote Then If Not oSettings.DisableSyncMessages Then
RaiseEvent UpdateLog(mgrMonitorList_SyncToMaster, False, ToolTipIcon.Info, True) If bToRemote Then
Else RaiseEvent UpdateLog(mgrMonitorList_SyncToMaster, False, ToolTipIcon.Info, True)
RaiseEvent UpdateLog(mgrMonitorList_SyncFromMaster, False, ToolTipIcon.Info, True) Else
RaiseEvent UpdateLog(mgrMonitorList_SyncFromMaster, False, ToolTipIcon.Info, True)
End If
End If End If
'Add / Update Sync 'Add / Update Sync
@@ -469,21 +474,34 @@ Public Class mgrMonitorList
hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Local) hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Local)
End If End If
'Sync Wipe Protection
If bSyncProtection Then
If hshCompareFrom.Count = 0 And hshCompareTo.Count > 0 Then
Cursor.Current = Cursors.Default
If mgrCommon.ShowMessage(mgrMonitorList_WarningSyncProtection, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
'We will always show this one in the log regardless of setting
RaiseEvent UpdateLog(mgrMonitorList_ErrorSyncCancel, False, ToolTipIcon.Warning, True)
Exit Sub
End If
Cursor.Current = Cursors.WaitCursor
End If
End If
hshSyncItems = hshCompareFrom.Clone hshSyncItems = hshCompareFrom.Clone
For Each oFromItem In hshCompareFrom.Values For Each oFromItem In hshCompareFrom.Values
If hshCompareTo.Contains(oFromItem.CompoundKey) Then If hshCompareTo.Contains(oFromItem.ID) Then
oToItem = DirectCast(hshCompareTo(oFromItem.CompoundKey), clsGame) oToItem = DirectCast(hshCompareTo(oFromItem.ID), clsGame)
If oFromItem.SyncEquals(oToItem, eSyncFields) Then If oFromItem.SyncEquals(oToItem, oSettings.SyncFields) Then
hshSyncItems.Remove(oFromItem.CompoundKey) hshSyncItems.Remove(oFromItem.ID)
End If End If
End If End If
Next Next
If bToRemote Then If bToRemote Then
DoListAddUpdateSync(hshSyncItems, mgrSQLite.Database.Remote, eSyncFields) DoListAddUpdateSync(hshSyncItems, mgrSQLite.Database.Remote, oSettings.SyncFields)
Else Else
DoListAddUpdateSync(hshSyncItems, mgrSQLite.Database.Local, eSyncFields) DoListAddUpdateSync(hshSyncItems, mgrSQLite.Database.Local, oSettings.SyncFields)
End If End If
'Sync Tags 'Sync Tags
@@ -502,10 +520,10 @@ Public Class mgrMonitorList
hshDeleteItems = hshCompareTo.Clone hshDeleteItems = hshCompareTo.Clone
For Each oToItem In hshCompareTo.Values For Each oToItem In hshCompareTo.Values
If hshCompareFrom.Contains(oToItem.CompoundKey) Then If hshCompareFrom.Contains(oToItem.ID) Then
oFromItem = DirectCast(hshCompareFrom(oToItem.CompoundKey), clsGame) oFromItem = DirectCast(hshCompareFrom(oToItem.ID), clsGame)
If oToItem.MinimalEquals(oFromItem) Then If oToItem.MinimalEquals(oFromItem) Then
hshDeleteItems.Remove(oToItem.CompoundKey) hshDeleteItems.Remove(oToItem.ID)
End If End If
End If End If
Next Next
@@ -516,7 +534,10 @@ Public Class mgrMonitorList
DoListDeleteSync(hshDeleteItems, mgrSQLite.Database.Local) DoListDeleteSync(hshDeleteItems, mgrSQLite.Database.Local)
End If End If
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrMonitorList_SyncChanges, (hshDeleteItems.Count + hshSyncItems.Count + iChanges).ToString), False, ToolTipIcon.Info, True) If Not oSettings.DisableSyncMessages Then
RaiseEvent UpdateLog(mgrCommon.FormatString(mgrMonitorList_SyncChanges, (hshDeleteItems.Count + hshSyncItems.Count + iChanges).ToString), False, ToolTipIcon.Info, True)
End If
Cursor.Current = Cursors.Default Cursor.Current = Cursors.Default
Application.DoEvents() Application.DoEvents()
End Sub End Sub
@@ -527,7 +548,7 @@ Public Class mgrMonitorList
ByRef hshParams As Hashtable) 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 sBaseSelect As String = "MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter, Comments, IsRegEx FROM monitorlist"
Dim sSort As String = " ORDER BY " & sSortField Dim sSort As String = " ORDER BY " & sSortField
If bSortAsc Then If bSortAsc Then
@@ -700,7 +721,6 @@ Public Class mgrMonitorList
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 sID As String
Dim oList As New List(Of Game) Dim oList As New List(Of Game)
Dim oGame As Game Dim oGame As Game
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
@@ -711,29 +731,70 @@ Public Class mgrMonitorList
For Each dr As DataRow In oData.Tables(0).Rows For Each dr As DataRow In oData.Tables(0).Rows
oGame = New Game oGame = New Game
sID = CStr(dr("MonitorID")) oGame.ID = CStr(dr("MonitorID"))
oGame.Name = CStr(dr("Name")) oGame.Name = CStr(dr("Name"))
oGame.ProcessName = CStr(dr("Process")) oGame.ProcessName = CStr(dr("Process"))
If Not IsDBNull(dr("Path")) Then oGame.Path = CStr(dr("Path")) If Not IsDBNull(dr("Path")) Then oGame.Path = CStr(dr("Path"))
oGame.AbsolutePath = CBool(dr("AbsolutePath")) oGame.AbsolutePath = CBool(dr("AbsolutePath"))
oGame.FolderSave = CBool(dr("FolderSave")) oGame.FolderSave = CBool(dr("FolderSave"))
oGame.AppendTimeStamp = CBool(dr("TimeStamp"))
oGame.BackupLimit = CInt(dr("BackupLimit"))
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")) oGame.MonitorOnly = CBool(dr("MonitorOnly"))
If Not IsDBNull(dr("Parameter")) Then oGame.Parameter = CStr(dr("Parameter")) If Not IsDBNull(dr("Parameter")) Then oGame.Parameter = CStr(dr("Parameter"))
If Not IsDBNull(dr("Comments")) Then oGame.Comments = CStr(dr("Comments")) If Not IsDBNull(dr("Comments")) Then oGame.Comments = CStr(dr("Comments"))
oGame.Tags = mgrGameTags.GetTagsByGameForExport(sID) oGame.IsRegEx = CBool(dr("IsRegEx"))
oGame.Tags = mgrGameTags.GetTagsByGameForExport(oGame.ID)
oList.Add(oGame) oList.Add(oGame)
Next Next
Return oList Return oList
End Function End Function
Public Shared Function DoImport(ByVal sPath As String) As Boolean Public Shared Function SyncGameIDs(ByVal sPath As String, ByRef oSettings As mgrSettings, ByVal bOfficial As Boolean) As Boolean
If (sPath.IndexOf("http://", 0, StringComparison.CurrentCultureIgnoreCase) > -1) Or Dim sWarning As String
(sPath.IndexOf("https://", 0, StringComparison.CurrentCultureIgnoreCase) > -1) Then
If bOfficial Then
If (oSettings.SuppressMessages And mgrSettings.eSuppressMessages.GameIDSync) = mgrSettings.eSuppressMessages.GameIDSync Then
sWarning = mgrMonitorList_ConfirmOfficialGameIDSync
Else
sWarning = mgrMonitorList_ConfirmInitialOfficialGameIDSync
oSettings.SuppressMessages = oSettings.SetMessageField(oSettings.SuppressMessages, mgrSettings.eSuppressMessages.GameIDSync)
oSettings.SaveSettings()
End If
Else
sWarning = mgrMonitorList_ConfirmFileGameIDSync
End If
If mgrCommon.ShowMessage(sWarning, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
If mgrCommon.IsAddress(sPath) Then
If mgrCommon.CheckAddress(sPath) Then
DoGameIDSync(sPath, True)
Else
mgrCommon.ShowMessage(mgrMonitorList_WebNoReponse, sPath, MsgBoxStyle.Exclamation)
Return False
End If
Else
If File.Exists(sPath) Then
DoGameIDSync(sPath)
Else
mgrCommon.ShowMessage(mgrMonitorList_FileNotFound, sPath, MsgBoxStyle.Exclamation)
Return False
End If
End If
End If
Return True
End Function
Public Shared Function DoImport(ByVal sPath As String, ByVal bOfficial As Boolean, ByRef oSettings As mgrSettings, Optional ByVal bStartUpWizard As Boolean = False, Optional ByVal bWinConfigsInLinux As Boolean = False) As Boolean
If mgrCommon.IsAddress(sPath) Then
If mgrCommon.CheckAddress(sPath) Then If mgrCommon.CheckAddress(sPath) Then
ImportMonitorList(sPath, True) If bOfficial And Not bStartUpWizard And Not ((oSettings.SuppressMessages And mgrSettings.eSuppressMessages.GameIDSync) = mgrSettings.eSuppressMessages.GameIDSync) Then
SyncGameIDs(sPath, oSettings, True)
End If
ImportMonitorList(sPath, True, bWinConfigsInLinux)
Return True Return True
Else Else
mgrCommon.ShowMessage(mgrMonitorList_WebNoReponse, sPath, MsgBoxStyle.Exclamation) mgrCommon.ShowMessage(mgrMonitorList_WebNoReponse, sPath, MsgBoxStyle.Exclamation)
@@ -741,7 +802,7 @@ Public Class mgrMonitorList
End If End If
Else Else
If File.Exists(sPath) Then If File.Exists(sPath) Then
ImportMonitorList(sPath) ImportMonitorList(sPath,, bWinConfigsInLinux)
Return True Return True
Else Else
mgrCommon.ShowMessage(mgrMonitorList_FileNotFound, sPath, MsgBoxStyle.Exclamation) mgrCommon.ShowMessage(mgrMonitorList_FileNotFound, sPath, MsgBoxStyle.Exclamation)
@@ -751,8 +812,8 @@ Public Class mgrMonitorList
Return True Return True
End Function End Function
Private Shared Sub ImportMonitorList(ByVal sLocation As String, Optional ByVal bWebRead As Boolean = False) Private Shared Sub ImportMonitorList(ByVal sLocation As String, Optional ByVal bWebRead As Boolean = False, Optional ByVal bWinConfigsInLinux As Boolean = False)
Dim hshCompareFrom As Hashtable Dim hshCompareFrom As New Hashtable
Dim hshCompareTo As Hashtable Dim hshCompareTo As Hashtable
Dim hshSyncItems As Hashtable Dim hshSyncItems As Hashtable
Dim oFromItem As clsGame Dim oFromItem As clsGame
@@ -761,17 +822,33 @@ Public Class mgrMonitorList
Cursor.Current = Cursors.WaitCursor Cursor.Current = Cursors.WaitCursor
'Add / Update Sync If Not mgrXML.ReadMonitorList(sLocation, oExportInfo, hshCompareFrom, bWebRead) Then
hshCompareFrom = mgrXML.ReadMonitorList(sLocation, oExportInfo, bWebRead) Exit Sub
End If
If oExportInfo.AppVer < 115 Then
If mgrCommon.ShowMessage(mgrMonitorList_ImportVersionWarning, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
Exit Sub
End If
End If
hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Local) hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Local)
hshSyncItems = hshCompareFrom.Clone hshSyncItems = hshCompareFrom.Clone
For Each oFromItem In hshCompareFrom.Values For Each oFromItem In hshCompareFrom.Values
If hshCompareTo.Contains(oFromItem.CompoundKey) Then If hshCompareTo.Contains(oFromItem.ID) Then
oToItem = DirectCast(hshCompareTo(oFromItem.CompoundKey), clsGame) oToItem = DirectCast(hshCompareTo(oFromItem.ID), clsGame)
If oFromItem.CoreEquals(oToItem) Then If oFromItem.MinimalEquals(oToItem) Then
hshSyncItems.Remove(oFromItem.CompoundKey) If oFromItem.CoreEquals(oToItem) Then
hshSyncItems.Remove(oFromItem.ID)
Else
DirectCast(hshSyncItems(oFromItem.ID), clsGame).ImportUpdate = True
'These fields need to be set via the object or they will be lost when the configuration is updated
DirectCast(hshSyncItems(oFromItem.ID), clsGame).Hours = oToItem.Hours
DirectCast(hshSyncItems(oFromItem.ID), clsGame).CleanFolder = oToItem.CleanFolder
End If
End If End If
End If End If
Next Next
@@ -782,6 +859,7 @@ Public Class mgrMonitorList
Dim frm As New frmAdvancedImport Dim frm As New frmAdvancedImport
frm.ImportInfo = oExportInfo frm.ImportInfo = oExportInfo
frm.ImportData = hshSyncItems frm.ImportData = hshSyncItems
frm.ModWinConfigsForLinux = bWinConfigsInLinux
If frm.ShowDialog() = DialogResult.OK Then If frm.ShowDialog() = DialogResult.OK Then
Cursor.Current = Cursors.WaitCursor Cursor.Current = Cursors.WaitCursor
@@ -798,6 +876,70 @@ Public Class mgrMonitorList
Application.DoEvents() Application.DoEvents()
End Sub End Sub
Private Shared Sub DoGameIDSync(ByVal sLocation As String, Optional ByVal bWebRead As Boolean = False)
Dim oLocalDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim oRemoteDatabase As New mgrSQLite(mgrSQLite.Database.Remote)
Dim sSQL As String
Dim hshParams As Hashtable
Dim oParamList As New List(Of Hashtable)
Dim hshCompareFrom As New Hashtable
Dim hshCompareTo As Hashtable
Dim hshSyncIDs As New Hashtable
Dim oFromItem As clsGame
Dim oToItem As clsGame
Dim oExportInfo As New ExportData
Cursor.Current = Cursors.WaitCursor
If Not mgrXML.ReadMonitorList(sLocation, oExportInfo, hshCompareFrom, bWebRead) Then
Exit Sub
End If
If oExportInfo.AppVer < 110 Then
mgrCommon.ShowMessage(mgrMonitorList_ErrorGameIDVerFailure, MsgBoxStyle.Exclamation)
Exit Sub
End If
hshCompareTo = ReadList(eListTypes.FullList, mgrSQLite.Database.Local)
For Each oFromItem In hshCompareFrom.Values
If Not hshCompareTo.Contains(oFromItem.ID) Then
For Each oToItem In hshCompareTo.Values
'Strip all special characters and compare names
If Regex.Replace(oToItem.Name, "[^\w]+", "").ToLower = Regex.Replace(oFromItem.Name, "[^\w]+", "").ToLower Then
'Ignore games with duplicate names
If Not hshSyncIDs.Contains(oFromItem.ID) Then
hshSyncIDs.Add(oFromItem.ID, oToItem.ID)
End If
End If
Next
End If
Next
For Each de As DictionaryEntry In hshSyncIDs
hshParams = New Hashtable
hshParams.Add("MonitorID", CStr(de.Key))
hshParams.Add("QueryID", CStr(de.Value))
oParamList.Add(hshParams)
Next
sSQL = "UPDATE monitorlist SET MonitorID=@MonitorID WHERE MonitorID=@QueryID;"
sSQL &= "UPDATE gametags SET MonitorID=@MonitorID WHERE MonitorID=@QueryID;"
sSQL &= "UPDATE manifest SET MonitorID=@MonitorID WHERE MonitorID=@QueryID;"
oRemoteDatabase.RunMassParamQuery(sSQL, oParamList)
sSQL &= "UPDATE sessions SET MonitorID=@MonitorID WHERE MonitorID=@QueryID;"
sSQL &= "UPDATE gameprocesses SET MonitorID=@MonitorID WHERE MonitorID=@QueryID;"
oLocalDatabase.RunMassParamQuery(sSQL, oParamList)
Cursor.Current = Cursors.Default
mgrCommon.ShowMessage(mgrMonitorList_GameIDSyncCompleted, hshSyncIDs.Count.ToString, MsgBoxStyle.Information)
End Sub
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
@@ -846,15 +988,15 @@ Public Class mgrMonitorList
'If the remote database actually contains a list, then ask what to do 'If the remote database actually contains a list, then ask what to do
If iGameCount > 0 Then If iGameCount > 0 Then
If mgrCommon.ShowMessage(mgrMonitorList_ConfirmExistingData, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then If mgrCommon.ShowMessage(mgrMonitorList_ConfirmExistingData, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
mgrMonitorList.SyncMonitorLists(oSettings.SyncFields) mgrMonitorList.SyncMonitorLists(oSettings)
Else Else
mgrMonitorList.SyncMonitorLists(oSettings.SyncFields, False) mgrMonitorList.SyncMonitorLists(oSettings, False)
End If End If
Else Else
mgrMonitorList.SyncMonitorLists(oSettings.SyncFields) mgrMonitorList.SyncMonitorLists(oSettings)
End If End If
Else Else
mgrMonitorList.SyncMonitorLists(oSettings.SyncFields) mgrMonitorList.SyncMonitorLists(oSettings)
End If End If
End Sub End Sub
End Class End Class
+261 -57
View File
@@ -15,7 +15,8 @@ Public Class mgrPath
Private Shared oReleaseType As ProcessorArchitecture = AssemblyName.GetAssemblyName(Application.ExecutablePath()).ProcessorArchitecture Private Shared oReleaseType As ProcessorArchitecture = AssemblyName.GetAssemblyName(Application.ExecutablePath()).ProcessorArchitecture
Shared Sub New() Shared Sub New()
hshCustomVariables = mgrVariables.ReadVariables SetEnv()
LoadCustomVariables()
End Sub End Sub
Shared ReadOnly Property ReleaseType As Integer Shared ReadOnly Property ReleaseType As Integer
@@ -99,8 +100,18 @@ Public Class mgrPath
End Set End Set
End Property End Property
Public Shared Function ValidateForFileSystem(ByVal sCheckString As String) As String Public Shared Function ValidatePathForOS(ByVal sCheckString As String) As String
Dim cInvalidCharacters As Char() = {"\", "/", ":", "*", "?", """", "<", ">", "|", "."} Dim cInvalidCharacters As Char() = Path.GetInvalidPathChars
For Each c As Char In cInvalidCharacters
sCheckString = sCheckString.Replace(c, "")
Next
Return sCheckString.Trim
End Function
Public Shared Function ValidateFileNameForOS(ByVal sCheckString As String) As String
Dim cInvalidCharacters As Char() = Path.GetInvalidFileNameChars
For Each c As Char In cInvalidCharacters For Each c As Char In cInvalidCharacters
sCheckString = sCheckString.Replace(c, "") sCheckString = sCheckString.Replace(c, "")
@@ -192,14 +203,149 @@ Public Class mgrPath
Return sResult Return sResult
End Function End Function
Public Shared Function ReplaceSpecialPaths(sValue As String) As String Private Shared Function BuildWinePath(ByVal sPath As String, ByVal sWinePrefix As String) As String
Dim sMyDocs As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) Dim sRealPath As String
Dim sPublicDocs As String = Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments) Dim cDriveLetter As Char
Dim sAppDataRoaming As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) Dim sWineDrive As String
Dim sAppDataLocal As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
Dim sCurrentUser As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
Dim oCustomVariable As clsPathVariable
Try
'Grab Path
sRealPath = sPath.Split("=")(1)
'Remove Quotes
sRealPath = sRealPath.TrimStart("""")
sRealPath = sRealPath.TrimEnd("""")
'Flip Seperators
sRealPath = sRealPath.Replace("\\", "/")
'Change Wine Drive
cDriveLetter = sRealPath.Chars(sRealPath.IndexOf(":") - 1)
sWineDrive = "drive_" & cDriveLetter
sRealPath = sRealPath.Replace(cDriveLetter & ":", sWineDrive.ToLower)
Return sWinePrefix & Path.DirectorySeparatorChar & sRealPath
Catch ex As Exception
mgrCommon.ShowMessage(mgrPath_ErrorBuildingWinePath, ex.Message, MsgBoxStyle.Exclamation)
Return String.Empty
End Try
End Function
Public Shared Function GetWineSavePath(ByVal sPrefix As String, ByVal sPath As String) As String
Dim sRegistry As String
Dim sWinePath As String
Dim sReplace As String
Dim oParse As Regex
Dim oMatch As Match
Try
If sPath.Contains("%APPDATA%") Then
sReplace = "%APPDATA%"
sRegistry = File.ReadAllText(sPrefix & Path.DirectorySeparatorChar & "user.reg")
oParse = New Regex("""AppData""="".+?(?=\n)")
ElseIf sPath.Contains("%LOCALAPPDATA%Low") Then
sReplace = "%LOCALAPPDATA%Low"
sRegistry = File.ReadAllText(sPrefix & Path.DirectorySeparatorChar & "user.reg")
oParse = New Regex("""{A520A1A4-1780-4FF6-BD18-167343C5AF16}""="".+?(?=\n)")
ElseIf sPath.Contains("%LOCALAPPDATA%") Then
sReplace = "%LOCALAPPDATA%"
sRegistry = File.ReadAllText(sPrefix & Path.DirectorySeparatorChar & "user.reg")
oParse = New Regex("""Local AppData""="".+?(?=\n)")
ElseIf sPath.Contains("%USERDOCUMENTS%") Then
sReplace = "%USERDOCUMENTS%"
sRegistry = File.ReadAllText(sPrefix & Path.DirectorySeparatorChar & "user.reg")
oParse = New Regex("""Personal""="".+?(?=\n)")
ElseIf sPath.Contains("%COMMONDOCUMENTS%") Then
sReplace = "%COMMONDOCUMENTS%"
sRegistry = File.ReadAllText(sPrefix & Path.DirectorySeparatorChar & "system.reg")
oParse = New Regex("""Common Documents""="".+?(?=\n)")
ElseIf sPath.Contains("%USERPROFILE%") Then
sReplace = "%USERPROFILE%"
sRegistry = File.ReadAllText(sPrefix & Path.DirectorySeparatorChar & "user.reg")
oParse = New Regex("""Desktop""="".+?(?=\\\\Desktop)")
Else
Return sPath
End If
If oParse.IsMatch(sRegistry) Then
oMatch = oParse.Match(sRegistry)
sWinePath = BuildWinePath(oMatch.Value, sPrefix)
sPath = sPath.Replace("\", Path.DirectorySeparatorChar)
Return sPath.Replace(sReplace, sWinePath)
End If
Return sPath
Catch ex As Exception
mgrCommon.ShowMessage(mgrPath_ErrorConvertWineSavePath, ex.Message, MsgBoxStyle.Exclamation)
Return sPath
End Try
End Function
Public Shared Function GetWinePrefix(ByVal prs As Process) As String
Dim prps As Process
Dim sPsinfo As String
Dim oParse As New Regex("WINEPREFIX=.+?(?= )")
Dim oMatch As Match
Try
prps = New Process
prps.StartInfo.FileName = "/bin/ps"
prps.StartInfo.Arguments = "e " & prs.Id.ToString
prps.StartInfo.UseShellExecute = False
prps.StartInfo.RedirectStandardOutput = True
prps.StartInfo.CreateNoWindow = True
prps.Start()
sPsinfo = prps.StandardOutput.ReadToEnd()
If oParse.IsMatch(sPsinfo) Then
oMatch = oParse.Match(sPsinfo)
Return oMatch.Value.Trim("/").Split("=")(1)
Else
Return String.Empty
End If
Catch ex As Exception
mgrCommon.ShowMessage(mgrPath_ErrorWinePrefix, ex.Message, MsgBoxStyle.Exclamation)
Return String.Empty
End Try
End Function
Public Shared Function CheckSpecialPaths() As Boolean
Dim hshEnvs As New Hashtable
Dim bNoError As Boolean = True
hshEnvs.Add("Documents", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
hshEnvs.Add("AppDataRoaming", Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData))
hshEnvs.Add("AppDataLocal", Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData))
If Not mgrCommon.IsUnix Then
hshEnvs.Add("UserData", Environment.GetFolderPath(Environment.SpecialFolder.UserProfile))
hshEnvs.Add("PublicDocuments", Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments))
End If
For Each de As DictionaryEntry In hshEnvs
If de.Value = String.Empty Then
mgrCommon.ShowMessage(mgrPath_SpecialPathError, de.Key, MsgBoxStyle.Critical)
bNoError = False
End If
Next
Return bNoError
End Function
Private Shared Sub SetEnv()
If Not mgrCommon.IsUnix Then
Environment.SetEnvironmentVariable("USERDOCUMENTS", Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments))
Environment.SetEnvironmentVariable("COMMONDOCUMENTS", Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments))
End If
End Sub
Public Shared Function ReplaceSpecialPaths(ByVal sValue As String) As String
Dim sXdgData As String = "${XDG_DATA_HOME:-~/.local/share}"
Dim sEnvAppDataLocal As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
Dim sXdgConfig As String = "${XDG_CONFIG_HOME:-~/.config}"
Dim sEnvAppDataRoaming As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
Dim sHomeDir As String = "${HOME}"
Dim sEnvCurrentUser As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
Dim oCustomVariable As clsPathVariable
For Each oCustomVariable In hshCustomVariables.Values For Each oCustomVariable In hshCustomVariables.Values
If sValue.Contains(oCustomVariable.FormattedName) Then If sValue.Contains(oCustomVariable.FormattedName) Then
@@ -207,39 +353,69 @@ Public Class mgrPath
End If End If
Next Next
If sValue.Contains("*appdatalocal*") Then If mgrCommon.IsUnix Then
Return sValue.Replace("*appdatalocal*", sAppDataLocal) '$VAR_iable
End If Dim oParse As New Regex("\$([a-zA-Z0-9_]+)")
'${VAR_iable} but not advanced syntax like ${VAR:-iable}
If sValue.Contains("*appdataroaming*") Then Dim oParseBracketed As New Regex("\$\{([a-zA-Z0-9_]+?)\}")
Return sValue.Replace("*appdataroaming*", sAppDataRoaming) '~ not inside ${...}
End If Dim oParseTilde As New Regex("~(?![^\$\{]*\})")
If sEnvCurrentUser = String.Empty Then
'This needs to be tested last for Unix compatability 'Fall back
If sValue.Contains("*mydocs*") Then sEnvCurrentUser = Environment.GetFolderPath(Environment.SpecialFolder.Personal)
Return sValue.Replace("*mydocs*", sMyDocs) End If
End If If sEnvCurrentUser = String.Empty Then
'Fall back
'Don't use these in Unix sEnvCurrentUser = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
If Not mgrCommon.IsUnix Then
If sValue.Contains("*publicdocs*") Then
Return sValue.Replace("*publicdocs*", sPublicDocs)
End If End If
If sValue.Contains("*currentuser*") Then '$HOME to ${HOME}
Return sValue.Replace("*currentuser*", sCurrentUser) sValue = oParse.Replace(sValue, "${$1}")
End If 'Special notations for home directory
sValue = oParseTilde.Replace(sValue, "${HOME}")
'XDG Base Directory Specification has default values
sValue = sValue.Replace("${XDG_DATA_HOME}", sXdgData)
sValue = sValue.Replace("${XDG_CONFIG_HOME}", sXdgConfig)
'Replace with paths
sValue = sValue.Replace(sXdgData, sEnvAppDataLocal)
sValue = sValue.Replace(sXdgConfig, sEnvAppDataRoaming)
sValue = sValue.Replace(sHomeDir, sEnvCurrentUser)
'Escape real Windows variables
sValue = sValue.Replace("%", "\%")
'Transform Linux variables to Windows variables
sValue = oParseBracketed.Replace(sValue, "%$1%")
End If
'On Linux real Linux environmental variables are used
sValue = Environment.ExpandEnvironmentVariables(sValue)
If mgrCommon.IsUnix Then
'Transform missing variables back
Dim oParse As New Regex("%([a-zA-Z0-9_]+?)%")
sValue = oParse.Replace(sValue, "${$1}")
'Unscape real Windows variables
sValue = sValue.Replace("\%", "%")
End If End If
Return sValue Return sValue
End Function End Function
Public Shared Function ReverseSpecialPaths(sValue As String) As String Public Shared Function ReverseSpecialPaths(sValue As String) As String
Dim sMyDocs As String = "*mydocs*" Dim sMyDocs As String = "%USERDOCUMENTS%"
Dim sPublicDocs As String = "*publicdocs*" Dim sEnvMyDocs As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
Dim sAppDataRoaming As String = "*appdatalocal*" Dim sPublicDocs As String = "%COMMONDOCUMENTS%"
Dim sAppDataLocal As String = "*appdataroaming*" Dim sEnvPublicDocs As String = Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments)
Dim sCurrentUser As String = "*currentuser*" Dim sAppDataLocal As String = "%LOCALAPPDATA%"
Dim sXdgData As String = "${XDG_DATA_HOME:-~/.local/share}"
Dim sEnvAppDataLocal As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)
Dim sAppDataRoaming As String = "%APPDATA%"
Dim sXdgConfig As String = "${XDG_CONFIG_HOME:-~/.config}"
Dim sEnvAppDataRoaming As String = Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)
Dim sCurrentUser As String = "%USERPROFILE%"
Dim sHomeDir As String = "~"
Dim sEnvCurrentUser As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)
Dim oCustomVariable As clsPathVariable Dim oCustomVariable As clsPathVariable
For Each oCustomVariable In hshCustomVariables.Values For Each oCustomVariable In hshCustomVariables.Values
@@ -248,27 +424,49 @@ Public Class mgrPath
End If End If
Next Next
If sValue.Contains(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData)) Then
Return sValue.Replace(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), sAppDataLocal)
End If
If sValue.Contains(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData)) Then
Return sValue.Replace(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), sAppDataRoaming)
End If
'This needs to be tested last for Unix compatability
If sValue.Contains(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)) Then
Return sValue.Replace(Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), sMyDocs)
End If
'Don't use these in Unix
If Not mgrCommon.IsUnix Then If Not mgrCommon.IsUnix Then
If sValue.Contains(Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments)) Then If sValue.Contains(sEnvAppDataRoaming) Then
Return sValue.Replace(Environment.GetFolderPath(Environment.SpecialFolder.CommonDocuments), sPublicDocs) Return sValue.Replace(sEnvAppDataRoaming, sAppDataRoaming)
End If End If
If sValue.Contains(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile)) Then If sValue.Contains(sEnvAppDataLocal) Then
Return sValue.Replace(Environment.GetFolderPath(Environment.SpecialFolder.UserProfile), sCurrentUser) Return sValue.Replace(sEnvAppDataLocal, sAppDataLocal)
End If
'This needs to be tested last for Unix compatability
If sValue.Contains(sEnvMyDocs) Then
Return sValue.Replace(sEnvMyDocs, sMyDocs)
End If
'Mono doesn't set a path for these folders
If sValue.Contains(sEnvPublicDocs) Then
Return sValue.Replace(sEnvPublicDocs, sPublicDocs)
End If
If sValue.Contains(sEnvCurrentUser) Then
Return sValue.Replace(sEnvCurrentUser, sCurrentUser)
End If
Else
'Use different paths on Linux
If sValue.Contains(sEnvAppDataRoaming) Then
Return sValue.Replace(sEnvAppDataRoaming, sXdgConfig)
End If
If sValue.Contains(sEnvAppDataLocal) Then
Return sValue.Replace(sEnvAppDataLocal, sXdgData)
End If
'Must be last
If sValue.Contains(sEnvCurrentUser) Then
If sEnvCurrentUser = String.Empty Then
'Fall back
sEnvCurrentUser = Environment.GetFolderPath(Environment.SpecialFolder.Personal)
End If
If sEnvCurrentUser = String.Empty Then
'Fall back
sEnvCurrentUser = sMyDocs
End If
Return sValue.Replace(sEnvCurrentUser, sHomeDir)
End If End If
End If End If
@@ -307,8 +505,10 @@ Public Class mgrPath
Public Shared Function VerifyCustomVariables(ByVal hshScanlist As Hashtable, ByRef sGames As String) As Boolean Public Shared Function VerifyCustomVariables(ByVal hshScanlist As Hashtable, ByRef sGames As String) As Boolean
Dim hshCustomVariables As Hashtable = mgrVariables.ReadVariables Dim hshCustomVariables As Hashtable = mgrVariables.ReadVariables
'Reserved variables will be resolved on Windows, but not on a Linux. Therefore we an ignore list here, otherwise GBM will bitch about them when using Windows configurations for Wine.
Dim oReservedVariables As List(Of String) = mgrVariables.GetReservedVariables
Dim sVariableCheck As String Dim sVariableCheck As String
Dim sPattern As String = "\*(.*)\*" Dim sPattern As String = "\%(.*)\%"
Dim oGame As clsGame Dim oGame As clsGame
Dim oMatch As Match Dim oMatch As Match
Dim bClean As Boolean = True Dim bClean As Boolean = True
@@ -316,8 +516,8 @@ Public Class mgrPath
For Each oGame In hshScanlist.Values For Each oGame In hshScanlist.Values
oMatch = Regex.Match(oGame.Path, sPattern) oMatch = Regex.Match(oGame.Path, sPattern)
If oMatch.Success Then If oMatch.Success Then
sVariableCheck = oMatch.Value.Replace("*", String.Empty) sVariableCheck = oMatch.Value.Replace("%", String.Empty)
If Not hshCustomVariables.ContainsKey(sVariableCheck) Then If Not hshCustomVariables.ContainsKey(sVariableCheck) And Not oReservedVariables.Contains(sVariableCheck) Then
sGames &= vbCrLf & oGame.Name & " (" & sVariableCheck & ")" sGames &= vbCrLf & oGame.Name & " (" & sVariableCheck & ")"
bClean = False bClean = False
End If End If
@@ -327,8 +527,12 @@ Public Class mgrPath
Return bClean Return bClean
End Function End Function
Public Shared Sub CustomVariablesReload() Public Shared Sub LoadCustomVariables()
hshCustomVariables = mgrVariables.ReadVariables hshCustomVariables = mgrVariables.ReadVariables
For Each oVariable As clsPathVariable In hshCustomVariables.Values
Environment.SetEnvironmentVariable(oVariable.Name, oVariable.Path)
Next
End Sub End Sub
Public Shared Function SetManualGamePath() As String Public Shared Function SetManualGamePath() As String
+152
View File
@@ -0,0 +1,152 @@
Public Class mgrProcess
Private Shared Function MapToObject(ByVal dr As DataRow) As clsProcess
Dim oProcess As New clsProcess
oProcess.ID = CStr(dr("ProcessID"))
oProcess.Name = CStr(dr("Name"))
oProcess.Path = CStr(dr("Path"))
If Not IsDBNull(dr("Args")) Then oProcess.Args = CStr(dr("Args"))
oProcess.Kill = CBool(dr("Kill"))
Return oProcess
End Function
Private Shared Function SetCoreParameters(ByVal oProcess As clsProcess) As Hashtable
Dim hshParams As New Hashtable
hshParams.Add("ProcessID", oProcess.ID)
hshParams.Add("Name", oProcess.Name)
hshParams.Add("Path", oProcess.Path)
hshParams.Add("Args", oProcess.Args)
hshParams.Add("Kill", oProcess.Kill)
Return hshParams
End Function
Public Shared Sub DoProcessAdd(ByVal oProcess As clsProcess)
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim hshParams As Hashtable
sSQL = "INSERT INTO processes VALUES (@ProcessID, @Name, @Path, @Args, @Kill)"
hshParams = SetCoreParameters(oProcess)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
Public Shared Sub DoProcessUpdate(ByVal oProcess As clsProcess)
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim hshParams As Hashtable
sSQL = "UPDATE processes SET Name=@Name, Path=@Path, Args=@Args, Kill=@Kill "
sSQL &= "WHERE ProcessID = @ProcessID"
hshParams = SetCoreParameters(oProcess)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
Public Shared Sub DoProcessDelete(ByVal sProcessID As String)
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim hshParams As New Hashtable
sSQL = "DELETE FROM gameprocesses "
sSQL &= "WHERE ProcessID = @ProcessID;"
sSQL &= "DELETE FROM processes "
sSQL &= "WHERE ProcessID = @ProcessID;"
hshParams.Add("ProcessID", sProcessID)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
Public Shared Function DoProcessGetbyID(ByVal sProcessID As String) As clsProcess
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim oData As DataSet
Dim oProcess As New clsProcess
Dim hshParams As New Hashtable
sSQL = "SELECT * FROM processes "
sSQL &= "WHERE ProcessID = @ProcessID"
hshParams.Add("ProcessID", sProcessID)
oData = oDatabase.ReadParamData(sSQL, hshParams)
For Each dr As DataRow In oData.Tables(0).Rows
oProcess = MapToObject(dr)
Next
Return oProcess
End Function
Public Shared Function DoProcessGetbyName(ByVal sProcessName As String) As clsProcess
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim oData As DataSet
Dim oProcess As New clsProcess
Dim hshParams As New Hashtable
sSQL = "SELECT * FROM processes "
sSQL &= "WHERE Name = @Name"
hshParams.Add("Name", sProcessName)
oData = oDatabase.ReadParamData(sSQL, hshParams)
For Each dr As DataRow In oData.Tables(0).Rows
oProcess = MapToObject(dr)
Next
Return oProcess
End Function
Public Shared Function DoCheckDuplicate(ByVal sName As String, Optional ByVal sExcludeID As String = "") As Boolean
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String
Dim oData As DataSet
Dim hshParams As New Hashtable
sSQL = "SELECT * FROM processes "
sSQL &= "WHERE Name = @Name"
hshParams.Add("Name", sName)
If sExcludeID <> String.Empty Then
sSQL &= " AND ProcessID <> @ProcessID"
hshParams.Add("ProcessID", 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
Public Shared Function ReadProcesses() As Hashtable
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim oData As DataSet
Dim sSQL As String
Dim hshList As New Hashtable
Dim oProcess As clsProcess
sSQL = "SELECT * from processes"
oData = oDatabase.ReadParamData(sSQL, New Hashtable)
For Each dr As DataRow In oData.Tables(0).Rows
oProcess = MapToObject(dr)
hshList.Add(oProcess.Name, oProcess)
Next
Return hshList
End Function
End Class
@@ -1,16 +1,17 @@
Imports System.IO Imports System.IO
Imports System.Management Imports System.Management
Imports System.Text.RegularExpressions
Public Class mgrProcesses Public Class mgrProcessDetection
Private prsFoundProcess As Process Private prsFoundProcess As Process
Private sProcessPath As String
Private dStartTime As DateTime = Now, dEndTime As DateTime = Now Private dStartTime As DateTime = Now, dEndTime As DateTime = Now
Private lTimeSpent As Long = 0 Private lTimeSpent As Long = 0
Private oGame As clsGame Private oGame As clsGame
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
@@ -21,6 +22,15 @@ Public Class mgrProcesses
End Set End Set
End Property End Property
Property ProcessPath As String
Get
Return sProcessPath
End Get
Set(value As String)
sProcessPath = value
End Set
End Property
Property StartTime As DateTime Property StartTime As DateTime
Get Get
Return dStartTime Return dStartTime
@@ -72,64 +82,32 @@ Public Class mgrProcesses
End Set End Set
End Property End Property
Property FullCommand As String
Get
Return sFullCommand
End Get
Set(value As String)
sFullCommand = value
End Set
End Property
Private Function HandleDuplicates(hshScanList As Hashtable) As Boolean
Dim sProcess As String
bDuplicates = True
oDuplicateGames.Clear()
For Each o As clsGame In hshScanList.Values
sProcess = o.ProcessName.Split(":")(0)
If o.Duplicate = True And sProcess = oGame.TrueProcess Then
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
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 'This function will only work correctly on Windows
Private Sub GetWindowsCommand(ByVal prs As Process) Private Function GetWindowsCommand(ByVal prs As Process) As String
FullCommand = String.Empty Dim sFullCommand As String = String.Empty
Try Try
Using searcher As New ManagementObjectSearcher("SELECT CommandLine FROM Win32_Process WHERE ProcessId = " + prs.Id.ToString) Using searcher As New ManagementObjectSearcher("SELECT CommandLine FROM Win32_Process WHERE ProcessId = " + prs.Id.ToString)
For Each o As ManagementObject In searcher.Get() For Each o As ManagementObject In searcher.Get()
FullCommand &= o("CommandLine") & " " sFullCommand &= o("CommandLine") & " "
Next Next
End Using End Using
Catch ex As Exception Catch
'Do Nothing 'Do Nothing
End Try End Try
End Sub Return sFullCommand
End Function
'This function will only work correctly on Unix 'This function will only work correctly on Unix
Private Sub GetUnixCommand(ByVal prs As Process) Private Function GetUnixCommand(ByVal prs As Process) As String
FullCommand = String.Empty Dim sFullCommand As String = String.Empty
Try Try
FullCommand = File.ReadAllText("/proc/" & prs.Id.ToString() & "/cmdline").Replace(vbNullChar, " ") sFullCommand = File.ReadAllText("/proc/" & prs.Id.ToString() & "/cmdline").Replace(vbNullChar, " ")
Catch ex As Exception Catch
'Do Nothing 'Do Nothing
End Try End Try
End Sub
Return sFullCommand
End Function
'This function will only work correctly on Unix 'This function will only work correctly on Unix
Private Function GetUnixProcessArguments(ByVal prs As Process) As String() Private Function GetUnixProcessArguments(ByVal prs As Process) As String()
@@ -162,16 +140,122 @@ Public Class mgrProcesses
End Try End Try
End Function End Function
Public Function SearchRunningProcesses(ByVal hshScanList As Hashtable, ByRef bNeedsPath As Boolean, ByRef iErrorCode As Integer, ByVal bDebugMode As Boolean) As Boolean Private Function IsMatch(ByRef oGame As clsGame, ByRef sProcessCheck As String) As Boolean
If oGame.IsRegEx Then
Try
If Regex.IsMatch(sProcessCheck, oGame.ProcessName) Then
Return True
End If
Catch
'Ignore malformed regular expressions that may have passed validation
End Try
Else
If oGame.ProcessName = sProcessCheck Then
Return True
End If
End If
Return False
End Function
Private Function GetProcessPath(ByVal bWineProcess As Boolean) As String
Try
If Not bWineProcess Then
Return Path.GetDirectoryName(FoundProcess.MainModule.FileName)
Else
Return GetUnixSymLinkDirectory(FoundProcess)
End If
Catch
Return String.Empty
End Try
End Function
Private Sub FilterDetected(ByVal oDetectedGames As ArrayList, ByVal bWineProcess As Boolean)
Dim bMatch As Boolean = False
Dim sFullCommand As String
Dim oNotDetectedWithParameters As New ArrayList
Dim oDetectedWithParameters As New ArrayList
Dim oNotDetectedWithProcessPath As New ArrayList
Dim oDetectedWithProcessPath As New ArrayList
'Get parameters of the found process
If mgrCommon.IsUnix Then
sFullCommand = GetUnixCommand(FoundProcess)
Else
sFullCommand = GetWindowsCommand(FoundProcess)
End If
'Get Process Path
ProcessPath = GetProcessPath(bWineProcess)
'Look for any games using parameters and any matches
For Each oDetectedGame As clsGame In oDetectedGames
If oDetectedGame.Parameter <> String.Empty Then
If sFullCommand.Contains(oDetectedGame.Parameter) Then
oDetectedWithParameters.Add(oDetectedGame)
Else
oNotDetectedWithParameters.Add(oDetectedGame)
End If
End If
Next
'If we detected at least one parameter match, replace full detected list with the detected with parameter list
If oDetectedWithParameters.Count > 0 Then
oDetectedGames = oDetectedWithParameters
Else
'If there is no parameter match, remove any games using parameters from the detected list
For Each oGameNotDetected As clsGame In oNotDetectedWithParameters
oDetectedGames.Remove(oGameNotDetected)
Next
End If
'If there's only one match after parameter detection, set it as current game and we're done.
If oDetectedGames.Count = 1 Then
GameInfo = oDetectedGames(0)
Duplicate = False
Else
'Check if we have any exact matches based on process path
For Each oDetectedGame As clsGame In oDetectedGames
If oDetectedGame.ProcessPath <> String.Empty Then
If oDetectedGame.ProcessPath = ProcessPath Then
oDetectedWithProcessPath.Add(oDetectedGame)
Else
oNotDetectedWithProcessPath.Add(oDetectedGame)
End If
End If
Next
'If there's only one match after process detection, set it as current game and we're done
If oDetectedWithProcessPath.Count = 1 Then
GameInfo = oDetectedWithProcessPath(0)
Duplicate = False
Else
'Remove any games with a process path that does not match the current process
For Each oGameNotDetected As clsGame In oNotDetectedWithProcessPath
oDetectedGames.Remove(oGameNotDetected)
Next
'If only a single game remains, set it as current game and we're done
If oDetectedGames.Count = 1 Then
GameInfo = oDetectedGames(0)
Duplicate = False
Else
'We've done all we can, the user must selected which game they were playing when the process ends
Duplicate = True
oDuplicateGames = oDetectedGames
End If
End If
End If
End Sub
Public Function SearchRunningProcesses(ByVal hshScanList As Hashtable, ByRef bNeedsPath As Boolean, ByRef bWineProcess As Boolean, ByRef iErrorCode As Integer, ByVal bDebugMode As Boolean) As Boolean
Dim prsList() As Process = Process.GetProcesses Dim prsList() As Process = Process.GetProcesses
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 oDetectedGames As New ArrayList
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
@@ -179,56 +263,41 @@ Public Class mgrProcesses
'Unix Handler 'Unix Handler
'We need some special handling for Wine processes 'We need some special handling for Wine processes
If mgrCommon.IsUnix And (sProcessCheck.ToLower = "wine-preloader" Or sProcessCheck.ToLower = "wine64-preloader") Then If mgrCommon.IsUnix And (sProcessCheck.ToLower = "wine-preloader" Or sProcessCheck.ToLower = "wine64-preloader") Then
Dim sArgs As String() = GetUnixProcessArguments(prsCurrent)
Dim sParameter As String
Dim sWinePath As String() Dim sWinePath As String()
'We can't use Path.GetFileName here, Wine uses the Windows seperator in arguments and Mono expects a different one in Unix. 'The wine-preloader parameters can refer to a path on the host system, windows based path within in the prefix, or mixed notation.
sWinePath = GetUnixProcessArguments(prsCurrent)(0).Split("\") sParameter = sArgs(0).Replace("\", "/")
sProcessCheck = sWinePath(sWinePath.Length - 1).Replace(".exe", "") sWinePath = sParameter.Split("/")
sProcessCheck = Path.GetFileNameWithoutExtension(sWinePath(sWinePath.Length - 1))
bWineProcess = True bWineProcess = True
Else Else
bWineProcess = False bWineProcess = False
End If End If
If bDebugMode And mgrCommon.IsUnix Then If bDebugMode And mgrCommon.IsUnix Then
sProcessList &= prsCurrent.Id & " " & prsCurrent.ProcessName & " " & GetUnixProcessArguments(prsCurrent)(0) & vbCrLf sProcessList &= prsCurrent.Id & " " & prsCurrent.ProcessName & " " & GetUnixCommand(prsCurrent) & vbCrLf
ElseIf bDebugMode Then ElseIf bDebugMode Then
sProcessList &= prsCurrent.Id & " " & prsCurrent.ProcessName & vbCrLf sProcessList &= prsCurrent.Id & " " & prsCurrent.ProcessName & " " & GetWindowsCommand(prsCurrent) & vbCrLf
End If End If
Catch ex As Exception Catch ex As Exception
'Do Nothing 'Do Nothing
End Try End Try
'Detection Pass 1 For Each oCurrentGame As clsGame In hshScanList.Values
If hshScanList.ContainsKey(sProcessCheck) Then If IsMatch(oCurrentGame, sProcessCheck) Then
prsFoundProcess = prsCurrent prsFoundProcess = prsCurrent
oGame = DirectCast(hshScanList.Item(sProcessCheck), clsGame).ShallowCopy oGame = oCurrentGame.ShallowCopy
bPass = True oDetectedGames.Add(oGame.ShallowCopy)
If mgrCommon.IsUnix Then
GetUnixCommand(prsCurrent)
Else
GetWindowsCommand(prsCurrent)
End If End If
Next
If oGame.Duplicate = True Then If oDetectedGames.Count > 0 Then
If HandleDuplicates(hshScanList) Then FilterDetected(oDetectedGames, bWineProcess)
bDuplicates = False
oDuplicateGames.Clear()
End If
Else
bDuplicates = False
oDuplicateGames.Clear()
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 End If
'Detection Pass 2 If oDetectedGames.Count > 0 Then
If bPass Then If Not oGame.AbsolutePath And Not oGame.MonitorOnly Then
'Determine the process path if we need it
If Not oGame.AbsolutePath Or oGame.Duplicate Then
Try Try
If Not bWineProcess Then If Not bWineProcess Then
oGame.ProcessPath = Path.GetDirectoryName(prsCurrent.MainModule.FileName) oGame.ProcessPath = Path.GetDirectoryName(prsCurrent.MainModule.FileName)
@@ -236,9 +305,6 @@ Public Class mgrProcesses
oGame.ProcessPath = GetUnixSymLinkDirectory(prsCurrent) oGame.ProcessPath = GetUnixSymLinkDirectory(prsCurrent)
End If End If
Catch exWin32 As System.ComponentModel.Win32Exception Catch exWin32 As System.ComponentModel.Win32Exception
'If an exception occurs the process is:
'Running as administrator and the app isn't.
'The process is 64-bit and the process folder is required, shouldn't happen often.
If exWin32.NativeErrorCode = 5 Then If exWin32.NativeErrorCode = 5 Then
bNeedsPath = True bNeedsPath = True
iErrorCode = 5 iErrorCode = 5
@@ -247,13 +313,11 @@ Public Class mgrProcesses
iErrorCode = 299 iErrorCode = 299
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. 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. Return False
bPass = False
End Try End Try
End If End If
+12 -44
View File
@@ -28,30 +28,16 @@ Public Class mgrRestore
Public Event UpdateRestoreInfo(oRestoreInfo As clsBackup) Public Event UpdateRestoreInfo(oRestoreInfo As clsBackup)
Public Event SetLastAction(sMessage As String) Public Event SetLastAction(sMessage As String)
Public Shared Sub DoPathOverride(ByRef oCheckBackup As clsBackup, ByVal oCheckGame As clsGame)
'Always override the manifest restore path with the current configuration path if possible
If Not oCheckGame.Temporary Then
If Path.IsPathRooted(oCheckGame.Path) Then
oCheckBackup.AbsolutePath = True
Else
oCheckBackup.AbsolutePath = False
End If
oCheckBackup.RestorePath = oCheckGame.Path
End If
End Sub
Public Shared Function CheckPath(ByRef oRestoreInfo As clsBackup, ByVal oGame As clsGame, ByRef bTriggerReload As Boolean) As Boolean Public Shared Function CheckPath(ByRef oRestoreInfo As clsBackup, ByVal oGame As clsGame, ByRef bTriggerReload As Boolean) As Boolean
Dim sProcess As String Dim sProcess As String
Dim sRestorePath As String Dim sRestorePath As String
Dim bNoAuto As Boolean Dim bNoAuto As Boolean
DoPathOverride(oRestoreInfo, oGame)
If Not oRestoreInfo.AbsolutePath Then If Not oRestoreInfo.AbsolutePath Then
If oGame.ProcessPath <> String.Empty Then If oGame.ProcessPath <> String.Empty Then
oRestoreInfo.RelativeRestorePath = oGame.ProcessPath & Path.DirectorySeparatorChar & oRestoreInfo.RestorePath oRestoreInfo.RelativeRestorePath = oGame.ProcessPath & Path.DirectorySeparatorChar & oRestoreInfo.RestorePath
Else Else
sProcess = oGame.TrueProcess sProcess = oGame.ProcessName
If mgrCommon.IsProcessNotSearchable(oGame) Then bNoAuto = True If mgrCommon.IsProcessNotSearchable(oGame) Then bNoAuto = True
sRestorePath = mgrPath.ProcessPathSearch(oRestoreInfo.Name, sProcess, mgrCommon.FormatString(mgrRestore_RelativeNeedPath, oRestoreInfo.Name), bNoAuto) sRestorePath = mgrPath.ProcessPathSearch(oRestoreInfo.Name, sProcess, mgrCommon.FormatString(mgrRestore_RelativeNeedPath, oRestoreInfo.Name), bNoAuto)
@@ -72,7 +58,7 @@ Public Class mgrRestore
Return True Return True
End Function End Function
Public Shared Function CheckManifest(ByVal sAppName As String) As Boolean Public Shared Function CheckManifest(ByVal sMonitorID As String) As Boolean
Dim slLocalManifest As SortedList Dim slLocalManifest As SortedList
Dim slRemoteManifest As SortedList Dim slRemoteManifest As SortedList
Dim oLocalItem As New clsBackup Dim oLocalItem As New clsBackup
@@ -83,13 +69,13 @@ Public Class mgrRestore
slLocalManifest = mgrManifest.ReadLatestManifest(mgrSQLite.Database.Local) slLocalManifest = mgrManifest.ReadLatestManifest(mgrSQLite.Database.Local)
slRemoteManifest = mgrManifest.ReadLatestManifest(mgrSQLite.Database.Remote) slRemoteManifest = mgrManifest.ReadLatestManifest(mgrSQLite.Database.Remote)
If slLocalManifest.Contains(sAppName) Then If slLocalManifest.Contains(sMonitorID) Then
oLocalItem = DirectCast(slLocalManifest(sAppName), clsBackup) oLocalItem = DirectCast(slLocalManifest(sMonitorID), clsBackup)
bLocal = True bLocal = True
End If End If
If slRemoteManifest.Contains(sAppName) Then If slRemoteManifest.Contains(sMonitorID) Then
oRemoteItem = DirectCast(slRemoteManifest(sAppName), clsBackup) oRemoteItem = DirectCast(slRemoteManifest(sMonitorID), clsBackup)
bRemote = True bRemote = True
End If End If
@@ -119,38 +105,20 @@ Public Class mgrRestore
slRemoteManifest = mgrManifest.ReadLatestManifest(mgrSQLite.Database.Remote) slRemoteManifest = mgrManifest.ReadLatestManifest(mgrSQLite.Database.Remote)
For Each oItem As clsBackup In slRemoteManifest.Values For Each oItem As clsBackup In slRemoteManifest.Values
If slLocalManifest.Contains(oItem.Name) Then If slLocalManifest.Contains(oItem.MonitorID) Then
oLocalItem = DirectCast(slLocalManifest(oItem.Name), clsBackup) oLocalItem = DirectCast(slLocalManifest(oItem.MonitorID), clsBackup)
If oItem.DateUpdated > oLocalItem.DateUpdated Then If oItem.DateUpdated > oLocalItem.DateUpdated Then
slRestoreItems.Add(oItem.Name, oItem) slRestoreItems.Add(oItem.MonitorID, oItem)
End If End If
Else Else
slRestoreItems.Add(oItem.Name, oItem) slRestoreItems.Add(oItem.MonitorID, oItem)
End If End If
Next Next
Return slRestoreItems Return slRestoreItems
End Function End Function
Public Shared Function SyncLocalManifest() As SortedList
Dim slLocalManifest As SortedList
Dim slRemoteManifest As SortedList
Dim slRemovedItems As New SortedList
slLocalManifest = mgrManifest.ReadLatestManifest(mgrSQLite.Database.Local)
slRemoteManifest = mgrManifest.ReadLatestManifest(mgrSQLite.Database.Remote)
For Each oItem As clsBackup In slLocalManifest.Values
If Not slRemoteManifest.Contains(oItem.Name) Then
slRemovedItems.Add(oItem.Name, oItem)
mgrManifest.DoManifestDeletebyName(oItem, mgrSQLite.Database.Local)
End If
Next
Return slRemovedItems
End Function
Public Function CheckRestorePrereq(ByVal oBackupInfo As clsBackup, ByVal bCleanFolder As Boolean) 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
@@ -262,8 +230,8 @@ Public Class mgrRestore
If bRestoreCompleted Then If bRestoreCompleted Then
'Save Local Manifest 'Save Local Manifest
If mgrManifest.DoGlobalManifestCheck(oBackupInfo.Name, mgrSQLite.Database.Local) Then If mgrManifest.DoManifestCheck(oBackupInfo.MonitorID, mgrSQLite.Database.Local) Then
mgrManifest.DoManifestUpdateByName(oBackupInfo, mgrSQLite.Database.Local) mgrManifest.DoManifestUpdateByMonitorID(oBackupInfo, mgrSQLite.Database.Local)
Else Else
mgrManifest.DoManifestAdd(oBackupInfo, mgrSQLite.Database.Local) mgrManifest.DoManifestAdd(oBackupInfo, mgrSQLite.Database.Local)
End If End If
+175 -17
View File
@@ -27,17 +27,17 @@ Public Class mgrSQLite
End Select End Select
End Sub End Sub
Private Sub BackupDB(ByVal sLastVer As String) Public Sub BackupDB(ByVal sDescription As String, Optional ByVal bOverwrite As Boolean = False)
Dim sNewFile As String = String.Empty Dim sNewFile As String = String.Empty
Try Try
Select Case eDatabase Select Case eDatabase
Case Database.Local Case Database.Local
sNewFile = mgrPath.DatabaseLocation & "." & sLastVer & ".bak" sNewFile = mgrPath.DatabaseLocation & "." & sDescription & ".bak"
File.Copy(mgrPath.DatabaseLocation, sNewFile, False) File.Copy(mgrPath.DatabaseLocation, sNewFile, bOverwrite)
Case Database.Remote Case Database.Remote
sNewFile = mgrPath.RemoteDatabaseLocation & "." & sLastVer & ".bak" sNewFile = mgrPath.RemoteDatabaseLocation & "." & sDescription & ".bak"
File.Copy(mgrPath.RemoteDatabaseLocation, sNewFile, False) File.Copy(mgrPath.RemoteDatabaseLocation, sNewFile, bOverwrite)
End Select End Select
Catch ex As Exception Catch ex As Exception
mgrCommon.ShowMessage(mgrSQLite_ErrorBackupFailure, New String() {sNewFile, ex.Message}, MsgBoxStyle.Exclamation) mgrCommon.ShowMessage(mgrSQLite_ErrorBackupFailure, New String() {sNewFile, ex.Message}, MsgBoxStyle.Exclamation)
@@ -72,18 +72,19 @@ 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, StartWithWindows BOOLEAN NOT NULL, TimeTracking BOOLEAN NOT NULL, " & "BackupFolder TEXT NOT NULL, StartWithWindows BOOLEAN NOT NULL, TimeTracking BOOLEAN NOT NULL, " &
"SupressBackup BOOLEAN NOT NULL, SupressBackupThreshold INTEGER NOT NULL, CompressionLevel INTEGER NOT NULL, Custom7zArguments TEXT, " & "SuppressBackup BOOLEAN NOT NULL, SuppressBackupThreshold INTEGER NOT NULL, CompressionLevel INTEGER NOT NULL, Custom7zArguments TEXT, " &
"Custom7zLocation TEXT, SyncFields INTEGER NOT NULL, AutoSaveLog BOOLEAN NOT NULL, AutoRestore BOOLEAN NOT NULL, AutoMark BOOLEAN NOT NULL, SessionTracking 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, " &
"SuppressMessages INTEGER NOT NULL, BackupOnLaunch BOOLEAN NOT NULL, UseGameID BOOLEAN NOT NULL, DisableSyncMessages BOOLEAN NOT NULL, ShowResolvedPaths BOOLEAN NOT NULL);"
'Add Tables (SavedPath) 'Add Tables (SavedPath)
sSql &= "CREATE TABLE savedpath (PathName TEXT NOT NULL PRIMARY KEY, Path TEXT NOT NULL);" sSql &= "CREATE TABLE savedpath (PathName TEXT NOT NULL PRIMARY KEY, Path TEXT NOT NULL);"
'Add 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 PRIMARY KEY, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " &
"AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " & "AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " &
"ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " & "ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " &
"BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, Parameter TEXT, Comments TEXT, PRIMARY KEY(Name, Process));" "BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, Parameter TEXT, Comments TEXT, IsRegEx BOOLEAN NOT NULL);"
'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,12 +96,18 @@ Public Class mgrSQLite
sSql &= "CREATE TABLE variables (VariableID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY, Path TEXT NOT NULL);" sSql &= "CREATE TABLE variables (VariableID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY, Path TEXT NOT NULL);"
'Add Tables (Local Manifest) 'Add Tables (Local 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, MonitorID TEXT NOT NULL, FileName TEXT NOT NULL, " &
"AbsolutePath BOOLEAN NOT NULL, DateUpdated TEXT NOT NULL, UpdatedBy TEXT NOT NULL, CheckSum TEXT);" "DateUpdated TEXT NOT NULL, UpdatedBy TEXT NOT NULL, CheckSum TEXT);"
'Add Tables (Sessions) 'Add Tables (Sessions)
sSql &= "CREATE TABLE sessions (MonitorID TEXT NOT NULL, Start INTEGER NOT NULL, End INTEGER NOT NULL, PRIMARY KEY(MonitorID, Start));" sSql &= "CREATE TABLE sessions (MonitorID TEXT NOT NULL, Start INTEGER NOT NULL, End INTEGER NOT NULL, PRIMARY KEY(MonitorID, Start));"
'Add Tables (Processes)
sSql &= "CREATE TABLE processes (ProcessID TEXT NOT NULL PRIMARY KEY, Name Text NOT NULL, Path TEXT NOT NULL, Args TEXT, Kill BOOLEAN NOT NULL);"
'Add Tables (Game Processes)
sSql &= "CREATE TABLE gameprocesses (ProcessID TEXT NOT NULL, MonitorID TEXT NOT NULL, PRIMARY KEY(ProcessID, MonitorID));"
'Set Version 'Set Version
sSql &= "PRAGMA user_version=" & mgrCommon.AppVersion sSql &= "PRAGMA user_version=" & mgrCommon.AppVersion
@@ -120,14 +127,14 @@ Public Class mgrSQLite
SqliteConnection.CreateFile(sDatabaseLocation) SqliteConnection.CreateFile(sDatabaseLocation)
'Add Tables (Remote Monitor List) 'Add Tables (Remote 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 PRIMARY KEY, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " &
"AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " & "AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " &
"ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " & "ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " &
"BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, Parameter TEXT, Comments TEXT, PRIMARY KEY(Name, Process));" "BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, Parameter TEXT, Comments TEXT, IsRegEx BOOLEAN NOT NULL);"
'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, MonitorID TEXT NOT NULL, FileName TEXT NOT NULL, " &
"AbsolutePath BOOLEAN NOT NULL, DateUpdated TEXT NOT NULL, UpdatedBy TEXT NOT NULL, CheckSum TEXT);" "DateUpdated TEXT NOT NULL, UpdatedBy TEXT NOT NULL, CheckSum TEXT);"
'Add Tables (Remote Tags) 'Add Tables (Remote 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); "
@@ -267,7 +274,7 @@ Public Class mgrSQLite
Dim oResult As New Object Dim oResult As New Object
Connect() Connect()
Command = New SqliteCommand(sSQL, db) command = New SqliteCommand(sSQL, db)
BuildParams(command, hshParams) BuildParams(command, hshParams)
Try Try
@@ -734,6 +741,157 @@ Public Class mgrSQLite
End If End If
End If End If
'1.08 Upgrade
If GetDatabaseVersion() < 108 Then
If eDatabase = Database.Local Then
'Backup DB before starting
BackupDB("v105")
'Add new field(s)
sSQL = "ALTER TABLE monitorlist ADD COLUMN IsRegEx BOOLEAN NOT NULL DEFAULT 0;"
sSQL &= "PRAGMA user_version=108"
RunParamQuery(sSQL, New Hashtable)
End If
If eDatabase = Database.Remote Then
'Backup DB before starting
BackupDB("v105")
'Add new field(s)
sSQL = "ALTER TABLE monitorlist ADD COLUMN IsRegEx BOOLEAN NOT NULL DEFAULT 0;"
sSQL &= "PRAGMA user_version=108"
RunParamQuery(sSQL, New Hashtable)
End If
End If
'1.10 Upgrade
If GetDatabaseVersion() < 110 Then
If eDatabase = Database.Local Then
'Backup DB before starting
BackupDB("v108")
'Add Tables
sSQL = "CREATE TABLE processes (ProcessID TEXT NOT NULL PRIMARY KEY, Name Text NOT NULL, Path TEXT NOT NULL, Args TEXT, Kill BOOLEAN NOT NULL);"
sSQL &= "CREATE TABLE gameprocesses (ProcessID TEXT NOT NULL, MonitorID TEXT NOT NULL, PRIMARY KEY(ProcessID, MonitorID));"
'Overhaul Tables
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, StartWithWindows BOOLEAN NOT NULL, TimeTracking BOOLEAN NOT NULL, " &
"SuppressBackup BOOLEAN NOT NULL, SuppressBackupThreshold INTEGER NOT NULL, CompressionLevel INTEGER NOT NULL, Custom7zArguments TEXT, " &
"Custom7zLocation TEXT, SyncFields INTEGER NOT NULL, AutoSaveLog BOOLEAN NOT NULL, AutoRestore BOOLEAN NOT NULL, AutoMark BOOLEAN NOT NULL, SessionTracking BOOLEAN NOT NULL, " &
"SuppressMessages INTEGER NOT NULL, BackupOnLaunch BOOLEAN NOT NULL, UseGameID BOOLEAN NOT NULL, DisableSyncMessages BOOLEAN NOT NULL);"
sSQL &= "INSERT INTO settings_new(SettingsID, MonitorOnStartup, StartToTray, ShowDetectionToolTips, DisableConfirmation, CreateSubFolder, ShowOverwriteWarning, RestoreOnLaunch, " &
"BackupFolder, StartWithWindows, TimeTracking, SuppressBackup, SuppressBackupThreshold, CompressionLevel, Custom7zArguments, Custom7zLocation, SyncFields, AutoSaveLog, " &
"AutoRestore, AutoMark, SessionTracking, SuppressMessages, BackupOnLaunch, UseGameID, DisableSyncMessages) SELECT SettingsID, MonitorOnStartup, StartToTray, ShowDetectionToolTips, DisableConfirmation, CreateSubFolder, ShowOverwriteWarning, RestoreOnLaunch, " &
"BackupFolder, StartWithWindows, TimeTracking, SupressBackup, SupressBackupThreshold, CompressionLevel, Custom7zArguments, Custom7zLocation, SyncFields, AutoSaveLog, " &
"AutoRestore, AutoMark, SessionTracking, 0, 1, 0, 1 FROM settings;" &
"DROP TABLE settings; ALTER TABLE settings_new RENAME TO settings;"
sSQL &= "CREATE TABLE monitorlist_new (MonitorID TEXT NOT NULL PRIMARY KEY, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " &
"AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " &
"ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " &
"BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, Parameter TEXT, Comments TEXT, IsRegEx BOOLEAN NOT NULL);"
sSQL &= "INSERT INTO monitorlist_new (MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, " &
"ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter, Comments, IsRegEx)" &
"SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, " &
"ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter, Comments, IsRegEx FROM monitorlist;" &
"DROP TABLE monitorlist; ALTER TABLE monitorlist_new RENAME TO monitorlist;"
sSQL &= "CREATE TABLE manifest_new (ManifestID TEXT NOT NULL PRIMARY KEY, MonitorID TEXT NOT NULL, FileName TEXT NOT NULL, " &
"DateUpdated TEXT NOT NULL, UpdatedBy TEXT NOT NULL, CheckSum TEXT);"
sSQL &= "INSERT INTO manifest_new (ManifestID, MonitorID, FileName, DateUpdated, UpdatedBy, CheckSum) " &
"SELECT ManifestID, MonitorID, FileName, DateUpdated, UpdatedBy, CheckSum FROM manifest NATURAL JOIN monitorlist GROUP BY ManifestID;" &
"DROP TABLE manifest; ALTER TABLE manifest_new RENAME TO manifest;"
sSQL &= "PRAGMA user_version=110"
RunParamQuery(sSQL, New Hashtable)
CompactDatabase()
End If
If eDatabase = Database.Remote Then
'Backup DB before starting
BackupDB("v108")
'Overhaul Tables
sSQL = "CREATE TABLE monitorlist_new (MonitorID TEXT NOT NULL PRIMARY KEY, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " &
"AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " &
"ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " &
"BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, Parameter TEXT, Comments TEXT, IsRegEx BOOLEAN NOT NULL);"
sSQL &= "INSERT INTO monitorlist_new (MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, " &
"ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter, Comments, IsRegEx)" &
"SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, " &
"ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder, Parameter, Comments, IsRegEx FROM monitorlist;" &
"DROP TABLE monitorlist; ALTER TABLE monitorlist_new RENAME TO monitorlist;"
'We need to push the local game list against the remote database in case they had syncing disabled
Dim hshMonitorList As Hashtable = mgrMonitorList.ReadList(mgrMonitorList.eListTypes.FullList, mgrSQLite.Database.Local)
Dim oSettings As New mgrSettings
oSettings.LoadSettings()
mgrMonitorList.DoListAddUpdateSync(hshMonitorList, Database.Remote, oSettings.SyncFields)
mgrTags.SyncTags(True)
mgrGameTags.SyncGameTags(True)
sSQL &= "CREATE TABLE manifest_new (ManifestID TEXT NOT NULL PRIMARY KEY, MonitorID TEXT NOT NULL, FileName TEXT NOT NULL, " &
"DateUpdated TEXT NOT NULL, UpdatedBy TEXT NOT NULL, CheckSum TEXT);"
sSQL &= "INSERT INTO manifest_new (ManifestID, MonitorID, FileName, DateUpdated, UpdatedBy, CheckSum) " &
"SELECT ManifestID, MonitorID, FileName, DateUpdated, UpdatedBy, CheckSum FROM manifest NATURAL JOIN monitorlist GROUP BY ManifestID;" &
"DROP TABLE manifest; ALTER TABLE manifest_new RENAME TO manifest;"
sSQL &= "PRAGMA user_version=110"
RunParamQuery(sSQL, New Hashtable)
CompactDatabase()
End If
End If
'1.15 Upgrade
If GetDatabaseVersion() < 115 Then
If eDatabase = Database.Local Then
'Backup DB before starting
BackupDB("v110")
'Add new setting
sSQL = "ALTER TABLE settings ADD COLUMN ShowResolvedPaths BOOLEAN NOT NULL DEFAULT 1;"
sSQL &= "PRAGMA user_version=115"
RunParamQuery(sSQL, New Hashtable)
End If
If eDatabase = Database.Remote Then
'Backup DB before starting
BackupDB("v110")
'Convert core path variables to new standard
If Not mgrCommon.IsUnix Then
sSQL = "UPDATE monitorlist SET Path = Replace(Path,'*appdatalocal*','%LOCALAPPDATA%');"
sSQL &= "UPDATE monitorlist SET Path = Replace(Path,'*appdataroaming*','%APPDATA%');"
sSQL &= "UPDATE monitorlist SET Path = Replace(Path,'*mydocs*','%USERDOCUMENTS%');"
sSQL &= "UPDATE monitorlist SET Path = Replace(Path,'*currentuser*','%USERPROFILE%');"
sSQL &= "UPDATE monitorlist SET Path = Replace(Path,'*publicdocs*','%COMMONDOCUMENTS%');"
Else
sSQL = "UPDATE monitorlist SET Path = Replace(Path,'*appdatalocal*','${XDG_DATA_HOME:-~/.local/share}');"
sSQL &= "UPDATE monitorlist SET Path = Replace(Path,'*appdataroaming*','${XDG_CONFIG_HOME:-~/.config}');"
sSQL &= "UPDATE monitorlist SET Path = Replace(Path,'*mydocs*','~');"
End If
'Convert custom variables to new standard
Dim hshVariables As Hashtable = mgrVariables.ReadVariables()
Dim sOldVariable As String
For Each oVariable As clsPathVariable In hshVariables.Values
sOldVariable = "*" & oVariable.Name & "*"
sSQL &= "UPDATE monitorlist SET Path = Replace(Path,'" & sOldVariable & "','" & oVariable.FormattedName & "');"
Next
sSQL &= "PRAGMA user_version=115"
RunParamQuery(sSQL, New Hashtable)
End If
End If
End Sub End Sub
Public Function GetDBSize() As Long Public Function GetDBSize() As Long
+137 -6
View File
@@ -1,11 +1,15 @@
Public Class mgrSessions Imports GBM.My.Resources
Imports System.IO
Imports System.Xml.Serialization
Public Class mgrSessions
Private Shared Function MapToObject(ByVal dr As DataRow) As clsSession Private Shared Function MapToObject(ByVal dr As DataRow) As clsSession
Dim oSession As New clsSession Dim oSession As New clsSession
oSession.MonitorID = CStr(dr("MonitorID")) oSession.MonitorID = CStr(dr("MonitorID"))
oSession.SessionStart = mgrCommon.UnixToDate(CInt(dr("Start"))) oSession.SessionStart = CInt(dr("Start"))
oSession.SessionEnd = mgrCommon.UnixToDate(CInt(dr("End"))) oSession.SessionEnd = CInt(dr("End"))
Return oSession Return oSession
End Function End Function
@@ -14,8 +18,8 @@
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
hshParams.Add("MonitorID", oSession.MonitorID) hshParams.Add("MonitorID", oSession.MonitorID)
hshParams.Add("Start", mgrCommon.DateToUnix(oSession.SessionStart)) hshParams.Add("Start", oSession.SessionStart)
hshParams.Add("End", mgrCommon.DateToUnix(oSession.SessionEnd)) hshParams.Add("End", oSession.SessionEnd)
Return hshParams Return hshParams
End Function End Function
@@ -80,7 +84,7 @@
For Each oSession As clsSession In oSessions For Each oSession As clsSession In oSessions
hshParams = New Hashtable hshParams = New Hashtable
hshParams.Add("MonitorID", oSession.MonitorID) hshParams.Add("MonitorID", oSession.MonitorID)
hshParams.Add("Start", mgrCommon.DateToUnix(oSession.SessionStart)) hshParams.Add("Start", oSession.SessionStart)
oParamList.Add(hshParams) oParamList.Add(hshParams)
Next Next
@@ -123,4 +127,131 @@
Return iRowCount Return iRowCount
End Function End Function
Private Shared Function EscapeCSV(ByVal sItem As String) As String
Dim bEnclose As Boolean = False
If sItem.Contains("""") Then
sItem = sItem.Replace("""", """""")
bEnclose = True
End If
If sItem.Contains(",") Then
bEnclose = True
End If
If sItem.Contains(vbCrLf) Or sItem.Contains(vbCr) Or sItem.Contains(vbLf) Then
bEnclose = True
End If
If bEnclose Then
sItem = """" & sItem & """"
End If
Return sItem
End Function
Public Shared Function ExportAsCSV(ByVal sLocation As String, ByVal bUnixTime As Boolean, ByVal bHeaders As Boolean, ByRef dg As DataGridView) As Boolean
Dim oWriter As StreamWriter
Dim sHeader As String
Dim sCurrentRow As String
Dim oBannedColumns As New List(Of DataGridViewColumn)
Try
oWriter = New StreamWriter(sLocation)
'Set Ban Columns
oBannedColumns.Add(dg.Columns("MonitorID"))
If bUnixTime Then
oBannedColumns.Add(dg.Columns("Start"))
oBannedColumns.Add(dg.Columns("End"))
Else
oBannedColumns.Add(dg.Columns("StartUnix"))
oBannedColumns.Add(dg.Columns("EndUnix"))
End If
'Handle Headers
If bHeaders Then
sHeader = String.Empty
For Each dgCol As DataGridViewColumn In dg.Columns
If Not oBannedColumns.Contains(dgCol) Then
sHeader &= dgCol.HeaderText & ","
End If
Next
sHeader = sHeader.TrimEnd(",")
oWriter.WriteLine(sHeader)
End If
'Handle Rows
For Each dgRow As DataGridViewRow In dg.Rows
sCurrentRow = String.Empty
For Each dgCell As DataGridViewCell In dgRow.Cells
If Not oBannedColumns.Contains(dg.Columns(dgCell.ColumnIndex)) Then
sCurrentRow &= EscapeCSV(dgCell.Value.ToString) & ","
End If
Next
sCurrentRow = sCurrentRow.TrimEnd(",")
'Don't write a LF on the last row
If dg.Rows.Count = (dgRow.Index + 1) Then
oWriter.Write(sCurrentRow)
Else
oWriter.WriteLine(sCurrentRow)
End If
Next
'Finish up
oWriter.Flush()
oWriter.Close()
mgrCommon.ShowMessage(mgrSessions_ExportSuccess, MsgBoxStyle.Information)
Return True
Catch ex As Exception
mgrCommon.ShowMessage(mgrSessions_ErrorExportFailure, ex.Message, MsgBoxStyle.Exclamation)
Return False
End Try
End Function
Public Shared Function ExportAsXML(ByVal sLocation As String, ByVal bUnixTime As Boolean, ByRef dg As DataGridView) As Boolean
Dim oSerializer As XmlSerializer
Dim oWriter As StreamWriter
Dim oCurrentSession As Session
Dim oSessions As New List(Of Session)
Dim oBannedColumns As New List(Of DataGridViewColumn)
Try
'Format data for export
For Each dgRow As DataGridViewRow In dg.Rows
oCurrentSession = New Session
oCurrentSession.GameName = dgRow.Cells("Name").Value.ToString
If bUnixTime Then
oCurrentSession.StartDate = dgRow.Cells("StartUnix").Value.ToString
oCurrentSession.EndDate = dgRow.Cells("EndUnix").Value.ToString
Else
oCurrentSession.StartDate = dgRow.Cells("Start").Value.ToString
oCurrentSession.EndDate = dgRow.Cells("End").Value.ToString
End If
oCurrentSession.Hours = dgRow.Cells("Hours").Value.ToString
oSessions.Add(oCurrentSession)
Next
'Serialize
oSerializer = New XmlSerializer(oSessions.GetType, New XmlRootAttribute("Sessions"))
oWriter = New StreamWriter(sLocation)
oSerializer.Serialize(oWriter.BaseStream, oSessions)
'Finish up
oWriter.Flush()
oWriter.Close()
mgrCommon.ShowMessage(mgrSessions_ExportSuccess, MsgBoxStyle.Information)
Return True
Catch ex As Exception
mgrCommon.ShowMessage(mgrSessions_ErrorExportFailure, ex.Message, MsgBoxStyle.Exclamation)
Return False
End Try
End Function
End Class End Class
+100 -32
View File
@@ -11,17 +11,28 @@ Public Class mgrSettings
Private bRestoreOnLaunch As Boolean = False Private bRestoreOnLaunch As Boolean = False
Private bAutoRestore As Boolean = False Private bAutoRestore As Boolean = False
Private bAutoMark As Boolean = False Private bAutoMark As Boolean = False
Private bSync As Boolean = True
Private bTimeTracking As Boolean = True Private bTimeTracking As Boolean = True
Private bSessionTracking As Boolean = False Private bSessionTracking As Boolean = False
Private bSupressBackup As Boolean = False Private bSuppressBackup As Boolean = False
Private iSupressBackupThreshold As Integer = 10 Private iSuppressBackupThreshold As Integer = 10
Private iCompressionLevel As Integer = 5 Private iCompressionLevel As Integer = 5
Private s7zArguments As String = String.Empty Private s7zArguments As String = String.Empty
Private s7zLocation As String = String.Empty Private s7zLocation As String = String.Empty
Private sBackupFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).TrimEnd(New Char() {"\", "/"}) Private sBackupFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).TrimEnd(New Char() {"\", "/"})
Private eSyncFields As clsGame.eOptionalSyncFields = clsGame.eOptionalSyncFields.None Or clsGame.eOptionalSyncFields.TimeStamp Private eSyncFields As clsGame.eOptionalSyncFields = clsGame.eOptionalSyncFields.None
Private eMessages As eSuppressMessages = eSuppressMessages.None
Private bAutoSaveLog As Boolean = False Private bAutoSaveLog As Boolean = False
Private bBackupOnLaunch As Boolean = True
Private bUseGameID As Boolean = False
Private bDisableSyncMessages As Boolean = True
Private bShowResolvedPaths As Boolean = True
<Flags()> Public Enum eSuppressMessages
None = 0
GameIDSync = 1
BackupImport = 2
WinConfigsInLinux = 4
End Enum
Property StartWithWindows As Boolean Property StartWithWindows As Boolean
Get Get
@@ -113,15 +124,6 @@ Public Class mgrSettings
End Set End Set
End Property End Property
Property Sync As Boolean
Get
Return bSync
End Get
Set(value As Boolean)
bSync = value
End Set
End Property
Property TimeTracking As Boolean Property TimeTracking As Boolean
Get Get
Return bTimeTracking Return bTimeTracking
@@ -140,21 +142,21 @@ Public Class mgrSettings
End Set End Set
End Property End Property
Property SupressBackup As Boolean Property SuppressBackup As Boolean
Get Get
Return bSupressBackup Return bSuppressBackup
End Get End Get
Set(value As Boolean) Set(value As Boolean)
bSupressBackup = value bSuppressBackup = value
End Set End Set
End Property End Property
Property SupressBackupThreshold As Integer Property SuppressBackupThreshold As Integer
Get Get
Return iSupressBackupThreshold Return iSuppressBackupThreshold
End Get End Get
Set(value As Integer) Set(value As Integer)
iSupressBackupThreshold = value iSuppressBackupThreshold = value
End Set End Set
End Property End Property
@@ -176,6 +178,15 @@ Public Class mgrSettings
End Set End Set
End Property End Property
Property ShowResolvedPaths As Boolean
Get
Return bShowResolvedPaths
End Get
Set(value As Boolean)
bShowResolvedPaths = value
End Set
End Property
ReadOnly Property Prepared7zArguments As String ReadOnly Property Prepared7zArguments As String
Get Get
'Prepare custom 7z arguments 'Prepare custom 7z arguments
@@ -260,18 +271,57 @@ Public Class mgrSettings
End Set End Set
End Property End Property
Property SuppressMessages As eSuppressMessages
Get
Return eMessages
End Get
Set(value As eSuppressMessages)
eMessages = value
End Set
End Property
Property BackupOnLaunch As Boolean
Get
Return bBackupOnLaunch
End Get
Set(value As Boolean)
bBackupOnLaunch = value
End Set
End Property
Property UseGameID As Boolean
Get
Return bUseGameID
End Get
Set(value As Boolean)
bUseGameID = value
End Set
End Property
Property DisableSyncMessages As Boolean
Get
Return bDisableSyncMessages
End Get
Set(value As Boolean)
bDisableSyncMessages = value
End Set
End Property
Sub New()
'The GameIDsync message should be suppressed on all new databases
SuppressMessages = SetMessageField(SuppressMessages, eSuppressMessages.GameIDSync)
End Sub
Private Sub SaveFromClass() Private Sub SaveFromClass()
Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local) Dim oDatabase As New mgrSQLite(mgrSQLite.Database.Local)
Dim sSQL As String Dim sSQL As String
Dim hshParams As New Hashtable Dim hshParams As New Hashtable
sSQL = "DELETE FROM settings WHERE SettingsID = 1" sSQL = "INSERT OR REPLACE INTO settings VALUES (1, @MonitorOnStartup, @StartToTray, @ShowDetectionToolTips, @DisableConfirmation, "
oDatabase.RunParamQuery(sSQL, New Hashtable) sSQL &= "@CreateSubFolder, @ShowOverwriteWarning, @RestoreOnLaunch, @BackupFolder, @StartWithWindows, "
sSQL &= "@TimeTracking, @SuppressBackup, @SuppressBackupThreshold, @CompressionLevel, @Custom7zArguments, @Custom7zLocation, "
sSQL = "INSERT INTO settings VALUES (1, @MonitorOnStartup, @StartToTray, @ShowDetectionToolTips, @DisableConfirmation, " sSQL &= "@SyncFields, @AutoSaveLog, @AutoRestore, @AutoMark, @SessionTracking, @SuppressMessages, @BackupOnLaunch, @UseGameID, "
sSQL &= "@CreateSubFolder, @ShowOverwriteWarning, @RestoreOnLaunch, @BackupFolder, @Sync, @StartWithWindows, " sSQL &= "@DisableSyncMessages, @ShowResolvedPaths)"
sSQL &= "@TimeTracking, @SupressBackup, @SupressBackupThreshold, @CompressionLevel, @Custom7zArguments, @Custom7zLocation, "
sSQL &= "@SyncFields, @AutoSaveLog, @AutoRestore, @AutoMark, @SessionTracking)"
hshParams.Add("MonitorOnStartup", MonitorOnStartup) hshParams.Add("MonitorOnStartup", MonitorOnStartup)
hshParams.Add("StartToTray", StartToTray) hshParams.Add("StartToTray", StartToTray)
@@ -281,11 +331,10 @@ Public Class mgrSettings
hshParams.Add("ShowOverwriteWarning", ShowOverwriteWarning) hshParams.Add("ShowOverwriteWarning", ShowOverwriteWarning)
hshParams.Add("RestoreOnLaunch", RestoreOnLaunch) hshParams.Add("RestoreOnLaunch", RestoreOnLaunch)
hshParams.Add("BackupFolder", BackupFolder) hshParams.Add("BackupFolder", BackupFolder)
hshParams.Add("Sync", Sync)
hshParams.Add("StartWithWindows", StartWithWindows) hshParams.Add("StartWithWindows", StartWithWindows)
hshParams.Add("TimeTracking", TimeTracking) hshParams.Add("TimeTracking", TimeTracking)
hshParams.Add("SupressBackup", SupressBackup) hshParams.Add("SuppressBackup", SuppressBackup)
hshParams.Add("SupressBackupThreshold", SupressBackupThreshold) hshParams.Add("SuppressBackupThreshold", SuppressBackupThreshold)
hshParams.Add("CompressionLevel", CompressionLevel) hshParams.Add("CompressionLevel", CompressionLevel)
hshParams.Add("Custom7zArguments", Custom7zArguments) hshParams.Add("Custom7zArguments", Custom7zArguments)
hshParams.Add("Custom7zLocation", Custom7zLocation) hshParams.Add("Custom7zLocation", Custom7zLocation)
@@ -294,6 +343,12 @@ Public Class mgrSettings
hshParams.Add("AutoRestore", AutoRestore) hshParams.Add("AutoRestore", AutoRestore)
hshParams.Add("AutoMark", AutoMark) hshParams.Add("AutoMark", AutoMark)
hshParams.Add("SessionTracking", SessionTracking) hshParams.Add("SessionTracking", SessionTracking)
hshParams.Add("SuppressMessages", SuppressMessages)
hshParams.Add("BackupOnLaunch", BackupOnLaunch)
hshParams.Add("UseGameID", UseGameID)
hshParams.Add("DisableSyncMessages", DisableSyncMessages)
hshParams.Add("ShowResolvedPaths", ShowResolvedPaths)
oDatabase.RunParamQuery(sSQL, hshParams) oDatabase.RunParamQuery(sSQL, hshParams)
End Sub End Sub
@@ -316,11 +371,10 @@ Public Class mgrSettings
ShowOverwriteWarning = CBool(dr("ShowOverwriteWarning")) ShowOverwriteWarning = CBool(dr("ShowOverwriteWarning"))
RestoreOnLaunch = CBool(dr("RestoreOnLaunch")) RestoreOnLaunch = CBool(dr("RestoreOnLaunch"))
BackupFolder = CStr(dr("BackupFolder")) BackupFolder = CStr(dr("BackupFolder"))
Sync = CBool(dr("Sync"))
StartWithWindows = CBool(dr("StartWithWindows")) StartWithWindows = CBool(dr("StartWithWindows"))
TimeTracking = CBool(dr("TimeTracking")) TimeTracking = CBool(dr("TimeTracking"))
SupressBackup = CBool(dr("SupressBackup")) SuppressBackup = CBool(dr("SuppressBackup"))
SupressBackupThreshold = CInt(dr("SupressBackupThreshold")) SuppressBackupThreshold = CInt(dr("SuppressBackupThreshold"))
CompressionLevel = CInt(dr("CompressionLevel")) CompressionLevel = CInt(dr("CompressionLevel"))
If Not IsDBNull(dr("Custom7zArguments")) Then Custom7zArguments = CStr(dr("Custom7zArguments")) If Not IsDBNull(dr("Custom7zArguments")) Then Custom7zArguments = CStr(dr("Custom7zArguments"))
If Not IsDBNull(dr("Custom7zLocation")) Then Custom7zLocation = CStr(dr("Custom7zLocation")) If Not IsDBNull(dr("Custom7zLocation")) Then Custom7zLocation = CStr(dr("Custom7zLocation"))
@@ -329,6 +383,11 @@ Public Class mgrSettings
AutoRestore = CBool(dr("AutoRestore")) AutoRestore = CBool(dr("AutoRestore"))
AutoMark = CBool(dr("AutoMark")) AutoMark = CBool(dr("AutoMark"))
SessionTracking = CBool(dr("SessionTracking")) SessionTracking = CBool(dr("SessionTracking"))
SuppressMessages = CInt(dr("SuppressMessages"))
BackupOnLaunch = CBool(dr("BackupOnLaunch"))
UseGameID = CBool(dr("UseGameID"))
DisableSyncMessages = CBool(dr("DisableSyncMessages"))
ShowResolvedPaths = CBool(dr("ShowResolvedPaths"))
Next Next
oDatabase.Disconnect() oDatabase.Disconnect()
@@ -347,4 +406,13 @@ Public Class mgrSettings
'Set Remote Manifest Location 'Set Remote Manifest Location
mgrPath.RemoteDatabaseLocation = Me.BackupFolder mgrPath.RemoteDatabaseLocation = Me.BackupFolder
End Sub End Sub
Public Function SetMessageField(ByVal eMessages As eSuppressMessages, ByVal eMessage As eSuppressMessages) As eSuppressMessages
Return eMessages Or eMessage
End Function
Public Function RemoveMessageField(ByVal eMessages As eSuppressMessages, ByVal eMessage As eSuppressMessages) As eSuppressMessages
Return eMessages And (Not eMessage)
End Function
End Class End Class
+1 -1
View File
@@ -153,7 +153,7 @@
Dim hshParams As Hashtable Dim hshParams As Hashtable
Dim oParamList As New List(Of Hashtable) Dim oParamList As New List(Of Hashtable)
sSQL = "INSERT OR REPLACE INTO tags VALUES (COALESCE((SELECT TagID FROM tags WHERE Name = @Name), @ID), @Name); INSERT INTO gametags VALUES ((SELECT TagID from tags WHERE Name=@Name), @MonitorID);" sSQL = "INSERT OR REPLACE INTO tags VALUES (COALESCE((SELECT TagID FROM tags WHERE Name = @Name), @ID), @Name); INSERT OR REPLACE INTO gametags VALUES ((SELECT TagID from tags WHERE Name=@Name), @MonitorID);"
For Each oGame As clsGame In hshTags.Values For Each oGame As clsGame In hshTags.Values
sMonitorID = oGame.ID sMonitorID = oGame.ID
For Each t As Tag In oGame.ImportTags For Each t As Tag In oGame.ImportTags
+25
View File
@@ -154,4 +154,29 @@
Return hshList Return hshList
End Function End Function
Public Shared Function GetReservedVariables() As List(Of String)
Dim oList As New List(Of String)
oList.Add("APPDATA")
oList.Add("LOCALAPPDATA")
oList.Add("USERDOCUMENTS")
oList.Add("COMMONDOCUMENTS")
oList.Add("USERPROFILE")
Return oList
End Function
Public Shared Function CheckForReservedVariables(ByVal sPath As String) As Boolean
Dim s As String
For Each s In GetReservedVariables()
s = "%" & s & "%"
If sPath.Contains(s) Then
Return True
End If
Next
Return False
End Function
End Class End Class
+16 -11
View File
@@ -6,48 +6,54 @@ Imports System.Net
Public Class mgrXML Public Class mgrXML
Public Shared Function ReadMonitorList(ByVal sLocation As String, ByRef oExportInfo As ExportData, Optional ByVal bWebRead As Boolean = False) As Hashtable Public Shared Function ReadMonitorList(ByVal sLocation As String, ByRef oExportInfo As ExportData, ByRef hshList As Hashtable, Optional ByVal bWebRead As Boolean = False) As Boolean
Dim oList As List(Of Game) Dim oList As List(Of Game)
Dim hshList As New Hashtable
Dim hshDupeList As New Hashtable Dim hshDupeList As New Hashtable
Dim oExportData As ExportData Dim oExportData As New 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 False
End If
If Not ImportandDeserialize(sLocation, oExportData, bWebRead) Then
Return False
End If End If
oExportData = ImportandDeserialize(sLocation, bWebRead)
oList = oExportData.Configurations oList = oExportData.Configurations
oExportInfo = oExportData oExportInfo = oExportData
For Each g As Game In oList For Each g As Game In oList
oGame = New clsGame oGame = New clsGame
oGame.ID = g.ID
oGame.Name = g.Name oGame.Name = g.Name
oGame.ProcessName = g.ProcessName oGame.ProcessName = g.ProcessName
oGame.AbsolutePath = g.AbsolutePath oGame.AbsolutePath = g.AbsolutePath
oGame.Path = g.Path oGame.Path = g.Path
oGame.FolderSave = g.FolderSave oGame.FolderSave = g.FolderSave
oGame.AppendTimeStamp = g.AppendTimeStamp
oGame.BackupLimit = g.BackupLimit
oGame.FileType = g.FileType oGame.FileType = g.FileType
oGame.ExcludeList = g.ExcludeList oGame.ExcludeList = g.ExcludeList
oGame.MonitorOnly = g.MonitorOnly oGame.MonitorOnly = g.MonitorOnly
oGame.Parameter = g.Parameter oGame.Parameter = g.Parameter
oGame.Comments = g.Comments oGame.Comments = g.Comments
oGame.IsRegEx = g.IsRegEx
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
'This should be wrapped just in case we get some bad data 'This should be wrapped just in case we get some bad data
Try Try
hshList.Add(oGame.ProcessName & ":" & oGame.Name, oGame) hshList.Add(oGame.ID, oGame)
Catch e As Exception Catch e As Exception
'Do Nothing 'Do Nothing
End Try End Try
Next Next
Return hshList Return True
End Function End Function
Private Shared Function ReadImportData(ByVal sLocation As String, ByVal bWebRead As Boolean) Private Shared Function ReadImportData(ByVal sLocation As String, ByVal bWebRead As Boolean)
@@ -64,10 +70,9 @@ Public Class mgrXML
Return oReader Return oReader
End Function End Function
Public Shared Function ImportandDeserialize(ByVal sLocation As String, Optional ByVal bWebRead As Boolean = False) As ExportData Public Shared Function ImportandDeserialize(ByVal sLocation As String, ByRef oExportData As ExportData, Optional ByVal bWebRead As Boolean = False) As Boolean
Dim oReader As StreamReader Dim oReader As StreamReader
Dim oSerializer As XmlSerializer Dim oSerializer As XmlSerializer
Dim oExportData As New ExportData
Try Try
oReader = ReadImportData(sLocation, bWebRead) oReader = ReadImportData(sLocation, bWebRead)
@@ -82,12 +87,12 @@ Public Class mgrXML
oExportData.Configurations = oSerializer.Deserialize(oReader) oExportData.Configurations = oSerializer.Deserialize(oReader)
oReader.Close() oReader.Close()
End If End If
Return True
Catch ex As Exception Catch ex As Exception
mgrCommon.ShowMessage(mgrXML_ErrorImportFailure, ex.Message, MsgBoxStyle.Exclamation) mgrCommon.ShowMessage(mgrXML_ErrorImportFailure, ex.Message, MsgBoxStyle.Exclamation)
Return False
End Try End Try
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
+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 © 2017 Michael J. Seiferling")> <Assembly: AssemblyCopyright("Copyright © 2018 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("1.0.5.*")> <Assembly: AssemblyVersion("1.1.5.*")>
<Assembly: AssemblyFileVersion("1.0.5.0")> <Assembly: AssemblyFileVersion("1.1.5.0")>
<Assembly: NeutralResourcesLanguageAttribute("en")> <Assembly: NeutralResourcesLanguageAttribute("en")>
+1036 -62
View File
File diff suppressed because it is too large Load Diff
+361 -37
View File
@@ -133,9 +133,6 @@
<data name="frmMain_ManifestTotalRemoved" xml:space="preserve"> <data name="frmMain_ManifestTotalRemoved" xml:space="preserve">
<value>[PARAM] entries were removed from the local manifest.</value> <value>[PARAM] entries were removed from the local manifest.</value>
</data> </data>
<data name="frmMain_ConfirmManifestClean" xml:space="preserve">
<value>This tool removes orphaned backup information from the local manifest based on the current backup folder. Data can become orphaned when backups are deleted by various computers that share the same backup folder on a cloud or network.[BR][BR]When alternating between different backup folders you should NOT use this tool.[BR][BR]Do you wish to proceed?</value>
</data>
<data name="frmMain_ConfirmRebuild" xml:space="preserve"> <data name="frmMain_ConfirmRebuild" xml:space="preserve">
<value>This will rebuild all databases and shrink them to an optimal size.[BR]This should only be used if your gbm.s3db files are becoming very large.[BR][BR]Do you wish to continue?</value> <value>This will rebuild all databases and shrink them to an optimal size.[BR]This should only be used if your gbm.s3db files are becoming very large.[BR][BR]Do you wish to continue?</value>
</data> </data>
@@ -269,7 +266,7 @@
<value>Last Game: [PARAM]</value> <value>Last Game: [PARAM]</value>
</data> </data>
<data name="frmMain_ManualBackup" xml:space="preserve"> <data name="frmMain_ManualBackup" xml:space="preserve">
<value>A manaul backup of [PARAM] was triggered.</value> <value>A manual backup of [PARAM] was triggered.</value>
</data> </data>
<data name="frmMain_MasterListChanged" xml:space="preserve"> <data name="frmMain_MasterListChanged" xml:space="preserve">
<value>The master game list has been changed by a program other than GBM.</value> <value>The master game list has been changed by a program other than GBM.</value>
@@ -392,13 +389,13 @@
<value>Add Game &amp;Wizard...</value> <value>Add Game &amp;Wizard...</value>
</data> </data>
<data name="frmMain_gMonSetupCustomVariables" xml:space="preserve"> <data name="frmMain_gMonSetupCustomVariables" xml:space="preserve">
<value>Custom &amp;Path Variables...</value> <value>Custom Path &amp;Variables...</value>
</data> </data>
<data name="frmMain_gMonSetupGameManager" xml:space="preserve"> <data name="frmMain_gMonSetupGameManager" xml:space="preserve">
<value>&amp;Game Manager...</value> <value>&amp;Game Manager...</value>
</data> </data>
<data name="frmMain_gMonSetupTags" xml:space="preserve"> <data name="frmMain_gMonSetupTags" xml:space="preserve">
<value>&amp;Tags...</value> <value>&amp;Tag Manager...</value>
</data> </data>
<data name="frmMain_gMonStripStatusButton" xml:space="preserve"> <data name="frmMain_gMonStripStatusButton" xml:space="preserve">
<value>Monitor Status:</value> <value>Monitor Status:</value>
@@ -406,9 +403,6 @@
<data name="frmMain_gMonTools" xml:space="preserve"> <data name="frmMain_gMonTools" xml:space="preserve">
<value>&amp;Tools</value> <value>&amp;Tools</value>
</data> </data>
<data name="frmMain_gMonToolsCleanMan" xml:space="preserve">
<value>Clea&amp;n Local Manifest</value>
</data>
<data name="frmMain_gMonToolsCompact" xml:space="preserve"> <data name="frmMain_gMonToolsCompact" xml:space="preserve">
<value>&amp;Compact Databases</value> <value>&amp;Compact Databases</value>
</data> </data>
@@ -437,7 +431,7 @@
<value>&amp;Backup</value> <value>&amp;Backup</value>
</data> </data>
<data name="frmGameManager_btnCancel" xml:space="preserve"> <data name="frmGameManager_btnCancel" xml:space="preserve">
<value>&amp;Cancel</value> <value>Ca&amp;ncel</value>
</data> </data>
<data name="frmGameManager_btnClose" xml:space="preserve"> <data name="frmGameManager_btnClose" xml:space="preserve">
<value>C&amp;lose</value> <value>C&amp;lose</value>
@@ -461,7 +455,7 @@
<value>&amp;Import</value> <value>&amp;Import</value>
</data> </data>
<data name="frmGameManager_btnInclude" xml:space="preserve"> <data name="frmGameManager_btnInclude" xml:space="preserve">
<value>In&amp;clude Items...</value> <value>Incl&amp;ude Items...</value>
</data> </data>
<data name="frmGameManager_btnMarkAsRestored" xml:space="preserve"> <data name="frmGameManager_btnMarkAsRestored" xml:space="preserve">
<value>&amp;Mark as Restored</value> <value>&amp;Mark as Restored</value>
@@ -485,7 +479,7 @@
<value>...</value> <value>...</value>
</data> </data>
<data name="frmGameManager_btnTags" xml:space="preserve"> <data name="frmGameManager_btnTags" xml:space="preserve">
<value>Tags...</value> <value>&amp;Tags...</value>
</data> </data>
<data name="frmGameManager_chkEnabled" xml:space="preserve"> <data name="frmGameManager_chkEnabled" xml:space="preserve">
<value>Monitor this game</value> <value>Monitor this game</value>
@@ -554,7 +548,7 @@
<value>[PARAM] is already up to date.[BR][BR]Would you like to restore this backup anyway?</value> <value>[PARAM] is already up to date.[BR][BR]Would you like to restore this backup anyway?</value>
</data> </data>
<data name="frmGameManager_ErrorGameDupe" xml:space="preserve"> <data name="frmGameManager_ErrorGameDupe" xml:space="preserve">
<value>A game with this exact name and process already exists.</value> <value>A game with the same ID ([PARAM]) already exists.</value>
</data> </data>
<data name="frmGameManager_ErrorNoBackupData" xml:space="preserve"> <data name="frmGameManager_ErrorNoBackupData" xml:space="preserve">
<value>The selected game(s) have no backup data or can't be restored with their current configuration.</value> <value>The selected game(s) have no backup data or can't be restored with their current configuration.</value>
@@ -596,7 +590,7 @@
<value>Include</value> <value>Include</value>
</data> </data>
<data name="frmGameManager_IncludeShortcut" xml:space="preserve"> <data name="frmGameManager_IncludeShortcut" xml:space="preserve">
<value>In&amp;clude</value> <value>Incl&amp;ude</value>
</data> </data>
<data name="frmGameManager_Items" xml:space="preserve"> <data name="frmGameManager_Items" xml:space="preserve">
<value>Items...</value> <value>Items...</value>
@@ -776,7 +770,7 @@
<value>Saved Game Folder:</value> <value>Saved Game Folder:</value>
</data> </data>
<data name="frmAddWizard_lblStep1Instructions" xml:space="preserve"> <data name="frmAddWizard_lblStep1Instructions" xml:space="preserve">
<value>The name will be automatically filtered for length and invalid characters. You may drag and drop a shortcut here to complete this step, only Windows shortcuts are currently supported.</value> <value>You may drag and drop a shortcut here to complete this step, only Windows shortcuts are currently supported.</value>
</data> </data>
<data name="frmAddWizard_lblStep1Intro" xml:space="preserve"> <data name="frmAddWizard_lblStep1Intro" xml:space="preserve">
<value>Enter the name of the game to monitor:</value> <value>Enter the name of the game to monitor:</value>
@@ -785,7 +779,7 @@
<value>Game Name</value> <value>Game Name</value>
</data> </data>
<data name="frmAddWizard_lblStep2Instructions" xml:space="preserve"> <data name="frmAddWizard_lblStep2Instructions" xml:space="preserve">
<value>Some games use launchers. Do not monitor launchers, be sure to choose the game's actual exe file. You may drag and drop a shortcut here to complete this step, only Windows shortcuts are currently supported.</value> <value>Some games use launchers. Do not monitor launchers, be sure to choose the game's actual executable file. You may drag and drop a shortcut here to complete this step, only Windows shortcuts are currently supported.</value>
</data> </data>
<data name="frmAddWizard_lblStep2Intro" xml:space="preserve"> <data name="frmAddWizard_lblStep2Intro" xml:space="preserve">
<value>Choose the game's executable file or shortcut:</value> <value>Choose the game's executable file or shortcut:</value>
@@ -926,7 +920,7 @@
<value>&amp;Close</value> <value>&amp;Close</value>
</data> </data>
<data name="frmGameTags_btnOpenTags" xml:space="preserve"> <data name="frmGameTags_btnOpenTags" xml:space="preserve">
<value>Setup &amp;Tags...</value> <value>&amp;Tag Manager...</value>
</data> </data>
<data name="frmGameTags_btnRemove" xml:space="preserve"> <data name="frmGameTags_btnRemove" xml:space="preserve">
<value>&lt;</value> <value>&lt;</value>
@@ -989,7 +983,7 @@
<value>Individual Files</value> <value>Individual Files</value>
</data> </data>
<data name="frmIncludeExclude_RawEditInfo" xml:space="preserve"> <data name="frmIncludeExclude_RawEditInfo" xml:space="preserve">
<value>Items are semi-colon delimited.</value> <value>Items are colon delimited.</value>
</data> </data>
<data name="frmIncludeExclude_RawEditTitle" xml:space="preserve"> <data name="frmIncludeExclude_RawEditTitle" xml:space="preserve">
<value>[PARAM] Raw Edit</value> <value>[PARAM] Raw Edit</value>
@@ -1081,11 +1075,8 @@
<data name="frmSettings_chkStartWindows" xml:space="preserve"> <data name="frmSettings_chkStartWindows" xml:space="preserve">
<value>Start with Windows</value> <value>Start with Windows</value>
</data> </data>
<data name="frmSettings_chkSupressBackup" xml:space="preserve"> <data name="frmSettings_chkSuppressBackup" xml:space="preserve">
<value>Backup only when session time exceeds</value> <value>Ignore sessions shorter than</value>
</data>
<data name="frmSettings_chkSync" xml:space="preserve">
<value>Enable syncing</value>
</data> </data>
<data name="frmSettings_chkTimeTracking" xml:space="preserve"> <data name="frmSettings_chkTimeTracking" xml:space="preserve">
<value>Enable time tracking</value> <value>Enable time tracking</value>
@@ -1097,10 +1088,10 @@
<value>Settings</value> <value>Settings</value>
</data> </data>
<data name="frmSettings_grpStartup" xml:space="preserve"> <data name="frmSettings_grpStartup" xml:space="preserve">
<value>Startup</value> <value>Startup Options</value>
</data> </data>
<data name="frmSettings_grpFolderOptions" xml:space="preserve"> <data name="frmSettings_grpFolderOptions" xml:space="preserve">
<value>Folders</value> <value>Files and Folders</value>
</data> </data>
<data name="frmSettings_lblBackupFolder" xml:space="preserve"> <data name="frmSettings_lblBackupFolder" xml:space="preserve">
<value>Backup Folder:</value> <value>Backup Folder:</value>
@@ -1135,9 +1126,6 @@
<data name="frmStartUpWizard_chkCreateFolder" xml:space="preserve"> <data name="frmStartUpWizard_chkCreateFolder" xml:space="preserve">
<value>Create a sub-folder for each game</value> <value>Create a sub-folder for each game</value>
</data> </data>
<data name="frmStartUpWizard_chkSync" xml:space="preserve">
<value>Import any existing GBM data in the backup folder</value>
</data>
<data name="frmStartUpWizard_ConfirmOfficialImport" xml:space="preserve"> <data name="frmStartUpWizard_ConfirmOfficialImport" xml:space="preserve">
<value>Would you like to choose games to import from the official list?[BR][BR]This requires an active internet connection.</value> <value>Would you like to choose games to import from the official list?[BR][BR]This requires an active internet connection.</value>
</data> </data>
@@ -1166,7 +1154,7 @@
<value>Welcome to GBM</value> <value>Welcome to GBM</value>
</data> </data>
<data name="frmStartUpWizard_lblStep2Instructions" xml:space="preserve"> <data name="frmStartUpWizard_lblStep2Instructions" xml:space="preserve">
<value>GBM will store all your backup files along with a manifest database (gbm.s3db) in this location. </value> <value>GBM will store all your backup files along with a manifest database (gbm.s3db) in this location. Any existing GBM data in this folder will be automatically imported.</value>
</data> </data>
<data name="frmStartUpWizard_lblStep2Intro" xml:space="preserve"> <data name="frmStartUpWizard_lblStep2Intro" xml:space="preserve">
<value>Choose where GBM saves your backup files:</value> <value>Choose where GBM saves your backup files:</value>
@@ -1220,7 +1208,7 @@
<value>You must enter a valid tag name.</value> <value>You must enter a valid tag name.</value>
</data> </data>
<data name="frmTags_FormName" xml:space="preserve"> <data name="frmTags_FormName" xml:space="preserve">
<value>Tags</value> <value>Tag Manager</value>
</data> </data>
<data name="frmTags_grpTag" xml:space="preserve"> <data name="frmTags_grpTag" xml:space="preserve">
<value>Configuration</value> <value>Configuration</value>
@@ -1292,7 +1280,7 @@
<value>[PARAM] backup completed with warnings.</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 more recent backup for [PARAM] that has not been restored on this computer.[BR][BR]Do you want to overwrite this file anyway?</value>
</data> </data>
<data name="mgrBackup_ConfirmOverwrite" xml:space="preserve"> <data name="mgrBackup_ConfirmOverwrite" xml:space="preserve">
<value>A file with the same name already exists in the backup folder.[BR][BR]Do you want to overwrite this file?</value> <value>A file with the same name already exists in the backup folder.[BR][BR]Do you want to overwrite this file?</value>
@@ -1319,7 +1307,7 @@
<value>[PARAM] backup aborted by user due to overwrite.</value> <value>[PARAM] backup aborted by user due to overwrite.</value>
</data> </data>
<data name="mgrBackup_ErrorSubFolderCreate" xml:space="preserve"> <data name="mgrBackup_ErrorSubFolderCreate" xml:space="preserve">
<value>Backup aborted. A failure occured while creating a backup sub-folder for [PARAM].[BR][PARAM]</value> <value>A failure occured while creating a backup sub-folder for [PARAM].[BR][PARAM]</value>
</data> </data>
<data name="mgrBackup_GenerateHash" xml:space="preserve"> <data name="mgrBackup_GenerateHash" xml:space="preserve">
<value>Generating SHA-256 hash for [PARAM] backup file.</value> <value>Generating SHA-256 hash for [PARAM] backup file.</value>
@@ -1610,7 +1598,7 @@
<value>A backup cannot be run on the selected game(s) with their current configuration.</value> <value>A backup cannot be run on the selected game(s) with their current configuration.</value>
</data> </data>
<data name="frmSettings_btnOptionalFields" xml:space="preserve"> <data name="frmSettings_btnOptionalFields" xml:space="preserve">
<value>Choose &amp;Optional Fields...</value> <value>Choose &amp;Optional Sync Fields...</value>
</data> </data>
<data name="frmSyncFields_btnCancel" xml:space="preserve"> <data name="frmSyncFields_btnCancel" xml:space="preserve">
<value>&amp;Cancel</value> <value>&amp;Cancel</value>
@@ -1649,7 +1637,7 @@
<value>Autosave log when max length is exceeded</value> <value>Autosave log when max length is exceeded</value>
</data> </data>
<data name="frmSettings_grpGameData" xml:space="preserve"> <data name="frmSettings_grpGameData" xml:space="preserve">
<value>Game Data</value> <value>Game Data Options</value>
</data> </data>
<data name="frmSettings_lstSettings_7z" xml:space="preserve"> <data name="frmSettings_lstSettings_7z" xml:space="preserve">
<value>7-Zip</value> <value>7-Zip</value>
@@ -1777,9 +1765,6 @@
<data name="frmGameManager_lblParameter" xml:space="preserve"> <data name="frmGameManager_lblParameter" xml:space="preserve">
<value>Parameter:</value> <value>Parameter:</value>
</data> </data>
<data name="frmGameManager_ErrorProcessParameterDupe" xml:space="preserve">
<value>A game with this exact process and parameter already exists.</value>
</data>
<data name="mgrCommon_B" xml:space="preserve"> <data name="mgrCommon_B" xml:space="preserve">
<value>[PARAM] B</value> <value>[PARAM] B</value>
</data> </data>
@@ -1945,4 +1930,343 @@
<data name="frmSettings_chkSessionTracking" xml:space="preserve"> <data name="frmSettings_chkSessionTracking" xml:space="preserve">
<value>Enable session tracking</value> <value>Enable session tracking</value>
</data> </data>
<data name="frmSettings_WarningAdminStart" xml:space="preserve">
<value>Please note that GBM will not "Start with Windows" as Administrator.[BR][BR]See the Online Manual in the Help menu for details.</value>
</data>
<data name="frmSessions_ColumnHours" xml:space="preserve">
<value>Hours</value>
</data>
<data name="frmSessions_lblTotalHours" xml:space="preserve">
<value>Total Hours: [PARAM]</value>
</data>
<data name="frmSessions_ChooseExportLocation" xml:space="preserve">
<value>Choose a location for the export file</value>
</data>
<data name="frmSessions_CSV" xml:space="preserve">
<value>CSV</value>
</data>
<data name="frmSessions_DefaultExportFileName" xml:space="preserve">
<value>Game Session Export</value>
</data>
<data name="frmSessions_XML" xml:space="preserve">
<value>XML</value>
</data>
<data name="mgrSessions_ErrorExportFailure" xml:space="preserve">
<value>An error occured exporting the session data.[BR][BR][PARAM]</value>
</data>
<data name="mgrSessions_ExportSuccess" xml:space="preserve">
<value>The data has been exported successfully.</value>
</data>
<data name="frmSessionExport_btnCancel" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="frmSessionExport_btnExport" xml:space="preserve">
<value>&amp;Export</value>
</data>
<data name="frmSessionExport_chkCSVHeaders" xml:space="preserve">
<value>Export Column Headers (CSV)</value>
</data>
<data name="frmSessionExport_FormName" xml:space="preserve">
<value>Session Export Options</value>
</data>
<data name="frmSessionExport_grpDateType" xml:space="preserve">
<value>Date Type</value>
</data>
<data name="frmSessionExport_grpExportType" xml:space="preserve">
<value>Export Type</value>
</data>
<data name="frmSessionExport_grpOptions" xml:space="preserve">
<value>Other Options</value>
</data>
<data name="frmSessionExport_optCSV" xml:space="preserve">
<value>CSV</value>
</data>
<data name="frmSessionExport_optCurrentLocale" xml:space="preserve">
<value>Current Locale</value>
</data>
<data name="frmSessionExport_optUnix" xml:space="preserve">
<value>Unix Timestamp</value>
</data>
<data name="frmSessionExport_optXML" xml:space="preserve">
<value>XML</value>
</data>
<data name="frmSessions_btnExport" xml:space="preserve">
<value>&amp;Export Grid</value>
</data>
<data name="frmFilter_FieldIsRegEx" xml:space="preserve">
<value>Regular Expression</value>
</data>
<data name="frmGameManager_chkRegEx" xml:space="preserve">
<value>Regular Expression</value>
</data>
<data name="frmGameManager_lblComments" xml:space="preserve">
<value>Comments:</value>
</data>
<data name="AppURL_RegExr" xml:space="preserve">
<value>http://regexr.com/?expression=[PARAM]&amp;text=test</value>
</data>
<data name="frmGameManager_ErrorRegExFailure" xml:space="preserve">
<value>The process is not a a valid regular expression.[BR][BR]Would you like help validating and testing your regular expression? [BR][BR]This will open your web browser and requires the internet.</value>
</data>
<data name="frmGameManager_btnGameID" xml:space="preserve">
<value>&amp;Game ID...</value>
</data>
<data name="frmGameManager_GameIDEditInfo" xml:space="preserve">
<value>The unique Game ID is generated by GBM. Changing this value is not recommended.</value>
</data>
<data name="frmGameManager_GameIDEditTitle" xml:space="preserve">
<value>Edit Game ID</value>
</data>
<data name="frmFilter_FieldGameID" xml:space="preserve">
<value>Game ID</value>
</data>
<data name="mgrMonitorList_ConfirmInitialOfficialGameIDSync" xml:space="preserve">
<value>GBM now uses a unique identifier for each game. For the import feature to recognize game configurations from a prior version, they need to use the same identifiers.[BR][BR]Do you want to sync your game identifiers with the official list?[BR][BR]This feature is available anytime from the "Tools" menu. If you use GBM on multiple PCs, please see "Tools" section of the online manual before using this feature.</value>
</data>
<data name="mgrMonitorList_ErrorGameIDVerFailure" xml:space="preserve">
<value>This file cannot be used to sync game indentifiers. It was created with an older version of GBM.</value>
</data>
<data name="mgrMonitorList_ImportVersionWarning" xml:space="preserve">
<value>This export file was created with a version of GBM prior to 1.1.5 and may contain incompatible configuration data.[BR][BR]Do you still want to import configurations from this file? (Not Recommended)</value>
</data>
<data name="mgrMonitorList_ConfirmFileGameIDSync" xml:space="preserve">
<value>Do you want to sync your game identifiers with this export file?[BR][BR]You should only do this if you're managing your own game configurations. If you use GBM on multiple PCs, please see "Tools" section of the online manual before using this feature.</value>
</data>
<data name="frmMain_gMonToolsSyncGameID" xml:space="preserve">
<value>S&amp;ync Game IDs</value>
</data>
<data name="frmMain_gMonToolsSyncGameIDFile" xml:space="preserve">
<value>&amp;File...</value>
</data>
<data name="frmMain_gMonToolsSyncGameIDOfficial" xml:space="preserve">
<value>&amp;Official List...</value>
</data>
<data name="mgrMonitorList_ConfirmOfficialGameIDSync" xml:space="preserve">
<value>Do you want to sync your game identifiers with the official game list?[BR][BR]This allows the import feature to recognize game configurations from a prior version. If you use GBM on multiple PCs, please see "Tools" section of the online manual before using this feature.</value>
</data>
<data name="frmSettings_btnResetMessages" xml:space="preserve">
<value>&amp;Reset Warnings</value>
</data>
<data name="frmSettings_ConfirmMessageReset" xml:space="preserve">
<value>Do you want to reset all hidden warnings and messages?</value>
</data>
<data name="Icon_New" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\New.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="Icon_Update" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Update.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
</data>
<data name="mgrMonitorList_GameIDSyncCompleted" xml:space="preserve">
<value>Sync Complete.[BR][BR][PARAM] game configurations were matched and updated.</value>
</data>
<data name="App_BackupOnLaunchFileDescription" xml:space="preserve">
<value>launch</value>
</data>
<data name="frmSettings_chkBackupOnLaunch" xml:space="preserve">
<value>Backup GBM data files on launch</value>
</data>
<data name="frmMain_ErrorEndChildProcess" xml:space="preserve">
<value>An error occured when attempting to end a process associated with [PARAM].</value>
</data>
<data name="frmMain_ErrorStartChildProcess" xml:space="preserve">
<value>An error occured when attempting to start a process associated with [PARAM].</value>
</data>
<data name="frmProcessManager_btnAdd" xml:space="preserve">
<value>+</value>
</data>
<data name="frmProcessManager_btnCancel" xml:space="preserve">
<value>&amp;Cancel</value>
</data>
<data name="frmProcessManager_btnClose" xml:space="preserve">
<value>C&amp;lose</value>
</data>
<data name="frmProcessManager_btnDelete" xml:space="preserve">
<value>-</value>
</data>
<data name="frmProcessManager_btnProcessBrowse" xml:space="preserve">
<value>...</value>
</data>
<data name="frmProcessManager_btnSave" xml:space="preserve">
<value>&amp;Save</value>
</data>
<data name="frmProcessManager_ConfirmDelete" xml:space="preserve">
<value>Are you sure you want to delete [PARAM]? This cannot be undone.</value>
</data>
<data name="frmProcessManager_ErrorDupe" xml:space="preserve">
<value>A process with this name already exists.</value>
</data>
<data name="frmProcessManager_ErrorPathNotFound" xml:space="preserve">
<value>The process does not exist.</value>
</data>
<data name="frmProcessManager_ErrorValidName" xml:space="preserve">
<value>You must enter a valid name for this process.</value>
</data>
<data name="frmProcessManager_ErrorValidPath" xml:space="preserve">
<value>You must choose a valid process.</value>
</data>
<data name="frmProcessManager_FormName" xml:space="preserve">
<value>Process Manager</value>
</data>
<data name="frmProcessManager_grpProcess" xml:space="preserve">
<value>Configuration</value>
</data>
<data name="frmProcessManager_lblName" xml:space="preserve">
<value>Name:</value>
</data>
<data name="frmProcessManager_lblPath" xml:space="preserve">
<value>Path:</value>
</data>
<data name="frmMain_gMonSetupProcessManager" xml:space="preserve">
<value>&amp;Process Manager...</value>
</data>
<data name="frmProcessManager_ChooseProcess" xml:space="preserve">
<value>Choose a file that starts the process</value>
</data>
<data name="frmProcessManager_Executable" xml:space="preserve">
<value>Executable</value>
</data>
<data name="frmProcessManager_chkKillProcess" xml:space="preserve">
<value>Kill process when game is closed</value>
</data>
<data name="frmGameProcesses_btnAdd" xml:space="preserve">
<value>&gt;</value>
</data>
<data name="frmGameProcesses_btnClose" xml:space="preserve">
<value>&amp;Close</value>
</data>
<data name="frmGameProcesses_btnOpenProcesses" xml:space="preserve">
<value>&amp;Process Manager...</value>
</data>
<data name="frmGameProcesses_btnRemove" xml:space="preserve">
<value>&lt;</value>
</data>
<data name="frmGameProcesses_FormNameMulti" xml:space="preserve">
<value>Edit Processes for Multiple Games</value>
</data>
<data name="frmGameProcesses_FormNameSingle" xml:space="preserve">
<value>Edit Processes for [PARAM]</value>
</data>
<data name="frmGameProcesses_lblGameProccesses" xml:space="preserve">
<value>Current Processes</value>
</data>
<data name="frmGameProcesses_lblProcesses" xml:space="preserve">
<value>Available Processes</value>
</data>
<data name="App_GenericError" xml:space="preserve">
<value>Error: [PARAM]</value>
</data>
<data name="frmMain_ProcessKilled" xml:space="preserve">
<value>Kill signal was sent for [PARAM].</value>
</data>
<data name="frmMain_ProcessStarted" xml:space="preserve">
<value>[PARAM] has been started.</value>
</data>
<data name="frmSettings_chkUseGameID" xml:space="preserve">
<value>Use Game ID for folder and file names</value>
</data>
<data name="mgrMonitorList_ErrorSyncCancel" xml:space="preserve">
<value>The sync was aborted by the user.</value>
</data>
<data name="mgrMonitorList_WarningSyncProtection" xml:space="preserve">
<value>The database GBM is attempting to sync with appears to be empty, syncing with this database will delete all data. Do you still want to sync with this database? (Not Recommended)</value>
</data>
<data name="frmSettings_chkDisableSyncMessages" xml:space="preserve">
<value>Disable sync event messages</value>
</data>
<data name="frmSettings_grpBackupConfirmations" xml:space="preserve">
<value>Backup Confirmations</value>
</data>
<data name="frmSettings_grpGameMonitoringOptions" xml:space="preserve">
<value>Game Monitoring Options</value>
</data>
<data name="frmSettings_grpLogOptions" xml:space="preserve">
<value>Log Options</value>
</data>
<data name="frmSettings_lstSettings_Startup" xml:space="preserve">
<value>Startup</value>
</data>
<data name="mgrBackup_ConfirmOverwriteRelative" xml:space="preserve">
<value>A file with the same name already exists in the backup folder.[BR][BR]This game stores saves in a relative location, you may need to restore the current backup if the game was recently re-installed.[BR][BR]Do you want to overwrite this file?</value>
</data>
<data name="mgrPath_SpecialPathError" xml:space="preserve">
<value>An error occured while determining a required system path. [BR][BR]The environment value for [PARAM] is empty.[BR][BR]The application will now exit.</value>
</data>
<data name="frmMain_ErrorGameDetails" xml:space="preserve">
<value>An error occured while obtaining the details of the detected game.</value>
</data>
<data name="frmMain_ErrorGameIcon" xml:space="preserve">
<value>An error occured while extracting the executable icon.</value>
</data>
<data name="frmGameManager_ErrorRenameFilesExist" xml:space="preserve">
<value>The backup folder contains one or more backup files that cannot be renamed to [PARAM] because a file using that name already exists.[BR][BR]Do you want to continue and remove the existing files?</value>
</data>
<data name="frmGameManager_ErrorRenameFolderExists" xml:space="preserve">
<value>The backup folder [PARAM] cannot be renamed to [PARAM] because a folder with that name already exists.[BR][BR]Do you want to continue and remove the existing folder?</value>
</data>
<data name="frmMain_WinePrefix" xml:space="preserve">
<value>[PARAM] Wine Prefix: [PARAM]</value>
</data>
<data name="frmMain_WineSavePath" xml:space="preserve">
<value>[PARAM] Converted Save Path: [PARAM]</value>
</data>
<data name="mgrPath_ErrorBuildingWinePath" xml:space="preserve">
<value>An error occured when building a Wine path.[BR][BR][PARAM]</value>
</data>
<data name="mgrPath_ErrorConvertWineSavePath" xml:space="preserve">
<value>An error occured when converting to a Wine save path.[BR][BR][PARAM]</value>
</data>
<data name="mgrPath_ErrorWinePrefix" xml:space="preserve">
<value>An error occured when determining a Wine prefix.[BR][BR][PARAM]</value>
</data>
<data name="mgrPath_ErrorUnixEnv" xml:space="preserve">
<value>An error occured while building a list of environment variables.[BR][BR][PARAM]</value>
</data>
<data name="frmSettings_chkShowResolvedPaths" xml:space="preserve">
<value>Show resolved save paths in Game Manager</value>
</data>
<data name="frmGameManager_7zBackup" xml:space="preserve">
<value>7-Zip</value>
</data>
<data name="frmGameManager_btnImportBackup" xml:space="preserve">
<value>Import B&amp;ackup Files</value>
</data>
<data name="frmGameManager_Choose7zImport" xml:space="preserve">
<value>Choose compatible backup file(s)</value>
</data>
<data name="frmGameManager_ConfirmBackupImport" xml:space="preserve">
<value>Are you sure you want to import the selected file(s) for [PARAM]. This will close the form.</value>
</data>
<data name="mgrBackup_ErrorImportBackupCopy" xml:space="preserve">
<value>Failed to import [PARAM], the file could not be copied.</value>
</data>
<data name="mgrBackup_ImportedFile" xml:space="preserve">
<value>Imported Backup</value>
</data>
<data name="mgrBackup_ImportSuccess" xml:space="preserve">
<value>Imported backup file [PARAM] for [PARAM].</value>
</data>
<data name="frmGameManager_btnProcesses" xml:space="preserve">
<value>Pro&amp;cesses...</value>
</data>
<data name="frmGameManager_WarningImportBackup" xml:space="preserve">
<value>This feature is intended to import 7-Zip backup archives compatible with the selected game configuration.[BR][BR]GBM does NOT verify these files, you should only use files created by GBM or compatible archives created using the same settings as the current game configuration.[BR][BR]This message will only be shown once.</value>
</data>
<data name="frmVariableManager_ErrorVariableReserved" xml:space="preserve">
<value>[PARAM] is a reserved variable, you must enter a different name.</value>
</data>
<data name="frmGameManager_WarningImportBackupSaveMulti" xml:space="preserve">
<value>The "Save multiple backups" option must be enabled on this configuration to import multiple backup files.</value>
</data>
<data name="frmGameManager_cmsOfficialLinux" xml:space="preserve">
<value>&amp;Linux...</value>
</data>
<data name="frmGameManager_cmsOfficialWindows" xml:space="preserve">
<value>&amp;Windows...</value>
</data>
<data name="frmGameManager_WarningWinConfigsInLinux" xml:space="preserve">
<value>Official Windows configurations can be used in Linux for games running in Wine or Proton.[BR][BR]You do not need to modify these configurations, GBM will automatically do any required path conversions the first time the game is detected.[BR][BR]This message will only be shown once.</value>
</data>
<data name="frmGameManager_ConfirmBackupImportOverwriteSingle" xml:space="preserve">
<value>Importing this backup file will overwrite the current backup file for [PARAM].[BR][BR]Do you want to continue? This will close the form.</value>
</data>
</root> </root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 926 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 891 B

Binary file not shown.
Binary file not shown.
BIN
View File
Binary file not shown.

Before

Width:  |  Height:  |  Size: 170 KiB

After

Width:  |  Height:  |  Size: 358 KiB

+45 -18
View File
@@ -1,31 +1,58 @@
Game Backup Monitor v1.0.5 Readme Game Backup Monitor v1.1.5 Readme
http://mikemaximus.github.io/gbm-web/ http://mikemaximus.github.io/gbm-web/
gamebackupmonitor@gmail.com gamebackupmonitor@gmail.com
December 8, 2017 October 10th, 2018
New in 1.0.5 New in 1.1.5
All Platforms: All Platforms:
- You can now add Comments to a game configuration. - Fixed a crash that could occur when renaming a game configuration.
- You can now exclude tags and use negative filters on the Game Manager. - Rewrote portions of game detection:
- Fixed a bug causing backup size calculations to be incorrect when including sub-folders in a configuration. - The handling of duplicate game configurations has been flawed since regular expression support was added in v1.1. This has been fixed.
- 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. - GBM is now more efficient when detecting games by parameter and/or process path.
- 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. - Changed how save path variables are handled:
- Fixed a bug causing games not to be detected if more than one copy of the process was running. - GBM no longer uses it's own format and naming scheme for path variables.
- GBM can now save statistical data from each detected gaming session: - GBM now uses Windows environment variables in game configurations.
- This feature records the start and end time of each detected gaming session. In future versions more data may be available. - For example, *appdatalocal* is now %LOCALAPPDATA% in a Windows configuration.
- You can view session data using the new "Session Viewer" available in the Tools menu. - GBM also uses some custom environment variables, such as %USERDOCUMENTS% and %COMMONDOCUMENTS%. These are needed for compatability and to handle some limitations with how GBM interacts with 7-Zip.
- This feature is disabled by default. It can be enabled on the Setting screen. - GBM now uses the XDG specification for game configurations in Linux. (Thanks basxto!)
- Session data is stored locally, it is currently not synced with the backup folder. - For example, *appdatalocal* is now ${XDG_DATA_HOME:-~/.local/share} in a Linux configuration.
- Custom Path Variables have changed. For example, *Steam User Data* will now be %Steam User Data%.
- They will appear this way in Windows and Linux.
- GBM will no longer allow the creation of variables using reserved names, such as APPDATA.
- Your configurations will be automatically updated to these new formats when upgrading to v1.1.5.
- These changes will break game list compatability with other versions of GBM. Archived lists are available at http://mikemaximus.github.io/gbm-web/archive.html for those that wish to stay on an older version.
- Added a new setting, "Show resolved save paths in Game Manager".
- This new setting is enabled by default.
- When enabled, GBM will display resolved save paths in the Game Manager. This is how GBM displayed paths prior to v1.1.5.
- When disabled, GBM will display save paths with their variables when applicable.
- Added a tooltip to applicable "Path" fields on the Game Manager.
- This tooltip either displays either a resolved or unresolved path.
- The behaviour is toggled by the "Show resolved save paths" setting.
- Added "Import Backup Files" feature to the Game Manager.
- This feature allows you to import one or more backup files for a specific game configuration.
- This is useful if you lost your GBM database(s), but not the backup files. It also can be used to easily move compatible saved game backups between Windows and Linux.
- GBM cannot verify that the backups being imported are compatible with the current configuration. This is up to the user!
- This feature will be expanded and refined in future releases.
Windows Only: Linux:
- Only one instance of GBM can now be running. - Fixed an issue that prevented Wine / Proton games from being detected in some cases.
- GBM can now use any Windows configuration to detect and backup games running in Wine / Proton.
- An absolute Windows save path, such "%APPDATA%\Game\Saved Games" will be automatically converted to the proper path within the detected Wine prefix.
- The converted path will be saved to the configuration once game has been detected at least once.
- You cannot restore a backup using an absolute Windows path. The game needs to be detected at least once so the correct save path can be determined.
- This feature should be considered "Beta" and may not work in all scenarios. Please report any issues you may encounter!
Linux Only: Website:
- Added makefile for easy Linux installation. Thanks basxto! - Search features have been added to the Official Game Lists (Thanks basxto!)
- Includes advanced features such as searching by tag and excludes.
- Tags are now clickable for automatic searching of similar games.
- Searches are linkable.
- You can now link directly to a single configuration using the new link icon.
- Configurations intelligently collapse or uncollapse based on search results.
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.
+3 -1
View File
@@ -9,7 +9,9 @@ Game Backup Monitor is a simple, but flexible application that detects games as
**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 />
[Contribute to Game Backup Monitor](http://mikemaximus.github.io/gbm-web/contribute.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 /> [Preconfigured Windows Games](http://mikemaximus.github.io/gbm-web/GBM_Official.xml) <br />
[Preconfigured Linux Games](http://mikemaximus.github.io/gbm-web/GBM_Official_Linux.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/).
+10
View File
@@ -0,0 +1,10 @@
Package: gbm
Architecture: all
Maintainer: Sebastian Riedel <git@basxto.de>
Priority: optional
Version: 1.0.8
Homepage: https://mikemaximus.github.io/gbm-web/
Bugs: https://github.com/MikeMaximus/gbm/issues
Depends: mono-vbnc, libsqlite3-0, p7zip-full
Recommends: libnotify-bin
Description: Automatically backup your saved games!
+13
View File
@@ -0,0 +1,13 @@
#!/bin/sh
set -e
XDG_DESKTOP_MENU="`which xdg-desktop-menu 2> /dev/null`"
XDG_ICON_RESOURCE="`which xdg-icon-resource 2> /dev/null`"
if [ -x "$XDG_DESKTOP_MENU" ]; then
xdg-desktop-menu forceupdate --mode system;
fi
if [ -x "$XDG_ICON_RESOURCE" ]; then
xdg-icon-resource forceupdate --mode system;
fi
+1 -2
View File
@@ -6,9 +6,8 @@ Name=Game Backup Monitor
Comment=Monitors games and backs up their savegames Comment=Monitors games and backs up their savegames
Comment[de]=Beobachtet Spiele und sichert ihre Spielstände Comment[de]=Beobachtet Spiele und sichert ihre Spielstände
Path=/usr/local/bin
TryExec=mono TryExec=mono
Exec=mono gbm Exec=gbm
Terminal=false Terminal=false
Icon=gbm Icon=gbm
Executable
+45
View File
@@ -0,0 +1,45 @@
#!/bin/sh -e
# prepare
if [ -z "${XDG_DATA_HOME}" ]; then
XDG_DATA_HOME="${HOME}/.local/share"
fi
mkdir -p "${XDG_DATA_HOME}/gbm"
pidfile="${XDG_DATA_HOME}/gbm/pid"
# check whether pid file exists and process is running
if ( ! [ -e "${pidfile}" ] || ! pgrep -F "${pidfile}" ); then
# check for all dependencies
for prog in mono readlink df 7za;do
[ -n "`whereis -b ${prog} | cut -sd' ' -f2`" ] || (echo "Please install ${prog}" && exit 1);
done
for lib in libsqlite3;do
[ -n "`ldconfig -p | grep ${lib}`" ] || (echo "Please install ${lib}" && exit 1);
done
# directory this script is located in
dir="$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)"
echo "Located in ${dir}";
gbmpath='./';
# locate GBM.exe
if [ "${dir}" = '/usr/bin' ] && [ -s '/usr/share/gbm/GBM.exe' ]; then
gbmpath='/usr/share/gbm/';
elif [ "${dir}" = '/usr/local/bin' ] && [ -s '/usr/local/share/gbm/GBM.exe' ]; then
gbmpath='/usr/local/share/gbm/';
elif [ ! -s './GBM.exe' ]; then
echo 'GBM.exe not found';
exit 2;
fi
# pass our arguments to GBM and run it in background
mono --desktop "${gbmpath}GBM.exe" "$@" &
# store pid and wait for process to end
echo $! > "${pidfile}"
wait $!
rm "${pidfile}"
exit $?;
else
echo "GBM is already running"
exit 1;
fi
+29 -16
View File
@@ -1,31 +1,44 @@
ICONSIZES := 16 24 32 48 64 72 96 128 256 ICONSIZES := 16 24 32 48 64 72 96 128 256
IMGMAGICK := $(shell command -v convert 2> /dev/null) IMGMAGICK := $(shell command -v convert 2> /dev/null)
XDGUTILS := $(shell command -v xdg-desktop-menu 2> /dev/null) DESTDIR :=
PREFIX := usr/local
define \n define \n
endef endef
install: GBM.exe $(foreach size,$(ICONSIZES),gbm_$(size)x$(size).png) 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 #rename it in a way, it can easily started from terminal
install GBM.exe /usr/local/bin/gbm; install -d $(DESTDIR)/$(PREFIX)/bin;
install gbm.sh $(DESTDIR)/$(PREFIX)/bin/gbm;
install -d $(DESTDIR)/$(PREFIX)/share/gbm/;
install GBM.exe $(DESTDIR)/$(PREFIX)/share/gbm/;
#install icon in different sizes #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)) $(foreach size,$(ICONSIZES),install -d $(DESTDIR)/$(PREFIX)/share/icons/hicolor/$(size)x$(size)/apps/;$(\n))
xdg-icon-resource forceupdate --mode system; $(foreach size,$(ICONSIZES),install -m644 gbm_$(size)x$(size).png $(DESTDIR)/$(PREFIX)/share/icons/hicolor/$(size)x$(size)/apps/gbm.png;$(\n))
#install .desktop file, which is used for running gbm from desktop and menus #install .desktop file, which is used for running gbm from desktop and menus
xdg-desktop-menu install --mode system --novendor gbm.desktop; install -d $(DESTDIR)/$(PREFIX)/share/applications/
install -m644 gbm.desktop $(DESTDIR)/$(PREFIX)/share/applications/gbm.desktop
uninstall: /usr/local/bin/gbm ifeq ($(DESTDIR),)
ifndef XDGUTILS -xdg-icon-resource forceupdate --mode system;
$(error "xdg-desktop-menu is not available, please install xdg-utils") -xdg-desktop-menu forceupdate --mode system;
endif endif
rm /usr/local/bin/gbm;
$(foreach size,$(ICONSIZES),xdg-icon-resource uninstall --mode system --novendor --noupdate --size $(size) gbm;$(\n)) uninstall: $(DESTDIR)/$(PREFIX)/bin/gbm
xdg-icon-resource forceupdate --mode system; -rm $(DESTDIR)/$(PREFIX)/bin/gbm;
xdg-desktop-menu uninstall --mode system --novendor gbm.desktop; -rm -r $(DESTDIR)/$(PREFIX)/share/gbm/;
$(foreach size,$(ICONSIZES),-rm $(DESTDIR)/$(PREFIX)/share/icons/hicolor/$(size)x$(size)/apps/gbm.png;$(\n))
-rm $(DESTDIR)/$(PREFIX)/share/applications/gbm.desktop
ifeq ($(DESTDIR),)
-xdg-icon-resource forceupdate --mode system;
-xdg-desktop-menu forceupdate --mode system;
endif
#must be root
deb: DESTDIR := deb-package/gbm
deb: PREFIX := usr
deb: install
cd deb-package;dpkg-deb --build gbm
gbm_%.png: gbm.ico gbm_%.png: gbm.ico
ifndef IMGMAGICK ifndef IMGMAGICK