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

Small bug fixes on Import Dataset dialog #6242

Merged
merged 8 commits into from
Mar 15, 2021
Merged
21 changes: 15 additions & 6 deletions instat/dlgImportDataset.vb
Original file line number Diff line number Diff line change
Expand Up @@ -446,13 +446,15 @@ Public Class dlgImportDataset

If DialogResult.OK = dlgOpen.ShowDialog() Then
ucrSaveFile.Reset()
'ucrSaveFile.SetAssignToBooleans(bTempDataFrameList:=False)
N-thony marked this conversation as resolved.
Show resolved Hide resolved
'TODO This is in place for when we allow multiple files selected.
bMultiFiles = (dlgOpen.FileNames.Count > 1)
If NumberOfFileTypes(dlgOpen.FileNames) > 1 Then
MsgBox("All files must be of the same type", MsgBoxStyle.Information, "Multiple file types")
SetControlsFromFile("")
Else
dctSelectedExcelSheets.Clear()
clbSheets.Items.Clear()
SetControlsFromFile(dlgOpen.FileName)
End If
Else
Expand Down Expand Up @@ -636,15 +638,22 @@ Public Class dlgImportDataset
strFileType = ""
End If
If strFileType <> "" AndAlso strFileType <> "RDS" Then
'ucrSaveFile.Show()
'ucrSaveFile.SetName(frmMain.clsRLink.MakeValidText(strFileName), bSilent:=True)
'don't ovewrite the name for excel sheets if there is a selected sheet name
If (strFileType <> "XLSX" OrElse strFileType <> "XLS") AndAlso clbSheets.CheckedItems.Count = 0 Then
If (strFileType = "XLSX" OrElse strFileType = "XLS") Then
ucrSaveFile.SetAssignToBooleans(bTempDataFrameList:=True)
If clbSheets.CheckedItems.Count > 1 Then
ucrSaveFile.Hide()
ElseIf clbSheets.CheckedItems.Count = 1 Then
ucrSaveFile.Show()
ucrSaveFile.SetName(dctSelectedExcelSheets.Values.First(), bSilent:=True)
ElseIf clbSheets.CheckedItems.Count = 0 Then
ucrSaveFile.Show()
ucrSaveFile.SetName(frmMain.clsRLink.MakeValidText(strFileName), bSilent:=True)
End If
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace with a select/case statement?

Else
ucrSaveFile.SetAssignToBooleans(bTempDataFrameList:=False)
ucrSaveFile.Show()
ucrSaveFile.SetName(frmMain.clsRLink.MakeValidText(strFileName), bSilent:=True)
End If
Else
ucrSaveFile.Hide()
End If
RefreshFilePreview()
RefreshFrameView()
Expand Down