-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add file associations support to Compose Desktop <!-- Optional --> Fixes #773 ## Testing Tested on the [sample project](https://github.com/zhelenskiy/file-associations-demo). 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. <!-- Optional --> This should be tested by QA ## Release Notes <!-- Optional, if omitted - won't be included in the changelog Sections: - Highlights - Known issues - Breaking changes - Features - Fixes Subsections: - Multiple Platforms - iOS - Desktop - Web - Resources - Gradle Plugin --> ### Highlight - Desktop - Introduction of the new DSL function in `nativeDistributions` block: ```kotlin fun fileAssociation(mimeType: String, extension: String, description: String): Unit ```
- Loading branch information
1 parent
c7b6403
commit dea37a0
Showing
12 changed files
with
337 additions
and
61 deletions.
There are no files selected for viewing
11 changes: 11 additions & 0 deletions
11
.../compose/src/main/kotlin/org/jetbrains/compose/desktop/application/dsl/FileAssociation.kt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
package org.jetbrains.compose.desktop.application.dsl | ||
|
||
import java.io.File | ||
import java.io.Serializable | ||
|
||
internal data class FileAssociation( | ||
val mimeType: String, | ||
val extension: String, | ||
val description: String, | ||
val iconFile: File?, | ||
) : Serializable |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.