Skip to content

Commit

Permalink
🔀 Merge pull request #91 from zacharee/override-methods-in-linux-picker
Browse files Browse the repository at this point in the history
Override `saveFile()` in LinuxFilePicker
  • Loading branch information
vinceglb authored Aug 19, 2024
2 parents 0ee388a + 0684e95 commit 47208b3
Showing 1 changed file with 10 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -51,4 +51,14 @@ internal class LinuxFilePicker(
title,
parentWindow
) else swingFilePicker.pickDirectory(initialDirectory, title, parentWindow)

override suspend fun saveFile(
bytes: ByteArray?,
baseName: String,
extension: String,
initialDirectory: String?,
parentWindow: Window?
): File? = if (xdgFilePickerPortalAvailable) xdgFilePickerPortal.saveFile(
bytes, baseName, extension, initialDirectory, parentWindow
) else awtFilePicker.saveFile(bytes, baseName, extension, initialDirectory, parentWindow)
}

0 comments on commit 47208b3

Please sign in to comment.