Skip to content

Commit

Permalink
Merge pull request IDEMSInternational#8556 from derekagorhom/Addition…
Browse files Browse the repository at this point in the history
…al_Toolbar_Changes

Allow the user to easily reopen previously opened scripts
  • Loading branch information
N-thony authored Oct 18, 2023
2 parents 89d4d68 + 749f3d1 commit e570fe9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions instat/dlgImportDataset.vb
Original file line number Diff line number Diff line change
Expand Up @@ -716,6 +716,7 @@ Public Class dlgImportDataset
"Load Script From File", MessageBoxButtons.YesNo) = DialogResult.Yes Then
Try
frmMain.ucrScriptWindow.strActiveTabText = File.ReadAllText(strFilePathSystem)
frmMain.clsRecentItems.addToMenu(Replace(strFilePathSystem, "\", "/"))
Catch
MessageBox.Show("Could not load the script from file." &
Environment.NewLine & "The file may be in use by another program or you may not have access to write to the specified location.",
Expand Down
4 changes: 4 additions & 0 deletions instat/ucrScript.vb
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ Public Class ucrScript
File.WriteAllText(dlgSave.FileName, If(bIsLog, clsScriptLog.Text, clsScriptActive.Text))
bIsTextChanged = False
TabControl.SelectedTab.Text = System.IO.Path.GetFileName(dlgSave.FileName)
frmMain.clsRecentItems.addToMenu(Replace(Path.Combine(Path.GetFullPath(FileIO.SpecialDirectories.MyDocuments), System.IO.Path.GetFileName(dlgSave.FileName)), "\", "/"))
frmMain.bDataSaved = True
If bIsLog Then
strInitialDirectoryLog = Path.GetDirectoryName(dlgSave.FileName)
Else
Expand Down Expand Up @@ -515,6 +517,8 @@ Public Class ucrScript
TabControl.SelectedTab.Text = System.IO.Path.GetFileName(dlgLoad.FileName)
strInitialDirectory = Path.GetDirectoryName(dlgLoad.FileName)
bIsTextChanged = False
frmMain.clsRecentItems.addToMenu(Replace(Path.Combine(Path.GetFullPath(FileIO.SpecialDirectories.MyDocuments), System.IO.Path.GetFileName(dlgLoad.FileName)), "\", "/"))
frmMain.bDataSaved = True
Catch
MsgBox("Could not load the script from file." & Environment.NewLine &
"The file may be in use by another program or you may not have access to read from the specified location.",
Expand Down

0 comments on commit e570fe9

Please sign in to comment.