Update for issue #35
This commit is contained in:
Generated
+46
-7
@@ -44,10 +44,14 @@ Partial Class frmSettings
|
||||
Me.chkRestoreOnLaunch = New System.Windows.Forms.CheckBox()
|
||||
Me.chkOverwriteWarning = New System.Windows.Forms.CheckBox()
|
||||
Me.chkCreateFolder = New System.Windows.Forms.CheckBox()
|
||||
Me.grp7z = New System.Windows.Forms.GroupBox()
|
||||
Me.lblCompression = New System.Windows.Forms.Label()
|
||||
Me.cboCompression = New System.Windows.Forms.ComboBox()
|
||||
Me.grpGeneral.SuspendLayout()
|
||||
Me.grpPaths.SuspendLayout()
|
||||
Me.grpBackup.SuspendLayout()
|
||||
CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).BeginInit()
|
||||
Me.grp7z.SuspendLayout()
|
||||
Me.SuspendLayout()
|
||||
'
|
||||
'chkMonitorOnStartup
|
||||
@@ -140,10 +144,10 @@ 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(12, 360)
|
||||
Me.grpPaths.Location = New System.Drawing.Point(12, 410)
|
||||
Me.grpPaths.Name = "grpPaths"
|
||||
Me.grpPaths.Size = New System.Drawing.Size(360, 60)
|
||||
Me.grpPaths.TabIndex = 2
|
||||
Me.grpPaths.TabIndex = 3
|
||||
Me.grpPaths.TabStop = False
|
||||
Me.grpPaths.Text = "Paths"
|
||||
'
|
||||
@@ -175,7 +179,7 @@ Partial Class frmSettings
|
||||
'btnSave
|
||||
'
|
||||
Me.btnSave.DialogResult = System.Windows.Forms.DialogResult.OK
|
||||
Me.btnSave.Location = New System.Drawing.Point(216, 426)
|
||||
Me.btnSave.Location = New System.Drawing.Point(216, 476)
|
||||
Me.btnSave.Name = "btnSave"
|
||||
Me.btnSave.Size = New System.Drawing.Size(75, 23)
|
||||
Me.btnSave.TabIndex = 3
|
||||
@@ -185,7 +189,7 @@ Partial Class frmSettings
|
||||
'btnCancel
|
||||
'
|
||||
Me.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel
|
||||
Me.btnCancel.Location = New System.Drawing.Point(297, 426)
|
||||
Me.btnCancel.Location = New System.Drawing.Point(297, 476)
|
||||
Me.btnCancel.Name = "btnCancel"
|
||||
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
|
||||
Me.btnCancel.TabIndex = 4
|
||||
@@ -204,7 +208,7 @@ Partial Class frmSettings
|
||||
Me.grpBackup.Controls.Add(Me.chkBackupConfirm)
|
||||
Me.grpBackup.Location = New System.Drawing.Point(12, 183)
|
||||
Me.grpBackup.Name = "grpBackup"
|
||||
Me.grpBackup.Size = New System.Drawing.Size(360, 171)
|
||||
Me.grpBackup.Size = New System.Drawing.Size(360, 168)
|
||||
Me.grpBackup.TabIndex = 1
|
||||
Me.grpBackup.TabStop = False
|
||||
Me.grpBackup.Text = "Backup and Restore"
|
||||
@@ -276,11 +280,41 @@ Partial Class frmSettings
|
||||
Me.chkCreateFolder.Text = "Create a sub-folder for each game"
|
||||
Me.chkCreateFolder.UseVisualStyleBackColor = True
|
||||
'
|
||||
'grp7z
|
||||
'
|
||||
Me.grp7z.Controls.Add(Me.cboCompression)
|
||||
Me.grp7z.Controls.Add(Me.lblCompression)
|
||||
Me.grp7z.Location = New System.Drawing.Point(12, 357)
|
||||
Me.grp7z.Name = "grp7z"
|
||||
Me.grp7z.Size = New System.Drawing.Size(360, 47)
|
||||
Me.grp7z.TabIndex = 2
|
||||
Me.grp7z.TabStop = False
|
||||
Me.grp7z.Text = "7z Options"
|
||||
'
|
||||
'lblCompression
|
||||
'
|
||||
Me.lblCompression.AutoSize = True
|
||||
Me.lblCompression.Location = New System.Drawing.Point(6, 20)
|
||||
Me.lblCompression.Name = "lblCompression"
|
||||
Me.lblCompression.Size = New System.Drawing.Size(70, 13)
|
||||
Me.lblCompression.TabIndex = 0
|
||||
Me.lblCompression.Text = "Compression:"
|
||||
'
|
||||
'cboCompression
|
||||
'
|
||||
Me.cboCompression.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
|
||||
Me.cboCompression.FormattingEnabled = True
|
||||
Me.cboCompression.Location = New System.Drawing.Point(88, 17)
|
||||
Me.cboCompression.Name = "cboCompression"
|
||||
Me.cboCompression.Size = New System.Drawing.Size(224, 21)
|
||||
Me.cboCompression.TabIndex = 1
|
||||
'
|
||||
'frmSettings
|
||||
'
|
||||
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
|
||||
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
|
||||
Me.ClientSize = New System.Drawing.Size(384, 461)
|
||||
Me.ClientSize = New System.Drawing.Size(384, 511)
|
||||
Me.Controls.Add(Me.grp7z)
|
||||
Me.Controls.Add(Me.grpBackup)
|
||||
Me.Controls.Add(Me.btnCancel)
|
||||
Me.Controls.Add(Me.btnSave)
|
||||
@@ -292,7 +326,7 @@ Partial Class frmSettings
|
||||
Me.Name = "frmSettings"
|
||||
Me.ShowIcon = False
|
||||
Me.ShowInTaskbar = False
|
||||
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
|
||||
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
|
||||
Me.Text = "Settings"
|
||||
Me.grpGeneral.ResumeLayout(False)
|
||||
Me.grpGeneral.PerformLayout()
|
||||
@@ -301,6 +335,8 @@ Partial Class frmSettings
|
||||
Me.grpBackup.ResumeLayout(False)
|
||||
Me.grpBackup.PerformLayout()
|
||||
CType(Me.nudSupressBackupThreshold, System.ComponentModel.ISupportInitialize).EndInit()
|
||||
Me.grp7z.ResumeLayout(False)
|
||||
Me.grp7z.PerformLayout()
|
||||
Me.ResumeLayout(False)
|
||||
|
||||
End Sub
|
||||
@@ -326,4 +362,7 @@ Partial Class frmSettings
|
||||
Friend WithEvents lblMinutes As Label
|
||||
Friend WithEvents nudSupressBackupThreshold As NumericUpDown
|
||||
Friend WithEvents chkSupressBackup As CheckBox
|
||||
Friend WithEvents grp7z As GroupBox
|
||||
Friend WithEvents cboCompression As ComboBox
|
||||
Friend WithEvents lblCompression As Label
|
||||
End Class
|
||||
|
||||
+36
-14
@@ -58,6 +58,7 @@ Public Class frmSettings
|
||||
oSettings.TimeTracking = chkTimeTracking.Checked
|
||||
oSettings.SupressBackup = chkSupressBackup.Checked
|
||||
oSettings.SupressBackupThreshold = nudSupressBackupThreshold.Value
|
||||
oSettings.CompressionLevel = cboCompression.SelectedValue
|
||||
|
||||
'We need to clear all checksums its turned off
|
||||
If chkCheckSum.Checked = False And oSettings.CheckSum = True Then
|
||||
@@ -111,24 +112,24 @@ Public Class frmSettings
|
||||
chkSupressBackup.Checked = oSettings.SupressBackup
|
||||
nudSupressBackupThreshold.Value = oSettings.SupressBackupThreshold
|
||||
nudSupressBackupThreshold.Enabled = chkSupressBackup.Checked
|
||||
cboCompression.SelectedValue = oSettings.CompressionLevel
|
||||
End Sub
|
||||
|
||||
Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click
|
||||
If SaveSettings() Then
|
||||
bShutdown = True
|
||||
Me.Close()
|
||||
End If
|
||||
End Sub
|
||||
Private Sub LoadCombos()
|
||||
Dim oComboItems As New List(Of KeyValuePair(Of Integer, String))
|
||||
|
||||
Private Sub btnCancel_Click(sender As System.Object, e As System.EventArgs) Handles btnCancel.Click
|
||||
bShutdown = True
|
||||
Me.Close()
|
||||
End Sub
|
||||
'cboCompression
|
||||
cboCompression.ValueMember = "Key"
|
||||
cboCompression.DisplayMember = "Value"
|
||||
|
||||
Private Sub frmSettings_FormClosing(sender As System.Object, e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
|
||||
If bShutdown = False Then
|
||||
e.Cancel = True
|
||||
End If
|
||||
oComboItems.Add(New KeyValuePair(Of Integer, String)(0, frmSettings_cboCompression_None))
|
||||
oComboItems.Add(New KeyValuePair(Of Integer, String)(1, frmSettings_cboCompression_Fastest))
|
||||
oComboItems.Add(New KeyValuePair(Of Integer, String)(3, frmSettings_cboCompression_Fast))
|
||||
oComboItems.Add(New KeyValuePair(Of Integer, String)(5, frmSettings_cboCompression_Normal))
|
||||
oComboItems.Add(New KeyValuePair(Of Integer, String)(7, frmSettings_cboCompression_Maximum))
|
||||
oComboItems.Add(New KeyValuePair(Of Integer, String)(9, frmSettings_cboCompression_Ultra))
|
||||
|
||||
cboCompression.DataSource = oComboItems
|
||||
End Sub
|
||||
|
||||
Private Sub SetForm()
|
||||
@@ -156,10 +157,31 @@ Public Class frmSettings
|
||||
chkShowDetectionTips.Text = frmSettings_chkShowDetectionTips
|
||||
chkStartToTray.Text = frmSettings_chkStartToTray
|
||||
chkMonitorOnStartup.Text = frmSettings_chkMonitorOnStartup
|
||||
grp7z.Text = frmSettings_grp7z
|
||||
lblCompression.Text = frmSettings_lblCompression
|
||||
End Sub
|
||||
|
||||
Private Sub btnSave_Click(sender As System.Object, e As System.EventArgs) Handles btnSave.Click
|
||||
If SaveSettings() Then
|
||||
bShutdown = True
|
||||
Me.Close()
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub btnCancel_Click(sender As System.Object, e As System.EventArgs) Handles btnCancel.Click
|
||||
bShutdown = True
|
||||
Me.Close()
|
||||
End Sub
|
||||
|
||||
Private Sub frmSettings_FormClosing(sender As System.Object, e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
|
||||
If bShutdown = False Then
|
||||
e.Cancel = True
|
||||
End If
|
||||
End Sub
|
||||
|
||||
Private Sub frmSettings_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
|
||||
SetForm()
|
||||
LoadCombos()
|
||||
LoadSettings()
|
||||
End Sub
|
||||
|
||||
|
||||
@@ -168,7 +168,7 @@ Public Class mgrBackup
|
||||
End If
|
||||
|
||||
If Directory.Exists(sSavePath) Then
|
||||
prs7z.StartInfo.Arguments = "a -t7z " & "-i@""" & mgrPath.IncludeFileLocation & """ -x@""" & mgrPath.ExcludeFileLocation & """ """ & sBackupFile & """ -r"
|
||||
prs7z.StartInfo.Arguments = "a -bb1 -bt -t7z -mx" & oSettings.CompressionLevel & " -i@""" & mgrPath.IncludeFileLocation & """ -x@""" & mgrPath.ExcludeFileLocation & """ """ & sBackupFile & """ -r"
|
||||
prs7z.StartInfo.FileName = mgrPath.Utility7zLocation
|
||||
prs7z.StartInfo.UseShellExecute = False
|
||||
prs7z.StartInfo.RedirectStandardOutput = True
|
||||
|
||||
@@ -73,7 +73,7 @@ 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);"
|
||||
"SupressBackup BOOLEAN NOT NULL, SupressBackupThreshold INTEGER NOT NULL, CompressionLevel INTEGER 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, " &
|
||||
@@ -506,6 +506,29 @@ Public Class mgrSQLite
|
||||
End If
|
||||
End If
|
||||
|
||||
'0.96 Upgrade
|
||||
If GetDatabaseVersion() < 96 Then
|
||||
If eDatabase = Database.Local Then
|
||||
'Backup DB before starting
|
||||
BackupDB("v95")
|
||||
|
||||
'Add new setting
|
||||
sSQL = "ALTER TABLE settings ADD COLUMN CompressionLevel INTEGER NOT NULL DEFAULT 5;"
|
||||
|
||||
sSQL &= "PRAGMA user_version=96"
|
||||
|
||||
RunParamQuery(sSQL, New Hashtable)
|
||||
End If
|
||||
If eDatabase = Database.Remote Then
|
||||
'Backup DB before starting
|
||||
BackupDB("v95")
|
||||
|
||||
sSQL = "PRAGMA user_version=96"
|
||||
|
||||
RunParamQuery(sSQL, New Hashtable)
|
||||
End If
|
||||
End If
|
||||
|
||||
End Sub
|
||||
|
||||
Public Function GetDBSize() As Long
|
||||
|
||||
@@ -14,6 +14,7 @@ Public Class mgrSettings
|
||||
Private bTimeTracking As Boolean = True
|
||||
Private bSupressBackup As Boolean = False
|
||||
Private iSupressBackupThreshold As Integer = 10
|
||||
Private iCompressionLevel As Integer = 5
|
||||
Private sBackupFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments).TrimEnd(New Char() {"\", "/"})
|
||||
|
||||
Property StartWithWindows As Boolean
|
||||
@@ -133,6 +134,15 @@ Public Class mgrSettings
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property CompressionLevel As Integer
|
||||
Get
|
||||
Return iCompressionLevel
|
||||
End Get
|
||||
Set(value As Integer)
|
||||
iCompressionLevel = value
|
||||
End Set
|
||||
End Property
|
||||
|
||||
Property BackupFolder As String
|
||||
Get
|
||||
Return sBackupFolder
|
||||
@@ -152,7 +162,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)"
|
||||
sSQL &= "@TimeTracking, @SupressBackup, @SupressBackupThreshold, @CompressionLevel)"
|
||||
|
||||
hshParams.Add("MonitorOnStartup", MonitorOnStartup)
|
||||
hshParams.Add("StartToTray", StartToTray)
|
||||
@@ -168,6 +178,7 @@ Public Class mgrSettings
|
||||
hshParams.Add("TimeTracking", TimeTracking)
|
||||
hshParams.Add("SupressBackup", SupressBackup)
|
||||
hshParams.Add("SupressBackupThreshold", SupressBackupThreshold)
|
||||
hshParams.Add("CompressionLevel", CompressionLevel)
|
||||
|
||||
oDatabase.RunParamQuery(sSQL, hshParams)
|
||||
End Sub
|
||||
@@ -197,6 +208,7 @@ Public Class mgrSettings
|
||||
TimeTracking = CBool(dr("TimeTracking"))
|
||||
SupressBackup = CBool(dr("SupressBackup"))
|
||||
SupressBackupThreshold = CInt(dr("SupressBackupThreshold"))
|
||||
CompressionLevel = CInt(dr("CompressionLevel"))
|
||||
Next
|
||||
|
||||
oDatabase.Disconnect()
|
||||
|
||||
Generated
+73
-1
@@ -2913,6 +2913,60 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Fast.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmSettings_cboCompression_Fast() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmSettings_cboCompression_Fast", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Fastest.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmSettings_cboCompression_Fastest() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmSettings_cboCompression_Fastest", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Maximum.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmSettings_cboCompression_Maximum() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmSettings_cboCompression_Maximum", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to None.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmSettings_cboCompression_None() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmSettings_cboCompression_None", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Normal.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmSettings_cboCompression_Normal() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmSettings_cboCompression_Normal", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Ultra.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmSettings_cboCompression_Ultra() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmSettings_cboCompression_Ultra", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Disable backup confirmation.
|
||||
'''</summary>
|
||||
@@ -3039,6 +3093,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to 7z Options.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmSettings_grp7z() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmSettings_grp7z", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Backup and Restore.
|
||||
'''</summary>
|
||||
@@ -3067,7 +3130,7 @@ Namespace My.Resources
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Backup Folder.
|
||||
''' Looks up a localized string similar to Backup Folder:.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmSettings_lblBackupFolder() As String
|
||||
Get
|
||||
@@ -3075,6 +3138,15 @@ Namespace My.Resources
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to Compression:.
|
||||
'''</summary>
|
||||
Friend ReadOnly Property frmSettings_lblCompression() As String
|
||||
Get
|
||||
Return ResourceManager.GetString("frmSettings_lblCompression", resourceCulture)
|
||||
End Get
|
||||
End Property
|
||||
|
||||
'''<summary>
|
||||
''' Looks up a localized string similar to minutes.
|
||||
'''</summary>
|
||||
|
||||
@@ -1133,7 +1133,7 @@
|
||||
<value>Paths</value>
|
||||
</data>
|
||||
<data name="frmSettings_lblBackupFolder" xml:space="preserve">
|
||||
<value>Backup Folder</value>
|
||||
<value>Backup Folder:</value>
|
||||
</data>
|
||||
<data name="frmSettings_lblMinutes" xml:space="preserve">
|
||||
<value>minutes</value>
|
||||
@@ -1513,4 +1513,28 @@
|
||||
<data name="mgrCommon_ErrorWritingTextFile" xml:space="preserve">
|
||||
<value>An error has occured writing the text file.[BR][BR][PARAM]</value>
|
||||
</data>
|
||||
<data name="frmSettings_cboCompression_Fast" xml:space="preserve">
|
||||
<value>Fast</value>
|
||||
</data>
|
||||
<data name="frmSettings_cboCompression_Fastest" xml:space="preserve">
|
||||
<value>Fastest</value>
|
||||
</data>
|
||||
<data name="frmSettings_cboCompression_Maximum" xml:space="preserve">
|
||||
<value>Maximum</value>
|
||||
</data>
|
||||
<data name="frmSettings_cboCompression_None" xml:space="preserve">
|
||||
<value>None</value>
|
||||
</data>
|
||||
<data name="frmSettings_cboCompression_Normal" xml:space="preserve">
|
||||
<value>Normal</value>
|
||||
</data>
|
||||
<data name="frmSettings_cboCompression_Ultra" xml:space="preserve">
|
||||
<value>Ultra</value>
|
||||
</data>
|
||||
<data name="frmSettings_grp7z" xml:space="preserve">
|
||||
<value>7z Options</value>
|
||||
</data>
|
||||
<data name="frmSettings_lblCompression" xml:space="preserve">
|
||||
<value>Compression:</value>
|
||||
</data>
|
||||
</root>
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user