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 + AwAB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EAA+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 0000000..a876031 Binary files /dev/null and b/GBM/Resources/file.ico differ diff --git a/GBM/Resources/folder.ico b/GBM/Resources/folder.ico new file mode 100644 index 0000000..ac79aeb Binary files /dev/null and b/GBM/Resources/folder.ico differ diff --git a/GBM/Resources/type.ico b/GBM/Resources/type.ico new file mode 100644 index 0000000..3f51d7f Binary files /dev/null and b/GBM/Resources/type.ico differ