Skip to content
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

allows adding files and folders via filechooser and drag and drop #51 #82

Merged
merged 4 commits into from
Nov 28, 2020

Conversation

wolfposd
Copy link
Contributor

recursive adding of folders ( #51 )

  • need to switch to JFileChooser with SystemLookAndFeel, as javafx.filechooser doesnt allow files+folders selection simultaneously....
  • selecting folders (filechooser/dragndrop) now recursively walks the directory and adds every file.xyz it finds, matching the selected file-filter
  • unified dragndrop filemagic and filechooser magic

need to switch to JFileChooser, as javafx filechooser doesnt allow files+folders selection
selection folders (filechooser/dragndrop) now recursively walks the directory and adds every file.xyz it finds
@developersu
Copy link
Owner

Hi wolfposd,

I understand that current implementation is far away from being perfect but this swing UI looks like a breath from mid-90th.

And, to be honest with you, I don't like it. Just because of how it looks. And actually on Linux it's a way harder to navigate thru file hierarchy.

img

Sorry.
Thank you for your time.

@wolfposd
Copy link
Contributor Author

i know, but swing is the only filechooser that supports multiple selection =(

maybe add a third button for "Add Folders"?

what about drag&drop for recursive folders?
should i adapt the PR?

@developersu
Copy link
Owner

i know, but swing is the only filechooser that supports multiple selection =(

Yeah.. that's why there is 'Select split NSP' button added. Not perfect.

maybe add a third button for "Add Folders"?

Yeah.. like 'Select all' or 'Scan folder and add all content'..
What about adding an option on settings with long and clear description like: 'Select folders with files instead files'? Then on initialize() @ 'GamesController.java' add if-else on selectNspBtn.setOnAction(e-> selectFilesBtnAction()); call depends on option user wants.
BTW, I can handle all this preferences read-write things and, if you want, you can take care about filtering and adding functional part.

what about drag&drop for recursive folders?
should i adapt the PR?

Yes, please. Your implementation with streams and lambdas looks good!

- old filechooser
- directory chooser can choose any directory and recursively adds all *.xyz files
- add button template
@wolfposd
Copy link
Contributor Author

Reverted the old button, and added a new open folder button
dont know about the text, maybe it should be "Scan Folder(s) for Files"

grafik

@developersu
Copy link
Owner

Great! Leave it as is.. I'd like to change idea a bit. Will review, approve, update and get back to you with news and details.
Sorry, a bit busy nowadays ( ><)

Anyway, many thanks!! It's a great improvement!

File[] files = startFolder.listFiles();
if(files != null)
for (File f : files) {
if (f.isDirectory()) {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To handle split-files should be if (f.isDirectory() && ! f.getName().toLowerCase().matches(regex))

if (isTinfoil() && isXciNszXczSupport())
return REGEX_ALLFILES_TINFOIL;
else
return REGEX_ONLY_NSP;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To handle #33 should be:

else if (goldleafController.getNSPFileFilterForGL())) {
    return REGEX_ONLY_NSP;
}
else 
    return ".*";

@developersu developersu merged commit dcabf76 into developersu:master Nov 28, 2020
@developersu
Copy link
Owner

Added your code with some corrections. I'd like to have it as a selectable option in app preferences and be able to turn it off instead of adding more buttons. This way when checkbox for this is selected, we can remove 'Select split-files' button. It makes UI cleaner (IMHO).

Ok, for GoldLeaf: users can select files that are not just nsp, nsz etc but literally any files.
So when I drop my home-folder on Linux (or drive C: on Windows) application would start background thread and will try to add everything.. and user won't even know about this till he/she has memory. So I'm about to add some kinda pop-up for this notifying user that something is running.

Anyway, you can build and check if you want or pick artifact from CI.. if you're interested in what has been changed.

Thanks!

@wolfposd
Copy link
Contributor Author

So when I drop my home-folder on Linux (or drive C: on Windows) application would start background thread and will try to add everything.. and user won't even know about this till he/she has memory.

if possible the "Activity Indicator" should be the same as everywhere else. I cant remember if there is a progressbar when doing USB/Network Uploads, but if there is, just re-use that?

On mobile phones you commonly find version a)
on desktop i would prefer version b)
grafik

@developersu
Copy link
Owner

Both looks good. Actually I'd like to also have 'Cancel' button to be able cancelling this flow.

And I also was about to create pop-up linked to javafx's 'Task', add some cute progress bar, bind it, add counter of files like 'Bla-bla-bla, Scan in progress. 5142 files would be added..'

As for progress bar that exists in application, of course we can use it too.. but the main issue for me is 'Cancel' button.

@developersu
Copy link
Owner

If you want to reach me somewhere else: telegram: developer_su, Skype: developer.su Discord: IDK.. somewhere.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants