diff options
| author | Mole Shang <135e2@135e2.dev> | 2024-03-01 23:23:11 +0800 | 
|---|---|---|
| committer | Mole Shang <135e2@135e2.dev> | 2024-03-01 23:29:19 +0800 | 
| commit | f4309930b547aa845f2f12824109fb606d9fb217 (patch) | |
| tree | 14f0344c579df7ac8dea945ffe37cd0274e1b17f /src/ui.c | |
| parent | 2c23cf4b3968a2c4f86253dcadba9779bc00e6ff (diff) | |
| download | hinata-f4309930b547aa845f2f12824109fb606d9fb217.tar.gz hinata-f4309930b547aa845f2f12824109fb606d9fb217.tar.bz2 hinata-f4309930b547aa845f2f12824109fb606d9fb217.zip  | |
xmake: come back to NFD
Diffstat (limited to 'src/ui.c')
| -rw-r--r-- | src/ui.c | 12 | 
1 files changed, 5 insertions, 7 deletions
@@ -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");      }  | 
