This commit is contained in:
2019-03-14 12:37:38 +00:00
42 changed files with 2316 additions and 628 deletions
+1 -1
View File
@@ -434,7 +434,7 @@ Public Class frmAddWizard
End If
End If
sNewPath = mgrCommon.OpenFolderBrowser("Wizard_Save_Path", frmAddWizard_ChooseSavePath, sDefaultFolder, False, False)
sNewPath = mgrCommon.OpenClassicFolderBrowser("Wizard_Save_Path", frmAddWizard_ChooseSavePath, sDefaultFolder, False, False)
If sNewPath <> String.Empty Then txtSavePath.Text = sNewPath
End Sub
+1 -46
View File
@@ -51,7 +51,7 @@ Public Class frmAdvancedImport
lstGames.BeginUpdate()
bSelectAll = Not bSelectAll
For i As Integer = 0 To lstGames.Items.Count - 1
lstGames.Items(i).Checked = bSelectAll
lstGames.Items(i).Checked = bSelectAll
Next
lstGames.EndUpdate()
Cursor.Current = Cursors.Default
@@ -66,46 +66,6 @@ Public Class frmAdvancedImport
End If
End Sub
Private Sub ModTags(ByRef oTags As List(Of Tag))
Dim bExists As Boolean
Dim oTag As Tag
Dim oNewTag As Tag
Dim oRemoveTag As New Tag
Dim sTag As String
Dim sAddTags() As String = {"Wine"}
Dim sRemoveTags() As String = {"Official"}
For Each sTag In sAddTags
bExists = False
For Each oTag In oTags
If oTag.Name = sTag Then
bExists = True
Exit For
End If
Next
If Not bExists Then
oNewTag = New Tag
oNewTag.Name = sTag
oTags.Add(oNewTag)
End If
Next
For Each sTag In sRemoveTags
bExists = False
For Each oTag In oTags
If oTag.Name = sTag Then
bExists = True
oRemoveTag = oTag
Exit For
End If
Next
If bExists Then
oTags.Remove(oRemoveTag)
End If
Next
End Sub
Private Function CheckIgnoreTags(ByVal oTags As List(Of Tag)) As Boolean
Dim oTag As Tag
Dim sTag As String
@@ -142,11 +102,6 @@ Public Class frmAdvancedImport
bAddItem = False
oApp = DirectCast(de.Value, clsGame)
'Run any required tag mods
If ModWinConfigsForLinux Then
ModTags(oApp.ImportTags)
End If
sTags = String.Empty
oApp.ImportTags.Sort(AddressOf mgrCommon.CompareImportTagsByName)
For Each oTag As Tag In oApp.ImportTags
+1
View File
@@ -49,6 +49,7 @@ Partial Class frmChooseGame
'lstGameBox
'
Me.lstGameBox.FormattingEnabled = True
Me.lstGameBox.HorizontalScrollbar = True
Me.lstGameBox.Location = New System.Drawing.Point(15, 34)
Me.lstGameBox.Name = "lstGameBox"
Me.lstGameBox.Size = New System.Drawing.Size(228, 95)
+9 -1
View File
@@ -26,11 +26,19 @@ Public Class frmChooseGame
End Property
Private Sub FillComboBox()
Dim sTags As String
Dim sName As String
lstGameBox.ValueMember = "Key"
lstGameBox.DisplayMember = "Value"
For Each o As clsGame In Process.DuplicateList
lstGameBox.Items.Add(New KeyValuePair(Of String, String)(o.ID, o.Name))
sTags = mgrGameTags.PrintTagsbyID(o.ID)
If sTags <> String.Empty Then
sName = o.Name & " (" & sTags & ")"
Else
sName = o.Name
End If
lstGameBox.Items.Add(New KeyValuePair(Of String, String)(o.ID, sName))
oGamesHash.Add(o.ID, o)
Next
+10 -10
View File
@@ -40,7 +40,7 @@ Partial Class frmFilter
Me.grpGameFilter = New System.Windows.Forms.GroupBox()
Me.lblNot = New System.Windows.Forms.Label()
Me.chkNot = New System.Windows.Forms.CheckBox()
Me.cboBoolFilter = New System.Windows.Forms.ComboBox()
Me.cboListFilter = New System.Windows.Forms.ComboBox()
Me.numFilter = New System.Windows.Forms.NumericUpDown()
Me.cboNumericOps = New System.Windows.Forms.ComboBox()
Me.lblCurrentFilters = New System.Windows.Forms.Label()
@@ -229,7 +229,7 @@ Partial Class frmFilter
'
Me.grpGameFilter.Controls.Add(Me.lblNot)
Me.grpGameFilter.Controls.Add(Me.chkNot)
Me.grpGameFilter.Controls.Add(Me.cboBoolFilter)
Me.grpGameFilter.Controls.Add(Me.cboListFilter)
Me.grpGameFilter.Controls.Add(Me.numFilter)
Me.grpGameFilter.Controls.Add(Me.cboNumericOps)
Me.grpGameFilter.Controls.Add(Me.lblCurrentFilters)
@@ -265,14 +265,14 @@ Partial Class frmFilter
Me.chkNot.TabIndex = 10
Me.chkNot.UseVisualStyleBackColor = True
'
'cboBoolFilter
'cboListFilter
'
Me.cboBoolFilter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cboBoolFilter.FormattingEnabled = True
Me.cboBoolFilter.Location = New System.Drawing.Point(187, 36)
Me.cboBoolFilter.Name = "cboBoolFilter"
Me.cboBoolFilter.Size = New System.Drawing.Size(136, 21)
Me.cboBoolFilter.TabIndex = 3
Me.cboListFilter.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cboListFilter.FormattingEnabled = True
Me.cboListFilter.Location = New System.Drawing.Point(187, 36)
Me.cboListFilter.Name = "cboListFilter"
Me.cboListFilter.Size = New System.Drawing.Size(136, 21)
Me.cboListFilter.TabIndex = 3
'
'numFilter
'
@@ -549,7 +549,7 @@ Partial Class frmFilter
Friend WithEvents lblFields As Label
Friend WithEvents cboNumericOps As ComboBox
Friend WithEvents numFilter As NumericUpDown
Friend WithEvents cboBoolFilter As ComboBox
Friend WithEvents cboListFilter As ComboBox
Friend WithEvents lblSortFields As Label
Friend WithEvents Label1 As Label
Friend WithEvents grpSortOptions As GroupBox
+50 -16
View File
@@ -242,6 +242,15 @@ Public Class frmFilter
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'OS
oField = New clsGameFilterField
oField.FieldName = "OS"
oField.FriendlyFieldName = frmFilter_FieldOS
oField.Type = clsGameFilterField.eDataType.fEnum
oField.EnumField = clsGameFilterField.eEnumFilterField.OS
oField.Status = clsGameFilterField.eFieldStatus.ValidFilter
oValidFields.Add(oField)
'IsRegEx
oField = New clsGameFilterField
oField.FieldName = "IsRegEx"
@@ -359,7 +368,7 @@ Public Class frmFilter
sFilter = oFilter.Field.FriendlyFieldName & " " & frmFilter_lstFilterContains & " """ & oFilter.Data & """"
Case clsGameFilterField.eDataType.fNumeric
sFilter = oFilter.Field.FriendlyFieldName & " " & oFilter.NumericOperatorAsString & " " & oFilter.Data
Case clsGameFilterField.eDataType.fBool
Case clsGameFilterField.eDataType.fBool, clsGameFilterField.eDataType.fEnum
sFilter = oFilter.Field.FriendlyFieldName & " = " & oFilter.Data
End Select
@@ -413,23 +422,22 @@ Public Class frmFilter
End Sub
Private Sub ChangeFilterMode()
Dim oFilterType As clsGameFilterField.eDataType = DirectCast(cboFilterField.SelectedValue, clsGameFilterField).Type
Dim oFilter As clsGameFilterField = DirectCast(cboFilterField.SelectedValue, clsGameFilterField)
'Reset
cboNumericOps.SelectedIndex = 0
cboBoolFilter.SelectedIndex = 0
numFilter.Value = 0
txtStringFilter.Text = String.Empty
chkNot.Checked = False
'Reset Visibilty
cboBoolFilter.Visible = False
cboListFilter.Visible = False
cboNumericOps.Visible = False
numFilter.Visible = False
txtStringFilter.Visible = False
'Set Visiblity
Select Case oFilterType
Select Case oFilter.Type
Case clsGameFilterField.eDataType.fString
txtStringFilter.Visible = True
Case clsGameFilterField.eDataType.fNumeric
@@ -437,7 +445,13 @@ Public Class frmFilter
numFilter.Visible = True
txtStringFilter.Visible = False
Case clsGameFilterField.eDataType.fBool
cboBoolFilter.Visible = True
LoadComboAsBool()
cboListFilter.SelectedIndex = 0
cboListFilter.Visible = True
Case clsGameFilterField.eDataType.fEnum
LoadComboAsEnum(oFilter.EnumField)
cboListFilter.SelectedIndex = 0
cboListFilter.Visible = True
End Select
End Sub
@@ -458,8 +472,8 @@ Public Class frmFilter
oFilter.Data = numFilter.Value
oFilter.NumericOperator = DirectCast(cboNumericOps.SelectedValue, clsGameFilter.eNumericOperators)
sFilter = oFilter.Field.FriendlyFieldName & " " & oFilter.NumericOperatorAsString & " " & oFilter.Data
Case clsGameFilterField.eDataType.fBool
oFilter.Data = cboBoolFilter.SelectedValue
Case clsGameFilterField.eDataType.fBool, clsGameFilterField.eDataType.fEnum
oFilter.Data = cboListFilter.SelectedValue
sFilter = oFilter.Field.FriendlyFieldName & " = " & oFilter.Data
End Select
@@ -531,20 +545,40 @@ Public Class frmFilter
End Sub
Private Sub LoadCombos()
Dim oFilterFields As New List(Of KeyValuePair(Of clsGameFilterField, String))
Dim oSortFields As New List(Of KeyValuePair(Of String, String))
Dim oNumericOperators As New List(Of KeyValuePair(Of clsGameFilter.eNumericOperators, String))
Private Sub LoadComboAsBool()
Dim oBoolOperators As New List(Of KeyValuePair(Of Boolean, String))
'cboBoolFilter
cboBoolFilter.ValueMember = "Key"
cboBoolFilter.DisplayMember = "Value"
'cboListFilter (Boolean)
cboListFilter.ValueMember = "Key"
cboListFilter.DisplayMember = "Value"
oBoolOperators.Add(New KeyValuePair(Of Boolean, String)(True, frmFilter_cboBoolFilterEnabled))
oBoolOperators.Add(New KeyValuePair(Of Boolean, String)(False, frmFilter_cboBoolFilterDisabled))
cboBoolFilter.DataSource = oBoolOperators
cboListFilter.DataSource = oBoolOperators
End Sub
Private Sub LoadComboAsEnum(ByVal eEnum As clsGameFilterField.eEnumFilterField)
Dim oEnums As New List(Of KeyValuePair(Of Integer, String))
'cboListFilter (Enum)
cboListFilter.ValueMember = "Key"
cboListFilter.DisplayMember = "Value"
Select Case eEnum
Case clsGameFilterField.eEnumFilterField.OS
For Each v As Object In [Enum].GetValues(GetType(clsGame.eOS))
oEnums.Add(New KeyValuePair(Of Integer, String)(v, [Enum].GetName(GetType(clsGame.eOS), v)))
Next
End Select
cboListFilter.DataSource = oEnums
End Sub
Private Sub LoadCombos()
Dim oFilterFields As New List(Of KeyValuePair(Of clsGameFilterField, String))
Dim oSortFields As New List(Of KeyValuePair(Of String, String))
Dim oNumericOperators As New List(Of KeyValuePair(Of clsGameFilter.eNumericOperators, String))
'cboNumericOps
cboNumericOps.ValueMember = "Key"
+76 -39
View File
@@ -28,12 +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()
@@ -107,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.chkRecurseSubFolders = New System.Windows.Forms.CheckBox()
Me.grpConfig.SuspendLayout()
CType(Me.nudLimit, System.ComponentModel.ISupportInitialize).BeginInit()
Me.grpExtra.SuspendLayout()
@@ -164,13 +167,16 @@ 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.btnWineConfig)
Me.grpConfig.Controls.Add(Me.lblOS)
Me.grpConfig.Controls.Add(Me.cboOS)
Me.grpConfig.Controls.Add(Me.chkRecurseSubFolders)
Me.grpConfig.Controls.Add(Me.btnGameID)
Me.grpConfig.Controls.Add(Me.chkRegEx)
Me.grpConfig.Controls.Add(Me.lblComments)
Me.grpConfig.Controls.Add(Me.txtComments)
Me.grpConfig.Controls.Add(Me.txtParameter)
Me.grpConfig.Controls.Add(Me.lblParameter)
Me.grpConfig.Controls.Add(Me.txtComments)
Me.grpConfig.Controls.Add(Me.chkCleanFolder)
Me.grpConfig.Controls.Add(Me.lblLimit)
Me.grpConfig.Controls.Add(Me.nudLimit)
@@ -197,6 +203,44 @@ 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
Me.lblOS.Location = New System.Drawing.Point(7, 172)
Me.lblOS.Name = "lblOS"
Me.lblOS.Size = New System.Drawing.Size(25, 13)
Me.lblOS.TabIndex = 14
Me.lblOS.Text = "OS:"
'
'cboOS
'
Me.cboOS.DropDownStyle = System.Windows.Forms.ComboBoxStyle.DropDownList
Me.cboOS.FormattingEnabled = True
Me.cboOS.Location = New System.Drawing.Point(70, 169)
Me.cboOS.Name = "cboOS"
Me.cboOS.Size = New System.Drawing.Size(115, 21)
Me.cboOS.TabIndex = 15
'
'chkRecurseSubFolders
'
Me.chkRecurseSubFolders.AutoSize = True
Me.chkRecurseSubFolders.Location = New System.Drawing.Point(489, 206)
Me.chkRecurseSubFolders.Name = "chkRecurseSubFolders"
Me.chkRecurseSubFolders.Size = New System.Drawing.Size(15, 14)
Me.chkRecurseSubFolders.TabIndex = 0
Me.chkRecurseSubFolders.TabStop = False
Me.chkRecurseSubFolders.UseVisualStyleBackColor = True
Me.chkRecurseSubFolders.Visible = False
'
'btnGameID
'
Me.btnGameID.Location = New System.Drawing.Point(402, 17)
@@ -219,21 +263,12 @@ Partial Class frmGameManager
'lblComments
'
Me.lblComments.AutoSize = True
Me.lblComments.Location = New System.Drawing.Point(7, 181)
Me.lblComments.Location = New System.Drawing.Point(7, 128)
Me.lblComments.Name = "lblComments"
Me.lblComments.Size = New System.Drawing.Size(59, 13)
Me.lblComments.TabIndex = 19
Me.lblComments.TabIndex = 12
Me.lblComments.Text = "Comments:"
'
'txtComments
'
Me.txtComments.Location = New System.Drawing.Point(70, 181)
Me.txtComments.Multiline = True
Me.txtComments.Name = "txtComments"
Me.txtComments.ScrollBars = System.Windows.Forms.ScrollBars.Vertical
Me.txtComments.Size = New System.Drawing.Size(413, 71)
Me.txtComments.TabIndex = 20
'
'txtParameter
'
Me.txtParameter.Location = New System.Drawing.Point(70, 71)
@@ -250,49 +285,58 @@ 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
Me.chkCleanFolder.Location = New System.Drawing.Point(330, 127)
Me.chkCleanFolder.Location = New System.Drawing.Point(330, 200)
Me.chkCleanFolder.Name = "chkCleanFolder"
Me.chkCleanFolder.Size = New System.Drawing.Size(136, 17)
Me.chkCleanFolder.TabIndex = 14
Me.chkCleanFolder.TabIndex = 19
Me.chkCleanFolder.Text = "Delete folder on restore"
Me.chkCleanFolder.UseVisualStyleBackColor = True
'
'lblLimit
'
Me.lblLimit.AutoSize = True
Me.lblLimit.Location = New System.Drawing.Point(376, 157)
Me.lblLimit.Location = New System.Drawing.Point(376, 229)
Me.lblLimit.Name = "lblLimit"
Me.lblLimit.Size = New System.Drawing.Size(68, 13)
Me.lblLimit.TabIndex = 18
Me.lblLimit.TabIndex = 23
Me.lblLimit.Text = "Backup Limit"
Me.lblLimit.Visible = False
'
'nudLimit
'
Me.nudLimit.Location = New System.Drawing.Point(330, 155)
Me.nudLimit.Location = New System.Drawing.Point(330, 227)
Me.nudLimit.Name = "nudLimit"
Me.nudLimit.Size = New System.Drawing.Size(40, 20)
Me.nudLimit.TabIndex = 17
Me.nudLimit.TabIndex = 22
Me.nudLimit.Visible = False
'
'btnExclude
'
Me.btnExclude.Location = New System.Drawing.Point(10, 152)
Me.btnExclude.Location = New System.Drawing.Point(10, 224)
Me.btnExclude.Name = "btnExclude"
Me.btnExclude.Size = New System.Drawing.Size(175, 23)
Me.btnExclude.TabIndex = 15
Me.btnExclude.TabIndex = 20
Me.btnExclude.Text = "E&xclude Items..."
Me.btnExclude.UseVisualStyleBackColor = True
'
'btnInclude
'
Me.btnInclude.Location = New System.Drawing.Point(10, 123)
Me.btnInclude.Location = New System.Drawing.Point(10, 196)
Me.btnInclude.Name = "btnInclude"
Me.btnInclude.Size = New System.Drawing.Size(175, 23)
Me.btnInclude.TabIndex = 12
Me.btnInclude.TabIndex = 17
Me.btnInclude.Text = "Incl&ude Items..."
Me.btnInclude.UseVisualStyleBackColor = True
'
@@ -372,20 +416,20 @@ Partial Class frmGameManager
'chkTimeStamp
'
Me.chkTimeStamp.AutoSize = True
Me.chkTimeStamp.Location = New System.Drawing.Point(191, 156)
Me.chkTimeStamp.Location = New System.Drawing.Point(191, 228)
Me.chkTimeStamp.Name = "chkTimeStamp"
Me.chkTimeStamp.Size = New System.Drawing.Size(133, 17)
Me.chkTimeStamp.TabIndex = 16
Me.chkTimeStamp.TabIndex = 21
Me.chkTimeStamp.Text = "Save multiple backups"
Me.chkTimeStamp.UseVisualStyleBackColor = True
'
'chkFolderSave
'
Me.chkFolderSave.AutoSize = True
Me.chkFolderSave.Location = New System.Drawing.Point(191, 127)
Me.chkFolderSave.Location = New System.Drawing.Point(191, 200)
Me.chkFolderSave.Name = "chkFolderSave"
Me.chkFolderSave.Size = New System.Drawing.Size(109, 17)
Me.chkFolderSave.TabIndex = 13
Me.chkFolderSave.TabIndex = 18
Me.chkFolderSave.Text = "Save entire folder"
Me.chkFolderSave.UseVisualStyleBackColor = True
'
@@ -614,6 +658,7 @@ Partial Class frmGameManager
Me.cboRemoteBackup.Name = "cboRemoteBackup"
Me.cboRemoteBackup.Size = New System.Drawing.Size(387, 21)
Me.cboRemoteBackup.TabIndex = 12
Me.cboRemoteBackup.Tag = "wipe"
'
'lblRestorePathData
'
@@ -927,17 +972,6 @@ Partial Class frmGameManager
Me.ttFullPath.InitialDelay = 300
Me.ttFullPath.ReshowDelay = 60
'
'chkRecurseSubFolders
'
Me.chkRecurseSubFolders.AutoSize = True
Me.chkRecurseSubFolders.Location = New System.Drawing.Point(489, 206)
Me.chkRecurseSubFolders.Name = "chkRecurseSubFolders"
Me.chkRecurseSubFolders.Size = New System.Drawing.Size(15, 14)
Me.chkRecurseSubFolders.TabIndex = 0
Me.chkRecurseSubFolders.TabStop = False
Me.chkRecurseSubFolders.UseVisualStyleBackColor = True
Me.chkRecurseSubFolders.Visible = False
'
'frmGameManager
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
@@ -1073,4 +1107,7 @@ Partial Class frmGameManager
Friend WithEvents cmsOfficialWindows As ToolStripMenuItem
Friend WithEvents cmsOfficialLinux As ToolStripMenuItem
Friend WithEvents chkRecurseSubFolders As CheckBox
Friend WithEvents lblOS As Label
Friend WithEvents cboOS As ComboBox
Friend WithEvents btnWineConfig As Button
End Class
+123 -51
View File
@@ -209,6 +209,14 @@ Public Class frmGameManager
Return sPath
End Function
Private Sub HandleWineConfig()
If mgrCommon.IsUnix And cboOS.SelectedValue = clsGame.eOS.Windows And Not eCurrentMode = eModes.Add 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
@@ -334,7 +342,7 @@ Public Class frmGameManager
oRestoreData = mgrRestore.CompareManifests
'Only show games with data to restore
Dim oTemporaryList As OrderedDictionary = mgrCommon.GenericClone(GameData)
Dim oTemporaryList As OrderedDictionary = mgrMonitorList.ReadFilteredList(oCurrentIncludeTagFilters, oCurrentExcludeTagFilters, oCurrentFilters, eCurrentFilter, bCurrentAndOperator, bCurrentSortAsc, sCurrentSortField)
For Each de As DictionaryEntry In oTemporaryList
oGame = DirectCast(de.Value, clsGame)
If Not oRestoreData.ContainsKey(oGame.ID) Then
@@ -345,7 +353,7 @@ Public Class frmGameManager
Next
ElseIf optBackupData.Checked Then
'Only show games with backup data
Dim oTemporaryList As OrderedDictionary = mgrCommon.GenericClone(GameData)
Dim oTemporaryList As OrderedDictionary = mgrMonitorList.ReadFilteredList(oCurrentIncludeTagFilters, oCurrentExcludeTagFilters, oCurrentFilters, eCurrentFilter, bCurrentAndOperator, bCurrentSortAsc, sCurrentSortField)
oRestoreData = oRemoteBackupData.Clone
For Each de As DictionaryEntry In oTemporaryList
@@ -394,14 +402,14 @@ Public Class frmGameManager
End If
End If
sNewPath = mgrCommon.OpenFolderBrowser("GM_Process_Path", frmGameManager_ChooseExePath, sDefaultFolder, False, False)
sNewPath = mgrCommon.OpenFolderBrowser("GM_Process_Path", frmGameManager_ChooseExePath, sDefaultFolder, False)
If sNewPath <> String.Empty Then txtAppPath.Text = sNewPath
End Sub
Private Sub SavePathBrowse()
Dim sDefaultFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
Dim sCurrentPath As String = txtSavePath.Text
Dim sCurrentPath As String = mgrPath.ReplaceSpecialPaths(txtSavePath.Text)
Dim sNewPath As String
If txtSavePath.Text <> String.Empty Then
@@ -410,7 +418,7 @@ Public Class frmGameManager
End If
End If
sNewPath = mgrCommon.OpenFolderBrowser("GM_Save_Path", frmGameManager_ChooseSaveFolder, sDefaultFolder, False, False)
sNewPath = mgrCommon.OpenFolderBrowser("GM_Save_Path", frmGameManager_ChooseSaveFolder, sDefaultFolder, False)
If sNewPath <> String.Empty Then
txtSavePath.Text = sNewPath
@@ -533,11 +541,15 @@ Public Class frmGameManager
sFileName = BackupFolder & CurrentBackupItem.FileName
If File.Exists(sFileName) Then
oProcessStartInfo = New ProcessStartInfo
oProcessStartInfo.FileName = sFileName
oProcessStartInfo.UseShellExecute = True
oProcessStartInfo.Verb = "open"
Process.Start(oProcessStartInfo)
Try
oProcessStartInfo = New ProcessStartInfo
oProcessStartInfo.FileName = sFileName
oProcessStartInfo.UseShellExecute = True
oProcessStartInfo.Verb = "open"
Process.Start(oProcessStartInfo)
Catch ex As Exception
mgrCommon.ShowMessage(App_ErrorLaunchExternal, ex.Message, MsgBoxStyle.Exclamation)
End Try
Else
mgrCommon.ShowMessage(frmGameManager_ErrorNoBackupExists, MsgBoxStyle.Exclamation)
End If
@@ -641,11 +653,15 @@ Public Class frmGameManager
End If
If Directory.Exists(sPath) Then
oProcessStartInfo = New ProcessStartInfo
oProcessStartInfo.FileName = sPath
oProcessStartInfo.UseShellExecute = True
oProcessStartInfo.Verb = "open"
Process.Start(oProcessStartInfo)
Try
oProcessStartInfo = New ProcessStartInfo
oProcessStartInfo.FileName = sPath
oProcessStartInfo.UseShellExecute = True
oProcessStartInfo.Verb = "open"
Process.Start(oProcessStartInfo)
Catch ex As Exception
mgrCommon.ShowMessage(App_ErrorLaunchExternal, ex.Message, MsgBoxStyle.Exclamation)
End Try
Else
mgrCommon.ShowMessage(frmGameManager_ErrorNoRestorePathExists, MsgBoxStyle.Exclamation)
End If
@@ -706,13 +722,13 @@ Public Class frmGameManager
If eCurrentMode = eModes.Add Then
oTagsToSave = frm.TagList
FillTagsbyList(frm.TagList)
lblTags.Text = mgrGameTags.PrintTagsbyList(frm.TagList)
Else
'Sync
mgrMonitorList.SyncMonitorLists(Settings)
'Only update visible tags if one item is selected
If lstGames.SelectedItems.Count = 1 Then FillTagsbyID(CurrentGame.ID)
If lstGames.SelectedItems.Count = 1 Then lblTags.Text = mgrGameTags.PrintTagsbyID(CurrentGame.ID)
'If a tag filter is enabled, reload list to reflect changes
If optCustom.Checked Then
@@ -726,6 +742,13 @@ Public Class frmGameManager
End Sub
Public Sub OpenWineConfiguration()
Dim frm As New frmWineConfiguration
frm.Settings = oSettings
frm.MonitorID = oCurrentGame.ID
frm.ShowDialog()
End Sub
Public Sub VerifyBackups(ByVal oApp As clsGame)
Dim oCurrentBackup As clsBackup
Dim oCurrentBackups As List(Of clsBackup)
@@ -845,6 +868,18 @@ Public Class frmGameManager
btnMarkAsRestored.Enabled = False
End If
If chkMonitorOnly.Checked Then
btnImportBackup.Enabled = False
Else
btnImportBackup.Enabled = True
End If
If mgrPath.IsSupportedRegistryPath(oApp.TruePath) Then
btnImportBackup.Enabled = False
btnOpenBackupFile.Enabled = False
btnOpenRestorePath.Enabled = False
End If
End Sub
Private Sub UpdateBackupInfo(ByVal sManifestID As String)
@@ -923,6 +958,7 @@ Public Class frmGameManager
txtProcess.Text = oApp.ProcessName
chkRegEx.Checked = oApp.IsRegEx
txtParameter.Text = oApp.Parameter
cboOS.SelectedValue = CInt(oApp.OS)
If oSettings.ShowResolvedPaths Then
txtSavePath.Text = oApp.Path
sttPath = oApp.TruePath
@@ -946,6 +982,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
@@ -953,7 +990,7 @@ Public Class frmGameManager
txtVersion.Text = oApp.Version
txtIcon.Text = oApp.Icon
FillTagsbyID(oData.Key)
lblTags.Text = mgrGameTags.PrintTagsbyID(oData.Key)
'Icon
If IO.File.Exists(oApp.Icon) Then
@@ -972,33 +1009,6 @@ Public Class frmGameManager
IsLoading = False
End Sub
Private Sub FillTagsbyID(ByVal sID As String)
Dim slTags As SortedList
Dim oTag As clsTag
Dim sTags As String = String.Empty
Dim cTrim() As Char = {",", " "}
slTags = mgrGameTags.GetTagsByGame(sID)
For Each de As DictionaryEntry In slTags
oTag = DirectCast(de.Value, clsTag)
sTags &= "#" & oTag.Name & ", "
Next
lblTags.Text = sTags.TrimEnd(cTrim)
End Sub
Private Sub FillTagsbyList(ByVal oList As List(Of KeyValuePair(Of String, String)))
Dim sTags As String = String.Empty
Dim cTrim() As Char = {",", " "}
For Each kp As KeyValuePair(Of String, String) In oList
sTags &= "#" & kp.Value & ", "
Next
lblTags.Text = sTags.TrimEnd(cTrim)
End Sub
Private Sub DirtyCheck_ValueChanged(sender As Object, e As EventArgs)
If Not IsLoading And Not eCurrentMode = eModes.MultiSelect Then
IsDirty = True
@@ -1021,6 +1031,7 @@ Public Class frmGameManager
Private Sub AssignDirtyHandlersMisc()
AddHandler chkEnabled.CheckedChanged, AddressOf DirtyCheck_ValueChanged
AddHandler chkMonitorOnly.CheckedChanged, AddressOf DirtyCheck_ValueChanged
AddHandler cboOS.SelectedValueChanged, AddressOf DirtyCheck_ValueChanged
End Sub
Private Sub WipeControls(ByVal oCtls As GroupBox.ControlCollection)
@@ -1034,7 +1045,7 @@ Public Class frmGameManager
ElseIf TypeOf ctl Is NumericUpDown Then
DirectCast(ctl, NumericUpDown).Value = DirectCast(ctl, NumericUpDown).Minimum
ElseIf TypeOf ctl Is ComboBox Then
DirectCast(ctl, ComboBox).DataSource = Nothing
If ctl.Tag = "wipe" Then DirectCast(ctl, ComboBox).DataSource = Nothing
End If
Next
End Sub
@@ -1083,6 +1094,8 @@ Public Class frmGameManager
btnExclude.Text = frmGameManager_btnExclude
btnImport.Enabled = False
btnExport.Enabled = False
cboOS.SelectedValue = CInt(mgrCommon.GetCurrentOS)
HandleWineConfig()
Case eModes.Edit
grpFilter.Enabled = False
lstGames.Enabled = False
@@ -1129,7 +1142,6 @@ Public Class frmGameManager
lblTags.Visible = True
btnImport.Enabled = True
btnExport.Enabled = True
btnImportBackup.Enabled = True
Case eModes.Disabled
grpFilter.Enabled = True
lstGames.Enabled = True
@@ -1158,6 +1170,7 @@ Public Class frmGameManager
btnExclude.Text = frmGameManager_btnExclude
btnImport.Enabled = True
btnExport.Enabled = True
cboOS.SelectedValue = CInt(mgrCommon.GetCurrentOS)
UpdateGenericButtonLabel(frmGameManager_IncludeShortcut, btnInclude, False)
UpdateGenericButtonLabel(frmGameManager_ExcludeShortcut, btnExclude, False)
UpdateGenericButtonLabel(frmGameManager_btnGameID, btnGameID, False)
@@ -1220,6 +1233,7 @@ Public Class frmGameManager
btnInclude.Enabled = False
btnExclude.Enabled = False
chkCleanFolder.Enabled = False
btnWineConfig.Enabled = False
Else
chkFolderSave.Enabled = True
chkTimeStamp.Enabled = True
@@ -1230,10 +1244,26 @@ Public Class frmGameManager
btnSavePathBrowse.Enabled = True
btnInclude.Enabled = True
btnExclude.Enabled = True
btnWineConfig.Enabled = True
FolderSaveModeChange()
End If
End Sub
Private Sub RegistryModeChange()
If mgrPath.IsSupportedRegistryPath(txtSavePath.Text) Then
cboOS.SelectedValue = CInt(clsGame.eOS.Windows)
chkFolderSave.Checked = True
chkFolderSave.Enabled = False
btnInclude.Enabled = False
btnExclude.Enabled = False
Else
chkFolderSave.Checked = False
chkFolderSave.Enabled = True
btnInclude.Enabled = True
btnExclude.Enabled = True
End If
End Sub
Private Sub TimeStampModeChange()
If chkTimeStamp.Checked Then
nudLimit.Visible = True
@@ -1258,7 +1288,7 @@ Public Class frmGameManager
Private Sub VerifyCleanFolder()
If Not bIsLoading Then
If (chkFolderSave.Checked = True And txtExclude.Text = String.Empty And txtSavePath.Text <> String.Empty) And Not chkMonitorOnly.Checked Then
If (chkFolderSave.Checked = True And txtExclude.Text = String.Empty And txtSavePath.Text <> String.Empty) And Not mgrPath.IsSupportedRegistryPath(txtSavePath.Text) And Not chkMonitorOnly.Checked Then
chkCleanFolder.Enabled = True
Else
chkCleanFolder.Checked = False
@@ -1364,9 +1394,22 @@ Public Class frmGameManager
oApp.ProcessName = txtProcess.Text
oApp.Parameter = txtParameter.Text
oApp.OS = CType(cboOS.SelectedValue, clsGame.eOS)
oApp.Path = mgrPath.ValidatePathForOS(txtSavePath.Text)
'Only do a simple root check here in case the user doesn't really understand creating a proper configuration
oApp.AbsolutePath = Path.IsPathRooted(oApp.Path)
'If we have a registry path, trim any trailing backslashes because they cause export failures
If mgrPath.IsSupportedRegistryPath(oApp.Path) Then
oApp.Path = oApp.Path.TrimEnd("\")
End If
'We need to handle a special case here when working with Windows configurations in Linux
If mgrCommon.IsUnix And mgrVariables.CheckForReservedVariables(oApp.Path) And oApp.OS = clsGame.eOS.Windows Then
oApp.AbsolutePath = True
Else
'Only do a simple root check here in case the user doesn't really understand creating a proper configuration
oApp.AbsolutePath = Path.IsPathRooted(oApp.Path)
End If
oApp.FileType = txtFileType.Text
oApp.ExcludeList = txtExclude.Text
oApp.FolderSave = chkFolderSave.Checked
@@ -1471,7 +1514,6 @@ Public Class frmGameManager
FillData()
ModeChange()
VerifyCleanFolder()
VerifyImportBackup()
ElseIf lstGames.SelectedItems.Count > 1 Then
eCurrentMode = eModes.MultiSelect
ModeChange()
@@ -1815,6 +1857,25 @@ Public Class frmGameManager
btnGameID.Text = frmGameManager_btnGameID
btnImportBackup.Text = frmGameManager_btnImportBackup
btnProcesses.Text = frmGameManager_btnProcesses
lblOS.Text = frmGameManager_lblOS
btnWineConfig.Text = frmGameManager_btnWineConfig
'Init Combos
Dim oComboItems As New List(Of KeyValuePair(Of Integer, String))
'cboOS
cboOS.ValueMember = "Key"
cboOS.DisplayMember = "Value"
oComboItems.Add(New KeyValuePair(Of Integer, String)(clsGame.eOS.Windows, App_WindowsOS))
oComboItems.Add(New KeyValuePair(Of Integer, String)(clsGame.eOS.Linux, App_LinuxOS))
cboOS.DataSource = oComboItems
If Not mgrCommon.IsUnix Then
cboOS.Enabled = False
btnWineConfig.Visible = False
End If
'Init Official Import Menu
If mgrCommon.IsUnix Then
@@ -1938,6 +1999,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)
@@ -2003,6 +2068,12 @@ Public Class frmGameManager
End If
End Sub
Private Sub cboOS_SelectedIndexChanged(sender As Object, e As EventArgs) Handles cboOS.SelectedIndexChanged
If Not bIsLoading And Not eCurrentMode = eModes.Add 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
@@ -2054,6 +2125,7 @@ Public Class frmGameManager
Private Sub txtSavePath_TextChanged(sender As Object, e As EventArgs) Handles txtSavePath.TextChanged
ttFullPath.RemoveAll()
RegistryModeChange()
VerifyCleanFolder()
End Sub
+1 -1
View File
@@ -118,7 +118,7 @@ Public Class frmIncludeExclude
End If
End If
sNewPath = mgrCommon.OpenFolderBrowser("IE_Save_Path", frmIncludeExclude_BrowseSaveFolder, sDefaultFolder, False, False)
sNewPath = mgrCommon.OpenFolderBrowser("IE_Save_Path", frmIncludeExclude_BrowseSaveFolder, sDefaultFolder, False)
If sNewPath <> String.Empty Then txtRootFolder.Text = sNewPath
End Sub
+190 -69
View File
@@ -30,6 +30,7 @@ Public Class frmMain
Private bMenuEnabled As Boolean = True
Private bLockdown As Boolean = True
Private bFirstRun As Boolean = False
Private bInitialLoad As Boolean = True
Private bProcessIsAdmin As Boolean = False
Private bLogToggle As Boolean = False
Private bShowToggle As Boolean = True
@@ -167,11 +168,46 @@ Public Class frmMain
OperationEnded()
End Sub
Private Function VerifyBackupForOS(ByRef oGame As clsGame, ByRef sPath As String) As Boolean
Dim bOSVerified As Boolean
'Handle Windows configurations in Linux
If mgrCommon.IsUnix Then
If oGame.OS = clsGame.eOS.Windows Then
If mgrVariables.CheckForReservedVariables(oGame.TruePath) Then
'Absolute Path
Dim oWineData As clsWineData = mgrWineData.DoWineDataGetbyID(oGame.ID)
If oWineData.SavePath <> String.Empty Then
sPath = oWineData.SavePath
bOSVerified = True
UpdateLog(mgrCommon.FormatString(frmMain_WineSavePath, oWineData.SavePath), False)
Else
bOSVerified = False
UpdateLog(mgrCommon.FormatString(frmMain_ErrorNoWineSavePath, oGame.Name), True, ToolTipIcon.Error, True)
End If
Else
'Relative Path
bOSVerified = True
End If
mgrPath.ModWinePathData(oGame)
Else
'Linux Configuration
bOSVerified = True
End If
Else
'Windows
bOSVerified = True
End If
Return bOSVerified
End Function
Private Sub RunRestore(ByVal oRestoreList As Hashtable)
Dim oGame As clsGame
Dim oReadyList As New List(Of clsBackup)
Dim oRestoreInfo As clsBackup
Dim bTriggerReload As Boolean = False
Dim bOSVerified As Boolean
Dim bPathVerified As Boolean
eCurrentOperation = eOperation.Restore
OperationStarted()
@@ -179,16 +215,23 @@ Public Class frmMain
'Build Restore List
For Each de As DictionaryEntry In oRestoreList
bPathVerified = False
bOSVerified = False
oGame = DirectCast(de.Key, clsGame)
oRestoreInfo = DirectCast(de.Value, clsBackup)
If mgrRestore.CheckPath(oRestoreInfo, oGame, bTriggerReload) Then
bOSVerified = VerifyBackupForOS(oGame, oRestoreInfo.RestorePath)
If mgrPath.IsSupportedRegistryPath(oRestoreInfo.TruePath) Then
bPathVerified = True
Else
UpdateLog(mgrCommon.FormatString(frmMain_ErrorRestorePath, oRestoreInfo.Name), False, ToolTipIcon.Error, True)
If mgrRestore.CheckPath(oRestoreInfo, oGame, bTriggerReload) Then
bPathVerified = True
Else
UpdateLog(mgrCommon.FormatString(frmMain_ErrorRestorePath, oRestoreInfo.Name), False, ToolTipIcon.Error, True)
End If
End If
If bPathVerified Then
If bOSVerified And bPathVerified Then
If oRestore.CheckRestorePrereq(oRestoreInfo, oGame.CleanFolder) Then
oReadyList.Add(oRestoreInfo)
End If
@@ -212,6 +255,7 @@ Public Class frmMain
Private Sub RunManualBackup(ByVal oBackupList As List(Of clsGame))
Dim oGame As clsGame
Dim bNoAuto As Boolean
Dim bOSVerified As Boolean
Dim bPathVerified As Boolean
Dim oReadyList As New List(Of clsGame)
@@ -221,11 +265,14 @@ Public Class frmMain
'Build Backup List
For Each oGame In oBackupList
bNoAuto = False
bOSVerified = False
bPathVerified = False
gMonStripStatusButton.Enabled = False
UpdateLog(mgrCommon.FormatString(frmMain_ManualBackup, oGame.Name), False)
bOSVerified = VerifyBackupForOS(oGame, oGame.Path)
If oGame.AbsolutePath = False Then
If oGame.ProcessPath = String.Empty Then
If mgrCommon.IsProcessNotSearchable(oGame) Then bNoAuto = True
@@ -241,7 +288,7 @@ Public Class frmMain
bPathVerified = True
End If
If bPathVerified Then
If bOSVerified And bPathVerified Then
If oBackup.CheckBackupPrereq(oGame) Then
oReadyList.Add(oGame)
End If
@@ -306,7 +353,7 @@ Public Class frmMain
If oSettings.DisableConfirmation Then
bDoBackup = True
Else
If mgrCommon.ShowMessage(frmMain_ConfirmBackup, oProcess.GameInfo.Name, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
If mgrCommon.ShowPriorityMessage(frmMain_ConfirmBackup, oProcess.GameInfo.Name, MsgBoxStyle.YesNo) = MsgBoxResult.Yes Then
bDoBackup = True
Else
bDoBackup = False
@@ -735,7 +782,7 @@ Public Class frmMain
DirectCast(hshScanList.Item(oProcess.GameInfo.ID), clsGame).Hours = oProcess.GameInfo.Hours
End If
mgrMonitorList.DoListUpdate(oProcess.GameInfo)
mgrMonitorList.DoListFieldUpdate("Hours", oProcess.GameInfo.Hours, oProcess.GameInfo.ID)
mgrMonitorList.SyncMonitorLists(oSettings)
UpdateTimeSpent(dCurrentHours, oProcess.TimeSpent.TotalHours)
@@ -969,15 +1016,27 @@ Public Class frmMain
End Sub
Private Sub OpenWebSite()
Process.Start(App_URLWebsite)
Try
Process.Start(App_URLWebsite)
Catch ex As Exception
mgrCommon.ShowMessage(App_ErrorLaunchExternal, ex.Message, MsgBoxStyle.Exclamation)
End Try
End Sub
Private Sub OpenOnlineManual()
Process.Start(App_URLManual)
Try
Process.Start(App_URLManual)
Catch ex As Exception
mgrCommon.ShowMessage(App_ErrorLaunchExternal, ex.Message, MsgBoxStyle.Exclamation)
End Try
End Sub
Private Sub OpenCheckforUpdates()
Process.Start(App_URLUpdates)
Try
Process.Start(App_URLUpdates)
Catch ex As Exception
mgrCommon.ShowMessage(App_ErrorLaunchExternal, ex.Message, MsgBoxStyle.Exclamation)
End Try
End Sub
Private Sub CheckForNewBackups()
@@ -1126,8 +1185,15 @@ Public Class frmMain
'Verify the "Start with Windows" setting
If oSettings.StartWithWindows Then
If Not VerifyStartWithWindows() Then
UpdateLog(frmMain_ErrorAppLocationChanged, False, ToolTipIcon.Info)
If mgrCommon.IsUnix Then
Dim sVerifyError As String = String.Empty
If Not VerifyAutoStartLinux(sVerifyError) Then
UpdateLog(sVerifyError, False, ToolTipIcon.Info)
End If
Else
If Not VerifyStartWithWindows() Then
UpdateLog(frmMain_ErrorAppLocationChanged, False, ToolTipIcon.Info)
End If
End If
End If
@@ -1681,6 +1747,53 @@ Public Class frmMain
End If
End Sub
Private Function VerifyAutoStartLinux(ByRef sErrorMessage As String) As Boolean
Dim oProcess As Process
Dim sDesktopFile As String = String.Empty
Dim sAutoStartFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) & Path.DirectorySeparatorChar & ".config/autostart/"
'Check if the app is still properly installed
If mgrPath.VerifyLinuxDesktopFileLocation(sDesktopFile) Then
If File.Exists(sAutoStartFolder & Path.DirectorySeparatorChar & "gbm.desktop") Then
Return True
Else
'Create the autostart folder if it doesn't exist yet
If Not Directory.Exists(sAutoStartFolder) Then
Directory.CreateDirectory(sAutoStartFolder)
End If
'Create link
Try
oProcess = New Process
oProcess.StartInfo.FileName = "/bin/ln"
oProcess.StartInfo.Arguments = "-s " & sDesktopFile & " " & sAutoStartFolder
oProcess.StartInfo.UseShellExecute = False
oProcess.StartInfo.RedirectStandardOutput = True
oProcess.StartInfo.CreateNoWindow = True
oProcess.Start()
Catch ex As Exception
mgrCommon.ShowMessage(frmSettings_ErrorLinuxAutoStart, ex.Message, MsgBoxStyle.Exclamation)
End Try
sErrorMessage = frmMain_ErrorLinuxAutoStartMissing
Return False
End If
Else
'If the app is no longer properly installed, disable autostart and the setting.
Try
oSettings.StartWithWindows = False
oSettings.SaveSettings()
If File.Exists(sAutoStartFolder & Path.DirectorySeparatorChar & "gbm.desktop") Then
File.Delete(sAutoStartFolder & Path.DirectorySeparatorChar & "gbm.desktop")
End If
Catch ex As Exception
mgrCommon.ShowMessage(frmSettings_ErrorLinuxAutoStart, ex.Message, MsgBoxStyle.Exclamation)
End Try
sErrorMessage = frmMain_ErrorLinuxAutoStartLinkMissing
Return False
End If
End Function
Private Function VerifyStartWithWindows() As Boolean
Dim oKey As Microsoft.Win32.RegistryKey
Dim sAppName As String = Application.ProductName
@@ -1861,11 +1974,6 @@ Public Class frmMain
RestartAsAdmin()
End Sub
Private Sub frmMain_Activated(sender As System.Object, e As System.EventArgs) Handles MyBase.Activated
txtLog.Select(txtLog.TextLength, 0)
txtLog.ScrollToCaret()
End Sub
Private Sub Main_FormClosing(sender As System.Object, e As System.Windows.Forms.FormClosingEventArgs) Handles MyBase.FormClosing
'Unix Handler
If mgrCommon.IsUnix And Not bShutdown Then
@@ -1898,12 +2006,11 @@ Public Class frmMain
Private Sub ScanTimerEventProcessor(myObject As Object, ByVal myEventArgs As EventArgs) Handles tmScanTimer.Tick
Dim bNeedsPath As Boolean = False
Dim bWineProcess As Boolean = False
Dim bContinue As Boolean = True
Dim iErrorCode As Integer = 0
Dim sErrorMessage As String = String.Empty
If oProcess.SearchRunningProcesses(hshScanList, bNeedsPath, bWineProcess, iErrorCode, bProcessDebugMode) Then
If oProcess.SearchRunningProcesses(hshScanList, bNeedsPath, iErrorCode, bProcessDebugMode) Then
PauseScan(True)
If bNeedsPath Then
@@ -1933,27 +2040,18 @@ Public Class frmMain
End If
End If
If bWineProcess Then
'Attempt a path conversion if the game configuration is using an absolute windows path that we can convert
If mgrVariables.CheckForReservedVariables(oProcess.GameInfo.TruePath) Then
Dim sWinePrefix As String = mgrPath.GetWinePrefix(oProcess.FoundProcess)
Dim sWineSavePath As String
If Not sWinePrefix = String.Empty Then
UpdateLog(mgrCommon.FormatString(frmMain_WinePrefix, New String() {oProcess.GameInfo.Name, sWinePrefix}), False)
sWineSavePath = mgrPath.GetWineSavePath(sWinePrefix, oProcess.GameInfo.TruePath)
If Not sWineSavePath = oProcess.GameInfo.TruePath Then
oProcess.GameInfo.TruePath = sWineSavePath
oProcess.GameInfo.AbsolutePath = True
UpdateLog(mgrCommon.FormatString(frmMain_WineSavePath, New String() {oProcess.GameInfo.Name, sWineSavePath}), False)
Else
bContinue = False
End If
Else
bContinue = False
End If
'We need to determine this Wine information and store it before the process ends.
If oProcess.WineProcess Then
Dim oWineData As New clsWineData
oWineData.Prefix = mgrPath.GetWinePrefix(oProcess.FoundProcess)
oWineData.BinaryPath = Path.GetDirectoryName(oProcess.FoundProcess.MainModule.FileName)
UpdateLog(mgrCommon.FormatString(frmMain_WineBinaryPath, oWineData.BinaryPath), False)
If Not oWineData.Prefix = String.Empty Then
oProcess.WineData = oWineData
UpdateLog(mgrCommon.FormatString(frmMain_WinePrefix, oWineData.Prefix), False)
Else
bContinue = False
End If
'This does required mods to include/exclude data and relative paths (if required)
mgrPath.ModWinePathData(oProcess.GameInfo)
End If
If bContinue = True Then
@@ -2013,7 +2111,7 @@ Public Class frmMain
oProcess.GameInfo.ProcessPath = mgrPath.ProcessPathSearch(oProcess.GameInfo.Name, oProcess.GameInfo.ProcessName, sPathDetectionError)
If oProcess.GameInfo.ProcessPath <> String.Empty Then
'Update and reload
mgrMonitorList.DoListUpdate(oProcess.GameInfo)
mgrMonitorList.DoListFieldUpdate("ProcessPath", oProcess.GameInfo.ProcessPath, oProcess.GameInfo.ID)
LoadGameSettings()
Else
bContinue = False
@@ -2029,6 +2127,20 @@ Public Class frmMain
If bContinue Then
If DoMultiGameCheck() Then
UpdateLog(mgrCommon.FormatString(frmMain_GameEnded, oProcess.GameInfo.Name), False)
If oProcess.WineProcess Then
oProcess.WineData.MonitorID = oProcess.GameInfo.ID
'Attempt a path conversion if the game configuration is using an absolute windows path that we can convert
If mgrVariables.CheckForReservedVariables(oProcess.GameInfo.TruePath) Then
oProcess.WineData.SavePath = mgrPath.GetWineSavePath(oProcess.WineData.Prefix, oProcess.GameInfo.TruePath)
If Not oProcess.WineData.SavePath = oProcess.GameInfo.TruePath Then
oProcess.GameInfo.TruePath = oProcess.WineData.SavePath
UpdateLog(mgrCommon.FormatString(frmMain_WineSavePath, oProcess.WineData.SavePath), False)
End If
End If
mgrWineData.DoWineDataAddUpdate(oProcess.WineData)
'This does required mods to include/exclude data and relative paths (if required)
mgrPath.ModWinePathData(oProcess.GameInfo)
End If
If oSettings.TimeTracking Then HandleTimeSpent()
If oSettings.SessionTracking Then HandleSession()
RunBackup()
@@ -2048,19 +2160,41 @@ Public Class frmMain
oProcess.StartTime = Now : oProcess.EndTime = Now
End Sub
Private Sub Main_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Private Sub frmMain_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
SetForm()
End Sub
Private Sub frmMain_Activated(sender As System.Object, e As System.EventArgs) Handles MyBase.Activated
'Init
Try
SetForm()
VerifyGameDataPath()
LoadAndVerify()
If Not bInitFail Then
If bInitialLoad Then
Try
VerifyGameDataPath()
LoadAndVerify()
Catch ex As Exception
If mgrCommon.ShowMessage(frmMain_ErrorInitFailure, ex.Message & vbCrLf & ex.StackTrace, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
bInitFail = True
End If
End Try
If bInitFail Then
bShutdown = True
Me.Close()
Else
VerifyCustomPathVariables()
If oSettings.StartToTray And Not mgrCommon.IsUnix Then
bShowToggle = False
Me.Visible = False
Me.ShowInTaskbar = False
'Windows and Linux require different settings for the system tray
If mgrCommon.IsUnix Then
Me.MinimizeBox = True
If oSettings.StartToTray Then
Me.WindowState = FormWindowState.Minimized
End If
Else
Me.gMonTray.Visible = True
If oSettings.StartToTray Then
bShowToggle = False
Me.Visible = False
Me.ShowInTaskbar = False
End If
End If
If oSettings.MonitorOnStartup Then
@@ -2071,29 +2205,16 @@ Public Class frmMain
HandleScan()
CheckForNewBackups()
'Unix Handler
If mgrCommon.IsUnix Then
Me.MinimizeBox = True
Else
Me.gMonTray.Visible = True
End If
End If
Catch ex As Exception
If mgrCommon.ShowMessage(frmMain_ErrorInitFailure, ex.Message, MsgBoxStyle.YesNo) = MsgBoxResult.No Then
bInitFail = True
If bFirstRun And Not bShutdown Then
OpenStartupWizard()
End If
End Try
End Sub
Private Sub frmMain_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
If bInitFail Then
bShutdown = True
Me.Close()
End If
If bFirstRun And Not bShutdown Then
OpenStartupWizard()
bInitialLoad = False
Else
txtLog.Select(txtLog.TextLength, 0)
txtLog.ScrollToCaret()
End If
End Sub
+40 -27
View File
@@ -71,9 +71,10 @@ Partial Class frmSettings
Me.pnlStartup = New System.Windows.Forms.Panel()
Me.grpStartup = New System.Windows.Forms.GroupBox()
Me.chkBackupOnLaunch = New System.Windows.Forms.CheckBox()
Me.chkStartWindows = New System.Windows.Forms.CheckBox()
Me.chkStartToTray = New System.Windows.Forms.CheckBox()
Me.chkAutoStart = New System.Windows.Forms.CheckBox()
Me.chkStartMinimized = New System.Windows.Forms.CheckBox()
Me.chkMonitorOnStartup = New System.Windows.Forms.CheckBox()
Me.chkDisableDiskSpaceCheck = New System.Windows.Forms.CheckBox()
Me.grpFolderOptions.SuspendLayout()
Me.grp7zGeneral.SuspendLayout()
Me.pnlBackup.SuspendLayout()
@@ -318,11 +319,12 @@ Partial Class frmSettings
'
'grpBackupConfirmations
'
Me.grpBackupConfirmations.Controls.Add(Me.chkDisableDiskSpaceCheck)
Me.grpBackupConfirmations.Controls.Add(Me.chkBackupConfirm)
Me.grpBackupConfirmations.Controls.Add(Me.chkOverwriteWarning)
Me.grpBackupConfirmations.Location = New System.Drawing.Point(6, 200)
Me.grpBackupConfirmations.Name = "grpBackupConfirmations"
Me.grpBackupConfirmations.Size = New System.Drawing.Size(354, 65)
Me.grpBackupConfirmations.Size = New System.Drawing.Size(354, 90)
Me.grpBackupConfirmations.TabIndex = 2
Me.grpBackupConfirmations.TabStop = False
Me.grpBackupConfirmations.Text = "Backup Confirmations"
@@ -340,10 +342,10 @@ Partial Class frmSettings
'chkOverwriteWarning
'
Me.chkOverwriteWarning.AutoSize = True
Me.chkOverwriteWarning.Location = New System.Drawing.Point(9, 41)
Me.chkOverwriteWarning.Location = New System.Drawing.Point(9, 64)
Me.chkOverwriteWarning.Name = "chkOverwriteWarning"
Me.chkOverwriteWarning.Size = New System.Drawing.Size(139, 17)
Me.chkOverwriteWarning.TabIndex = 1
Me.chkOverwriteWarning.TabIndex = 2
Me.chkOverwriteWarning.Text = "Show overwrite warning"
Me.chkOverwriteWarning.UseVisualStyleBackColor = True
'
@@ -560,8 +562,8 @@ Partial Class frmSettings
'grpStartup
'
Me.grpStartup.Controls.Add(Me.chkBackupOnLaunch)
Me.grpStartup.Controls.Add(Me.chkStartWindows)
Me.grpStartup.Controls.Add(Me.chkStartToTray)
Me.grpStartup.Controls.Add(Me.chkAutoStart)
Me.grpStartup.Controls.Add(Me.chkStartMinimized)
Me.grpStartup.Controls.Add(Me.chkMonitorOnStartup)
Me.grpStartup.Location = New System.Drawing.Point(6, 12)
Me.grpStartup.Name = "grpStartup"
@@ -580,25 +582,25 @@ Partial Class frmSettings
Me.chkBackupOnLaunch.Text = "Backup GBM data files on launch"
Me.chkBackupOnLaunch.UseVisualStyleBackColor = True
'
'chkStartWindows
'chkAutoStart
'
Me.chkStartWindows.AutoSize = True
Me.chkStartWindows.Location = New System.Drawing.Point(6, 19)
Me.chkStartWindows.Name = "chkStartWindows"
Me.chkStartWindows.Size = New System.Drawing.Size(117, 17)
Me.chkStartWindows.TabIndex = 0
Me.chkStartWindows.Text = "Start with Windows"
Me.chkStartWindows.UseVisualStyleBackColor = True
Me.chkAutoStart.AutoSize = True
Me.chkAutoStart.Location = New System.Drawing.Point(6, 19)
Me.chkAutoStart.Name = "chkAutoStart"
Me.chkAutoStart.Size = New System.Drawing.Size(155, 17)
Me.chkAutoStart.TabIndex = 0
Me.chkAutoStart.Text = "Start automatically on log-in"
Me.chkAutoStart.UseVisualStyleBackColor = True
'
'chkStartToTray
'chkStartMinimized
'
Me.chkStartToTray.AutoSize = True
Me.chkStartToTray.Location = New System.Drawing.Point(6, 42)
Me.chkStartToTray.Name = "chkStartToTray"
Me.chkStartToTray.Size = New System.Drawing.Size(115, 17)
Me.chkStartToTray.TabIndex = 1
Me.chkStartToTray.Text = "Start to system tray"
Me.chkStartToTray.UseVisualStyleBackColor = True
Me.chkStartMinimized.AutoSize = True
Me.chkStartMinimized.Location = New System.Drawing.Point(6, 42)
Me.chkStartMinimized.Name = "chkStartMinimized"
Me.chkStartMinimized.Size = New System.Drawing.Size(96, 17)
Me.chkStartMinimized.TabIndex = 1
Me.chkStartMinimized.Text = "Start minimized"
Me.chkStartMinimized.UseVisualStyleBackColor = True
'
'chkMonitorOnStartup
'
@@ -610,15 +612,25 @@ Partial Class frmSettings
Me.chkMonitorOnStartup.Text = "Start monitoring on launch"
Me.chkMonitorOnStartup.UseVisualStyleBackColor = True
'
'chkDisableDiskSpaceCheck
'
Me.chkDisableDiskSpaceCheck.AutoSize = True
Me.chkDisableDiskSpaceCheck.Location = New System.Drawing.Point(9, 41)
Me.chkDisableDiskSpaceCheck.Name = "chkDisableDiskSpaceCheck"
Me.chkDisableDiskSpaceCheck.Size = New System.Drawing.Size(222, 17)
Me.chkDisableDiskSpaceCheck.TabIndex = 1
Me.chkDisableDiskSpaceCheck.Text = "Disable disk space check prior to backup"
Me.chkDisableDiskSpaceCheck.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(554, 361)
Me.Controls.Add(Me.pnlGeneral)
Me.Controls.Add(Me.pnlStartup)
Me.Controls.Add(Me.pnl7z)
Me.Controls.Add(Me.pnlBackup)
Me.Controls.Add(Me.pnlGeneral)
Me.Controls.Add(Me.pnl7z)
Me.Controls.Add(Me.btnResetMessages)
Me.Controls.Add(Me.lstSettings)
Me.Controls.Add(Me.btnDefaults)
@@ -706,9 +718,10 @@ Partial Class frmSettings
Friend WithEvents pnlStartup As Panel
Friend WithEvents grpStartup As GroupBox
Friend WithEvents chkBackupOnLaunch As CheckBox
Friend WithEvents chkStartWindows As CheckBox
Friend WithEvents chkStartToTray As CheckBox
Friend WithEvents chkAutoStart As CheckBox
Friend WithEvents chkStartMinimized As CheckBox
Friend WithEvents chkMonitorOnStartup As CheckBox
Friend WithEvents grpGameMonitoringOptions As GroupBox
Friend WithEvents chkShowResolvedPaths As CheckBox
Friend WithEvents chkDisableDiskSpaceCheck As CheckBox
End Class
+52 -20
View File
@@ -16,6 +16,36 @@ Public Class frmSettings
End Set
End Property
Private Sub HandleLinuxAutoStart(ByVal bToggle As Boolean)
Dim oProcess As Process
Dim sDesktopFile = String.Empty
Dim sAutoStartFolder As String = Environment.GetFolderPath(Environment.SpecialFolder.UserProfile) & Path.DirectorySeparatorChar & ".config/autostart/"
If bToggle And mgrPath.VerifyLinuxDesktopFileLocation(sDesktopFile) Then
'Create the autostart folder if it doesn't exist yet
If Not Directory.Exists(sAutoStartFolder) Then
Directory.CreateDirectory(sAutoStartFolder)
End If
'Create link
Try
oProcess = New Process
oProcess.StartInfo.FileName = "/bin/ln"
oProcess.StartInfo.Arguments = "-s " & sDesktopFile & " " & sAutoStartFolder
oProcess.StartInfo.UseShellExecute = False
oProcess.StartInfo.RedirectStandardOutput = True
oProcess.StartInfo.CreateNoWindow = True
oProcess.Start()
Catch ex As Exception
mgrCommon.ShowMessage(frmSettings_ErrorLinuxAutoStart, ex.Message, MsgBoxStyle.Exclamation)
End Try
Else
'Delete link
If File.Exists(sAutoStartFolder & Path.DirectorySeparatorChar & "gbm.desktop") Then
File.Delete(sAutoStartFolder & Path.DirectorySeparatorChar & "gbm.desktop")
End If
End If
End Sub
Private Sub HandleRegistryUpdate(ByVal bToggle As Boolean)
Dim oKey As Microsoft.Win32.RegistryKey
Dim sAppName As String = Application.ProductName
@@ -35,23 +65,28 @@ Public Class frmSettings
Private Function ValidateSettings() As Boolean
'Show Start with Windows warning if running as admin
If chkStartWindows.Checked And mgrCommon.IsElevated Then
If Not mgrCommon.IsUnix And chkAutoStart.Checked And mgrCommon.IsElevated Then
mgrCommon.ShowMessage(frmSettings_WarningAdminStart, MsgBoxStyle.Exclamation)
End If
'Only modify registry key when the value changed
If chkStartWindows.Checked <> oSettings.StartWithWindows Then
HandleRegistryUpdate(chkStartWindows.Checked)
'Only modify when the value changed
If chkAutoStart.Checked <> oSettings.StartWithWindows Then
If mgrCommon.IsUnix Then
HandleLinuxAutoStart(chkAutoStart.Checked)
Else
HandleRegistryUpdate(chkAutoStart.Checked)
End If
End If
oSettings.StartWithWindows = chkStartWindows.Checked
oSettings.StartWithWindows = chkAutoStart.Checked
oSettings.MonitorOnStartup = chkMonitorOnStartup.Checked
oSettings.StartToTray = chkStartToTray.Checked
oSettings.StartToTray = chkStartMinimized.Checked
oSettings.BackupOnLaunch = chkBackupOnLaunch.Checked
oSettings.ShowDetectionToolTips = chkShowDetectionTips.Checked
oSettings.DisableSyncMessages = chkDisableSyncMessages.Checked
oSettings.AutoSaveLog = chkAutoSaveLog.Checked
oSettings.DisableConfirmation = chkBackupConfirm.Checked
oSettings.DisableDiskSpaceCheck = chkDisableDiskSpaceCheck.Checked
oSettings.CreateSubFolder = chkCreateFolder.Checked
oSettings.UseGameID = chkUseGameID.Checked
oSettings.ShowOverwriteWarning = chkOverwriteWarning.Checked
@@ -173,14 +208,15 @@ Public Class frmSettings
End Sub
Private Sub LoadSettings()
chkStartWindows.Checked = oSettings.StartWithWindows
chkAutoStart.Checked = oSettings.StartWithWindows
chkMonitorOnStartup.Checked = oSettings.MonitorOnStartup
chkStartToTray.Checked = oSettings.StartToTray
chkStartMinimized.Checked = oSettings.StartToTray
chkBackupOnLaunch.Checked = oSettings.BackupOnLaunch
chkShowDetectionTips.Checked = oSettings.ShowDetectionToolTips
chkDisableSyncMessages.Checked = oSettings.DisableSyncMessages
chkAutoSaveLog.Checked = oSettings.AutoSaveLog
chkBackupConfirm.Checked = oSettings.DisableConfirmation
chkDisableDiskSpaceCheck.Checked = oSettings.DisableDiskSpaceCheck
chkCreateFolder.Checked = oSettings.CreateSubFolder
chkUseGameID.Checked = oSettings.UseGameID
chkOverwriteWarning.Checked = oSettings.ShowOverwriteWarning
@@ -199,12 +235,6 @@ Public Class frmSettings
txt7zLocation.Text = oSettings.Custom7zLocation
eCurrentSyncFields = oSettings.SyncFields
'Unix Handler
If mgrCommon.IsUnix Then
chkStartToTray.Checked = False
chkStartWindows.Checked = False
End If
'Retrieve 7z Info
GetUtilityInfo(oSettings.Custom7zLocation)
@@ -305,10 +335,10 @@ Public Class frmSettings
grpGameData.Text = frmSettings_grpGameData
chkTimeTracking.Text = frmSettings_chkTimeTracking
chkSessionTracking.Text = frmSettings_chkSessionTracking
chkStartWindows.Text = frmSettings_chkStartWindows
chkAutoStart.Text = frmSettings_chkAutoStart
chkShowDetectionTips.Text = frmSettings_chkShowDetectionTips
chkAutoSaveLog.Text = frmSettings_chkAutoSaveLog
chkStartToTray.Text = frmSettings_chkStartToTray
chkStartMinimized.Text = frmSettings_chkStartMinimized
chkMonitorOnStartup.Text = frmSettings_chkMonitorOnStartup
grp7zGeneral.Text = frmSettings_grp7zGeneral
grp7zAdvanced.Text = frmSettings_grp7zAdvanced
@@ -325,11 +355,13 @@ Public Class frmSettings
chkDisableSyncMessages.Text = frmSettings_chkDisableSyncMessages
grpGameMonitoringOptions.Text = frmSettings_grpGameMonitoringOptions
chkShowResolvedPaths.Text = frmSettings_chkShowResolvedPaths
chkDisableDiskSpaceCheck.Text = frmSettings_chkDisableDiskSpaceCheck
'Unix Handler
If mgrCommon.IsUnix Then
chkStartToTray.Enabled = False
chkStartWindows.Enabled = False
'Only enable this option on Linux if GBM was installed with an official method
If Not mgrPath.VerifyLinuxDesktopFileLocation() Then
chkAutoStart.Enabled = False
End If
End If
'Handle Panels
@@ -358,7 +390,7 @@ Public Class frmSettings
Private Sub btnBackupFolder_Click(sender As System.Object, e As System.EventArgs) Handles btnBackupFolder.Click
Dim sNewFolder As String
sNewFolder = mgrCommon.OpenFolderBrowser("Settings_Backup_Path", frmSettings_BrowseFolder, oSettings.BackupFolder, True, False)
sNewFolder = mgrCommon.OpenClassicFolderBrowser("Settings_Backup_Path", frmSettings_BrowseFolder, oSettings.BackupFolder, True, False)
If sNewFolder <> String.Empty Then txtBackupFolder.Text = sNewFolder
End Sub
+1 -1
View File
@@ -211,7 +211,7 @@ Public Class frmStartUpWizard
End If
End If
sNewPath = mgrCommon.OpenFolderBrowser("Wizard_Backup_Path", frmStartUpWizard_BrowseFolder, sDefaultFolder, True, False)
sNewPath = mgrCommon.OpenClassicFolderBrowser("Wizard_Backup_Path", frmStartUpWizard_BrowseFolder, sDefaultFolder, True, False)
If sNewPath <> String.Empty Then txtBackupPath.Text = sNewPath
End Sub
+1 -1
View File
@@ -54,7 +54,7 @@ Public Class frmVariableManager
End If
End If
sNewPath = mgrCommon.OpenFolderBrowser("VM_Path", frmVariableManager_PathBrowse, sDefaultFolder, False, False)
sNewPath = mgrCommon.OpenFolderBrowser("VM_Path", frmVariableManager_PathBrowse, sDefaultFolder, False)
If sNewPath <> String.Empty Then txtPath.Text = sNewPath
End Sub
+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 = 3
'
'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 = 1
'
'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 = 4
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>
+100
View File
@@ -0,0 +1,100 @@
Imports GBM.My.Resources
Public Class frmWineConfiguration
Private oSettings As mgrSettings
Private sMonitorID As String
Property Settings As mgrSettings
Get
Return oSettings
End Get
Set(value As mgrSettings)
oSettings = value
End Set
End Property
Property MonitorID As String
Get
Return sMonitorID
End Get
Set(value As String)
sMonitorID = 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()
Dim oWineData As New clsWineData
oWineData = mgrWineData.DoWineDataGetbyID(sMonitorID)
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()
Dim oWineData As clsWineData
If txtWineBinaryPath.Text = String.Empty And txtWinePrefix.Text = String.Empty And txtWineSavePath.Text = String.Empty Then
mgrWineData.DoWineDataDelete(sMonitorID)
Me.DialogResult = DialogResult.OK
Else
If ValidateData() Then
oWineData = New clsWineData
oWineData.MonitorID = sMonitorID
oWineData.BinaryPath = txtWineBinaryPath.Text
oWineData.Prefix = txtWinePrefix.Text
oWineData.SavePath = txtWineSavePath.Text
mgrWineData.DoWineDataAddUpdate(oWineData)
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
End Class