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

mac/dialog: refactoring and additions #15859

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

Akemi
Copy link
Member

@Akemi Akemi commented Feb 13, 2025

some dialog refactoring and additions, to make integrations with #15845 easier and prevent code duplications. needs a followup commit for #15845.

also shamelessly stole some ideas from @kasper93.

Copy link

github-actions bot commented Feb 13, 2025

Download the artifacts for this pull request:

Windows
macOS

@kasper93
Copy link
Contributor

kasper93 commented Feb 14, 2025

Not much to say, looks ok. I'm mostly interested how will it work when using mp_file_dialog_get_files, but this is next step.

@Akemi
Copy link
Member Author

Akemi commented Feb 14, 2025

@kasper93 just a heads up, an initial implementation based on your PR including the changes from here. Akemi@813f53d

i am not sure what the assert equivalent would be. following is only evaluated on -Onone builds.

assert(retCount < 1 || ret != nil)

@kasper93
Copy link
Contributor

@kasper93 just a heads up, an initial implementation based on your PR including the changes from here. Akemi@813f53d

Thanks!

i am not sure what the assert equivalent would be. following is only evaluated on -Onone builds.

assert(retCount < 1 || ret != nil)

You can skip it. It's not important. It was just a check.

What I aimed at is that. We return NULL if there is no selection and not NULL if there is at least one selection. To avoid cases where we return empty list (list with terminator only), which is valid, but I didn't want that.

@Akemi
Copy link
Member Author

Akemi commented Feb 14, 2025

i see, that case should be handled by the guard that returns nil when the array is nil (the helper functions never return an empty array).

@kasper93
Copy link
Contributor

I will cherry-pick your commit to my branch, after this PR is merged.

@hooke007
Copy link
Contributor

@kasper93 I guess my previous question was flooded in the arguments of PR#15845. So I post it here. Do you have the plan to add the similar simple dialog for urls On Windows too?
截屏2025-02-14 22 48 36

@kasper93
Copy link
Contributor

kasper93 commented Feb 14, 2025

@kasper93 I guess my previous question was flooded in the arguments of PR#15845. So I post it here. Do you have the plan to add the similar simple dialog for urls On Windows too?

No. We want standard file selection dialog. We won't implement custom dialog to input strings or anything like that. Windows doesn't provide standard dialog that would provide what you want. Of course it is easy to make such dialog, it's not something that we want.

For url you can just paste directly and it will open it.

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.

3 participants