Skip to content

Commit

Permalink
Merge pull request IDEMSInternational#8516 from N-thony/versionning
Browse files Browse the repository at this point in the history
Notify the user when there is a new version of R-Instat on the website
  • Loading branch information
N-thony authored Oct 18, 2023
2 parents 331af37 + 951117b commit 6e92ca0
Show file tree
Hide file tree
Showing 7 changed files with 986 additions and 861 deletions.
12 changes: 12 additions & 0 deletions instat/clsInstatOptions.vb
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,13 @@ Imports RDotNet
Public strClimsoftPort As String
Public strClimsoftUsername As String
Public iMaxOutputsHeight As Nullable(Of Integer)
Public bRemindLaterOption As Nullable(Of Boolean)

Public Sub New(Optional bSetOptions As Boolean = True)
'TODO Is this sensible to do in constructor?
bIncludeRDefaultParameters = clsInstatOptionsDefaults.DEFAULTbIncludeRDefaultParameters
bCommandsinOutput = clsInstatOptionsDefaults.DEFAULTbCommandsinOutput
bRemindLaterOption = clsInstatOptionsDefaults.DEFAULTbRemindLaterOption
bIncludeCommentDefault = clsInstatOptionsDefaults.DEFAULTbIncludeCommentDefault
bShowClimaticMenu = clsInstatOptionsDefaults.DEFAULTbShowClimaticMenu
bShowStructuredMenu = clsInstatOptionsDefaults.DEFAULTbShowStructuredMenu
Expand Down Expand Up @@ -148,6 +150,12 @@ Imports RDotNet
SetCommandInOutpt(clsInstatOptionsDefaults.DEFAULTbCommandsinOutput)
End If

If bRemindLaterOption.HasValue Then
SetRemindLaterOption(bRemindLaterOption)
Else
SetRemindLaterOption(clsInstatOptionsDefaults.DEFAULTbRemindLaterOption)
End If

If strComment Is Nothing Then
SetComment(Translations.GetTranslation(clsInstatOptionsDefaults.DEFAULTstrComment))
End If
Expand Down Expand Up @@ -463,6 +471,10 @@ Imports RDotNet
frmMain.clsRLink.strGraphDisplayOption = strGraphDisplayOption
End Sub

Public Sub SetRemindLaterOption(bRemind As Boolean)
bRemindLaterOption = bRemind
End Sub

Public Sub SetCommandInOutpt(bCommand As Boolean)
bCommandsinOutput = bCommand
frmMain.clsRLink.bShowCommands = bCommandsinOutput
Expand Down
1 change: 1 addition & 0 deletions instat/clsInstatOptionsDefaults.vb
Original file line number Diff line number Diff line change
Expand Up @@ -54,4 +54,5 @@ Public Class clsInstatOptionsDefaults
Public Shared ReadOnly DEFAULTstrClimsoftPort As String = "3308"
Public Shared ReadOnly DEFAULTstrClimsoftUsername As String = "root"
Public Shared ReadOnly DEFAULTiMaxOutputsHeight As Integer = 500
Public Shared ReadOnly DEFAULTbRemindLaterOption As Boolean = False
End Class
496 changes: 285 additions & 211 deletions instat/dlgOptions.Designer.vb

Large diffs are not rendered by default.

5 changes: 4 additions & 1 deletion instat/dlgOptions.vb
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ Public Class dlgOptions
ucrChkIncludeDefaultParams.SetText("Include Default Parameter Values in R Commands")
ucrChkAutoSave.SetText("Auto save a backup of data")
ucrChkShowWaitDialog.SetText("Show waiting dialog when command takes longer than")
ucrChkReminder.SetText("Remind me later when R-Instat new version available")
ucrChkAutoSave.AddToLinkedControls(ucrNudAutoSaveMinutes, {True}, bNewLinkedAddRemoveParameter:=True, bNewLinkedHideIfParameterMissing:=True)
ucrNudAutoSaveMinutes.SetLinkedDisplayControl(lblMinutes)
ucrPnlGraphDisplay.AddRadioButton(rdoDisplayinOutputWindow)
Expand Down Expand Up @@ -121,6 +122,7 @@ Public Class dlgOptions
ucrChkShowSignifStars.Checked = frmMain.clsInstatOptions.bShowSignifStars
ucrChkShowDataonGrid.Checked = frmMain.clsInstatOptions.bChangeDataFrame
ucrChkShowWaitDialog.Checked = frmMain.clsInstatOptions.bShowWaitDialog
ucrChkReminder.Checked = frmMain.clsInstatOptions.bRemindLaterOption
ucrNudWaitSeconds.Value = frmMain.clsInstatOptions.iWaitTimeDelaySeconds
ucrInputDatabaseName.SetName(frmMain.clsInstatOptions.strClimsoftDatabaseName)
ucrInputHost.SetName(frmMain.clsInstatOptions.strClimsoftHost)
Expand Down Expand Up @@ -184,6 +186,7 @@ Public Class dlgOptions
frmMain.clsInstatOptions.SetSignifStars(ucrChkShowSignifStars.Checked)
frmMain.clsInstatOptions.SetChangeDataFrame(ucrChkShowDataonGrid.Checked)
frmMain.clsInstatOptions.SetShowWaitDialog(ucrChkShowWaitDialog.Checked)
frmMain.clsInstatOptions.SetRemindLaterOption(ucrChkReminder.Checked)
frmMain.clsInstatOptions.SetWaitTimeDelaySeconds(ucrNudWaitSeconds.Value)
frmMain.clsInstatOptions.SetClimsoftDatabaseName(ucrInputDatabaseName.GetText())
frmMain.clsInstatOptions.SetClimsoftHost(ucrInputHost.GetText())
Expand Down Expand Up @@ -357,7 +360,7 @@ Public Class dlgOptions

End Sub

Private Sub AllControls_ControlValueChanged() Handles ucrNudMaxCols.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrNudWaitSeconds.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged
Private Sub AllControls_ControlValueChanged() Handles ucrNudMaxCols.ControlValueChanged, ucrNudAutoSaveMinutes.ControlValueChanged, ucrNudPreviewRows.ControlValueChanged, ucrInputComment.ControlContentsChanged, ucrChkIncludeCommentsbyDefault.ControlValueChanged, ucrNudMaxRows.ControlValueChanged, ucrChkIncludeDefaultParams.ControlValueChanged, ucrChkShowRCommandsinOutputWindow.ControlValueChanged, ucrNudDigits.ControlValueChanged, ucrChkShowSignifStars.ControlValueChanged, ucrChkShowDataonGrid.ControlValueChanged, ucrChkAutoSave.ControlValueChanged, ucrChkShowWaitDialog.ControlValueChanged, ucrNudWaitSeconds.ControlValueChanged, ucrChkViewClimaticMenu.ControlValueChanged, ucrChkViewStructuredMenu.ControlValueChanged, ucrChkViewProcurementMenu.ControlValueChanged, ucrChkViewOptionsByContextMenu.ControlValueChanged, ucrInputDatabaseName.ControlValueChanged, ucrInputHost.ControlValueChanged, ucrInputPort.ControlValueChanged, ucrInputUserName.ControlValueChanged, ucrChkMaxOutputsHeight.ControlValueChanged, ucrNudMaxOutputsHeight.ControlValueChanged, ucrChkReminder.ControlValueChanged
ApplyEnabled(True)
End Sub

Expand Down
Loading

0 comments on commit 6e92ca0

Please sign in to comment.