Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Auto-Saving Data: Triggering Saves Only on Data Changes #9283

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions instat/frmMain.vb
Original file line number Diff line number Diff line change
Expand Up @@ -217,9 +217,9 @@ Public Class frmMain
'---------------------------------------
'Do this after loading options because interval depends on options
'Interval is in milliseconds and option is in minutes
timer.Interval = (clsInstatOptions.iAutoSaveDataMinutes * 60 * 1000)
timer.Start()
AddHandler System.Windows.Forms.Application.Idle, AddressOf Application_Idle
'timer.Interval = (clsInstatOptions.iAutoSaveDataMinutes * 60 * 1000)
'timer.Start()
'AddHandler System.Windows.Forms.Application.Idle, AddressOf Application_Idle
'---------------------------------------

'--------------------------------------
Expand Down Expand Up @@ -1163,6 +1163,9 @@ Public Class frmMain
strCurrentStatus = tstatus.Text
If clsRLink.bInstatObjectExists Then
tstatus.Text = GetTranslation("Auto saving data...")

Application.DoEvents() ' Ensures the message is displayed immediately

Cursor = Cursors.WaitCursor
If Not Directory.Exists(strAutoSaveDataFolderPath) Then
Directory.CreateDirectory(strAutoSaveDataFolderPath)
Expand Down
1 change: 1 addition & 0 deletions instat/ucrDataView.vb
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ Public Class ucrDataView
End If
EnableDisableUndoMenu()
_grid.Focus()
frmMain.AutoSaveData()
End Sub

''' <summary>
Expand Down
Loading