From 8ebfed7ab70dd5dfe39b88bc3dc7059575f70e85 Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Mon, 14 Nov 2016 15:37:44 -0600 Subject: [PATCH 01/16] Added experimental "Clean folder on restore" feature --- GBM/Classes/clsGame.vb | 13 +++++++++++++ GBM/Forms/frmGameManager.Designer.vb | 19 ++++++++++++++++--- GBM/Forms/frmGameManager.vb | 23 ++++++++++++++++++++++- GBM/Forms/frmMain.vb | 6 +++--- GBM/Managers/mgrCommon.vb | 2 +- GBM/Managers/mgrMonitorList.vb | 21 ++++++++++++--------- GBM/Managers/mgrRestore.vb | 19 +++++++++++++++---- GBM/Managers/mgrSQLite.vb | 28 ++++++++++++++++++++++++++-- GBM/My Project/AssemblyInfo.vb | 4 ++-- GBM/My Project/Resources.Designer.vb | 9 +++++++++ GBM/My Project/Resources.resx | 3 +++ 11 files changed, 122 insertions(+), 25 deletions(-) diff --git a/GBM/Classes/clsGame.vb b/GBM/Classes/clsGame.vb index acf07ff..43ce188 100644 --- a/GBM/Classes/clsGame.vb +++ b/GBM/Classes/clsGame.vb @@ -8,6 +8,7 @@ Private sFileType As String = String.Empty Private bAppendTimeStamp As Boolean = False Private iBackupLimit As Integer = 2 + Private bCleanFolder As Boolean = False Private sExcludeList As String = String.Empty Private sProcessPath As String = String.Empty Private sIcon As String = String.Empty @@ -127,6 +128,15 @@ End Set End Property + Property CleanFolder As Boolean + Get + Return bCleanFolder + End Get + Set(value As Boolean) + bCleanFolder = value + End Set + End Property + Property ExcludeList As String Set(value As String) sExcludeList = value @@ -268,6 +278,9 @@ If FolderSave <> oGame.FolderSave Then Return False End If + If CleanFolder <> oGame.CleanFolder Then + Return False + End If If AppendTimeStamp <> oGame.AppendTimeStamp Then Return False End If diff --git a/GBM/Forms/frmGameManager.Designer.vb b/GBM/Forms/frmGameManager.Designer.vb index 0f7d977..856fcac 100644 --- a/GBM/Forms/frmGameManager.Designer.vb +++ b/GBM/Forms/frmGameManager.Designer.vb @@ -95,6 +95,7 @@ Partial Class frmGameManager Me.cmsDeleteBackup = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.cmsDeleteOne = New System.Windows.Forms.ToolStripMenuItem() Me.cmsDeleteAll = New System.Windows.Forms.ToolStripMenuItem() + Me.chkCleanFolder = New System.Windows.Forms.CheckBox() Me.grpConfig.SuspendLayout() CType(Me.nudLimit, System.ComponentModel.ISupportInitialize).BeginInit() Me.grpExtra.SuspendLayout() @@ -151,6 +152,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.chkCleanFolder) Me.grpConfig.Controls.Add(Me.lblLimit) Me.grpConfig.Controls.Add(Me.nudLimit) Me.grpConfig.Controls.Add(Me.btnExclude) @@ -182,7 +184,7 @@ Partial Class frmGameManager Me.lblLimit.Location = New System.Drawing.Point(375, 130) Me.lblLimit.Name = "lblLimit" Me.lblLimit.Size = New System.Drawing.Size(68, 13) - Me.lblLimit.TabIndex = 13 + Me.lblLimit.TabIndex = 14 Me.lblLimit.Text = "Backup Limit" Me.lblLimit.Visible = False ' @@ -192,7 +194,7 @@ Partial Class frmGameManager Me.nudLimit.Minimum = New Decimal(New Integer() {2, 0, 0, 0}) Me.nudLimit.Name = "nudLimit" Me.nudLimit.Size = New System.Drawing.Size(40, 20) - Me.nudLimit.TabIndex = 12 + Me.nudLimit.TabIndex = 13 Me.nudLimit.Value = New Decimal(New Integer() {2, 0, 0, 0}) Me.nudLimit.Visible = False ' @@ -293,7 +295,7 @@ Partial Class frmGameManager Me.chkTimeStamp.Location = New System.Drawing.Point(190, 129) Me.chkTimeStamp.Name = "chkTimeStamp" Me.chkTimeStamp.Size = New System.Drawing.Size(133, 17) - Me.chkTimeStamp.TabIndex = 11 + Me.chkTimeStamp.TabIndex = 12 Me.chkTimeStamp.Text = "Save multiple backups" Me.chkTimeStamp.UseVisualStyleBackColor = True ' @@ -807,6 +809,16 @@ Partial Class frmGameManager Me.cmsDeleteAll.Size = New System.Drawing.Size(114, 22) Me.cmsDeleteAll.Text = "&All Files" ' + 'chkCleanFolder + ' + Me.chkCleanFolder.AutoSize = True + Me.chkCleanFolder.Location = New System.Drawing.Point(329, 101) + Me.chkCleanFolder.Name = "chkCleanFolder" + Me.chkCleanFolder.Size = New System.Drawing.Size(132, 17) + Me.chkCleanFolder.TabIndex = 11 + Me.chkCleanFolder.Text = "Clean folder on restore" + Me.chkCleanFolder.UseVisualStyleBackColor = True + ' 'frmGameManager ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) @@ -928,4 +940,5 @@ Partial Class frmGameManager Friend WithEvents cmsDeleteBackup As ContextMenuStrip Friend WithEvents cmsDeleteOne As ToolStripMenuItem Friend WithEvents cmsDeleteAll As ToolStripMenuItem + Friend WithEvents chkCleanFolder As CheckBox End Class diff --git a/GBM/Forms/frmGameManager.vb b/GBM/Forms/frmGameManager.vb index 14311b2..0039160 100644 --- a/GBM/Forms/frmGameManager.vb +++ b/GBM/Forms/frmGameManager.vb @@ -470,6 +470,7 @@ Public Class frmGameManager frm.ShowDialog() txtBox.Text = frm.BuilderString + VerifyCleanFolder() End Sub Private Function FindRestorePath() As Boolean @@ -714,6 +715,7 @@ Public Class frmGameManager txtFileType.Text = oApp.FileType txtExclude.Text = oApp.ExcludeList chkFolderSave.Checked = oApp.FolderSave + chkCleanFolder.Checked = oApp.CleanFolder chkTimeStamp.Checked = oApp.AppendTimeStamp nudLimit.Value = oApp.BackupLimit chkEnabled.Checked = oApp.Enabled @@ -826,6 +828,7 @@ Public Class frmGameManager WipeControls(grpConfig.Controls) WipeControls(grpExtra.Controls) WipeControls(grpStats.Controls) + chkCleanFolder.Enabled = False pbIcon.Image = Icon_Unknown chkEnabled.Enabled = True chkMonitorOnly.Enabled = True @@ -982,6 +985,7 @@ Public Class frmGameManager Else btnInclude.Enabled = True End If + VerifyCleanFolder() End Sub Private Sub TimeStampModeChange() @@ -996,6 +1000,17 @@ Public Class frmGameManager End If End Sub + Private Sub VerifyCleanFolder() + If Not bIsLoading Then + If chkFolderSave.Checked = True And txtExclude.Text = String.Empty And txtSavePath.Text <> String.Empty Then + chkCleanFolder.Enabled = True + Else + chkCleanFolder.Checked = False + chkCleanFolder.Enabled = False + End If + End If + End Sub + Private Sub EditApp() eCurrentMode = eModes.Edit ModeChange() @@ -1062,6 +1077,7 @@ Public Class frmGameManager oApp.FileType = txtFileType.Text oApp.ExcludeList = txtExclude.Text oApp.FolderSave = chkFolderSave.Checked + oApp.CleanFolder = chkCleanFolder.Checked oApp.AppendTimeStamp = chkTimeStamp.Checked oApp.BackupLimit = nudLimit.Value oApp.Enabled = chkEnabled.Checked @@ -1144,6 +1160,7 @@ Public Class frmGameManager eCurrentMode = eModes.View FillData() ModeChange() + VerifyCleanFolder() ElseIf lstGames.SelectedItems.Count > 1 Then eCurrentMode = eModes.MultiSelect ModeChange() @@ -1411,6 +1428,7 @@ Public Class frmGameManager lblName.Text = frmGameManager_lblName chkTimeStamp.Text = frmGameManager_chkTimeStamp chkFolderSave.Text = frmGameManager_chkFolderSave + chkCleanFolder.Text = frmGameManager_chkCleanFolder btnBackup.Text = frmGameManager_btnBackup btnClose.Text = frmGameManager_btnClose btnDelete.Text = frmGameManager_btnDelete @@ -1607,6 +1625,10 @@ Public Class frmGameManager End If End Sub + Private Sub txtSavePath_TextChanged(sender As Object, e As EventArgs) Handles txtSavePath.TextChanged + VerifyCleanFolder() + End Sub + Private Sub tmFilterTimer_Tick(sender As Object, ByVal e As EventArgs) Handles tmFilterTimer.Tick lstGames.DataSource = Nothing FormatAndFillList() @@ -1617,5 +1639,4 @@ Public Class frmGameManager Private Sub frmGameManager_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown txtQuickFilter.Focus() End Sub - End Class diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index a956d7e..e596fc2 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -181,7 +181,7 @@ Public Class frmMain End If If bPathVerified Then - If oRestore.CheckRestorePrereq(oRestoreInfo) Then + If oRestore.CheckRestorePrereq(oRestoreInfo, oGame.CleanFolder) Then oReadyList.Add(oRestoreInfo) End If End If @@ -661,9 +661,9 @@ Public Class frmMain Private Sub OpenAbout() Dim iProcessType As System.Reflection.ProcessorArchitecture = System.Reflection.AssemblyName.GetAssemblyName(Application.ExecutablePath()).ProcessorArchitecture - Dim sVersion As String = My.Application.Info.Version.Major & "." & My.Application.Info.Version.Minor + Dim sVersion As String = My.Application.Info.Version.Major & "." & My.Application.Info.Version.Minor & "." & My.Application.Info.Version.Build Dim sProcessType = [Enum].GetName(GetType(System.Reflection.ProcessorArchitecture), iProcessType) - Dim sRevision As String = My.Application.Info.Version.Build & "." & My.Application.Info.Version.Revision + Dim sRevision As String = My.Application.Info.Version.Revision Dim sConstCopyright As String = Chr(169) & mgrCommon.FormatString(App_Copyright, Now.Year.ToString) mgrCommon.ShowMessage(frmMain_About, New String() {sVersion, sProcessType, sRevision, sConstCopyright}, MsgBoxStyle.Information) diff --git a/GBM/Managers/mgrCommon.vb b/GBM/Managers/mgrCommon.vb index 7e7429e..79be112 100644 --- a/GBM/Managers/mgrCommon.vb +++ b/GBM/Managers/mgrCommon.vb @@ -30,7 +30,7 @@ Public Class mgrCommon Public Shared ReadOnly Property AppVersion As Integer Get - Return (My.Application.Info.Version.Major * 100) + My.Application.Info.Version.Minor + Return (My.Application.Info.Version.Major * 100) + (My.Application.Info.Version.Minor * 10) + My.Application.Info.Version.Build End Get End Property diff --git a/GBM/Managers/mgrMonitorList.vb b/GBM/Managers/mgrMonitorList.vb index f50df73..5421043 100644 --- a/GBM/Managers/mgrMonitorList.vb +++ b/GBM/Managers/mgrMonitorList.vb @@ -30,6 +30,7 @@ Public Class mgrMonitorList oGame.Enabled = CBool(dr("Enabled")) oGame.MonitorOnly = CBool(dr("MonitorOnly")) oGame.BackupLimit = CInt(dr("BackupLimit")) + oGame.CleanFolder = CBool(dr("CleanFolder")) Return oGame End Function @@ -54,6 +55,7 @@ Public Class mgrMonitorList hshParams.Add("Enabled", oGame.Enabled) hshParams.Add("MonitorOnly", oGame.MonitorOnly) hshParams.Add("BackupLimit", oGame.BackupLimit) + hshParams.Add("CleanFolder", oGame.CleanFolder) Return hshParams End Function @@ -94,7 +96,7 @@ Public Class mgrMonitorList Dim hshParams As Hashtable sSQL = "INSERT INTO monitorlist VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, @TimeStamp, " - sSQL &= "@ExcludeList, @ProcessPath, @Icon, @Hours, @Version, @Company, @Enabled, @MonitorOnly, @BackupLimit)" + sSQL &= "@ExcludeList, @ProcessPath, @Icon, @Hours, @Version, @Company, @Enabled, @MonitorOnly, @BackupLimit, @CleanFolder)" 'Parameters hshParams = SetCoreParameters(oGame) @@ -110,7 +112,7 @@ Public Class mgrMonitorList sSQL = "UPDATE monitorlist SET Name=@Name, Process=@Process, Path=@Path, AbsolutePath=@AbsolutePath, FolderSave=@FolderSave, " sSQL &= "FileType=@FileType, TimeStamp=@TimeStamp, ExcludeList=@ExcludeList, ProcessPath=@ProcessPath, Icon=@Icon, " - sSQL &= "Hours=@Hours, Version=@Version, Company=@Company, Enabled=@Enabled, MonitorOnly=@MonitorOnly, BackupLimit=@BackupLimit WHERE MonitorID=@ID" + sSQL &= "Hours=@Hours, Version=@Version, Company=@Company, Enabled=@Enabled, MonitorOnly=@MonitorOnly, BackupLimit=@BackupLimit, CleanFolder=@CleanFolder WHERE MonitorID=@ID" 'Parameters hshParams = SetCoreParameters(oGame) @@ -315,11 +317,11 @@ Public Class mgrMonitorList sVersion = "(SELECT Version FROM monitorlist WHERE MonitorID=@ID)" End If - sSQL = "INSERT OR REPLACE INTO monitorlist (MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit) " + sSQL = "INSERT OR REPLACE INTO monitorlist (MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder) " sSQL &= "VALUES (@ID, @Name, @Process, @Path, @AbsolutePath, @FolderSave, @FileType, " sSQL &= sTimeStamp & ", @ExcludeList, " & sGamePath & ", " sSQL &= sIcon & ", @Hours, " & sVersion & ", " - sSQL &= sCompany & ", " & sMonitorGame & ", @MonitorOnly, " & sBackupLimit & ");" + sSQL &= sCompany & ", " & sMonitorGame & ", @MonitorOnly, " & sBackupLimit & ",@CleanFolder);" For Each oGame As clsGame In hshGames.Values hshParams = New Hashtable @@ -335,6 +337,7 @@ Public Class mgrMonitorList hshParams.Add("ExcludeList", oGame.ExcludeList) hshParams.Add("Hours", oGame.Hours) hshParams.Add("MonitorOnly", oGame.MonitorOnly) + hshParams.Add("CleanFolder", oGame.CleanFolder) 'Optional Parameters If (eSyncFields And clsGame.eOptionalSyncFields.Company) = clsGame.eOptionalSyncFields.Company Then @@ -471,9 +474,9 @@ Public Class mgrMonitorList Select Case eFilterType Case frmFilter.eFilterType.NoFilter - sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit FROM monitorlist ORDER BY Name Asc" + sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder FROM monitorlist ORDER BY Name Asc" Case frmFilter.eFilterType.FieldAnd, frmFilter.eFilterType.FieldOr - sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit FROM monitorlist" + sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder FROM monitorlist" If hshStringFilters.Count > 0 Then sSQL &= " WHERE (" @@ -495,7 +498,7 @@ Public Class mgrMonitorList End If sSQL &= " ORDER BY Name Asc" Case frmFilter.eFilterType.AnyTag - sSQL = "SELECT DISTINCT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit FROM monitorlist " + sSQL = "SELECT DISTINCT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder FROM monitorlist " sSQL &= "NATURAL JOIN gametags WHERE gametags.TagID IN (" For Each oTag As clsTag In oTagFilters @@ -507,7 +510,7 @@ Public Class mgrMonitorList sSQL = sSQL.TrimEnd(",") sSQL &= ") ORDER BY Name Asc" Case frmFilter.eFilterType.AllTags - sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit FROM monitorlist WHERE MonitorID IN " + sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder FROM monitorlist WHERE MonitorID IN " For Each oTag As clsTag In oTagFilters sSQL &= "(SELECT MonitorID FROM gametags WHERE monitorlist.MonitorID = gametags.MonitorID And TagID = @TagID" & iCounter & ")" @@ -520,7 +523,7 @@ Public Class mgrMonitorList sSQL &= " ORDER BY Name Asc" Case frmFilter.eFilterType.NoTags - sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit FROM monitorlist WHERE MonitorID NOT IN (SELECT MonitorID FROM gametags) ORDER BY Name Asc" + sSQL = "SELECT MonitorID, Name, Process, Path, AbsolutePath, FolderSave, FileType, TimeStamp, ExcludeList, ProcessPath, Icon, Hours, Version, Company, Enabled, MonitorOnly, BackupLimit, CleanFolder FROM monitorlist WHERE MonitorID NOT IN (SELECT MonitorID FROM gametags) ORDER BY Name Asc" End Select Return sSQL diff --git a/GBM/Managers/mgrRestore.vb b/GBM/Managers/mgrRestore.vb index ca8f903..78514b7 100644 --- a/GBM/Managers/mgrRestore.vb +++ b/GBM/Managers/mgrRestore.vb @@ -161,7 +161,13 @@ Public Class mgrRestore Return slRemovedItems End Function - Public Function CheckRestorePrereq(ByVal oBackupInfo As clsBackup) As Boolean + Private Sub CleanFolder(ByVal sExtractPath As String) + If Directory.Exists(sExtractPath) Then + + End If + End Sub + + Public Function CheckRestorePrereq(ByVal oBackupInfo As clsBackup, ByVal bCleanFolder As Boolean) As Boolean Dim sHash As String Dim sExtractPath As String Dim sBackupFile As String = oSettings.BackupFolder & Path.DirectorySeparatorChar & oBackupInfo.FileName @@ -185,10 +191,15 @@ Public Class mgrRestore RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorNoPath, sExtractPath), False, ToolTipIcon.Error, True) Return False End If + Else + If bCleanFolder Then + mgrCommon.DeleteDirectory(sExtractPath, True) + Directory.CreateDirectory(sExtractPath) + End If End If - 'Check file integrity - If oSettings.CheckSum Then + 'Check file integrity + If oSettings.CheckSum Then If oBackupInfo.CheckSum <> String.Empty Then sHash = mgrHash.Generate_SHA256_Hash(sBackupFile) If sHash <> oBackupInfo.CheckSum Then @@ -282,7 +293,7 @@ Public Class mgrRestore RaiseEvent SetLastAction(mgrCommon.FormatString(mgrRestore_ActionComplete, oBackupInfo.CroppedName)) Else RaiseEvent SetLastAction(mgrCommon.FormatString(mgrRestore_ActionFailed, oBackupInfo.CroppedName)) - End If + End If Next End Sub diff --git a/GBM/Managers/mgrSQLite.vb b/GBM/Managers/mgrSQLite.vb index add2a4a..0909ad7 100644 --- a/GBM/Managers/mgrSQLite.vb +++ b/GBM/Managers/mgrSQLite.vb @@ -80,7 +80,7 @@ Public Class mgrSQLite sSql &= "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " & "AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " & "ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " & - "BackupLimit INTEGER NOT NULL, PRIMARY KEY(Name, Process));" + "BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, PRIMARY KEY(Name, Process));" 'Add Tables (Tags) sSql &= "CREATE TABLE tags (TagID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL PRIMARY KEY); " @@ -117,7 +117,7 @@ Public Class mgrSQLite sSql = "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " & "AbsolutePath BOOLEAN NOT NULL, FolderSave BOOLEAN NOT NULL, FileType TEXT, TimeStamp BOOLEAN NOT NULL, ExcludeList TEXT NOT NULL, " & "ProcessPath TEXT, Icon TEXT, Hours REAL, Version TEXT, Company TEXT, Enabled BOOLEAN NOT NULL, MonitorOnly BOOLEAN NOT NULL, " & - "BackupLimit INTEGER NOT NULL, PRIMARY KEY(Name, Process));" + "BackupLimit INTEGER NOT NULL, CleanFolder BOOLEAN NOT NULL, PRIMARY KEY(Name, Process));" 'Add Tables (Remote Manifest) sSql &= "CREATE TABLE manifest (ManifestID TEXT NOT NULL PRIMARY KEY, Name TEXT NOT NULL, FileName TEXT NOT NULL, RestorePath TEXT NOT NULL, " & @@ -600,6 +600,30 @@ Public Class mgrSQLite End If End If + '1.01 Upgrade + If GetDatabaseVersion() < 101 Then + If eDatabase = Database.Local Then + 'Backup DB before starting + BackupDB("v98") + + 'Add new field(s) + sSQL = "ALTER TABLE monitorlist ADD COLUMN CleanFolder BOOLEAN NOT NULL DEFAULT 0;" + sSQL &= "PRAGMA user_version=101" + + RunParamQuery(sSQL, New Hashtable) + End If + If eDatabase = Database.Remote Then + 'Backup DB before starting + BackupDB("v98") + + 'Add new field(s) + sSQL = "ALTER TABLE monitorlist ADD COLUMN CleanFolder BOOLEAN NOT NULL DEFAULT 0;" + sSQL &= "PRAGMA user_version=101" + + RunParamQuery(sSQL, New Hashtable) + End If + End If + End Sub Public Function GetDBSize() As Long diff --git a/GBM/My Project/AssemblyInfo.vb b/GBM/My Project/AssemblyInfo.vb index bc0a8d4..ed587ad 100644 --- a/GBM/My Project/AssemblyInfo.vb +++ b/GBM/My Project/AssemblyInfo.vb @@ -33,7 +33,7 @@ Imports System.Runtime.InteropServices ' by using the '*' as shown below: ' - - + + \ No newline at end of file diff --git a/GBM/My Project/Resources.Designer.vb b/GBM/My Project/Resources.Designer.vb index 3d98856..27759c1 100644 --- a/GBM/My Project/Resources.Designer.vb +++ b/GBM/My Project/Resources.Designer.vb @@ -1293,6 +1293,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to Clean folder on restore. + ''' + Friend ReadOnly Property frmGameManager_chkCleanFolder() As String + Get + Return ResourceManager.GetString("frmGameManager_chkCleanFolder", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Monitor this game. ''' diff --git a/GBM/My Project/Resources.resx b/GBM/My Project/Resources.resx index f86cdc1..5ee2c95 100644 --- a/GBM/My Project/Resources.resx +++ b/GBM/My Project/Resources.resx @@ -1732,4 +1732,7 @@ Unknown + + Clean folder on restore + \ No newline at end of file From 3184cb61ecb63cc14b08e997455b6c27b72fc366 Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Mon, 14 Nov 2016 15:43:16 -0600 Subject: [PATCH 02/16] Removed some unused code --- GBM/Managers/mgrRestore.vb | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/GBM/Managers/mgrRestore.vb b/GBM/Managers/mgrRestore.vb index 78514b7..9039f74 100644 --- a/GBM/Managers/mgrRestore.vb +++ b/GBM/Managers/mgrRestore.vb @@ -161,12 +161,6 @@ Public Class mgrRestore Return slRemovedItems End Function - Private Sub CleanFolder(ByVal sExtractPath As String) - If Directory.Exists(sExtractPath) Then - - End If - End Sub - Public Function CheckRestorePrereq(ByVal oBackupInfo As clsBackup, ByVal bCleanFolder As Boolean) As Boolean Dim sHash As String Dim sExtractPath As String @@ -198,8 +192,8 @@ Public Class mgrRestore End If End If - 'Check file integrity - If oSettings.CheckSum Then + 'Check file integrity + If oSettings.CheckSum Then If oBackupInfo.CheckSum <> String.Empty Then sHash = mgrHash.Generate_SHA256_Hash(sBackupFile) If sHash <> oBackupInfo.CheckSum Then From 72f520f3337d2a7bec43d258f96d5ba7684da073 Mon Sep 17 00:00:00 2001 From: MikeMaximus Date: Thu, 22 Dec 2016 09:20:05 -0600 Subject: [PATCH 03/16] Fix for issue #68 --- GBM/Forms/frmMain.vb | 1 + 1 file changed, 1 insertion(+) diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index e596fc2..3b9b6cb 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -889,6 +889,7 @@ Public Class frmMain 'Toggle State with Tray Clicks If Not bShowToggle Then bShowToggle = True + Me.Refresh() Me.Visible = True Me.ShowInTaskbar = True Me.Focus() From e4237a74bbcbe3ef3ba6f9cb2d57b3ab1e0e9179 Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Thu, 5 Jan 2017 09:01:40 -0600 Subject: [PATCH 04/16] Modified fix for issue #68 --- GBM/Forms/frmMain.vb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index 3b9b6cb..8cdb063 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -652,6 +652,12 @@ Public Class frmMain bProcessDebugMode = bDebugEnable mgrCommon.ShowMessage(frmMain_CommandSucess, MsgBoxStyle.Exclamation) End Select + + Case "refresh" + 'Redraw the main form + Me.Refresh() + mgrCommon.ShowMessage(frmMain_CommandSucess, MsgBoxStyle.Exclamation) + Case Else mgrCommon.ShowMessage(frmMain_ErrorCommandInvalid, sMainCommand, MsgBoxStyle.Exclamation) End Select @@ -889,7 +895,6 @@ Public Class frmMain 'Toggle State with Tray Clicks If Not bShowToggle Then bShowToggle = True - Me.Refresh() Me.Visible = True Me.ShowInTaskbar = True Me.Focus() From 8ce1b00a8c0cf524522a7924992393b5b552828c Mon Sep 17 00:00:00 2001 From: MikeMaximus Date: Fri, 6 Jan 2017 08:20:03 -0600 Subject: [PATCH 05/16] Working fix for issue #68 --- GBM/Forms/frmMain.Designer.vb | 1 + GBM/Forms/frmMain.vb | 5 ----- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/GBM/Forms/frmMain.Designer.vb b/GBM/Forms/frmMain.Designer.vb index 0f8a26c..29ee4b0 100644 --- a/GBM/Forms/frmMain.Designer.vb +++ b/GBM/Forms/frmMain.Designer.vb @@ -523,6 +523,7 @@ Partial Class frmMain ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font + Me.AutoSize = True Me.ClientSize = New System.Drawing.Size(524, 401) Me.Controls.Add(Me.pbTime) Me.Controls.Add(Me.lblStatus3) diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index 8cdb063..fccfc70 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -653,11 +653,6 @@ Public Class frmMain mgrCommon.ShowMessage(frmMain_CommandSucess, MsgBoxStyle.Exclamation) End Select - Case "refresh" - 'Redraw the main form - Me.Refresh() - mgrCommon.ShowMessage(frmMain_CommandSucess, MsgBoxStyle.Exclamation) - Case Else mgrCommon.ShowMessage(frmMain_ErrorCommandInvalid, sMainCommand, MsgBoxStyle.Exclamation) End Select From 5a9b3c99b384afb4fdf35a9068a1c23c242dd399 Mon Sep 17 00:00:00 2001 From: MikeMaximus Date: Sun, 19 Feb 2017 14:36:52 -0600 Subject: [PATCH 06/16] Changes for Issue #67 & #70 --- GBM/Classes/clsBackup.vb | 20 ----- GBM/Forms/frmMain.vb | 114 ++++++++++++++++++++++++--- GBM/Managers/mgrRestore.vb | 12 +-- GBM/My Project/Resources.Designer.vb | 18 +++++ GBM/My Project/Resources.resx | 6 ++ 5 files changed, 133 insertions(+), 37 deletions(-) diff --git a/GBM/Classes/clsBackup.vb b/GBM/Classes/clsBackup.vb index eef77cc..b42af69 100644 --- a/GBM/Classes/clsBackup.vb +++ b/GBM/Classes/clsBackup.vb @@ -7,8 +7,6 @@ Private sRelativeRestorePath As String = String.Empty Private dDateUpdated As DateTime = Date.Now Private sUpdatedBy As String = String.Empty - Private dLastDateUpdated As DateTime = Date.Now - Private sLastUpdatedBy As String = String.Empty Private sCheckSum As String = String.Empty Property ID As String @@ -109,24 +107,6 @@ End Set End Property - Property LastDateUpdated As DateTime - Get - Return dLastDateUpdated - End Get - Set(value As DateTime) - dLastDateUpdated = value - End Set - End Property - - Property LastUpdatedBy As String - Get - Return sLastUpdatedBy - End Get - Set(value As String) - sLastUpdatedBy = value - End Set - End Property - Property CheckSum As String Get Return sCheckSum diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index fccfc70..2834803 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -40,12 +40,14 @@ Public Class frmMain Private sPriorVersion As String Private iFormHeight As Integer Private iLogSpacer As Integer + Private iRestoreTimeOut As Integer 'Developer Debug Flags Private bProcessDebugMode As Boolean = False WithEvents oFileWatcher As New System.IO.FileSystemWatcher WithEvents tmScanTimer As New Timer + WithEvents tmRestoreCheck As New Timer Public WithEvents oProcess As New mgrProcesses Public WithEvents oBackup As New mgrBackup @@ -53,6 +55,7 @@ Public Class frmMain Public hshScanList As Hashtable Public oSettings As New mgrSettings + Delegate Sub UpdateNotifierCallBack(ByVal iCount As Integer) Delegate Sub UpdateLogCallBack(ByVal sLogUpdate As String, ByVal bTrayUpdate As Boolean, ByVal objIcon As System.Windows.Forms.ToolTipIcon, ByVal bTimeStamp As Boolean) Delegate Sub WorkingGameInfoCallBack(ByVal sTitle As String, ByVal sStatus1 As String, ByVal sStatus2 As String, ByVal sStatus3 As String) Delegate Sub UpdateStatusCallBack(ByVal sStatus As String) @@ -328,15 +331,17 @@ Public Class frmMain End If End Sub - Private Sub CheckRestore() - Dim slRestoreData As SortedList = mgrRestore.CompareManifests() - Dim sNotification As String - - If slRestoreData.Count > 0 Then - If slRestoreData.Count > 1 Then - sNotification = mgrCommon.FormatString(frmMain_NewSaveNotificationMulti, slRestoreData.Count) + Private Sub UpdateNotifier(ByVal iCount As Integer) + 'Thread Safe + If Me.InvokeRequired = True Then + Dim d As New UpdateNotifierCallBack(AddressOf UpdateNotifier) + Me.Invoke(d, New Object() {iCount}) + Else + Dim sNotification As String + If iCount > 1 Then + sNotification = mgrCommon.FormatString(frmMain_NewSaveNotificationMulti, iCount) Else - sNotification = mgrCommon.FormatString(frmMain_NewSaveNotificationSingle, slRestoreData.Count) + sNotification = mgrCommon.FormatString(frmMain_NewSaveNotificationSingle, iCount) End If gMonNotification.Image = Icon_Inbox gMonTrayNotification.Image = Icon_Inbox @@ -347,6 +352,90 @@ Public Class frmMain End If End Sub + Private Sub StartRestoreCheck() + iRestoreTimeOut = -1 + tmRestoreCheck.Interval = 60000 + tmRestoreCheck.Enabled = True + tmRestoreCheck.Start() + AutoRestoreCheck() + End Sub + + Private Sub AutoRestoreCheck() + Dim slRestoreData As SortedList = mgrRestore.CompareManifests() + Dim sNotReady As New List(Of String) + Dim sNotInstalled As New List(Of String) + Dim oBackup As clsBackup + Dim sFileName As String + Dim sExtractPath As String + Dim bFinished As Boolean = True + + 'Bail out and shut down the timer if there's nothing to do + If slRestoreData.Count = 0 Then + tmRestoreCheck.Stop() + tmRestoreCheck.Enabled = False + Exit Sub + End If + + 'Increment Timer + iRestoreTimeOut += 1 + + 'Check backup files + For Each de As DictionaryEntry In slRestoreData + oBackup = DirectCast(de.Value, clsBackup) + + 'Check if backup file is ready to restore + sFileName = oSettings.BackupFolder & IO.Path.DirectorySeparatorChar & oBackup.FileName + If mgrHash.Generate_SHA256_Hash(sFileName) <> oBackup.CheckSum Then + sNotReady.Add(de.Key) + bFinished = False + End If + + 'Check if the restore location exists, if not we assume the game is not installed and should be auto-marked. + If oBackup.AbsolutePath Then + sExtractPath = oBackup.RestorePath + Else + sExtractPath = oBackup.RelativeRestorePath + End If + If Not IO.Directory.Exists(sExtractPath) Then + If mgrManifest.DoGlobalManifestCheck(de.Key, mgrSQLite.Database.Local) Then + mgrManifest.DoManifestUpdateByName(de.Value, mgrSQLite.Database.Local) + Else + mgrManifest.DoManifestAdd(de.Value, mgrSQLite.Database.Local) + End If + sNotInstalled.Add(de.Key) + End If + Next + + 'Remove any backup files that are not ready + For Each s As String In sNotReady + slRestoreData.Remove(s) + UpdateLog(mgrCommon.FormatString(frmMain_RestoreNotReady, s), False, ToolTipIcon.Info, True) + Next + + 'Remove any backup files that should not be automatically restored + For Each s As String In sNotInstalled + slRestoreData.Remove(s) + UpdateLog(mgrCommon.FormatString(frmMain_AutoMarked, s), False, ToolTipIcon.Info, True) + Next + + 'When backup files are ready update the notifier + If slRestoreData.Count > 0 Then + UpdateNotifier(slRestoreData.Count) + End If + + 'Shutdown if we are finished + If bFinished Then + tmRestoreCheck.Stop() + tmRestoreCheck.Enabled = False + End If + + 'Time out after 15 minutes + If iRestoreTimeOut = 15 Then + tmRestoreCheck.Stop() + tmRestoreCheck.Enabled = False + End If + End Sub + 'Functions handling the display of game information Private Sub SetIcon() Dim sIcon As String @@ -758,7 +847,7 @@ Public Class frmMain Private Sub CheckForNewBackups() If oSettings.RestoreOnLaunch Then - CheckRestore() + StartRestoreCheck() End If End Sub @@ -1100,6 +1189,9 @@ Public Class frmMain End Sub Private Sub SetForm() + 'Disable Autosize in Linux (Mono prevents manual resizing when this is enabled) + If mgrCommon.IsUnix Then Me.AutoSize = False + 'Set Form Name Me.Name = App_NameLong @@ -1522,6 +1614,10 @@ Public Class frmMain End If End Sub + Private Sub AutoRestoreEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles tmRestoreCheck.Tick + AutoRestoreCheck() + End Sub + Private Sub ScanTimerEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles tmScanTimer.Tick Dim bNeedsPath As Boolean = False Dim bContinue As Boolean = True diff --git a/GBM/Managers/mgrRestore.vb b/GBM/Managers/mgrRestore.vb index 9039f74..30aca39 100644 --- a/GBM/Managers/mgrRestore.vb +++ b/GBM/Managers/mgrRestore.vb @@ -96,8 +96,6 @@ Public Class mgrRestore If bLocal And bRemote Then 'Compare If oRemoteItem.DateUpdated > oLocalItem.DateUpdated Then - oRemoteItem.LastDateUpdated = oLocalItem.DateUpdated - oRemoteItem.LastUpdatedBy = oLocalItem.UpdatedBy Return True End If End If @@ -126,16 +124,14 @@ Public Class mgrRestore If oItem.DateUpdated > oLocalItem.DateUpdated Then oLocalItem.FileName = oItem.FileName - oLocalItem.LastDateUpdated = oItem.DateUpdated - oLocalItem.LastUpdatedBy = oItem.UpdatedBy + oLocalItem.DateUpdated = oItem.DateUpdated + oLocalItem.UpdatedBy = oItem.UpdatedBy slRestoreItems.Add(oLocalItem.Name, oLocalItem) End If Else oLocalItem = oItem - oLocalItem.LastDateUpdated = oItem.DateUpdated - oLocalItem.LastUpdatedBy = oItem.UpdatedBy - oLocalItem.DateUpdated = Nothing - oLocalItem.UpdatedBy = Nothing + oLocalItem.DateUpdated = oItem.DateUpdated + oLocalItem.UpdatedBy = oItem.UpdatedBy slRestoreItems.Add(oLocalItem.Name, oLocalItem) End If Next diff --git a/GBM/My Project/Resources.Designer.vb b/GBM/My Project/Resources.Designer.vb index 27759c1..ccc409c 100644 --- a/GBM/My Project/Resources.Designer.vb +++ b/GBM/My Project/Resources.Designer.vb @@ -2301,6 +2301,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to The saved game folder for [PARAM] does not exist, the backup has been automatically marked as restored.. + ''' + Friend ReadOnly Property frmMain_AutoMarked() As String + Get + Return ResourceManager.GetString("frmMain_AutoMarked", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Backup in Progress.... ''' @@ -3156,6 +3165,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to The backup file for [PARAM] is not ready to restore.. + ''' + Friend ReadOnly Property frmMain_RestoreNotReady() As String + Get + Return ResourceManager.GetString("frmMain_RestoreNotReady", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to GBM is running with Administrator privileges.. ''' diff --git a/GBM/My Project/Resources.resx b/GBM/My Project/Resources.resx index 5ee2c95..c9ac133 100644 --- a/GBM/My Project/Resources.resx +++ b/GBM/My Project/Resources.resx @@ -1735,4 +1735,10 @@ Clean folder on restore + + The saved game folder for [PARAM] does not exist, the backup has been automatically marked as restored. + + + The backup file for [PARAM] is not ready to restore. + \ No newline at end of file From 3bd4cbd0bdc7f4ffffafdf30ef3731a9b56b8dcb Mon Sep 17 00:00:00 2001 From: MikeMaximus Date: Sun, 19 Feb 2017 21:22:57 -0600 Subject: [PATCH 07/16] Updates for issue #67 --- GBM/Forms/frmMain.vb | 70 +++-- GBM/Forms/frmSettings.Designer.vb | 402 ++++++++++++++++----------- GBM/Forms/frmSettings.vb | 16 +- GBM/Managers/mgrRestore.vb | 10 +- GBM/Managers/mgrSQLite.vb | 4 +- GBM/Managers/mgrSettings.vb | 26 +- GBM/My Project/Resources.Designer.vb | 64 ++++- GBM/My Project/Resources.resx | 26 +- 8 files changed, 419 insertions(+), 199 deletions(-) diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index 2834803..65e19d6 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -55,7 +55,7 @@ Public Class frmMain Public hshScanList As Hashtable Public oSettings As New mgrSettings - Delegate Sub UpdateNotifierCallBack(ByVal iCount As Integer) + Delegate Sub UpdateNotifierCallBack(ByVal iCount As Integer, ByVal bRestored As Boolean) Delegate Sub UpdateLogCallBack(ByVal sLogUpdate As String, ByVal bTrayUpdate As Boolean, ByVal objIcon As System.Windows.Forms.ToolTipIcon, ByVal bTimeStamp As Boolean) Delegate Sub WorkingGameInfoCallBack(ByVal sTitle As String, ByVal sStatus1 As String, ByVal sStatus2 As String, ByVal sStatus3 As String) Delegate Sub UpdateStatusCallBack(ByVal sStatus As String) @@ -331,17 +331,25 @@ Public Class frmMain End If End Sub - Private Sub UpdateNotifier(ByVal iCount As Integer) + Private Sub UpdateNotifier(ByVal iCount As Integer, ByVal bRestored As Boolean) 'Thread Safe If Me.InvokeRequired = True Then Dim d As New UpdateNotifierCallBack(AddressOf UpdateNotifier) - Me.Invoke(d, New Object() {iCount}) + Me.Invoke(d, New Object() {iCount, bRestored}) Else Dim sNotification As String If iCount > 1 Then - sNotification = mgrCommon.FormatString(frmMain_NewSaveNotificationMulti, iCount) + If bRestored Then + sNotification = mgrCommon.FormatString(frmMain_RestoreNotificationMulti, iCount) + Else + sNotification = mgrCommon.FormatString(frmMain_NewSaveNotificationMulti, iCount) + End If Else - sNotification = mgrCommon.FormatString(frmMain_NewSaveNotificationSingle, iCount) + If bRestored Then + sNotification = mgrCommon.FormatString(frmMain_RestoreNotificationSingle, iCount) + Else + sNotification = mgrCommon.FormatString(frmMain_NewSaveNotificationSingle, iCount) + End If End If gMonNotification.Image = Icon_Inbox gMonTrayNotification.Image = Icon_Inbox @@ -368,8 +376,10 @@ Public Class frmMain Dim sFileName As String Dim sExtractPath As String Dim bFinished As Boolean = True + Dim hshRestore As Hashtable + Dim hshGames As Hashtable - 'Bail out and shut down the timer if there's nothing to do + 'Shut down the timer and bail out if there's nothing to do If slRestoreData.Count = 0 Then tmRestoreCheck.Stop() tmRestoreCheck.Enabled = False @@ -391,18 +401,20 @@ Public Class frmMain End If 'Check if the restore location exists, if not we assume the game is not installed and should be auto-marked. - If oBackup.AbsolutePath Then - sExtractPath = oBackup.RestorePath - Else - sExtractPath = oBackup.RelativeRestorePath - End If - If Not IO.Directory.Exists(sExtractPath) Then - If mgrManifest.DoGlobalManifestCheck(de.Key, mgrSQLite.Database.Local) Then - mgrManifest.DoManifestUpdateByName(de.Value, mgrSQLite.Database.Local) + If oSettings.AutoMark Then + If oBackup.AbsolutePath Then + sExtractPath = oBackup.RestorePath Else - mgrManifest.DoManifestAdd(de.Value, mgrSQLite.Database.Local) + sExtractPath = oBackup.RelativeRestorePath + End If + If Not IO.Directory.Exists(sExtractPath) Then + If mgrManifest.DoGlobalManifestCheck(de.Key, mgrSQLite.Database.Local) Then + mgrManifest.DoManifestUpdateByName(de.Value, mgrSQLite.Database.Local) + Else + mgrManifest.DoManifestAdd(de.Value, mgrSQLite.Database.Local) + End If + sNotInstalled.Add(de.Key) End If - sNotInstalled.Add(de.Key) End If Next @@ -418,9 +430,27 @@ Public Class frmMain UpdateLog(mgrCommon.FormatString(frmMain_AutoMarked, s), False, ToolTipIcon.Info, True) Next - 'When backup files are ready update the notifier - If slRestoreData.Count > 0 Then - UpdateNotifier(slRestoreData.Count) + 'Automatically restore backup files + If oSettings.AutoRestore Then + If slRestoreData.Count > 0 Then + hshRestore = New Hashtable + For Each de As DictionaryEntry In slRestoreData + hshGames = mgrMonitorList.DoListGetbyName(de.Key) + If hshGames.Count = 1 Then + hshRestore.Add(hshGames(0), de.Value) + Else + UpdateLog(mgrCommon.FormatString(frmMain_AutoRestoreFailure, de.Key), False, ToolTipIcon.Info, True) + End If + Next + RunRestore(hshRestore) + End If + End If + + 'Update the notifier + If oSettings.RestoreOnLaunch Then + If slRestoreData.Count > 0 Then + UpdateNotifier(slRestoreData.Count, oSettings.AutoMark) + End If End If 'Shutdown if we are finished @@ -846,7 +876,7 @@ Public Class frmMain End Sub Private Sub CheckForNewBackups() - If oSettings.RestoreOnLaunch Then + If oSettings.RestoreOnLaunch Or oSettings.AutoRestore Or oSettings.AutoMark Then StartRestoreCheck() End If End Sub diff --git a/GBM/Forms/frmSettings.Designer.vb b/GBM/Forms/frmSettings.Designer.vb index ad77796..c2ae984 100644 --- a/GBM/Forms/frmSettings.Designer.vb +++ b/GBM/Forms/frmSettings.Designer.vb @@ -23,7 +23,6 @@ Partial Class frmSettings _ Private Sub InitializeComponent() Me.chkMonitorOnStartup = New System.Windows.Forms.CheckBox() - Me.chkBackupConfirm = New System.Windows.Forms.CheckBox() Me.grpStartup = New System.Windows.Forms.GroupBox() Me.chkStartWindows = New System.Windows.Forms.CheckBox() Me.chkStartToTray = New System.Windows.Forms.CheckBox() @@ -39,12 +38,6 @@ Partial Class frmSettings Me.chkCreateFolder = New System.Windows.Forms.CheckBox() Me.btnSave = New System.Windows.Forms.Button() Me.btnCancel = New System.Windows.Forms.Button() - Me.lblMinutes = New System.Windows.Forms.Label() - Me.nudSupressBackupThreshold = New System.Windows.Forms.NumericUpDown() - Me.chkSupressBackup = New System.Windows.Forms.CheckBox() - Me.chkCheckSum = New System.Windows.Forms.CheckBox() - Me.chkRestoreOnLaunch = New System.Windows.Forms.CheckBox() - Me.chkOverwriteWarning = New System.Windows.Forms.CheckBox() Me.grp7zGeneral = New System.Windows.Forms.GroupBox() Me.cboCompression = New System.Windows.Forms.ComboBox() Me.lblCompression = New System.Windows.Forms.Label() @@ -57,17 +50,28 @@ Partial Class frmSettings Me.lbl7zProduct = New System.Windows.Forms.Label() Me.btnDefaults = New System.Windows.Forms.Button() Me.pnlBackup = New System.Windows.Forms.Panel() + Me.lblMinutes = New System.Windows.Forms.Label() + Me.nudSupressBackupThreshold = New System.Windows.Forms.NumericUpDown() + Me.chkSupressBackup = New System.Windows.Forms.CheckBox() + Me.chkBackupConfirm = New System.Windows.Forms.CheckBox() + Me.chkCheckSum = New System.Windows.Forms.CheckBox() + Me.chkOverwriteWarning = New System.Windows.Forms.CheckBox() + Me.grpBackupHandling = New System.Windows.Forms.GroupBox() + Me.chkAutoMark = New System.Windows.Forms.CheckBox() Me.pnl7z = New System.Windows.Forms.Panel() Me.grp7zAdvanced = New System.Windows.Forms.GroupBox() Me.grp7zInformation = New System.Windows.Forms.GroupBox() Me.pnlGeneral = New System.Windows.Forms.Panel() Me.grpGameData = New System.Windows.Forms.GroupBox() Me.lstSettings = New System.Windows.Forms.ListBox() + Me.chkRestoreNotify = New System.Windows.Forms.CheckBox() + Me.chkAutoRestore = New System.Windows.Forms.CheckBox() Me.grpStartup.SuspendLayout() Me.grpFolderOptions.SuspendLayout() - CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).BeginInit() Me.grp7zGeneral.SuspendLayout() Me.pnlBackup.SuspendLayout() + CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).BeginInit() + Me.grpBackupHandling.SuspendLayout() Me.pnl7z.SuspendLayout() Me.grp7zAdvanced.SuspendLayout() Me.grp7zInformation.SuspendLayout() @@ -78,31 +82,24 @@ Partial Class frmSettings 'chkMonitorOnStartup ' Me.chkMonitorOnStartup.AutoSize = True - Me.chkMonitorOnStartup.Location = New System.Drawing.Point(6, 65) + Me.chkMonitorOnStartup.Location = New System.Drawing.Point(8, 80) + Me.chkMonitorOnStartup.Margin = New System.Windows.Forms.Padding(4) Me.chkMonitorOnStartup.Name = "chkMonitorOnStartup" - Me.chkMonitorOnStartup.Size = New System.Drawing.Size(146, 17) + Me.chkMonitorOnStartup.Size = New System.Drawing.Size(192, 21) Me.chkMonitorOnStartup.TabIndex = 2 Me.chkMonitorOnStartup.Text = "Start monitoring at launch" Me.chkMonitorOnStartup.UseVisualStyleBackColor = True ' - 'chkBackupConfirm - ' - Me.chkBackupConfirm.AutoSize = True - Me.chkBackupConfirm.Location = New System.Drawing.Point(6, 88) - Me.chkBackupConfirm.Name = "chkBackupConfirm" - Me.chkBackupConfirm.Size = New System.Drawing.Size(160, 17) - Me.chkBackupConfirm.TabIndex = 1 - Me.chkBackupConfirm.Text = "Disable backup confirmation" - Me.chkBackupConfirm.UseVisualStyleBackColor = True - ' 'grpStartup ' Me.grpStartup.Controls.Add(Me.chkStartWindows) Me.grpStartup.Controls.Add(Me.chkStartToTray) Me.grpStartup.Controls.Add(Me.chkMonitorOnStartup) - Me.grpStartup.Location = New System.Drawing.Point(6, 12) + Me.grpStartup.Location = New System.Drawing.Point(8, 15) + Me.grpStartup.Margin = New System.Windows.Forms.Padding(4) Me.grpStartup.Name = "grpStartup" - Me.grpStartup.Size = New System.Drawing.Size(354, 90) + Me.grpStartup.Padding = New System.Windows.Forms.Padding(4) + Me.grpStartup.Size = New System.Drawing.Size(472, 111) Me.grpStartup.TabIndex = 0 Me.grpStartup.TabStop = False Me.grpStartup.Text = "Startup" @@ -110,9 +107,10 @@ Partial Class frmSettings 'chkStartWindows ' Me.chkStartWindows.AutoSize = True - Me.chkStartWindows.Location = New System.Drawing.Point(6, 19) + Me.chkStartWindows.Location = New System.Drawing.Point(8, 23) + Me.chkStartWindows.Margin = New System.Windows.Forms.Padding(4) Me.chkStartWindows.Name = "chkStartWindows" - Me.chkStartWindows.Size = New System.Drawing.Size(117, 17) + Me.chkStartWindows.Size = New System.Drawing.Size(148, 21) Me.chkStartWindows.TabIndex = 0 Me.chkStartWindows.Text = "Start with Windows" Me.chkStartWindows.UseVisualStyleBackColor = True @@ -120,9 +118,10 @@ Partial Class frmSettings 'chkStartToTray ' Me.chkStartToTray.AutoSize = True - Me.chkStartToTray.Location = New System.Drawing.Point(6, 42) + Me.chkStartToTray.Location = New System.Drawing.Point(8, 52) + Me.chkStartToTray.Margin = New System.Windows.Forms.Padding(4) Me.chkStartToTray.Name = "chkStartToTray" - Me.chkStartToTray.Size = New System.Drawing.Size(115, 17) + Me.chkStartToTray.Size = New System.Drawing.Size(152, 21) Me.chkStartToTray.TabIndex = 1 Me.chkStartToTray.Text = "Start to system tray" Me.chkStartToTray.UseVisualStyleBackColor = True @@ -130,18 +129,20 @@ Partial Class frmSettings 'chkAutoSaveLog ' Me.chkAutoSaveLog.AutoSize = True - Me.chkAutoSaveLog.Location = New System.Drawing.Point(6, 204) + Me.chkAutoSaveLog.Location = New System.Drawing.Point(8, 251) + Me.chkAutoSaveLog.Margin = New System.Windows.Forms.Padding(4) Me.chkAutoSaveLog.Name = "chkAutoSaveLog" - Me.chkAutoSaveLog.Size = New System.Drawing.Size(231, 17) + Me.chkAutoSaveLog.Size = New System.Drawing.Size(300, 21) Me.chkAutoSaveLog.TabIndex = 7 Me.chkAutoSaveLog.Text = "Autosave log when max length is exceeded" Me.chkAutoSaveLog.UseVisualStyleBackColor = True ' 'btnOptionalFields ' - Me.btnOptionalFields.Location = New System.Drawing.Point(110, 38) + Me.btnOptionalFields.Location = New System.Drawing.Point(147, 47) + Me.btnOptionalFields.Margin = New System.Windows.Forms.Padding(4) Me.btnOptionalFields.Name = "btnOptionalFields" - Me.btnOptionalFields.Size = New System.Drawing.Size(134, 23) + Me.btnOptionalFields.Size = New System.Drawing.Size(179, 28) Me.btnOptionalFields.TabIndex = 6 Me.btnOptionalFields.Text = "Choose &Optional Fields..." Me.btnOptionalFields.UseVisualStyleBackColor = True @@ -149,9 +150,10 @@ Partial Class frmSettings 'chkTimeTracking ' Me.chkTimeTracking.AutoSize = True - Me.chkTimeTracking.Location = New System.Drawing.Point(6, 19) + Me.chkTimeTracking.Location = New System.Drawing.Point(8, 23) + Me.chkTimeTracking.Margin = New System.Windows.Forms.Padding(4) Me.chkTimeTracking.Name = "chkTimeTracking" - Me.chkTimeTracking.Size = New System.Drawing.Size(122, 17) + Me.chkTimeTracking.Size = New System.Drawing.Size(158, 21) Me.chkTimeTracking.TabIndex = 4 Me.chkTimeTracking.Text = "Enable time tracking" Me.chkTimeTracking.UseVisualStyleBackColor = True @@ -159,9 +161,10 @@ Partial Class frmSettings 'chkSync ' Me.chkSync.AutoSize = True - Me.chkSync.Location = New System.Drawing.Point(6, 42) + Me.chkSync.Location = New System.Drawing.Point(8, 52) + Me.chkSync.Margin = New System.Windows.Forms.Padding(4) Me.chkSync.Name = "chkSync" - Me.chkSync.Size = New System.Drawing.Size(98, 17) + Me.chkSync.Size = New System.Drawing.Size(126, 21) Me.chkSync.TabIndex = 5 Me.chkSync.Text = "Enable syncing" Me.chkSync.UseVisualStyleBackColor = True @@ -169,9 +172,10 @@ Partial Class frmSettings 'chkShowDetectionTips ' Me.chkShowDetectionTips.AutoSize = True - Me.chkShowDetectionTips.Location = New System.Drawing.Point(6, 181) + Me.chkShowDetectionTips.Location = New System.Drawing.Point(8, 223) + Me.chkShowDetectionTips.Margin = New System.Windows.Forms.Padding(4) Me.chkShowDetectionTips.Name = "chkShowDetectionTips" - Me.chkShowDetectionTips.Size = New System.Drawing.Size(159, 17) + Me.chkShowDetectionTips.Size = New System.Drawing.Size(205, 21) Me.chkShowDetectionTips.TabIndex = 3 Me.chkShowDetectionTips.Text = "Show detection notifications" Me.chkShowDetectionTips.UseVisualStyleBackColor = True @@ -182,18 +186,21 @@ Partial Class frmSettings Me.grpFolderOptions.Controls.Add(Me.lblBackupFolder) Me.grpFolderOptions.Controls.Add(Me.txtBackupFolder) Me.grpFolderOptions.Controls.Add(Me.chkCreateFolder) - Me.grpFolderOptions.Location = New System.Drawing.Point(6, 12) + Me.grpFolderOptions.Location = New System.Drawing.Point(8, 15) + Me.grpFolderOptions.Margin = New System.Windows.Forms.Padding(4) Me.grpFolderOptions.Name = "grpFolderOptions" - Me.grpFolderOptions.Size = New System.Drawing.Size(354, 70) + Me.grpFolderOptions.Padding = New System.Windows.Forms.Padding(4) + Me.grpFolderOptions.Size = New System.Drawing.Size(472, 86) Me.grpFolderOptions.TabIndex = 1 Me.grpFolderOptions.TabStop = False Me.grpFolderOptions.Text = "Folders" ' 'btnBackupFolder ' - Me.btnBackupFolder.Location = New System.Drawing.Point(313, 17) + Me.btnBackupFolder.Location = New System.Drawing.Point(417, 21) + Me.btnBackupFolder.Margin = New System.Windows.Forms.Padding(4) Me.btnBackupFolder.Name = "btnBackupFolder" - Me.btnBackupFolder.Size = New System.Drawing.Size(27, 20) + Me.btnBackupFolder.Size = New System.Drawing.Size(36, 25) Me.btnBackupFolder.TabIndex = 2 Me.btnBackupFolder.Text = "..." Me.btnBackupFolder.UseVisualStyleBackColor = True @@ -201,25 +208,28 @@ Partial Class frmSettings 'lblBackupFolder ' Me.lblBackupFolder.AutoSize = True - Me.lblBackupFolder.Location = New System.Drawing.Point(6, 20) + Me.lblBackupFolder.Location = New System.Drawing.Point(8, 25) + Me.lblBackupFolder.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblBackupFolder.Name = "lblBackupFolder" - Me.lblBackupFolder.Size = New System.Drawing.Size(79, 13) + Me.lblBackupFolder.Size = New System.Drawing.Size(103, 17) Me.lblBackupFolder.TabIndex = 0 Me.lblBackupFolder.Text = "Backup Folder:" ' 'txtBackupFolder ' - Me.txtBackupFolder.Location = New System.Drawing.Point(91, 17) + Me.txtBackupFolder.Location = New System.Drawing.Point(121, 21) + Me.txtBackupFolder.Margin = New System.Windows.Forms.Padding(4) Me.txtBackupFolder.Name = "txtBackupFolder" - Me.txtBackupFolder.Size = New System.Drawing.Size(216, 20) + Me.txtBackupFolder.Size = New System.Drawing.Size(287, 22) Me.txtBackupFolder.TabIndex = 1 ' 'chkCreateFolder ' Me.chkCreateFolder.AutoSize = True - Me.chkCreateFolder.Location = New System.Drawing.Point(9, 43) + Me.chkCreateFolder.Location = New System.Drawing.Point(12, 53) + Me.chkCreateFolder.Margin = New System.Windows.Forms.Padding(4) Me.chkCreateFolder.Name = "chkCreateFolder" - Me.chkCreateFolder.Size = New System.Drawing.Size(186, 17) + Me.chkCreateFolder.Size = New System.Drawing.Size(247, 21) Me.chkCreateFolder.TabIndex = 3 Me.chkCreateFolder.Text = "Create a sub-folder for each game" Me.chkCreateFolder.UseVisualStyleBackColor = True @@ -227,9 +237,10 @@ Partial Class frmSettings 'btnSave ' Me.btnSave.DialogResult = System.Windows.Forms.DialogResult.OK - Me.btnSave.Location = New System.Drawing.Point(384, 321) + Me.btnSave.Location = New System.Drawing.Point(512, 395) + Me.btnSave.Margin = New System.Windows.Forms.Padding(4) Me.btnSave.Name = "btnSave" - Me.btnSave.Size = New System.Drawing.Size(75, 23) + Me.btnSave.Size = New System.Drawing.Size(100, 28) Me.btnSave.TabIndex = 5 Me.btnSave.Text = "&Save" Me.btnSave.UseVisualStyleBackColor = True @@ -237,77 +248,23 @@ Partial Class frmSettings 'btnCancel ' Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(465, 321) + Me.btnCancel.Location = New System.Drawing.Point(620, 395) + Me.btnCancel.Margin = New System.Windows.Forms.Padding(4) Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.Size = New System.Drawing.Size(100, 28) Me.btnCancel.TabIndex = 6 Me.btnCancel.Text = "&Cancel" Me.btnCancel.UseVisualStyleBackColor = True ' - 'lblMinutes - ' - Me.lblMinutes.AutoSize = True - Me.lblMinutes.Location = New System.Drawing.Point(286, 181) - Me.lblMinutes.Name = "lblMinutes" - Me.lblMinutes.Size = New System.Drawing.Size(43, 13) - Me.lblMinutes.TabIndex = 7 - Me.lblMinutes.Text = "minutes" - ' - 'nudSupressBackupThreshold - ' - Me.nudSupressBackupThreshold.Location = New System.Drawing.Point(229, 179) - Me.nudSupressBackupThreshold.Maximum = New Decimal(New Integer() {999, 0, 0, 0}) - Me.nudSupressBackupThreshold.Name = "nudSupressBackupThreshold" - Me.nudSupressBackupThreshold.Size = New System.Drawing.Size(51, 20) - Me.nudSupressBackupThreshold.TabIndex = 6 - ' - 'chkSupressBackup - ' - Me.chkSupressBackup.AutoSize = True - Me.chkSupressBackup.Location = New System.Drawing.Point(6, 180) - Me.chkSupressBackup.Name = "chkSupressBackup" - Me.chkSupressBackup.Size = New System.Drawing.Size(217, 17) - Me.chkSupressBackup.TabIndex = 5 - Me.chkSupressBackup.Text = "Backup only when session time exceeds" - Me.chkSupressBackup.UseVisualStyleBackColor = True - ' - 'chkCheckSum - ' - Me.chkCheckSum.AutoSize = True - Me.chkCheckSum.Location = New System.Drawing.Point(6, 134) - Me.chkCheckSum.Name = "chkCheckSum" - Me.chkCheckSum.Size = New System.Drawing.Size(195, 17) - Me.chkCheckSum.TabIndex = 3 - Me.chkCheckSum.Text = "Verify backup files with a checksum" - Me.chkCheckSum.UseVisualStyleBackColor = True - ' - 'chkRestoreOnLaunch - ' - Me.chkRestoreOnLaunch.AutoSize = True - Me.chkRestoreOnLaunch.Location = New System.Drawing.Point(6, 157) - Me.chkRestoreOnLaunch.Name = "chkRestoreOnLaunch" - Me.chkRestoreOnLaunch.Size = New System.Drawing.Size(257, 17) - Me.chkRestoreOnLaunch.TabIndex = 4 - Me.chkRestoreOnLaunch.Text = "Notify when there are new backup files to restore" - Me.chkRestoreOnLaunch.UseVisualStyleBackColor = True - ' - 'chkOverwriteWarning - ' - Me.chkOverwriteWarning.AutoSize = True - Me.chkOverwriteWarning.Location = New System.Drawing.Point(6, 111) - Me.chkOverwriteWarning.Name = "chkOverwriteWarning" - Me.chkOverwriteWarning.Size = New System.Drawing.Size(139, 17) - Me.chkOverwriteWarning.TabIndex = 2 - Me.chkOverwriteWarning.Text = "Show overwrite warning" - Me.chkOverwriteWarning.UseVisualStyleBackColor = True - ' 'grp7zGeneral ' Me.grp7zGeneral.Controls.Add(Me.cboCompression) Me.grp7zGeneral.Controls.Add(Me.lblCompression) - Me.grp7zGeneral.Location = New System.Drawing.Point(6, 12) + Me.grp7zGeneral.Location = New System.Drawing.Point(8, 15) + Me.grp7zGeneral.Margin = New System.Windows.Forms.Padding(4) Me.grp7zGeneral.Name = "grp7zGeneral" - Me.grp7zGeneral.Size = New System.Drawing.Size(354, 50) + Me.grp7zGeneral.Padding = New System.Windows.Forms.Padding(4) + Me.grp7zGeneral.Size = New System.Drawing.Size(472, 62) Me.grp7zGeneral.TabIndex = 0 Me.grp7zGeneral.TabStop = False Me.grp7zGeneral.Text = "General" @@ -316,84 +273,94 @@ Partial Class frmSettings ' Me.cboCompression.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cboCompression.FormattingEnabled = True - Me.cboCompression.Location = New System.Drawing.Point(110, 17) + Me.cboCompression.Location = New System.Drawing.Point(147, 21) + Me.cboCompression.Margin = New System.Windows.Forms.Padding(4) Me.cboCompression.Name = "cboCompression" - Me.cboCompression.Size = New System.Drawing.Size(238, 21) + Me.cboCompression.Size = New System.Drawing.Size(316, 24) Me.cboCompression.TabIndex = 1 ' 'lblCompression ' Me.lblCompression.AutoSize = True - Me.lblCompression.Location = New System.Drawing.Point(6, 20) + Me.lblCompression.Location = New System.Drawing.Point(8, 25) + Me.lblCompression.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblCompression.Name = "lblCompression" - Me.lblCompression.Size = New System.Drawing.Size(70, 13) + Me.lblCompression.Size = New System.Drawing.Size(94, 17) Me.lblCompression.TabIndex = 0 Me.lblCompression.Text = "Compression:" ' 'btn7zLocation ' - Me.btn7zLocation.Location = New System.Drawing.Point(313, 41) + Me.btn7zLocation.Location = New System.Drawing.Point(417, 50) + Me.btn7zLocation.Margin = New System.Windows.Forms.Padding(4) Me.btn7zLocation.Name = "btn7zLocation" - Me.btn7zLocation.Size = New System.Drawing.Size(27, 20) + Me.btn7zLocation.Size = New System.Drawing.Size(36, 25) Me.btn7zLocation.TabIndex = 5 Me.btn7zLocation.Text = "..." Me.btn7zLocation.UseVisualStyleBackColor = True ' 'txt7zLocation ' - Me.txt7zLocation.Location = New System.Drawing.Point(110, 41) + Me.txt7zLocation.Location = New System.Drawing.Point(147, 50) + Me.txt7zLocation.Margin = New System.Windows.Forms.Padding(4) Me.txt7zLocation.Name = "txt7zLocation" - Me.txt7zLocation.Size = New System.Drawing.Size(197, 20) + Me.txt7zLocation.Size = New System.Drawing.Size(261, 22) Me.txt7zLocation.TabIndex = 4 ' 'lblLocation ' Me.lblLocation.AutoSize = True - Me.lblLocation.Location = New System.Drawing.Point(6, 44) + Me.lblLocation.Location = New System.Drawing.Point(8, 54) + Me.lblLocation.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblLocation.Name = "lblLocation" - Me.lblLocation.Size = New System.Drawing.Size(89, 13) + Me.lblLocation.Size = New System.Drawing.Size(117, 17) Me.lblLocation.TabIndex = 4 Me.lblLocation.Text = "Custom Location:" ' 'txt7zArguments ' - Me.txt7zArguments.Location = New System.Drawing.Point(110, 15) + Me.txt7zArguments.Location = New System.Drawing.Point(147, 18) + Me.txt7zArguments.Margin = New System.Windows.Forms.Padding(4) Me.txt7zArguments.Name = "txt7zArguments" - Me.txt7zArguments.Size = New System.Drawing.Size(238, 20) + Me.txt7zArguments.Size = New System.Drawing.Size(316, 22) Me.txt7zArguments.TabIndex = 3 ' 'lblArguments ' Me.lblArguments.AutoSize = True - Me.lblArguments.Location = New System.Drawing.Point(6, 20) + Me.lblArguments.Location = New System.Drawing.Point(8, 25) + Me.lblArguments.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblArguments.Name = "lblArguments" - Me.lblArguments.Size = New System.Drawing.Size(98, 13) + Me.lblArguments.Size = New System.Drawing.Size(131, 17) Me.lblArguments.TabIndex = 2 Me.lblArguments.Text = "Custom Arguments:" ' 'lbl7zCopyright ' Me.lbl7zCopyright.AutoEllipsis = True - Me.lbl7zCopyright.Location = New System.Drawing.Point(9, 34) + Me.lbl7zCopyright.Location = New System.Drawing.Point(12, 42) + Me.lbl7zCopyright.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lbl7zCopyright.Name = "lbl7zCopyright" - Me.lbl7zCopyright.Size = New System.Drawing.Size(339, 17) + Me.lbl7zCopyright.Size = New System.Drawing.Size(452, 21) Me.lbl7zCopyright.TabIndex = 8 Me.lbl7zCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' 'lbl7zProduct ' Me.lbl7zProduct.AutoEllipsis = True - Me.lbl7zProduct.Location = New System.Drawing.Point(9, 17) + Me.lbl7zProduct.Location = New System.Drawing.Point(12, 21) + Me.lbl7zProduct.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lbl7zProduct.Name = "lbl7zProduct" - Me.lbl7zProduct.Size = New System.Drawing.Size(339, 17) + Me.lbl7zProduct.Size = New System.Drawing.Size(452, 21) Me.lbl7zProduct.TabIndex = 7 Me.lbl7zProduct.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' 'btnDefaults ' - Me.btnDefaults.Location = New System.Drawing.Point(12, 321) + Me.btnDefaults.Location = New System.Drawing.Point(16, 395) + Me.btnDefaults.Margin = New System.Windows.Forms.Padding(4) Me.btnDefaults.Name = "btnDefaults" - Me.btnDefaults.Size = New System.Drawing.Size(110, 23) + Me.btnDefaults.Size = New System.Drawing.Size(147, 28) Me.btnDefaults.TabIndex = 4 Me.btnDefaults.Text = "Set &Defaults" Me.btnDefaults.UseVisualStyleBackColor = True @@ -402,25 +369,113 @@ Partial Class frmSettings ' Me.pnlBackup.Controls.Add(Me.lblMinutes) Me.pnlBackup.Controls.Add(Me.nudSupressBackupThreshold) - Me.pnlBackup.Controls.Add(Me.grpFolderOptions) Me.pnlBackup.Controls.Add(Me.chkSupressBackup) Me.pnlBackup.Controls.Add(Me.chkBackupConfirm) Me.pnlBackup.Controls.Add(Me.chkCheckSum) Me.pnlBackup.Controls.Add(Me.chkOverwriteWarning) - Me.pnlBackup.Controls.Add(Me.chkRestoreOnLaunch) - Me.pnlBackup.Location = New System.Drawing.Point(180, 0) + Me.pnlBackup.Controls.Add(Me.grpBackupHandling) + Me.pnlBackup.Controls.Add(Me.grpFolderOptions) + Me.pnlBackup.Location = New System.Drawing.Point(240, 0) + Me.pnlBackup.Margin = New System.Windows.Forms.Padding(4) Me.pnlBackup.Name = "pnlBackup" - Me.pnlBackup.Size = New System.Drawing.Size(367, 314) + Me.pnlBackup.Size = New System.Drawing.Size(489, 386) Me.pnlBackup.TabIndex = 3 ' + 'lblMinutes + ' + Me.lblMinutes.AutoSize = True + Me.lblMinutes.Location = New System.Drawing.Point(381, 309) + Me.lblMinutes.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblMinutes.Name = "lblMinutes" + Me.lblMinutes.Size = New System.Drawing.Size(57, 17) + Me.lblMinutes.TabIndex = 14 + Me.lblMinutes.Text = "minutes" + ' + 'nudSupressBackupThreshold + ' + Me.nudSupressBackupThreshold.Location = New System.Drawing.Point(305, 306) + Me.nudSupressBackupThreshold.Margin = New System.Windows.Forms.Padding(4) + Me.nudSupressBackupThreshold.Maximum = New Decimal(New Integer() {999, 0, 0, 0}) + Me.nudSupressBackupThreshold.Name = "nudSupressBackupThreshold" + Me.nudSupressBackupThreshold.Size = New System.Drawing.Size(68, 22) + Me.nudSupressBackupThreshold.TabIndex = 13 + ' + 'chkSupressBackup + ' + Me.chkSupressBackup.AutoSize = True + Me.chkSupressBackup.Location = New System.Drawing.Point(8, 308) + Me.chkSupressBackup.Margin = New System.Windows.Forms.Padding(4) + Me.chkSupressBackup.Name = "chkSupressBackup" + Me.chkSupressBackup.Size = New System.Drawing.Size(282, 21) + Me.chkSupressBackup.TabIndex = 12 + Me.chkSupressBackup.Text = "Backup only when session time exceeds" + Me.chkSupressBackup.UseVisualStyleBackColor = True + ' + 'chkBackupConfirm + ' + Me.chkBackupConfirm.AutoSize = True + Me.chkBackupConfirm.Location = New System.Drawing.Point(8, 222) + Me.chkBackupConfirm.Margin = New System.Windows.Forms.Padding(4) + Me.chkBackupConfirm.Name = "chkBackupConfirm" + Me.chkBackupConfirm.Size = New System.Drawing.Size(208, 21) + Me.chkBackupConfirm.TabIndex = 9 + Me.chkBackupConfirm.Text = "Disable backup confirmation" + Me.chkBackupConfirm.UseVisualStyleBackColor = True + ' + 'chkCheckSum + ' + Me.chkCheckSum.AutoSize = True + Me.chkCheckSum.Location = New System.Drawing.Point(8, 279) + Me.chkCheckSum.Margin = New System.Windows.Forms.Padding(4) + Me.chkCheckSum.Name = "chkCheckSum" + Me.chkCheckSum.Size = New System.Drawing.Size(252, 21) + Me.chkCheckSum.TabIndex = 11 + Me.chkCheckSum.Text = "Verify backup files with a checksum" + Me.chkCheckSum.UseVisualStyleBackColor = True + ' + 'chkOverwriteWarning + ' + Me.chkOverwriteWarning.AutoSize = True + Me.chkOverwriteWarning.Location = New System.Drawing.Point(8, 251) + Me.chkOverwriteWarning.Margin = New System.Windows.Forms.Padding(4) + Me.chkOverwriteWarning.Name = "chkOverwriteWarning" + Me.chkOverwriteWarning.Size = New System.Drawing.Size(178, 21) + Me.chkOverwriteWarning.TabIndex = 10 + Me.chkOverwriteWarning.Text = "Show overwrite warning" + Me.chkOverwriteWarning.UseVisualStyleBackColor = True + ' + 'grpBackupHandling + ' + Me.grpBackupHandling.Controls.Add(Me.chkAutoRestore) + Me.grpBackupHandling.Controls.Add(Me.chkRestoreNotify) + Me.grpBackupHandling.Controls.Add(Me.chkAutoMark) + Me.grpBackupHandling.Location = New System.Drawing.Point(8, 108) + Me.grpBackupHandling.Name = "grpBackupHandling" + Me.grpBackupHandling.Size = New System.Drawing.Size(472, 107) + Me.grpBackupHandling.TabIndex = 8 + Me.grpBackupHandling.TabStop = False + Me.grpBackupHandling.Text = "Backup Handling" + ' + 'chkAutoMark + ' + Me.chkAutoMark.AutoSize = True + Me.chkAutoMark.Location = New System.Drawing.Point(11, 78) + Me.chkAutoMark.Margin = New System.Windows.Forms.Padding(4) + Me.chkAutoMark.Name = "chkAutoMark" + Me.chkAutoMark.Size = New System.Drawing.Size(395, 21) + Me.chkAutoMark.TabIndex = 5 + Me.chkAutoMark.Text = "Automatically mark backups as restored when appropriate" + Me.chkAutoMark.UseVisualStyleBackColor = True + ' 'pnl7z ' Me.pnl7z.Controls.Add(Me.grp7zAdvanced) Me.pnl7z.Controls.Add(Me.grp7zInformation) Me.pnl7z.Controls.Add(Me.grp7zGeneral) - Me.pnl7z.Location = New System.Drawing.Point(180, 0) + Me.pnl7z.Location = New System.Drawing.Point(240, 0) + Me.pnl7z.Margin = New System.Windows.Forms.Padding(4) Me.pnl7z.Name = "pnl7z" - Me.pnl7z.Size = New System.Drawing.Size(367, 314) + Me.pnl7z.Size = New System.Drawing.Size(489, 386) Me.pnl7z.TabIndex = 2 ' 'grp7zAdvanced @@ -430,9 +485,11 @@ Partial Class frmSettings Me.grp7zAdvanced.Controls.Add(Me.txt7zLocation) Me.grp7zAdvanced.Controls.Add(Me.txt7zArguments) Me.grp7zAdvanced.Controls.Add(Me.lblLocation) - Me.grp7zAdvanced.Location = New System.Drawing.Point(6, 68) + Me.grp7zAdvanced.Location = New System.Drawing.Point(8, 84) + Me.grp7zAdvanced.Margin = New System.Windows.Forms.Padding(4) Me.grp7zAdvanced.Name = "grp7zAdvanced" - Me.grp7zAdvanced.Size = New System.Drawing.Size(354, 73) + Me.grp7zAdvanced.Padding = New System.Windows.Forms.Padding(4) + Me.grp7zAdvanced.Size = New System.Drawing.Size(472, 90) Me.grp7zAdvanced.TabIndex = 2 Me.grp7zAdvanced.TabStop = False Me.grp7zAdvanced.Text = "Advanced" @@ -441,9 +498,11 @@ Partial Class frmSettings ' Me.grp7zInformation.Controls.Add(Me.lbl7zProduct) Me.grp7zInformation.Controls.Add(Me.lbl7zCopyright) - Me.grp7zInformation.Location = New System.Drawing.Point(6, 146) + Me.grp7zInformation.Location = New System.Drawing.Point(8, 180) + Me.grp7zInformation.Margin = New System.Windows.Forms.Padding(4) Me.grp7zInformation.Name = "grp7zInformation" - Me.grp7zInformation.Size = New System.Drawing.Size(354, 63) + Me.grp7zInformation.Padding = New System.Windows.Forms.Padding(4) + Me.grp7zInformation.Size = New System.Drawing.Size(472, 78) Me.grp7zInformation.TabIndex = 1 Me.grp7zInformation.TabStop = False Me.grp7zInformation.Text = "Utility Information" @@ -454,9 +513,10 @@ Partial Class frmSettings Me.pnlGeneral.Controls.Add(Me.grpGameData) Me.pnlGeneral.Controls.Add(Me.chkShowDetectionTips) Me.pnlGeneral.Controls.Add(Me.grpStartup) - Me.pnlGeneral.Location = New System.Drawing.Point(180, 0) + Me.pnlGeneral.Location = New System.Drawing.Point(240, 0) + Me.pnlGeneral.Margin = New System.Windows.Forms.Padding(4) Me.pnlGeneral.Name = "pnlGeneral" - Me.pnlGeneral.Size = New System.Drawing.Size(367, 314) + Me.pnlGeneral.Size = New System.Drawing.Size(489, 386) Me.pnlGeneral.TabIndex = 1 ' 'grpGameData @@ -464,9 +524,11 @@ Partial Class frmSettings Me.grpGameData.Controls.Add(Me.chkTimeTracking) Me.grpGameData.Controls.Add(Me.chkSync) Me.grpGameData.Controls.Add(Me.btnOptionalFields) - Me.grpGameData.Location = New System.Drawing.Point(6, 106) + Me.grpGameData.Location = New System.Drawing.Point(8, 130) + Me.grpGameData.Margin = New System.Windows.Forms.Padding(4) Me.grpGameData.Name = "grpGameData" - Me.grpGameData.Size = New System.Drawing.Size(354, 69) + Me.grpGameData.Padding = New System.Windows.Forms.Padding(4) + Me.grpGameData.Size = New System.Drawing.Size(472, 85) Me.grpGameData.TabIndex = 1 Me.grpGameData.TabStop = False Me.grpGameData.Text = "Game Data" @@ -474,24 +536,47 @@ Partial Class frmSettings 'lstSettings ' Me.lstSettings.FormattingEnabled = True - Me.lstSettings.Location = New System.Drawing.Point(12, 12) + Me.lstSettings.ItemHeight = 16 + Me.lstSettings.Location = New System.Drawing.Point(16, 15) + Me.lstSettings.Margin = New System.Windows.Forms.Padding(4) Me.lstSettings.Name = "lstSettings" - Me.lstSettings.Size = New System.Drawing.Size(162, 303) + Me.lstSettings.Size = New System.Drawing.Size(215, 372) Me.lstSettings.TabIndex = 0 ' + 'chkRestoreNotify + ' + Me.chkRestoreNotify.AutoSize = True + Me.chkRestoreNotify.Location = New System.Drawing.Point(11, 23) + Me.chkRestoreNotify.Name = "chkRestoreNotify" + Me.chkRestoreNotify.Size = New System.Drawing.Size(257, 21) + Me.chkRestoreNotify.TabIndex = 8 + Me.chkRestoreNotify.Text = "Notify about new backups to restore" + Me.chkRestoreNotify.UseVisualStyleBackColor = True + ' + 'chkAutoRestore + ' + Me.chkAutoRestore.AutoSize = True + Me.chkAutoRestore.Location = New System.Drawing.Point(11, 50) + Me.chkAutoRestore.Name = "chkAutoRestore" + Me.chkAutoRestore.Size = New System.Drawing.Size(248, 21) + Me.chkAutoRestore.TabIndex = 9 + Me.chkAutoRestore.Text = "Automatically restore new backups" + Me.chkAutoRestore.UseVisualStyleBackColor = True + ' 'frmSettings ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(554, 361) + Me.ClientSize = New System.Drawing.Size(739, 444) + Me.Controls.Add(Me.pnlBackup) Me.Controls.Add(Me.lstSettings) Me.Controls.Add(Me.btnDefaults) Me.Controls.Add(Me.btnCancel) Me.Controls.Add(Me.btnSave) Me.Controls.Add(Me.pnlGeneral) Me.Controls.Add(Me.pnl7z) - Me.Controls.Add(Me.pnlBackup) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle + Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "frmSettings" @@ -503,11 +588,13 @@ Partial Class frmSettings Me.grpStartup.PerformLayout() Me.grpFolderOptions.ResumeLayout(False) Me.grpFolderOptions.PerformLayout() - CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).EndInit() Me.grp7zGeneral.ResumeLayout(False) Me.grp7zGeneral.PerformLayout() Me.pnlBackup.ResumeLayout(False) Me.pnlBackup.PerformLayout() + CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).EndInit() + Me.grpBackupHandling.ResumeLayout(False) + Me.grpBackupHandling.PerformLayout() Me.pnl7z.ResumeLayout(False) Me.grp7zAdvanced.ResumeLayout(False) Me.grp7zAdvanced.PerformLayout() @@ -520,7 +607,6 @@ Partial Class frmSettings End Sub Friend WithEvents chkMonitorOnStartup As System.Windows.Forms.CheckBox - Friend WithEvents chkBackupConfirm As System.Windows.Forms.CheckBox Friend WithEvents grpStartup As System.Windows.Forms.GroupBox Friend WithEvents grpFolderOptions As System.Windows.Forms.GroupBox Friend WithEvents txtBackupFolder As System.Windows.Forms.TextBox @@ -530,16 +616,10 @@ Partial Class frmSettings Friend WithEvents btnBackupFolder As System.Windows.Forms.Button Friend WithEvents chkShowDetectionTips As System.Windows.Forms.CheckBox Friend WithEvents chkStartToTray As System.Windows.Forms.CheckBox - Friend WithEvents chkOverwriteWarning As System.Windows.Forms.CheckBox Friend WithEvents chkCreateFolder As System.Windows.Forms.CheckBox - Friend WithEvents chkRestoreOnLaunch As System.Windows.Forms.CheckBox Friend WithEvents chkSync As System.Windows.Forms.CheckBox - Friend WithEvents chkCheckSum As System.Windows.Forms.CheckBox Friend WithEvents chkStartWindows As System.Windows.Forms.CheckBox Friend WithEvents chkTimeTracking As System.Windows.Forms.CheckBox - Friend WithEvents lblMinutes As Label - Friend WithEvents nudSupressBackupThreshold As NumericUpDown - Friend WithEvents chkSupressBackup As CheckBox Friend WithEvents grp7zGeneral As GroupBox Friend WithEvents cboCompression As ComboBox Friend WithEvents lblCompression As Label @@ -560,4 +640,14 @@ Partial Class frmSettings Friend WithEvents lstSettings As ListBox Friend WithEvents grp7zAdvanced As GroupBox Friend WithEvents grp7zInformation As GroupBox + Friend WithEvents lblMinutes As Label + Friend WithEvents nudSupressBackupThreshold As NumericUpDown + Friend WithEvents chkSupressBackup As CheckBox + Friend WithEvents chkBackupConfirm As CheckBox + Friend WithEvents chkCheckSum As CheckBox + Friend WithEvents chkOverwriteWarning As CheckBox + Friend WithEvents grpBackupHandling As GroupBox + Friend WithEvents chkAutoMark As CheckBox + Friend WithEvents chkAutoRestore As CheckBox + Friend WithEvents chkRestoreNotify As CheckBox End Class diff --git a/GBM/Forms/frmSettings.vb b/GBM/Forms/frmSettings.vb index 2389d5c..d5e4c1d 100644 --- a/GBM/Forms/frmSettings.vb +++ b/GBM/Forms/frmSettings.vb @@ -48,7 +48,9 @@ Public Class frmSettings oSettings.DisableConfirmation = chkBackupConfirm.Checked oSettings.CreateSubFolder = chkCreateFolder.Checked oSettings.ShowOverwriteWarning = chkOverwriteWarning.Checked - oSettings.RestoreOnLaunch = chkRestoreOnLaunch.Checked + oSettings.RestoreOnLaunch = chkRestoreNotify.Checked + oSettings.AutoRestore = chkAutoRestore.Checked + oSettings.AutoMark = chkAutoMark.Checked oSettings.TimeTracking = chkTimeTracking.Checked oSettings.SupressBackup = chkSupressBackup.Checked oSettings.SupressBackupThreshold = nudSupressBackupThreshold.Value @@ -177,7 +179,9 @@ Public Class frmSettings chkBackupConfirm.Checked = oSettings.DisableConfirmation chkCreateFolder.Checked = oSettings.CreateSubFolder chkOverwriteWarning.Checked = oSettings.ShowOverwriteWarning - chkRestoreOnLaunch.Checked = oSettings.RestoreOnLaunch + chkRestoreNotify.Checked = oSettings.RestoreOnLaunch + chkAutoRestore.Checked = oSettings.AutoRestore + chkAutoMark.Checked = oSettings.AutoMark txtBackupFolder.Text = oSettings.BackupFolder chkSync.Checked = oSettings.Sync chkCheckSum.Checked = oSettings.CheckSum @@ -280,7 +284,10 @@ Public Class frmSettings lblMinutes.Text = frmSettings_lblMinutes chkSupressBackup.Text = frmSettings_chkSupressBackup chkCheckSum.Text = frmSettings_chkCheckSum - chkRestoreOnLaunch.Text = frmSettings_chkRestoreOnLaunch + grpBackupHandling.Text = frmSettings_grpBackupHandling + chkRestoreNotify.Text = frmSettings_chkRestoreNotify + chkAutoRestore.Text = frmSettings_chkAutoRestore + chkAutoMark.Text = frmSettings_chkAutoMark chkOverwriteWarning.Text = frmSettings_chkOverwriteWarning chkCreateFolder.Text = frmSettings_chkCreateFolder chkBackupConfirm.Text = frmSettings_chkBackupConfirm @@ -352,7 +359,7 @@ Public Class frmSettings End If End Sub - Private Sub chkSupressBackup_CheckedChanged(sender As Object, e As EventArgs) Handles chkSupressBackup.CheckedChanged + Private Sub chkSupressBackup_CheckedChanged(sender As Object, e As EventArgs) nudSupressBackupThreshold.Enabled = chkSupressBackup.Checked End Sub @@ -375,4 +382,5 @@ Public Class frmSettings Private Sub lstSettings_SelectedValueChanged(sender As Object, e As EventArgs) Handles lstSettings.SelectedValueChanged ChangePanel() End Sub + End Class \ No newline at end of file diff --git a/GBM/Managers/mgrRestore.vb b/GBM/Managers/mgrRestore.vb index 30aca39..7677806 100644 --- a/GBM/Managers/mgrRestore.vb +++ b/GBM/Managers/mgrRestore.vb @@ -123,16 +123,10 @@ Public Class mgrRestore oLocalItem = DirectCast(slLocalManifest(oItem.Name), clsBackup) If oItem.DateUpdated > oLocalItem.DateUpdated Then - oLocalItem.FileName = oItem.FileName - oLocalItem.DateUpdated = oItem.DateUpdated - oLocalItem.UpdatedBy = oItem.UpdatedBy - slRestoreItems.Add(oLocalItem.Name, oLocalItem) + slRestoreItems.Add(oItem.Name, oItem) End If Else - oLocalItem = oItem - oLocalItem.DateUpdated = oItem.DateUpdated - oLocalItem.UpdatedBy = oItem.UpdatedBy - slRestoreItems.Add(oLocalItem.Name, oLocalItem) + slRestoreItems.Add(oItem.Name, oItem) End If Next diff --git a/GBM/Managers/mgrSQLite.vb b/GBM/Managers/mgrSQLite.vb index 0909ad7..9744430 100644 --- a/GBM/Managers/mgrSQLite.vb +++ b/GBM/Managers/mgrSQLite.vb @@ -74,7 +74,7 @@ Public Class mgrSQLite "DisableConfirmation BOOLEAN NOT NULL, CreateSubFolder BOOLEAN NOT NULL, ShowOverwriteWarning BOOLEAN NOT NULL, RestoreOnLaunch BOOLEAN NOT NULL, " & "BackupFolder TEXT NOT NULL, Sync BOOLEAN NOT NULL, CheckSum BOOLEAN NOT NULL, StartWithWindows BOOLEAN NOT NULL, TimeTracking BOOLEAN NOT NULL, " & "SupressBackup BOOLEAN NOT NULL, SupressBackupThreshold INTEGER NOT NULL, CompressionLevel INTEGER NOT NULL, Custom7zArguments TEXT, " & - "Custom7zLocation TEXT, SyncFields INTEGER NOT NULL, AutoSaveLog BOOLEAN NOT NULL);" + "Custom7zLocation TEXT, SyncFields INTEGER NOT NULL, AutoSaveLog BOOLEAN NOT NULL, AutoRestore BOOLEAN NOT NULL, AutoMark BOOLEAN NOT NULL);" 'Add Tables (Monitor List) sSql &= "CREATE TABLE monitorlist (MonitorID TEXT NOT NULL UNIQUE, Name TEXT NOT NULL, Process TEXT NOT NULL, Path TEXT, " & @@ -608,6 +608,8 @@ Public Class mgrSQLite 'Add new field(s) sSQL = "ALTER TABLE monitorlist ADD COLUMN CleanFolder BOOLEAN NOT NULL DEFAULT 0;" + sSQL &= "ALTER TABLE settings ADD COLUMN AutoRestore BOOLEAN NOT NULL DEFAULT 0;" + sSQL &= "ALTER TABLE settings ADD COLUMN AutoMark BOOLEAN NOT NULL DEFAULT 0;" sSQL &= "PRAGMA user_version=101" RunParamQuery(sSQL, New Hashtable) diff --git a/GBM/Managers/mgrSettings.vb b/GBM/Managers/mgrSettings.vb index 9ccd8f6..8bab6e1 100644 --- a/GBM/Managers/mgrSettings.vb +++ b/GBM/Managers/mgrSettings.vb @@ -9,6 +9,8 @@ Public Class mgrSettings Private bCreateSubFolder As Boolean = False Private bShowOverwriteWarning As Boolean = True Private bRestoreOnLaunch As Boolean = False + Private bAutoRestore As Boolean = False + Private bAutoMark As Boolean = False Private bSync As Boolean = True Private bCheckSum As Boolean = True Private bTimeTracking As Boolean = True @@ -93,6 +95,24 @@ Public Class mgrSettings End Set End Property + Property AutoRestore As Boolean + Get + Return bAutoRestore + End Get + Set(value As Boolean) + bAutoRestore = value + End Set + End Property + + Property AutoMark As Boolean + Get + Return bAutoMark + End Get + Set(value As Boolean) + bAutoMark = value + End Set + End Property + Property Sync As Boolean Get Return bSync @@ -251,7 +271,7 @@ Public Class mgrSettings sSQL = "INSERT INTO settings VALUES (1, @MonitorOnStartup, @StartToTray, @ShowDetectionToolTips, @DisableConfirmation, " sSQL &= "@CreateSubFolder, @ShowOverwriteWarning, @RestoreOnLaunch, @BackupFolder, @Sync, @CheckSum, @StartWithWindows, " sSQL &= "@TimeTracking, @SupressBackup, @SupressBackupThreshold, @CompressionLevel, @Custom7zArguments, @Custom7zLocation, " - sSQL &= "@SyncFields,@AutoSaveLog)" + sSQL &= "@SyncFields, @AutoSaveLog, @AutoRestore, @AutoMark)" hshParams.Add("MonitorOnStartup", MonitorOnStartup) hshParams.Add("StartToTray", StartToTray) @@ -272,6 +292,8 @@ Public Class mgrSettings hshParams.Add("Custom7zLocation", Custom7zLocation) hshParams.Add("SyncFields", SyncFields) hshParams.Add("AutoSaveLog", AutoSaveLog) + hshParams.Add("AutoRestore", AutoRestore) + hshParams.Add("AutoMark", AutoMark) oDatabase.RunParamQuery(sSQL, hshParams) End Sub @@ -305,6 +327,8 @@ Public Class mgrSettings If Not IsDBNull(dr("Custom7zLocation")) Then Custom7zLocation = CStr(dr("Custom7zLocation")) SyncFields = CInt(dr("SyncFields")) AutoSaveLog = CBool(dr("AutoSaveLog")) + AutoRestore = CBool(dr("AutoRestore")) + AutoMark = CBool(dr("AutoMark")) Next oDatabase.Disconnect() diff --git a/GBM/My Project/Resources.Designer.vb b/GBM/My Project/Resources.Designer.vb index ccc409c..ab9e157 100644 --- a/GBM/My Project/Resources.Designer.vb +++ b/GBM/My Project/Resources.Designer.vb @@ -2310,6 +2310,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to [PARAM] has multiple configurations and cannot be automatically restored.. + ''' + Friend ReadOnly Property frmMain_AutoRestoreFailure() As String + Get + Return ResourceManager.GetString("frmMain_AutoRestoreFailure", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Backup in Progress.... ''' @@ -3076,7 +3085,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to [PARAM] New Saves Pending. + ''' Looks up a localized string similar to [PARAM] New Backups Pending. ''' Friend ReadOnly Property frmMain_NewSaveNotificationMulti() As String Get @@ -3085,7 +3094,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to [PARAM] New Save Pending. + ''' Looks up a localized string similar to [PARAM] New Backup Pending. ''' Friend ReadOnly Property frmMain_NewSaveNotificationSingle() As String Get @@ -3165,6 +3174,24 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to [PARAM] New Backups Restored. + ''' + Friend ReadOnly Property frmMain_RestoreNotificationMulti() As String + Get + Return ResourceManager.GetString("frmMain_RestoreNotificationMulti", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to [PARAM] New Backup Restored. + ''' + Friend ReadOnly Property frmMain_RestoreNotificationSingle() As String + Get + Return ResourceManager.GetString("frmMain_RestoreNotificationSingle", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to The backup file for [PARAM] is not ready to restore.. ''' @@ -3372,6 +3399,24 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to Automatically mark backups as restored when appropriate. + ''' + Friend ReadOnly Property frmSettings_chkAutoMark() As String + Get + Return ResourceManager.GetString("frmSettings_chkAutoMark", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Automatically restore new backups. + ''' + Friend ReadOnly Property frmSettings_chkAutoRestore() As String + Get + Return ResourceManager.GetString("frmSettings_chkAutoRestore", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Autosave log when max length is exceeded. ''' @@ -3427,11 +3472,11 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to Notify when there are new backup files to restore. + ''' Looks up a localized string similar to Notify about new backups to restore. ''' - Friend ReadOnly Property frmSettings_chkRestoreOnLaunch() As String + Friend ReadOnly Property frmSettings_chkRestoreNotify() As String Get - Return ResourceManager.GetString("frmSettings_chkRestoreOnLaunch", resourceCulture) + Return ResourceManager.GetString("frmSettings_chkRestoreNotify", resourceCulture) End Get End Property @@ -3552,6 +3597,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to Backup Handling. + ''' + Friend ReadOnly Property frmSettings_grpBackupHandling() As String + Get + Return ResourceManager.GetString("frmSettings_grpBackupHandling", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Folders. ''' diff --git a/GBM/My Project/Resources.resx b/GBM/My Project/Resources.resx index c9ac133..fb7f34c 100644 --- a/GBM/My Project/Resources.resx +++ b/GBM/My Project/Resources.resx @@ -287,10 +287,10 @@ Multiple Games Detected - [PARAM] New Saves Pending + [PARAM] New Backups Pending - [PARAM] New Save Pending + [PARAM] New Backup Pending Game details are unavailable. @@ -1087,8 +1087,8 @@ Show overwrite warning - - Notify when there are new backup files to restore + + Notify about new backups to restore Show detection notifications @@ -1741,4 +1741,22 @@ The backup file for [PARAM] is not ready to restore. + + Automatically mark backups as restored when appropriate + + + Backup Handling + + + Automatically restore new backups + + + [PARAM] has multiple configurations and cannot be automatically restored. + + + [PARAM] New Backups Restored + + + [PARAM] New Backup Restored + \ No newline at end of file From c3b73a9953d3aa9df63ac6414a105d337532c278 Mon Sep 17 00:00:00 2001 From: MikeMaximus Date: Sun, 19 Feb 2017 21:34:45 -0600 Subject: [PATCH 08/16] Fixed event broken by last commit --- GBM/Forms/frmSettings.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GBM/Forms/frmSettings.vb b/GBM/Forms/frmSettings.vb index d5e4c1d..f2335aa 100644 --- a/GBM/Forms/frmSettings.vb +++ b/GBM/Forms/frmSettings.vb @@ -359,7 +359,7 @@ Public Class frmSettings End If End Sub - Private Sub chkSupressBackup_CheckedChanged(sender As Object, e As EventArgs) + Private Sub chkSupressBackup_CheckedChanged(sender As Object, e As EventArgs) Handles chkSupressBackup.CheckedChanged nudSupressBackupThreshold.Enabled = chkSupressBackup.Checked End Sub From 974aaa3638a9bd40f752527da69f2c5329df9194 Mon Sep 17 00:00:00 2001 From: MikeMaximus Date: Tue, 21 Feb 2017 16:36:34 -0600 Subject: [PATCH 09/16] Updates for issue #67 --- GBM/Forms/frmMain.vb | 51 ++++++++++++++++++++-------- GBM/My Project/Resources.Designer.vb | 22 ++++++++++-- GBM/My Project/Resources.resx | 8 ++++- 3 files changed, 63 insertions(+), 18 deletions(-) diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index 65e19d6..96547a2 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -341,14 +341,18 @@ Public Class frmMain If iCount > 1 Then If bRestored Then sNotification = mgrCommon.FormatString(frmMain_RestoreNotificationMulti, iCount) + gMonNotification.Tag = 1 Else sNotification = mgrCommon.FormatString(frmMain_NewSaveNotificationMulti, iCount) + gMonNotification.Tag = 0 End If Else If bRestored Then sNotification = mgrCommon.FormatString(frmMain_RestoreNotificationSingle, iCount) + gMonNotification.Tag = 1 Else sNotification = mgrCommon.FormatString(frmMain_NewSaveNotificationSingle, iCount) + gMonNotification.Tag = 0 End If End If gMonNotification.Image = Icon_Inbox @@ -372,6 +376,7 @@ Public Class frmMain Dim slRestoreData As SortedList = mgrRestore.CompareManifests() Dim sNotReady As New List(Of String) Dim sNotInstalled As New List(Of String) + Dim sNoCheckSum As New List(Of String) Dim oBackup As clsBackup Dim sFileName As String Dim sExtractPath As String @@ -394,27 +399,31 @@ Public Class frmMain oBackup = DirectCast(de.Value, clsBackup) 'Check if backup file is ready to restore - sFileName = oSettings.BackupFolder & IO.Path.DirectorySeparatorChar & oBackup.FileName - If mgrHash.Generate_SHA256_Hash(sFileName) <> oBackup.CheckSum Then - sNotReady.Add(de.Key) - bFinished = False + If oBackup.CheckSum <> String.Empty Then + sFileName = oSettings.BackupFolder & IO.Path.DirectorySeparatorChar & oBackup.FileName + If mgrHash.Generate_SHA256_Hash(sFileName) <> oBackup.CheckSum Then + sNotReady.Add(de.Key) + bFinished = False + End If + Else + sNoCheckSum.Add(de.Key) End If 'Check if the restore location exists, if not we assume the game is not installed and should be auto-marked. - If oSettings.AutoMark Then - If oBackup.AbsolutePath Then - sExtractPath = oBackup.RestorePath - Else - sExtractPath = oBackup.RelativeRestorePath - End If - If Not IO.Directory.Exists(sExtractPath) Then + If oBackup.AbsolutePath Then + sExtractPath = oBackup.RestorePath + Else + sExtractPath = oBackup.RelativeRestorePath + End If + If Not IO.Directory.Exists(sExtractPath) Then + If oSettings.AutoMark Then If mgrManifest.DoGlobalManifestCheck(de.Key, mgrSQLite.Database.Local) Then mgrManifest.DoManifestUpdateByName(de.Value, mgrSQLite.Database.Local) Else mgrManifest.DoManifestAdd(de.Value, mgrSQLite.Database.Local) End If - sNotInstalled.Add(de.Key) End If + sNotInstalled.Add(de.Key) End If Next @@ -427,7 +436,15 @@ Public Class frmMain 'Remove any backup files that should not be automatically restored For Each s As String In sNotInstalled slRestoreData.Remove(s) - UpdateLog(mgrCommon.FormatString(frmMain_AutoMarked, s), False, ToolTipIcon.Info, True) + If oSettings.AutoMark Then + UpdateLog(mgrCommon.FormatString(frmMain_AutoMark, s), False, ToolTipIcon.Info, True) + Else + UpdateLog(mgrCommon.FormatString(frmMain_NoAutoMark, s), False, ToolTipIcon.Info, True) + End If + Next + For Each s As String In sNoCheckSum + slRestoreData.Remove(s) + UpdateLog(mgrCommon.FormatString(frmMain_NoCheckSum, s), False, ToolTipIcon.Info, True) Next 'Automatically restore backup files @@ -449,7 +466,7 @@ Public Class frmMain 'Update the notifier If oSettings.RestoreOnLaunch Then If slRestoreData.Count > 0 Then - UpdateNotifier(slRestoreData.Count, oSettings.AutoMark) + UpdateNotifier(slRestoreData.Count, oSettings.AutoRestore) End If End If @@ -911,10 +928,12 @@ Public Class frmMain Private Sub HandleSyncWatcher() Handles oFileWatcher.Changed If oSettings.Sync Then + StopSyncWatcher() UpdateLog(frmMain_MasterListChanged, False, ToolTipIcon.Info, True) SyncGameSettings() LoadGameSettings() CheckForNewBackups() + StartSyncWatcher() End If End Sub @@ -1590,7 +1609,9 @@ Public Class frmMain Private Sub gMonNotification_Click(sender As Object, e As EventArgs) Handles gMonNotification.Click, gMonTrayNotification.Click gMonNotification.Visible = False gMonTrayNotification.Visible = False - OpenGameManager(True) + If gMonNotification.Tag = 0 Then + OpenGameManager(True) + End If End Sub Private Sub btnLogToggle_Click(sender As Object, e As EventArgs) Handles btnLogToggle.Click diff --git a/GBM/My Project/Resources.Designer.vb b/GBM/My Project/Resources.Designer.vb index ab9e157..5c16fdb 100644 --- a/GBM/My Project/Resources.Designer.vb +++ b/GBM/My Project/Resources.Designer.vb @@ -2304,9 +2304,9 @@ Namespace My.Resources ''' ''' Looks up a localized string similar to The saved game folder for [PARAM] does not exist, the backup has been automatically marked as restored.. ''' - Friend ReadOnly Property frmMain_AutoMarked() As String + Friend ReadOnly Property frmMain_AutoMark() As String Get - Return ResourceManager.GetString("frmMain_AutoMarked", resourceCulture) + Return ResourceManager.GetString("frmMain_AutoMark", resourceCulture) End Get End Property @@ -3102,6 +3102,24 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to The saved game folder for [PARAM] does not exist, this backup has been skipped.. + ''' + Friend ReadOnly Property frmMain_NoAutoMark() As String + Get + Return ResourceManager.GetString("frmMain_NoAutoMark", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to The backup file for [PARAM] has no checksum, it cannot be automatically restored.. + ''' + Friend ReadOnly Property frmMain_NoCheckSum() As String + Get + Return ResourceManager.GetString("frmMain_NoCheckSum", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Game details are unavailable.. ''' diff --git a/GBM/My Project/Resources.resx b/GBM/My Project/Resources.resx index fb7f34c..da4ee40 100644 --- a/GBM/My Project/Resources.resx +++ b/GBM/My Project/Resources.resx @@ -1735,7 +1735,7 @@ Clean folder on restore - + The saved game folder for [PARAM] does not exist, the backup has been automatically marked as restored. @@ -1759,4 +1759,10 @@ [PARAM] New Backup Restored + + The saved game folder for [PARAM] does not exist, this backup has been skipped. + + + The backup file for [PARAM] has no checksum, it cannot be automatically restored. + \ No newline at end of file From a5dd1d547bc388e24b200dcd9d2b5165d7bbe239 Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Wed, 22 Feb 2017 12:49:19 -0600 Subject: [PATCH 10/16] Relative path fix for issue #67 --- GBM/Forms/frmMain.vb | 37 ++++++++++++++++++---------- GBM/My Project/Resources.Designer.vb | 4 +-- GBM/My Project/Resources.resx | 4 +-- 3 files changed, 28 insertions(+), 17 deletions(-) diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index 96547a2..e79afc7 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -1,4 +1,5 @@ Imports GBM.My.Resources +Imports System.IO 'Name: frmMain 'Description: Game Backup Monitor Main Screen @@ -45,7 +46,7 @@ Public Class frmMain 'Developer Debug Flags Private bProcessDebugMode As Boolean = False - WithEvents oFileWatcher As New System.IO.FileSystemWatcher + WithEvents oFileWatcher As New FileSystemWatcher WithEvents tmScanTimer As New Timer WithEvents tmRestoreCheck As New Timer @@ -82,7 +83,7 @@ Public Class frmMain Dim sStatus3 As String 'Build Info - sStatus1 = IO.Path.GetFileName(oRestoreInfo.FileName) + sStatus1 = Path.GetFileName(oRestoreInfo.FileName) sStatus2 = mgrCommon.FormatString(frmMain_UpdatedBy, New String() {oRestoreInfo.UpdatedBy, oRestoreInfo.DateUpdated}) If oRestoreInfo.AbsolutePath Then sStatus3 = oRestoreInfo.RestorePath @@ -104,7 +105,7 @@ Public Class frmMain If oGame.AbsolutePath Then sStatus2 = oGame.Path Else - sStatus2 = oGame.ProcessPath & System.IO.Path.DirectorySeparatorChar & oGame.Path + sStatus2 = oGame.ProcessPath & Path.DirectorySeparatorChar & oGame.Path End If sStatus3 = String.Empty @@ -383,6 +384,7 @@ Public Class frmMain Dim bFinished As Boolean = True Dim hshRestore As Hashtable Dim hshGames As Hashtable + Dim oGame As clsGame 'Shut down the timer and bail out if there's nothing to do If slRestoreData.Count = 0 Then @@ -400,7 +402,7 @@ Public Class frmMain 'Check if backup file is ready to restore If oBackup.CheckSum <> String.Empty Then - sFileName = oSettings.BackupFolder & IO.Path.DirectorySeparatorChar & oBackup.FileName + sFileName = oSettings.BackupFolder & Path.DirectorySeparatorChar & oBackup.FileName If mgrHash.Generate_SHA256_Hash(sFileName) <> oBackup.CheckSum Then sNotReady.Add(de.Key) bFinished = False @@ -413,9 +415,17 @@ Public Class frmMain If oBackup.AbsolutePath Then sExtractPath = oBackup.RestorePath Else + hshGames = mgrMonitorList.DoListGetbyName(de.Key) + If hshGames.Count = 1 Then + oGame = DirectCast(hshGames(0), clsGame) + If oGame.ProcessPath <> String.Empty Then + oBackup.RelativeRestorePath = oGame.ProcessPath & Path.DirectorySeparatorChar & oBackup.RestorePath + End If + End If sExtractPath = oBackup.RelativeRestorePath End If - If Not IO.Directory.Exists(sExtractPath) Then + + If Not Directory.Exists(sExtractPath) Then If oSettings.AutoMark Then If mgrManifest.DoGlobalManifestCheck(de.Key, mgrSQLite.Database.Local) Then mgrManifest.DoManifestUpdateByName(de.Value, mgrSQLite.Database.Local) @@ -454,7 +464,8 @@ Public Class frmMain For Each de As DictionaryEntry In slRestoreData hshGames = mgrMonitorList.DoListGetbyName(de.Key) If hshGames.Count = 1 Then - hshRestore.Add(hshGames(0), de.Value) + oGame = DirectCast(hshGames(0), clsGame) + hshRestore.Add(oGame, de.Value) Else UpdateLog(mgrCommon.FormatString(frmMain_AutoRestoreFailure, de.Key), False, ToolTipIcon.Info, True) End If @@ -500,7 +511,7 @@ Public Class frmMain End If Try - fbBrowser.InitialDirectory = IO.Path.GetDirectoryName(oProcess.FoundProcess.MainModule.FileName) + fbBrowser.InitialDirectory = Path.GetDirectoryName(oProcess.FoundProcess.MainModule.FileName) Catch ex As Exception fbBrowser.InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments) End Try @@ -508,7 +519,7 @@ Public Class frmMain If fbBrowser.ShowDialog() = Windows.Forms.DialogResult.OK Then sIcon = fbBrowser.FileName - If IO.File.Exists(sIcon) Then + If File.Exists(sIcon) Then oProcess.GameInfo.Icon = sIcon pbIcon.Image = Image.FromFile(sIcon) mgrMonitorList.DoListUpdate(oProcess.GameInfo) @@ -599,7 +610,7 @@ Public Class frmMain End Try 'Check for a custom icon & details - If IO.File.Exists(oProcess.GameInfo.Icon) Then + If File.Exists(oProcess.GameInfo.Icon) Then pbIcon.Image = Image.FromFile(oProcess.GameInfo.Icon) End If If sFileName = String.Empty Then @@ -922,7 +933,7 @@ Public Class frmMain If oSettings.Sync Then oFileWatcher.Path = oSettings.BackupFolder oFileWatcher.Filter = "gbm.s3db" - oFileWatcher.NotifyFilter = IO.NotifyFilters.LastWrite + oFileWatcher.NotifyFilter = NotifyFilters.LastWrite End If End Sub @@ -1400,9 +1411,9 @@ Public Class frmMain Dim sSettingsRoot As String = Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData) & "/gbm" Dim sDBLocation As String = sSettingsRoot & "/gbm.s3db" - If Not IO.Directory.Exists(sSettingsRoot) Then + If Not Directory.Exists(sSettingsRoot) Then Try - IO.Directory.CreateDirectory(sSettingsRoot) + Directory.CreateDirectory(sSettingsRoot) Catch ex As Exception mgrCommon.ShowMessage(frmMain_ErrorSettingsFolder, ex.Message, MsgBoxStyle.Critical) bShutdown = True @@ -1410,7 +1421,7 @@ Public Class frmMain End Try End If - If Not IO.File.Exists(sDBLocation) Then bFirstRun = True + If Not File.Exists(sDBLocation) Then bFirstRun = True End Sub Private Sub VerifyDBVersion(ByVal iDB As mgrSQLite.Database) diff --git a/GBM/My Project/Resources.Designer.vb b/GBM/My Project/Resources.Designer.vb index 5c16fdb..953fedb 100644 --- a/GBM/My Project/Resources.Designer.vb +++ b/GBM/My Project/Resources.Designer.vb @@ -2302,7 +2302,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to The saved game folder for [PARAM] does not exist, the backup has been automatically marked as restored.. + ''' Looks up a localized string similar to The saved game folder for [PARAM] does not exist or could not be determined, the backup has been automatically marked as restored.. ''' Friend ReadOnly Property frmMain_AutoMark() As String Get @@ -3103,7 +3103,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to The saved game folder for [PARAM] does not exist, this backup has been skipped.. + ''' Looks up a localized string similar to The saved game folder for [PARAM] does not exist or could not be determined, this backup has been skipped.. ''' Friend ReadOnly Property frmMain_NoAutoMark() As String Get diff --git a/GBM/My Project/Resources.resx b/GBM/My Project/Resources.resx index da4ee40..a85abc6 100644 --- a/GBM/My Project/Resources.resx +++ b/GBM/My Project/Resources.resx @@ -1736,7 +1736,7 @@ Clean folder on restore - The saved game folder for [PARAM] does not exist, the backup has been automatically marked as restored. + The saved game folder for [PARAM] does not exist or could not be determined, the backup has been automatically marked as restored. The backup file for [PARAM] is not ready to restore. @@ -1760,7 +1760,7 @@ [PARAM] New Backup Restored - The saved game folder for [PARAM] does not exist, this backup has been skipped. + The saved game folder for [PARAM] does not exist or could not be determined, this backup has been skipped. The backup file for [PARAM] has no checksum, it cannot be automatically restored. From a490e6d1f2e80c89b8ade85a17edcda1605f6d21 Mon Sep 17 00:00:00 2001 From: MikeMaximus Date: Sun, 26 Feb 2017 15:48:48 -0600 Subject: [PATCH 11/16] Fixed timer problem with issue #67 --- GBM/Forms/frmMain.vb | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index e79afc7..ecec0c3 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -47,8 +47,10 @@ Public Class frmMain Private bProcessDebugMode As Boolean = False WithEvents oFileWatcher As New FileSystemWatcher + + 'Timers - There may only be one System.Windows.Forms.Timer and it must be tmScanTimer. WithEvents tmScanTimer As New Timer - WithEvents tmRestoreCheck As New Timer + WithEvents tmRestoreCheck As New System.Timers.Timer Public WithEvents oProcess As New mgrProcesses Public WithEvents oBackup As New mgrBackup @@ -368,7 +370,7 @@ Public Class frmMain Private Sub StartRestoreCheck() iRestoreTimeOut = -1 tmRestoreCheck.Interval = 60000 - tmRestoreCheck.Enabled = True + tmRestoreCheck.AutoReset = True tmRestoreCheck.Start() AutoRestoreCheck() End Sub @@ -389,7 +391,6 @@ Public Class frmMain 'Shut down the timer and bail out if there's nothing to do If slRestoreData.Count = 0 Then tmRestoreCheck.Stop() - tmRestoreCheck.Enabled = False Exit Sub End If @@ -484,13 +485,11 @@ Public Class frmMain 'Shutdown if we are finished If bFinished Then tmRestoreCheck.Stop() - tmRestoreCheck.Enabled = False End If 'Time out after 15 minutes If iRestoreTimeOut = 15 Then tmRestoreCheck.Stop() - tmRestoreCheck.Enabled = False End If End Sub @@ -1676,8 +1675,10 @@ Public Class frmMain End If End Sub - Private Sub AutoRestoreEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles tmRestoreCheck.Tick - AutoRestoreCheck() + Private Sub AutoRestoreEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles tmRestoreCheck.Elapsed + If eCurrentStatus <> eStatus.Paused Then + AutoRestoreCheck() + End If End Sub Private Sub ScanTimerEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles tmScanTimer.Tick From 6f3ed9ab819e4a4b6d4b8a7d3cdd5b94453472d8 Mon Sep 17 00:00:00 2001 From: MikeMaximus Date: Sun, 26 Feb 2017 16:01:44 -0600 Subject: [PATCH 12/16] Added build date and removed revision in About display --- GBM/Forms/frmMain.vb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index ecec0c3..503441f 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -810,7 +810,7 @@ Public Class frmMain Dim iProcessType As System.Reflection.ProcessorArchitecture = System.Reflection.AssemblyName.GetAssemblyName(Application.ExecutablePath()).ProcessorArchitecture Dim sVersion As String = My.Application.Info.Version.Major & "." & My.Application.Info.Version.Minor & "." & My.Application.Info.Version.Build Dim sProcessType = [Enum].GetName(GetType(System.Reflection.ProcessorArchitecture), iProcessType) - Dim sRevision As String = My.Application.Info.Version.Revision + Dim sRevision As String = File.GetLastWriteTime(Application.ExecutablePath).ToString Dim sConstCopyright As String = Chr(169) & mgrCommon.FormatString(App_Copyright, Now.Year.ToString) mgrCommon.ShowMessage(frmMain_About, New String() {sVersion, sProcessType, sRevision, sConstCopyright}, MsgBoxStyle.Information) From 3ae0d1ba82d605dad2443e532cb84c6327c62c86 Mon Sep 17 00:00:00 2001 From: MikeMaximus Date: Tue, 28 Feb 2017 14:42:35 -0600 Subject: [PATCH 13/16] Label changes in Game Manager --- GBM/My Project/Resources.Designer.vb | 4 ++-- GBM/My Project/Resources.resx | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/GBM/My Project/Resources.Designer.vb b/GBM/My Project/Resources.Designer.vb index 953fedb..55456e9 100644 --- a/GBM/My Project/Resources.Designer.vb +++ b/GBM/My Project/Resources.Designer.vb @@ -1294,7 +1294,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to Clean folder on restore. + ''' Looks up a localized string similar to Delete folder on restore. ''' Friend ReadOnly Property frmGameManager_chkCleanFolder() As String Get @@ -1951,7 +1951,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to New Saves Pending. + ''' Looks up a localized string similar to New Backups Pending. ''' Friend ReadOnly Property frmGameManager_optPendingRestores() As String Get diff --git a/GBM/My Project/Resources.resx b/GBM/My Project/Resources.resx index a85abc6..ea8ef15 100644 --- a/GBM/My Project/Resources.resx +++ b/GBM/My Project/Resources.resx @@ -659,7 +659,7 @@ Custom - New Saves Pending + New Backups Pending Out of Sync @@ -1733,7 +1733,7 @@ Unknown - Clean folder on restore + Delete folder on restore The saved game folder for [PARAM] does not exist or could not be determined, the backup has been automatically marked as restored. From 4e7eb5846390fd33561d767b504a0fe4f60ff085 Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Tue, 28 Feb 2017 15:41:57 -0600 Subject: [PATCH 14/16] More label updates --- GBM/Forms/frmGameManager.Designer.vb | 26 +-- GBM/Forms/frmSettings.Designer.vb | 271 +++++++++++---------------- GBM/My Project/Resources.Designer.vb | 4 +- GBM/My Project/Resources.resx | 4 +- 4 files changed, 130 insertions(+), 175 deletions(-) diff --git a/GBM/Forms/frmGameManager.Designer.vb b/GBM/Forms/frmGameManager.Designer.vb index 856fcac..8ed79ed 100644 --- a/GBM/Forms/frmGameManager.Designer.vb +++ b/GBM/Forms/frmGameManager.Designer.vb @@ -28,6 +28,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.chkCleanFolder = New System.Windows.Forms.CheckBox() Me.lblLimit = New System.Windows.Forms.Label() Me.nudLimit = New System.Windows.Forms.NumericUpDown() Me.btnExclude = New System.Windows.Forms.Button() @@ -95,7 +96,6 @@ Partial Class frmGameManager Me.cmsDeleteBackup = New System.Windows.Forms.ContextMenuStrip(Me.components) Me.cmsDeleteOne = New System.Windows.Forms.ToolStripMenuItem() Me.cmsDeleteAll = New System.Windows.Forms.ToolStripMenuItem() - Me.chkCleanFolder = New System.Windows.Forms.CheckBox() Me.grpConfig.SuspendLayout() CType(Me.nudLimit, System.ComponentModel.ISupportInitialize).BeginInit() Me.grpExtra.SuspendLayout() @@ -178,6 +178,16 @@ Partial Class frmGameManager Me.grpConfig.TabStop = False Me.grpConfig.Text = "Configuration" ' + 'chkCleanFolder + ' + Me.chkCleanFolder.AutoSize = True + Me.chkCleanFolder.Location = New System.Drawing.Point(329, 101) + Me.chkCleanFolder.Name = "chkCleanFolder" + Me.chkCleanFolder.Size = New System.Drawing.Size(136, 17) + Me.chkCleanFolder.TabIndex = 11 + Me.chkCleanFolder.Text = "Delete folder on restore" + Me.chkCleanFolder.UseVisualStyleBackColor = True + ' 'lblLimit ' Me.lblLimit.AutoSize = True @@ -720,10 +730,10 @@ Partial Class frmGameManager Me.optPendingRestores.AutoSize = True Me.optPendingRestores.Location = New System.Drawing.Point(6, 64) Me.optPendingRestores.Name = "optPendingRestores" - Me.optPendingRestores.Size = New System.Drawing.Size(122, 17) + Me.optPendingRestores.Size = New System.Drawing.Size(134, 17) Me.optPendingRestores.TabIndex = 2 Me.optPendingRestores.TabStop = True - Me.optPendingRestores.Text = "New Saves Pending" + Me.optPendingRestores.Text = "New Backups Pending" Me.optPendingRestores.UseVisualStyleBackColor = True ' 'optAllGames @@ -809,16 +819,6 @@ Partial Class frmGameManager Me.cmsDeleteAll.Size = New System.Drawing.Size(114, 22) Me.cmsDeleteAll.Text = "&All Files" ' - 'chkCleanFolder - ' - Me.chkCleanFolder.AutoSize = True - Me.chkCleanFolder.Location = New System.Drawing.Point(329, 101) - Me.chkCleanFolder.Name = "chkCleanFolder" - Me.chkCleanFolder.Size = New System.Drawing.Size(132, 17) - Me.chkCleanFolder.TabIndex = 11 - Me.chkCleanFolder.Text = "Clean folder on restore" - Me.chkCleanFolder.UseVisualStyleBackColor = True - ' 'frmGameManager ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) diff --git a/GBM/Forms/frmSettings.Designer.vb b/GBM/Forms/frmSettings.Designer.vb index c2ae984..70c342a 100644 --- a/GBM/Forms/frmSettings.Designer.vb +++ b/GBM/Forms/frmSettings.Designer.vb @@ -57,6 +57,8 @@ Partial Class frmSettings Me.chkCheckSum = New System.Windows.Forms.CheckBox() Me.chkOverwriteWarning = New System.Windows.Forms.CheckBox() Me.grpBackupHandling = New System.Windows.Forms.GroupBox() + Me.chkAutoRestore = New System.Windows.Forms.CheckBox() + Me.chkRestoreNotify = New System.Windows.Forms.CheckBox() Me.chkAutoMark = New System.Windows.Forms.CheckBox() Me.pnl7z = New System.Windows.Forms.Panel() Me.grp7zAdvanced = New System.Windows.Forms.GroupBox() @@ -64,8 +66,6 @@ Partial Class frmSettings Me.pnlGeneral = New System.Windows.Forms.Panel() Me.grpGameData = New System.Windows.Forms.GroupBox() Me.lstSettings = New System.Windows.Forms.ListBox() - Me.chkRestoreNotify = New System.Windows.Forms.CheckBox() - Me.chkAutoRestore = New System.Windows.Forms.CheckBox() Me.grpStartup.SuspendLayout() Me.grpFolderOptions.SuspendLayout() Me.grp7zGeneral.SuspendLayout() @@ -82,10 +82,9 @@ Partial Class frmSettings 'chkMonitorOnStartup ' Me.chkMonitorOnStartup.AutoSize = True - Me.chkMonitorOnStartup.Location = New System.Drawing.Point(8, 80) - Me.chkMonitorOnStartup.Margin = New System.Windows.Forms.Padding(4) + Me.chkMonitorOnStartup.Location = New System.Drawing.Point(6, 65) Me.chkMonitorOnStartup.Name = "chkMonitorOnStartup" - Me.chkMonitorOnStartup.Size = New System.Drawing.Size(192, 21) + Me.chkMonitorOnStartup.Size = New System.Drawing.Size(146, 17) Me.chkMonitorOnStartup.TabIndex = 2 Me.chkMonitorOnStartup.Text = "Start monitoring at launch" Me.chkMonitorOnStartup.UseVisualStyleBackColor = True @@ -95,11 +94,9 @@ Partial Class frmSettings Me.grpStartup.Controls.Add(Me.chkStartWindows) Me.grpStartup.Controls.Add(Me.chkStartToTray) Me.grpStartup.Controls.Add(Me.chkMonitorOnStartup) - Me.grpStartup.Location = New System.Drawing.Point(8, 15) - Me.grpStartup.Margin = New System.Windows.Forms.Padding(4) + Me.grpStartup.Location = New System.Drawing.Point(6, 12) Me.grpStartup.Name = "grpStartup" - Me.grpStartup.Padding = New System.Windows.Forms.Padding(4) - Me.grpStartup.Size = New System.Drawing.Size(472, 111) + Me.grpStartup.Size = New System.Drawing.Size(354, 90) Me.grpStartup.TabIndex = 0 Me.grpStartup.TabStop = False Me.grpStartup.Text = "Startup" @@ -107,10 +104,9 @@ Partial Class frmSettings 'chkStartWindows ' Me.chkStartWindows.AutoSize = True - Me.chkStartWindows.Location = New System.Drawing.Point(8, 23) - Me.chkStartWindows.Margin = New System.Windows.Forms.Padding(4) + Me.chkStartWindows.Location = New System.Drawing.Point(6, 19) Me.chkStartWindows.Name = "chkStartWindows" - Me.chkStartWindows.Size = New System.Drawing.Size(148, 21) + Me.chkStartWindows.Size = New System.Drawing.Size(117, 17) Me.chkStartWindows.TabIndex = 0 Me.chkStartWindows.Text = "Start with Windows" Me.chkStartWindows.UseVisualStyleBackColor = True @@ -118,10 +114,9 @@ Partial Class frmSettings 'chkStartToTray ' Me.chkStartToTray.AutoSize = True - Me.chkStartToTray.Location = New System.Drawing.Point(8, 52) - Me.chkStartToTray.Margin = New System.Windows.Forms.Padding(4) + Me.chkStartToTray.Location = New System.Drawing.Point(6, 42) Me.chkStartToTray.Name = "chkStartToTray" - Me.chkStartToTray.Size = New System.Drawing.Size(152, 21) + Me.chkStartToTray.Size = New System.Drawing.Size(115, 17) Me.chkStartToTray.TabIndex = 1 Me.chkStartToTray.Text = "Start to system tray" Me.chkStartToTray.UseVisualStyleBackColor = True @@ -129,20 +124,18 @@ Partial Class frmSettings 'chkAutoSaveLog ' Me.chkAutoSaveLog.AutoSize = True - Me.chkAutoSaveLog.Location = New System.Drawing.Point(8, 251) - Me.chkAutoSaveLog.Margin = New System.Windows.Forms.Padding(4) + Me.chkAutoSaveLog.Location = New System.Drawing.Point(6, 204) Me.chkAutoSaveLog.Name = "chkAutoSaveLog" - Me.chkAutoSaveLog.Size = New System.Drawing.Size(300, 21) + Me.chkAutoSaveLog.Size = New System.Drawing.Size(231, 17) Me.chkAutoSaveLog.TabIndex = 7 Me.chkAutoSaveLog.Text = "Autosave log when max length is exceeded" Me.chkAutoSaveLog.UseVisualStyleBackColor = True ' 'btnOptionalFields ' - Me.btnOptionalFields.Location = New System.Drawing.Point(147, 47) - Me.btnOptionalFields.Margin = New System.Windows.Forms.Padding(4) + Me.btnOptionalFields.Location = New System.Drawing.Point(110, 38) Me.btnOptionalFields.Name = "btnOptionalFields" - Me.btnOptionalFields.Size = New System.Drawing.Size(179, 28) + Me.btnOptionalFields.Size = New System.Drawing.Size(134, 23) Me.btnOptionalFields.TabIndex = 6 Me.btnOptionalFields.Text = "Choose &Optional Fields..." Me.btnOptionalFields.UseVisualStyleBackColor = True @@ -150,10 +143,9 @@ Partial Class frmSettings 'chkTimeTracking ' Me.chkTimeTracking.AutoSize = True - Me.chkTimeTracking.Location = New System.Drawing.Point(8, 23) - Me.chkTimeTracking.Margin = New System.Windows.Forms.Padding(4) + Me.chkTimeTracking.Location = New System.Drawing.Point(6, 19) Me.chkTimeTracking.Name = "chkTimeTracking" - Me.chkTimeTracking.Size = New System.Drawing.Size(158, 21) + Me.chkTimeTracking.Size = New System.Drawing.Size(122, 17) Me.chkTimeTracking.TabIndex = 4 Me.chkTimeTracking.Text = "Enable time tracking" Me.chkTimeTracking.UseVisualStyleBackColor = True @@ -161,10 +153,9 @@ Partial Class frmSettings 'chkSync ' Me.chkSync.AutoSize = True - Me.chkSync.Location = New System.Drawing.Point(8, 52) - Me.chkSync.Margin = New System.Windows.Forms.Padding(4) + Me.chkSync.Location = New System.Drawing.Point(6, 42) Me.chkSync.Name = "chkSync" - Me.chkSync.Size = New System.Drawing.Size(126, 21) + Me.chkSync.Size = New System.Drawing.Size(98, 17) Me.chkSync.TabIndex = 5 Me.chkSync.Text = "Enable syncing" Me.chkSync.UseVisualStyleBackColor = True @@ -172,10 +163,9 @@ Partial Class frmSettings 'chkShowDetectionTips ' Me.chkShowDetectionTips.AutoSize = True - Me.chkShowDetectionTips.Location = New System.Drawing.Point(8, 223) - Me.chkShowDetectionTips.Margin = New System.Windows.Forms.Padding(4) + Me.chkShowDetectionTips.Location = New System.Drawing.Point(6, 181) Me.chkShowDetectionTips.Name = "chkShowDetectionTips" - Me.chkShowDetectionTips.Size = New System.Drawing.Size(205, 21) + Me.chkShowDetectionTips.Size = New System.Drawing.Size(159, 17) Me.chkShowDetectionTips.TabIndex = 3 Me.chkShowDetectionTips.Text = "Show detection notifications" Me.chkShowDetectionTips.UseVisualStyleBackColor = True @@ -186,21 +176,18 @@ Partial Class frmSettings Me.grpFolderOptions.Controls.Add(Me.lblBackupFolder) Me.grpFolderOptions.Controls.Add(Me.txtBackupFolder) Me.grpFolderOptions.Controls.Add(Me.chkCreateFolder) - Me.grpFolderOptions.Location = New System.Drawing.Point(8, 15) - Me.grpFolderOptions.Margin = New System.Windows.Forms.Padding(4) + Me.grpFolderOptions.Location = New System.Drawing.Point(6, 12) Me.grpFolderOptions.Name = "grpFolderOptions" - Me.grpFolderOptions.Padding = New System.Windows.Forms.Padding(4) - Me.grpFolderOptions.Size = New System.Drawing.Size(472, 86) + Me.grpFolderOptions.Size = New System.Drawing.Size(354, 70) Me.grpFolderOptions.TabIndex = 1 Me.grpFolderOptions.TabStop = False Me.grpFolderOptions.Text = "Folders" ' 'btnBackupFolder ' - Me.btnBackupFolder.Location = New System.Drawing.Point(417, 21) - Me.btnBackupFolder.Margin = New System.Windows.Forms.Padding(4) + Me.btnBackupFolder.Location = New System.Drawing.Point(313, 17) Me.btnBackupFolder.Name = "btnBackupFolder" - Me.btnBackupFolder.Size = New System.Drawing.Size(36, 25) + Me.btnBackupFolder.Size = New System.Drawing.Size(27, 20) Me.btnBackupFolder.TabIndex = 2 Me.btnBackupFolder.Text = "..." Me.btnBackupFolder.UseVisualStyleBackColor = True @@ -208,28 +195,25 @@ Partial Class frmSettings 'lblBackupFolder ' Me.lblBackupFolder.AutoSize = True - Me.lblBackupFolder.Location = New System.Drawing.Point(8, 25) - Me.lblBackupFolder.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblBackupFolder.Location = New System.Drawing.Point(6, 20) Me.lblBackupFolder.Name = "lblBackupFolder" - Me.lblBackupFolder.Size = New System.Drawing.Size(103, 17) + Me.lblBackupFolder.Size = New System.Drawing.Size(79, 13) Me.lblBackupFolder.TabIndex = 0 Me.lblBackupFolder.Text = "Backup Folder:" ' 'txtBackupFolder ' - Me.txtBackupFolder.Location = New System.Drawing.Point(121, 21) - Me.txtBackupFolder.Margin = New System.Windows.Forms.Padding(4) + Me.txtBackupFolder.Location = New System.Drawing.Point(91, 17) Me.txtBackupFolder.Name = "txtBackupFolder" - Me.txtBackupFolder.Size = New System.Drawing.Size(287, 22) + Me.txtBackupFolder.Size = New System.Drawing.Size(216, 20) Me.txtBackupFolder.TabIndex = 1 ' 'chkCreateFolder ' Me.chkCreateFolder.AutoSize = True - Me.chkCreateFolder.Location = New System.Drawing.Point(12, 53) - Me.chkCreateFolder.Margin = New System.Windows.Forms.Padding(4) + Me.chkCreateFolder.Location = New System.Drawing.Point(9, 43) Me.chkCreateFolder.Name = "chkCreateFolder" - Me.chkCreateFolder.Size = New System.Drawing.Size(247, 21) + Me.chkCreateFolder.Size = New System.Drawing.Size(186, 17) Me.chkCreateFolder.TabIndex = 3 Me.chkCreateFolder.Text = "Create a sub-folder for each game" Me.chkCreateFolder.UseVisualStyleBackColor = True @@ -237,10 +221,9 @@ Partial Class frmSettings 'btnSave ' Me.btnSave.DialogResult = System.Windows.Forms.DialogResult.OK - Me.btnSave.Location = New System.Drawing.Point(512, 395) - Me.btnSave.Margin = New System.Windows.Forms.Padding(4) + Me.btnSave.Location = New System.Drawing.Point(384, 321) Me.btnSave.Name = "btnSave" - Me.btnSave.Size = New System.Drawing.Size(100, 28) + Me.btnSave.Size = New System.Drawing.Size(75, 23) Me.btnSave.TabIndex = 5 Me.btnSave.Text = "&Save" Me.btnSave.UseVisualStyleBackColor = True @@ -248,10 +231,9 @@ Partial Class frmSettings 'btnCancel ' Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(620, 395) - Me.btnCancel.Margin = New System.Windows.Forms.Padding(4) + Me.btnCancel.Location = New System.Drawing.Point(465, 321) Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(100, 28) + Me.btnCancel.Size = New System.Drawing.Size(75, 23) Me.btnCancel.TabIndex = 6 Me.btnCancel.Text = "&Cancel" Me.btnCancel.UseVisualStyleBackColor = True @@ -260,11 +242,9 @@ Partial Class frmSettings ' Me.grp7zGeneral.Controls.Add(Me.cboCompression) Me.grp7zGeneral.Controls.Add(Me.lblCompression) - Me.grp7zGeneral.Location = New System.Drawing.Point(8, 15) - Me.grp7zGeneral.Margin = New System.Windows.Forms.Padding(4) + Me.grp7zGeneral.Location = New System.Drawing.Point(6, 12) Me.grp7zGeneral.Name = "grp7zGeneral" - Me.grp7zGeneral.Padding = New System.Windows.Forms.Padding(4) - Me.grp7zGeneral.Size = New System.Drawing.Size(472, 62) + Me.grp7zGeneral.Size = New System.Drawing.Size(354, 50) Me.grp7zGeneral.TabIndex = 0 Me.grp7zGeneral.TabStop = False Me.grp7zGeneral.Text = "General" @@ -273,94 +253,84 @@ Partial Class frmSettings ' Me.cboCompression.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cboCompression.FormattingEnabled = True - Me.cboCompression.Location = New System.Drawing.Point(147, 21) - Me.cboCompression.Margin = New System.Windows.Forms.Padding(4) + Me.cboCompression.Location = New System.Drawing.Point(110, 17) Me.cboCompression.Name = "cboCompression" - Me.cboCompression.Size = New System.Drawing.Size(316, 24) + Me.cboCompression.Size = New System.Drawing.Size(238, 21) Me.cboCompression.TabIndex = 1 ' 'lblCompression ' Me.lblCompression.AutoSize = True - Me.lblCompression.Location = New System.Drawing.Point(8, 25) - Me.lblCompression.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblCompression.Location = New System.Drawing.Point(6, 20) Me.lblCompression.Name = "lblCompression" - Me.lblCompression.Size = New System.Drawing.Size(94, 17) + Me.lblCompression.Size = New System.Drawing.Size(70, 13) Me.lblCompression.TabIndex = 0 Me.lblCompression.Text = "Compression:" ' 'btn7zLocation ' - Me.btn7zLocation.Location = New System.Drawing.Point(417, 50) - Me.btn7zLocation.Margin = New System.Windows.Forms.Padding(4) + Me.btn7zLocation.Location = New System.Drawing.Point(313, 41) Me.btn7zLocation.Name = "btn7zLocation" - Me.btn7zLocation.Size = New System.Drawing.Size(36, 25) + Me.btn7zLocation.Size = New System.Drawing.Size(27, 20) Me.btn7zLocation.TabIndex = 5 Me.btn7zLocation.Text = "..." Me.btn7zLocation.UseVisualStyleBackColor = True ' 'txt7zLocation ' - Me.txt7zLocation.Location = New System.Drawing.Point(147, 50) - Me.txt7zLocation.Margin = New System.Windows.Forms.Padding(4) + Me.txt7zLocation.Location = New System.Drawing.Point(110, 41) Me.txt7zLocation.Name = "txt7zLocation" - Me.txt7zLocation.Size = New System.Drawing.Size(261, 22) + Me.txt7zLocation.Size = New System.Drawing.Size(197, 20) Me.txt7zLocation.TabIndex = 4 ' 'lblLocation ' Me.lblLocation.AutoSize = True - Me.lblLocation.Location = New System.Drawing.Point(8, 54) - Me.lblLocation.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblLocation.Location = New System.Drawing.Point(6, 44) Me.lblLocation.Name = "lblLocation" - Me.lblLocation.Size = New System.Drawing.Size(117, 17) + Me.lblLocation.Size = New System.Drawing.Size(89, 13) Me.lblLocation.TabIndex = 4 Me.lblLocation.Text = "Custom Location:" ' 'txt7zArguments ' - Me.txt7zArguments.Location = New System.Drawing.Point(147, 18) - Me.txt7zArguments.Margin = New System.Windows.Forms.Padding(4) + Me.txt7zArguments.Location = New System.Drawing.Point(110, 15) Me.txt7zArguments.Name = "txt7zArguments" - Me.txt7zArguments.Size = New System.Drawing.Size(316, 22) + Me.txt7zArguments.Size = New System.Drawing.Size(238, 20) Me.txt7zArguments.TabIndex = 3 ' 'lblArguments ' Me.lblArguments.AutoSize = True - Me.lblArguments.Location = New System.Drawing.Point(8, 25) - Me.lblArguments.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblArguments.Location = New System.Drawing.Point(6, 20) Me.lblArguments.Name = "lblArguments" - Me.lblArguments.Size = New System.Drawing.Size(131, 17) + Me.lblArguments.Size = New System.Drawing.Size(98, 13) Me.lblArguments.TabIndex = 2 Me.lblArguments.Text = "Custom Arguments:" ' 'lbl7zCopyright ' Me.lbl7zCopyright.AutoEllipsis = True - Me.lbl7zCopyright.Location = New System.Drawing.Point(12, 42) - Me.lbl7zCopyright.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lbl7zCopyright.Location = New System.Drawing.Point(9, 34) Me.lbl7zCopyright.Name = "lbl7zCopyright" - Me.lbl7zCopyright.Size = New System.Drawing.Size(452, 21) + Me.lbl7zCopyright.Size = New System.Drawing.Size(339, 17) Me.lbl7zCopyright.TabIndex = 8 Me.lbl7zCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' 'lbl7zProduct ' Me.lbl7zProduct.AutoEllipsis = True - Me.lbl7zProduct.Location = New System.Drawing.Point(12, 21) - Me.lbl7zProduct.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lbl7zProduct.Location = New System.Drawing.Point(9, 17) Me.lbl7zProduct.Name = "lbl7zProduct" - Me.lbl7zProduct.Size = New System.Drawing.Size(452, 21) + Me.lbl7zProduct.Size = New System.Drawing.Size(339, 17) Me.lbl7zProduct.TabIndex = 7 Me.lbl7zProduct.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' 'btnDefaults ' - Me.btnDefaults.Location = New System.Drawing.Point(16, 395) - Me.btnDefaults.Margin = New System.Windows.Forms.Padding(4) + Me.btnDefaults.Location = New System.Drawing.Point(12, 321) Me.btnDefaults.Name = "btnDefaults" - Me.btnDefaults.Size = New System.Drawing.Size(147, 28) + Me.btnDefaults.Size = New System.Drawing.Size(110, 23) Me.btnDefaults.TabIndex = 4 Me.btnDefaults.Text = "Set &Defaults" Me.btnDefaults.UseVisualStyleBackColor = True @@ -375,38 +345,34 @@ Partial Class frmSettings Me.pnlBackup.Controls.Add(Me.chkOverwriteWarning) Me.pnlBackup.Controls.Add(Me.grpBackupHandling) Me.pnlBackup.Controls.Add(Me.grpFolderOptions) - Me.pnlBackup.Location = New System.Drawing.Point(240, 0) - Me.pnlBackup.Margin = New System.Windows.Forms.Padding(4) + Me.pnlBackup.Location = New System.Drawing.Point(180, 0) Me.pnlBackup.Name = "pnlBackup" - Me.pnlBackup.Size = New System.Drawing.Size(489, 386) + Me.pnlBackup.Size = New System.Drawing.Size(367, 314) Me.pnlBackup.TabIndex = 3 ' 'lblMinutes ' Me.lblMinutes.AutoSize = True - Me.lblMinutes.Location = New System.Drawing.Point(381, 309) - Me.lblMinutes.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) + Me.lblMinutes.Location = New System.Drawing.Point(286, 251) Me.lblMinutes.Name = "lblMinutes" - Me.lblMinutes.Size = New System.Drawing.Size(57, 17) + Me.lblMinutes.Size = New System.Drawing.Size(43, 13) Me.lblMinutes.TabIndex = 14 Me.lblMinutes.Text = "minutes" ' 'nudSupressBackupThreshold ' - Me.nudSupressBackupThreshold.Location = New System.Drawing.Point(305, 306) - Me.nudSupressBackupThreshold.Margin = New System.Windows.Forms.Padding(4) + Me.nudSupressBackupThreshold.Location = New System.Drawing.Point(229, 249) Me.nudSupressBackupThreshold.Maximum = New Decimal(New Integer() {999, 0, 0, 0}) Me.nudSupressBackupThreshold.Name = "nudSupressBackupThreshold" - Me.nudSupressBackupThreshold.Size = New System.Drawing.Size(68, 22) + Me.nudSupressBackupThreshold.Size = New System.Drawing.Size(51, 20) Me.nudSupressBackupThreshold.TabIndex = 13 ' 'chkSupressBackup ' Me.chkSupressBackup.AutoSize = True - Me.chkSupressBackup.Location = New System.Drawing.Point(8, 308) - Me.chkSupressBackup.Margin = New System.Windows.Forms.Padding(4) + Me.chkSupressBackup.Location = New System.Drawing.Point(6, 250) Me.chkSupressBackup.Name = "chkSupressBackup" - Me.chkSupressBackup.Size = New System.Drawing.Size(282, 21) + Me.chkSupressBackup.Size = New System.Drawing.Size(217, 17) Me.chkSupressBackup.TabIndex = 12 Me.chkSupressBackup.Text = "Backup only when session time exceeds" Me.chkSupressBackup.UseVisualStyleBackColor = True @@ -414,10 +380,9 @@ Partial Class frmSettings 'chkBackupConfirm ' Me.chkBackupConfirm.AutoSize = True - Me.chkBackupConfirm.Location = New System.Drawing.Point(8, 222) - Me.chkBackupConfirm.Margin = New System.Windows.Forms.Padding(4) + Me.chkBackupConfirm.Location = New System.Drawing.Point(6, 180) Me.chkBackupConfirm.Name = "chkBackupConfirm" - Me.chkBackupConfirm.Size = New System.Drawing.Size(208, 21) + Me.chkBackupConfirm.Size = New System.Drawing.Size(160, 17) Me.chkBackupConfirm.TabIndex = 9 Me.chkBackupConfirm.Text = "Disable backup confirmation" Me.chkBackupConfirm.UseVisualStyleBackColor = True @@ -425,10 +390,9 @@ Partial Class frmSettings 'chkCheckSum ' Me.chkCheckSum.AutoSize = True - Me.chkCheckSum.Location = New System.Drawing.Point(8, 279) - Me.chkCheckSum.Margin = New System.Windows.Forms.Padding(4) + Me.chkCheckSum.Location = New System.Drawing.Point(6, 227) Me.chkCheckSum.Name = "chkCheckSum" - Me.chkCheckSum.Size = New System.Drawing.Size(252, 21) + Me.chkCheckSum.Size = New System.Drawing.Size(195, 17) Me.chkCheckSum.TabIndex = 11 Me.chkCheckSum.Text = "Verify backup files with a checksum" Me.chkCheckSum.UseVisualStyleBackColor = True @@ -436,10 +400,9 @@ Partial Class frmSettings 'chkOverwriteWarning ' Me.chkOverwriteWarning.AutoSize = True - Me.chkOverwriteWarning.Location = New System.Drawing.Point(8, 251) - Me.chkOverwriteWarning.Margin = New System.Windows.Forms.Padding(4) + Me.chkOverwriteWarning.Location = New System.Drawing.Point(6, 204) Me.chkOverwriteWarning.Name = "chkOverwriteWarning" - Me.chkOverwriteWarning.Size = New System.Drawing.Size(178, 21) + Me.chkOverwriteWarning.Size = New System.Drawing.Size(139, 17) Me.chkOverwriteWarning.TabIndex = 10 Me.chkOverwriteWarning.Text = "Show overwrite warning" Me.chkOverwriteWarning.UseVisualStyleBackColor = True @@ -449,22 +412,45 @@ Partial Class frmSettings Me.grpBackupHandling.Controls.Add(Me.chkAutoRestore) Me.grpBackupHandling.Controls.Add(Me.chkRestoreNotify) Me.grpBackupHandling.Controls.Add(Me.chkAutoMark) - Me.grpBackupHandling.Location = New System.Drawing.Point(8, 108) + Me.grpBackupHandling.Location = New System.Drawing.Point(6, 88) + Me.grpBackupHandling.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) Me.grpBackupHandling.Name = "grpBackupHandling" - Me.grpBackupHandling.Size = New System.Drawing.Size(472, 107) + Me.grpBackupHandling.Padding = New System.Windows.Forms.Padding(2, 2, 2, 2) + Me.grpBackupHandling.Size = New System.Drawing.Size(354, 87) Me.grpBackupHandling.TabIndex = 8 Me.grpBackupHandling.TabStop = False Me.grpBackupHandling.Text = "Backup Handling" ' + 'chkAutoRestore + ' + Me.chkAutoRestore.AutoSize = True + Me.chkAutoRestore.Location = New System.Drawing.Point(8, 41) + Me.chkAutoRestore.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) + Me.chkAutoRestore.Name = "chkAutoRestore" + Me.chkAutoRestore.Size = New System.Drawing.Size(190, 17) + Me.chkAutoRestore.TabIndex = 9 + Me.chkAutoRestore.Text = "Automatically restore new backups" + Me.chkAutoRestore.UseVisualStyleBackColor = True + ' + 'chkRestoreNotify + ' + Me.chkRestoreNotify.AutoSize = True + Me.chkRestoreNotify.Location = New System.Drawing.Point(8, 19) + Me.chkRestoreNotify.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) + Me.chkRestoreNotify.Name = "chkRestoreNotify" + Me.chkRestoreNotify.Size = New System.Drawing.Size(216, 17) + Me.chkRestoreNotify.TabIndex = 8 + Me.chkRestoreNotify.Text = "Display notifications about new backups" + Me.chkRestoreNotify.UseVisualStyleBackColor = True + ' 'chkAutoMark ' Me.chkAutoMark.AutoSize = True - Me.chkAutoMark.Location = New System.Drawing.Point(11, 78) - Me.chkAutoMark.Margin = New System.Windows.Forms.Padding(4) + Me.chkAutoMark.Location = New System.Drawing.Point(8, 63) Me.chkAutoMark.Name = "chkAutoMark" - Me.chkAutoMark.Size = New System.Drawing.Size(395, 21) + Me.chkAutoMark.Size = New System.Drawing.Size(321, 17) Me.chkAutoMark.TabIndex = 5 - Me.chkAutoMark.Text = "Automatically mark backups as restored when appropriate" + Me.chkAutoMark.Text = "Automatically mark new backups as restored when appropriate" Me.chkAutoMark.UseVisualStyleBackColor = True ' 'pnl7z @@ -472,10 +458,9 @@ Partial Class frmSettings Me.pnl7z.Controls.Add(Me.grp7zAdvanced) Me.pnl7z.Controls.Add(Me.grp7zInformation) Me.pnl7z.Controls.Add(Me.grp7zGeneral) - Me.pnl7z.Location = New System.Drawing.Point(240, 0) - Me.pnl7z.Margin = New System.Windows.Forms.Padding(4) + Me.pnl7z.Location = New System.Drawing.Point(180, 0) Me.pnl7z.Name = "pnl7z" - Me.pnl7z.Size = New System.Drawing.Size(489, 386) + Me.pnl7z.Size = New System.Drawing.Size(367, 314) Me.pnl7z.TabIndex = 2 ' 'grp7zAdvanced @@ -485,11 +470,9 @@ Partial Class frmSettings Me.grp7zAdvanced.Controls.Add(Me.txt7zLocation) Me.grp7zAdvanced.Controls.Add(Me.txt7zArguments) Me.grp7zAdvanced.Controls.Add(Me.lblLocation) - Me.grp7zAdvanced.Location = New System.Drawing.Point(8, 84) - Me.grp7zAdvanced.Margin = New System.Windows.Forms.Padding(4) + Me.grp7zAdvanced.Location = New System.Drawing.Point(6, 68) Me.grp7zAdvanced.Name = "grp7zAdvanced" - Me.grp7zAdvanced.Padding = New System.Windows.Forms.Padding(4) - Me.grp7zAdvanced.Size = New System.Drawing.Size(472, 90) + Me.grp7zAdvanced.Size = New System.Drawing.Size(354, 73) Me.grp7zAdvanced.TabIndex = 2 Me.grp7zAdvanced.TabStop = False Me.grp7zAdvanced.Text = "Advanced" @@ -498,11 +481,9 @@ Partial Class frmSettings ' Me.grp7zInformation.Controls.Add(Me.lbl7zProduct) Me.grp7zInformation.Controls.Add(Me.lbl7zCopyright) - Me.grp7zInformation.Location = New System.Drawing.Point(8, 180) - Me.grp7zInformation.Margin = New System.Windows.Forms.Padding(4) + Me.grp7zInformation.Location = New System.Drawing.Point(6, 146) Me.grp7zInformation.Name = "grp7zInformation" - Me.grp7zInformation.Padding = New System.Windows.Forms.Padding(4) - Me.grp7zInformation.Size = New System.Drawing.Size(472, 78) + Me.grp7zInformation.Size = New System.Drawing.Size(354, 63) Me.grp7zInformation.TabIndex = 1 Me.grp7zInformation.TabStop = False Me.grp7zInformation.Text = "Utility Information" @@ -513,10 +494,9 @@ Partial Class frmSettings Me.pnlGeneral.Controls.Add(Me.grpGameData) Me.pnlGeneral.Controls.Add(Me.chkShowDetectionTips) Me.pnlGeneral.Controls.Add(Me.grpStartup) - Me.pnlGeneral.Location = New System.Drawing.Point(240, 0) - Me.pnlGeneral.Margin = New System.Windows.Forms.Padding(4) + Me.pnlGeneral.Location = New System.Drawing.Point(180, 0) Me.pnlGeneral.Name = "pnlGeneral" - Me.pnlGeneral.Size = New System.Drawing.Size(489, 386) + Me.pnlGeneral.Size = New System.Drawing.Size(367, 314) Me.pnlGeneral.TabIndex = 1 ' 'grpGameData @@ -524,11 +504,9 @@ Partial Class frmSettings Me.grpGameData.Controls.Add(Me.chkTimeTracking) Me.grpGameData.Controls.Add(Me.chkSync) Me.grpGameData.Controls.Add(Me.btnOptionalFields) - Me.grpGameData.Location = New System.Drawing.Point(8, 130) - Me.grpGameData.Margin = New System.Windows.Forms.Padding(4) + Me.grpGameData.Location = New System.Drawing.Point(6, 106) Me.grpGameData.Name = "grpGameData" - Me.grpGameData.Padding = New System.Windows.Forms.Padding(4) - Me.grpGameData.Size = New System.Drawing.Size(472, 85) + Me.grpGameData.Size = New System.Drawing.Size(354, 69) Me.grpGameData.TabIndex = 1 Me.grpGameData.TabStop = False Me.grpGameData.Text = "Game Data" @@ -536,38 +514,16 @@ Partial Class frmSettings 'lstSettings ' Me.lstSettings.FormattingEnabled = True - Me.lstSettings.ItemHeight = 16 - Me.lstSettings.Location = New System.Drawing.Point(16, 15) - Me.lstSettings.Margin = New System.Windows.Forms.Padding(4) + Me.lstSettings.Location = New System.Drawing.Point(12, 12) Me.lstSettings.Name = "lstSettings" - Me.lstSettings.Size = New System.Drawing.Size(215, 372) + Me.lstSettings.Size = New System.Drawing.Size(162, 303) Me.lstSettings.TabIndex = 0 ' - 'chkRestoreNotify - ' - Me.chkRestoreNotify.AutoSize = True - Me.chkRestoreNotify.Location = New System.Drawing.Point(11, 23) - Me.chkRestoreNotify.Name = "chkRestoreNotify" - Me.chkRestoreNotify.Size = New System.Drawing.Size(257, 21) - Me.chkRestoreNotify.TabIndex = 8 - Me.chkRestoreNotify.Text = "Notify about new backups to restore" - Me.chkRestoreNotify.UseVisualStyleBackColor = True - ' - 'chkAutoRestore - ' - Me.chkAutoRestore.AutoSize = True - Me.chkAutoRestore.Location = New System.Drawing.Point(11, 50) - Me.chkAutoRestore.Name = "chkAutoRestore" - Me.chkAutoRestore.Size = New System.Drawing.Size(248, 21) - Me.chkAutoRestore.TabIndex = 9 - Me.chkAutoRestore.Text = "Automatically restore new backups" - Me.chkAutoRestore.UseVisualStyleBackColor = True - ' 'frmSettings ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(739, 444) + Me.ClientSize = New System.Drawing.Size(554, 361) Me.Controls.Add(Me.pnlBackup) Me.Controls.Add(Me.lstSettings) Me.Controls.Add(Me.btnDefaults) @@ -576,7 +532,6 @@ Partial Class frmSettings Me.Controls.Add(Me.pnlGeneral) Me.Controls.Add(Me.pnl7z) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle - Me.Margin = New System.Windows.Forms.Padding(4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "frmSettings" diff --git a/GBM/My Project/Resources.Designer.vb b/GBM/My Project/Resources.Designer.vb index 55456e9..571a768 100644 --- a/GBM/My Project/Resources.Designer.vb +++ b/GBM/My Project/Resources.Designer.vb @@ -3418,7 +3418,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to Automatically mark backups as restored when appropriate. + ''' Looks up a localized string similar to Automatically mark new backups as restored when appropriate. ''' Friend ReadOnly Property frmSettings_chkAutoMark() As String Get @@ -3490,7 +3490,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to Notify about new backups to restore. + ''' Looks up a localized string similar to Display notifications about new backups. ''' Friend ReadOnly Property frmSettings_chkRestoreNotify() As String Get diff --git a/GBM/My Project/Resources.resx b/GBM/My Project/Resources.resx index ea8ef15..4d31c70 100644 --- a/GBM/My Project/Resources.resx +++ b/GBM/My Project/Resources.resx @@ -1088,7 +1088,7 @@ Show overwrite warning - Notify about new backups to restore + Display notifications about new backups Show detection notifications @@ -1742,7 +1742,7 @@ The backup file for [PARAM] is not ready to restore. - Automatically mark backups as restored when appropriate + Automatically mark new backups as restored when appropriate Backup Handling From 24e1c4b92fde3eddc3b9649a47cb58b16e6fcdd3 Mon Sep 17 00:00:00 2001 From: MikeMaximus Date: Thu, 9 Mar 2017 14:46:07 -0600 Subject: [PATCH 15/16] Changes for issue #71 --- GBM/Forms/frmMain.vb | 160 ++++++++--------- GBM/Forms/frmSettings.Designer.vb | 245 +++++++++++++++------------ GBM/Forms/frmSettings.vb | 10 -- GBM/Managers/mgrBackup.vb | 8 +- GBM/Managers/mgrRestore.vb | 23 ++- GBM/Managers/mgrSQLite.vb | 17 +- GBM/Managers/mgrSettings.vb | 14 +- GBM/My Project/Resources.Designer.vb | 9 - GBM/My Project/Resources.resx | 3 - 9 files changed, 252 insertions(+), 237 deletions(-) diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index 503441f..cd10986 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -394,84 +394,96 @@ Public Class frmMain Exit Sub End If - 'Increment Timer - iRestoreTimeOut += 1 + If oSettings.AutoMark Or oSettings.AutoRestore Then + 'Increment Timer + iRestoreTimeOut += 1 - 'Check backup files - For Each de As DictionaryEntry In slRestoreData - oBackup = DirectCast(de.Value, clsBackup) + 'Check backup files + For Each de As DictionaryEntry In slRestoreData + oBackup = DirectCast(de.Value, clsBackup) - 'Check if backup file is ready to restore - If oBackup.CheckSum <> String.Empty Then - sFileName = oSettings.BackupFolder & Path.DirectorySeparatorChar & oBackup.FileName - If mgrHash.Generate_SHA256_Hash(sFileName) <> oBackup.CheckSum Then - sNotReady.Add(de.Key) - bFinished = False - End If - Else - sNoCheckSum.Add(de.Key) - End If - - 'Check if the restore location exists, if not we assume the game is not installed and should be auto-marked. - If oBackup.AbsolutePath Then - sExtractPath = oBackup.RestorePath - Else - hshGames = mgrMonitorList.DoListGetbyName(de.Key) - If hshGames.Count = 1 Then - oGame = DirectCast(hshGames(0), clsGame) - If oGame.ProcessPath <> String.Empty Then - oBackup.RelativeRestorePath = oGame.ProcessPath & Path.DirectorySeparatorChar & oBackup.RestorePath + 'Check if backup file is ready to restore + If oBackup.CheckSum <> String.Empty Then + sFileName = oSettings.BackupFolder & Path.DirectorySeparatorChar & oBackup.FileName + If mgrHash.Generate_SHA256_Hash(sFileName) <> oBackup.CheckSum Then + sNotReady.Add(de.Key) + bFinished = False End If + Else + sNoCheckSum.Add(de.Key) End If - sExtractPath = oBackup.RelativeRestorePath - End If - If Not Directory.Exists(sExtractPath) Then - If oSettings.AutoMark Then - If mgrManifest.DoGlobalManifestCheck(de.Key, mgrSQLite.Database.Local) Then - mgrManifest.DoManifestUpdateByName(de.Value, mgrSQLite.Database.Local) - Else - mgrManifest.DoManifestAdd(de.Value, mgrSQLite.Database.Local) - End If - End If - sNotInstalled.Add(de.Key) - End If - Next - - 'Remove any backup files that are not ready - For Each s As String In sNotReady - slRestoreData.Remove(s) - UpdateLog(mgrCommon.FormatString(frmMain_RestoreNotReady, s), False, ToolTipIcon.Info, True) - Next - - 'Remove any backup files that should not be automatically restored - For Each s As String In sNotInstalled - slRestoreData.Remove(s) - If oSettings.AutoMark Then - UpdateLog(mgrCommon.FormatString(frmMain_AutoMark, s), False, ToolTipIcon.Info, True) - Else - UpdateLog(mgrCommon.FormatString(frmMain_NoAutoMark, s), False, ToolTipIcon.Info, True) - End If - Next - For Each s As String In sNoCheckSum - slRestoreData.Remove(s) - UpdateLog(mgrCommon.FormatString(frmMain_NoCheckSum, s), False, ToolTipIcon.Info, True) - Next - - 'Automatically restore backup files - If oSettings.AutoRestore Then - If slRestoreData.Count > 0 Then - hshRestore = New Hashtable - For Each de As DictionaryEntry In slRestoreData + 'Check if the restore location exists, if not we assume the game is not installed and should be auto-marked. + If oBackup.AbsolutePath Then + sExtractPath = oBackup.RestorePath + Else hshGames = mgrMonitorList.DoListGetbyName(de.Key) If hshGames.Count = 1 Then oGame = DirectCast(hshGames(0), clsGame) - hshRestore.Add(oGame, de.Value) - Else - UpdateLog(mgrCommon.FormatString(frmMain_AutoRestoreFailure, de.Key), False, ToolTipIcon.Info, True) + If oGame.ProcessPath <> String.Empty Then + oBackup.RelativeRestorePath = oGame.ProcessPath & Path.DirectorySeparatorChar & oBackup.RestorePath + End If End If - Next - RunRestore(hshRestore) + sExtractPath = oBackup.RelativeRestorePath + End If + + If Not Directory.Exists(sExtractPath) Then + If oSettings.AutoMark Then + If mgrManifest.DoGlobalManifestCheck(de.Key, mgrSQLite.Database.Local) Then + mgrManifest.DoManifestUpdateByName(de.Value, mgrSQLite.Database.Local) + Else + mgrManifest.DoManifestAdd(de.Value, mgrSQLite.Database.Local) + End If + End If + sNotInstalled.Add(de.Key) + End If + Next + + 'Remove any backup files that are not ready + For Each s As String In sNotReady + slRestoreData.Remove(s) + UpdateLog(mgrCommon.FormatString(frmMain_RestoreNotReady, s), False, ToolTipIcon.Info, True) + Next + + 'Remove any backup files that should not be automatically restored + For Each s As String In sNotInstalled + slRestoreData.Remove(s) + If oSettings.AutoMark Then + UpdateLog(mgrCommon.FormatString(frmMain_AutoMark, s), False, ToolTipIcon.Info, True) + Else + UpdateLog(mgrCommon.FormatString(frmMain_NoAutoMark, s), False, ToolTipIcon.Info, True) + End If + Next + For Each s As String In sNoCheckSum + slRestoreData.Remove(s) + UpdateLog(mgrCommon.FormatString(frmMain_NoCheckSum, s), False, ToolTipIcon.Info, True) + Next + + 'Automatically restore backup files + If oSettings.AutoRestore Then + If slRestoreData.Count > 0 Then + hshRestore = New Hashtable + For Each de As DictionaryEntry In slRestoreData + hshGames = mgrMonitorList.DoListGetbyName(de.Key) + If hshGames.Count = 1 Then + oGame = DirectCast(hshGames(0), clsGame) + hshRestore.Add(oGame, de.Value) + Else + UpdateLog(mgrCommon.FormatString(frmMain_AutoRestoreFailure, de.Key), False, ToolTipIcon.Info, True) + End If + Next + RunRestore(hshRestore) + End If + End If + + 'Shutdown if we are finished + If bFinished Then + tmRestoreCheck.Stop() + End If + + 'Time out after 15 minutes + If iRestoreTimeOut = 15 Then + tmRestoreCheck.Stop() End If End If @@ -481,16 +493,6 @@ Public Class frmMain UpdateNotifier(slRestoreData.Count, oSettings.AutoRestore) End If End If - - 'Shutdown if we are finished - If bFinished Then - tmRestoreCheck.Stop() - End If - - 'Time out after 15 minutes - If iRestoreTimeOut = 15 Then - tmRestoreCheck.Stop() - End If End Sub 'Functions handling the display of game information diff --git a/GBM/Forms/frmSettings.Designer.vb b/GBM/Forms/frmSettings.Designer.vb index 70c342a..ae7e7ab 100644 --- a/GBM/Forms/frmSettings.Designer.vb +++ b/GBM/Forms/frmSettings.Designer.vb @@ -54,7 +54,6 @@ Partial Class frmSettings Me.nudSupressBackupThreshold = New System.Windows.Forms.NumericUpDown() Me.chkSupressBackup = New System.Windows.Forms.CheckBox() Me.chkBackupConfirm = New System.Windows.Forms.CheckBox() - Me.chkCheckSum = New System.Windows.Forms.CheckBox() Me.chkOverwriteWarning = New System.Windows.Forms.CheckBox() Me.grpBackupHandling = New System.Windows.Forms.GroupBox() Me.chkAutoRestore = New System.Windows.Forms.CheckBox() @@ -82,9 +81,10 @@ Partial Class frmSettings 'chkMonitorOnStartup ' Me.chkMonitorOnStartup.AutoSize = True - Me.chkMonitorOnStartup.Location = New System.Drawing.Point(6, 65) + Me.chkMonitorOnStartup.Location = New System.Drawing.Point(8, 80) + Me.chkMonitorOnStartup.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.chkMonitorOnStartup.Name = "chkMonitorOnStartup" - Me.chkMonitorOnStartup.Size = New System.Drawing.Size(146, 17) + Me.chkMonitorOnStartup.Size = New System.Drawing.Size(192, 21) Me.chkMonitorOnStartup.TabIndex = 2 Me.chkMonitorOnStartup.Text = "Start monitoring at launch" Me.chkMonitorOnStartup.UseVisualStyleBackColor = True @@ -94,9 +94,11 @@ Partial Class frmSettings Me.grpStartup.Controls.Add(Me.chkStartWindows) Me.grpStartup.Controls.Add(Me.chkStartToTray) Me.grpStartup.Controls.Add(Me.chkMonitorOnStartup) - Me.grpStartup.Location = New System.Drawing.Point(6, 12) + Me.grpStartup.Location = New System.Drawing.Point(8, 15) + Me.grpStartup.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.grpStartup.Name = "grpStartup" - Me.grpStartup.Size = New System.Drawing.Size(354, 90) + Me.grpStartup.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.grpStartup.Size = New System.Drawing.Size(472, 111) Me.grpStartup.TabIndex = 0 Me.grpStartup.TabStop = False Me.grpStartup.Text = "Startup" @@ -104,9 +106,10 @@ Partial Class frmSettings 'chkStartWindows ' Me.chkStartWindows.AutoSize = True - Me.chkStartWindows.Location = New System.Drawing.Point(6, 19) + Me.chkStartWindows.Location = New System.Drawing.Point(8, 23) + Me.chkStartWindows.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.chkStartWindows.Name = "chkStartWindows" - Me.chkStartWindows.Size = New System.Drawing.Size(117, 17) + Me.chkStartWindows.Size = New System.Drawing.Size(148, 21) Me.chkStartWindows.TabIndex = 0 Me.chkStartWindows.Text = "Start with Windows" Me.chkStartWindows.UseVisualStyleBackColor = True @@ -114,9 +117,10 @@ Partial Class frmSettings 'chkStartToTray ' Me.chkStartToTray.AutoSize = True - Me.chkStartToTray.Location = New System.Drawing.Point(6, 42) + Me.chkStartToTray.Location = New System.Drawing.Point(8, 52) + Me.chkStartToTray.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.chkStartToTray.Name = "chkStartToTray" - Me.chkStartToTray.Size = New System.Drawing.Size(115, 17) + Me.chkStartToTray.Size = New System.Drawing.Size(152, 21) Me.chkStartToTray.TabIndex = 1 Me.chkStartToTray.Text = "Start to system tray" Me.chkStartToTray.UseVisualStyleBackColor = True @@ -124,18 +128,20 @@ Partial Class frmSettings 'chkAutoSaveLog ' Me.chkAutoSaveLog.AutoSize = True - Me.chkAutoSaveLog.Location = New System.Drawing.Point(6, 204) + Me.chkAutoSaveLog.Location = New System.Drawing.Point(8, 251) + Me.chkAutoSaveLog.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.chkAutoSaveLog.Name = "chkAutoSaveLog" - Me.chkAutoSaveLog.Size = New System.Drawing.Size(231, 17) + Me.chkAutoSaveLog.Size = New System.Drawing.Size(300, 21) Me.chkAutoSaveLog.TabIndex = 7 Me.chkAutoSaveLog.Text = "Autosave log when max length is exceeded" Me.chkAutoSaveLog.UseVisualStyleBackColor = True ' 'btnOptionalFields ' - Me.btnOptionalFields.Location = New System.Drawing.Point(110, 38) + Me.btnOptionalFields.Location = New System.Drawing.Point(147, 47) + Me.btnOptionalFields.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.btnOptionalFields.Name = "btnOptionalFields" - Me.btnOptionalFields.Size = New System.Drawing.Size(134, 23) + Me.btnOptionalFields.Size = New System.Drawing.Size(179, 28) Me.btnOptionalFields.TabIndex = 6 Me.btnOptionalFields.Text = "Choose &Optional Fields..." Me.btnOptionalFields.UseVisualStyleBackColor = True @@ -143,9 +149,10 @@ Partial Class frmSettings 'chkTimeTracking ' Me.chkTimeTracking.AutoSize = True - Me.chkTimeTracking.Location = New System.Drawing.Point(6, 19) + Me.chkTimeTracking.Location = New System.Drawing.Point(8, 23) + Me.chkTimeTracking.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.chkTimeTracking.Name = "chkTimeTracking" - Me.chkTimeTracking.Size = New System.Drawing.Size(122, 17) + Me.chkTimeTracking.Size = New System.Drawing.Size(158, 21) Me.chkTimeTracking.TabIndex = 4 Me.chkTimeTracking.Text = "Enable time tracking" Me.chkTimeTracking.UseVisualStyleBackColor = True @@ -153,9 +160,10 @@ Partial Class frmSettings 'chkSync ' Me.chkSync.AutoSize = True - Me.chkSync.Location = New System.Drawing.Point(6, 42) + Me.chkSync.Location = New System.Drawing.Point(8, 52) + Me.chkSync.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.chkSync.Name = "chkSync" - Me.chkSync.Size = New System.Drawing.Size(98, 17) + Me.chkSync.Size = New System.Drawing.Size(126, 21) Me.chkSync.TabIndex = 5 Me.chkSync.Text = "Enable syncing" Me.chkSync.UseVisualStyleBackColor = True @@ -163,9 +171,10 @@ Partial Class frmSettings 'chkShowDetectionTips ' Me.chkShowDetectionTips.AutoSize = True - Me.chkShowDetectionTips.Location = New System.Drawing.Point(6, 181) + Me.chkShowDetectionTips.Location = New System.Drawing.Point(8, 223) + Me.chkShowDetectionTips.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.chkShowDetectionTips.Name = "chkShowDetectionTips" - Me.chkShowDetectionTips.Size = New System.Drawing.Size(159, 17) + Me.chkShowDetectionTips.Size = New System.Drawing.Size(205, 21) Me.chkShowDetectionTips.TabIndex = 3 Me.chkShowDetectionTips.Text = "Show detection notifications" Me.chkShowDetectionTips.UseVisualStyleBackColor = True @@ -176,18 +185,21 @@ Partial Class frmSettings Me.grpFolderOptions.Controls.Add(Me.lblBackupFolder) Me.grpFolderOptions.Controls.Add(Me.txtBackupFolder) Me.grpFolderOptions.Controls.Add(Me.chkCreateFolder) - Me.grpFolderOptions.Location = New System.Drawing.Point(6, 12) + Me.grpFolderOptions.Location = New System.Drawing.Point(8, 15) + Me.grpFolderOptions.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.grpFolderOptions.Name = "grpFolderOptions" - Me.grpFolderOptions.Size = New System.Drawing.Size(354, 70) + Me.grpFolderOptions.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.grpFolderOptions.Size = New System.Drawing.Size(472, 86) Me.grpFolderOptions.TabIndex = 1 Me.grpFolderOptions.TabStop = False Me.grpFolderOptions.Text = "Folders" ' 'btnBackupFolder ' - Me.btnBackupFolder.Location = New System.Drawing.Point(313, 17) + Me.btnBackupFolder.Location = New System.Drawing.Point(417, 21) + Me.btnBackupFolder.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.btnBackupFolder.Name = "btnBackupFolder" - Me.btnBackupFolder.Size = New System.Drawing.Size(27, 20) + Me.btnBackupFolder.Size = New System.Drawing.Size(36, 25) Me.btnBackupFolder.TabIndex = 2 Me.btnBackupFolder.Text = "..." Me.btnBackupFolder.UseVisualStyleBackColor = True @@ -195,25 +207,28 @@ Partial Class frmSettings 'lblBackupFolder ' Me.lblBackupFolder.AutoSize = True - Me.lblBackupFolder.Location = New System.Drawing.Point(6, 20) + Me.lblBackupFolder.Location = New System.Drawing.Point(8, 25) + Me.lblBackupFolder.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblBackupFolder.Name = "lblBackupFolder" - Me.lblBackupFolder.Size = New System.Drawing.Size(79, 13) + Me.lblBackupFolder.Size = New System.Drawing.Size(103, 17) Me.lblBackupFolder.TabIndex = 0 Me.lblBackupFolder.Text = "Backup Folder:" ' 'txtBackupFolder ' - Me.txtBackupFolder.Location = New System.Drawing.Point(91, 17) + Me.txtBackupFolder.Location = New System.Drawing.Point(121, 21) + Me.txtBackupFolder.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.txtBackupFolder.Name = "txtBackupFolder" - Me.txtBackupFolder.Size = New System.Drawing.Size(216, 20) + Me.txtBackupFolder.Size = New System.Drawing.Size(287, 22) Me.txtBackupFolder.TabIndex = 1 ' 'chkCreateFolder ' Me.chkCreateFolder.AutoSize = True - Me.chkCreateFolder.Location = New System.Drawing.Point(9, 43) + Me.chkCreateFolder.Location = New System.Drawing.Point(12, 53) + Me.chkCreateFolder.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.chkCreateFolder.Name = "chkCreateFolder" - Me.chkCreateFolder.Size = New System.Drawing.Size(186, 17) + Me.chkCreateFolder.Size = New System.Drawing.Size(247, 21) Me.chkCreateFolder.TabIndex = 3 Me.chkCreateFolder.Text = "Create a sub-folder for each game" Me.chkCreateFolder.UseVisualStyleBackColor = True @@ -221,9 +236,10 @@ Partial Class frmSettings 'btnSave ' Me.btnSave.DialogResult = System.Windows.Forms.DialogResult.OK - Me.btnSave.Location = New System.Drawing.Point(384, 321) + Me.btnSave.Location = New System.Drawing.Point(512, 395) + Me.btnSave.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.btnSave.Name = "btnSave" - Me.btnSave.Size = New System.Drawing.Size(75, 23) + Me.btnSave.Size = New System.Drawing.Size(100, 28) Me.btnSave.TabIndex = 5 Me.btnSave.Text = "&Save" Me.btnSave.UseVisualStyleBackColor = True @@ -231,9 +247,10 @@ Partial Class frmSettings 'btnCancel ' Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(465, 321) + Me.btnCancel.Location = New System.Drawing.Point(620, 395) + Me.btnCancel.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.btnCancel.Name = "btnCancel" - Me.btnCancel.Size = New System.Drawing.Size(75, 23) + Me.btnCancel.Size = New System.Drawing.Size(100, 28) Me.btnCancel.TabIndex = 6 Me.btnCancel.Text = "&Cancel" Me.btnCancel.UseVisualStyleBackColor = True @@ -242,9 +259,11 @@ Partial Class frmSettings ' Me.grp7zGeneral.Controls.Add(Me.cboCompression) Me.grp7zGeneral.Controls.Add(Me.lblCompression) - Me.grp7zGeneral.Location = New System.Drawing.Point(6, 12) + Me.grp7zGeneral.Location = New System.Drawing.Point(8, 15) + Me.grp7zGeneral.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.grp7zGeneral.Name = "grp7zGeneral" - Me.grp7zGeneral.Size = New System.Drawing.Size(354, 50) + Me.grp7zGeneral.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.grp7zGeneral.Size = New System.Drawing.Size(472, 62) Me.grp7zGeneral.TabIndex = 0 Me.grp7zGeneral.TabStop = False Me.grp7zGeneral.Text = "General" @@ -253,84 +272,94 @@ Partial Class frmSettings ' Me.cboCompression.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cboCompression.FormattingEnabled = True - Me.cboCompression.Location = New System.Drawing.Point(110, 17) + Me.cboCompression.Location = New System.Drawing.Point(147, 21) + Me.cboCompression.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.cboCompression.Name = "cboCompression" - Me.cboCompression.Size = New System.Drawing.Size(238, 21) + Me.cboCompression.Size = New System.Drawing.Size(316, 24) Me.cboCompression.TabIndex = 1 ' 'lblCompression ' Me.lblCompression.AutoSize = True - Me.lblCompression.Location = New System.Drawing.Point(6, 20) + Me.lblCompression.Location = New System.Drawing.Point(8, 25) + Me.lblCompression.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblCompression.Name = "lblCompression" - Me.lblCompression.Size = New System.Drawing.Size(70, 13) + Me.lblCompression.Size = New System.Drawing.Size(94, 17) Me.lblCompression.TabIndex = 0 Me.lblCompression.Text = "Compression:" ' 'btn7zLocation ' - Me.btn7zLocation.Location = New System.Drawing.Point(313, 41) + Me.btn7zLocation.Location = New System.Drawing.Point(417, 50) + Me.btn7zLocation.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.btn7zLocation.Name = "btn7zLocation" - Me.btn7zLocation.Size = New System.Drawing.Size(27, 20) + Me.btn7zLocation.Size = New System.Drawing.Size(36, 25) Me.btn7zLocation.TabIndex = 5 Me.btn7zLocation.Text = "..." Me.btn7zLocation.UseVisualStyleBackColor = True ' 'txt7zLocation ' - Me.txt7zLocation.Location = New System.Drawing.Point(110, 41) + Me.txt7zLocation.Location = New System.Drawing.Point(147, 50) + Me.txt7zLocation.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.txt7zLocation.Name = "txt7zLocation" - Me.txt7zLocation.Size = New System.Drawing.Size(197, 20) + Me.txt7zLocation.Size = New System.Drawing.Size(261, 22) Me.txt7zLocation.TabIndex = 4 ' 'lblLocation ' Me.lblLocation.AutoSize = True - Me.lblLocation.Location = New System.Drawing.Point(6, 44) + Me.lblLocation.Location = New System.Drawing.Point(8, 54) + Me.lblLocation.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblLocation.Name = "lblLocation" - Me.lblLocation.Size = New System.Drawing.Size(89, 13) + Me.lblLocation.Size = New System.Drawing.Size(117, 17) Me.lblLocation.TabIndex = 4 Me.lblLocation.Text = "Custom Location:" ' 'txt7zArguments ' - Me.txt7zArguments.Location = New System.Drawing.Point(110, 15) + Me.txt7zArguments.Location = New System.Drawing.Point(147, 18) + Me.txt7zArguments.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.txt7zArguments.Name = "txt7zArguments" - Me.txt7zArguments.Size = New System.Drawing.Size(238, 20) + Me.txt7zArguments.Size = New System.Drawing.Size(316, 22) Me.txt7zArguments.TabIndex = 3 ' 'lblArguments ' Me.lblArguments.AutoSize = True - Me.lblArguments.Location = New System.Drawing.Point(6, 20) + Me.lblArguments.Location = New System.Drawing.Point(8, 25) + Me.lblArguments.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblArguments.Name = "lblArguments" - Me.lblArguments.Size = New System.Drawing.Size(98, 13) + Me.lblArguments.Size = New System.Drawing.Size(131, 17) Me.lblArguments.TabIndex = 2 Me.lblArguments.Text = "Custom Arguments:" ' 'lbl7zCopyright ' Me.lbl7zCopyright.AutoEllipsis = True - Me.lbl7zCopyright.Location = New System.Drawing.Point(9, 34) + Me.lbl7zCopyright.Location = New System.Drawing.Point(12, 42) + Me.lbl7zCopyright.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lbl7zCopyright.Name = "lbl7zCopyright" - Me.lbl7zCopyright.Size = New System.Drawing.Size(339, 17) + Me.lbl7zCopyright.Size = New System.Drawing.Size(452, 21) Me.lbl7zCopyright.TabIndex = 8 Me.lbl7zCopyright.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' 'lbl7zProduct ' Me.lbl7zProduct.AutoEllipsis = True - Me.lbl7zProduct.Location = New System.Drawing.Point(9, 17) + Me.lbl7zProduct.Location = New System.Drawing.Point(12, 21) + Me.lbl7zProduct.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lbl7zProduct.Name = "lbl7zProduct" - Me.lbl7zProduct.Size = New System.Drawing.Size(339, 17) + Me.lbl7zProduct.Size = New System.Drawing.Size(452, 21) Me.lbl7zProduct.TabIndex = 7 Me.lbl7zProduct.TextAlign = System.Drawing.ContentAlignment.MiddleLeft ' 'btnDefaults ' - Me.btnDefaults.Location = New System.Drawing.Point(12, 321) + Me.btnDefaults.Location = New System.Drawing.Point(16, 395) + Me.btnDefaults.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.btnDefaults.Name = "btnDefaults" - Me.btnDefaults.Size = New System.Drawing.Size(110, 23) + Me.btnDefaults.Size = New System.Drawing.Size(147, 28) Me.btnDefaults.TabIndex = 4 Me.btnDefaults.Text = "Set &Defaults" Me.btnDefaults.UseVisualStyleBackColor = True @@ -341,38 +370,41 @@ Partial Class frmSettings Me.pnlBackup.Controls.Add(Me.nudSupressBackupThreshold) Me.pnlBackup.Controls.Add(Me.chkSupressBackup) Me.pnlBackup.Controls.Add(Me.chkBackupConfirm) - Me.pnlBackup.Controls.Add(Me.chkCheckSum) Me.pnlBackup.Controls.Add(Me.chkOverwriteWarning) Me.pnlBackup.Controls.Add(Me.grpBackupHandling) Me.pnlBackup.Controls.Add(Me.grpFolderOptions) - Me.pnlBackup.Location = New System.Drawing.Point(180, 0) + Me.pnlBackup.Location = New System.Drawing.Point(240, 0) + Me.pnlBackup.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.pnlBackup.Name = "pnlBackup" - Me.pnlBackup.Size = New System.Drawing.Size(367, 314) + Me.pnlBackup.Size = New System.Drawing.Size(489, 386) Me.pnlBackup.TabIndex = 3 ' 'lblMinutes ' Me.lblMinutes.AutoSize = True - Me.lblMinutes.Location = New System.Drawing.Point(286, 251) + Me.lblMinutes.Location = New System.Drawing.Point(381, 281) + Me.lblMinutes.Margin = New System.Windows.Forms.Padding(4, 0, 4, 0) Me.lblMinutes.Name = "lblMinutes" - Me.lblMinutes.Size = New System.Drawing.Size(43, 13) + Me.lblMinutes.Size = New System.Drawing.Size(57, 17) Me.lblMinutes.TabIndex = 14 Me.lblMinutes.Text = "minutes" ' 'nudSupressBackupThreshold ' - Me.nudSupressBackupThreshold.Location = New System.Drawing.Point(229, 249) + Me.nudSupressBackupThreshold.Location = New System.Drawing.Point(305, 278) + Me.nudSupressBackupThreshold.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.nudSupressBackupThreshold.Maximum = New Decimal(New Integer() {999, 0, 0, 0}) Me.nudSupressBackupThreshold.Name = "nudSupressBackupThreshold" - Me.nudSupressBackupThreshold.Size = New System.Drawing.Size(51, 20) + Me.nudSupressBackupThreshold.Size = New System.Drawing.Size(68, 22) Me.nudSupressBackupThreshold.TabIndex = 13 ' 'chkSupressBackup ' Me.chkSupressBackup.AutoSize = True - Me.chkSupressBackup.Location = New System.Drawing.Point(6, 250) + Me.chkSupressBackup.Location = New System.Drawing.Point(8, 280) + Me.chkSupressBackup.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.chkSupressBackup.Name = "chkSupressBackup" - Me.chkSupressBackup.Size = New System.Drawing.Size(217, 17) + Me.chkSupressBackup.Size = New System.Drawing.Size(282, 21) Me.chkSupressBackup.TabIndex = 12 Me.chkSupressBackup.Text = "Backup only when session time exceeds" Me.chkSupressBackup.UseVisualStyleBackColor = True @@ -380,29 +412,21 @@ Partial Class frmSettings 'chkBackupConfirm ' Me.chkBackupConfirm.AutoSize = True - Me.chkBackupConfirm.Location = New System.Drawing.Point(6, 180) + Me.chkBackupConfirm.Location = New System.Drawing.Point(8, 222) + Me.chkBackupConfirm.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.chkBackupConfirm.Name = "chkBackupConfirm" - Me.chkBackupConfirm.Size = New System.Drawing.Size(160, 17) + Me.chkBackupConfirm.Size = New System.Drawing.Size(208, 21) Me.chkBackupConfirm.TabIndex = 9 Me.chkBackupConfirm.Text = "Disable backup confirmation" Me.chkBackupConfirm.UseVisualStyleBackColor = True ' - 'chkCheckSum - ' - Me.chkCheckSum.AutoSize = True - Me.chkCheckSum.Location = New System.Drawing.Point(6, 227) - Me.chkCheckSum.Name = "chkCheckSum" - Me.chkCheckSum.Size = New System.Drawing.Size(195, 17) - Me.chkCheckSum.TabIndex = 11 - Me.chkCheckSum.Text = "Verify backup files with a checksum" - Me.chkCheckSum.UseVisualStyleBackColor = True - ' 'chkOverwriteWarning ' Me.chkOverwriteWarning.AutoSize = True - Me.chkOverwriteWarning.Location = New System.Drawing.Point(6, 204) + Me.chkOverwriteWarning.Location = New System.Drawing.Point(8, 251) + Me.chkOverwriteWarning.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.chkOverwriteWarning.Name = "chkOverwriteWarning" - Me.chkOverwriteWarning.Size = New System.Drawing.Size(139, 17) + Me.chkOverwriteWarning.Size = New System.Drawing.Size(178, 21) Me.chkOverwriteWarning.TabIndex = 10 Me.chkOverwriteWarning.Text = "Show overwrite warning" Me.chkOverwriteWarning.UseVisualStyleBackColor = True @@ -412,11 +436,11 @@ Partial Class frmSettings Me.grpBackupHandling.Controls.Add(Me.chkAutoRestore) Me.grpBackupHandling.Controls.Add(Me.chkRestoreNotify) Me.grpBackupHandling.Controls.Add(Me.chkAutoMark) - Me.grpBackupHandling.Location = New System.Drawing.Point(6, 88) - Me.grpBackupHandling.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) + Me.grpBackupHandling.Location = New System.Drawing.Point(8, 108) + Me.grpBackupHandling.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) Me.grpBackupHandling.Name = "grpBackupHandling" - Me.grpBackupHandling.Padding = New System.Windows.Forms.Padding(2, 2, 2, 2) - Me.grpBackupHandling.Size = New System.Drawing.Size(354, 87) + Me.grpBackupHandling.Padding = New System.Windows.Forms.Padding(3, 2, 3, 2) + Me.grpBackupHandling.Size = New System.Drawing.Size(472, 107) Me.grpBackupHandling.TabIndex = 8 Me.grpBackupHandling.TabStop = False Me.grpBackupHandling.Text = "Backup Handling" @@ -424,10 +448,10 @@ Partial Class frmSettings 'chkAutoRestore ' Me.chkAutoRestore.AutoSize = True - Me.chkAutoRestore.Location = New System.Drawing.Point(8, 41) - Me.chkAutoRestore.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) + Me.chkAutoRestore.Location = New System.Drawing.Point(11, 50) + Me.chkAutoRestore.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) Me.chkAutoRestore.Name = "chkAutoRestore" - Me.chkAutoRestore.Size = New System.Drawing.Size(190, 17) + Me.chkAutoRestore.Size = New System.Drawing.Size(248, 21) Me.chkAutoRestore.TabIndex = 9 Me.chkAutoRestore.Text = "Automatically restore new backups" Me.chkAutoRestore.UseVisualStyleBackColor = True @@ -435,10 +459,10 @@ Partial Class frmSettings 'chkRestoreNotify ' Me.chkRestoreNotify.AutoSize = True - Me.chkRestoreNotify.Location = New System.Drawing.Point(8, 19) - Me.chkRestoreNotify.Margin = New System.Windows.Forms.Padding(2, 2, 2, 2) + Me.chkRestoreNotify.Location = New System.Drawing.Point(11, 23) + Me.chkRestoreNotify.Margin = New System.Windows.Forms.Padding(3, 2, 3, 2) Me.chkRestoreNotify.Name = "chkRestoreNotify" - Me.chkRestoreNotify.Size = New System.Drawing.Size(216, 17) + Me.chkRestoreNotify.Size = New System.Drawing.Size(281, 21) Me.chkRestoreNotify.TabIndex = 8 Me.chkRestoreNotify.Text = "Display notifications about new backups" Me.chkRestoreNotify.UseVisualStyleBackColor = True @@ -446,9 +470,10 @@ Partial Class frmSettings 'chkAutoMark ' Me.chkAutoMark.AutoSize = True - Me.chkAutoMark.Location = New System.Drawing.Point(8, 63) + Me.chkAutoMark.Location = New System.Drawing.Point(11, 78) + Me.chkAutoMark.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.chkAutoMark.Name = "chkAutoMark" - Me.chkAutoMark.Size = New System.Drawing.Size(321, 17) + Me.chkAutoMark.Size = New System.Drawing.Size(424, 21) Me.chkAutoMark.TabIndex = 5 Me.chkAutoMark.Text = "Automatically mark new backups as restored when appropriate" Me.chkAutoMark.UseVisualStyleBackColor = True @@ -458,9 +483,10 @@ Partial Class frmSettings Me.pnl7z.Controls.Add(Me.grp7zAdvanced) Me.pnl7z.Controls.Add(Me.grp7zInformation) Me.pnl7z.Controls.Add(Me.grp7zGeneral) - Me.pnl7z.Location = New System.Drawing.Point(180, 0) + Me.pnl7z.Location = New System.Drawing.Point(240, 0) + Me.pnl7z.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.pnl7z.Name = "pnl7z" - Me.pnl7z.Size = New System.Drawing.Size(367, 314) + Me.pnl7z.Size = New System.Drawing.Size(489, 386) Me.pnl7z.TabIndex = 2 ' 'grp7zAdvanced @@ -470,9 +496,11 @@ Partial Class frmSettings Me.grp7zAdvanced.Controls.Add(Me.txt7zLocation) Me.grp7zAdvanced.Controls.Add(Me.txt7zArguments) Me.grp7zAdvanced.Controls.Add(Me.lblLocation) - Me.grp7zAdvanced.Location = New System.Drawing.Point(6, 68) + Me.grp7zAdvanced.Location = New System.Drawing.Point(8, 84) + Me.grp7zAdvanced.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.grp7zAdvanced.Name = "grp7zAdvanced" - Me.grp7zAdvanced.Size = New System.Drawing.Size(354, 73) + Me.grp7zAdvanced.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.grp7zAdvanced.Size = New System.Drawing.Size(472, 90) Me.grp7zAdvanced.TabIndex = 2 Me.grp7zAdvanced.TabStop = False Me.grp7zAdvanced.Text = "Advanced" @@ -481,9 +509,11 @@ Partial Class frmSettings ' Me.grp7zInformation.Controls.Add(Me.lbl7zProduct) Me.grp7zInformation.Controls.Add(Me.lbl7zCopyright) - Me.grp7zInformation.Location = New System.Drawing.Point(6, 146) + Me.grp7zInformation.Location = New System.Drawing.Point(8, 180) + Me.grp7zInformation.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.grp7zInformation.Name = "grp7zInformation" - Me.grp7zInformation.Size = New System.Drawing.Size(354, 63) + Me.grp7zInformation.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.grp7zInformation.Size = New System.Drawing.Size(472, 78) Me.grp7zInformation.TabIndex = 1 Me.grp7zInformation.TabStop = False Me.grp7zInformation.Text = "Utility Information" @@ -494,9 +524,10 @@ Partial Class frmSettings Me.pnlGeneral.Controls.Add(Me.grpGameData) Me.pnlGeneral.Controls.Add(Me.chkShowDetectionTips) Me.pnlGeneral.Controls.Add(Me.grpStartup) - Me.pnlGeneral.Location = New System.Drawing.Point(180, 0) + Me.pnlGeneral.Location = New System.Drawing.Point(240, 0) + Me.pnlGeneral.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.pnlGeneral.Name = "pnlGeneral" - Me.pnlGeneral.Size = New System.Drawing.Size(367, 314) + Me.pnlGeneral.Size = New System.Drawing.Size(489, 386) Me.pnlGeneral.TabIndex = 1 ' 'grpGameData @@ -504,9 +535,11 @@ Partial Class frmSettings Me.grpGameData.Controls.Add(Me.chkTimeTracking) Me.grpGameData.Controls.Add(Me.chkSync) Me.grpGameData.Controls.Add(Me.btnOptionalFields) - Me.grpGameData.Location = New System.Drawing.Point(6, 106) + Me.grpGameData.Location = New System.Drawing.Point(8, 130) + Me.grpGameData.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.grpGameData.Name = "grpGameData" - Me.grpGameData.Size = New System.Drawing.Size(354, 69) + Me.grpGameData.Padding = New System.Windows.Forms.Padding(4, 4, 4, 4) + Me.grpGameData.Size = New System.Drawing.Size(472, 85) Me.grpGameData.TabIndex = 1 Me.grpGameData.TabStop = False Me.grpGameData.Text = "Game Data" @@ -514,16 +547,18 @@ Partial Class frmSettings 'lstSettings ' Me.lstSettings.FormattingEnabled = True - Me.lstSettings.Location = New System.Drawing.Point(12, 12) + Me.lstSettings.ItemHeight = 16 + Me.lstSettings.Location = New System.Drawing.Point(16, 15) + Me.lstSettings.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.lstSettings.Name = "lstSettings" - Me.lstSettings.Size = New System.Drawing.Size(162, 303) + Me.lstSettings.Size = New System.Drawing.Size(215, 372) Me.lstSettings.TabIndex = 0 ' 'frmSettings ' - Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) + Me.AutoScaleDimensions = New System.Drawing.SizeF(8.0!, 16.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(554, 361) + Me.ClientSize = New System.Drawing.Size(739, 444) Me.Controls.Add(Me.pnlBackup) Me.Controls.Add(Me.lstSettings) Me.Controls.Add(Me.btnDefaults) @@ -532,6 +567,7 @@ Partial Class frmSettings Me.Controls.Add(Me.pnlGeneral) Me.Controls.Add(Me.pnl7z) Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle + Me.Margin = New System.Windows.Forms.Padding(4, 4, 4, 4) Me.MaximizeBox = False Me.MinimizeBox = False Me.Name = "frmSettings" @@ -599,7 +635,6 @@ Partial Class frmSettings Friend WithEvents nudSupressBackupThreshold As NumericUpDown Friend WithEvents chkSupressBackup As CheckBox Friend WithEvents chkBackupConfirm As CheckBox - Friend WithEvents chkCheckSum As CheckBox Friend WithEvents chkOverwriteWarning As CheckBox Friend WithEvents grpBackupHandling As GroupBox Friend WithEvents chkAutoMark As CheckBox diff --git a/GBM/Forms/frmSettings.vb b/GBM/Forms/frmSettings.vb index f2335aa..d5cd44d 100644 --- a/GBM/Forms/frmSettings.vb +++ b/GBM/Forms/frmSettings.vb @@ -4,7 +4,6 @@ Imports System.IO Public Class frmSettings Dim bShutdown As Boolean = False Dim bSyncSettingsChanged As Boolean = False - Dim bCheckSumDisabled As Boolean = False Dim eCurrentSyncFields As clsGame.eOptionalSyncFields Private oSettings As mgrSettings @@ -63,12 +62,6 @@ Public Class frmSettings oSettings.Custom7zArguments = txt7zArguments.Text.Trim oSettings.Custom7zLocation = txt7zLocation.Text.Trim - 'We need to clear all checksums its turned off - If chkCheckSum.Checked = False And oSettings.CheckSum = True Then - bCheckSumDisabled = True - End If - oSettings.CheckSum = chkCheckSum.Checked - 'Turning syncing from off to on is the same as changing the backup folder If chkSync.Checked = True And oSettings.Sync = False Then bSyncSettingsChanged = True @@ -108,7 +101,6 @@ Public Class frmSettings If ValidateSettings() Then oSettings.SaveSettings() If bSyncSettingsChanged Then mgrMonitorList.HandleBackupLocationChange(Settings) - If bCheckSumDisabled Then mgrManifest.DoManifestHashWipe() Return True Else Return False @@ -184,7 +176,6 @@ Public Class frmSettings chkAutoMark.Checked = oSettings.AutoMark txtBackupFolder.Text = oSettings.BackupFolder chkSync.Checked = oSettings.Sync - chkCheckSum.Checked = oSettings.CheckSum chkTimeTracking.Checked = oSettings.TimeTracking chkSupressBackup.Checked = oSettings.SupressBackup nudSupressBackupThreshold.Value = oSettings.SupressBackupThreshold @@ -283,7 +274,6 @@ Public Class frmSettings 'Set Form Text lblMinutes.Text = frmSettings_lblMinutes chkSupressBackup.Text = frmSettings_chkSupressBackup - chkCheckSum.Text = frmSettings_chkCheckSum grpBackupHandling.Text = frmSettings_grpBackupHandling chkRestoreNotify.Text = frmSettings_chkRestoreNotify chkAutoRestore.Text = frmSettings_chkAutoRestore diff --git a/GBM/Managers/mgrBackup.vb b/GBM/Managers/mgrBackup.vb index 46b4699..567d922 100644 --- a/GBM/Managers/mgrBackup.vb +++ b/GBM/Managers/mgrBackup.vb @@ -242,10 +242,10 @@ Public Class mgrBackup 'Write Main Manifest If bBackupCompleted Then - If oSettings.CheckSum Then - RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_GenerateHash, oGame.Name), False, ToolTipIcon.Info, True) - sHash = mgrHash.Generate_SHA256_Hash(sBackupFile) - End If + + 'Generate checksum for new backup + RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_GenerateHash, oGame.Name), False, ToolTipIcon.Info, True) + sHash = mgrHash.Generate_SHA256_Hash(sBackupFile) If Not DoManifestUpdate(oGame, sBackupFile, dTimeStamp, sHash) Then RaiseEvent UpdateLog(mgrCommon.FormatString(mgrBackup_ErrorManifestFailure, oGame.Name), True, ToolTipIcon.Error, True) diff --git a/GBM/Managers/mgrRestore.vb b/GBM/Managers/mgrRestore.vb index 7677806..9b91118 100644 --- a/GBM/Managers/mgrRestore.vb +++ b/GBM/Managers/mgrRestore.vb @@ -183,23 +183,22 @@ Public Class mgrRestore End If 'Check file integrity - If oSettings.CheckSum Then - If oBackupInfo.CheckSum <> String.Empty Then - sHash = mgrHash.Generate_SHA256_Hash(sBackupFile) - If sHash <> oBackupInfo.CheckSum Then - RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorFailedCheck, oBackupInfo.Name), False, ToolTipIcon.Info, True) - If mgrCommon.ShowMessage(mgrRestore_ConfirmFailedCheck, oBackupInfo.Name, MsgBoxStyle.YesNo) = MsgBoxResult.No Then - RaiseEvent UpdateLog(mgrRestore_ErrorCheckAbort, False, ToolTipIcon.Info, True) - Return False - End If - Else - RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_Verified, oBackupInfo.Name), False, ToolTipIcon.Info, True) + If oBackupInfo.CheckSum <> String.Empty Then + sHash = mgrHash.Generate_SHA256_Hash(sBackupFile) + If sHash <> oBackupInfo.CheckSum Then + RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_ErrorFailedCheck, oBackupInfo.Name), False, ToolTipIcon.Info, True) + If mgrCommon.ShowMessage(mgrRestore_ConfirmFailedCheck, oBackupInfo.Name, MsgBoxStyle.YesNo) = MsgBoxResult.No Then + RaiseEvent UpdateLog(mgrRestore_ErrorCheckAbort, False, ToolTipIcon.Info, True) + Return False End If Else - RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_NoVerify, oBackupInfo.Name), False, ToolTipIcon.Info, True) + RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_Verified, oBackupInfo.Name), False, ToolTipIcon.Info, True) End If + Else + RaiseEvent UpdateLog(mgrCommon.FormatString(mgrRestore_NoVerify, oBackupInfo.Name), False, ToolTipIcon.Info, True) End If + Return True End Function diff --git a/GBM/Managers/mgrSQLite.vb b/GBM/Managers/mgrSQLite.vb index 9744430..3990d8c 100644 --- a/GBM/Managers/mgrSQLite.vb +++ b/GBM/Managers/mgrSQLite.vb @@ -72,7 +72,7 @@ Public Class mgrSQLite 'Add Tables (Settings) sSql = "CREATE TABLE settings (SettingsID INTEGER NOT NULL PRIMARY KEY, MonitorOnStartup BOOLEAN NOT NULL, StartToTray BOOLEAN NOT NULL, ShowDetectionToolTips BOOLEAN NOT NULL, " & "DisableConfirmation BOOLEAN NOT NULL, CreateSubFolder BOOLEAN NOT NULL, ShowOverwriteWarning BOOLEAN NOT NULL, RestoreOnLaunch BOOLEAN NOT NULL, " & - "BackupFolder TEXT NOT NULL, Sync BOOLEAN NOT NULL, CheckSum BOOLEAN NOT NULL, StartWithWindows BOOLEAN NOT NULL, TimeTracking BOOLEAN NOT NULL, " & + "BackupFolder TEXT NOT NULL, Sync BOOLEAN NOT NULL, StartWithWindows BOOLEAN NOT NULL, TimeTracking BOOLEAN NOT NULL, " & "SupressBackup BOOLEAN NOT NULL, SupressBackupThreshold INTEGER NOT NULL, CompressionLevel INTEGER NOT NULL, Custom7zArguments TEXT, " & "Custom7zLocation TEXT, SyncFields INTEGER NOT NULL, AutoSaveLog BOOLEAN NOT NULL, AutoRestore BOOLEAN NOT NULL, AutoMark BOOLEAN NOT NULL);" @@ -606,8 +606,21 @@ Public Class mgrSQLite 'Backup DB before starting BackupDB("v98") + 'Remove checksum field + sSQL = "CREATE TABLE settings_new (SettingsID INTEGER NOT NULL PRIMARY KEY, MonitorOnStartup BOOLEAN NOT NULL, StartToTray BOOLEAN NOT NULL, ShowDetectionToolTips BOOLEAN NOT NULL, " & + "DisableConfirmation BOOLEAN NOT NULL, CreateSubFolder BOOLEAN NOT NULL, ShowOverwriteWarning BOOLEAN NOT NULL, RestoreOnLaunch BOOLEAN NOT NULL, " & + "BackupFolder TEXT NOT NULL, Sync BOOLEAN NOT NULL, StartWithWindows BOOLEAN NOT NULL, TimeTracking BOOLEAN NOT NULL, " & + "SupressBackup BOOLEAN NOT NULL, SupressBackupThreshold INTEGER NOT NULL, CompressionLevel INTEGER NOT NULL, Custom7zArguments TEXT, " & + "Custom7zLocation TEXT, SyncFields INTEGER NOT NULL, AutoSaveLog BOOLEAN NOT NULL);" + sSQL &= "INSERT INTO settings_new (SettingsID, MonitorOnStartup, StartToTray, ShowDetectionToolTips, DisableConfirmation, CreateSubFolder, " & + "ShowOverwriteWarning, RestoreOnLaunch, BackupFolder, Sync, StartWithWindows, TimeTracking, SupressBackup, SupressBackupThreshold, " & + "CompressionLevel, Custom7zArguments, Custom7zLocation, SyncFields, AutoSaveLog) " & + "SELECT SettingsID, MonitorOnStartup, StartToTray, ShowDetectionToolTips, DisableConfirmation, CreateSubFolder, " & + "ShowOverwriteWarning, RestoreOnLaunch, BackupFolder, Sync, StartWithWindows, TimeTracking, SupressBackup, SupressBackupThreshold, " & + "CompressionLevel, Custom7zArguments, Custom7zLocation, SyncFields, AutoSaveLog FROM settings;" & + "DROP TABLE settings; ALTER TABLE settings_new RENAME TO settings;" 'Add new field(s) - sSQL = "ALTER TABLE monitorlist ADD COLUMN CleanFolder BOOLEAN NOT NULL DEFAULT 0;" + sSQL &= "ALTER TABLE monitorlist ADD COLUMN CleanFolder BOOLEAN NOT NULL DEFAULT 0;" sSQL &= "ALTER TABLE settings ADD COLUMN AutoRestore BOOLEAN NOT NULL DEFAULT 0;" sSQL &= "ALTER TABLE settings ADD COLUMN AutoMark BOOLEAN NOT NULL DEFAULT 0;" sSQL &= "PRAGMA user_version=101" diff --git a/GBM/Managers/mgrSettings.vb b/GBM/Managers/mgrSettings.vb index 8bab6e1..73da1f9 100644 --- a/GBM/Managers/mgrSettings.vb +++ b/GBM/Managers/mgrSettings.vb @@ -12,7 +12,6 @@ Public Class mgrSettings Private bAutoRestore As Boolean = False Private bAutoMark As Boolean = False Private bSync As Boolean = True - Private bCheckSum As Boolean = True Private bTimeTracking As Boolean = True Private bSupressBackup As Boolean = False Private iSupressBackupThreshold As Integer = 10 @@ -122,15 +121,6 @@ Public Class mgrSettings End Set End Property - Property CheckSum As Boolean - Get - Return bCheckSum - End Get - Set(value As Boolean) - bCheckSum = value - End Set - End Property - Property TimeTracking As Boolean Get Return bTimeTracking @@ -269,7 +259,7 @@ Public Class mgrSettings oDatabase.RunParamQuery(sSQL, New Hashtable) sSQL = "INSERT INTO settings VALUES (1, @MonitorOnStartup, @StartToTray, @ShowDetectionToolTips, @DisableConfirmation, " - sSQL &= "@CreateSubFolder, @ShowOverwriteWarning, @RestoreOnLaunch, @BackupFolder, @Sync, @CheckSum, @StartWithWindows, " + sSQL &= "@CreateSubFolder, @ShowOverwriteWarning, @RestoreOnLaunch, @BackupFolder, @Sync, @StartWithWindows, " sSQL &= "@TimeTracking, @SupressBackup, @SupressBackupThreshold, @CompressionLevel, @Custom7zArguments, @Custom7zLocation, " sSQL &= "@SyncFields, @AutoSaveLog, @AutoRestore, @AutoMark)" @@ -282,7 +272,6 @@ Public Class mgrSettings hshParams.Add("RestoreOnLaunch", RestoreOnLaunch) hshParams.Add("BackupFolder", BackupFolder) hshParams.Add("Sync", Sync) - hshParams.Add("CheckSum", CheckSum) hshParams.Add("StartWithWindows", StartWithWindows) hshParams.Add("TimeTracking", TimeTracking) hshParams.Add("SupressBackup", SupressBackup) @@ -317,7 +306,6 @@ Public Class mgrSettings RestoreOnLaunch = CBool(dr("RestoreOnLaunch")) BackupFolder = CStr(dr("BackupFolder")) Sync = CBool(dr("Sync")) - CheckSum = CBool(dr("CheckSum")) StartWithWindows = CBool(dr("StartWithWindows")) TimeTracking = CBool(dr("TimeTracking")) SupressBackup = CBool(dr("SupressBackup")) diff --git a/GBM/My Project/Resources.Designer.vb b/GBM/My Project/Resources.Designer.vb index 571a768..af33cec 100644 --- a/GBM/My Project/Resources.Designer.vb +++ b/GBM/My Project/Resources.Designer.vb @@ -3453,15 +3453,6 @@ Namespace My.Resources End Get End Property - ''' - ''' Looks up a localized string similar to Verify backup files with a checksum. - ''' - Friend ReadOnly Property frmSettings_chkCheckSum() As String - Get - Return ResourceManager.GetString("frmSettings_chkCheckSum", resourceCulture) - End Get - End Property - ''' ''' Looks up a localized string similar to Create a sub-folder for each game. ''' diff --git a/GBM/My Project/Resources.resx b/GBM/My Project/Resources.resx index 4d31c70..f795a3a 100644 --- a/GBM/My Project/Resources.resx +++ b/GBM/My Project/Resources.resx @@ -1075,9 +1075,6 @@ Disable backup confirmation - - Verify backup files with a checksum - Create a sub-folder for each game From 71d09126c27c6a2f8d5e36de239c0e9c477f0f1e Mon Sep 17 00:00:00 2001 From: MikeMaximus Date: Tue, 14 Mar 2017 20:17:20 -0600 Subject: [PATCH 16/16] Update README.md --- README.md | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 99983e2..2b9012c 100644 --- a/README.md +++ b/README.md @@ -1,15 +1,15 @@ -# [Game Backup Monitor] (http://mikemaximus.github.io/gbm-web/) +# [Game Backup Monitor](http://mikemaximus.github.io/gbm-web/) -![Screenshot] (http://mikemaximus.github.io/gbm-web/images/manual/manual_01.jpg) +![Screenshot](http://mikemaximus.github.io/gbm-web/images/manual/manual_01.jpg) Game Backup Monitor is a simple, but flexible application that detects games as you play them. Once you finish playing a game, a backup of the saved games will be made automatically using 7-Zip compression. GBM can be used on a single computer, or on multiple computers to effectively add cloud support to any game or application. **License**: GNU General Public License version 3.0 (GPLv3)
-**Language**: English ([Translation FAQ] (http://mikemaximus.github.io/gbm-web/translations.html))
+**Language**: English ([Translation FAQ](http://mikemaximus.github.io/gbm-web/translations.html))
**Platform**: Windows (.NET 4) & Linux (Mono) -[About Game Backup Monitor] (http://mikemaximus.github.io/gbm-web/about.html)
-[Game Backup Monitor FAQ] (http://mikemaximus.github.io/gbm-web/faq.html)
-[Game Backup Monitor Manual] (http://mikemaximus.github.io/gbm-web/manual.html)
-[List of Preconfigured Games] (http://mikemaximus.github.io/gbm-web/GBM_Official.xml)

-Updates regarding this project are available via the [Game Backup Monitor web site] (http://mikemaximus.github.io/gbm-web/). +[About Game Backup Monitor](http://mikemaximus.github.io/gbm-web/about.html)
+[Game Backup Monitor FAQ](http://mikemaximus.github.io/gbm-web/faq.html)
+[Game Backup Monitor Manual](http://mikemaximus.github.io/gbm-web/manual.html)
+[List of Preconfigured Games](http://mikemaximus.github.io/gbm-web/GBM_Official.xml)

+Updates regarding this project are available via the [Game Backup Monitor web site](http://mikemaximus.github.io/gbm-web/).