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

[feature] Start from the last used directory #215

Open
WojciechMula opened this issue Dec 4, 2024 · 2 comments
Open

[feature] Start from the last used directory #215

WojciechMula opened this issue Dec 4, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@WojciechMula
Copy link

I find it more friendly, when I can open a file from the same directory I opened file last time.
My proposal is to provide a new configuration enum that would control how a dialog behave:

  • always use the initial directory (default),
  • always use the last directory a user visited (with the full directory history?),
  • use the last directory only if user selected something, otherwise use the initial directory.

Does it sound sane?

@fluxxcode
Copy link
Owner

fluxxcode commented Dec 4, 2024

Hey, thanks for the issue.

The idea sounds good, but can be quite confusing if an app uses multiple file dialog objects.

You can already implement this yourself. Something like:

if let Some(path) = file_dialog.take_selected() {
    file_dialog.config_mut().initial_directory = path;
}

Then the last selected path should always be opened. But I have not tested it myself

@fluxxcode fluxxcode added the enhancement New feature or request label Dec 8, 2024
@WojciechMula
Copy link
Author

The idea sounds good, but can be quite confusing if an app uses multiple file dialog objects.

Yes, this would need to be a setting per instance.

Anyways, I used your suggestion and for now it's a good workaround, thanks.

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

No branches or pull requests

2 participants