Fixes for backup threshold setting

This commit is contained in:
Michael J. Seiferling
2015-12-05 13:14:16 -06:00
parent 83135acb90
commit b270ffeabe
2 changed files with 18 additions and 16 deletions
+8 -6
View File
@@ -269,8 +269,8 @@ Public Class frmMain
If SupressBackup() Then
bDoBackup = False
UpdateLog(oProcess.GameInfo.Name & " backup was cancelled due to session time.", False)
SetLastAction(oProcess.GameInfo.CroppedName & " backup was cancelled due to session time")
UpdateLog(oProcess.GameInfo.Name & " backup was cancelled due to session length.", False)
SetLastAction(oProcess.GameInfo.CroppedName & " backup was cancelled due to session length")
OperationEnded()
Else
If oProcess.GameInfo.MonitorOnly = False Then
@@ -566,14 +566,13 @@ Public Class frmMain
If oSettings.Sync Then mgrMonitorList.SyncMonitorLists()
UpdateTimeSpent(dCurrentHours, oProcess.TimeSpent.TotalHours)
'Reset
oProcess.StartTime = Now : oProcess.EndTime = Now
End Sub
Private Function SupressBackup() As Boolean
Dim iSession As Integer
If oSettings.SupressBackup Then
If oProcess.TimeSpent.Minutes > oSettings.SupressBackupThreshold Then
iSession = Math.Ceiling(oProcess.TimeSpent.TotalMinutes)
If iSession > oSettings.SupressBackupThreshold Then
Return False
Else
Return True
@@ -1429,6 +1428,7 @@ Public Class frmMain
Private Sub bwMain_RunWorkerCompleted(sender As System.Object, e As System.ComponentModel.RunWorkerCompletedEventArgs) Handles bwMonitor.RunWorkerCompleted
oProcess.EndTime = Now
If Not bCancelledByUser Then
If DoMultiGameCheck() Then
UpdateLog(oProcess.GameInfo.Name & " has ended.", False)
@@ -1440,7 +1440,9 @@ Public Class frmMain
ResumeScan()
End If
End If
bCancelledByUser = False
oProcess.StartTime = Now : oProcess.EndTime = Now
End Sub
Private Sub Main_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
+10 -10
View File
@@ -38,7 +38,7 @@ Partial Class frmSettings
Me.btnSave = New System.Windows.Forms.Button()
Me.btnCancel = New System.Windows.Forms.Button()
Me.grpBackup = New System.Windows.Forms.GroupBox()
Me.Label1 = New System.Windows.Forms.Label()
Me.lblMinutes = New System.Windows.Forms.Label()
Me.nudSupressBackupThreshold = New System.Windows.Forms.NumericUpDown()
Me.chkSupressBackup = New System.Windows.Forms.CheckBox()
Me.chkCheckSum = New System.Windows.Forms.CheckBox()
@@ -195,7 +195,7 @@ Partial Class frmSettings
'
'grpBackup
'
Me.grpBackup.Controls.Add(Me.Label1)
Me.grpBackup.Controls.Add(Me.lblMinutes)
Me.grpBackup.Controls.Add(Me.nudSupressBackupThreshold)
Me.grpBackup.Controls.Add(Me.chkSupressBackup)
Me.grpBackup.Controls.Add(Me.chkCheckSum)
@@ -210,14 +210,14 @@ Partial Class frmSettings
Me.grpBackup.TabStop = False
Me.grpBackup.Text = "Backup and Restore Options"
'
'Label1
'lblMinutes
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(286, 135)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(43, 13)
Me.Label1.TabIndex = 7
Me.Label1.Text = "minutes"
Me.lblMinutes.AutoSize = True
Me.lblMinutes.Location = New System.Drawing.Point(286, 135)
Me.lblMinutes.Name = "lblMinutes"
Me.lblMinutes.Size = New System.Drawing.Size(43, 13)
Me.lblMinutes.TabIndex = 7
Me.lblMinutes.Text = "minutes"
'
'nudSupressBackupThreshold
'
@@ -325,7 +325,7 @@ Partial Class frmSettings
Friend WithEvents chkCheckSum As System.Windows.Forms.CheckBox
Friend WithEvents chkStartWindows As System.Windows.Forms.CheckBox
Friend WithEvents chkTimeTracking As System.Windows.Forms.CheckBox
Friend WithEvents Label1 As Label
Friend WithEvents lblMinutes As Label
Friend WithEvents nudSupressBackupThreshold As NumericUpDown
Friend WithEvents chkSupressBackup As CheckBox
End Class