Added AutoHideLog and ThemeSelection to SQL settings database and wired to settings UI

This commit is contained in:
2019-03-15 21:13:07 +00:00
parent 88d97a6027
commit b97139cd6d
7 changed files with 97 additions and 30 deletions
+25 -25
View File
@@ -77,9 +77,9 @@ Partial Class frmSettings
Me.chkMonitorOnStartup = New System.Windows.Forms.CheckBox()
Me.pnlInterface = New System.Windows.Forms.Panel()
Me.grpInterfaceOptions = New System.Windows.Forms.GroupBox()
Me.chkAutoHideLog = New System.Windows.Forms.CheckBox()
Me.cboThemeSelection = New System.Windows.Forms.ComboBox()
Me.lblThemeSelection = New System.Windows.Forms.Label()
Me.cmbThemeSelection = New System.Windows.Forms.ComboBox()
Me.chkAutoHideOutput = New System.Windows.Forms.CheckBox()
Me.grpFolderOptions.SuspendLayout()
Me.grp7zGeneral.SuspendLayout()
Me.pnlBackup.SuspendLayout()
@@ -639,8 +639,8 @@ Partial Class frmSettings
'
'grpInterfaceOptions
'
Me.grpInterfaceOptions.Controls.Add(Me.chkAutoHideOutput)
Me.grpInterfaceOptions.Controls.Add(Me.cmbThemeSelection)
Me.grpInterfaceOptions.Controls.Add(Me.chkAutoHideLog)
Me.grpInterfaceOptions.Controls.Add(Me.cboThemeSelection)
Me.grpInterfaceOptions.Controls.Add(Me.lblThemeSelection)
Me.grpInterfaceOptions.Location = New System.Drawing.Point(6, 12)
Me.grpInterfaceOptions.Name = "grpInterfaceOptions"
@@ -649,6 +649,25 @@ Partial Class frmSettings
Me.grpInterfaceOptions.TabStop = False
Me.grpInterfaceOptions.Text = "Interface Options"
'
'chkAutoHideLog
'
Me.chkAutoHideLog.AutoSize = True
Me.chkAutoHideLog.Location = New System.Drawing.Point(12, 56)
Me.chkAutoHideLog.Name = "chkAutoHideLog"
Me.chkAutoHideLog.Size = New System.Drawing.Size(167, 17)
Me.chkAutoHideLog.TabIndex = 3
Me.chkAutoHideLog.Text = "Automatically hide backup log"
Me.chkAutoHideLog.UseVisualStyleBackColor = True
'
'cboThemeSelection
'
Me.cboThemeSelection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cboThemeSelection.FormattingEnabled = True
Me.cboThemeSelection.Location = New System.Drawing.Point(100, 23)
Me.cboThemeSelection.Name = "cboThemeSelection"
Me.cboThemeSelection.Size = New System.Drawing.Size(121, 21)
Me.cboThemeSelection.TabIndex = 1
'
'lblThemeSelection
'
Me.lblThemeSelection.AutoSize = True
@@ -658,25 +677,6 @@ Partial Class frmSettings
Me.lblThemeSelection.TabIndex = 0
Me.lblThemeSelection.Text = "Theme Selection:"
'
'cmbThemeSelection
'
Me.cmbThemeSelection.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cmbThemeSelection.FormattingEnabled = True
Me.cmbThemeSelection.Location = New System.Drawing.Point(100, 23)
Me.cmbThemeSelection.Name = "cmbThemeSelection"
Me.cmbThemeSelection.Size = New System.Drawing.Size(121, 21)
Me.cmbThemeSelection.TabIndex = 1
'
'chkAutoHideOutput
'
Me.chkAutoHideOutput.AutoSize = True
Me.chkAutoHideOutput.Location = New System.Drawing.Point(12, 56)
Me.chkAutoHideOutput.Name = "chkAutoHideOutput"
Me.chkAutoHideOutput.Size = New System.Drawing.Size(183, 17)
Me.chkAutoHideOutput.TabIndex = 3
Me.chkAutoHideOutput.Text = "Automatically hide output window"
Me.chkAutoHideOutput.UseVisualStyleBackColor = True
'
'frmSettings
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -785,7 +785,7 @@ Partial Class frmSettings
Friend WithEvents chkDisableDiskSpaceCheck As CheckBox
Friend WithEvents pnlInterface As Panel
Friend WithEvents grpInterfaceOptions As GroupBox
Friend WithEvents chkAutoHideOutput As CheckBox
Friend WithEvents cmbThemeSelection As ComboBox
Friend WithEvents chkAutoHideLog As CheckBox
Friend WithEvents cboThemeSelection As ComboBox
Friend WithEvents lblThemeSelection As Label
End Class
+17
View File
@@ -99,6 +99,7 @@ Public Class frmSettings
oSettings.SuppressBackup = chkSuppressBackup.Checked
oSettings.SuppressBackupThreshold = nudSuppressBackupThreshold.Value
oSettings.CompressionLevel = cboCompression.SelectedValue
oSettings.ThemeSelection = cboThemeSelection.SelectedValue
If oSettings.Custom7zArguments <> txt7zArguments.Text.Trim And txt7zArguments.Text.Trim <> String.Empty Then
mgrCommon.ShowMessage(frmSettings_WarningArguments, MsgBoxStyle.Exclamation)
@@ -234,6 +235,8 @@ Public Class frmSettings
txt7zArguments.Text = oSettings.Custom7zArguments
txt7zLocation.Text = oSettings.Custom7zLocation
eCurrentSyncFields = oSettings.SyncFields
cboThemeSelection.SelectedIndex = oSettings.ThemeSelection
chkAutoHideLog.Checked = oSettings.AutoHideLog
'Retrieve 7z Info
GetUtilityInfo(oSettings.Custom7zLocation)
@@ -243,6 +246,7 @@ Public Class frmSettings
Private Sub LoadCombos()
Dim oComboItems As New List(Of KeyValuePair(Of Integer, String))
Dim oSettingsItems As New List(Of KeyValuePair(Of Integer, String))
Dim oThemeItems As New List(Of KeyValuePair(Of Integer, String))
'cboCompression
cboCompression.ValueMember = "Key"
@@ -257,6 +261,15 @@ Public Class frmSettings
cboCompression.DataSource = oComboItems
'cboThemes
cboThemeSelection.ValueMember = "Key"
cboThemeSelection.DisplayMember = "Value"
oThemeItems.Add(New KeyValuePair(Of Integer, String)(0, frmSettings_cboThemeSelection_Light))
oThemeItems.Add(New KeyValuePair(Of Integer, String)(1, frmSettings_cboThemeSelection_Dark))
cboThemeSelection.DataSource = oThemeItems
'lstSettings
lstSettings.ValueMember = "Key"
lstSettings.DisplayMember = "Value"
@@ -437,4 +450,8 @@ Public Class frmSettings
Private Sub lstSettings_SelectedValueChanged(sender As Object, e As EventArgs) Handles lstSettings.SelectedValueChanged
ChangePanel()
End Sub
Private Sub cboThemeSelection_SelectedValueChanged(sender As Object, e As EventArgs) Handles cboThemeSelection.SelectedValueChanged
'Todo
End Sub
End Class
+3
View File
@@ -77,6 +77,7 @@ Public Class mgrSQLite
"Custom7zLocation TEXT, SyncFields INTEGER NOT NULL, AutoSaveLog BOOLEAN NOT NULL, AutoRestore BOOLEAN NOT NULL, AutoMark BOOLEAN NOT NULL, SessionTracking BOOLEAN NOT NULL, " &
"SuppressMessages INTEGER NOT NULL, BackupOnLaunch BOOLEAN NOT NULL, UseGameID BOOLEAN NOT NULL, DisableSyncMessages BOOLEAN NOT NULL, ShowResolvedPaths BOOLEAN NOT NULL, " &
"DisableDiskSpaceCheck BOOLEAN NOT NULL);"
"DisableDiskSpaceCheck BOOLEAN NOT NULL, ThemeSelection INTEGER NOT NULL, AutoHideLog BOOLEAN NOT NULL);"
'Add Tables (SavedPath)
sSql &= "CREATE TABLE savedpath (PathName TEXT NOT NULL PRIMARY KEY, Path TEXT NOT NULL);"
@@ -931,6 +932,8 @@ Public Class mgrSQLite
'Add new field(s)
sSQL = "ALTER TABLE monitorlist ADD COLUMN OS INTEGER NOT NULL DEFAULT " & mgrCommon.GetCurrentOS & ";"
sSQL &= "ALTER TABLE settings ADD COLUMN DisableDiskSpaceCheck BOOLEAN NOT NULL DEFAULT 0;"
sSQL &= "ALTER TABLE settings ADD COLUMN ThemeSelection INTEGER NOT NULL DEFAULT 0;"
sSQL &= "ALTER TABLE settings ADD COLUMN AutoHideLog BOOLEAN NOT NULL DEFAULT 0;"
'Add Tables (Wine Data)
sSQL &= "CREATE TABLE winedata (MonitorID TEXT NOT NULL PRIMARY KEY, Prefix TEXT NOT NULL, SavePath TEXT NOT NULL, BinaryPath TEXT NOT NULL);"
+25 -2
View File
@@ -27,6 +27,8 @@ Public Class mgrSettings
Private bDisableSyncMessages As Boolean = True
Private bShowResolvedPaths As Boolean = True
Private bDisableDiskSpaceCheck As Boolean = False
Private eThemeSelection As mgrThemeEngine.eBaseTheme = mgrThemeEngine.eBaseTheme.Light
Private bAutoHideLog As Boolean = False
<Flags()> Public Enum eSuppressMessages
None = 0
@@ -318,6 +320,24 @@ Public Class mgrSettings
End Set
End Property
Property ThemeSelection As mgrThemeEngine.eBaseTheme
Get
Return eThemeSelection
End Get
Set(value As mgrThemeEngine.eBaseTheme)
eThemeSelection = value
End Set
End Property
Property AutoHideLog As Boolean
Get
Return bAutoHideLog
End Get
Set(value As Boolean)
bAutoHideLog = value
End Set
End Property
Sub New()
'The GameIDsync message should be suppressed on all new databases
SuppressMessages = SetMessageField(SuppressMessages, eSuppressMessages.GameIDSync)
@@ -332,7 +352,7 @@ Public Class mgrSettings
sSQL &= "@CreateSubFolder, @ShowOverwriteWarning, @RestoreOnLaunch, @BackupFolder, @StartWithWindows, "
sSQL &= "@TimeTracking, @SuppressBackup, @SuppressBackupThreshold, @CompressionLevel, @Custom7zArguments, @Custom7zLocation, "
sSQL &= "@SyncFields, @AutoSaveLog, @AutoRestore, @AutoMark, @SessionTracking, @SuppressMessages, @BackupOnLaunch, @UseGameID, "
sSQL &= "@DisableSyncMessages, @ShowResolvedPaths, @DisableDiskSpaceCheck)"
sSQL &= "@DisableSyncMessages, @ShowResolvedPaths, @DisableDiskSpaceCheck, @ThemeSelection, @AutoHideLog)"
hshParams.Add("MonitorOnStartup", MonitorOnStartup)
hshParams.Add("StartToTray", StartToTray)
@@ -360,7 +380,8 @@ Public Class mgrSettings
hshParams.Add("DisableSyncMessages", DisableSyncMessages)
hshParams.Add("ShowResolvedPaths", ShowResolvedPaths)
hshParams.Add("DisableDiskSpaceCheck", DisableDiskSpaceCheck)
hshParams.Add("ThemeSelection", ThemeSelection)
hshParams.Add("AutoHideLog", AutoHideLog)
oDatabase.RunParamQuery(sSQL, hshParams)
End Sub
@@ -401,6 +422,8 @@ Public Class mgrSettings
DisableSyncMessages = CBool(dr("DisableSyncMessages"))
ShowResolvedPaths = CBool(dr("ShowResolvedPaths"))
DisableDiskSpaceCheck = CBool(dr("DisableDiskSpaceCheck"))
ThemeSelection = CInt(dr("ThemeSelection"))
AutoHideLog = CBool(dr("AutoHideLog"))
Next
oDatabase.Disconnect()
+2 -2
View File
@@ -12,8 +12,8 @@ Public Class mgrThemeEngine
''' Supported themes.
''' </summary>
Public Enum eBaseTheme
Dark
Light
Light = 0
Dark = 1
End Enum
''' <summary>
+19 -1
View File
@@ -22,7 +22,7 @@ Namespace My.Resources
'''<summary>
''' A strongly-typed resource class, for looking up localized strings, etc.
'''</summary>
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0"), _
<Global.System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "15.0.0.0"), _
Global.System.Diagnostics.DebuggerNonUserCodeAttribute(), _
Global.System.Runtime.CompilerServices.CompilerGeneratedAttribute(), _
Global.Microsoft.VisualBasic.HideModuleNameAttribute()> _
@@ -4677,6 +4677,24 @@ Namespace My.Resources
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Dark.
'''</summary>
Friend ReadOnly Property frmSettings_cboThemeSelection_Dark() As String
Get
Return ResourceManager.GetString("frmSettings_cboThemeSelection_Dark", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Light.
'''</summary>
Friend ReadOnly Property frmSettings_cboThemeSelection_Light() As String
Get
Return ResourceManager.GetString("frmSettings_cboThemeSelection_Light", resourceCulture)
End Get
End Property
'''<summary>
''' Looks up a localized string similar to Automatically mark new backups as restored when appropriate.
'''</summary>
+6
View File
@@ -2401,4 +2401,10 @@
<data name="frmSettings_lstSettings_Interface" xml:space="preserve">
<value>Interface</value>
</data>
<data name="frmSettings_cboThemeSelection_Dark" xml:space="preserve">
<value>Dark</value>
</data>
<data name="frmSettings_cboThemeSelection_Light" xml:space="preserve">
<value>Light</value>
</data>
</root>