-
Notifications
You must be signed in to change notification settings - Fork 695
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
Fixes #2150. Revamping FileDialog #2259
Conversation
Awesome! |
Putting this back in ready for review. I think I have addressed most of the feedback. I still need to look more into configuration manager support and now that we have System.IO.Abstractions I can write some more tests but I think all the functionality is there otherwise. |
Tickets that would be nice to have to refactor this include: |
Bugs
/folder/item1
/folder/item2 And you enter a capital I (i.e. |
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.
This is simply fantastic. I know you're now remembering that the last 10% is the hardest 90% ;-).
Feel free to punt all of my change requests to new Issues we can fix at our leisure except the namespace/file location ones.
Lets's make FileDialog more customizible for buttons. I suggest adding to the constructor the label for Cancel button and the ability to change the order of the buttons ([ Cancel ][ Open ] -> [ Open ][ Cancel ] -> [ Open ][ Done ]): |
I'm a fan of making it more customizable but not via a constructor. Constructors should be parameter-less. |
Most of what you describe can be accomplished with the Style class. But there are improvements that could be made. I've put what works at the top of this code sample and what we could enable in the bottom (in comments). fd.Style.OkButtonText = "Lets go!";
fd.Style.ModifiedColumnName = "Date";
fd.Title = "Blerg";
// does not exist
// fd.Style.OkCancelText = "Wait no!";
// currently has internal setters (so you cannot do this). Also needs slight adjustment
// in order of initialization so user changes would take effect
//fd.Style.PathCaption = "Pick a file";
//fd.Style.SearchCaption = "Find yer stuff";
|
And the ability to change the order of the buttons ([ Wait no! ][ Lets go! ] -> [ Lets go! ][ Wait no! ]) |
Fixes #2150.
Note: This branch/PR includes #2258 (SplitContainer)
The goals are:
Speed
If using a console TUI, entering a file/directory should be as fast as on the shell directly
Coloring
Listing files on the console with
ls
gives coloring that shows what is a directory, what is an image, executable etc.ls
commandls
Navigation (Backwards/Forwards/Up)
After making a navigation into a folder there should be a single key click you can make to take you back. Once moving back you should be able to use another keystroke to move forward again.
Backspace
in the Table view changes historyShift+Backspace
moves forward againMore File Info
Being able to sort by FileSize or Date Modified is super handy
Other Places
Most GUI file explorers have either a list or a tree recent/root places (e.g. drives)
SpecialFolder
andLogicalDrives
on left in a collapsable pane.TODO
' '
for files and'\'
for directories..
should set the text entry to the current dir (not last selected file at that level)ListView
).LEFT
cursor when TileView is expanded and first cell in table is selected should move focus to the tree# Additional Review TODOs
Reference Examples
Since we are in the domain of terminal use here we should first look at what the basic console offers. The user can select a directory with autocomplete by typing it directly and hitting tab to complete or enter to confirm. Some terminals have more or less autocomplete e.g. with fish will show full autocomplete suggestions in gray:
Folder selection in the console
Windows file dialog
Save/Export dialog in GIMP
MacOS file open dialog
MS-Dos open dialog for text editor
Terminal.Gui file dialog
Fixes #_____ - Include a terse summary of the change or which issue is fixed.
Pull Request checklist:
CTRL-K-D
to automatically reformat your files before committing.dotnet test
before commit///
style comments)