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

File Open Dialog Should Support Opening Folders #941

Closed
stuartmscott opened this issue May 5, 2020 · 20 comments
Closed

File Open Dialog Should Support Opening Folders #941

stuartmscott opened this issue May 5, 2020 · 20 comments
Assignees
Labels
blocker Items that would block a forthcoming release

Comments

@stuartmscott
Copy link
Member

Is your feature request related to a problem? Please describe:

It is only possible for the user to open a file, it is not possible for the user to open a folder.

Is it possible to construct a solution with the existing API?

No

Describe the solution you'd like to see:

It should be possible to show a dialog for the user to select a folder, either through the existing ShowOpenDialog, or a new ShowOpenFolderDialog.

@stuartmscott
Copy link
Member Author

Moving to 1.3 alongside the other file picker work, @andydotxyz if you think this should be 1.3.x feel free to move over

@andydotxyz
Copy link
Member

Probably requires some discussion, as I have not figured out how we can do this.
Also I think it would be good to get feedback on the initial file handling code before extending it to the more complex cases.

@stuartmscott
Copy link
Member Author

Agreed, moving to 1.3.x

@stuartmscott
Copy link
Member Author

Idea: this could leverage the proposed file filtering feature, to filter out files and only show directories.

@Jacalz
Copy link
Member

Jacalz commented Jun 26, 2020

I agree with @stuartmscott that this would be very good to see in an upcoming release in 1.3.x. Having this implemented would make the file picker implementation more or less complete in my opinion.

I think the idea about using the (now implemented as far as I am aware) file filters would be a good idea for this. Looking at the folder selection in Chrome for selecting where downloads should be saved, it looks like they are not showing any files at all and only folders. So in theory (yes it is always harder to do in practice) we could just use the file filtering to turn of showing files and then modify the FileOpen dialog layout to send the callback on the currently viewed folder instead of selecting any files.

chrome-folder-select

@chenwuwen
Copy link

Idea: this could leverage the proposed file filtering feature, to filter out files and only show directories.

Your scheme seems feasible, but what type should I filter? The folder has no type, can you give the code that can be run

@andydotxyz
Copy link
Member

I think that @stuartmscott was just proposing ways that this could be built internally - even with the right filtering the dialog does not support picking of a folder

@andydotxyz
Copy link
Member

This can be done as soon as we have the ListableURI (or equivalent) as that is what the callback will need to return.
For example:

	dialog.ShowFileOpen(func(dir fyne.ListableURI, err error) {
		if err != nil {
			dialog.ShowError(err, win)
			return
		}
		loadDir(dir)
	}, win)

@chenwuwen
Copy link

This can be done as soon as we have the ListableURI (or equivalent) as that is what the callback will need to return.
For example:

	dialog.ShowFileOpen(func(dir fyne.ListableURI, err error) {
		if err != nil {
			dialog.ShowError(err, win)
			return
		}
		loadDir(dir)
	}, win)

But not yet fyne.ListableURI

@andydotxyz
Copy link
Member

Correct. It is being worked on in PR #1233

@polotto
Copy link

polotto commented Oct 21, 2020

That is a function that I really need now. For my application scenario, is necessary that the user select a folder to watch for changes. Is there any work around that a I can make the folder selection work?

@andydotxyz
Copy link
Member

There is no workaround, it needs support coded into the file picker, desktop driver and mobile drivers to function correctly.

@polotto
Copy link

polotto commented Oct 21, 2020

Will that feature released in the next version? Is there that feature in the road map of the project?

@andydotxyz
Copy link
Member

andydotxyz commented Oct 21, 2020

It’s hard to say at this point. We have it prioritised for 1.4 but a lot of other work has to be crammed in too. And this time we have a hard deadline as Google is making updated Android API support required in 2 weeks time!

Of course we always try to accommodate the needs of our sponsors :) https://github.com/sponsors/fyne-io

@polotto
Copy link

polotto commented Oct 22, 2020

I'll sponsor the fyne :) !

@andydotxyz
Copy link
Member

THanks @angelopolotto ❤️

@andydotxyz andydotxyz self-assigned this Oct 22, 2020
andydotxyz added a commit to andydotxyz/fyne that referenced this issue Oct 23, 2020
This does open mobile pickers as well, though the lack of ListableURI in mobile means it does not return correctly.

Fixes fyne-io#941
@andydotxyz
Copy link
Member

If you want a preview you can now test out this functionality from the PR #1449.
All being well this will be released in a week with 1.4.

@polotto
Copy link

polotto commented Oct 23, 2020

Amazing news!!! I'll test that. The 1.4 release will be a great evolution of Fyne, you will need a wine to celebrate. Is all the milestone on github projetcs?

@andydotxyz
Copy link
Member

Resolved and ready for testing on develop branch.
This will not completely work on iOS and Android until #1455 is implemented which should be before 1.4 release as well

@andydotxyz
Copy link
Member

You can see what else is in 1.4 using the milestone link https://github.com/fyne-io/fyne/milestone/11.

We may not get all the features in but the blockers will be resolved for sure :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Items that would block a forthcoming release
Projects
None yet
Development

No branches or pull requests

5 participants