Merge branch 'v104' of https://github.com/MikeMaximus/gbm into v104

This commit is contained in:
Michael J. Seiferling
2017-09-23 15:21:23 -06:00
5 changed files with 51 additions and 15 deletions
+10
View File
@@ -7,6 +7,7 @@
Private bFolderSave As Boolean Private bFolderSave As Boolean
Private sFileType As String Private sFileType As String
Private sExcludeList As String Private sExcludeList As String
Private bMonitorOnly As Boolean
Private oTags As List(Of Tag) Private oTags As List(Of Tag)
Property Name As String Property Name As String
@@ -81,6 +82,15 @@
End Get End Get
End Property End Property
Property MonitorOnly As Boolean
Set(value As Boolean)
bMonitorOnly = value
End Set
Get
Return bMonitorOnly
End Get
End Property
Property Tags As List(Of Tag) Property Tags As List(Of Tag)
Get Get
Return oTags Return oTags
+36 -14
View File
@@ -1044,6 +1044,27 @@ Public Class frmGameManager
VerifyCleanFolder() VerifyCleanFolder()
End Sub End Sub
Private Sub MonitorOnlyModeChange()
If chkMonitorOnly.Checked Then
chkFolderSave.Enabled = False
chkTimeStamp.Enabled = False
lblSavePath.Enabled = False
txtSavePath.Enabled = False
btnSavePathBrowse.Enabled = False
btnInclude.Enabled = False
btnExclude.Enabled = False
Else
chkFolderSave.Enabled = True
chkTimeStamp.Enabled = True
lblSavePath.Enabled = True
txtSavePath.Enabled = True
btnSavePathBrowse.Enabled = True
btnInclude.Enabled = True
btnExclude.Enabled = True
End If
VerifyCleanFolder()
End Sub
Private Sub TimeStampModeChange() Private Sub TimeStampModeChange()
If chkTimeStamp.Checked Then If chkTimeStamp.Checked Then
nudLimit.Visible = True nudLimit.Visible = True
@@ -1058,7 +1079,7 @@ Public Class frmGameManager
Private Sub VerifyCleanFolder() Private Sub VerifyCleanFolder()
If Not bIsLoading Then If Not bIsLoading Then
If chkFolderSave.Checked = True And txtExclude.Text = String.Empty And txtSavePath.Text <> String.Empty Then If (chkFolderSave.Checked = True And txtExclude.Text = String.Empty And txtSavePath.Text <> String.Empty) And Not chkMonitorOnly.Checked Then
chkCleanFolder.Enabled = True chkCleanFolder.Enabled = True
Else Else
chkCleanFolder.Checked = False chkCleanFolder.Checked = False
@@ -1263,7 +1284,7 @@ Public Class frmGameManager
Return False Return False
End If End If
If chkFolderSave.Checked = False And txtFileType.Text = String.Empty Then If (chkFolderSave.Checked = False And txtFileType.Text = String.Empty) And Not chkMonitorOnly.Checked Then
mgrCommon.ShowMessage(frmGameManager_ErrorNoItems, MsgBoxStyle.Exclamation) mgrCommon.ShowMessage(frmGameManager_ErrorNoItems, MsgBoxStyle.Exclamation)
btnInclude.Focus() btnInclude.Focus()
Return False Return False
@@ -1351,7 +1372,7 @@ Public Class frmGameManager
For Each oData In lstGames.SelectedItems For Each oData In lstGames.SelectedItems
oGame = DirectCast(GameData(oData.Key), clsGame) oGame = DirectCast(GameData(oData.Key), clsGame)
BackupList.Add(oGame) If Not oGame.MonitorOnly Then BackupList.Add(oGame)
Next Next
If BackupList.Count = 1 Then If BackupList.Count = 1 Then
@@ -1388,17 +1409,14 @@ Public Class frmGameManager
If lstGames.SelectedItems.Count > 0 Then If lstGames.SelectedItems.Count > 0 Then
RestoreList.Clear() RestoreList.Clear()
If lstGames.SelectedItems.Count = 1 Then
RestoreList.Add(CurrentGame, CurrentBackupItem) For Each oData In lstGames.SelectedItems
Else If oRemoteBackupData.Contains(oData.Value) Then
For Each oData In lstGames.SelectedItems oGame = DirectCast(GameData(oData.Key), clsGame)
If oRemoteBackupData.Contains(oData.Value) Then oBackup = DirectCast(oRemoteBackupData(oData.Value), clsBackup)
oGame = DirectCast(GameData(oData.Key), clsGame) If Not oGame.MonitorOnly Then RestoreList.Add(oGame, oBackup)
oBackup = DirectCast(oRemoteBackupData(oData.Value), clsBackup) End If
RestoreList.Add(oGame, oBackup) Next
End If
Next
End If
If RestoreList.Count = 1 Then If RestoreList.Count = 1 Then
bDoRestore = True bDoRestore = True
@@ -1729,4 +1747,8 @@ Public Class frmGameManager
Private Sub frmGameManager_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown Private Sub frmGameManager_Shown(sender As Object, e As EventArgs) Handles MyBase.Shown
txtQuickFilter.Focus() txtQuickFilter.Focus()
End Sub End Sub
Private Sub chkMonitorOnly_CheckedChanged(sender As Object, e As EventArgs) Handles chkMonitorOnly.CheckedChanged
MonitorOnlyModeChange()
End Sub
End Class End Class
+3 -1
View File
@@ -269,13 +269,15 @@ Public Class mgrCommon
End Function End Function
'Calculate the current size of a folder 'Calculate the current size of a folder
Public Shared Function GetFolderSize(ByVal sPath As String, ByVal sInclude As String(), ByVal sExclude As String()) Public Shared Function GetFolderSize(ByVal sPath As String, ByVal sInclude As String(), ByVal sExclude As String()) As Long
Dim oFolder As DirectoryInfo Dim oFolder As DirectoryInfo
Dim bInclude As Boolean Dim bInclude As Boolean
Dim bExclude As Boolean Dim bExclude As Boolean
Dim lSize As Long = 0 Dim lSize As Long = 0
Try Try
If Not Directory.Exists(sPath) Then Return lSize
oFolder = New DirectoryInfo(sPath) oFolder = New DirectoryInfo(sPath)
'Files 'Files
+1
View File
@@ -630,6 +630,7 @@ Public Class mgrMonitorList
oGame.FolderSave = CBool(dr("FolderSave")) oGame.FolderSave = CBool(dr("FolderSave"))
If Not IsDBNull(dr("FileType")) Then oGame.FileType = CStr(dr("FileType")) If Not IsDBNull(dr("FileType")) Then oGame.FileType = CStr(dr("FileType"))
If Not IsDBNull(dr("ExcludeList")) Then oGame.ExcludeList = CStr(dr("ExcludeList")) If Not IsDBNull(dr("ExcludeList")) Then oGame.ExcludeList = CStr(dr("ExcludeList"))
oGame.MonitorOnly = CBool(dr("MonitorOnly"))
If Not IsDBNull(dr("Parameter")) Then oGame.Parameter = CStr(dr("Parameter")) If Not IsDBNull(dr("Parameter")) Then oGame.Parameter = CStr(dr("Parameter"))
oGame.Tags = mgrGameTags.GetTagsByGameForExport(sID) oGame.Tags = mgrGameTags.GetTagsByGameForExport(sID)
oList.Add(oGame) oList.Add(oGame)
+1
View File
@@ -28,6 +28,7 @@ Public Class mgrXML
oGame.FolderSave = g.FolderSave oGame.FolderSave = g.FolderSave
oGame.FileType = g.FileType oGame.FileType = g.FileType
oGame.ExcludeList = g.ExcludeList oGame.ExcludeList = g.ExcludeList
oGame.MonitorOnly = g.MonitorOnly
oGame.Parameter = g.Parameter oGame.Parameter = g.Parameter
For Each t As Tag In g.Tags For Each t As Tag In g.Tags
oGame.ImportTags.Add(t) oGame.ImportTags.Add(t)