Changes for issue #73

This commit is contained in:
Michael J. Seiferling
2017-03-23 10:57:11 -06:00
parent 63ed3dac67
commit bddf07ee44
+10 -1
View File
@@ -51,6 +51,7 @@ Public Class frmMain
'Timers - There may only be one System.Windows.Forms.Timer and it must be tmScanTimer. 'Timers - There may only be one System.Windows.Forms.Timer and it must be tmScanTimer.
WithEvents tmScanTimer As New Timer WithEvents tmScanTimer As New Timer
WithEvents tmRestoreCheck As New System.Timers.Timer WithEvents tmRestoreCheck As New System.Timers.Timer
WithEvents tmFileWatcherQueue As New System.Timers.Timer
Public WithEvents oProcess As New mgrProcesses Public WithEvents oProcess As New mgrProcesses
Public WithEvents oBackup As New mgrBackup Public WithEvents oBackup As New mgrBackup
@@ -933,9 +934,16 @@ Public Class frmMain
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 Sub End Sub
Private Sub HandleSyncWatcher() Handles oFileWatcher.Changed Private Sub QueueSyncWatcher() Handles oFileWatcher.Changed
tmFileWatcherQueue.Enabled = True
tmFileWatcherQueue.Interval = 30000
tmFileWatcherQueue.Start()
End Sub
Private Sub HandleSyncWatcher() Handles tmFileWatcherQueue.Elapsed
StopSyncWatcher() StopSyncWatcher()
If oSettings.Sync Then If oSettings.Sync Then
UpdateLog(frmMain_MasterListChanged, False, ToolTipIcon.Info, True) UpdateLog(frmMain_MasterListChanged, False, ToolTipIcon.Info, True)
@@ -944,6 +952,7 @@ Public Class frmMain
End If End If
CheckForNewBackups() CheckForNewBackups()
StartSyncWatcher() StartSyncWatcher()
tmFileWatcherQueue.Enabled = False
End Sub End Sub
Private Sub SyncGameSettings() Private Sub SyncGameSettings()