From 0e4f357c01e58b2676676f3f6835ab7b8e413067 Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Sun, 22 May 2016 22:47:28 -0600 Subject: [PATCH] Added backend for new Settings --- GBM/Forms/frmSettings.Designer.vb | 116 +++++++++++++-------------- GBM/Forms/frmSettings.vb | 65 +++++++++++---- GBM/Managers/mgrSQLite.vb | 32 +++++++- GBM/Managers/mgrSettings.vb | 87 +++++++++++++++++++- GBM/My Project/AssemblyInfo.vb | 10 +-- GBM/My Project/Resources.Designer.vb | 31 ++++--- GBM/My Project/Resources.resx | 23 +++--- 7 files changed, 261 insertions(+), 103 deletions(-) diff --git a/GBM/Forms/frmSettings.Designer.vb b/GBM/Forms/frmSettings.Designer.vb index 92f0af1..5381c98 100644 --- a/GBM/Forms/frmSettings.Designer.vb +++ b/GBM/Forms/frmSettings.Designer.vb @@ -55,10 +55,10 @@ Partial Class frmSettings Me.cboCompression = New System.Windows.Forms.ComboBox() Me.lblCompression = New System.Windows.Forms.Label() Me.grpSync = New System.Windows.Forms.GroupBox() - Me.grpSyncOptions = New System.Windows.Forms.GroupBox() + Me.grpSyncData = New System.Windows.Forms.GroupBox() Me.chkSyncTags = New System.Windows.Forms.CheckBox() - Me.chkSyncAllData = New System.Windows.Forms.CheckBox() - Me.chkSyncConfig = New System.Windows.Forms.CheckBox() + Me.chkSyncAll = New System.Windows.Forms.CheckBox() + Me.chkSyncGameConfigs = New System.Windows.Forms.CheckBox() Me.chkSyncGameInfo = New System.Windows.Forms.CheckBox() Me.chkSyncHours = New System.Windows.Forms.CheckBox() Me.btnDefaults = New System.Windows.Forms.Button() @@ -68,7 +68,7 @@ Partial Class frmSettings CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).BeginInit() Me.grp7z.SuspendLayout() Me.grpSync.SuspendLayout() - Me.grpSyncOptions.SuspendLayout() + Me.grpSyncData.SuspendLayout() Me.SuspendLayout() ' 'chkMonitorOnStartup @@ -100,7 +100,7 @@ Partial Class frmSettings Me.grpGeneral.Controls.Add(Me.chkMonitorOnStartup) Me.grpGeneral.Location = New System.Drawing.Point(12, 12) Me.grpGeneral.Name = "grpGeneral" - Me.grpGeneral.Size = New System.Drawing.Size(360, 165) + Me.grpGeneral.Size = New System.Drawing.Size(215, 165) Me.grpGeneral.TabIndex = 0 Me.grpGeneral.TabStop = False Me.grpGeneral.Text = "General" @@ -160,7 +160,7 @@ Partial Class frmSettings Me.grpPaths.Controls.Add(Me.btnBackupFolder) Me.grpPaths.Controls.Add(Me.lblBackupFolder) Me.grpPaths.Controls.Add(Me.txtBackupFolder) - Me.grpPaths.Location = New System.Drawing.Point(377, 326) + Me.grpPaths.Location = New System.Drawing.Point(233, 326) Me.grpPaths.Name = "grpPaths" Me.grpPaths.Size = New System.Drawing.Size(360, 60) Me.grpPaths.TabIndex = 3 @@ -195,7 +195,7 @@ Partial Class frmSettings 'btnSave ' Me.btnSave.DialogResult = System.Windows.Forms.DialogResult.OK - Me.btnSave.Location = New System.Drawing.Point(581, 392) + Me.btnSave.Location = New System.Drawing.Point(437, 392) Me.btnSave.Name = "btnSave" Me.btnSave.Size = New System.Drawing.Size(75, 23) Me.btnSave.TabIndex = 5 @@ -205,7 +205,7 @@ Partial Class frmSettings 'btnCancel ' Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel - Me.btnCancel.Location = New System.Drawing.Point(662, 392) + Me.btnCancel.Location = New System.Drawing.Point(518, 392) Me.btnCancel.Name = "btnCancel" Me.btnCancel.Size = New System.Drawing.Size(75, 23) Me.btnCancel.TabIndex = 6 @@ -222,7 +222,7 @@ Partial Class frmSettings Me.grpBackup.Controls.Add(Me.chkOverwriteWarning) Me.grpBackup.Controls.Add(Me.chkCreateFolder) Me.grpBackup.Controls.Add(Me.chkBackupConfirm) - Me.grpBackup.Location = New System.Drawing.Point(378, 12) + Me.grpBackup.Location = New System.Drawing.Point(233, 12) Me.grpBackup.Name = "grpBackup" Me.grpBackup.Size = New System.Drawing.Size(360, 165) Me.grpBackup.TabIndex = 2 @@ -307,7 +307,7 @@ Partial Class frmSettings Me.grp7z.Controls.Add(Me.lbl7zProduct) Me.grp7z.Controls.Add(Me.cboCompression) Me.grp7z.Controls.Add(Me.lblCompression) - Me.grp7z.Location = New System.Drawing.Point(377, 183) + Me.grp7z.Location = New System.Drawing.Point(233, 183) Me.grp7z.Name = "grp7z" Me.grp7z.Size = New System.Drawing.Size(360, 137) Me.grp7z.TabIndex = 3 @@ -325,9 +325,9 @@ Partial Class frmSettings ' 'txt7zLocation ' - Me.txt7zLocation.Location = New System.Drawing.Point(88, 70) + Me.txt7zLocation.Location = New System.Drawing.Point(110, 70) Me.txt7zLocation.Name = "txt7zLocation" - Me.txt7zLocation.Size = New System.Drawing.Size(233, 20) + Me.txt7zLocation.Size = New System.Drawing.Size(211, 20) Me.txt7zLocation.TabIndex = 5 ' 'lblLocation @@ -335,15 +335,15 @@ Partial Class frmSettings Me.lblLocation.AutoSize = True Me.lblLocation.Location = New System.Drawing.Point(6, 73) Me.lblLocation.Name = "lblLocation" - Me.lblLocation.Size = New System.Drawing.Size(51, 13) + Me.lblLocation.Size = New System.Drawing.Size(89, 13) Me.lblLocation.TabIndex = 4 - Me.lblLocation.Text = "Location:" + Me.lblLocation.Text = "Custom Location:" ' 'txt7zArguments ' - Me.txt7zArguments.Location = New System.Drawing.Point(88, 44) + Me.txt7zArguments.Location = New System.Drawing.Point(110, 44) Me.txt7zArguments.Name = "txt7zArguments" - Me.txt7zArguments.Size = New System.Drawing.Size(266, 20) + Me.txt7zArguments.Size = New System.Drawing.Size(244, 20) Me.txt7zArguments.TabIndex = 3 ' 'lblArguments @@ -351,9 +351,9 @@ Partial Class frmSettings Me.lblArguments.AutoSize = True Me.lblArguments.Location = New System.Drawing.Point(6, 47) Me.lblArguments.Name = "lblArguments" - Me.lblArguments.Size = New System.Drawing.Size(60, 13) + Me.lblArguments.Size = New System.Drawing.Size(98, 13) Me.lblArguments.TabIndex = 2 - Me.lblArguments.Text = "Arguments:" + Me.lblArguments.Text = "Custom Arguments:" ' 'lbl7zCopyright ' @@ -375,9 +375,9 @@ Partial Class frmSettings ' Me.cboCompression.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList Me.cboCompression.FormattingEnabled = True - Me.cboCompression.Location = New System.Drawing.Point(88, 17) + Me.cboCompression.Location = New System.Drawing.Point(110, 17) Me.cboCompression.Name = "cboCompression" - Me.cboCompression.Size = New System.Drawing.Size(266, 21) + Me.cboCompression.Size = New System.Drawing.Size(244, 21) Me.cboCompression.TabIndex = 1 ' 'lblCompression @@ -391,28 +391,28 @@ Partial Class frmSettings ' 'grpSync ' - Me.grpSync.Controls.Add(Me.grpSyncOptions) + Me.grpSync.Controls.Add(Me.grpSyncData) Me.grpSync.Controls.Add(Me.chkSync) Me.grpSync.Location = New System.Drawing.Point(12, 183) Me.grpSync.Name = "grpSync" - Me.grpSync.Size = New System.Drawing.Size(359, 203) + Me.grpSync.Size = New System.Drawing.Size(215, 203) Me.grpSync.TabIndex = 1 Me.grpSync.TabStop = False - Me.grpSync.Text = "Sync Game Data" + Me.grpSync.Text = "Sync Options" ' - 'grpSyncOptions + 'grpSyncData ' - Me.grpSyncOptions.Controls.Add(Me.chkSyncTags) - Me.grpSyncOptions.Controls.Add(Me.chkSyncAllData) - Me.grpSyncOptions.Controls.Add(Me.chkSyncConfig) - Me.grpSyncOptions.Controls.Add(Me.chkSyncGameInfo) - Me.grpSyncOptions.Controls.Add(Me.chkSyncHours) - Me.grpSyncOptions.Location = New System.Drawing.Point(6, 47) - Me.grpSyncOptions.Name = "grpSyncOptions" - Me.grpSyncOptions.Size = New System.Drawing.Size(347, 140) - Me.grpSyncOptions.TabIndex = 1 - Me.grpSyncOptions.TabStop = False - Me.grpSyncOptions.Text = "Sync Options" + Me.grpSyncData.Controls.Add(Me.chkSyncTags) + Me.grpSyncData.Controls.Add(Me.chkSyncAll) + Me.grpSyncData.Controls.Add(Me.chkSyncGameConfigs) + Me.grpSyncData.Controls.Add(Me.chkSyncGameInfo) + Me.grpSyncData.Controls.Add(Me.chkSyncHours) + Me.grpSyncData.Location = New System.Drawing.Point(6, 47) + Me.grpSyncData.Name = "grpSyncData" + Me.grpSyncData.Size = New System.Drawing.Size(194, 140) + Me.grpSyncData.TabIndex = 1 + Me.grpSyncData.TabStop = False + Me.grpSyncData.Text = "Sync Data" ' 'chkSyncTags ' @@ -424,25 +424,25 @@ Partial Class frmSettings Me.chkSyncTags.Text = "Tags" Me.chkSyncTags.UseVisualStyleBackColor = True ' - 'chkSyncAllData + 'chkSyncAll ' - Me.chkSyncAllData.AutoSize = True - Me.chkSyncAllData.Location = New System.Drawing.Point(6, 111) - Me.chkSyncAllData.Name = "chkSyncAllData" - Me.chkSyncAllData.Size = New System.Drawing.Size(164, 17) - Me.chkSyncAllData.TabIndex = 4 - Me.chkSyncAllData.Text = "All Data (Not Recommended)" - Me.chkSyncAllData.UseVisualStyleBackColor = True + Me.chkSyncAll.AutoSize = True + Me.chkSyncAll.Location = New System.Drawing.Point(6, 111) + Me.chkSyncAll.Name = "chkSyncAll" + Me.chkSyncAll.Size = New System.Drawing.Size(164, 17) + Me.chkSyncAll.TabIndex = 4 + Me.chkSyncAll.Text = "All Data (Not Recommended)" + Me.chkSyncAll.UseVisualStyleBackColor = True ' - 'chkSyncConfig + 'chkSyncGameConfigs ' - Me.chkSyncConfig.AutoSize = True - Me.chkSyncConfig.Location = New System.Drawing.Point(6, 19) - Me.chkSyncConfig.Name = "chkSyncConfig" - Me.chkSyncConfig.Size = New System.Drawing.Size(88, 17) - Me.chkSyncConfig.TabIndex = 0 - Me.chkSyncConfig.Text = "Configuration" - Me.chkSyncConfig.UseVisualStyleBackColor = True + Me.chkSyncGameConfigs.AutoSize = True + Me.chkSyncGameConfigs.Location = New System.Drawing.Point(6, 19) + Me.chkSyncGameConfigs.Name = "chkSyncGameConfigs" + Me.chkSyncGameConfigs.Size = New System.Drawing.Size(124, 17) + Me.chkSyncGameConfigs.TabIndex = 0 + Me.chkSyncGameConfigs.Text = "Game Configurations" + Me.chkSyncGameConfigs.UseVisualStyleBackColor = True ' 'chkSyncGameInfo ' @@ -470,14 +470,14 @@ Partial Class frmSettings Me.btnDefaults.Name = "btnDefaults" Me.btnDefaults.Size = New System.Drawing.Size(110, 23) Me.btnDefaults.TabIndex = 4 - Me.btnDefaults.Text = "Use &Defaults" + Me.btnDefaults.Text = "Set &Defaults" Me.btnDefaults.UseVisualStyleBackColor = True ' 'frmSettings ' Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!) Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font - Me.ClientSize = New System.Drawing.Size(749, 426) + Me.ClientSize = New System.Drawing.Size(604, 426) Me.Controls.Add(Me.grpSync) Me.Controls.Add(Me.btnDefaults) Me.Controls.Add(Me.grp7z) @@ -505,8 +505,8 @@ Partial Class frmSettings Me.grp7z.PerformLayout() Me.grpSync.ResumeLayout(False) Me.grpSync.PerformLayout() - Me.grpSyncOptions.ResumeLayout(False) - Me.grpSyncOptions.PerformLayout() + Me.grpSyncData.ResumeLayout(False) + Me.grpSyncData.PerformLayout() Me.ResumeLayout(False) End Sub @@ -538,7 +538,7 @@ Partial Class frmSettings Friend WithEvents lbl7zProduct As Label Friend WithEvents lbl7zCopyright As Label Friend WithEvents grpSync As GroupBox - Friend WithEvents chkSyncConfig As CheckBox + Friend WithEvents chkSyncGameConfigs As CheckBox Friend WithEvents btn7zLocation As Button Friend WithEvents txt7zLocation As TextBox Friend WithEvents lblLocation As Label @@ -547,7 +547,7 @@ Partial Class frmSettings Friend WithEvents chkSyncHours As CheckBox Friend WithEvents chkSyncGameInfo As CheckBox Friend WithEvents btnDefaults As Button - Friend WithEvents grpSyncOptions As GroupBox - Friend WithEvents chkSyncAllData As CheckBox + Friend WithEvents grpSyncData As GroupBox + Friend WithEvents chkSyncAll As CheckBox Friend WithEvents chkSyncTags As CheckBox End Class diff --git a/GBM/Forms/frmSettings.vb b/GBM/Forms/frmSettings.vb index 82dde7b..5c3adfd 100644 --- a/GBM/Forms/frmSettings.vb +++ b/GBM/Forms/frmSettings.vb @@ -42,23 +42,22 @@ Public Class frmSettings Private Sub HandleSyncState() If chkSync.Checked Then - grpSyncOptions.Enabled = True + grpSyncData.Enabled = True Else - grpSyncOptions.Enabled = False + grpSyncData.Enabled = False End If End Sub Private Sub HandleSyncAllDataState() - If chkSyncAllData.Checked Then - For Each chk As CheckBox In grpSyncOptions.Controls - If Not chk Is chkSyncAllData Then - chk.Checked = False + If chkSyncAll.Checked Then + For Each chk As CheckBox In grpSyncData.Controls + If Not chk Is chkSyncAll Then chk.Enabled = False End If Next Else - For Each chk As CheckBox In grpSyncOptions.Controls - If Not chk Is chkSyncAllData Then + For Each chk As CheckBox In grpSyncData.Controls + If Not chk Is chkSyncAll Then chk.Enabled = True End If Next @@ -84,6 +83,10 @@ Public Class frmSettings oSettings.SupressBackup = chkSupressBackup.Checked oSettings.SupressBackupThreshold = nudSupressBackupThreshold.Value oSettings.CompressionLevel = cboCompression.SelectedValue + oSettings.Custom7zArguments = txt7zArguments.Text + + 'TODO: Add Custom Location Validation! + oSettings.Custom7zLocation = txt7zLocation.Text 'We need to clear all checksums its turned off If chkCheckSum.Checked = False And oSettings.CheckSum = True Then @@ -96,6 +99,11 @@ Public Class frmSettings bBackupLocationChanged = True End If oSettings.Sync = chkSync.Checked + oSettings.SyncGameConfigs = chkSyncGameConfigs.Checked + oSettings.SyncGameInfo = chkSyncGameInfo.Checked + oSettings.SyncHours = chkSyncHours.Checked + oSettings.SyncTags = chkSyncTags.Checked + oSettings.SyncAll = chkSyncAll.Checked If IO.Directory.Exists(txtBackupFolder.Text) Then If oSettings.BackupFolder <> txtBackupFolder.Text Then @@ -107,6 +115,10 @@ Public Class frmSettings Return False End If + If oSettings.Custom7zArguments <> String.Empty Then + mgrCommon.ShowMessage(frmSettings_WarningArguments, MsgBoxStyle.Exclamation) + End If + Return True End Function @@ -121,9 +133,15 @@ Public Class frmSettings End If End Function - Private Sub Get7zInfo() + Private Sub Get7zInfo(ByVal sLocation As String) Try - Dim oFileInfo As FileVersionInfo = FileVersionInfo.GetVersionInfo(mgrPath.Utility7zLocation) + 'Use default when no custom location is set + If sLocation = String.Empty Then + sLocation = mgrPath.Utility7zLocation + End If + + 'Get info + Dim oFileInfo As FileVersionInfo = FileVersionInfo.GetVersionInfo(sLocation) lbl7zProduct.Text = oFileInfo.FileDescription & " " & oFileInfo.ProductVersion lbl7zCopyright.Text = oFileInfo.LegalCopyright Catch ex As Exception @@ -142,12 +160,19 @@ Public Class frmSettings chkRestoreOnLaunch.Checked = oSettings.RestoreOnLaunch txtBackupFolder.Text = oSettings.BackupFolder chkSync.Checked = oSettings.Sync + chkSyncGameConfigs.Checked = oSettings.SyncGameConfigs + chkSyncGameInfo.Checked = oSettings.SyncGameInfo + chkSyncHours.Checked = oSettings.SyncHours + chkSyncTags.Checked = oSettings.SyncTags + chkSyncAll.Checked = oSettings.SyncAll chkCheckSum.Checked = oSettings.CheckSum chkTimeTracking.Checked = oSettings.TimeTracking chkSupressBackup.Checked = oSettings.SupressBackup nudSupressBackupThreshold.Value = oSettings.SupressBackupThreshold nudSupressBackupThreshold.Enabled = chkSupressBackup.Checked cboCompression.SelectedValue = oSettings.CompressionLevel + txt7zArguments.Text = oSettings.Custom7zArguments + txt7zLocation.Text = oSettings.Custom7zLocation 'Unix Handler If mgrCommon.IsUnix Then @@ -156,7 +181,7 @@ Public Class frmSettings End If 'Retrieve 7z Info - Get7zInfo() + Get7zInfo(oSettings.Custom7zLocation) End Sub Private Sub LoadCombos() @@ -204,18 +229,18 @@ Public Class frmSettings grp7z.Text = frmSettings_grp7z lblCompression.Text = frmSettings_lblCompression grpSync.Text = frmSettings_grpSync - grpSyncOptions.Text = frmSettings_grpSyncOptions - chkSyncConfig.Text = frmSettings_chkSyncConfig + grpSyncData.Text = frmSettings_grpSyncOptions + chkSyncGameConfigs.Text = frmSettings_chkSyncGameConfigs chkSyncGameInfo.Text = frmSettings_chkSyncGameInfo chkSyncHours.Text = frmSettings_chkSyncHours chkSyncTags.Text = frmSettings_chkSyncTags - chkSyncAllData.Text = frmSettings_chkSyncAllData + chkSyncAll.Text = frmSettings_chkSyncAll btnDefaults.Text = frmSettings_btnDefaults lblArguments.Text = frmSettings_lblArguments lblLocation.Text = frmSettings_lblLocation 'Unix Handler - If mgrCommon.IsUnix Then + If mgrCommon.IsUnix Then chkStartToTray.Enabled = False chkStartWindows.Enabled = False End If @@ -254,7 +279,10 @@ Public Class frmSettings Private Sub btn7zLocation_Click(sender As Object, e As EventArgs) Handles btn7zLocation.Click Dim sNewLocation As String sNewLocation = mgrCommon.OpenFileBrowser(frmSettings_Browse7za, "exe", frmSettings_7zaFileType, Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments), False) - If sNewLocation <> String.Empty Then txt7zLocation.Text = sNewLocation + If sNewLocation <> String.Empty Then + txt7zLocation.Text = sNewLocation + Get7zInfo(txt7zLocation.Text) + End If End Sub Private Sub chkSupressBackup_CheckedChanged(sender As Object, e As EventArgs) Handles chkSupressBackup.CheckedChanged @@ -265,8 +293,11 @@ Public Class frmSettings HandleSyncState() End Sub - Private Sub chkSyncAllData_CheckedChanged(sender As Object, e As EventArgs) Handles chkSyncAllData.CheckedChanged + Private Sub chkSyncAllData_CheckedChanged(sender As Object, e As EventArgs) Handles chkSyncAll.CheckedChanged HandleSyncAllDataState() End Sub + Private Sub txt7zLocation_Leave(sender As Object, e As EventArgs) Handles txt7zLocation.Leave + Get7zInfo(txt7zLocation.Text) + End Sub End Class \ No newline at end of file diff --git a/GBM/Managers/mgrSQLite.vb b/GBM/Managers/mgrSQLite.vb index 7821f90..7380ea1 100644 --- a/GBM/Managers/mgrSQLite.vb +++ b/GBM/Managers/mgrSQLite.vb @@ -73,7 +73,9 @@ Public Class mgrSQLite 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, " & - "SupressBackup BOOLEAN NOT NULL, SupressBackupThreshold INTEGER NOT NULL, CompressionLevel INTEGER NOT NULL);" + "SupressBackup BOOLEAN NOT NULL, SupressBackupThreshold INTEGER NOT NULL, CompressionLevel INTEGER NOT NULL, Custom7zArguments TEXT, " & + "Custom7zLocation TEXT, SyncGameConfigs BOOLEAN NOT NULL, SyncGameInfo BOOLEAN NOT NULL, SyncHours BOOLEAN NOT NULL, SyncTags BOOLEAN NOT NULL, " & + "SyncAll 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, " & @@ -530,6 +532,34 @@ Public Class mgrSQLite End If End If + '0.97 Upgrade + If GetDatabaseVersion() < 97 Then + If eDatabase = Database.Local Then + 'Backup DB before starting + BackupDB("v96") + + 'Add new setting + sSQL = "ALTER TABLE settings ADD COLUMN Custom7zArguments TEXT;" + sSQL &= "ALTER TABLE settings ADD COLUMN Custom7zLocation TEXT;" + sSQL &= "ALTER TABLE settings ADD COLUMN SyncGameConfigs BOOLEAN NOT NULL DEFAULT 1;" + sSQL &= "ALTER TABLE settings ADD COLUMN SyncGameInfo BOOLEAN NOT NULL DEFAULT 0;" + sSQL &= "ALTER TABLE settings ADD COLUMN SyncHours BOOLEAN NOT NULL DEFAULT 1;" + sSQL &= "ALTER TABLE settings ADD COLUMN SyncTags BOOLEAN NOT NULL DEFAULT 1;" + sSQL &= "ALTER TABLE settings ADD COLUMN SyncAll BOOLEAN NOT NULL DEFAULT 0;" + sSQL &= "PRAGMA user_version=97" + + RunParamQuery(sSQL, New Hashtable) + End If + If eDatabase = Database.Remote Then + 'Backup DB before starting + BackupDB("v96") + + sSQL = "PRAGMA user_version=97" + + RunParamQuery(sSQL, New Hashtable) + End If + End If + End Sub Public Function GetDBSize() As Long diff --git a/GBM/Managers/mgrSettings.vb b/GBM/Managers/mgrSettings.vb index 123ac15..fef6feb 100644 --- a/GBM/Managers/mgrSettings.vb +++ b/GBM/Managers/mgrSettings.vb @@ -10,11 +10,18 @@ Public Class mgrSettings Private bShowOverwriteWarning As Boolean = True Private bRestoreOnLaunch As Boolean = False Private bSync As Boolean = True + Private bSyncGameConfigs As Boolean = True + Private bSyncGameInfo As Boolean = False + Private bSyncHours As Boolean = True + Private bSyncTags As Boolean = True + Private bSyncAll As Boolean = False Private bCheckSum As Boolean = True Private bTimeTracking As Boolean = True Private bSupressBackup As Boolean = False Private iSupressBackupThreshold As Integer = 10 Private iCompressionLevel As Integer = 5 + Private s7zArguments As String = String.Empty + Private s7zLocation As String = String.Empty Private sBackupFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).TrimEnd(New Char() {"\", "/"}) Property StartWithWindows As Boolean @@ -98,6 +105,51 @@ Public Class mgrSettings End Set End Property + Property SyncGameConfigs As Boolean + Get + Return bSyncGameConfigs + End Get + Set(value As Boolean) + bSyncGameConfigs = value + End Set + End Property + + Property SyncGameInfo As Boolean + Get + Return bSyncGameInfo + End Get + Set(value As Boolean) + bSyncGameInfo = value + End Set + End Property + + Property SyncHours As Boolean + Get + Return bSyncHours + End Get + Set(value As Boolean) + bSyncHours = value + End Set + End Property + + Property SyncTags As Boolean + Get + Return bSyncTags + End Get + Set(value As Boolean) + bSyncTags = value + End Set + End Property + + Property SyncAll As Boolean + Get + Return bSyncAll + End Get + Set(value As Boolean) + bSyncAll = value + End Set + End Property + Property CheckSum As Boolean Get Return bCheckSum @@ -143,6 +195,24 @@ Public Class mgrSettings End Set End Property + Property Custom7zArguments As String + Get + Return s7zArguments + End Get + Set(value As String) + s7zArguments = value + End Set + End Property + + Property Custom7zLocation As String + Get + Return s7zLocation + End Get + Set(value As String) + s7zLocation = value + End Set + End Property + Property BackupFolder As String Get Return sBackupFolder @@ -162,7 +232,8 @@ 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)" + sSQL &= "@TimeTracking, @SupressBackup, @SupressBackupThreshold, @CompressionLevel, @Custom7zArguments, @Custom7zLocation, " + sSQL &= "@SyncGameConfigs, @SyncGameInfo, @SyncHours, @SyncTags, @SyncAll)" hshParams.Add("MonitorOnStartup", MonitorOnStartup) hshParams.Add("StartToTray", StartToTray) @@ -179,6 +250,13 @@ Public Class mgrSettings hshParams.Add("SupressBackup", SupressBackup) hshParams.Add("SupressBackupThreshold", SupressBackupThreshold) hshParams.Add("CompressionLevel", CompressionLevel) + hshParams.Add("Custom7zArguments", Custom7zArguments) + hshParams.Add("Custom7zLocation", Custom7zLocation) + hshParams.Add("SyncGameConfigs", SyncGameConfigs) + hshParams.Add("SyncGameInfo", SyncGameInfo) + hshParams.Add("SyncHours", SyncHours) + hshParams.Add("SyncTags", SyncTags) + hshParams.Add("SyncAll", SyncAll) oDatabase.RunParamQuery(sSQL, hshParams) End Sub @@ -209,6 +287,13 @@ Public Class mgrSettings SupressBackup = CBool(dr("SupressBackup")) SupressBackupThreshold = CInt(dr("SupressBackupThreshold")) CompressionLevel = CInt(dr("CompressionLevel")) + If Not IsDBNull(dr("Custom7zArguments")) Then Custom7zArguments = CStr(dr("Custom7zArguments")) + If Not IsDBNull(dr("Custom7zLocation")) Then Custom7zLocation = CStr(dr("Custom7zLocation")) + SyncGameConfigs = CBool(dr("SyncGameConfigs")) + SyncGameInfo = CBool(dr("SyncGameInfo")) + SyncHours = CBool(dr("SyncHours")) + SyncTags = CBool(dr("SyncTags")) + SyncAll = CBool(dr("SyncAll")) Next oDatabase.Disconnect() diff --git a/GBM/My Project/AssemblyInfo.vb b/GBM/My Project/AssemblyInfo.vb index 1ec94e5..d04a3c8 100644 --- a/GBM/My Project/AssemblyInfo.vb +++ b/GBM/My Project/AssemblyInfo.vb @@ -13,14 +13,14 @@ Imports System.Runtime.InteropServices - - + + 'The following GUID is for the ID of the typelib if this project is exposed to COM - + ' Version information for an assembly consists of the following four values: ' @@ -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 144d25c..c093fb1 100644 --- a/GBM/My Project/Resources.Designer.vb +++ b/GBM/My Project/Resources.Designer.vb @@ -3103,7 +3103,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to Use &Defaults. + ''' Looks up a localized string similar to Set &Defaults. ''' Friend ReadOnly Property frmSettings_btnDefaults() As String Get @@ -3276,18 +3276,18 @@ Namespace My.Resources ''' ''' Looks up a localized string similar to All Data (Not Recommened). ''' - Friend ReadOnly Property frmSettings_chkSyncAllData() As String + Friend ReadOnly Property frmSettings_chkSyncAll() As String Get - Return ResourceManager.GetString("frmSettings_chkSyncAllData", resourceCulture) + Return ResourceManager.GetString("frmSettings_chkSyncAll", resourceCulture) End Get End Property ''' - ''' Looks up a localized string similar to Configuration. + ''' Looks up a localized string similar to Game Configurations. ''' - Friend ReadOnly Property frmSettings_chkSyncConfig() As String + Friend ReadOnly Property frmSettings_chkSyncGameConfigs() As String Get - Return ResourceManager.GetString("frmSettings_chkSyncConfig", resourceCulture) + Return ResourceManager.GetString("frmSettings_chkSyncGameConfigs", resourceCulture) End Get End Property @@ -3355,7 +3355,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to 7z Options. + ''' Looks up a localized string similar to 7-Zip Options. ''' Friend ReadOnly Property frmSettings_grp7z() As String Get @@ -3391,7 +3391,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to Sync Game Data. + ''' Looks up a localized string similar to Sync Options. ''' Friend ReadOnly Property frmSettings_grpSync() As String Get @@ -3400,7 +3400,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to Sync Options. + ''' Looks up a localized string similar to Sync Data. ''' Friend ReadOnly Property frmSettings_grpSyncOptions() As String Get @@ -3409,7 +3409,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to Arguments:. + ''' Looks up a localized string similar to Custom Arguments:. ''' Friend ReadOnly Property frmSettings_lblArguments() As String Get @@ -3436,7 +3436,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to Location:. + ''' Looks up a localized string similar to Custom Location:. ''' Friend ReadOnly Property frmSettings_lblLocation() As String Get @@ -3453,6 +3453,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to Custom 7-Zip arguments can cause backup or restore operations to fail.[BR][BR]If problems occur, clear the arguments and refer to the GBM manual.. + ''' + Friend ReadOnly Property frmSettings_WarningArguments() As String + Get + Return ResourceManager.GetString("frmSettings_WarningArguments", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Choose a backup folder:. ''' diff --git a/GBM/My Project/Resources.resx b/GBM/My Project/Resources.resx index 0d03547..0d677f4 100644 --- a/GBM/My Project/Resources.resx +++ b/GBM/My Project/Resources.resx @@ -1526,7 +1526,7 @@ Ultra - 7z Options + 7-Zip Options Compression: @@ -1598,13 +1598,13 @@ Search Aborted! - Use &Defaults + Set &Defaults - + All Data (Not Recommened) - - Configuration + + Game Configurations Game Information @@ -1619,16 +1619,16 @@ Unable to retrieve 7z product information! - Sync Game Data - - Sync Options + + Sync Data + - Arguments: + Custom Arguments: - Location: + Custom Location: Executable @@ -1636,4 +1636,7 @@ Locate 7-Zip Console (7za) + + Custom 7-Zip arguments can cause backup or restore operations to fail.[BR][BR]If problems occur, clear the arguments and refer to the GBM manual. + \ No newline at end of file