Ticket #2367 (closed bug: obsolete)

Opened 2 years ago

Last modified 2 months ago

file-dialog-enter-behavior - When hitting enter on folder in the file dialog, whole folder is imported instead of opening it.

Reported by: todor Owned by:
Priority: major Milestone: X3
Component: uncategorized Version: 2.0
Keywords: Cc: todor, deyan
Ticket_group: Effort:
Category: unknown Importance: 80
Estimated Number of Hours: 0 Add Hours to Ticket: 0
Billable?: yes Total Hours: 0
Analysis_owners: todor Design_owners: stefan
Imp._owners: stefan Test_owners:
Design_reviewers: meddle Analysis_reviewers: stefan
Changelog: Changelog Imp._reviewers: meddle, todor
Test_reviewers: Analysis_score: 3
Design_score: 4 Imp._score: 3
Test_score: 0

Description

  • Now when you try to insert item, if you accidentally press enter on folder Sophie tries to insert all its contents instead of opening it, the same happens iv you click on the insert button of the dialog.
  • This behavior is acceptable only if you want to import resources from the resource palette, but even then we should consider asking for folders containing too many resources.

Attachments

2367.patch Download (3.2 KB) - added by stefan 23 months ago.

Change History

Changed 2 years ago by todor

  • status changed from new to s1b_analysis_finished

Changed 23 months ago by stefan

  • design_owners set to stefan
  • status changed from s1b_analysis_finished to s2a_design_started
  • analysis_reviewers set to stefan

Analysis doesn't says what should be done - the options are two:

  • should enter behave as "open folder".
  • should enter as if u want to insert all items.

But, it was discussed that its better to open the folder instead of importing it.

Changed 23 months ago by stefan

  • analysis_score changed from 0 to 3

Changed 23 months ago by stefan

  • status changed from s2a_design_started to s3b_implementation_finished

The fix for this bug is only few lines added in the FileDialog class. In the show(...) method, in the part of handling the APROVE submit (hitting ENTER or "Import" button), is checkedwhether the selected item (one item) is firectory - if so, the selected item is opened. Otherwise, if selected item is file, or there are several selected items, including folders, all of them are imported.
Related code:

...
case JFileChooser.APPROVE_OPTION:
	File files[] = input.isMultiSelectEnabled() ? this.fileChooser.getSelectedFiles() : new File[] { this.fileChooser.getSelectedFile() };
	if (files.length == 1 && files[0].isDirectory()) {
		this.fileChooser.setCurrentDirectory(files[0]);
		break;
	}
...

Patch is attached to the ticket.

Changed 23 months ago by stefan

Changed 23 months ago by stefan

  • implementation_owners set to stefan

Changed 23 months ago by meddle

  • status changed from s3b_implementation_finished to s3c_implementation_ok
  • cc todor, deyan added
  • implementation_reviewers set to meddle, todor
  • design_score changed from 0 to 4
  • design_reviewers set to meddle
  • implementation_score changed from 0 to 3
  • Merged into the trunk at [8925].
  • This is good to be included in the release, but:
    • The point with the resource palette is not taken in mind.
    • You can reproduce the bug if you choose two or more folders...
  • I think for the above a new ticket should be made.

3p

Changed 2 months ago by meddle

  • status changed from s3c_implementation_ok to closed
  • resolution set to obsolete

Closing all the tickets before M Y1

Note: See TracTickets for help on using tickets.