Fixed sync setting conflict with issue #67

This commit is contained in:
MikeMaximus
2017-03-16 17:12:01 -06:00
parent c2a9d3ee77
commit 2ccc10bb9c
+8 -14
View File
@@ -919,34 +919,28 @@ Public Class frmMain
End Sub End Sub
Private Sub StartSyncWatcher() Private Sub StartSyncWatcher()
If oSettings.Sync Then oFileWatcher.EnableRaisingEvents = True
oFileWatcher.EnableRaisingEvents = True
End If
End Sub End Sub
Private Sub StopSyncWatcher() Private Sub StopSyncWatcher()
If oSettings.Sync Then oFileWatcher.EnableRaisingEvents = False
oFileWatcher.EnableRaisingEvents = False
End If
End Sub End Sub
Private Sub SetupSyncWatcher() Private Sub SetupSyncWatcher()
If oSettings.Sync Then oFileWatcher.Path = oSettings.BackupFolder
oFileWatcher.Path = oSettings.BackupFolder oFileWatcher.Filter = "gbm.s3db"
oFileWatcher.Filter = "gbm.s3db" oFileWatcher.NotifyFilter = NotifyFilters.LastWrite
oFileWatcher.NotifyFilter = NotifyFilters.LastWrite
End If
End Sub End Sub
Private Sub HandleSyncWatcher() Handles oFileWatcher.Changed Private Sub HandleSyncWatcher() Handles oFileWatcher.Changed
StopSyncWatcher()
If oSettings.Sync Then If oSettings.Sync Then
StopSyncWatcher()
UpdateLog(frmMain_MasterListChanged, False, ToolTipIcon.Info, True) UpdateLog(frmMain_MasterListChanged, False, ToolTipIcon.Info, True)
SyncGameSettings() SyncGameSettings()
LoadGameSettings() LoadGameSettings()
CheckForNewBackups()
StartSyncWatcher()
End If End If
CheckForNewBackups()
StartSyncWatcher()
End Sub End Sub
Private Sub SyncGameSettings() Private Sub SyncGameSettings()