Editing Wine data on Game Manager

This commit is contained in:
Michael J. Seiferling
2019-02-09 12:45:13 -06:00
parent b31ca7b084
commit fdcef783fb
10 changed files with 611 additions and 47 deletions
+22 -22
View File
@@ -28,15 +28,16 @@ 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.btnWineConfig = New System.Windows.Forms.Button()
Me.lblOS = New System.Windows.Forms.Label()
Me.cboOS = New System.Windows.Forms.ComboBox()
Me.chkRecurseSubFolders = New System.Windows.Forms.CheckBox()
Me.btnGameID = New System.Windows.Forms.Button()
Me.chkRegEx = New System.Windows.Forms.CheckBox()
Me.lblComments = New System.Windows.Forms.Label()
Me.txtComments = New System.Windows.Forms.TextBox()
Me.txtParameter = New System.Windows.Forms.TextBox()
Me.lblParameter = New System.Windows.Forms.Label()
Me.txtComments = New System.Windows.Forms.TextBox()
Me.chkCleanFolder = New System.Windows.Forms.CheckBox()
Me.lblLimit = New System.Windows.Forms.Label()
Me.nudLimit = New System.Windows.Forms.NumericUpDown()
@@ -110,7 +111,6 @@ Partial Class frmGameManager
Me.cmsDeleteAll = New System.Windows.Forms.ToolStripMenuItem()
Me.btnProcesses = New System.Windows.Forms.Button()
Me.ttFullPath = New System.Windows.Forms.ToolTip(Me.components)
Me.btnAdvancedConfig = New System.Windows.Forms.Button()
Me.grpConfig.SuspendLayout()
CType(Me.nudLimit, System.ComponentModel.ISupportInitialize).BeginInit()
Me.grpExtra.SuspendLayout()
@@ -167,7 +167,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.btnAdvancedConfig)
Me.grpConfig.Controls.Add(Me.btnWineConfig)
Me.grpConfig.Controls.Add(Me.lblOS)
Me.grpConfig.Controls.Add(Me.cboOS)
Me.grpConfig.Controls.Add(Me.chkRecurseSubFolders)
@@ -203,6 +203,15 @@ Partial Class frmGameManager
Me.grpConfig.TabStop = False
Me.grpConfig.Text = "Configuration"
'
'btnWineConfig
'
Me.btnWineConfig.Location = New System.Drawing.Point(191, 167)
Me.btnWineConfig.Name = "btnWineConfig"
Me.btnWineConfig.Size = New System.Drawing.Size(175, 23)
Me.btnWineConfig.TabIndex = 16
Me.btnWineConfig.Text = "&Wine Configuration..."
Me.btnWineConfig.UseVisualStyleBackColor = True
'
'lblOS
'
Me.lblOS.AutoSize = True
@@ -260,15 +269,6 @@ Partial Class frmGameManager
Me.lblComments.TabIndex = 12
Me.lblComments.Text = "Comments:"
'
'txtComments
'
Me.txtComments.Location = New System.Drawing.Point(70, 123)
Me.txtComments.Multiline = True
Me.txtComments.Name = "txtComments"
Me.txtComments.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.txtComments.Size = New System.Drawing.Size(414, 40)
Me.txtComments.TabIndex = 13
'
'txtParameter
'
Me.txtParameter.Location = New System.Drawing.Point(70, 71)
@@ -285,6 +285,15 @@ Partial Class frmGameManager
Me.lblParameter.TabIndex = 7
Me.lblParameter.Text = "Parameter:"
'
'txtComments
'
Me.txtComments.Location = New System.Drawing.Point(70, 123)
Me.txtComments.Multiline = True
Me.txtComments.Name = "txtComments"
Me.txtComments.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.txtComments.Size = New System.Drawing.Size(414, 40)
Me.txtComments.TabIndex = 13
'
'chkCleanFolder
'
Me.chkCleanFolder.AutoSize = True
@@ -963,15 +972,6 @@ Partial Class frmGameManager
Me.ttFullPath.InitialDelay = 300
Me.ttFullPath.ReshowDelay = 60
'
'btnAdvancedConfig
'
Me.btnAdvancedConfig.Location = New System.Drawing.Point(191, 167)
Me.btnAdvancedConfig.Name = "btnAdvancedConfig"
Me.btnAdvancedConfig.Size = New System.Drawing.Size(175, 23)
Me.btnAdvancedConfig.TabIndex = 16
Me.btnAdvancedConfig.Text = "&Advanced Configuration..."
Me.btnAdvancedConfig.UseVisualStyleBackColor = True
'
'frmGameManager
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -1109,5 +1109,5 @@ Partial Class frmGameManager
Friend WithEvents chkRecurseSubFolders As CheckBox
Friend WithEvents lblOS As Label
Friend WithEvents cboOS As ComboBox
Friend WithEvents btnAdvancedConfig As Button
Friend WithEvents btnWineConfig As Button
End Class
+51 -2
View File
@@ -12,6 +12,7 @@ Public Class frmGameManager
Private oCurrentGame As clsGame
Private oTagsToSave As New List(Of KeyValuePair(Of String, String))
Private oProcessesToSave As New List(Of KeyValuePair(Of String, String))
Private oWineDataToSave As clsWineData
Private bDisableExternalFunctions As Boolean = False
Private bTriggerBackup As Boolean = False
Private bTriggerRestore As Boolean = False
@@ -209,6 +210,14 @@ Public Class frmGameManager
Return sPath
End Function
Private Sub HandleWineConfig()
If mgrCommon.IsUnix And cboOS.SelectedValue = clsGame.eOS.Windows Then
btnWineConfig.Visible = True
Else
btnWineConfig.Visible = False
End If
End Sub
Private Function CheckManifestandUpdate(ByVal oOriginalApp As clsGame, ByVal oNewApp As clsGame, ByVal bUseGameID As Boolean) As Boolean
Dim oBackupItems As List(Of clsBackup)
Dim sDirectory As String
@@ -726,6 +735,24 @@ Public Class frmGameManager
End Sub
Public Sub OpenWineConfiguration()
Dim frm As New frmWineConfiguration
frm.Settings = oSettings
If eCurrentMode = eModes.Add Then
oWineDataToSave = New clsWineData
frm.NewMode = True
oWineDataToSave.MonitorID = txtID.Text
Else
oWineDataToSave = mgrWineData.DoWineDataGetbyID(txtID.Text)
If oWineDataToSave.MonitorID = String.Empty Then
oWineDataToSave.MonitorID = txtID.Text
End If
End If
frm.WineData = oWineDataToSave
frm.ShowDialog()
oWineDataToSave = frm.WineData
End Sub
Public Sub VerifyBackups(ByVal oApp As clsGame)
Dim oCurrentBackup As clsBackup
Dim oCurrentBackups As List(Of clsBackup)
@@ -947,6 +974,7 @@ Public Class frmGameManager
UpdateBuilderButtonLabel(oApp.FileType, frmGameManager_IncludeShortcut, btnInclude, False)
UpdateBuilderButtonLabel(oApp.ExcludeList, frmGameManager_ExcludeShortcut, btnExclude, False)
UpdateGenericButtonLabel(frmGameManager_btnGameID, btnGameID, False)
HandleWineConfig()
'Extra
txtAppPath.Text = oApp.ProcessPath
@@ -1059,6 +1087,7 @@ Public Class frmGameManager
btnImport.Enabled = False
btnExport.Enabled = False
cboOS.SelectedValue = CInt(mgrCommon.GetCurrentOS)
HandleWineConfig()
Case eModes.Edit
grpFilter.Enabled = False
lstGames.Enabled = False
@@ -1197,6 +1226,7 @@ Public Class frmGameManager
btnInclude.Enabled = False
btnExclude.Enabled = False
chkCleanFolder.Enabled = False
btnWineConfig.Enabled = False
Else
chkFolderSave.Enabled = True
chkTimeStamp.Enabled = True
@@ -1207,6 +1237,7 @@ Public Class frmGameManager
btnSavePathBrowse.Enabled = True
btnInclude.Enabled = True
btnExclude.Enabled = True
btnWineConfig.Enabled = True
FolderSaveModeChange()
End If
End Sub
@@ -1318,6 +1349,13 @@ Public Class frmGameManager
End If
End Sub
Private Sub SaveWineData(ByVal sID As String)
If Not oWineDataToSave Is Nothing Then
oWineDataToSave.MonitorID = sID
mgrWineData.DoWineDataAddUpdate(oWineDataToSave)
End If
End Sub
Private Sub SaveApp()
Dim oData As KeyValuePair(Of String, String)
Dim oApp As New clsGame
@@ -1374,6 +1412,7 @@ Public Class frmGameManager
mgrMonitorList.DoListAdd(oApp)
SaveTags(oApp.ID)
SaveProcesses(oApp.ID)
If mgrCommon.IsUnix And oApp.OS = clsGame.eOS.Windows Then SaveWineData(oApp.ID)
eCurrentMode = eModes.View
End If
Case eModes.Edit
@@ -1800,7 +1839,7 @@ Public Class frmGameManager
btnImportBackup.Text = frmGameManager_btnImportBackup
btnProcesses.Text = frmGameManager_btnProcesses
lblOS.Text = frmGameManager_lblOS
btnAdvancedConfig.Text = frmGameManager_btnAdvancedConfig
btnWineConfig.Text = frmGameManager_btnWineConfig
'Init Combos
Dim oComboItems As New List(Of KeyValuePair(Of Integer, String))
@@ -1816,7 +1855,7 @@ Public Class frmGameManager
If Not mgrCommon.IsUnix Then
cboOS.Enabled = False
btnAdvancedConfig.Enabled = False
btnWineConfig.Visible = False
End If
'Init Official Import Menu
@@ -1941,6 +1980,10 @@ Public Class frmGameManager
OpenProcesses()
End Sub
Private Sub btnWineConfig_Click(sender As Object, e As EventArgs) Handles btnWineConfig.Click
OpenWineConfiguration()
End Sub
Private Sub btnDeleteBackup_Click(sender As Object, e As EventArgs) Handles btnDeleteBackup.Click
If cboRemoteBackup.Items.Count > 1 Then
cmsDeleteBackup.Show(btnDeleteBackup, New Drawing.Point(btnDeleteBackup.Size.Width - Math.Floor(btnDeleteBackup.Size.Width * 0.1), btnDeleteBackup.Size.Height - Math.Floor(btnDeleteBackup.Size.Height * 0.5)), ToolStripDropDownDirection.AboveRight)
@@ -2006,6 +2049,12 @@ Public Class frmGameManager
End If
End Sub
Private Sub cboOS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboOS.SelectedIndexChanged
If Not bIsLoading Then
HandleWineConfig()
End If
End Sub
Private Sub btnImport_Click(sender As Object, e As EventArgs) Handles btnImport.Click
cmsImport.Show(btnImport, New Drawing.Point(btnImport.Size.Width - Math.Floor(btnImport.Size.Width * 0.1), btnImport.Size.Height - Math.Floor(btnImport.Size.Height * 0.5)), ToolStripDropDownDirection.AboveRight)
End Sub
+4 -4
View File
@@ -179,7 +179,7 @@ Public Class frmMain
If oWineData.SavePath <> String.Empty Then
sPath = oWineData.SavePath
bOSVerified = True
UpdateLog(mgrCommon.FormatString(frmMain_WineSavePath, New String() {oGame.Name, oWineData.SavePath}), False)
UpdateLog(mgrCommon.FormatString(frmMain_WineSavePath, oWineData.SavePath), False)
Else
bOSVerified = False
UpdateLog(mgrCommon.FormatString(frmMain_ErrorNoWineSavePath, oGame.Name), True, ToolTipIcon.Error, True)
@@ -1979,10 +1979,10 @@ Public Class frmMain
Dim oWineData As New clsWineData
oWineData.Prefix = mgrPath.GetWinePrefix(oProcess.FoundProcess)
oWineData.BinaryPath = Path.GetDirectoryName(oProcess.FoundProcess.MainModule.FileName)
UpdateLog(mgrCommon.FormatString(frmMain_WineBinaryPath, New String() {oProcess.GameInfo.Name, oWineData.BinaryPath}), False)
UpdateLog(mgrCommon.FormatString(frmMain_WineBinaryPath, oWineData.BinaryPath), False)
If Not oWineData.Prefix = String.Empty Then
oProcess.WineData = oWineData
UpdateLog(mgrCommon.FormatString(frmMain_WinePrefix, New String() {oProcess.GameInfo.Name, oWineData.Prefix}), False)
UpdateLog(mgrCommon.FormatString(frmMain_WinePrefix, oWineData.Prefix), False)
Else
bContinue = False
End If
@@ -2069,7 +2069,7 @@ Public Class frmMain
If Not oProcess.WineData.SavePath = oProcess.GameInfo.TruePath Then
oProcess.GameInfo.TruePath = oProcess.WineData.SavePath
mgrWineData.DoWineDataAddUpdate(oProcess.WineData)
UpdateLog(mgrCommon.FormatString(frmMain_WineSavePath, New String() {oProcess.GameInfo.Name, oProcess.WineData.SavePath}), False)
UpdateLog(mgrCommon.FormatString(frmMain_WineSavePath, oProcess.WineData.SavePath), False)
End If
End If
'This does required mods to include/exclude data and relative paths (if required)
+148
View File
@@ -0,0 +1,148 @@
<Global.Microsoft.VisualBasic.CompilerServices.DesignerGenerated()> _
Partial Class frmWineConfiguration
Inherits System.Windows.Forms.Form
'Form overrides dispose to clean up the component list.
<System.Diagnostics.DebuggerNonUserCode()> _
Protected Overrides Sub Dispose(ByVal disposing As Boolean)
Try
If disposing AndAlso components IsNot Nothing Then
components.Dispose()
End If
Finally
MyBase.Dispose(disposing)
End Try
End Sub
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
<System.Diagnostics.DebuggerStepThrough()> _
Private Sub InitializeComponent()
Me.grpWineConfig = New System.Windows.Forms.GroupBox()
Me.txtWineSavePath = New System.Windows.Forms.TextBox()
Me.txtWinePrefix = New System.Windows.Forms.TextBox()
Me.txtWineBinaryPath = New System.Windows.Forms.TextBox()
Me.lblWinePrefix = New System.Windows.Forms.Label()
Me.lblWineSavePath = New System.Windows.Forms.Label()
Me.lblWineBinaryPath = New System.Windows.Forms.Label()
Me.btnSave = New System.Windows.Forms.Button()
Me.btnCancel = New System.Windows.Forms.Button()
Me.grpWineConfig.SuspendLayout()
Me.SuspendLayout()
'
'grpWineConfig
'
Me.grpWineConfig.Controls.Add(Me.txtWineSavePath)
Me.grpWineConfig.Controls.Add(Me.txtWinePrefix)
Me.grpWineConfig.Controls.Add(Me.txtWineBinaryPath)
Me.grpWineConfig.Controls.Add(Me.lblWinePrefix)
Me.grpWineConfig.Controls.Add(Me.lblWineSavePath)
Me.grpWineConfig.Controls.Add(Me.lblWineBinaryPath)
Me.grpWineConfig.Location = New System.Drawing.Point(12, 12)
Me.grpWineConfig.Name = "grpWineConfig"
Me.grpWineConfig.Size = New System.Drawing.Size(460, 107)
Me.grpWineConfig.TabIndex = 0
Me.grpWineConfig.TabStop = False
Me.grpWineConfig.Text = "Configuration"
'
'txtWineSavePath
'
Me.txtWineSavePath.Location = New System.Drawing.Point(76, 75)
Me.txtWineSavePath.Name = "txtWineSavePath"
Me.txtWineSavePath.Size = New System.Drawing.Size(367, 20)
Me.txtWineSavePath.TabIndex = 5
'
'txtWinePrefix
'
Me.txtWinePrefix.Location = New System.Drawing.Point(76, 49)
Me.txtWinePrefix.Name = "txtWinePrefix"
Me.txtWinePrefix.Size = New System.Drawing.Size(367, 20)
Me.txtWinePrefix.TabIndex = 4
'
'txtWineBinaryPath
'
Me.txtWineBinaryPath.Location = New System.Drawing.Point(76, 23)
Me.txtWineBinaryPath.Name = "txtWineBinaryPath"
Me.txtWineBinaryPath.Size = New System.Drawing.Size(367, 20)
Me.txtWineBinaryPath.TabIndex = 3
'
'lblWinePrefix
'
Me.lblWinePrefix.AutoSize = True
Me.lblWinePrefix.Location = New System.Drawing.Point(6, 52)
Me.lblWinePrefix.Name = "lblWinePrefix"
Me.lblWinePrefix.Size = New System.Drawing.Size(36, 13)
Me.lblWinePrefix.TabIndex = 2
Me.lblWinePrefix.Text = "Prefix:"
'
'lblWineSavePath
'
Me.lblWineSavePath.AutoSize = True
Me.lblWineSavePath.Location = New System.Drawing.Point(6, 78)
Me.lblWineSavePath.Name = "lblWineSavePath"
Me.lblWineSavePath.Size = New System.Drawing.Size(60, 13)
Me.lblWineSavePath.TabIndex = 1
Me.lblWineSavePath.Text = "Save Path:"
'
'lblWineBinaryPath
'
Me.lblWineBinaryPath.AutoSize = True
Me.lblWineBinaryPath.Location = New System.Drawing.Point(6, 26)
Me.lblWineBinaryPath.Name = "lblWineBinaryPath"
Me.lblWineBinaryPath.Size = New System.Drawing.Size(64, 13)
Me.lblWineBinaryPath.TabIndex = 0
Me.lblWineBinaryPath.Text = "Binary Path:"
'
'btnSave
'
Me.btnSave.Location = New System.Drawing.Point(316, 125)
Me.btnSave.Name = "btnSave"
Me.btnSave.Size = New System.Drawing.Size(75, 23)
Me.btnSave.TabIndex = 1
Me.btnSave.Text = "&Save"
Me.btnSave.UseVisualStyleBackColor = True
'
'btnCancel
'
Me.btnCancel.Location = New System.Drawing.Point(397, 125)
Me.btnCancel.Name = "btnCancel"
Me.btnCancel.Size = New System.Drawing.Size(75, 23)
Me.btnCancel.TabIndex = 2
Me.btnCancel.Text = "&Cancel"
Me.btnCancel.UseVisualStyleBackColor = True
'
'frmWineConfiguration
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(484, 161)
Me.Controls.Add(Me.btnCancel)
Me.Controls.Add(Me.btnSave)
Me.Controls.Add(Me.grpWineConfig)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frmWineConfiguration"
Me.ShowIcon = False
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent
Me.Text = "Wine Configuration"
Me.grpWineConfig.ResumeLayout(False)
Me.grpWineConfig.PerformLayout()
Me.ResumeLayout(False)
End Sub
Friend WithEvents grpWineConfig As GroupBox
Friend WithEvents txtWineSavePath As TextBox
Friend WithEvents txtWinePrefix As TextBox
Friend WithEvents txtWineBinaryPath As TextBox
Friend WithEvents lblWinePrefix As Label
Friend WithEvents lblWineSavePath As Label
Friend WithEvents lblWineBinaryPath As Label
Friend WithEvents btnSave As Button
Friend WithEvents btnCancel As Button
End Class
+120
View File
@@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>
+117
View File
@@ -0,0 +1,117 @@
Imports GBM.My.Resources
Public Class frmWineConfiguration
Private oSettings As mgrSettings
Private oWineData As clsWineData
Private bNewMode As Boolean = False
Property Settings As mgrSettings
Get
Return oSettings
End Get
Set(value As mgrSettings)
oSettings = value
End Set
End Property
Property WineData As clsWineData
Get
Return oWineData
End Get
Set(value As clsWineData)
oWineData = value
End Set
End Property
Public Property NewMode As Boolean
Get
Return bNewMode
End Get
Set(value As Boolean)
bNewMode = value
End Set
End Property
Private Sub SetForm()
'Set Form Name
Me.Text = frmWineConfiguration_FormName
'Set Form Text
grpWineConfig.Text = frmWineConfiguration_grpWineConfig
lblWineBinaryPath.Text = frmWineConfiguration_lblWineBinaryPath
lblWinePrefix.Text = frmWineConfiguration_lblWinePrefix
lblWineSavePath.Text = frmWineConfiguration_lblWineSavePath
btnSave.Text = frmWineConfiguration_btnSave
btnCancel.Text = frmWineConfiguration_btnCancel
End Sub
Private Sub LoadData()
txtWineBinaryPath.Text = oWineData.BinaryPath
txtWinePrefix.Text = oWineData.Prefix
txtWineSavePath.Text = oWineData.SavePath
End Sub
Private Sub HandleWarning()
If Not (oSettings.SuppressMessages And mgrSettings.eSuppressMessages.WineConfig) = mgrSettings.eSuppressMessages.WineConfig Then
mgrCommon.ShowMessage(frmWineConfiguration_WarningSingle, MsgBoxStyle.Information)
oSettings.SuppressMessages = oSettings.SetMessageField(oSettings.SuppressMessages, mgrSettings.eSuppressMessages.WineConfig)
oSettings.SaveSettings()
End If
End Sub
Private Function ValidateData() As Boolean
If txtWineBinaryPath.Text = String.Empty Then
mgrCommon.ShowMessage(frmWineConfiguration_ErrorValidationBinaryPath, MsgBoxStyle.Exclamation)
Return False
End If
If txtWinePrefix.Text = String.Empty Then
mgrCommon.ShowMessage(frmWineConfiguration_ErrorValidationPrefix, MsgBoxStyle.Exclamation)
Return False
End If
Return True
End Function
Private Sub SaveData()
If txtWineBinaryPath.Text = String.Empty And txtWinePrefix.Text = String.Empty And txtWineSavePath.Text = String.Empty Then
If bNewMode Then
Me.DialogResult = DialogResult.OK
Else
mgrWineData.DoWineDataDelete(oWineData.MonitorID)
Me.DialogResult = DialogResult.OK
End If
Else
If ValidateData() Then
oWineData.BinaryPath = txtWineBinaryPath.Text
oWineData.Prefix = txtWinePrefix.Text
oWineData.SavePath = txtWineSavePath.Text
If Not bNewMode Then
mgrWineData.DoWineDataAddUpdate(oWineData)
End If
Me.DialogResult = DialogResult.OK
End If
End If
End Sub
Private Sub frmAdvancedConfiguration_Load(sender As Object, e As EventArgs) Handles MyBase.Load
SetForm()
LoadData()
HandleWarning()
End Sub
Private Sub btnSave_Click(sender As Object, e As EventArgs) Handles btnSave.Click
SaveData()
End Sub
Private Sub btnCancel_Click(sender As Object, e As EventArgs) Handles btnCancel.Click
Me.DialogResult = DialogResult.Cancel
End Sub
Private Sub frmWineConfiguration_FormClosing(sender As Object, e As FormClosingEventArgs) Handles MyBase.FormClosing
If oWineData.BinaryPath = String.Empty And oWineData.Prefix = String.Empty And oWineData.SavePath = String.Empty Then
oWineData = Nothing
End If
End Sub
End Class