From 7e1302714d0b0dca7312b8df935ee0e261018421 Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Fri, 27 Nov 2015 12:28:08 -0600 Subject: [PATCH 1/6] Started on include / exclude builder --- GBM/Forms/frmGameManager.Designer.vb | 14 +- GBM/Forms/frmGameManager.vb | 23 +++- GBM/Forms/frmIncludeExclude.Designer.vb | 151 +++++++++++++++++++++ GBM/Forms/frmIncludeExclude.resx | 170 ++++++++++++++++++++++++ GBM/Forms/frmIncludeExclude.vb | 111 ++++++++++++++++ GBM/Game Backup Monitor.vbproj | 12 ++ GBM/Resources/file.ico | Bin 0 -> 1150 bytes GBM/Resources/folder.ico | Bin 0 -> 1150 bytes GBM/Resources/type.ico | Bin 0 -> 1150 bytes 9 files changed, 479 insertions(+), 2 deletions(-) create mode 100644 GBM/Forms/frmIncludeExclude.Designer.vb create mode 100644 GBM/Forms/frmIncludeExclude.resx create mode 100644 GBM/Forms/frmIncludeExclude.vb create mode 100644 GBM/Resources/file.ico create mode 100644 GBM/Resources/folder.ico create mode 100644 GBM/Resources/type.ico diff --git a/GBM/Forms/frmGameManager.Designer.vb b/GBM/Forms/frmGameManager.Designer.vb index 2bf4fa2..0c5e507 100644 --- a/GBM/Forms/frmGameManager.Designer.vb +++ b/GBM/Forms/frmGameManager.Designer.vb @@ -81,6 +81,7 @@ Partial Class frmGameManager Me.optBackupData = New System.Windows.Forms.RadioButton() Me.optPendingRestores = New System.Windows.Forms.RadioButton() Me.optAllGames = New System.Windows.Forms.RadioButton() + Me.btnInclude = New System.Windows.Forms.Button() Me.grpConfig.SuspendLayout() Me.grpExtra.SuspendLayout() CType(Me.pbIcon, System.ComponentModel.ISupportInitialize).BeginInit() @@ -134,6 +135,7 @@ Partial Class frmGameManager 'grpConfig ' Me.grpConfig.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.grpConfig.Controls.Add(Me.btnInclude) Me.grpConfig.Controls.Add(Me.txtID) Me.grpConfig.Controls.Add(Me.lblExclude) Me.grpConfig.Controls.Add(Me.lblFileType) @@ -241,7 +243,7 @@ Partial Class frmGameManager ' Me.txtFileType.Location = New System.Drawing.Point(69, 97) Me.txtFileType.Name = "txtFileType" - Me.txtFileType.Size = New System.Drawing.Size(459, 20) + Me.txtFileType.Size = New System.Drawing.Size(423, 20) Me.txtFileType.TabIndex = 11 ' 'chkTimeStamp @@ -681,6 +683,15 @@ Partial Class frmGameManager Me.optAllGames.Text = "All" Me.optAllGames.UseVisualStyleBackColor = True ' + 'btnInclude + ' + Me.btnInclude.Location = New System.Drawing.Point(498, 97) + Me.btnInclude.Name = "btnInclude" + Me.btnInclude.Size = New System.Drawing.Size(30, 20) + Me.btnInclude.TabIndex = 15 + Me.btnInclude.Text = "..." + Me.btnInclude.UseVisualStyleBackColor = True + ' 'frmGameManager ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -782,4 +793,5 @@ Partial Class frmGameManager Friend WithEvents btnTags As System.Windows.Forms.Button Friend WithEvents lblTags As System.Windows.Forms.Label Friend WithEvents optTag As System.Windows.Forms.RadioButton + Friend WithEvents btnInclude As System.Windows.Forms.Button End Class diff --git a/GBM/Forms/frmGameManager.vb b/GBM/Forms/frmGameManager.vb index 4117a1e..4492dbc 100644 --- a/GBM/Forms/frmGameManager.vb +++ b/GBM/Forms/frmGameManager.vb @@ -386,6 +386,25 @@ Public Class frmGameManager End Sub + Private Sub OpenIncludeBuilder() + Dim frm As New frmIncludeExclude + frm.FormName = "Include Builder" + + If Path.IsPathRooted(txtSavePath.Text) Then + If Directory.Exists(txtSavePath.Text) Then + frm.RootFolder = txtSavePath.Text + End If + Else + If txtAppPath.Text <> String.Empty Then + If Directory.Exists(txtAppPath.Text & "\" & txtSavePath.Text) Then + frm.RootFolder = txtAppPath.Text & "\" & txtSavePath.Text + End If + End If + End If + + frm.ShowDialog() + End Sub + Private Function FindRestorePath() As Boolean Dim sProcess As String Dim sRestorePath As String @@ -1199,5 +1218,7 @@ Public Class frmGameManager LoadData() End Sub - + Private Sub btnInclude_Click(sender As Object, e As EventArgs) Handles btnInclude.Click + OpenIncludeBuilder() + End Sub End Class \ No newline at end of file diff --git a/GBM/Forms/frmIncludeExclude.Designer.vb b/GBM/Forms/frmIncludeExclude.Designer.vb new file mode 100644 index 0000000..4cfaa63 --- /dev/null +++ b/GBM/Forms/frmIncludeExclude.Designer.vb @@ -0,0 +1,151 @@ + _ +Partial Class frmIncludeExclude + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + Protected Overrides Sub Dispose(ByVal disposing As Boolean) + Try + If disposing AndAlso components IsNot Nothing Then + components.Dispose() + End If + Finally + MyBase.Dispose(disposing) + End Try + End Sub + + 'Required by the Windows Form Designer + Private components As System.ComponentModel.IContainer + + 'NOTE: The following procedure is required by the Windows Form Designer + 'It can be modified using the Windows Form Designer. + 'Do not modify it using the code editor. + _ + Private Sub InitializeComponent() + Me.components = New System.ComponentModel.Container() + Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmIncludeExclude)) + Me.treFiles = New System.Windows.Forms.TreeView() + Me.imgIcons = New System.Windows.Forms.ImageList(Me.components) + Me.bwLoader = New System.ComponentModel.BackgroundWorker() + Me.btnSave = New System.Windows.Forms.Button() + Me.btnCancel = New System.Windows.Forms.Button() + Me.txtRootFolder = New System.Windows.Forms.TextBox() + Me.btnBrowse = New System.Windows.Forms.Button() + Me.lstBuilder = New System.Windows.Forms.ListView() + Me.btnRemove = New System.Windows.Forms.Button() + Me.btnAdd = New System.Windows.Forms.Button() + Me.SuspendLayout() + ' + 'treFiles + ' + Me.treFiles.ImageIndex = 0 + Me.treFiles.ImageList = Me.imgIcons + Me.treFiles.Location = New System.Drawing.Point(12, 38) + Me.treFiles.Name = "treFiles" + Me.treFiles.SelectedImageIndex = 0 + Me.treFiles.Size = New System.Drawing.Size(230, 359) + Me.treFiles.TabIndex = 0 + ' + 'imgIcons + ' + Me.imgIcons.ImageStream = CType(resources.GetObject("imgIcons.ImageStream"), System.Windows.Forms.ImageListStreamer) + Me.imgIcons.TransparentColor = System.Drawing.Color.Transparent + Me.imgIcons.Images.SetKeyName(0, "folder.ico") + Me.imgIcons.Images.SetKeyName(1, "file.ico") + ' + 'btnSave + ' + Me.btnSave.Location = New System.Drawing.Point(416, 426) + Me.btnSave.Name = "btnSave" + Me.btnSave.Size = New System.Drawing.Size(75, 23) + Me.btnSave.TabIndex = 1 + Me.btnSave.Text = "Save" + Me.btnSave.UseVisualStyleBackColor = True + ' + 'btnCancel + ' + Me.btnCancel.Location = New System.Drawing.Point(497, 426) + Me.btnCancel.Name = "btnCancel" + Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.TabIndex = 2 + Me.btnCancel.Text = "Cancel" + Me.btnCancel.UseVisualStyleBackColor = True + ' + 'txtRootFolder + ' + Me.txtRootFolder.Location = New System.Drawing.Point(12, 12) + Me.txtRootFolder.Name = "txtRootFolder" + Me.txtRootFolder.ReadOnly = True + Me.txtRootFolder.Size = New System.Drawing.Size(194, 20) + Me.txtRootFolder.TabIndex = 3 + ' + 'btnBrowse + ' + Me.btnBrowse.Location = New System.Drawing.Point(212, 11) + Me.btnBrowse.Name = "btnBrowse" + Me.btnBrowse.Size = New System.Drawing.Size(30, 20) + Me.btnBrowse.TabIndex = 9 + Me.btnBrowse.Text = "..." + Me.btnBrowse.UseVisualStyleBackColor = True + ' + 'lstBuilder + ' + Me.lstBuilder.Location = New System.Drawing.Point(342, 38) + Me.lstBuilder.Name = "lstBuilder" + Me.lstBuilder.Size = New System.Drawing.Size(230, 359) + Me.lstBuilder.TabIndex = 10 + Me.lstBuilder.UseCompatibleStateImageBehavior = False + ' + 'btnRemove + ' + Me.btnRemove.Location = New System.Drawing.Point(268, 201) + Me.btnRemove.Name = "btnRemove" + Me.btnRemove.Size = New System.Drawing.Size(48, 23) + Me.btnRemove.TabIndex = 12 + Me.btnRemove.Text = "< <" + Me.btnRemove.UseVisualStyleBackColor = True + ' + 'btnAdd + ' + Me.btnAdd.Location = New System.Drawing.Point(268, 172) + Me.btnAdd.Name = "btnAdd" + Me.btnAdd.Size = New System.Drawing.Size(48, 23) + Me.btnAdd.TabIndex = 11 + Me.btnAdd.Text = "> >" + Me.btnAdd.UseVisualStyleBackColor = True + ' + 'frmIncludeExclude + ' + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.ClientSize = New System.Drawing.Size(584, 461) + Me.Controls.Add(Me.btnRemove) + Me.Controls.Add(Me.btnAdd) + Me.Controls.Add(Me.lstBuilder) + Me.Controls.Add(Me.btnBrowse) + Me.Controls.Add(Me.txtRootFolder) + Me.Controls.Add(Me.btnCancel) + Me.Controls.Add(Me.btnSave) + Me.Controls.Add(Me.treFiles) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle + Me.MaximizeBox = False + Me.MinimizeBox = False + Me.Name = "frmIncludeExclude" + Me.ShowIcon = False + Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen + Me.Text = "Include Exclude Builder" + Me.ResumeLayout(False) + Me.PerformLayout() + + End Sub + Friend WithEvents treFiles As System.Windows.Forms.TreeView + Friend WithEvents imgIcons As System.Windows.Forms.ImageList + Friend WithEvents bwLoader As System.ComponentModel.BackgroundWorker + Friend WithEvents btnSave As System.Windows.Forms.Button + Friend WithEvents btnCancel As System.Windows.Forms.Button + Friend WithEvents txtRootFolder As System.Windows.Forms.TextBox + Friend WithEvents btnBrowse As System.Windows.Forms.Button + Friend WithEvents lstBuilder As System.Windows.Forms.ListView + Friend WithEvents btnRemove As System.Windows.Forms.Button + Friend WithEvents btnAdd As System.Windows.Forms.Button +End Class diff --git a/GBM/Forms/frmIncludeExclude.resx b/GBM/Forms/frmIncludeExclude.resx new file mode 100644 index 0000000..d100af6 --- /dev/null +++ b/GBM/Forms/frmIncludeExclude.resx @@ -0,0 +1,170 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + 17, 17 + + + + AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w + LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB2 + CAAAAk1TRnQBSQFMAgEBAgEAATABAAEwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA + AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 + AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA + AWYDAAGZAwABzAIAATMDAAIzAgABMwFmAgABMwGZAgABMwHMAgABMwH/AgABZgMAAWYBMwIAAmYCAAFm + AZkCAAFmAcwCAAFmAf8CAAGZAwABmQEzAgABmQFmAgACmQIAAZkBzAIAAZkB/wIAAcwDAAHMATMCAAHM + AWYCAAHMAZkCAALMAgABzAH/AgAB/wFmAgAB/wGZAgAB/wHMAQABMwH/AgAB/wEAATMBAAEzAQABZgEA + ATMBAAGZAQABMwEAAcwBAAEzAQAB/wEAAf8BMwIAAzMBAAIzAWYBAAIzAZkBAAIzAcwBAAIzAf8BAAEz + AWYCAAEzAWYBMwEAATMCZgEAATMBZgGZAQABMwFmAcwBAAEzAWYB/wEAATMBmQIAATMBmQEzAQABMwGZ + AWYBAAEzApkBAAEzAZkBzAEAATMBmQH/AQABMwHMAgABMwHMATMBAAEzAcwBZgEAATMBzAGZAQABMwLM + AQABMwHMAf8BAAEzAf8BMwEAATMB/wFmAQABMwH/AZkBAAEzAf8BzAEAATMC/wEAAWYDAAFmAQABMwEA + AWYBAAFmAQABZgEAAZkBAAFmAQABzAEAAWYBAAH/AQABZgEzAgABZgIzAQABZgEzAWYBAAFmATMBmQEA + AWYBMwHMAQABZgEzAf8BAAJmAgACZgEzAQADZgEAAmYBmQEAAmYBzAEAAWYBmQIAAWYBmQEzAQABZgGZ + AWYBAAFmApkBAAFmAZkBzAEAAWYBmQH/AQABZgHMAgABZgHMATMBAAFmAcwBmQEAAWYCzAEAAWYBzAH/ + AQABZgH/AgABZgH/ATMBAAFmAf8BmQEAAWYB/wHMAQABzAEAAf8BAAH/AQABzAEAApkCAAGZATMBmQEA + AZkBAAGZAQABmQEAAcwBAAGZAwABmQIzAQABmQEAAWYBAAGZATMBzAEAAZkBAAH/AQABmQFmAgABmQFm + ATMBAAGZATMBZgEAAZkBZgGZAQABmQFmAcwBAAGZATMB/wEAApkBMwEAApkBZgEAA5kBAAKZAcwBAAKZ + Af8BAAGZAcwCAAGZAcwBMwEAAWYBzAFmAQABmQHMAZkBAAGZAswBAAGZAcwB/wEAAZkB/wIAAZkB/wEz + AQABmQHMAWYBAAGZAf8BmQEAAZkB/wHMAQABmQL/AQABzAMAAZkBAAEzAQABzAEAAWYBAAHMAQABmQEA + AcwBAAHMAQABmQEzAgABzAIzAQABzAEzAWYBAAHMATMBmQEAAcwBMwHMAQABzAEzAf8BAAHMAWYCAAHM + AWYBMwEAAZkCZgEAAcwBZgGZAQABzAFmAcwBAAGZAWYB/wEAAcwBmQIAAcwBmQEzAQABzAGZAWYBAAHM + ApkBAAHMAZkBzAEAAcwBmQH/AQACzAIAAswBMwEAAswBZgEAAswBmQEAA8wBAALMAf8BAAHMAf8CAAHM + Af8BMwEAAZkB/wFmAQABzAH/AZkBAAHMAf8BzAEAAcwC/wEAAcwBAAEzAQAB/wEAAWYBAAH/AQABmQEA + AcwBMwIAAf8CMwEAAf8BMwFmAQAB/wEzAZkBAAH/ATMBzAEAAf8BMwH/AQAB/wFmAgAB/wFmATMBAAHM + AmYBAAH/AWYBmQEAAf8BZgHMAQABzAFmAf8BAAH/AZkCAAH/AZkBMwEAAf8BmQFmAQAB/wKZAQAB/wGZ + AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz + AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm + AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw + AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/xMACf82AAH0CQcB/yUA + AfIMuwHyAgAB8wm8AfQD/yIAAbsMswEJAgAB8wLyAfEJBwH0IgABCQyzAQkCAAHzAvIB8QnwAfMiAAEJ + DLMBCQIAAfMM8gHzIgABCQy6AQkCAALzC/IB8yIAAfAMugHwAgAD8wryAfMiAAHwDNsB8AIABPMB8gnz + IgABGQzcARkCAATzAfIJ8yIAAfEMCQHxAgAO8yIAAfAH3AW6AfACAAHzAvQH8wHyAe8BvAH0IgABGQG7 + BO8BCQH/CAAB9AnzAe8B9wHxIwAB8wHwBBkB8gkAA/8B9AHzBPQBBwG8Af83AAH/BPMC8joABf8mAAFC + AU0BPgcAAT4DAAEoAwABQAMAARADAAEBAQABAQUAAYAXAAP/AQAC/wHAAR8EAAL/AYABDwQAAYABAQGA + AQEEAAGAAQEBgAEBBAABgAEBAYABAQQAAYABAQGAAQEEAAGAAQEBgAEBBAABgAEBAYABAQQAAYABAQGA + AQEEAAGAAQEBgAEBBAABgAEBAYABAQQAAYABAQGAAQEEAAGAAX8BgAEDBAABgAH/AYABBwQAAv8B8AEf + BAAC/wH4AT8EAAs= + + + + 118, 17 + + \ No newline at end of file diff --git a/GBM/Forms/frmIncludeExclude.vb b/GBM/Forms/frmIncludeExclude.vb new file mode 100644 index 0000000..449c885 --- /dev/null +++ b/GBM/Forms/frmIncludeExclude.vb @@ -0,0 +1,111 @@ +Imports System.IO + +Public Class frmIncludeExclude + + Dim sFormName As String = "Include Exclude" + Dim sRootFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + + Public Property FormName As String + Get + Return sFormName + End Get + Set(value As String) + sFormName = value + End Set + End Property + + Public Property RootFolder As String + Get + Return sRootFolder + End Get + Set(value As String) + sRootFolder = value + End Set + End Property + + Private Sub BuildTreeNodes(ByVal sDirectory As String, ByVal oNode As TreeNode) + Dim sFolders As String() + Dim sFiles As String() + Dim oChild As TreeNode + + Try + sFolders = Directory.GetDirectories(sDirectory) + sFiles = Directory.GetFiles(sDirectory) + + If sFolders.Length <> 0 Then + For Each sFolder As String In sFolders + oChild = New TreeNode(sFolder.Replace(sDirectory & "\", String.Empty), 0, 0) + oChild.Name = sFolder + oNode.Nodes.Add(oChild) + BuildTreeNodes(sFolder, oChild) + Next + End If + + If sFiles.Length <> 0 Then + For Each sFile As String In sFiles + oChild = New TreeNode(sFile.Replace(sDirectory & "\", String.Empty), 1, 1) + oNode.Nodes.Add(oChild) + Next + End If + Catch uaex As UnauthorizedAccessException + 'Do Nothing + Catch ex As Exception + MsgBox("An unexcepted error occured while reading the file system: " & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Critical, "Game Backup Monitor") + End Try + End Sub + + Private Sub BuildTree() + Cursor.Current = Cursors.WaitCursor + treFiles.BeginUpdate() + treFiles.Nodes.Clear() + Dim oRootNode As TreeNode + oRootNode = New TreeNode(Path.GetFileName(txtRootFolder.Text), 0, 0) + treFiles.Nodes.Add(oRootNode) + BuildTreeNodes(txtRootFolder.Text, oRootNode) + treFiles.EndUpdate() + Cursor.Current = Cursors.Default + End Sub + + Private Sub RootPathBrowse() + Dim sDefaultFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + Dim sCurrentPath As String = txtRootFolder.Text + Dim sNewPath As String + + If sCurrentPath <> String.Empty Then + If Directory.Exists(sCurrentPath) Then + sDefaultFolder = sCurrentPath + End If + End If + + sNewPath = mgrCommon.OpenFolderBrowser("Choose the location of the save folder:", sDefaultFolder, False) + + If sNewPath <> String.Empty Then txtRootFolder.Text = sNewPath + End Sub + + Private Sub frmIncludeExclude_Load(sender As Object, e As EventArgs) Handles MyBase.Load + Me.Text = FormName + txtRootFolder.Text = RootFolder + BuildTree() + End Sub + + Private Sub frmIncludeExclude_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown + treFiles.Select() + treFiles.SelectedNode.Expand() + End Sub + + Private Sub btnBrowse_Click(sender As Object, e As EventArgs) Handles btnBrowse.Click + RootPathBrowse() + BuildTree() + treFiles.Select() + treFiles.SelectedNode.Expand() + End Sub + + Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click + Me.Close() + End Sub + + Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click + Me.Close() + End Sub + +End Class \ No newline at end of file diff --git a/GBM/Game Backup Monitor.vbproj b/GBM/Game Backup Monitor.vbproj index 5be6dd1..5465995 100644 --- a/GBM/Game Backup Monitor.vbproj +++ b/GBM/Game Backup Monitor.vbproj @@ -150,6 +150,12 @@ Form + + frmIncludeExclude.vb + + + Form + frmStartUpWizard.vb @@ -239,6 +245,9 @@ frmGameTags.vb + + frmIncludeExclude.vb + frmStartUpWizard.vb Designer @@ -312,9 +321,12 @@ + + + PreserveNewest diff --git a/GBM/Resources/file.ico b/GBM/Resources/file.ico new file mode 100644 index 0000000000000000000000000000000000000000..a876031b464945c9e35a09f6fb718395c6dbdad5 GIT binary patch literal 1150 zcma)+J#X4j6ozk=N@=EK>KH0@NdH5J{sE@$WbV=~`628@Vnr-Kk}3%f5Jb~PDgFpb z(h8f@VEk>sln(WFdXAebxv4GnS`X*y-20yQ97~3=NBC@QG5meT-aKaPDP!yff+@`W z$zw=emlqdteyEL}sM_5|7TW0h`Y(Xg8nPt46poLKlcNu67Q)H#@VwXCNh{D7#oa4e z0*?6Q5+2gW+~-f{`L-ZzpLN=~;ZR%SwPaZ?OpOT`lQG z2mW$lF%Muq3&8W-*w@FHMSy42bF%+%v4F*Vjy?G3>%@`vNoGL+#C$d*|6Q)X!dgF; zOIU_seC~T*e24BOq4!y<)zDjp!C>&3>m^yvqkn{iSbs&H)JqcbtyZg0E|;T5qw$`! zaQ{6t1z}B9)ts*D+mrD)PoC5Z=jUn#AA3Eh*Xu1o5T28^R4Or16lwd{8fn@N`VX-e zm17u&+H5x8(Zyo1n5yGN-tO(O#{T~L!QtTsr&6ilze4(=5xTj1@QdpH2hk>D(JPvt FvEOsxv_1d; literal 0 HcmV?d00001 diff --git a/GBM/Resources/folder.ico b/GBM/Resources/folder.ico new file mode 100644 index 0000000000000000000000000000000000000000..ac79aeb8f354d1738c6b81b9449f9015ab16ba19 GIT binary patch literal 1150 zcmcJJOGpAi7{^EIUQ~4U5YeqJb*)>sZjpz&r+E@WNP34Ec?rhK6b%BqC_%+mP@=7o zs6EikM`mP;L61v5j(yFhvxRt=qIUT0H~Z)R+ZlvpWYyOr@|L6FT7;SrLTv;Rk))K9 z@h^`>S@-MzTFb6Y-7w%9ZFFpDn>JVwyS9;retNJ=Ctu+gTi_=+b@FBEbMx)^%-ji~ z)h;H^%w514IxzJQaW}r&?1d`_BcywTdnBJ<@58q{3P>?>yQ=^nap?I$=MWaWDiFL% zMpPg=)DQ2g@$2~*yf7kmBgCP8g4f}~%>v|8jF4`UAD8^=lWCk2Tu{hXr$};&*vSb_ zi1HI(zDJAmNj(&A^icT5TSEW-9GQcM;3Q-MCGN>g`^O>3X^iy#cYztxC2xU)ZM%e< zv%^zt2~Ig}EA3Uz(4OWqiuh&+g{bNHF>ZBJvhg)f`ocIb7BZpPN>%y}`{ty5wN1=# Xs22ZO27r)=rv{-Z83SUs?1PeiDq)oeGT_sV1xt2n#~M2n3>0DgIEZ2oeYjh=s%e zg#uOu0VUK*__R=LGsUL-EZ^z0olZObATcNyjMq1VB{72Re3LupzH{$6_a+aaApC`e zA^hKmvbG_#8zB^h15=n;<1zf#QTf{SIr$v6ZLtCa%d zh#Aan>7cENQ3S-@)$z#Dn}*a+&k$y1JY{(=0XOReug3$N+a-9gP6m58U~b+Hld5Yl zTrYM8^gL##o(?g;PPSQ9m%zz#@OfbYd|vOmhug)1!)}FH%>$V1NTh}oiG;3By#BVm z4au?A{w#0~W`oUG2@8I|5Psj92g7hc>z}}sDueECNFex`D%k}dgfsXuUF0%IfFtu) z-Q;b*&DrsVrk@u4478wF16TrQn$; zp~eR85lfb0r0>l6OUn}zI_bqPwgy;sHNgto1mE4wu*@pJGgWCD*AxhI$?h8)YI(9t znHf55sy{b7Di;M}+Ef=?TwWalzFK4+DBM&__DMIb@r92AkN#N)KuCxfgnsTt=*JF( dRzeY43_*y-p~1NZa~fQm!aasUoWpMo#$U(sn_d6_ literal 0 HcmV?d00001 From de5d1e062ab5efce6c7e8aa354c25d51415704ae Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Fri, 27 Nov 2015 17:07:50 -0600 Subject: [PATCH 2/6] First pass of include / exclude builder --- GBM/Forms/frmAdvancedImport.Designer.vb | 1 + GBM/Forms/frmGameManager.Designer.vb | 30 ++-- GBM/Forms/frmGameManager.vb | 25 +++- GBM/Forms/frmIncludeExclude.Designer.vb | 71 ++++++++- GBM/Forms/frmIncludeExclude.resx | 29 ++-- GBM/Forms/frmIncludeExclude.vb | 182 +++++++++++++++++++++--- GBM/My Project/AssemblyInfo.vb | 4 +- 7 files changed, 284 insertions(+), 58 deletions(-) diff --git a/GBM/Forms/frmAdvancedImport.Designer.vb b/GBM/Forms/frmAdvancedImport.Designer.vb index fba2c65..d27f728 100644 --- a/GBM/Forms/frmAdvancedImport.Designer.vb +++ b/GBM/Forms/frmAdvancedImport.Designer.vb @@ -96,6 +96,7 @@ Partial Class frmAdvancedImport Me.Controls.Add(Me.btnImport) Me.Controls.Add(Me.lstGames) Me.Controls.Add(Me.lblGames) + Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "frmAdvancedImport" diff --git a/GBM/Forms/frmGameManager.Designer.vb b/GBM/Forms/frmGameManager.Designer.vb index 0c5e507..b886bac 100644 --- a/GBM/Forms/frmGameManager.Designer.vb +++ b/GBM/Forms/frmGameManager.Designer.vb @@ -27,6 +27,7 @@ Partial Class frmGameManager Me.btnBackup = New System.Windows.Forms.Button() Me.btnClose = New System.Windows.Forms.Button() Me.grpConfig = New System.Windows.Forms.GroupBox() + Me.btnInclude = New System.Windows.Forms.Button() Me.txtID = New System.Windows.Forms.TextBox() Me.lblExclude = New System.Windows.Forms.Label() Me.lblFileType = New System.Windows.Forms.Label() @@ -81,7 +82,7 @@ Partial Class frmGameManager Me.optBackupData = New System.Windows.Forms.RadioButton() Me.optPendingRestores = New System.Windows.Forms.RadioButton() Me.optAllGames = New System.Windows.Forms.RadioButton() - Me.btnInclude = New System.Windows.Forms.Button() + Me.btnExclude = New System.Windows.Forms.Button() Me.grpConfig.SuspendLayout() Me.grpExtra.SuspendLayout() CType(Me.pbIcon, System.ComponentModel.ISupportInitialize).BeginInit() @@ -135,6 +136,7 @@ Partial Class frmGameManager 'grpConfig ' Me.grpConfig.Anchor = CType((System.Windows.Forms.AnchorStyles.Top Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) + Me.grpConfig.Controls.Add(Me.btnExclude) Me.grpConfig.Controls.Add(Me.btnInclude) Me.grpConfig.Controls.Add(Me.txtID) Me.grpConfig.Controls.Add(Me.lblExclude) @@ -159,6 +161,15 @@ Partial Class frmGameManager Me.grpConfig.TabStop = False Me.grpConfig.Text = "Configuration" ' + 'btnInclude + ' + Me.btnInclude.Location = New System.Drawing.Point(498, 97) + Me.btnInclude.Name = "btnInclude" + Me.btnInclude.Size = New System.Drawing.Size(30, 20) + Me.btnInclude.TabIndex = 15 + Me.btnInclude.Text = "..." + Me.btnInclude.UseVisualStyleBackColor = True + ' 'txtID ' Me.txtID.Enabled = False @@ -236,7 +247,7 @@ Partial Class frmGameManager ' Me.txtExclude.Location = New System.Drawing.Point(69, 123) Me.txtExclude.Name = "txtExclude" - Me.txtExclude.Size = New System.Drawing.Size(459, 20) + Me.txtExclude.Size = New System.Drawing.Size(423, 20) Me.txtExclude.TabIndex = 12 ' 'txtFileType @@ -683,14 +694,14 @@ Partial Class frmGameManager Me.optAllGames.Text = "All" Me.optAllGames.UseVisualStyleBackColor = True ' - 'btnInclude + 'btnExclude ' - Me.btnInclude.Location = New System.Drawing.Point(498, 97) - Me.btnInclude.Name = "btnInclude" - Me.btnInclude.Size = New System.Drawing.Size(30, 20) - Me.btnInclude.TabIndex = 15 - Me.btnInclude.Text = "..." - Me.btnInclude.UseVisualStyleBackColor = True + Me.btnExclude.Location = New System.Drawing.Point(498, 123) + Me.btnExclude.Name = "btnExclude" + Me.btnExclude.Size = New System.Drawing.Size(30, 20) + Me.btnExclude.TabIndex = 16 + Me.btnExclude.Text = "..." + Me.btnExclude.UseVisualStyleBackColor = True ' 'frmGameManager ' @@ -794,4 +805,5 @@ Partial Class frmGameManager Friend WithEvents lblTags As System.Windows.Forms.Label Friend WithEvents optTag As System.Windows.Forms.RadioButton Friend WithEvents btnInclude As System.Windows.Forms.Button + Friend WithEvents btnExclude As System.Windows.Forms.Button End Class diff --git a/GBM/Forms/frmGameManager.vb b/GBM/Forms/frmGameManager.vb index 4492dbc..2940b9d 100644 --- a/GBM/Forms/frmGameManager.vb +++ b/GBM/Forms/frmGameManager.vb @@ -386,23 +386,32 @@ Public Class frmGameManager End Sub - Private Sub OpenIncludeBuilder() - Dim frm As New frmIncludeExclude - frm.FormName = "Include Builder" + Private Function GetBuilderRoot() As String + Dim sRoot As String = String.Empty If Path.IsPathRooted(txtSavePath.Text) Then If Directory.Exists(txtSavePath.Text) Then - frm.RootFolder = txtSavePath.Text + sRoot = txtSavePath.Text End If Else If txtAppPath.Text <> String.Empty Then If Directory.Exists(txtAppPath.Text & "\" & txtSavePath.Text) Then - frm.RootFolder = txtAppPath.Text & "\" & txtSavePath.Text + sRoot = txtAppPath.Text & "\" & txtSavePath.Text End If End If End If + Return sRoot + End Function + + Private Sub OpenBuilder(ByVal sFormText As String, ByRef txtBox As TextBox) + Dim frm As New frmIncludeExclude + frm.FormName = sFormText + frm.BuilderString = txtBox.Text + frm.RootFolder = GetBuilderRoot() + frm.ShowDialog() + txtBox.Text = frm.BuilderString End Sub Private Function FindRestorePath() As Boolean @@ -1219,6 +1228,10 @@ Public Class frmGameManager End Sub Private Sub btnInclude_Click(sender As Object, e As EventArgs) Handles btnInclude.Click - OpenIncludeBuilder() + OpenBuilder("Include", txtFileType) + End Sub + + Private Sub btnExclude_Click(sender As Object, e As EventArgs) Handles btnExclude.Click + OpenBuilder("Exclude", txtExclude) End Sub End Class \ No newline at end of file diff --git a/GBM/Forms/frmIncludeExclude.Designer.vb b/GBM/Forms/frmIncludeExclude.Designer.vb index 4cfaa63..1a18631 100644 --- a/GBM/Forms/frmIncludeExclude.Designer.vb +++ b/GBM/Forms/frmIncludeExclude.Designer.vb @@ -26,7 +26,6 @@ Partial Class frmIncludeExclude Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(frmIncludeExclude)) Me.treFiles = New System.Windows.Forms.TreeView() Me.imgIcons = New System.Windows.Forms.ImageList(Me.components) - Me.bwLoader = New System.ComponentModel.BackgroundWorker() Me.btnSave = New System.Windows.Forms.Button() Me.btnCancel = New System.Windows.Forms.Button() Me.txtRootFolder = New System.Windows.Forms.TextBox() @@ -34,16 +33,22 @@ Partial Class frmIncludeExclude Me.lstBuilder = New System.Windows.Forms.ListView() Me.btnRemove = New System.Windows.Forms.Button() Me.btnAdd = New System.Windows.Forms.Button() + Me.grpFileOptions = New System.Windows.Forms.GroupBox() + Me.optIndividualFiles = New System.Windows.Forms.RadioButton() + Me.optFileTypes = New System.Windows.Forms.RadioButton() + Me.lblItems = New System.Windows.Forms.Label() + Me.grpFileOptions.SuspendLayout() Me.SuspendLayout() ' 'treFiles ' + Me.treFiles.CheckBoxes = True Me.treFiles.ImageIndex = 0 Me.treFiles.ImageList = Me.imgIcons Me.treFiles.Location = New System.Drawing.Point(12, 38) Me.treFiles.Name = "treFiles" Me.treFiles.SelectedImageIndex = 0 - Me.treFiles.Size = New System.Drawing.Size(230, 359) + Me.treFiles.Size = New System.Drawing.Size(250, 359) Me.treFiles.TabIndex = 0 ' 'imgIcons @@ -52,6 +57,7 @@ Partial Class frmIncludeExclude Me.imgIcons.TransparentColor = System.Drawing.Color.Transparent Me.imgIcons.Images.SetKeyName(0, "folder.ico") Me.imgIcons.Images.SetKeyName(1, "file.ico") + Me.imgIcons.Images.SetKeyName(2, "type.ico") ' 'btnSave ' @@ -81,7 +87,7 @@ Partial Class frmIncludeExclude ' 'btnBrowse ' - Me.btnBrowse.Location = New System.Drawing.Point(212, 11) + Me.btnBrowse.Location = New System.Drawing.Point(212, 12) Me.btnBrowse.Name = "btnBrowse" Me.btnBrowse.Size = New System.Drawing.Size(30, 20) Me.btnBrowse.TabIndex = 9 @@ -90,11 +96,13 @@ Partial Class frmIncludeExclude ' 'lstBuilder ' - Me.lstBuilder.Location = New System.Drawing.Point(342, 38) + Me.lstBuilder.Location = New System.Drawing.Point(322, 38) Me.lstBuilder.Name = "lstBuilder" - Me.lstBuilder.Size = New System.Drawing.Size(230, 359) + Me.lstBuilder.Size = New System.Drawing.Size(250, 359) + Me.lstBuilder.SmallImageList = Me.imgIcons Me.lstBuilder.TabIndex = 10 Me.lstBuilder.UseCompatibleStateImageBehavior = False + Me.lstBuilder.View = System.Windows.Forms.View.List ' 'btnRemove ' @@ -114,11 +122,55 @@ Partial Class frmIncludeExclude Me.btnAdd.Text = "> >" Me.btnAdd.UseVisualStyleBackColor = True ' + 'grpFileOptions + ' + Me.grpFileOptions.Controls.Add(Me.optFileTypes) + Me.grpFileOptions.Controls.Add(Me.optIndividualFiles) + Me.grpFileOptions.Location = New System.Drawing.Point(12, 403) + Me.grpFileOptions.Name = "grpFileOptions" + Me.grpFileOptions.Size = New System.Drawing.Size(194, 46) + Me.grpFileOptions.TabIndex = 13 + Me.grpFileOptions.TabStop = False + Me.grpFileOptions.Text = "File Options" + ' + 'optIndividualFiles + ' + Me.optIndividualFiles.AutoSize = True + Me.optIndividualFiles.Location = New System.Drawing.Point(85, 19) + Me.optIndividualFiles.Name = "optIndividualFiles" + Me.optIndividualFiles.Size = New System.Drawing.Size(94, 17) + Me.optIndividualFiles.TabIndex = 14 + Me.optIndividualFiles.TabStop = True + Me.optIndividualFiles.Text = "Individual Files" + Me.optIndividualFiles.UseVisualStyleBackColor = True + ' + 'optFileTypes + ' + Me.optFileTypes.AutoSize = True + Me.optFileTypes.Location = New System.Drawing.Point(6, 19) + Me.optFileTypes.Name = "optFileTypes" + Me.optFileTypes.Size = New System.Drawing.Size(73, 17) + Me.optFileTypes.TabIndex = 15 + Me.optFileTypes.TabStop = True + Me.optFileTypes.Text = "File Types" + Me.optFileTypes.UseVisualStyleBackColor = True + ' + 'lblItems + ' + Me.lblItems.AutoSize = True + Me.lblItems.Location = New System.Drawing.Point(319, 16) + Me.lblItems.Name = "lblItems" + Me.lblItems.Size = New System.Drawing.Size(32, 13) + Me.lblItems.TabIndex = 14 + Me.lblItems.Text = "Items" + ' 'frmIncludeExclude ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(584, 461) + Me.Controls.Add(Me.lblItems) + Me.Controls.Add(Me.grpFileOptions) Me.Controls.Add(Me.btnRemove) Me.Controls.Add(Me.btnAdd) Me.Controls.Add(Me.lstBuilder) @@ -133,14 +185,15 @@ Partial Class frmIncludeExclude Me.Name = "frmIncludeExclude" Me.ShowIcon = False Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen - Me.Text = "Include Exclude Builder" + Me.Text = "Include / Exclude Builder" + Me.grpFileOptions.ResumeLayout(False) + Me.grpFileOptions.PerformLayout() Me.ResumeLayout(False) Me.PerformLayout() End Sub Friend WithEvents treFiles As System.Windows.Forms.TreeView Friend WithEvents imgIcons As System.Windows.Forms.ImageList - Friend WithEvents bwLoader As System.ComponentModel.BackgroundWorker Friend WithEvents btnSave As System.Windows.Forms.Button Friend WithEvents btnCancel As System.Windows.Forms.Button Friend WithEvents txtRootFolder As System.Windows.Forms.TextBox @@ -148,4 +201,8 @@ Partial Class frmIncludeExclude Friend WithEvents lstBuilder As System.Windows.Forms.ListView Friend WithEvents btnRemove As System.Windows.Forms.Button Friend WithEvents btnAdd As System.Windows.Forms.Button + Friend WithEvents grpFileOptions As System.Windows.Forms.GroupBox + Friend WithEvents optFileTypes As System.Windows.Forms.RadioButton + Friend WithEvents optIndividualFiles As System.Windows.Forms.RadioButton + Friend WithEvents lblItems As System.Windows.Forms.Label End Class diff --git a/GBM/Forms/frmIncludeExclude.resx b/GBM/Forms/frmIncludeExclude.resx index d100af6..613eb5d 100644 --- a/GBM/Forms/frmIncludeExclude.resx +++ b/GBM/Forms/frmIncludeExclude.resx @@ -124,8 +124,8 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 - ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB2 - CAAAAk1TRnQBSQFMAgEBAgEAATABAAEwAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB6 + CQAAAk1TRnQBSQFMAgEBAwEAAUgBAAFIAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -153,18 +153,19 @@ AcwBAAH/AZkB/wEAAf8BzAIAAf8BzAEzAQAB/wHMAWYBAAH/AcwBmQEAAf8CzAEAAf8BzAH/AQAC/wEz AQABzAH/AWYBAAL/AZkBAAL/AcwBAAJmAf8BAAFmAf8BZgEAAWYC/wEAAf8CZgEAAf8BZgH/AQAC/wFm AQABIQEAAaUBAANfAQADdwEAA4YBAAOWAQADywEAA7IBAAPXAQAD3QEAA+MBAAPqAQAD8QEAA/gBAAHw - AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/xMACf82AAH0CQcB/yUA - AfIMuwHyAgAB8wm8AfQD/yIAAbsMswEJAgAB8wLyAfEJBwH0IgABCQyzAQkCAAHzAvIB8QnwAfMiAAEJ - DLMBCQIAAfMM8gHzIgABCQy6AQkCAALzC/IB8yIAAfAMugHwAgAD8wryAfMiAAHwDNsB8AIABPMB8gnz - IgABGQzcARkCAATzAfIJ8yIAAfEMCQHxAgAO8yIAAfAH3AW6AfACAAHzAvQH8wHyAe8BvAH0IgABGQG7 - BO8BCQH/CAAB9AnzAe8B9wHxIwAB8wHwBBkB8gkAA/8B9AHzBPQBBwG8Af83AAH/BPMC8joABf8mAAFC - AU0BPgcAAT4DAAEoAwABQAMAARADAAEBAQABAQUAAYAXAAP/AQAC/wHAAR8EAAL/AYABDwQAAYABAQGA - AQEEAAGAAQEBgAEBBAABgAEBAYABAQQAAYABAQGAAQEEAAGAAQEBgAEBBAABgAEBAYABAQQAAYABAQGA - AQEEAAGAAQEBgAEBBAABgAEBAYABAQQAAYABAQGAAQEEAAGAAX8BgAEDBAABgAH/AYABBwQAAv8B8AEf - BAAC/wH4AT8EAAs= + AfsB/wEAAaQCoAEAA4ADAAH/AgAB/wMAAv8BAAH/AwAB/wEAAf8BAAL/AgAD/xMACf82AAH0CQcB/wsA + Af8ZAAHyDLsB8gIAAfMJvAH0A/8IAAH/AbMBuwH/FgABuwyzAQkCAAHzAvIB8QkHAfQHAAH/A7MBugH/ + FQABCQyzAQkCAAHzAvIB8QnwAfMGAAH/ArQB8QG8AbQBCQH/FAABCQyzAQkCAAHzDPIB8wUAAf8CtALy + AfEBvAG0AbsB/xMAAQkMugEJAgAC8wvyAfMEAAH/AbQBugHzA/IB8QG8AbQBuxMAAfAMugHwAgAD8wry + AfMDAAH/AroD8wPyAfEBugG0EwAB8AzbAfACAATzAfIJ8wIAAf8CugbzAfICugL/EgABGQzcARkCAATz + AfIJ8wIAAfQCugEJBfMCuwH/FAAB8QwJAfECAA7zAgAB9AG6AdsB3AEJA/MBCQG7Af8VAAHwB9wFugHw + AgAB8wL0B/MB8gHvAbwB9AIAAfQB3AHzAf8B3AEJAfICCQH/FgABGQG7BO8BCQH/CAAB9AnzAe8B9wHx + AwAB9AHcARkB8wPcAQkB/xcAAfMB8AQZAfIJAAP/AfQB8wT0AQcBvAH/BAAB9AIJAdwB4QIJAf8rAAH/ + BPMC8gYAAf8F9AH/LQAF/yYAAUIBTQE+BwABPgMAASgDAAFAAwABEAMAAQEBAAEBBQABgBcAA/8BAAL/ + AcABHwL/AgAC/wGAAQ8B/gH/AgABgAEBAYABAQH+AR8CAAGAAQEBgAEBAfwBDwIAAYABAQGAAQEB+AEH + AgABgAEBAYABAQHwAQMCAAGAAQEBgAEBAeABAwIAAYABAQGAAQEBwAEDAgABgAEBAYABAQGAAQECAAGA + AQEBgAEBAYABBwIAAYABAQGAAQEBgAEPAgABgAEBAYABAQGAAR8CAAGAAX8BgAEDAYABPwIAAYAB/wGA + AQcBgAF/AgAC/wHwAR8BgAH/AgAC/wH4AT8C/wIACw== - - 118, 17 - \ No newline at end of file diff --git a/GBM/Forms/frmIncludeExclude.vb b/GBM/Forms/frmIncludeExclude.vb index 449c885..0ca0b75 100644 --- a/GBM/Forms/frmIncludeExclude.vb +++ b/GBM/Forms/frmIncludeExclude.vb @@ -3,7 +3,17 @@ Public Class frmIncludeExclude Dim sFormName As String = "Include Exclude" - Dim sRootFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) + Dim sRootFolder As String = String.Empty + Dim sBuilderString As String + + Public Property BuilderString As String + Get + Return sBuilderString + End Get + Set(value As String) + sBuilderString = value + End Set + End Property Public Property FormName As String Get @@ -19,51 +29,79 @@ Public Class frmIncludeExclude Return sRootFolder End Get Set(value As String) - sRootFolder = value + sRootFolder = value.TrimEnd("\") End Set End Property - Private Sub BuildTreeNodes(ByVal sDirectory As String, ByVal oNode As TreeNode) + Private Sub BuildBranch(ByVal sDirectory As String, ByVal oNode As TreeNode, ByVal bIsDriveRoot As Boolean) Dim sFolders As String() Dim sFiles As String() Dim oChild As TreeNode + Dim oPlaceHolder As TreeNode Try + Cursor.Current = Cursors.WaitCursor + treFiles.BeginUpdate() + + oNode.Nodes.RemoveByKey("GBM_Tree_Placeholder") + sFolders = Directory.GetDirectories(sDirectory) sFiles = Directory.GetFiles(sDirectory) If sFolders.Length <> 0 Then For Each sFolder As String In sFolders - oChild = New TreeNode(sFolder.Replace(sDirectory & "\", String.Empty), 0, 0) - oChild.Name = sFolder + If bIsDriveRoot Then + oChild = New TreeNode(sFolder.Replace(sDirectory, String.Empty), 0, 0) + Else + oChild = New TreeNode(sFolder.Replace(sDirectory & "\", String.Empty), 0, 0) + End If + oChild.Name = sFolder + oChild.Tag = 0 oNode.Nodes.Add(oChild) - BuildTreeNodes(sFolder, oChild) + oPlaceHolder = New TreeNode("GBM_Tree_Placeholder") + oPlaceHolder.Name = "GBM_Tree_Placeholder" + oChild.Nodes.Add(oPlaceHolder) Next End If If sFiles.Length <> 0 Then For Each sFile As String In sFiles - oChild = New TreeNode(sFile.Replace(sDirectory & "\", String.Empty), 1, 1) + If bIsDriveRoot Then + oChild = New TreeNode(sFile.Replace(sDirectory, String.Empty), 1, 1) + Else + oChild = New TreeNode(sFile.Replace(sDirectory & "\", String.Empty), 1, 1) + End If + oChild.Tag = 1 oNode.Nodes.Add(oChild) Next End If + Catch uaex As UnauthorizedAccessException 'Do Nothing Catch ex As Exception MsgBox("An unexcepted error occured while reading the file system: " & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Critical, "Game Backup Monitor") + Finally + treFiles.EndUpdate() + Cursor.Current = Cursors.Default End Try End Sub - Private Sub BuildTree() - Cursor.Current = Cursors.WaitCursor - treFiles.BeginUpdate() + Private Sub BuildTrunk() treFiles.Nodes.Clear() Dim oRootNode As TreeNode - oRootNode = New TreeNode(Path.GetFileName(txtRootFolder.Text), 0, 0) + Dim bIsDriveRoot As Boolean + + If Path.GetPathRoot(txtRootFolder.Text) = txtRootFolder.Text Then + oRootNode = New TreeNode(txtRootFolder.Text, 0, 0) + bIsDriveRoot = True + Else + oRootNode = New TreeNode(Path.GetFileName(txtRootFolder.Text), 0, 0) + bIsDriveRoot = False + End If + + oRootNode.Name = "Root" treFiles.Nodes.Add(oRootNode) - BuildTreeNodes(txtRootFolder.Text, oRootNode) - treFiles.EndUpdate() - Cursor.Current = Cursors.Default + BuildBranch(txtRootFolder.Text, oRootNode, bIsDriveRoot) End Sub Private Sub RootPathBrowse() @@ -77,30 +115,121 @@ Public Class frmIncludeExclude End If End If - sNewPath = mgrCommon.OpenFolderBrowser("Choose the location of the save folder:", sDefaultFolder, False) + sNewPath = mgrCommon.OpenFolderBrowser("Choose the location of the saved game folder:", sDefaultFolder, False) If sNewPath <> String.Empty Then txtRootFolder.Text = sNewPath End Sub + Private Sub GetAllCheckedNodes(ByVal oRootNode As TreeNodeCollection, ByRef oNodeList As List(Of TreeNode)) + For Each oNode As TreeNode In oRootNode + If oNode.Checked Then + oNode.Checked = False + oNodeList.Add(oNode) + End If + If oNode.Nodes.Count > 0 Then + GetAllCheckedNodes(oNode.Nodes, oNodeList) + End If + Next + End Sub + + Private Sub AddItem() + Dim oCheckedNodes As New List(Of TreeNode) + Dim oListViewItem As ListViewItem + Dim sItem As String + + GetAllCheckedNodes(treFiles.Nodes, oCheckedNodes) + + lstBuilder.BeginUpdate() + For Each oNode In oCheckedNodes + sItem = oNode.Text + If oNode.Tag = 1 And optFileTypes.Checked Then + sItem = Path.GetExtension(oNode.Text) + If sItem <> String.Empty Then + sItem = "*" & sItem + oListViewItem = New ListViewItem(sItem, 2) + oListViewItem.Name = sItem + Else + sItem = oNode.Text + oListViewItem = New ListViewItem(sItem, 1) + oListViewItem.Name = sItem + End If + Else + oListViewItem = New ListViewItem(sItem, CInt(oNode.Tag)) + oListViewItem.Name = sItem + End If + + If Not lstBuilder.Items.ContainsKey(sItem) Then + lstBuilder.Items.Add(oListViewItem) + End If + Next + lstBuilder.EndUpdate() + End Sub + + Private Sub RemoveItem() + For Each oListViewItem As ListViewItem In lstBuilder.SelectedItems + oListViewItem.Remove() + Next + End Sub + + Private Sub ParseBuilderString() + Dim iType As Integer = 1 + Dim oListViewItem As ListViewItem + Dim sItems As String() = BuilderString.Split(":") + + For Each sItem As String In sItems + If sItem.Contains("*") Then + iType = 2 + Else + If txtRootFolder.Text <> String.Empty Then + If Directory.Exists(txtRootFolder.Text & "\" & sItem) Then + iType = 0 + Else + iType = 1 + End If + End If + End If + + oListViewItem = New ListViewItem(sItem, iType) + oListViewItem.Name = sItem + lstBuilder.Items.Add(oListViewItem) + Next + End Sub + + Private Sub CreateNewBuilderString() + Dim sTempString As String = String.Empty + + For Each oListViewItem As ListViewItem In lstBuilder.Items + sTempString &= oListViewItem.Text & ":" + Next + + sTempString = sTempString.TrimEnd(":") + + BuilderString = sTempString + End Sub + Private Sub frmIncludeExclude_Load(sender As Object, e As EventArgs) Handles MyBase.Load - Me.Text = FormName + Me.Text = FormName & " Builder" txtRootFolder.Text = RootFolder - BuildTree() + optFileTypes.Checked = True + lblItems.Text = FormName & " Items" + If BuilderString <> String.Empty Then ParseBuilderString() + If txtRootFolder.Text <> String.Empty Then BuildTrunk() End Sub Private Sub frmIncludeExclude_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown treFiles.Select() - treFiles.SelectedNode.Expand() + If Not treFiles.SelectedNode Is Nothing Then treFiles.SelectedNode.Expand() End Sub Private Sub btnBrowse_Click(sender As Object, e As EventArgs) Handles btnBrowse.Click RootPathBrowse() - BuildTree() + If txtRootFolder.Text <> String.Empty Then BuildTrunk() treFiles.Select() - treFiles.SelectedNode.Expand() + If Not treFiles.SelectedNode Is Nothing Then treFiles.SelectedNode.Expand() End Sub Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click + CreateNewBuilderString() Me.Close() End Sub @@ -108,4 +237,17 @@ Public Class frmIncludeExclude Me.Close() End Sub + Private Sub treFiles_BeforeExpand(sender As Object, e As TreeViewCancelEventArgs) Handles treFiles.BeforeExpand + If Not e.Node.Name = "Root" Then + BuildBranch(e.Node.Name, e.Node, False) + End If + End Sub + + Private Sub btnAdd_Click(sender As Object, e As EventArgs) Handles btnAdd.Click + AddItem() + End Sub + + Private Sub btnRemove_Click(sender As Object, e As EventArgs) Handles btnRemove.Click + RemoveItem() + End Sub End Class \ No newline at end of file diff --git a/GBM/My Project/AssemblyInfo.vb b/GBM/My Project/AssemblyInfo.vb index 13bceb1..9fa0d2b 100644 --- a/GBM/My Project/AssemblyInfo.vb +++ b/GBM/My Project/AssemblyInfo.vb @@ -31,5 +31,5 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + From 0339a09b087b356975a963c7f2f175bf9b78bddd Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Fri, 27 Nov 2015 22:33:34 -0600 Subject: [PATCH 3/6] Minor clean-up to various forms --- GBM/Forms/frmFilter.Designer.vb | 16 ++-- GBM/Forms/frmGameManager.Designer.vb | 110 ++++++++++++------------ GBM/Forms/frmIncludeExclude.Designer.vb | 46 +++++----- GBM/Forms/frmIncludeExclude.resx | 2 +- GBM/Forms/frmIncludeExclude.vb | 4 +- GBM/Forms/frmTags.Designer.vb | 16 ++-- 6 files changed, 98 insertions(+), 96 deletions(-) diff --git a/GBM/Forms/frmFilter.Designer.vb b/GBM/Forms/frmFilter.Designer.vb index 37474b6..6c55203 100644 --- a/GBM/Forms/frmFilter.Designer.vb +++ b/GBM/Forms/frmFilter.Designer.vb @@ -40,7 +40,7 @@ Partial Class frmFilter Me.btnOK.Location = New System.Drawing.Point(297, 229) Me.btnOK.Name = "btnOK" Me.btnOK.Size = New System.Drawing.Size(75, 23) - Me.btnOK.TabIndex = 13 + Me.btnOK.TabIndex = 7 Me.btnOK.Text = "&OK" Me.btnOK.UseVisualStyleBackColor = True ' @@ -50,7 +50,7 @@ Partial Class frmFilter Me.lblGameTags.Location = New System.Drawing.Point(263, 8) Me.lblGameTags.Name = "lblGameTags" Me.lblGameTags.Size = New System.Drawing.Size(66, 13) - Me.lblGameTags.TabIndex = 6 + Me.lblGameTags.TabIndex = 5 Me.lblGameTags.Text = "Current Filter" ' 'lblTags @@ -59,7 +59,7 @@ Partial Class frmFilter Me.lblTags.Location = New System.Drawing.Point(49, 8) Me.lblTags.Name = "lblTags" Me.lblTags.Size = New System.Drawing.Size(77, 13) - Me.lblTags.TabIndex = 7 + Me.lblTags.TabIndex = 0 Me.lblTags.Text = "Available Tags" ' 'btnRemove @@ -67,7 +67,7 @@ Partial Class frmFilter 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 = 10 + Me.btnRemove.TabIndex = 4 Me.btnRemove.Text = "< <" Me.btnRemove.UseVisualStyleBackColor = True ' @@ -76,7 +76,7 @@ Partial Class frmFilter 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 = 9 + Me.btnAdd.TabIndex = 3 Me.btnAdd.Text = "> >" Me.btnAdd.UseVisualStyleBackColor = True ' @@ -87,7 +87,7 @@ Partial Class frmFilter Me.lstFilter.Name = "lstFilter" Me.lstFilter.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended Me.lstFilter.Size = New System.Drawing.Size(150, 173) - Me.lstFilter.TabIndex = 11 + Me.lstFilter.TabIndex = 6 ' 'lstTags ' @@ -96,7 +96,7 @@ Partial Class frmFilter Me.lstTags.Name = "lstTags" Me.lstTags.SelectionMode = System.Windows.Forms.SelectionMode.MultiExtended Me.lstTags.Size = New System.Drawing.Size(150, 173) - Me.lstTags.TabIndex = 8 + Me.lstTags.TabIndex = 1 ' 'GroupBox1 ' @@ -105,7 +105,7 @@ Partial Class frmFilter Me.GroupBox1.Location = New System.Drawing.Point(12, 206) Me.GroupBox1.Name = "GroupBox1" Me.GroupBox1.Size = New System.Drawing.Size(150, 46) - Me.GroupBox1.TabIndex = 14 + Me.GroupBox1.TabIndex = 2 Me.GroupBox1.TabStop = False Me.GroupBox1.Text = "Matching Options" ' diff --git a/GBM/Forms/frmGameManager.Designer.vb b/GBM/Forms/frmGameManager.Designer.vb index b886bac..41414ec 100644 --- a/GBM/Forms/frmGameManager.Designer.vb +++ b/GBM/Forms/frmGameManager.Designer.vb @@ -27,6 +27,7 @@ Partial Class frmGameManager Me.btnBackup = New System.Windows.Forms.Button() Me.btnClose = New System.Windows.Forms.Button() Me.grpConfig = New System.Windows.Forms.GroupBox() + Me.btnExclude = New System.Windows.Forms.Button() Me.btnInclude = New System.Windows.Forms.Button() Me.txtID = New System.Windows.Forms.TextBox() Me.lblExclude = New System.Windows.Forms.Label() @@ -82,7 +83,6 @@ Partial Class frmGameManager Me.optBackupData = New System.Windows.Forms.RadioButton() Me.optPendingRestores = New System.Windows.Forms.RadioButton() Me.optAllGames = New System.Windows.Forms.RadioButton() - Me.btnExclude = New System.Windows.Forms.Button() Me.grpConfig.SuspendLayout() Me.grpExtra.SuspendLayout() CType(Me.pbIcon, System.ComponentModel.ISupportInitialize).BeginInit() @@ -119,7 +119,7 @@ Partial Class frmGameManager Me.btnBackup.Location = New System.Drawing.Point(616, 526) Me.btnBackup.Name = "btnBackup" Me.btnBackup.Size = New System.Drawing.Size(75, 23) - Me.btnBackup.TabIndex = 13 + Me.btnBackup.TabIndex = 14 Me.btnBackup.Text = "&Backup" Me.btnBackup.UseVisualStyleBackColor = True ' @@ -129,7 +129,7 @@ Partial Class frmGameManager Me.btnClose.Location = New System.Drawing.Point(697, 526) Me.btnClose.Name = "btnClose" Me.btnClose.Size = New System.Drawing.Size(75, 23) - Me.btnClose.TabIndex = 14 + Me.btnClose.TabIndex = 15 Me.btnClose.Text = "C&lose" Me.btnClose.UseVisualStyleBackColor = True ' @@ -161,12 +161,21 @@ Partial Class frmGameManager Me.grpConfig.TabStop = False Me.grpConfig.Text = "Configuration" ' + 'btnExclude + ' + Me.btnExclude.Location = New System.Drawing.Point(498, 123) + Me.btnExclude.Name = "btnExclude" + Me.btnExclude.Size = New System.Drawing.Size(30, 20) + Me.btnExclude.TabIndex = 13 + Me.btnExclude.Text = "..." + Me.btnExclude.UseVisualStyleBackColor = True + ' 'btnInclude ' Me.btnInclude.Location = New System.Drawing.Point(498, 97) Me.btnInclude.Name = "btnInclude" Me.btnInclude.Size = New System.Drawing.Size(30, 20) - Me.btnInclude.TabIndex = 15 + Me.btnInclude.TabIndex = 11 Me.btnInclude.Text = "..." Me.btnInclude.UseVisualStyleBackColor = True ' @@ -176,7 +185,7 @@ Partial Class frmGameManager Me.txtID.Location = New System.Drawing.Point(495, 147) Me.txtID.Name = "txtID" Me.txtID.Size = New System.Drawing.Size(33, 20) - Me.txtID.TabIndex = 0 + Me.txtID.TabIndex = 16 Me.txtID.TabStop = False Me.txtID.Visible = False ' @@ -186,7 +195,7 @@ Partial Class frmGameManager Me.lblExclude.Location = New System.Drawing.Point(6, 126) Me.lblExclude.Name = "lblExclude" Me.lblExclude.Size = New System.Drawing.Size(48, 13) - Me.lblExclude.TabIndex = 13 + Me.lblExclude.TabIndex = 4 Me.lblExclude.Text = "Exclude:" ' 'lblFileType @@ -195,7 +204,7 @@ Partial Class frmGameManager Me.lblFileType.Location = New System.Drawing.Point(6, 100) Me.lblFileType.Name = "lblFileType" Me.lblFileType.Size = New System.Drawing.Size(45, 13) - Me.lblFileType.TabIndex = 12 + Me.lblFileType.TabIndex = 3 Me.lblFileType.Text = "Include:" ' 'btnSavePathBrowse @@ -203,7 +212,7 @@ Partial Class frmGameManager Me.btnSavePathBrowse.Location = New System.Drawing.Point(498, 71) Me.btnSavePathBrowse.Name = "btnSavePathBrowse" Me.btnSavePathBrowse.Size = New System.Drawing.Size(30, 20) - Me.btnSavePathBrowse.TabIndex = 10 + Me.btnSavePathBrowse.TabIndex = 9 Me.btnSavePathBrowse.Text = "..." Me.btnSavePathBrowse.UseVisualStyleBackColor = True ' @@ -212,7 +221,7 @@ Partial Class frmGameManager Me.btnProcessBrowse.Location = New System.Drawing.Point(498, 45) Me.btnProcessBrowse.Name = "btnProcessBrowse" Me.btnProcessBrowse.Size = New System.Drawing.Size(30, 20) - Me.btnProcessBrowse.TabIndex = 8 + Me.btnProcessBrowse.TabIndex = 7 Me.btnProcessBrowse.Text = "..." Me.btnProcessBrowse.UseVisualStyleBackColor = True ' @@ -222,7 +231,7 @@ Partial Class frmGameManager Me.lblSavePath.Location = New System.Drawing.Point(6, 74) Me.lblSavePath.Name = "lblSavePath" Me.lblSavePath.Size = New System.Drawing.Size(60, 13) - Me.lblSavePath.TabIndex = 9 + Me.lblSavePath.TabIndex = 2 Me.lblSavePath.Text = "Save Path:" ' 'lblProcess @@ -231,7 +240,7 @@ Partial Class frmGameManager 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 = 8 + Me.lblProcess.TabIndex = 1 Me.lblProcess.Text = "Process:" ' 'lblName @@ -240,7 +249,7 @@ Partial Class frmGameManager 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 = 7 + Me.lblName.TabIndex = 0 Me.lblName.Text = "Name:" ' 'txtExclude @@ -255,7 +264,7 @@ Partial Class frmGameManager Me.txtFileType.Location = New System.Drawing.Point(69, 97) Me.txtFileType.Name = "txtFileType" Me.txtFileType.Size = New System.Drawing.Size(423, 20) - Me.txtFileType.TabIndex = 11 + Me.txtFileType.TabIndex = 10 ' 'chkTimeStamp ' @@ -263,7 +272,7 @@ Partial Class frmGameManager Me.chkTimeStamp.Location = New System.Drawing.Point(124, 149) Me.chkTimeStamp.Name = "chkTimeStamp" Me.chkTimeStamp.Size = New System.Drawing.Size(146, 17) - Me.chkTimeStamp.TabIndex = 14 + Me.chkTimeStamp.TabIndex = 15 Me.chkTimeStamp.Text = "Time stamp each backup" Me.chkTimeStamp.UseVisualStyleBackColor = True ' @@ -273,7 +282,7 @@ Partial Class frmGameManager Me.chkFolderSave.Location = New System.Drawing.Point(9, 149) Me.chkFolderSave.Name = "chkFolderSave" Me.chkFolderSave.Size = New System.Drawing.Size(109, 17) - Me.chkFolderSave.TabIndex = 13 + Me.chkFolderSave.TabIndex = 14 Me.chkFolderSave.Text = "Save entire folder" Me.chkFolderSave.UseVisualStyleBackColor = True ' @@ -282,21 +291,21 @@ Partial Class frmGameManager Me.txtSavePath.Location = New System.Drawing.Point(69, 71) Me.txtSavePath.Name = "txtSavePath" Me.txtSavePath.Size = New System.Drawing.Size(423, 20) - Me.txtSavePath.TabIndex = 9 + Me.txtSavePath.TabIndex = 8 ' 'txtProcess ' Me.txtProcess.Location = New System.Drawing.Point(69, 45) Me.txtProcess.Name = "txtProcess" Me.txtProcess.Size = New System.Drawing.Size(423, 20) - Me.txtProcess.TabIndex = 7 + Me.txtProcess.TabIndex = 6 ' 'txtName ' Me.txtName.Location = New System.Drawing.Point(69, 19) Me.txtName.Name = "txtName" Me.txtName.Size = New System.Drawing.Size(459, 20) - Me.txtName.TabIndex = 6 + Me.txtName.TabIndex = 5 ' 'chkMonitorOnly ' @@ -348,7 +357,7 @@ Partial Class frmGameManager Me.btnIconBrowse.Location = New System.Drawing.Point(444, 96) Me.btnIconBrowse.Name = "btnIconBrowse" Me.btnIconBrowse.Size = New System.Drawing.Size(30, 20) - Me.btnIconBrowse.TabIndex = 20 + Me.btnIconBrowse.TabIndex = 10 Me.btnIconBrowse.Text = "..." Me.btnIconBrowse.UseVisualStyleBackColor = True ' @@ -357,7 +366,7 @@ Partial Class frmGameManager Me.txtIcon.Location = New System.Drawing.Point(69, 97) Me.txtIcon.Name = "txtIcon" Me.txtIcon.Size = New System.Drawing.Size(369, 20) - Me.txtIcon.TabIndex = 19 + Me.txtIcon.TabIndex = 9 ' 'lblVersion ' @@ -365,7 +374,7 @@ Partial Class frmGameManager Me.lblVersion.Location = New System.Drawing.Point(6, 74) Me.lblVersion.Name = "lblVersion" Me.lblVersion.Size = New System.Drawing.Size(45, 13) - Me.lblVersion.TabIndex = 20 + Me.lblVersion.TabIndex = 2 Me.lblVersion.Text = "Version:" ' 'txtVersion @@ -373,14 +382,14 @@ Partial Class frmGameManager Me.txtVersion.Location = New System.Drawing.Point(69, 71) Me.txtVersion.Name = "txtVersion" Me.txtVersion.Size = New System.Drawing.Size(459, 20) - Me.txtVersion.TabIndex = 18 + Me.txtVersion.TabIndex = 8 ' 'txtCompany ' Me.txtCompany.Location = New System.Drawing.Point(69, 45) Me.txtCompany.Name = "txtCompany" Me.txtCompany.Size = New System.Drawing.Size(459, 20) - Me.txtCompany.TabIndex = 17 + Me.txtCompany.TabIndex = 7 ' 'lblCompany ' @@ -388,7 +397,7 @@ Partial Class frmGameManager Me.lblCompany.Location = New System.Drawing.Point(6, 48) Me.lblCompany.Name = "lblCompany" Me.lblCompany.Size = New System.Drawing.Size(54, 13) - Me.lblCompany.TabIndex = 17 + Me.lblCompany.TabIndex = 1 Me.lblCompany.Text = "Company:" ' 'pbIcon @@ -407,7 +416,7 @@ Partial Class frmGameManager Me.Label1.Location = New System.Drawing.Point(6, 100) Me.Label1.Name = "Label1" Me.Label1.Size = New System.Drawing.Size(31, 13) - Me.Label1.TabIndex = 16 + Me.Label1.TabIndex = 3 Me.Label1.Text = "Icon:" ' 'btnAppPathBrowse @@ -415,7 +424,7 @@ Partial Class frmGameManager Me.btnAppPathBrowse.Location = New System.Drawing.Point(498, 19) Me.btnAppPathBrowse.Name = "btnAppPathBrowse" Me.btnAppPathBrowse.Size = New System.Drawing.Size(30, 20) - Me.btnAppPathBrowse.TabIndex = 16 + Me.btnAppPathBrowse.TabIndex = 6 Me.btnAppPathBrowse.Text = "..." Me.btnAppPathBrowse.UseVisualStyleBackColor = True ' @@ -425,7 +434,7 @@ Partial Class frmGameManager Me.lblGamePath.Location = New System.Drawing.Point(6, 23) Me.lblGamePath.Name = "lblGamePath" Me.lblGamePath.Size = New System.Drawing.Size(63, 13) - Me.lblGamePath.TabIndex = 13 + Me.lblGamePath.TabIndex = 0 Me.lblGamePath.Text = "Game Path:" ' 'txtAppPath @@ -433,7 +442,7 @@ Partial Class frmGameManager Me.txtAppPath.Location = New System.Drawing.Point(69, 19) Me.txtAppPath.Name = "txtAppPath" Me.txtAppPath.Size = New System.Drawing.Size(423, 20) - Me.txtAppPath.TabIndex = 15 + Me.txtAppPath.TabIndex = 5 ' 'nudHours ' @@ -443,7 +452,7 @@ Partial Class frmGameManager Me.nudHours.Maximum = New Decimal(New Integer() {10000, 0, 0, 0}) Me.nudHours.Name = "nudHours" Me.nudHours.Size = New System.Drawing.Size(88, 20) - Me.nudHours.TabIndex = 21 + Me.nudHours.TabIndex = 12 ' 'lblHours ' @@ -451,7 +460,7 @@ Partial Class frmGameManager Me.lblHours.Location = New System.Drawing.Point(6, 126) Me.lblHours.Name = "lblHours" Me.lblHours.Size = New System.Drawing.Size(38, 13) - Me.lblHours.TabIndex = 0 + Me.lblHours.TabIndex = 11 Me.lblHours.Text = "Hours:" ' 'btnTags @@ -459,7 +468,7 @@ Partial Class frmGameManager Me.btnTags.Location = New System.Drawing.Point(535, 360) Me.btnTags.Name = "btnTags" Me.btnTags.Size = New System.Drawing.Size(75, 23) - Me.btnTags.TabIndex = 22 + Me.btnTags.TabIndex = 8 Me.btnTags.Text = "Tags..." Me.btnTags.UseVisualStyleBackColor = True ' @@ -479,7 +488,7 @@ Partial Class frmGameManager Me.grpStats.Location = New System.Drawing.Point(238, 390) Me.grpStats.Name = "grpStats" Me.grpStats.Size = New System.Drawing.Size(534, 129) - Me.grpStats.TabIndex = 10 + Me.grpStats.TabIndex = 11 Me.grpStats.TabStop = False Me.grpStats.Text = "Backup Information" ' @@ -489,7 +498,7 @@ Partial Class frmGameManager Me.btnOpenRestorePath.Location = New System.Drawing.Point(336, 100) Me.btnOpenRestorePath.Name = "btnOpenRestorePath" Me.btnOpenRestorePath.Size = New System.Drawing.Size(114, 23) - Me.btnOpenRestorePath.TabIndex = 28 + Me.btnOpenRestorePath.TabIndex = 9 Me.btnOpenRestorePath.Text = "O&pen Restore Path" Me.btnOpenRestorePath.UseVisualStyleBackColor = True ' @@ -499,7 +508,7 @@ Partial Class frmGameManager Me.btnOpenBackupFile.Location = New System.Drawing.Point(216, 100) Me.btnOpenBackupFile.Name = "btnOpenBackupFile" Me.btnOpenBackupFile.Size = New System.Drawing.Size(114, 23) - Me.btnOpenBackupFile.TabIndex = 27 + Me.btnOpenBackupFile.TabIndex = 8 Me.btnOpenBackupFile.Text = "&Open Backup File" Me.btnOpenBackupFile.UseVisualStyleBackColor = True ' @@ -509,7 +518,7 @@ Partial Class frmGameManager Me.txtFileSize.Name = "txtFileSize" Me.txtFileSize.ReadOnly = True Me.txtFileSize.Size = New System.Drawing.Size(275, 20) - Me.txtFileSize.TabIndex = 0 + Me.txtFileSize.TabIndex = 6 Me.txtFileSize.TabStop = False ' 'btnDeleteBackup @@ -518,7 +527,7 @@ Partial Class frmGameManager Me.btnDeleteBackup.Location = New System.Drawing.Point(96, 100) Me.btnDeleteBackup.Name = "btnDeleteBackup" Me.btnDeleteBackup.Size = New System.Drawing.Size(114, 23) - Me.btnDeleteBackup.TabIndex = 26 + Me.btnDeleteBackup.TabIndex = 7 Me.btnDeleteBackup.Text = "&Delete Backup" Me.btnDeleteBackup.UseVisualStyleBackColor = True ' @@ -528,7 +537,7 @@ Partial Class frmGameManager Me.lblFileSize.Location = New System.Drawing.Point(6, 77) Me.lblFileSize.Name = "lblFileSize" Me.lblFileSize.Size = New System.Drawing.Size(70, 13) - Me.lblFileSize.TabIndex = 108 + Me.lblFileSize.TabIndex = 2 Me.lblFileSize.Text = "Backup Size:" ' 'lblSync @@ -537,7 +546,7 @@ Partial Class frmGameManager Me.lblSync.Location = New System.Drawing.Point(6, 105) Me.lblSync.Name = "lblSync" Me.lblSync.Size = New System.Drawing.Size(62, 13) - Me.lblSync.TabIndex = 24 + Me.lblSync.TabIndex = 3 Me.lblSync.Text = "Up to Date!" Me.lblSync.Visible = False ' @@ -547,7 +556,7 @@ Partial Class frmGameManager Me.txtCurrentBackup.Name = "txtCurrentBackup" Me.txtCurrentBackup.ReadOnly = True Me.txtCurrentBackup.Size = New System.Drawing.Size(275, 20) - Me.txtCurrentBackup.TabIndex = 0 + Me.txtCurrentBackup.TabIndex = 4 Me.txtCurrentBackup.TabStop = False ' 'lblCurrentBackup @@ -556,7 +565,7 @@ Partial Class frmGameManager Me.lblCurrentBackup.Location = New System.Drawing.Point(6, 27) Me.lblCurrentBackup.Name = "lblCurrentBackup" Me.lblCurrentBackup.Size = New System.Drawing.Size(84, 13) - Me.lblCurrentBackup.TabIndex = 22 + Me.lblCurrentBackup.TabIndex = 0 Me.lblCurrentBackup.Text = "Current Backup:" ' 'txtLocalBackup @@ -565,7 +574,7 @@ Partial Class frmGameManager Me.txtLocalBackup.Name = "txtLocalBackup" Me.txtLocalBackup.ReadOnly = True Me.txtLocalBackup.Size = New System.Drawing.Size(275, 20) - Me.txtLocalBackup.TabIndex = 0 + Me.txtLocalBackup.TabIndex = 5 Me.txtLocalBackup.TabStop = False ' 'lblLastBackup @@ -574,7 +583,7 @@ Partial Class frmGameManager Me.lblLastBackup.Location = New System.Drawing.Point(6, 53) Me.lblLastBackup.Name = "lblLastBackup" Me.lblLastBackup.Size = New System.Drawing.Size(76, 13) - Me.lblLastBackup.TabIndex = 20 + Me.lblLastBackup.TabIndex = 1 Me.lblLastBackup.Text = "Local Backup:" ' 'btnMarkAsRestored @@ -583,7 +592,7 @@ Partial Class frmGameManager Me.btnMarkAsRestored.Location = New System.Drawing.Point(429, 526) Me.btnMarkAsRestored.Name = "btnMarkAsRestored" Me.btnMarkAsRestored.Size = New System.Drawing.Size(100, 23) - Me.btnMarkAsRestored.TabIndex = 11 + Me.btnMarkAsRestored.TabIndex = 12 Me.btnMarkAsRestored.Text = "&Mark as Restored" Me.btnMarkAsRestored.UseVisualStyleBackColor = True ' @@ -593,7 +602,7 @@ Partial Class frmGameManager Me.btnRestore.Location = New System.Drawing.Point(535, 526) Me.btnRestore.Name = "btnRestore" Me.btnRestore.Size = New System.Drawing.Size(75, 23) - Me.btnRestore.TabIndex = 12 + Me.btnRestore.TabIndex = 13 Me.btnRestore.Text = "&Restore" Me.btnRestore.UseVisualStyleBackColor = True ' @@ -603,7 +612,7 @@ Partial Class frmGameManager Me.btnSave.Location = New System.Drawing.Point(616, 360) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(75, 23) - Me.btnSave.TabIndex = 8 + Me.btnSave.TabIndex = 9 Me.btnSave.Text = "&Save" Me.btnSave.UseVisualStyleBackColor = True ' @@ -623,7 +632,7 @@ Partial Class frmGameManager Me.btnCancel.Location = New System.Drawing.Point(697, 360) Me.btnCancel.Name = "btnCancel" Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 9 + Me.btnCancel.TabIndex = 10 Me.btnCancel.Text = "&Cancel" Me.btnCancel.UseVisualStyleBackColor = True ' @@ -694,15 +703,6 @@ Partial Class frmGameManager Me.optAllGames.Text = "All" Me.optAllGames.UseVisualStyleBackColor = True ' - 'btnExclude - ' - Me.btnExclude.Location = New System.Drawing.Point(498, 123) - Me.btnExclude.Name = "btnExclude" - Me.btnExclude.Size = New System.Drawing.Size(30, 20) - Me.btnExclude.TabIndex = 16 - Me.btnExclude.Text = "..." - Me.btnExclude.UseVisualStyleBackColor = True - ' 'frmGameManager ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) diff --git a/GBM/Forms/frmIncludeExclude.Designer.vb b/GBM/Forms/frmIncludeExclude.Designer.vb index 1a18631..bbcf39f 100644 --- a/GBM/Forms/frmIncludeExclude.Designer.vb +++ b/GBM/Forms/frmIncludeExclude.Designer.vb @@ -34,8 +34,8 @@ Partial Class frmIncludeExclude Me.btnRemove = New System.Windows.Forms.Button() Me.btnAdd = New System.Windows.Forms.Button() Me.grpFileOptions = New System.Windows.Forms.GroupBox() - Me.optIndividualFiles = New System.Windows.Forms.RadioButton() Me.optFileTypes = New System.Windows.Forms.RadioButton() + Me.optIndividualFiles = New System.Windows.Forms.RadioButton() Me.lblItems = New System.Windows.Forms.Label() Me.grpFileOptions.SuspendLayout() Me.SuspendLayout() @@ -49,7 +49,7 @@ Partial Class frmIncludeExclude Me.treFiles.Name = "treFiles" Me.treFiles.SelectedImageIndex = 0 Me.treFiles.Size = New System.Drawing.Size(250, 359) - Me.treFiles.TabIndex = 0 + Me.treFiles.TabIndex = 1 ' 'imgIcons ' @@ -64,7 +64,7 @@ Partial Class frmIncludeExclude Me.btnSave.Location = New System.Drawing.Point(416, 426) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(75, 23) - Me.btnSave.TabIndex = 1 + Me.btnSave.TabIndex = 6 Me.btnSave.Text = "Save" Me.btnSave.UseVisualStyleBackColor = True ' @@ -73,7 +73,7 @@ Partial Class frmIncludeExclude Me.btnCancel.Location = New System.Drawing.Point(497, 426) Me.btnCancel.Name = "btnCancel" Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 2 + Me.btnCancel.TabIndex = 7 Me.btnCancel.Text = "Cancel" Me.btnCancel.UseVisualStyleBackColor = True ' @@ -83,24 +83,26 @@ Partial Class frmIncludeExclude Me.txtRootFolder.Name = "txtRootFolder" Me.txtRootFolder.ReadOnly = True Me.txtRootFolder.Size = New System.Drawing.Size(194, 20) - Me.txtRootFolder.TabIndex = 3 + Me.txtRootFolder.TabIndex = 0 + Me.txtRootFolder.TabStop = False ' 'btnBrowse ' Me.btnBrowse.Location = New System.Drawing.Point(212, 12) Me.btnBrowse.Name = "btnBrowse" Me.btnBrowse.Size = New System.Drawing.Size(30, 20) - Me.btnBrowse.TabIndex = 9 + Me.btnBrowse.TabIndex = 0 Me.btnBrowse.Text = "..." Me.btnBrowse.UseVisualStyleBackColor = True ' 'lstBuilder ' + Me.lstBuilder.LabelEdit = True Me.lstBuilder.Location = New System.Drawing.Point(322, 38) Me.lstBuilder.Name = "lstBuilder" Me.lstBuilder.Size = New System.Drawing.Size(250, 359) Me.lstBuilder.SmallImageList = Me.imgIcons - Me.lstBuilder.TabIndex = 10 + Me.lstBuilder.TabIndex = 5 Me.lstBuilder.UseCompatibleStateImageBehavior = False Me.lstBuilder.View = System.Windows.Forms.View.List ' @@ -109,7 +111,7 @@ Partial Class frmIncludeExclude Me.btnRemove.Location = New System.Drawing.Point(268, 201) Me.btnRemove.Name = "btnRemove" Me.btnRemove.Size = New System.Drawing.Size(48, 23) - Me.btnRemove.TabIndex = 12 + Me.btnRemove.TabIndex = 4 Me.btnRemove.Text = "< <" Me.btnRemove.UseVisualStyleBackColor = True ' @@ -118,7 +120,7 @@ Partial Class frmIncludeExclude Me.btnAdd.Location = New System.Drawing.Point(268, 172) Me.btnAdd.Name = "btnAdd" Me.btnAdd.Size = New System.Drawing.Size(48, 23) - Me.btnAdd.TabIndex = 11 + Me.btnAdd.TabIndex = 3 Me.btnAdd.Text = "> >" Me.btnAdd.UseVisualStyleBackColor = True ' @@ -129,32 +131,32 @@ Partial Class frmIncludeExclude Me.grpFileOptions.Location = New System.Drawing.Point(12, 403) Me.grpFileOptions.Name = "grpFileOptions" Me.grpFileOptions.Size = New System.Drawing.Size(194, 46) - Me.grpFileOptions.TabIndex = 13 + Me.grpFileOptions.TabIndex = 2 Me.grpFileOptions.TabStop = False Me.grpFileOptions.Text = "File Options" ' - 'optIndividualFiles - ' - Me.optIndividualFiles.AutoSize = True - Me.optIndividualFiles.Location = New System.Drawing.Point(85, 19) - Me.optIndividualFiles.Name = "optIndividualFiles" - Me.optIndividualFiles.Size = New System.Drawing.Size(94, 17) - Me.optIndividualFiles.TabIndex = 14 - Me.optIndividualFiles.TabStop = True - Me.optIndividualFiles.Text = "Individual Files" - Me.optIndividualFiles.UseVisualStyleBackColor = True - ' 'optFileTypes ' Me.optFileTypes.AutoSize = True Me.optFileTypes.Location = New System.Drawing.Point(6, 19) Me.optFileTypes.Name = "optFileTypes" Me.optFileTypes.Size = New System.Drawing.Size(73, 17) - Me.optFileTypes.TabIndex = 15 + Me.optFileTypes.TabIndex = 0 Me.optFileTypes.TabStop = True Me.optFileTypes.Text = "File Types" Me.optFileTypes.UseVisualStyleBackColor = True ' + 'optIndividualFiles + ' + Me.optIndividualFiles.AutoSize = True + Me.optIndividualFiles.Location = New System.Drawing.Point(85, 19) + Me.optIndividualFiles.Name = "optIndividualFiles" + Me.optIndividualFiles.Size = New System.Drawing.Size(94, 17) + Me.optIndividualFiles.TabIndex = 1 + Me.optIndividualFiles.TabStop = True + Me.optIndividualFiles.Text = "Individual Files" + Me.optIndividualFiles.UseVisualStyleBackColor = True + ' 'lblItems ' Me.lblItems.AutoSize = True diff --git a/GBM/Forms/frmIncludeExclude.resx b/GBM/Forms/frmIncludeExclude.resx index 613eb5d..636e792 100644 --- a/GBM/Forms/frmIncludeExclude.resx +++ b/GBM/Forms/frmIncludeExclude.resx @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB6 - CQAAAk1TRnQBSQFMAgEBAwEAAUgBAAFIAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CQAAAk1TRnQBSQFMAgEBAwEAAVABAAFQAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/GBM/Forms/frmIncludeExclude.vb b/GBM/Forms/frmIncludeExclude.vb index 0ca0b75..3b08fcc 100644 --- a/GBM/Forms/frmIncludeExclude.vb +++ b/GBM/Forms/frmIncludeExclude.vb @@ -79,7 +79,7 @@ Public Class frmIncludeExclude Catch uaex As UnauthorizedAccessException 'Do Nothing Catch ex As Exception - MsgBox("An unexcepted error occured while reading the file system: " & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Critical, "Game Backup Monitor") + MsgBox("An unexpected error occured while reading the file system: " & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Critical, "Game Backup Monitor") Finally treFiles.EndUpdate() Cursor.Current = Cursors.Default @@ -87,7 +87,6 @@ Public Class frmIncludeExclude End Sub Private Sub BuildTrunk() - treFiles.Nodes.Clear() Dim oRootNode As TreeNode Dim bIsDriveRoot As Boolean @@ -99,6 +98,7 @@ Public Class frmIncludeExclude bIsDriveRoot = False End If + treFiles.Nodes.Clear() oRootNode.Name = "Root" treFiles.Nodes.Add(oRootNode) BuildBranch(txtRootFolder.Text, oRootNode, bIsDriveRoot) diff --git a/GBM/Forms/frmTags.Designer.vb b/GBM/Forms/frmTags.Designer.vb index e569a26..4d6c6ff 100644 --- a/GBM/Forms/frmTags.Designer.vb +++ b/GBM/Forms/frmTags.Designer.vb @@ -42,7 +42,7 @@ Partial Class frmTags Me.grpTag.Location = New System.Drawing.Point(238, 12) Me.grpTag.Name = "grpTag" Me.grpTag.Size = New System.Drawing.Size(334, 50) - Me.grpTag.TabIndex = 11 + Me.grpTag.TabIndex = 3 Me.grpTag.TabStop = False Me.grpTag.Text = "Configuration" ' @@ -68,7 +68,7 @@ Partial Class frmTags 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 = 14 + Me.btnClose.TabIndex = 7 Me.btnClose.Text = "C&lose" Me.btnClose.UseVisualStyleBackColor = True ' @@ -79,7 +79,7 @@ Partial Class frmTags 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 = 10 + Me.btnDelete.TabIndex = 2 Me.btnDelete.Text = "-" Me.btnDelete.UseVisualStyleBackColor = True ' @@ -90,7 +90,7 @@ Partial Class frmTags 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 = 9 + Me.btnAdd.TabIndex = 1 Me.btnAdd.Text = "+" Me.btnAdd.UseVisualStyleBackColor = True ' @@ -101,7 +101,7 @@ Partial Class frmTags Me.lstTags.Name = "lstTags" Me.lstTags.Size = New System.Drawing.Size(220, 212) Me.lstTags.Sorted = True - Me.lstTags.TabIndex = 7 + Me.lstTags.TabIndex = 0 ' 'txtID ' @@ -109,7 +109,7 @@ Partial Class frmTags Me.txtID.Location = New System.Drawing.Point(377, 67) Me.txtID.Name = "txtID" Me.txtID.Size = New System.Drawing.Size(33, 20) - Me.txtID.TabIndex = 8 + Me.txtID.TabIndex = 4 Me.txtID.TabStop = False Me.txtID.Visible = False ' @@ -119,7 +119,7 @@ Partial Class frmTags Me.btnCancel.Location = New System.Drawing.Point(497, 67) Me.btnCancel.Name = "btnCancel" Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 13 + Me.btnCancel.TabIndex = 6 Me.btnCancel.Text = "&Cancel" Me.btnCancel.UseVisualStyleBackColor = True ' @@ -129,7 +129,7 @@ Partial Class frmTags Me.btnSave.Location = New System.Drawing.Point(416, 67) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(75, 23) - Me.btnSave.TabIndex = 12 + Me.btnSave.TabIndex = 5 Me.btnSave.Text = "&Save" Me.btnSave.UseVisualStyleBackColor = True ' From 525c7d3ec3ad875a866812e10a7bbf8a0c2d2140 Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Sun, 29 Nov 2015 11:39:25 -0600 Subject: [PATCH 4/6] Added context menu and game manager tweaks --- GBM/Forms/frmGameManager.Designer.vb | 10 +-- GBM/Forms/frmIncludeExclude.Designer.vb | 49 ++++++++++++--- GBM/Forms/frmIncludeExclude.resx | 5 +- GBM/Forms/frmIncludeExclude.vb | 84 ++++++++++++++++++------- 4 files changed, 115 insertions(+), 33 deletions(-) diff --git a/GBM/Forms/frmGameManager.Designer.vb b/GBM/Forms/frmGameManager.Designer.vb index 41414ec..8cc94e2 100644 --- a/GBM/Forms/frmGameManager.Designer.vb +++ b/GBM/Forms/frmGameManager.Designer.vb @@ -163,7 +163,7 @@ Partial Class frmGameManager ' 'btnExclude ' - Me.btnExclude.Location = New System.Drawing.Point(498, 123) + Me.btnExclude.Location = New System.Drawing.Point(69, 122) Me.btnExclude.Name = "btnExclude" Me.btnExclude.Size = New System.Drawing.Size(30, 20) Me.btnExclude.TabIndex = 13 @@ -172,7 +172,7 @@ Partial Class frmGameManager ' 'btnInclude ' - Me.btnInclude.Location = New System.Drawing.Point(498, 97) + Me.btnInclude.Location = New System.Drawing.Point(69, 97) Me.btnInclude.Name = "btnInclude" Me.btnInclude.Size = New System.Drawing.Size(30, 20) Me.btnInclude.TabIndex = 11 @@ -254,17 +254,19 @@ Partial Class frmGameManager ' 'txtExclude ' - Me.txtExclude.Location = New System.Drawing.Point(69, 123) + Me.txtExclude.Location = New System.Drawing.Point(105, 123) Me.txtExclude.Name = "txtExclude" Me.txtExclude.Size = New System.Drawing.Size(423, 20) Me.txtExclude.TabIndex = 12 + Me.txtExclude.Visible = False ' 'txtFileType ' - Me.txtFileType.Location = New System.Drawing.Point(69, 97) + Me.txtFileType.Location = New System.Drawing.Point(105, 97) Me.txtFileType.Name = "txtFileType" Me.txtFileType.Size = New System.Drawing.Size(423, 20) Me.txtFileType.TabIndex = 10 + Me.txtFileType.Visible = False ' 'chkTimeStamp ' diff --git a/GBM/Forms/frmIncludeExclude.Designer.vb b/GBM/Forms/frmIncludeExclude.Designer.vb index bbcf39f..676159e 100644 --- a/GBM/Forms/frmIncludeExclude.Designer.vb +++ b/GBM/Forms/frmIncludeExclude.Designer.vb @@ -31,12 +31,17 @@ Partial Class frmIncludeExclude Me.txtRootFolder = New System.Windows.Forms.TextBox() Me.btnBrowse = New System.Windows.Forms.Button() Me.lstBuilder = New System.Windows.Forms.ListView() + Me.cmsItems = New System.Windows.Forms.ContextMenuStrip(Me.components) + Me.cmsEdit = New System.Windows.Forms.ToolStripMenuItem() + Me.cmsRemove = New System.Windows.Forms.ToolStripMenuItem() + Me.cmsAdd = New System.Windows.Forms.ToolStripMenuItem() Me.btnRemove = New System.Windows.Forms.Button() Me.btnAdd = New System.Windows.Forms.Button() Me.grpFileOptions = New System.Windows.Forms.GroupBox() Me.optFileTypes = New System.Windows.Forms.RadioButton() Me.optIndividualFiles = New System.Windows.Forms.RadioButton() Me.lblItems = New System.Windows.Forms.Label() + Me.cmsItems.SuspendLayout() Me.grpFileOptions.SuspendLayout() Me.SuspendLayout() ' @@ -82,13 +87,13 @@ Partial Class frmIncludeExclude Me.txtRootFolder.Location = New System.Drawing.Point(12, 12) Me.txtRootFolder.Name = "txtRootFolder" Me.txtRootFolder.ReadOnly = True - Me.txtRootFolder.Size = New System.Drawing.Size(194, 20) + Me.txtRootFolder.Size = New System.Drawing.Size(214, 20) Me.txtRootFolder.TabIndex = 0 Me.txtRootFolder.TabStop = False ' 'btnBrowse ' - Me.btnBrowse.Location = New System.Drawing.Point(212, 12) + Me.btnBrowse.Location = New System.Drawing.Point(232, 12) Me.btnBrowse.Name = "btnBrowse" Me.btnBrowse.Size = New System.Drawing.Size(30, 20) Me.btnBrowse.TabIndex = 0 @@ -97,6 +102,7 @@ Partial Class frmIncludeExclude ' 'lstBuilder ' + Me.lstBuilder.ContextMenuStrip = Me.cmsItems Me.lstBuilder.LabelEdit = True Me.lstBuilder.Location = New System.Drawing.Point(322, 38) Me.lstBuilder.Name = "lstBuilder" @@ -106,13 +112,37 @@ Partial Class frmIncludeExclude Me.lstBuilder.UseCompatibleStateImageBehavior = False Me.lstBuilder.View = System.Windows.Forms.View.List ' + 'cmsItems + ' + Me.cmsItems.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.cmsEdit, Me.cmsRemove, Me.cmsAdd}) + Me.cmsItems.Name = "cmsItems" + Me.cmsItems.Size = New System.Drawing.Size(169, 70) + ' + 'cmsEdit + ' + Me.cmsEdit.Name = "cmsEdit" + Me.cmsEdit.Size = New System.Drawing.Size(168, 22) + Me.cmsEdit.Text = "Edit" + ' + 'cmsRemove + ' + Me.cmsRemove.Name = "cmsRemove" + Me.cmsRemove.Size = New System.Drawing.Size(168, 22) + Me.cmsRemove.Text = "Remove" + ' + 'cmsAdd + ' + Me.cmsAdd.Name = "cmsAdd" + Me.cmsAdd.Size = New System.Drawing.Size(168, 22) + Me.cmsAdd.Text = "Add Custom Item" + ' 'btnRemove ' Me.btnRemove.Location = New System.Drawing.Point(268, 201) Me.btnRemove.Name = "btnRemove" Me.btnRemove.Size = New System.Drawing.Size(48, 23) Me.btnRemove.TabIndex = 4 - Me.btnRemove.Text = "< <" + Me.btnRemove.Text = "<" Me.btnRemove.UseVisualStyleBackColor = True ' 'btnAdd @@ -121,7 +151,7 @@ Partial Class frmIncludeExclude Me.btnAdd.Name = "btnAdd" Me.btnAdd.Size = New System.Drawing.Size(48, 23) Me.btnAdd.TabIndex = 3 - Me.btnAdd.Text = "> >" + Me.btnAdd.Text = ">" Me.btnAdd.UseVisualStyleBackColor = True ' 'grpFileOptions @@ -159,12 +189,12 @@ Partial Class frmIncludeExclude ' 'lblItems ' - Me.lblItems.AutoSize = True - Me.lblItems.Location = New System.Drawing.Point(319, 16) + Me.lblItems.Location = New System.Drawing.Point(322, 16) Me.lblItems.Name = "lblItems" - Me.lblItems.Size = New System.Drawing.Size(32, 13) + Me.lblItems.Size = New System.Drawing.Size(250, 13) Me.lblItems.TabIndex = 14 Me.lblItems.Text = "Items" + Me.lblItems.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'frmIncludeExclude ' @@ -188,6 +218,7 @@ Partial Class frmIncludeExclude Me.ShowIcon = False Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen Me.Text = "Include / Exclude Builder" + Me.cmsItems.ResumeLayout(False) Me.grpFileOptions.ResumeLayout(False) Me.grpFileOptions.PerformLayout() Me.ResumeLayout(False) @@ -207,4 +238,8 @@ Partial Class frmIncludeExclude Friend WithEvents optFileTypes As System.Windows.Forms.RadioButton Friend WithEvents optIndividualFiles As System.Windows.Forms.RadioButton Friend WithEvents lblItems As System.Windows.Forms.Label + Friend WithEvents cmsItems As System.Windows.Forms.ContextMenuStrip + Friend WithEvents cmsEdit As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents cmsRemove As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents cmsAdd As System.Windows.Forms.ToolStripMenuItem End Class diff --git a/GBM/Forms/frmIncludeExclude.resx b/GBM/Forms/frmIncludeExclude.resx index 636e792..b26b3df 100644 --- a/GBM/Forms/frmIncludeExclude.resx +++ b/GBM/Forms/frmIncludeExclude.resx @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB6 - CQAAAk1TRnQBSQFMAgEBAwEAAVABAAFQAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CQAAAk1TRnQBSQFMAgEBAwEAAZABAAGQAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -168,4 +168,7 @@ AQcBgAF/AgAC/wHwAR8BgAH/AgAC/wH4AT8C/wIACw== + + 118, 17 + \ No newline at end of file diff --git a/GBM/Forms/frmIncludeExclude.vb b/GBM/Forms/frmIncludeExclude.vb index 3b08fcc..7551d9f 100644 --- a/GBM/Forms/frmIncludeExclude.vb +++ b/GBM/Forms/frmIncludeExclude.vb @@ -33,7 +33,7 @@ Public Class frmIncludeExclude End Set End Property - Private Sub BuildBranch(ByVal sDirectory As String, ByVal oNode As TreeNode, ByVal bIsDriveRoot As Boolean) + Private Sub BuildBranch(ByVal sDirectory As String, ByVal oNode As TreeNode) Dim sFolders As String() Dim sFiles As String() Dim oChild As TreeNode @@ -49,13 +49,9 @@ Public Class frmIncludeExclude sFiles = Directory.GetFiles(sDirectory) If sFolders.Length <> 0 Then - For Each sFolder As String In sFolders - If bIsDriveRoot Then - oChild = New TreeNode(sFolder.Replace(sDirectory, String.Empty), 0, 0) - Else - oChild = New TreeNode(sFolder.Replace(sDirectory & "\", String.Empty), 0, 0) - End If - oChild.Name = sFolder + For Each sFolder As String In sFolders + oChild = New TreeNode(sFolder.Replace(sDirectory, String.Empty).TrimStart("\"), 0, 0) + oChild.Name = sFolder oChild.Tag = 0 oNode.Nodes.Add(oChild) oPlaceHolder = New TreeNode("GBM_Tree_Placeholder") @@ -65,12 +61,8 @@ Public Class frmIncludeExclude End If If sFiles.Length <> 0 Then - For Each sFile As String In sFiles - If bIsDriveRoot Then - oChild = New TreeNode(sFile.Replace(sDirectory, String.Empty), 1, 1) - Else - oChild = New TreeNode(sFile.Replace(sDirectory & "\", String.Empty), 1, 1) - End If + For Each sFile As String In sFiles + oChild = New TreeNode(sFile.Replace(sDirectory, String.Empty).TrimStart("\"), 1, 1) oChild.Tag = 1 oNode.Nodes.Add(oChild) Next @@ -88,20 +80,17 @@ Public Class frmIncludeExclude Private Sub BuildTrunk() Dim oRootNode As TreeNode - Dim bIsDriveRoot As Boolean If Path.GetPathRoot(txtRootFolder.Text) = txtRootFolder.Text Then oRootNode = New TreeNode(txtRootFolder.Text, 0, 0) - bIsDriveRoot = True Else oRootNode = New TreeNode(Path.GetFileName(txtRootFolder.Text), 0, 0) - bIsDriveRoot = False End If treFiles.Nodes.Clear() oRootNode.Name = "Root" treFiles.Nodes.Add(oRootNode) - BuildBranch(txtRootFolder.Text, oRootNode, bIsDriveRoot) + BuildBranch(txtRootFolder.Text, oRootNode) End Sub Private Sub RootPathBrowse() @@ -195,6 +184,24 @@ Public Class frmIncludeExclude Next End Sub + Private Sub IdentifyEntry(ByRef oListItem As ListViewItem, ByVal sNewLabel As String) + Dim iType As Integer = 1 + + If sNewLabel.Contains("*") Then + iType = 2 + Else + If txtRootFolder.Text <> String.Empty Then + If Directory.Exists(txtRootFolder.Text & "\" & sNewLabel) Then + iType = 0 + Else + iType = 1 + End If + End If + End If + + oListItem.ImageIndex = iType + End Sub + Private Sub CreateNewBuilderString() Dim sTempString As String = String.Empty @@ -208,12 +215,12 @@ Public Class frmIncludeExclude End Sub Private Sub frmIncludeExclude_Load(sender As Object, e As EventArgs) Handles MyBase.Load - Me.Text = FormName & " Builder" + Me.Text = FormName & " Builder" txtRootFolder.Text = RootFolder optFileTypes.Checked = True lblItems.Text = FormName & " Items" If BuilderString <> String.Empty Then ParseBuilderString() - If txtRootFolder.Text <> String.Empty Then BuildTrunk() + If txtRootFolder.Text <> String.Empty Then BuildTrunk() End Sub Private Sub frmIncludeExclude_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown @@ -239,7 +246,7 @@ Public Class frmIncludeExclude Private Sub treFiles_BeforeExpand(sender As Object, e As TreeViewCancelEventArgs) Handles treFiles.BeforeExpand If Not e.Node.Name = "Root" Then - BuildBranch(e.Node.Name, e.Node, False) + BuildBranch(e.Node.Name, e.Node) End If End Sub @@ -250,4 +257,39 @@ Public Class frmIncludeExclude Private Sub btnRemove_Click(sender As Object, e As EventArgs) Handles btnRemove.Click RemoveItem() End Sub + + Private Sub cmsItems_Opening(sender As Object, e As System.ComponentModel.CancelEventArgs) Handles cmsItems.Opening + If lstBuilder.SelectedItems.Count = 0 Then + cmsEdit.Visible = False + cmsRemove.Visible = False + cmsAdd.Visible = True + Else + cmsEdit.Visible = True + cmsRemove.Visible = True + cmsAdd.Visible = False + End If + End Sub + + Private Sub cmsEdit_Click(sender As Object, e As EventArgs) Handles cmsEdit.Click + If lstBuilder.SelectedItems.Count > 0 Then + lstBuilder.SelectedItems(0).BeginEdit() + End If + End Sub + + Private Sub cmsRemove_Click(sender As Object, e As EventArgs) Handles cmsRemove.Click + RemoveItem() + End Sub + + Private Sub cmsAdd_Click(sender As Object, e As EventArgs) Handles cmsAdd.Click + Dim oNewItem As New ListViewItem("Custom Item", 1) + oNewItem.Selected = True + lstBuilder.Items.Add(oNewItem) + lstBuilder.SelectedItems(0).BeginEdit() + End Sub + + Private Sub lstBuilder_AfterLabelEdit(sender As Object, e As LabelEditEventArgs) Handles lstBuilder.AfterLabelEdit + If Not e.Label Is Nothing Then + IdentifyEntry(lstBuilder.Items(e.Item), e.Label) + End If + End Sub End Class \ No newline at end of file From 3062b20775ee21446d1e4b370c9f6c9777133ff2 Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Mon, 30 Nov 2015 15:05:46 -0600 Subject: [PATCH 5/6] Second pass of include / exclude builder --- GBM/Forms/frmGameManager.Designer.vb | 88 ++++++--------- GBM/Forms/frmGameManager.vb | 35 ++++++ GBM/Forms/frmIncludeExclude.Designer.vb | 46 ++++++-- GBM/Forms/frmIncludeExclude.resx | 5 +- GBM/Forms/frmIncludeExclude.vb | 135 ++++++++++++++---------- 5 files changed, 191 insertions(+), 118 deletions(-) diff --git a/GBM/Forms/frmGameManager.Designer.vb b/GBM/Forms/frmGameManager.Designer.vb index 8cc94e2..7a8a877 100644 --- a/GBM/Forms/frmGameManager.Designer.vb +++ b/GBM/Forms/frmGameManager.Designer.vb @@ -30,8 +30,6 @@ Partial Class frmGameManager Me.btnExclude = New System.Windows.Forms.Button() Me.btnInclude = New System.Windows.Forms.Button() Me.txtID = New System.Windows.Forms.TextBox() - Me.lblExclude = New System.Windows.Forms.Label() - Me.lblFileType = New System.Windows.Forms.Label() Me.btnSavePathBrowse = New System.Windows.Forms.Button() Me.btnProcessBrowse = New System.Windows.Forms.Button() Me.lblSavePath = New System.Windows.Forms.Label() @@ -139,8 +137,6 @@ Partial Class frmGameManager Me.grpConfig.Controls.Add(Me.btnExclude) Me.grpConfig.Controls.Add(Me.btnInclude) Me.grpConfig.Controls.Add(Me.txtID) - Me.grpConfig.Controls.Add(Me.lblExclude) - Me.grpConfig.Controls.Add(Me.lblFileType) Me.grpConfig.Controls.Add(Me.btnSavePathBrowse) Me.grpConfig.Controls.Add(Me.btnProcessBrowse) Me.grpConfig.Controls.Add(Me.lblSavePath) @@ -156,57 +152,39 @@ Partial Class frmGameManager Me.grpConfig.Enabled = False Me.grpConfig.Location = New System.Drawing.Point(238, 12) Me.grpConfig.Name = "grpConfig" - Me.grpConfig.Size = New System.Drawing.Size(534, 182) + Me.grpConfig.Size = New System.Drawing.Size(534, 157) Me.grpConfig.TabIndex = 4 Me.grpConfig.TabStop = False Me.grpConfig.Text = "Configuration" ' 'btnExclude ' - Me.btnExclude.Location = New System.Drawing.Point(69, 122) + Me.btnExclude.Location = New System.Drawing.Point(9, 125) Me.btnExclude.Name = "btnExclude" - Me.btnExclude.Size = New System.Drawing.Size(30, 20) + Me.btnExclude.Size = New System.Drawing.Size(176, 23) Me.btnExclude.TabIndex = 13 - Me.btnExclude.Text = "..." + Me.btnExclude.Text = "E&xclude Items..." Me.btnExclude.UseVisualStyleBackColor = True ' 'btnInclude ' - Me.btnInclude.Location = New System.Drawing.Point(69, 97) + Me.btnInclude.Location = New System.Drawing.Point(9, 97) Me.btnInclude.Name = "btnInclude" - Me.btnInclude.Size = New System.Drawing.Size(30, 20) - Me.btnInclude.TabIndex = 11 - Me.btnInclude.Text = "..." + Me.btnInclude.Size = New System.Drawing.Size(176, 23) + Me.btnInclude.TabIndex = 10 + Me.btnInclude.Text = "In&clude Items..." Me.btnInclude.UseVisualStyleBackColor = True ' 'txtID ' Me.txtID.Enabled = False - Me.txtID.Location = New System.Drawing.Point(495, 147) + Me.txtID.Location = New System.Drawing.Point(495, 19) Me.txtID.Name = "txtID" Me.txtID.Size = New System.Drawing.Size(33, 20) Me.txtID.TabIndex = 16 Me.txtID.TabStop = False Me.txtID.Visible = False ' - 'lblExclude - ' - Me.lblExclude.AutoSize = True - Me.lblExclude.Location = New System.Drawing.Point(6, 126) - Me.lblExclude.Name = "lblExclude" - Me.lblExclude.Size = New System.Drawing.Size(48, 13) - Me.lblExclude.TabIndex = 4 - Me.lblExclude.Text = "Exclude:" - ' - 'lblFileType - ' - Me.lblFileType.AutoSize = True - Me.lblFileType.Location = New System.Drawing.Point(6, 100) - Me.lblFileType.Name = "lblFileType" - Me.lblFileType.Size = New System.Drawing.Size(45, 13) - Me.lblFileType.TabIndex = 3 - Me.lblFileType.Text = "Include:" - ' 'btnSavePathBrowse ' Me.btnSavePathBrowse.Location = New System.Drawing.Point(498, 71) @@ -254,37 +232,39 @@ Partial Class frmGameManager ' 'txtExclude ' - Me.txtExclude.Location = New System.Drawing.Point(105, 123) + Me.txtExclude.Location = New System.Drawing.Point(354, 127) Me.txtExclude.Name = "txtExclude" - Me.txtExclude.Size = New System.Drawing.Size(423, 20) - Me.txtExclude.TabIndex = 12 + Me.txtExclude.Size = New System.Drawing.Size(174, 20) + Me.txtExclude.TabIndex = 0 + Me.txtExclude.TabStop = False Me.txtExclude.Visible = False ' 'txtFileType ' - Me.txtFileType.Location = New System.Drawing.Point(105, 97) + Me.txtFileType.Location = New System.Drawing.Point(354, 99) Me.txtFileType.Name = "txtFileType" - Me.txtFileType.Size = New System.Drawing.Size(423, 20) - Me.txtFileType.TabIndex = 10 + Me.txtFileType.Size = New System.Drawing.Size(174, 20) + Me.txtFileType.TabIndex = 0 + Me.txtFileType.TabStop = False Me.txtFileType.Visible = False ' 'chkTimeStamp ' Me.chkTimeStamp.AutoSize = True - Me.chkTimeStamp.Location = New System.Drawing.Point(124, 149) + Me.chkTimeStamp.Location = New System.Drawing.Point(191, 129) Me.chkTimeStamp.Name = "chkTimeStamp" Me.chkTimeStamp.Size = New System.Drawing.Size(146, 17) - Me.chkTimeStamp.TabIndex = 15 + Me.chkTimeStamp.TabIndex = 14 Me.chkTimeStamp.Text = "Time stamp each backup" Me.chkTimeStamp.UseVisualStyleBackColor = True ' 'chkFolderSave ' Me.chkFolderSave.AutoSize = True - Me.chkFolderSave.Location = New System.Drawing.Point(9, 149) + Me.chkFolderSave.Location = New System.Drawing.Point(191, 101) Me.chkFolderSave.Name = "chkFolderSave" Me.chkFolderSave.Size = New System.Drawing.Size(109, 17) - Me.chkFolderSave.TabIndex = 14 + Me.chkFolderSave.TabIndex = 11 Me.chkFolderSave.Text = "Save entire folder" Me.chkFolderSave.UseVisualStyleBackColor = True ' @@ -306,13 +286,13 @@ Partial Class frmGameManager ' Me.txtName.Location = New System.Drawing.Point(69, 19) Me.txtName.Name = "txtName" - Me.txtName.Size = New System.Drawing.Size(459, 20) + Me.txtName.Size = New System.Drawing.Size(423, 20) Me.txtName.TabIndex = 5 ' 'chkMonitorOnly ' Me.chkMonitorOnly.AutoSize = True - Me.chkMonitorOnly.Location = New System.Drawing.Point(353, 365) + Me.chkMonitorOnly.Location = New System.Drawing.Point(353, 340) Me.chkMonitorOnly.Name = "chkMonitorOnly" Me.chkMonitorOnly.Size = New System.Drawing.Size(145, 17) Me.chkMonitorOnly.TabIndex = 7 @@ -336,7 +316,7 @@ Partial Class frmGameManager Me.grpExtra.Controls.Add(Me.txtAppPath) Me.grpExtra.Controls.Add(Me.nudHours) Me.grpExtra.Controls.Add(Me.lblHours) - Me.grpExtra.Location = New System.Drawing.Point(238, 200) + Me.grpExtra.Location = New System.Drawing.Point(238, 175) Me.grpExtra.Name = "grpExtra" Me.grpExtra.Size = New System.Drawing.Size(534, 155) Me.grpExtra.TabIndex = 5 @@ -467,7 +447,7 @@ Partial Class frmGameManager ' 'btnTags ' - Me.btnTags.Location = New System.Drawing.Point(535, 360) + Me.btnTags.Location = New System.Drawing.Point(535, 336) Me.btnTags.Name = "btnTags" Me.btnTags.Size = New System.Drawing.Size(75, 23) Me.btnTags.TabIndex = 8 @@ -487,9 +467,9 @@ Partial Class frmGameManager Me.grpStats.Controls.Add(Me.lblCurrentBackup) Me.grpStats.Controls.Add(Me.txtLocalBackup) Me.grpStats.Controls.Add(Me.lblLastBackup) - Me.grpStats.Location = New System.Drawing.Point(238, 390) + Me.grpStats.Location = New System.Drawing.Point(238, 365) Me.grpStats.Name = "grpStats" - Me.grpStats.Size = New System.Drawing.Size(534, 129) + Me.grpStats.Size = New System.Drawing.Size(534, 154) Me.grpStats.TabIndex = 11 Me.grpStats.TabStop = False Me.grpStats.Text = "Backup Information" @@ -497,7 +477,7 @@ Partial Class frmGameManager 'btnOpenRestorePath ' Me.btnOpenRestorePath.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.btnOpenRestorePath.Location = New System.Drawing.Point(336, 100) + Me.btnOpenRestorePath.Location = New System.Drawing.Point(339, 105) Me.btnOpenRestorePath.Name = "btnOpenRestorePath" Me.btnOpenRestorePath.Size = New System.Drawing.Size(114, 23) Me.btnOpenRestorePath.TabIndex = 9 @@ -507,7 +487,7 @@ Partial Class frmGameManager 'btnOpenBackupFile ' Me.btnOpenBackupFile.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.btnOpenBackupFile.Location = New System.Drawing.Point(216, 100) + Me.btnOpenBackupFile.Location = New System.Drawing.Point(216, 105) Me.btnOpenBackupFile.Name = "btnOpenBackupFile" Me.btnOpenBackupFile.Size = New System.Drawing.Size(114, 23) Me.btnOpenBackupFile.TabIndex = 8 @@ -526,7 +506,7 @@ Partial Class frmGameManager 'btnDeleteBackup ' Me.btnDeleteBackup.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.btnDeleteBackup.Location = New System.Drawing.Point(96, 100) + Me.btnDeleteBackup.Location = New System.Drawing.Point(96, 105) Me.btnDeleteBackup.Name = "btnDeleteBackup" Me.btnDeleteBackup.Size = New System.Drawing.Size(114, 23) Me.btnDeleteBackup.TabIndex = 7 @@ -611,7 +591,7 @@ Partial Class frmGameManager '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(616, 360) + Me.btnSave.Location = New System.Drawing.Point(616, 336) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(75, 23) Me.btnSave.TabIndex = 9 @@ -631,7 +611,7 @@ Partial Class frmGameManager 'btnCancel ' Me.btnCancel.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) - Me.btnCancel.Location = New System.Drawing.Point(697, 360) + Me.btnCancel.Location = New System.Drawing.Point(697, 336) Me.btnCancel.Name = "btnCancel" Me.btnCancel.Size = New System.Drawing.Size(75, 23) Me.btnCancel.TabIndex = 10 @@ -641,7 +621,7 @@ Partial Class frmGameManager 'chkEnabled ' Me.chkEnabled.AutoSize = True - Me.chkEnabled.Location = New System.Drawing.Point(238, 365) + Me.chkEnabled.Location = New System.Drawing.Point(238, 340) Me.chkEnabled.Name = "chkEnabled" Me.chkEnabled.Size = New System.Drawing.Size(109, 17) Me.chkEnabled.TabIndex = 6 @@ -766,8 +746,6 @@ Partial Class frmGameManager Friend WithEvents txtFileType As System.Windows.Forms.TextBox Friend WithEvents btnSavePathBrowse As System.Windows.Forms.Button Friend WithEvents btnProcessBrowse As System.Windows.Forms.Button - Friend WithEvents lblExclude As System.Windows.Forms.Label - Friend WithEvents lblFileType As System.Windows.Forms.Label Friend WithEvents btnSave As System.Windows.Forms.Button Friend WithEvents btnAppPathBrowse As System.Windows.Forms.Button Friend WithEvents lblGamePath As System.Windows.Forms.Label diff --git a/GBM/Forms/frmGameManager.vb b/GBM/Forms/frmGameManager.vb index 2940b9d..ff8585c 100644 --- a/GBM/Forms/frmGameManager.vb +++ b/GBM/Forms/frmGameManager.vb @@ -365,12 +365,16 @@ Public Class frmGameManager lstGames.ValueMember = "Key" lstGames.DisplayMember = "Value" + lstGames.BeginUpdate() + For Each de As DictionaryEntry In AppData oApp = DirectCast(de.Value, clsGame) oData = New KeyValuePair(Of String, String)(oApp.ID, oApp.Name) lstGames.Items.Add(oData) Next + lstGames.EndUpdate() + IsLoading = False End Sub @@ -386,6 +390,22 @@ Public Class frmGameManager End Sub + Private Sub UpdateBuilderButtonLabel(ByVal sBuilderString As String, ByVal sLabel As String, ByVal btn As Button, ByVal bDirty As Boolean) + Dim iCount As Integer = sBuilderString.Split(":").Length + + If sBuilderString <> String.Empty And iCount > 0 Then + btn.Text = sLabel & " Items... (" & iCount & ")" + Else + btn.Text = sLabel & " Items..." + End If + + If bDirty Then + btn.Font = New Font(FontFamily.GenericSansSerif, 8.25, FontStyle.Bold) + Else + btn.Font = New Font(FontFamily.GenericSansSerif, 8.25, FontStyle.Regular) + End If + End Sub + Private Function GetBuilderRoot() As String Dim sRoot As String = String.Empty @@ -411,6 +431,7 @@ Public Class frmGameManager frm.RootFolder = GetBuilderRoot() frm.ShowDialog() + txtBox.Text = frm.BuilderString End Sub @@ -598,6 +619,10 @@ Public Class frmGameManager chkEnabled.Checked = oApp.Enabled chkMonitorOnly.Checked = oApp.MonitorOnly + 'Update Buttons + UpdateBuilderButtonLabel(oApp.FileType, "In&clude", btnInclude, False) + UpdateBuilderButtonLabel(oApp.ExcludeList, "E&xclude", btnExclude, False) + 'Extra txtAppPath.Text = oApp.ProcessPath txtCompany.Text = oApp.Company @@ -1229,9 +1254,19 @@ Public Class frmGameManager Private Sub btnInclude_Click(sender As Object, e As EventArgs) Handles btnInclude.Click OpenBuilder("Include", txtFileType) + UpdateBuilderButtonLabel(txtFileType.Text, "In&clude", btnInclude, (oCurrentGame.FileType <> txtFileType.Text)) End Sub Private Sub btnExclude_Click(sender As Object, e As EventArgs) Handles btnExclude.Click OpenBuilder("Exclude", txtExclude) + UpdateBuilderButtonLabel(txtExclude.Text, "E&xclude", btnExclude, (oCurrentGame.ExcludeList <> txtExclude.Text)) + End Sub + + Private Sub chkFolderSave_CheckedChanged(sender As Object, e As EventArgs) Handles chkFolderSave.CheckedChanged + If chkFolderSave.Checked Then + btnInclude.Enabled = False + Else + btnInclude.Enabled = True + End If End Sub End Class \ No newline at end of file diff --git a/GBM/Forms/frmIncludeExclude.Designer.vb b/GBM/Forms/frmIncludeExclude.Designer.vb index 676159e..df304ad 100644 --- a/GBM/Forms/frmIncludeExclude.Designer.vb +++ b/GBM/Forms/frmIncludeExclude.Designer.vb @@ -41,6 +41,9 @@ Partial Class frmIncludeExclude Me.optFileTypes = New System.Windows.Forms.RadioButton() Me.optIndividualFiles = New System.Windows.Forms.RadioButton() Me.lblItems = New System.Windows.Forms.Label() + Me.btnRawEdit = New System.Windows.Forms.Button() + Me.lblSaveFolder = New System.Windows.Forms.Label() + Me.ttWarning = New System.Windows.Forms.ToolTip(Me.components) Me.cmsItems.SuspendLayout() Me.grpFileOptions.SuspendLayout() Me.SuspendLayout() @@ -50,10 +53,10 @@ Partial Class frmIncludeExclude Me.treFiles.CheckBoxes = True Me.treFiles.ImageIndex = 0 Me.treFiles.ImageList = Me.imgIcons - Me.treFiles.Location = New System.Drawing.Point(12, 38) + Me.treFiles.Location = New System.Drawing.Point(12, 64) Me.treFiles.Name = "treFiles" Me.treFiles.SelectedImageIndex = 0 - Me.treFiles.Size = New System.Drawing.Size(250, 359) + Me.treFiles.Size = New System.Drawing.Size(250, 333) Me.treFiles.TabIndex = 1 ' 'imgIcons @@ -69,8 +72,8 @@ Partial Class frmIncludeExclude Me.btnSave.Location = New System.Drawing.Point(416, 426) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(75, 23) - Me.btnSave.TabIndex = 6 - Me.btnSave.Text = "Save" + Me.btnSave.TabIndex = 7 + Me.btnSave.Text = "&Save" Me.btnSave.UseVisualStyleBackColor = True ' 'btnCancel @@ -78,13 +81,13 @@ Partial Class frmIncludeExclude Me.btnCancel.Location = New System.Drawing.Point(497, 426) Me.btnCancel.Name = "btnCancel" Me.btnCancel.Size = New System.Drawing.Size(75, 23) - Me.btnCancel.TabIndex = 7 - Me.btnCancel.Text = "Cancel" + Me.btnCancel.TabIndex = 8 + Me.btnCancel.Text = "&Cancel" Me.btnCancel.UseVisualStyleBackColor = True ' 'txtRootFolder ' - Me.txtRootFolder.Location = New System.Drawing.Point(12, 12) + Me.txtRootFolder.Location = New System.Drawing.Point(12, 38) Me.txtRootFolder.Name = "txtRootFolder" Me.txtRootFolder.ReadOnly = True Me.txtRootFolder.Size = New System.Drawing.Size(214, 20) @@ -93,7 +96,7 @@ Partial Class frmIncludeExclude ' 'btnBrowse ' - Me.btnBrowse.Location = New System.Drawing.Point(232, 12) + Me.btnBrowse.Location = New System.Drawing.Point(232, 37) Me.btnBrowse.Name = "btnBrowse" Me.btnBrowse.Size = New System.Drawing.Size(30, 20) Me.btnBrowse.TabIndex = 0 @@ -196,11 +199,35 @@ Partial Class frmIncludeExclude Me.lblItems.Text = "Items" Me.lblItems.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' + 'btnRawEdit + ' + Me.btnRawEdit.Location = New System.Drawing.Point(335, 426) + Me.btnRawEdit.Name = "btnRawEdit" + Me.btnRawEdit.Size = New System.Drawing.Size(75, 23) + Me.btnRawEdit.TabIndex = 6 + Me.btnRawEdit.Text = "Raw &Edit" + Me.btnRawEdit.UseVisualStyleBackColor = True + ' + 'lblSaveFolder + ' + Me.lblSaveFolder.Location = New System.Drawing.Point(9, 16) + Me.lblSaveFolder.Name = "lblSaveFolder" + Me.lblSaveFolder.Size = New System.Drawing.Size(250, 13) + Me.lblSaveFolder.TabIndex = 15 + Me.lblSaveFolder.Text = "Saved Game Folder" + Me.lblSaveFolder.TextAlign = System.Drawing.ContentAlignment.MiddleCenter + ' + 'ttWarning + ' + Me.ttWarning.ToolTipIcon = System.Windows.Forms.ToolTipIcon.Warning + ' 'frmIncludeExclude ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(584, 461) + Me.Controls.Add(Me.lblSaveFolder) + Me.Controls.Add(Me.btnRawEdit) Me.Controls.Add(Me.lblItems) Me.Controls.Add(Me.grpFileOptions) Me.Controls.Add(Me.btnRemove) @@ -242,4 +269,7 @@ Partial Class frmIncludeExclude Friend WithEvents cmsEdit As System.Windows.Forms.ToolStripMenuItem Friend WithEvents cmsRemove As System.Windows.Forms.ToolStripMenuItem Friend WithEvents cmsAdd As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents btnRawEdit As Button + Friend WithEvents lblSaveFolder As Label + Friend WithEvents ttWarning As ToolTip End Class diff --git a/GBM/Forms/frmIncludeExclude.resx b/GBM/Forms/frmIncludeExclude.resx index b26b3df..423d39f 100644 --- a/GBM/Forms/frmIncludeExclude.resx +++ b/GBM/Forms/frmIncludeExclude.resx @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB6 - CQAAAk1TRnQBSQFMAgEBAwEAAZABAAGQAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CQAAAk1TRnQBSQFMAgEBAwEAAaABAAGgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA @@ -171,4 +171,7 @@ 118, 17 + + 221, 17 + \ No newline at end of file diff --git a/GBM/Forms/frmIncludeExclude.vb b/GBM/Forms/frmIncludeExclude.vb index 7551d9f..d246558 100644 --- a/GBM/Forms/frmIncludeExclude.vb +++ b/GBM/Forms/frmIncludeExclude.vb @@ -39,43 +39,45 @@ Public Class frmIncludeExclude Dim oChild As TreeNode Dim oPlaceHolder As TreeNode - Try - Cursor.Current = Cursors.WaitCursor - treFiles.BeginUpdate() + If oNode.Nodes.ContainsKey("GBM_Tree_Placeholder") Then + Try + Cursor.Current = Cursors.WaitCursor + treFiles.BeginUpdate() - oNode.Nodes.RemoveByKey("GBM_Tree_Placeholder") + oNode.Nodes.RemoveByKey("GBM_Tree_Placeholder") - sFolders = Directory.GetDirectories(sDirectory) - sFiles = Directory.GetFiles(sDirectory) + sFolders = Directory.GetDirectories(sDirectory) + sFiles = Directory.GetFiles(sDirectory) - If sFolders.Length <> 0 Then - For Each sFolder As String In sFolders - oChild = New TreeNode(sFolder.Replace(sDirectory, String.Empty).TrimStart("\"), 0, 0) - oChild.Name = sFolder - oChild.Tag = 0 - oNode.Nodes.Add(oChild) - oPlaceHolder = New TreeNode("GBM_Tree_Placeholder") - oPlaceHolder.Name = "GBM_Tree_Placeholder" - oChild.Nodes.Add(oPlaceHolder) - Next - End If + If sFolders.Length <> 0 Then + For Each sFolder As String In sFolders + oChild = New TreeNode(sFolder.Replace(sDirectory, String.Empty).TrimStart("\"), 0, 0) + oChild.Name = sFolder + oChild.Tag = 0 + oNode.Nodes.Add(oChild) + oPlaceHolder = New TreeNode("GBM_Tree_Placeholder") + oPlaceHolder.Name = "GBM_Tree_Placeholder" + oChild.Nodes.Add(oPlaceHolder) + Next + End If - If sFiles.Length <> 0 Then - For Each sFile As String In sFiles - oChild = New TreeNode(sFile.Replace(sDirectory, String.Empty).TrimStart("\"), 1, 1) - oChild.Tag = 1 - oNode.Nodes.Add(oChild) - Next - End If + If sFiles.Length <> 0 Then + For Each sFile As String In sFiles + oChild = New TreeNode(sFile.Replace(sDirectory, String.Empty).TrimStart("\"), 1, 1) + oChild.Tag = 1 + oNode.Nodes.Add(oChild) + Next + End If - Catch uaex As UnauthorizedAccessException - 'Do Nothing - Catch ex As Exception - MsgBox("An unexpected error occured while reading the file system: " & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Critical, "Game Backup Monitor") - Finally - treFiles.EndUpdate() - Cursor.Current = Cursors.Default - End Try + Catch uaex As UnauthorizedAccessException + 'Do Nothing + Catch ex As Exception + MsgBox("An unexpected error occured while reading the file system: " & vbCrLf & vbCrLf & ex.Message, MsgBoxStyle.Critical, "Game Backup Monitor") + Finally + treFiles.EndUpdate() + Cursor.Current = Cursors.Default + End Try + End If End Sub Private Sub BuildTrunk() @@ -89,6 +91,7 @@ Public Class frmIncludeExclude treFiles.Nodes.Clear() oRootNode.Name = "Root" + oRootNode.Nodes.Add("GBM_Tree_Placeholder", "GBM_Tree_Placeholder") treFiles.Nodes.Add(oRootNode) BuildBranch(txtRootFolder.Text, oRootNode) End Sub @@ -160,38 +163,40 @@ Public Class frmIncludeExclude Next End Sub - Private Sub ParseBuilderString() + Private Sub ParseBuilderString(ByVal sString As String) Dim iType As Integer = 1 Dim oListViewItem As ListViewItem - Dim sItems As String() = BuilderString.Split(":") + Dim sItems As String() = sString.Split(":") + + lstBuilder.BeginUpdate() + lstBuilder.Clear() For Each sItem As String In sItems - If sItem.Contains("*") Then - iType = 2 - Else - If txtRootFolder.Text <> String.Empty Then - If Directory.Exists(txtRootFolder.Text & "\" & sItem) Then - iType = 0 - Else - iType = 1 - End If - End If - End If - - oListViewItem = New ListViewItem(sItem, iType) + oListViewItem = New ListViewItem(sItem) oListViewItem.Name = sItem - lstBuilder.Items.Add(oListViewItem) + IdentifyEntry(oListViewItem, sItem) + If Not lstBuilder.Items.ContainsKey(sItem) Then + lstBuilder.Items.Add(oListViewItem) + End If Next + + lstBuilder.EndUpdate() End Sub Private Sub IdentifyEntry(ByRef oListItem As ListViewItem, ByVal sNewLabel As String) Dim iType As Integer = 1 + Dim sFolderCheck As String If sNewLabel.Contains("*") Then iType = 2 Else If txtRootFolder.Text <> String.Empty Then - If Directory.Exists(txtRootFolder.Text & "\" & sNewLabel) Then + If Path.GetFileName(txtRootFolder.Text) = sNewLabel Then + sFolderCheck = txtRootFolder.Text + Else + sFolderCheck = txtRootFolder.Text & "\" & sNewLabel + End If + If Directory.Exists(sFolderCheck) Then iType = 0 Else iType = 1 @@ -202,7 +207,7 @@ Public Class frmIncludeExclude oListItem.ImageIndex = iType End Sub - Private Sub CreateNewBuilderString() + Private Function CreateNewBuilderString() As String Dim sTempString As String = String.Empty For Each oListViewItem As ListViewItem In lstBuilder.Items @@ -211,7 +216,16 @@ Public Class frmIncludeExclude sTempString = sTempString.TrimEnd(":") - BuilderString = sTempString + Return sTempString + End Function + + Private Sub OpenRawEdit() + Dim sCurrentString As String = CreateNewBuilderString() + Dim sNewString As String + sNewString = InputBox("Entries are semi-colon delimited.", FormName & " Raw Edit", sCurrentString) + If sNewString <> String.Empty Then + ParseBuilderString(sNewString) + End If End Sub Private Sub frmIncludeExclude_Load(sender As Object, e As EventArgs) Handles MyBase.Load @@ -219,13 +233,18 @@ Public Class frmIncludeExclude txtRootFolder.Text = RootFolder optFileTypes.Checked = True lblItems.Text = FormName & " Items" - If BuilderString <> String.Empty Then ParseBuilderString() + grpFileOptions.Text = FormName & " Options" + If BuilderString <> String.Empty Then ParseBuilderString(BuilderString) If txtRootFolder.Text <> String.Empty Then BuildTrunk() End Sub Private Sub frmIncludeExclude_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown treFiles.Select() If Not treFiles.SelectedNode Is Nothing Then treFiles.SelectedNode.Expand() + If txtRootFolder.Text = String.Empty Then + ttWarning.ToolTipTitle = "Notice" + ttWarning.Show("The saved game folder could not be determined or does not exist. Click here to manually set it.", btnBrowse, 10000) + End If End Sub Private Sub btnBrowse_Click(sender As Object, e As EventArgs) Handles btnBrowse.Click @@ -236,7 +255,7 @@ Public Class frmIncludeExclude End Sub Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click - CreateNewBuilderString() + BuilderString = CreateNewBuilderString() Me.Close() End Sub @@ -289,7 +308,15 @@ Public Class frmIncludeExclude Private Sub lstBuilder_AfterLabelEdit(sender As Object, e As LabelEditEventArgs) Handles lstBuilder.AfterLabelEdit If Not e.Label Is Nothing Then - IdentifyEntry(lstBuilder.Items(e.Item), e.Label) + If lstBuilder.Items.ContainsKey(e.Label) Then + e.CancelEdit = True + Else + IdentifyEntry(lstBuilder.Items(e.Item), e.Label) + End If End If End Sub + + Private Sub btnRawEdit_Click(sender As Object, e As EventArgs) Handles btnRawEdit.Click + OpenRawEdit() + End Sub End Class \ No newline at end of file From 39bbafd73153a3ea4bee6724a98a84a33760031c Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Mon, 30 Nov 2015 21:25:39 -0600 Subject: [PATCH 6/6] Various tweaks and changes --- GBM/Forms/frmGameManager.Designer.vb | 5 +- GBM/Forms/frmGameManager.vb | 12 +++- GBM/Forms/frmIncludeExclude.Designer.vb | 2 +- GBM/Forms/frmIncludeExclude.resx | 2 +- GBM/Forms/frmIncludeExclude.vb | 8 +-- GBM/Forms/frmMain.Designer.vb | 69 ++++++++++++-------- GBM/Forms/frmMain.vb | 86 ++++++++++++++----------- GBM/Managers/mgrPath.vb | 13 ++-- 8 files changed, 118 insertions(+), 79 deletions(-) diff --git a/GBM/Forms/frmGameManager.Designer.vb b/GBM/Forms/frmGameManager.Designer.vb index 7a8a877..2119134 100644 --- a/GBM/Forms/frmGameManager.Designer.vb +++ b/GBM/Forms/frmGameManager.Designer.vb @@ -469,14 +469,13 @@ Partial Class frmGameManager Me.grpStats.Controls.Add(Me.lblLastBackup) Me.grpStats.Location = New System.Drawing.Point(238, 365) Me.grpStats.Name = "grpStats" - Me.grpStats.Size = New System.Drawing.Size(534, 154) + Me.grpStats.Size = New System.Drawing.Size(534, 137) Me.grpStats.TabIndex = 11 Me.grpStats.TabStop = False Me.grpStats.Text = "Backup Information" ' 'btnOpenRestorePath ' - Me.btnOpenRestorePath.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnOpenRestorePath.Location = New System.Drawing.Point(339, 105) Me.btnOpenRestorePath.Name = "btnOpenRestorePath" Me.btnOpenRestorePath.Size = New System.Drawing.Size(114, 23) @@ -486,7 +485,6 @@ Partial Class frmGameManager ' 'btnOpenBackupFile ' - Me.btnOpenBackupFile.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnOpenBackupFile.Location = New System.Drawing.Point(216, 105) Me.btnOpenBackupFile.Name = "btnOpenBackupFile" Me.btnOpenBackupFile.Size = New System.Drawing.Size(114, 23) @@ -505,7 +503,6 @@ Partial Class frmGameManager ' 'btnDeleteBackup ' - Me.btnDeleteBackup.Anchor = CType((System.Windows.Forms.AnchorStyles.Bottom Or System.Windows.Forms.AnchorStyles.Right), System.Windows.Forms.AnchorStyles) Me.btnDeleteBackup.Location = New System.Drawing.Point(96, 105) Me.btnDeleteBackup.Name = "btnDeleteBackup" Me.btnDeleteBackup.Size = New System.Drawing.Size(114, 23) diff --git a/GBM/Forms/frmGameManager.vb b/GBM/Forms/frmGameManager.vb index ff8585c..ad2b960 100644 --- a/GBM/Forms/frmGameManager.vb +++ b/GBM/Forms/frmGameManager.vb @@ -738,6 +738,8 @@ Public Class frmGameManager chkMonitorOnly.Checked = False btnTags.Enabled = False lblTags.Visible = False + btnInclude.Text = "In&clude Items..." + btnExclude.Text = "E&xclude Items..." Case eModes.Edit grpFilter.Enabled = False lstGames.Enabled = False @@ -788,6 +790,8 @@ Public Class frmGameManager btnBackup.Enabled = False btnTags.Enabled = False lblTags.Visible = False + btnInclude.Text = "In&clude Items..." + btnExclude.Text = "E&xclude Items..." Case eModes.Disabled grpFilter.Enabled = True lstGames.Enabled = True @@ -810,6 +814,8 @@ Public Class frmGameManager btnRestore.Enabled = False btnMarkAsRestored.Enabled = False btnTags.Enabled = False + btnInclude.Text = "In&clude Items..." + btnExclude.Text = "E&xclude Items..." Case eModes.MultiSelect lstGames.Enabled = True WipeControls(grpConfig.Controls) @@ -1253,13 +1259,15 @@ Public Class frmGameManager End Sub Private Sub btnInclude_Click(sender As Object, e As EventArgs) Handles btnInclude.Click + Dim sInclude As String = txtFileType.Text OpenBuilder("Include", txtFileType) - UpdateBuilderButtonLabel(txtFileType.Text, "In&clude", btnInclude, (oCurrentGame.FileType <> txtFileType.Text)) + UpdateBuilderButtonLabel(txtFileType.Text, "In&clude", btnInclude, (sInclude <> txtFileType.Text)) End Sub Private Sub btnExclude_Click(sender As Object, e As EventArgs) Handles btnExclude.Click + Dim sExclude As String = txtExclude.Text OpenBuilder("Exclude", txtExclude) - UpdateBuilderButtonLabel(txtExclude.Text, "E&xclude", btnExclude, (oCurrentGame.ExcludeList <> txtExclude.Text)) + UpdateBuilderButtonLabel(txtExclude.Text, "E&xclude", btnExclude, (sExclude <> txtExclude.Text)) End Sub Private Sub chkFolderSave_CheckedChanged(sender As Object, e As EventArgs) Handles chkFolderSave.CheckedChanged diff --git a/GBM/Forms/frmIncludeExclude.Designer.vb b/GBM/Forms/frmIncludeExclude.Designer.vb index df304ad..2d52f55 100644 --- a/GBM/Forms/frmIncludeExclude.Designer.vb +++ b/GBM/Forms/frmIncludeExclude.Designer.vb @@ -214,7 +214,7 @@ Partial Class frmIncludeExclude Me.lblSaveFolder.Name = "lblSaveFolder" Me.lblSaveFolder.Size = New System.Drawing.Size(250, 13) Me.lblSaveFolder.TabIndex = 15 - Me.lblSaveFolder.Text = "Saved Game Folder" + Me.lblSaveFolder.Text = "Saved Game Explorer" Me.lblSaveFolder.TextAlign = System.Drawing.ContentAlignment.MiddleCenter ' 'ttWarning diff --git a/GBM/Forms/frmIncludeExclude.resx b/GBM/Forms/frmIncludeExclude.resx index 423d39f..0f14aeb 100644 --- a/GBM/Forms/frmIncludeExclude.resx +++ b/GBM/Forms/frmIncludeExclude.resx @@ -125,7 +125,7 @@ AAEAAAD/////AQAAAAAAAAAMAgAAAFdTeXN0ZW0uV2luZG93cy5Gb3JtcywgVmVyc2lvbj00LjAuMC4w LCBDdWx0dXJlPW5ldXRyYWwsIFB1YmxpY0tleVRva2VuPWI3N2E1YzU2MTkzNGUwODkFAQAAACZTeXN0 ZW0uV2luZG93cy5Gb3Jtcy5JbWFnZUxpc3RTdHJlYW1lcgEAAAAERGF0YQcCAgAAAAkDAAAADwMAAAB6 - CQAAAk1TRnQBSQFMAgEBAwEAAaABAAGgAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo + CQAAAk1TRnQBSQFMAgEBAwEAAagBAAGoAQABEAEAARABAAT/AQkBAAj/AUIBTQE2AQQGAAE2AQQCAAEo AwABQAMAARADAAEBAQABCAYAAQQYAAGAAgABgAMAAoABAAGAAwABgAEAAYABAAKAAgADwAEAAcAB3AHA AQAB8AHKAaYBAAEzBQABMwEAATMBAAEzAQACMwIAAxYBAAMcAQADIgEAAykBAANVAQADTQEAA0IBAAM5 AQABgAF8Af8BAAJQAf8BAAGTAQAB1gEAAf8B7AHMAQABxgHWAe8BAAHWAucBAAGQAakBrQIAAf8BMwMA diff --git a/GBM/Forms/frmIncludeExclude.vb b/GBM/Forms/frmIncludeExclude.vb index d246558..d7e27b0 100644 --- a/GBM/Forms/frmIncludeExclude.vb +++ b/GBM/Forms/frmIncludeExclude.vb @@ -2,7 +2,7 @@ Public Class frmIncludeExclude - Dim sFormName As String = "Include Exclude" + Dim sFormName As String = "Builder" Dim sRootFolder As String = String.Empty Dim sBuilderString As String @@ -187,7 +187,7 @@ Public Class frmIncludeExclude Dim iType As Integer = 1 Dim sFolderCheck As String - If sNewLabel.Contains("*") Then + If sNewLabel.Contains("*") Or sNewLabel.Contains("?") Then iType = 2 Else If txtRootFolder.Text <> String.Empty Then @@ -222,7 +222,7 @@ Public Class frmIncludeExclude Private Sub OpenRawEdit() Dim sCurrentString As String = CreateNewBuilderString() Dim sNewString As String - sNewString = InputBox("Entries are semi-colon delimited.", FormName & " Raw Edit", sCurrentString) + sNewString = InputBox("Items are semi-colon delimited.", FormName & " Raw Edit", sCurrentString) If sNewString <> String.Empty Then ParseBuilderString(sNewString) End If @@ -243,7 +243,7 @@ Public Class frmIncludeExclude If Not treFiles.SelectedNode Is Nothing Then treFiles.SelectedNode.Expand() If txtRootFolder.Text = String.Empty Then ttWarning.ToolTipTitle = "Notice" - ttWarning.Show("The saved game folder could not be determined or does not exist. Click here to manually set it.", btnBrowse, 10000) + ttWarning.Show("The saved game folder could not be determined or does not exist.", txtRootFolder, 6000) End If End Sub diff --git a/GBM/Forms/frmMain.Designer.vb b/GBM/Forms/frmMain.Designer.vb index 303b56d..e680c26 100644 --- a/GBM/Forms/frmMain.Designer.vb +++ b/GBM/Forms/frmMain.Designer.vb @@ -34,6 +34,7 @@ Partial Class frmMain Me.gMonTraySetupAddWizard = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTraySetupGameManager = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTraySetupCustomVariables = New System.Windows.Forms.ToolStripMenuItem() + Me.gMonTraySetupTags = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTrayTools = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTrayToolsGameList = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTrayToolsGameImportOfficialList = New System.Windows.Forms.ToolStripMenuItem() @@ -60,6 +61,7 @@ Partial Class frmMain Me.gMonSetupGameManager = New System.Windows.Forms.ToolStripMenuItem() Me.gMonSetupAddWizard = New System.Windows.Forms.ToolStripMenuItem() Me.gMonSetupCustomVariables = New System.Windows.Forms.ToolStripMenuItem() + Me.gMonSetupTags = New System.Windows.Forms.ToolStripMenuItem() Me.gMonTools = New System.Windows.Forms.ToolStripMenuItem() Me.gMonToolsGameList = New System.Windows.Forms.ToolStripMenuItem() Me.gMonToolsGameImportOfficialList = New System.Windows.Forms.ToolStripMenuItem() @@ -78,10 +80,10 @@ Partial Class frmMain Me.lblLastActionTitle = New System.Windows.Forms.Label() Me.lblTimeTitle = New System.Windows.Forms.Label() Me.lblTimeSpent = New System.Windows.Forms.Label() - Me.txtGameInfo = New System.Windows.Forms.TextBox() Me.btnCancelOperation = New System.Windows.Forms.Button() - Me.gMonSetupTags = New System.Windows.Forms.ToolStripMenuItem() - Me.gMonTraySetupTags = New System.Windows.Forms.ToolStripMenuItem() + Me.lblStatus1 = New System.Windows.Forms.Label() + Me.lblStatus2 = New System.Windows.Forms.Label() + Me.lblStatus3 = New System.Windows.Forms.Label() Me.gMonTrayMenu.SuspendLayout() Me.gMonStatusStrip.SuspendLayout() Me.gMonMainMenu.SuspendLayout() @@ -151,6 +153,12 @@ Partial Class frmMain Me.gMonTraySetupCustomVariables.Size = New System.Drawing.Size(201, 22) Me.gMonTraySetupCustomVariables.Text = "Custom &Path Variables..." ' + 'gMonTraySetupTags + ' + Me.gMonTraySetupTags.Name = "gMonTraySetupTags" + Me.gMonTraySetupTags.Size = New System.Drawing.Size(201, 22) + Me.gMonTraySetupTags.Text = "&Tags" + ' 'gMonTrayTools ' Me.gMonTrayTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonTrayToolsGameList, Me.gMonTrayToolsSyncMan, Me.gMonTrayToolsCompact}) @@ -334,6 +342,12 @@ Partial Class frmMain Me.gMonSetupCustomVariables.Size = New System.Drawing.Size(201, 22) Me.gMonSetupCustomVariables.Text = "Custom &Path Variables..." ' + 'gMonSetupTags + ' + Me.gMonSetupTags.Name = "gMonSetupTags" + Me.gMonSetupTags.Size = New System.Drawing.Size(201, 22) + Me.gMonSetupTags.Text = "&Tags..." + ' 'gMonTools ' Me.gMonTools.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.gMonToolsGameList, Me.gMonToolsSyncMan, Me.gMonToolsCompact}) @@ -469,19 +483,6 @@ Partial Class frmMain Me.lblTimeSpent.TabIndex = 14 Me.lblTimeSpent.Text = "0 Hours" ' - 'txtGameInfo - ' - Me.txtGameInfo.BorderStyle = System.Windows.Forms.BorderStyle.None - Me.txtGameInfo.Cursor = System.Windows.Forms.Cursors.Default - Me.txtGameInfo.Location = New System.Drawing.Point(69, 71) - Me.txtGameInfo.Multiline = True - Me.txtGameInfo.Name = "txtGameInfo" - Me.txtGameInfo.ReadOnly = True - Me.txtGameInfo.Size = New System.Drawing.Size(443, 52) - Me.txtGameInfo.TabIndex = 0 - Me.txtGameInfo.TabStop = False - Me.txtGameInfo.WordWrap = False - ' 'btnCancelOperation ' Me.btnCancelOperation.Location = New System.Drawing.Point(437, 103) @@ -491,25 +492,39 @@ Partial Class frmMain Me.btnCancelOperation.Text = "&Cancel" Me.btnCancelOperation.UseVisualStyleBackColor = True ' - 'gMonSetupTags + 'lblStatus1 ' - Me.gMonSetupTags.Name = "gMonSetupTags" - Me.gMonSetupTags.Size = New System.Drawing.Size(201, 22) - Me.gMonSetupTags.Text = "&Tags..." + Me.lblStatus1.AutoEllipsis = True + Me.lblStatus1.Location = New System.Drawing.Point(66, 71) + Me.lblStatus1.Name = "lblStatus1" + Me.lblStatus1.Size = New System.Drawing.Size(446, 13) + Me.lblStatus1.TabIndex = 15 ' - 'gMonTraySetupTags + 'lblStatus2 ' - Me.gMonTraySetupTags.Name = "gMonTraySetupTags" - Me.gMonTraySetupTags.Size = New System.Drawing.Size(201, 22) - Me.gMonTraySetupTags.Text = "&Tags" + Me.lblStatus2.AutoEllipsis = True + Me.lblStatus2.Location = New System.Drawing.Point(66, 87) + Me.lblStatus2.Name = "lblStatus2" + Me.lblStatus2.Size = New System.Drawing.Size(446, 13) + Me.lblStatus2.TabIndex = 16 + ' + 'lblStatus3 + ' + Me.lblStatus3.AutoEllipsis = True + Me.lblStatus3.Location = New System.Drawing.Point(66, 103) + Me.lblStatus3.Name = "lblStatus3" + Me.lblStatus3.Size = New System.Drawing.Size(365, 13) + Me.lblStatus3.TabIndex = 17 ' 'frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font Me.ClientSize = New System.Drawing.Size(524, 372) + Me.Controls.Add(Me.lblStatus3) + Me.Controls.Add(Me.lblStatus2) + Me.Controls.Add(Me.lblStatus1) Me.Controls.Add(Me.btnCancelOperation) - Me.Controls.Add(Me.txtGameInfo) Me.Controls.Add(Me.lblTimeSpent) Me.Controls.Add(Me.lblTimeTitle) Me.Controls.Add(Me.lblLastActionTitle) @@ -579,7 +594,6 @@ Partial Class frmMain Friend WithEvents gMonTraySetupAddWizard As System.Windows.Forms.ToolStripMenuItem Friend WithEvents lblTimeTitle As System.Windows.Forms.Label Friend WithEvents lblTimeSpent As System.Windows.Forms.Label - Friend WithEvents txtGameInfo As System.Windows.Forms.TextBox Friend WithEvents gMonToolsGameList As System.Windows.Forms.ToolStripMenuItem Friend WithEvents gMonToolsGameImportOfficialList As System.Windows.Forms.ToolStripMenuItem Friend WithEvents gMonToolsGameImportList As System.Windows.Forms.ToolStripMenuItem @@ -598,4 +612,7 @@ Partial Class frmMain Friend WithEvents gMonStripAdminButton As ToolStripSplitButton Friend WithEvents gMonTraySetupTags As System.Windows.Forms.ToolStripMenuItem Friend WithEvents gMonSetupTags As System.Windows.Forms.ToolStripMenuItem + Friend WithEvents lblStatus1 As Label + Friend WithEvents lblStatus2 As Label + Friend WithEvents lblStatus3 As Label End Class diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index 5c5d6cd..8fd951d 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -35,7 +35,9 @@ Public Class frmMain Private bAllowIcon As Boolean = False Private bAllowDetails As Boolean = False Private oPriorImage As Image - Private sPriorDetails As String + Private sPriorPath As String + Private sPriorCompany As String + Private sPriorVersion As String WithEvents oFileWatcher As New System.IO.FileSystemWatcher WithEvents tmScanTimer As New Timer @@ -47,7 +49,7 @@ Public Class frmMain Public oSettings As New mgrSettings Delegate Sub UpdateLogCallBack(ByVal sLogUpdate As String, ByVal bTrayUpdate As Boolean, ByVal objIcon As System.Windows.Forms.ToolTipIcon, ByVal bTimeStamp As Boolean) - Delegate Sub WorkingGameInfoCallBack(ByVal sTitle As String, ByVal sInfo As String) + Delegate Sub WorkingGameInfoCallBack(ByVal sTitle As String, ByVal sStatus1 As String, ByVal sStatus2 As String, ByVal sStatus3 As String) Delegate Sub UpdateStatusCallBack(ByVal sStatus As String) Delegate Sub SetLastActionCallBack(ByVal sString As String) Delegate Sub OperationEndedCallBack() @@ -67,37 +69,38 @@ Public Class frmMain End Sub Private Sub SetRestoreInfo(ByVal oRestoreInfo As clsBackup) Handles oRestore.UpdateRestoreInfo - Dim sInfo As String + Dim sStatus1 As String + Dim sStatus2 As String + Dim sStatus3 As String 'Build Info - sInfo = IO.Path.GetFileName(oRestoreInfo.FileName) & vbCrLf & "Updated by " & oRestoreInfo.UpdatedBy & " on " & oRestoreInfo.DateUpdated & vbCrLf + sStatus1 = IO.Path.GetFileName(oRestoreInfo.FileName) + sStatus2 = "Updated by " & oRestoreInfo.UpdatedBy & " on " & oRestoreInfo.DateUpdated If oRestoreInfo.AbsolutePath Then - sInfo = sInfo & oRestoreInfo.RestorePath + sStatus3 = oRestoreInfo.RestorePath Else - sInfo = sInfo & oRestoreInfo.RelativeRestorePath + sStatus3 = oRestoreInfo.RelativeRestorePath End If - WorkingGameInfo("Restore in progress...", sInfo) + WorkingGameInfo("Restore in progress...", sStatus1, sStatus2, sStatus3) UpdateStatus("Restore in progress...") End Sub Private Sub SetBackupInfo(ByVal oGame As clsGame) Handles oBackup.UpdateBackupInfo - Dim sInfo As String + Dim sStatus1 As String + Dim sStatus2 As String + Dim sStatus3 As String 'Build Info - sInfo = oGame.CroppedName & vbCrLf - If oGame.FolderSave Then - sInfo = sInfo & "Full Folder Backup" & vbCrLf - Else - sInfo = sInfo & "File Type Backup: " & oGame.FileType & vbCrLf - End If + sStatus1 = oGame.CroppedName If oGame.AbsolutePath Then - sInfo = sInfo & oGame.Path + sStatus2 = oGame.Path Else - sInfo = sInfo & oGame.ProcessPath & "\" & oGame.Path + sStatus2 = oGame.ProcessPath & "\" & oGame.Path End If + sStatus3 = String.Empty - WorkingGameInfo("Backup in Progress...", sInfo) + WorkingGameInfo("Backup in Progress...", sStatus1, sStatus2, sStatus3) UpdateStatus("Backup in progress...") End Sub @@ -366,7 +369,9 @@ Public Class frmMain If bKeepInfo And Not oProcess.GameInfo Is Nothing Then lblGameTitle.Text = "Last Game: " & oProcess.GameInfo.CroppedName pbIcon.Image = oPriorImage - txtGameInfo.Text = sPriorDetails + lblStatus1.Text = sPriorPath + lblStatus2.Text = sPriorCompany + lblStatus3.Text = sPriorVersion If oSettings.TimeTracking Then lblTimeTitle.Visible = True lblTimeSpent.Visible = True @@ -374,7 +379,9 @@ Public Class frmMain Else pbIcon.Image = My.Resources.Searching lblGameTitle.Text = "No Game Detected" - txtGameInfo.Clear() + lblStatus1.Text = String.Empty + lblStatus2.Text = String.Empty + lblStatus3.Text = String.Empty lblTimeTitle.Visible = False lblTimeSpent.Visible = False End If @@ -387,17 +394,19 @@ Public Class frmMain End Sub - Private Sub WorkingGameInfo(ByVal sTitle As String, ByVal sInfo As String) + Private Sub WorkingGameInfo(ByVal sTitle As String, ByVal sStatus1 As String, ByVal sStatus2 As String, ByVal sStatus3 As String) 'Thread Safe (If one control requires an invoke assume they all do) If pbIcon.InvokeRequired = True Then Dim d As New WorkingGameInfoCallBack(AddressOf WorkingGameInfo) - Me.Invoke(d, New Object() {sTitle, sInfo}) + Me.Invoke(d, New Object() {sTitle, sStatus1, sStatus2, sStatus3}) Else lblTimeTitle.Visible = False lblTimeSpent.Visible = False pbIcon.Image = My.Resources.Working lblGameTitle.Text = sTitle - txtGameInfo.Text = sInfo + lblStatus1.Text = sStatus1 + lblStatus2.Text = sStatus2 + lblStatus3.Text = sStatus3 End If End Sub @@ -407,7 +416,9 @@ Public Class frmMain Dim sCompanyName As String = String.Empty 'Wipe Game Info - txtGameInfo.Clear() + lblStatus1.Text = String.Empty + lblStatus2.Text = String.Empty + lblStatus3.Text = String.Empty 'Get Game Details If bMulti Then @@ -417,7 +428,7 @@ Public Class frmMain lblTimeTitle.Visible = False lblTimeSpent.Visible = False pbIcon.Image = My.Resources.Unknown - txtGameInfo.AppendText("Details are not available when multiple games are detected.") + lblStatus1.Text = "Game details are unavailable." Else bAllowIcon = True bAllowDetails = True @@ -462,27 +473,30 @@ Public Class frmMain 'Set Details If sFileName = String.Empty Then - txtGameInfo.AppendText("Path Not Available") + lblStatus1.Text = "Path Not Available" Else - txtGameInfo.AppendText(sFileName) - End If - - If sFileVersion = String.Empty Then - txtGameInfo.AppendText(vbCrLf & "No Version Set") - Else - txtGameInfo.AppendText(vbCrLf & sFileVersion) + lblStatus1.Text = sFileName End If If sCompanyName = String.Empty Then - txtGameInfo.AppendText(vbCrLf & "No Company Set") + lblStatus2.Text = "No Company Set" Else - txtGameInfo.AppendText(vbCrLf & sCompanyName) + lblStatus2.Text = sCompanyName End If + + If sFileVersion = String.Empty Then + lblStatus3.Text = "No Version Set" + Else + lblStatus3.Text = sFileVersion + End If + End If 'Set Prior Info oPriorImage = pbIcon.Image - sPriorDetails = txtGameInfo.Text + sPriorPath = lblStatus1.Text + sPriorCompany = lblStatus2.Text + sPriorVersion = lblStatus3.Text End Sub Private Sub UpdateTimeSpent(ByVal dTotalTime As Double, ByVal dSessionTime As Double) @@ -1421,7 +1435,7 @@ Public Class frmMain End If End Sub - Private Sub txtGameInfo_Enter(sender As Object, e As EventArgs) Handles txtGameInfo.Enter + Private Sub txtGameInfo_Enter(sender As Object, e As EventArgs) btnLogToggle.Focus() End Sub diff --git a/GBM/Managers/mgrPath.vb b/GBM/Managers/mgrPath.vb index 29bcb0f..449a98f 100644 --- a/GBM/Managers/mgrPath.vb +++ b/GBM/Managers/mgrPath.vb @@ -108,12 +108,15 @@ Public Class mgrPath End Set End Property - - Public Shared Function ValidateForFileSystem(ByVal sCheckString As String) As String - Dim cInvalidCharacters As Char() = {"\", "/", ":", "*", "?", """", "<", ">", "|"} + Dim cInvalidFileCharacters As Char() = Path.GetInvalidFileNameChars + Dim cInvalidPathCharacters As Char() = Path.GetInvalidPathChars - For Each c As Char In cInvalidCharacters + For Each c As Char In cInvalidFileCharacters + sCheckString = sCheckString.Replace(c, "") + Next + + For Each c As Char In cInvalidPathCharacters sCheckString = sCheckString.Replace(c, "") Next @@ -121,7 +124,7 @@ Public Class mgrPath sCheckString = sCheckString.Substring(0, 257) End If - Return sCheckString + Return sCheckString.Trim End Function Public Shared Function DetermineRelativePath(ByVal sProcessPath As String, ByVal sSavePath As String) As String Dim sPath1Array As String()