Ticket #2341 (closed tweak: obsolete)
file-dialog-filters -- add more filters to file dialogs
Reported by: | deyan | Owned by: | pap |
---|---|---|---|
Priority: | major | Milestone: | X3 |
Component: | uncategorized | Version: | 2.0 |
Keywords: | Cc: | ||
Category: | unknown | Effort: | |
Importance: | Ticket_group: | ||
Estimated Number of Hours: | 0 | Add Hours to Ticket: | 0 |
Billable?: | yes | Total Hours: | 0 |
Analysis_owners: | deyan | Design_owners: | pap |
Imp._owners: | pap | Test_owners: | |
Analysis_reviewers: | pap | Changelog: | Changelog |
Design_reviewers: | meddle | Imp._reviewers: | meddle, deyan |
Test_reviewers: | Analysis_score: | 4 | |
Design_score: | 4 | Imp._score: | 4 |
Test_score: | 0 |
Description (last modified by pap) (diff)
Create and add the following filters:
All dialogs
All Files (*.*)
Image dialogs
- All Image Files (*.jpg; *.jpeg; *.bmp; *.gif; *.png)
- JPEG (*.jpg; *.jpeg)
- Bitmap (*.bmp)
- Graphics Interchange Format (*.gif)
- Portable Network Graphics (*.png)
Video dialogs
- All Video Files (*.avi; *.mov)
- Audio Video Interleave (*.avi)
- Quick Time (*.mov)
Audio dialogs
- All Audio Files (*.wav; *.ogg)
- Wave (*.wav)
- Ogg Vorbis (*.ogg)
- Mp3 (*.mp3)
Text dialogs
- All Text Files (*.txt; *.rtf; *.htm; *.html)
- Web Page file (*.htm; *.html)
- Text file (*.txt)
- Rich Text Format (*.rtf)
Books
- Sophie 2.0 Book (*.book.s2)
PS
- PostScript (*.ps)
- Adobe PDF (*.pdf)
Import dialog
- All supported files
Attachments
Change History
comment:1 follow-up: ↓ 2 Changed 15 years ago by deyan
- Owner set to deyan
- Status changed from new to s1a_analysis_started
comment:2 in reply to: ↑ 1 Changed 15 years ago by deyan
- Description modified (diff)
Replying to deyan:
comment:4 Changed 15 years ago by pap
- Status changed from s1a_analysis_started to s1c_analysis_ok
- Analysis_reviewers set to pap
- Analysis_owners set to deyan
- Analysis_score changed from 0 to 4
- Seems good
comment:5 Changed 15 years ago by pap
- Design_owners set to pap
- Owner changed from deyan to pap
- Status changed from s1c_analysis_ok to s2a_design_started
- Taking for design
comment:6 Changed 15 years ago by deyan
- Description modified (diff)
Batch update from file active_tickets.csv
comment:7 Changed 15 years ago by pap
- Status changed from s2a_design_started to s2b_design_finished
- Description modified (diff)
- Create a new public static class in FileDialogInput called FileFilterInfo. It will contain a list of FileFilters and a list indicating whether the "accept all files" filter of JFileChooser should be used.
- Add method public boolean accepts(File file) that checks the file against the FileFilterInfo.
- Make FileDialogInput use FileFilterInfo instead of FileFilter.
- Make the ResourceImportManagers use the FileFilterInfo instead of just a FileFilter.
- These are generally straightforward especially with the FileFilterInfo.accepts method available.
- The resource chooser also benefits from this class as it gets simpler. For that purpose the addFilters method was added.
- Unresolved
- Removing FileFilter constants from FileDialogInput.
- Should FileFilterInfo be used in ResourceExportManager. How to handle appending an extension.
- How to construct FileFilterInfos? How about using static initializers? I know they aren't nice but otherwise there should be some gigantic expression to create a filter info with 5-6 filters.
comment:8 Changed 15 years ago by meddle
- Status changed from s2b_design_finished to s2c_design_ok
- Design_score changed from 0 to 4
- Design_reviewers set to meddle
- May be you should pull out the FileFilterInfo class, because the FileDialogInput is getting bigger and bigger.
- I think the FilterInfos should be in the corresponding ResourceImportManagers.
- The export managers correspond to one and only format, so you should have FileFilterInfo with one Filter, use the first filter's extension for appending.
- I think the static initializers will work, but prefer the constants in the ImportManagers. You decide.
- While talking about the export managers, may be we will have problems with the Sophie 2 Format one, because it appends different extensions depending on the exported resource.
- Are you sure there are no other problems?
- Use the tests and demos of the import/export logic and the ResourceChooser
comment:9 Changed 15 years ago by pap
- Status changed from s2c_design_ok to s3a_implementation_started
- Imp._owners set to pap
- Taking for implementation
- I think that we'd better leave the ExportManagers as they are.
- I'll try to pull out some classes of FileDialogInput.
comment:10 Changed 15 years ago by pap
- Status changed from s3a_implementation_started to s3b_implementation_finished
- Extracted all inner classes except the kind of the input. These were added to a new package.
- Made most of the filter constants of type FileFilterInfo instead of FileFilter
- Changed BinDataChooser to use FileFilterInfo.
- Added a method boolean accepts(File file, boolean strict) to FileFilterInfo that determines whether to consider the accept all files filter.
- I think that we should somehow fix the FileDialogInput.appendFileExtension method. Now it looks even uglier. It may be put inside FileFilterInfo or made to take the extension as it second parameter and the extension live inside a FileFilterInfo object or not.
- Implementation is in svn://sophie2.org/sophie2/branches/private/pap/fileFilters
- Can be seen in http://sophie2.org/trac/browser/branches/private/pap/fileFilters
comment:11 Changed 15 years ago by meddle
- Status changed from s3b_implementation_finished to s3c_implementation_ok
- Imp._score changed from 0 to 4
- Imp._reviewers set to meddle, deyan
Merged to the trunk at [8897]
- We made you fix some JavaDoc and brackets in the filter's text.
- Some bad hyphenation, but I think it was not your fault, I fixed what I saw...
- I think everything is fine...
- If you want to list your branch in the wiki write 'square_bracket'log:branches/path_to_what_you-want_to_list'square_bracket'
- I the next FileDialog, connected task we can put your last idea about appendFileExtension
comment:12 Changed 13 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.
Create and add the following filters: