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 associations #4957

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

Conversation

zhelenskiy
Copy link
Member

@zhelenskiy zhelenskiy commented Jun 11, 2024

Add file associations support to Compose Desktop

Fixes #773

Testing

Tested on the sample project.
Behaviours per OSs:

  • MacOS Sonoma: associations work for distributables.
  • Windows 11: associations work after the installation of the MSI.
  • Kubuntu: associations do not work, but everything else works fine. However, IDEA also does not have associations there, so I assume this is fine.

I didn't write any unit tests because I don’t know which of them you are expecting me to write. So, I'm looking forward to your feedback and suggestions.

This should be tested by QA

Release Notes

Highlight - Desktop

  • Introduction of the new DSL function in nativeDistributions block:
    fun fileAssociation(mimeType: String, extension: String, description: String): Unit

[Desktop: Add support for file associations](JetBrains#773)
@igordmn igordmn self-requested a review June 12, 2024 00:44
[Desktop: Add support for file associations](JetBrains#773)
@igordmn
Copy link
Collaborator

igordmn commented Jun 19, 2024

@terrakok, could you also review the new API in this PR? I am also reviewing it and the implementation.

@igordmn igordmn requested a review from terrakok June 19, 2024 10:30
Copy link
Collaborator

@igordmn igordmn left a comment

Choose a reason for hiding this comment

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

Thanks!

A few changes needed, an API review from @terrakok, and it is good to merge.

[Desktop: Add support for file associations](JetBrains#773)
[Desktop: Add support for file associations](JetBrains#773)
[Desktop: Add support for file associations](JetBrains#773)
@zhelenskiy
Copy link
Member Author

zhelenskiy commented Jun 21, 2024

Except for DSL test and docs, everything else is fixed. Can you close the comment, @terrakok? It is not closable.

What do you think about the API? It supports:

  • Ability to make platform-specific file associations.
  • Ability to make platform-independent associations without copying.
  • Ability to provide or not an icon.
  • For platform-specific association icons you need to specify only one property iconFile while for universal you need to specify windowsIconFile, etc.

The demo project is also updated according to the new API.

PS. This version is only tested on MacOS for now. I'll check the rest a bit later.

Copy link
Collaborator

@igordmn igordmn left a comment

Choose a reason for hiding this comment

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

Looks good to me after resolving 2 my open comments.

The end review and merging I delegate to @terrakok.

[Desktop: Add support for file associations](JetBrains#773)
@zhelenskiy
Copy link
Member Author

zhelenskiy commented Jun 22, 2024

I had to change resource name generation to make it stable for testing.

@zhelenskiy
Copy link
Member Author

I tested the current version on Windows, MacOS, Ubuntu, Kubuntu. On Windows, MacOS everything is ok, while on both Linux distributives there are problems (in Kubuntu there is no icon, in Ubuntu, association doesn't work), but the same thing is with idea as well.

@zhelenskiy zhelenskiy requested a review from terrakok June 22, 2024 17:46
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.

Desktop: Add support for file associations
3 participants