diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 7 | ||||
-rw-r--r-- | src/ui.c | 12 |
2 files changed, 5 insertions, 14 deletions
@@ -1,7 +1,6 @@ #include <GL/glew.h> #include <GLFW/glfw3.h> #include <curl/curl.h> -#include <nfd.h> #include <stdio.h> #include <stdlib.h> @@ -21,12 +20,12 @@ #include "nuklear_glfw_gl3.h" #include "constants.h" -#include "unifont.h" #include "logger.h" #include "main.h" #include "process_url.h" #include "style.h" #include "ui.h" +#include "unifont.h" extern int win_width, win_height; extern void load_ui(struct ui_struct *); @@ -77,9 +76,6 @@ int main(void) { exit(EXIT_FAILURE); } - /* Native File Dialog */ - NFD_Init(); - /* Logger setup */ struct logger *logger = setup_logger(); // Put it in ui_struct @@ -155,7 +151,6 @@ int main(void) { MAX_ELEMENT_BUFFER); glfwSwapBuffers(win); } - NFD_Quit(); curl_cleanup(&stat); nk_glfw3_shutdown(&glfw); glfwTerminate(); @@ -5,7 +5,7 @@ #include <string.h> #include "nuklear.h" -#include <nfd.h> +#include "tinyfiledialogs.h" #include "constants.h" #include "logger.h" @@ -13,7 +13,7 @@ #include "ui.h" static nk_size pct; -static nfdchar_t *outPath; +static char *outPath; void load_ui(struct ui_struct *ui) { static char text[USHRT_MAX], box_buffer[UINT16_MAX], status_string[UCHAR_MAX]; @@ -52,14 +52,10 @@ void load_ui(struct ui_struct *ui) { // Clear logger text clear_log(); - nfdresult_t result = NFD_PickFolder(&outPath, ""); - if (result == NFD_OKAY) { - DEBUG_PRINT("[NFD] outPath: %s\n", outPath); - } else if (result == NFD_ERROR) { - LOG("NFD", "Error: %s\n", NFD_GetError()); - } + outPath = tinyfd_selectFolderDialog("Pick a download folder: ", NULL); if (outPath) { + DEBUG_PRINT("tinyfd gets outPath: %s\n", outPath); append_log("Got URL: %s\n", text); add_url(text, outPath, NULL, NULL); } else { |