-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
Fix #13269 : support multi-file import across different formats #13271
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
base: main
Are you sure you want to change the base?
Conversation
PLease add a changelog entry, otherwise it's good to go! |
You modified Markdown ( You can check the detailed error output by navigating to your pull request, selecting the tab "Checks", section "Tests" (on the left), subsection "Markdown". |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have some questions
|| selectedExtensionFilter == FileFilterConverter.ANY_FILE | ||
|| "Available import formats".equals(selectedExtensionFilter.getDescription())) { | ||
task = BackgroundTask.wrap( | ||
() -> doImport(files, null)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why should it be null for cases selectedExtensionFilter == FileFilterConverter.ANY_FILE || "Available import formats".equals(selectedExtensionFilter.getDescription())
? The logic in the else case is more general - shouldn't that work here as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well I just realized that it worked because showFileOpenDialogAndGetMultipleFiles
doesn't update selectedExtensionFilter
which makes sense, but then it's always null and always imports with no format specified, whether its a singular or multiple files.
I'll update showFileOpenDialogAndGetMultipleFiles
and refactor importMultipleFiles
to infer format only when there's only one file to be imported and no specific filter
|
||
if (importMethod == ImportMethod.AS_NEW) { | ||
if (importMethod == ImportMethod.AS_NEW || tab == null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add a comment why the second condition works, as otherwise just by reading code this seems like a logic proxy/hacky way.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Import into current library" can still be enabled if there are no libraries open. Is that intentional ? If not, then comment should mention a bug report ?
@trag-bot didn't find any issues in the code! ✅✨ |
Closes #13269
this PR improves the import command to properly handle importing multiple files with different supported formats in a single operation.
ImportCommand::execute
now callsdialogService.showFileOpenDialogAndGetMultipleFiles
instead ofdialogService.showFileOpenDialog
andimportSingleFile()
has been refactored toimportMultipleFiles()
to handle one or more filesSteps to test
Mandatory checks
CHANGELOG.md
described in a way that is understandable for the average user (if change is visible to the user)