From f4309930b547aa845f2f12824109fb606d9fb217 Mon Sep 17 00:00:00 2001 From: Mole Shang <135e2@135e2.dev> Date: Fri, 1 Mar 2024 23:23:11 +0800 Subject: xmake: come back to NFD --- src/ui.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/ui.c') diff --git a/src/ui.c b/src/ui.c index 3065113..8065237 100644 --- a/src/ui.c +++ b/src/ui.c @@ -6,7 +6,7 @@ #include "nuklear.h" #include "process_url.h" -#include "tinyfiledialogs.h" +#include "nfd.h" #include "constants.h" #include "logger.h" @@ -16,7 +16,7 @@ static nk_size pct; static bool show_app_about; -static char *outPath; +static nfdchar_t *outPath; void load_ui(struct ui_struct *ui) { static char text[USHRT_MAX], box_buffer[UINT16_MAX], status_string[UCHAR_MAX]; @@ -103,12 +103,10 @@ void load_ui(struct ui_struct *ui) { // Clear logger text clear_log(); - outPath = tinyfd_selectFolderDialog("Pick a download folder: ", NULL); - - if (outPath) { - DEBUG_PRINT("tinyfd gets outPath: %s\n", outPath); + if (NFD_PickFolder(&outPath, NULL) == NFD_OKAY && outPath) { + DEBUG_PRINT("nfd gets outPath: %s\n", (char *)outPath); append_log("Got URL: %s\n", text); - add_url(text, outPath, NULL, NULL, NULL); + add_url(text, (char *)outPath, NULL, NULL, NULL); } else { LOG("NFD", "Please specify a valid file PATH to write to!\n"); } -- cgit v1.2.3