From fdcef783fb2143b2b9609ee5b245073804b46d30 Mon Sep 17 00:00:00 2001 From: "Michael J. Seiferling" Date: Sat, 9 Feb 2019 12:45:13 -0600 Subject: [PATCH] Editing Wine data on Game Manager --- GBM/Forms/frmGameManager.Designer.vb | 44 +++--- GBM/Forms/frmGameManager.vb | 53 +++++++- GBM/Forms/frmMain.vb | 8 +- GBM/Forms/frmWineConfiguration.Designer.vb | 148 +++++++++++++++++++++ GBM/Forms/frmWineConfiguration.resx | 120 +++++++++++++++++ GBM/Forms/frmWineConfiguration.vb | 117 ++++++++++++++++ GBM/Game Backup Monitor.vbproj | 9 ++ GBM/Managers/mgrSettings.vb | 1 + GBM/My Project/Resources.Designer.vb | 116 ++++++++++++++-- GBM/My Project/Resources.resx | 42 +++++- 10 files changed, 611 insertions(+), 47 deletions(-) create mode 100644 GBM/Forms/frmWineConfiguration.Designer.vb create mode 100644 GBM/Forms/frmWineConfiguration.resx create mode 100644 GBM/Forms/frmWineConfiguration.vb diff --git a/GBM/Forms/frmGameManager.Designer.vb b/GBM/Forms/frmGameManager.Designer.vb index ce2c12f..29d7e7b 100644 --- a/GBM/Forms/frmGameManager.Designer.vb +++ b/GBM/Forms/frmGameManager.Designer.vb @@ -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 diff --git a/GBM/Forms/frmGameManager.vb b/GBM/Forms/frmGameManager.vb index d1339fc..2ad44dd 100644 --- a/GBM/Forms/frmGameManager.vb +++ b/GBM/Forms/frmGameManager.vb @@ -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 diff --git a/GBM/Forms/frmMain.vb b/GBM/Forms/frmMain.vb index 5b2af7d..e588fbf 100644 --- a/GBM/Forms/frmMain.vb +++ b/GBM/Forms/frmMain.vb @@ -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) diff --git a/GBM/Forms/frmWineConfiguration.Designer.vb b/GBM/Forms/frmWineConfiguration.Designer.vb new file mode 100644 index 0000000..53088e5 --- /dev/null +++ b/GBM/Forms/frmWineConfiguration.Designer.vb @@ -0,0 +1,148 @@ + _ +Partial Class frmWineConfiguration + Inherits System.Windows.Forms.Form + + 'Form overrides dispose to clean up the component list. + _ + 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. + _ + 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 diff --git a/GBM/Forms/frmWineConfiguration.resx b/GBM/Forms/frmWineConfiguration.resx new file mode 100644 index 0000000..1af7de1 --- /dev/null +++ b/GBM/Forms/frmWineConfiguration.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/GBM/Forms/frmWineConfiguration.vb b/GBM/Forms/frmWineConfiguration.vb new file mode 100644 index 0000000..434410c --- /dev/null +++ b/GBM/Forms/frmWineConfiguration.vb @@ -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 \ No newline at end of file diff --git a/GBM/Game Backup Monitor.vbproj b/GBM/Game Backup Monitor.vbproj index 966b99b..062ec7e 100644 --- a/GBM/Game Backup Monitor.vbproj +++ b/GBM/Game Backup Monitor.vbproj @@ -138,6 +138,12 @@ + + frmWineConfiguration.vb + + + Form + frmAdvancedImport.vb @@ -283,6 +289,9 @@ + + frmWineConfiguration.vb + frmAdvancedImport.vb diff --git a/GBM/Managers/mgrSettings.vb b/GBM/Managers/mgrSettings.vb index a11ec1a..8e3c596 100644 --- a/GBM/Managers/mgrSettings.vb +++ b/GBM/Managers/mgrSettings.vb @@ -32,6 +32,7 @@ Public Class mgrSettings GameIDSync = 1 BackupImport = 2 WinConfigsInLinux = 4 + WineConfig = 16 End Enum Property StartWithWindows As Boolean diff --git a/GBM/My Project/Resources.Designer.vb b/GBM/My Project/Resources.Designer.vb index e8a91d6..56e237e 100644 --- a/GBM/My Project/Resources.Designer.vb +++ b/GBM/My Project/Resources.Designer.vb @@ -1491,15 +1491,6 @@ Namespace My.Resources End Get End Property - ''' - ''' Looks up a localized string similar to &Advanced Configuration.... - ''' - Friend ReadOnly Property frmGameManager_btnAdvancedConfig() As String - Get - Return ResourceManager.GetString("frmGameManager_btnAdvancedConfig", resourceCulture) - End Get - End Property - ''' ''' Looks up a localized string similar to .... ''' @@ -1707,6 +1698,15 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to &Wine Configuration.... + ''' + Friend ReadOnly Property frmGameManager_btnWineConfig() As String + Get + Return ResourceManager.GetString("frmGameManager_btnWineConfig", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized string similar to Delete folder on restore. ''' @@ -2545,7 +2545,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to Official Windows configurations can be used in Linux for games running in Wine or Proton.[BR][BR]You do not need to modify these configurations, GBM will automatically do any required path conversions the first time the game is detected.[BR][BR]This message will only be shown once.. + ''' Looks up a localized string similar to Official Windows configurations can be used in Linux for games running in Wine or Proton.[BR][BR]You do not need to modify these configurations, GBM will automatically do any required path conversions when the game is detected.[BR][BR]This message will only be shown once.. ''' Friend ReadOnly Property frmGameManager_WarningWinConfigsInLinux() As String Get @@ -4066,7 +4066,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to [PARAM] Wine Binary Path: [PARAM]. + ''' Looks up a localized string similar to Wine Binary Path: [PARAM]. ''' Friend ReadOnly Property frmMain_WineBinaryPath() As String Get @@ -4075,7 +4075,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to [PARAM] Wine Prefix: [PARAM]. + ''' Looks up a localized string similar to Wine Prefix: [PARAM]. ''' Friend ReadOnly Property frmMain_WinePrefix() As String Get @@ -4084,7 +4084,7 @@ Namespace My.Resources End Property ''' - ''' Looks up a localized string similar to [PARAM] Wine Save Path: [PARAM]. + ''' Looks up a localized string similar to Wine Save Path: [PARAM]. ''' Friend ReadOnly Property frmMain_WineSavePath() As String Get @@ -5640,6 +5640,96 @@ Namespace My.Resources End Get End Property + ''' + ''' Looks up a localized string similar to &Cancel. + ''' + Friend ReadOnly Property frmWineConfiguration_btnCancel() As String + Get + Return ResourceManager.GetString("frmWineConfiguration_btnCancel", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to &Save. + ''' + Friend ReadOnly Property frmWineConfiguration_btnSave() As String + Get + Return ResourceManager.GetString("frmWineConfiguration_btnSave", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to The Wine binary path is required.[BR][BR]Clear all fields and save to remove all Wine data for this game.. + ''' + Friend ReadOnly Property frmWineConfiguration_ErrorValidationBinaryPath() As String + Get + Return ResourceManager.GetString("frmWineConfiguration_ErrorValidationBinaryPath", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to The Wine Prefix is required.[BR][BR]Clear all fields and save to remove all Wine data for this game.. + ''' + Friend ReadOnly Property frmWineConfiguration_ErrorValidationPrefix() As String + Get + Return ResourceManager.GetString("frmWineConfiguration_ErrorValidationPrefix", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Wine Configuration. + ''' + Friend ReadOnly Property frmWineConfiguration_FormName() As String + Get + Return ResourceManager.GetString("frmWineConfiguration_FormName", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Configuration. + ''' + Friend ReadOnly Property frmWineConfiguration_grpWineConfig() As String + Get + Return ResourceManager.GetString("frmWineConfiguration_grpWineConfig", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Binary Path:. + ''' + Friend ReadOnly Property frmWineConfiguration_lblWineBinaryPath() As String + Get + Return ResourceManager.GetString("frmWineConfiguration_lblWineBinaryPath", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Prefix:. + ''' + Friend ReadOnly Property frmWineConfiguration_lblWinePrefix() As String + Get + Return ResourceManager.GetString("frmWineConfiguration_lblWinePrefix", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Save Path:. + ''' + Friend ReadOnly Property frmWineConfiguration_lblWineSavePath() As String + Get + Return ResourceManager.GetString("frmWineConfiguration_lblWineSavePath", resourceCulture) + End Get + End Property + + ''' + ''' Looks up a localized string similar to Game Backup Monitor automatically updates the Wine configuration for a game each time it is detected. Modifying any of these fields manually is not recommended in most cases.[BR][BR]This warning will only be displayed once.. + ''' + Friend ReadOnly Property frmWineConfiguration_WarningSingle() As String + Get + Return ResourceManager.GetString("frmWineConfiguration_WarningSingle", resourceCulture) + End Get + End Property + ''' ''' Looks up a localized resource of type System.Drawing.Icon similar to (Icon). ''' diff --git a/GBM/My Project/Resources.resx b/GBM/My Project/Resources.resx index 2ae56a7..3e781f8 100644 --- a/GBM/My Project/Resources.resx +++ b/GBM/My Project/Resources.resx @@ -2204,10 +2204,10 @@ The backup folder [PARAM] cannot be renamed to [PARAM] because a folder with that name already exists.[BR][BR]Do you want to continue and remove the existing folder? - [PARAM] Wine Prefix: [PARAM] + Wine Prefix: [PARAM] - [PARAM] Wine Save Path: [PARAM] + Wine Save Path: [PARAM] An error occured when building a Wine path.[BR][BR][PARAM] @@ -2264,7 +2264,7 @@ &Windows... - Official Windows configurations can be used in Linux for games running in Wine or Proton.[BR][BR]You do not need to modify these configurations, GBM will automatically do any required path conversions the first time the game is detected.[BR][BR]This message will only be shown once. + Official Windows configurations can be used in Linux for games running in Wine or Proton.[BR][BR]You do not need to modify these configurations, GBM will automatically do any required path conversions when the game is detected.[BR][BR]This message will only be shown once. Importing this backup file will overwrite the current backup file for [PARAM].[BR][BR]Do you want to continue? This will close the form. @@ -2290,16 +2290,46 @@ OS: - - &Advanced Configuration... + + &Wine Configuration... OS - [PARAM] Wine Binary Path: [PARAM] + Wine Binary Path: [PARAM] [PARAM] uses a Windows configuration and requires a Wine save path to perform this operation. + + &Cancel + + + &Save + + + The Wine binary path is required.[BR][BR]Clear all fields and save to remove all Wine data for this game. + + + The Wine Prefix is required.[BR][BR]Clear all fields and save to remove all Wine data for this game. + + + Wine Configuration + + + Configuration + + + Binary Path: + + + Prefix: + + + Save Path: + + + Game Backup Monitor automatically updates the Wine configuration for a game each time it is detected. Modifying any of these fields manually is not recommended in most cases.[BR][BR]This warning will only be displayed once. + \ No newline at end of file