Skip to content

Commit

Permalink
Override saveFile() in LinuxFilePicker
Browse files Browse the repository at this point in the history
  • Loading branch information
zacharee committed Aug 17, 2024
1 parent d44b37d commit 0684e95
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 0684e95

Please sign in to comment.