Native file dialogs now work in WSL.

This commit is contained in:
Jakob Friedl
2025-10-31 11:09:37 +01:00
parent d581e0d2b6
commit e27df807b3
6 changed files with 30 additions and 54 deletions

View File

@@ -1,4 +1,4 @@
import strformat, strutils, times, os, tables # native_dialogs
import strformat, strutils, times, os, tables, native_dialogs
import imguin/[cimgui, glfw_opengl, simple]
import ../../utils/[appImGui, colors]
import ../../../common/[types, utils]
@@ -96,11 +96,7 @@ proc draw*(component: DownloadsComponent, showComponent: ptr bool, connection: W
if igMenuItem("Download", nil, false, true):
# Download file
try:
let path = item.path & ".download"
# TODO: Use native dialogs to select the download location
# let path = callDialogFileSave("Save File")
let path = callDialogFileSave("Save File")
let data = component.contents[item.lootId]
writeFile(path, data)
except IOError: