Ticket #2367 (closed bug: obsolete)

Opened 10 years ago

Last modified 9 years 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
Category: unknown Effort:
Importance: 80 Ticket_group:
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:
Analysis_reviewers: stefan Changelog: Changelog
Design_reviewers: meddle 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 (3.2 KB) - added by stefan 10 years ago.

Change History

comment:1 Changed 10 years ago by todor

  • Status changed from new to s1b_analysis_finished

comment:2 Changed 10 years 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.

comment:3 Changed 10 years ago by stefan

  • Analysis_score changed from 0 to 3

comment:4 Changed 10 years 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 10 years ago by stefan

comment:5 Changed 10 years ago by stefan

  • Imp._owners set to stefan

comment:6 Changed 10 years ago by meddle

  • Status changed from s3b_implementation_finished to s3c_implementation_ok
  • Cc todor, deyan added
  • Imp._reviewers set to meddle, todor
  • Design_score changed from 0 to 4
  • Design_reviewers set to meddle
  • Imp._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

comment:7 Changed 9 years 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.