summaryrefslogtreecommitdiff
path: root/src/ui.c
diff options
context:
space:
mode:
authorMole Shang <[email protected]>2023-08-06 12:54:47 +0800
committerMole Shang <[email protected]>2023-08-06 13:13:47 +0800
commit6fc145906eafdbd89f4558b79282a9e5d722afbc (patch)
tree5eb33ff84acbc62d9e7e82b0a1277595ecf377c0 /src/ui.c
parent2f70538a4fe5427de44697d5585351216426a31b (diff)
downloadhinata-6fc145906eafdbd89f4558b79282a9e5d722afbc.tar.gz
hinata-6fc145906eafdbd89f4558b79282a9e5d722afbc.tar.bz2
hinata-6fc145906eafdbd89f4558b79282a9e5d722afbc.zip
xmake: migrate from NFD to tinyfiledialogs
nativefiledialog-extended works great on Linux w/ portal support, but somehow is too complex to build on Windows. [1] Switch to tinyfd for simplicity. [1]: Visual Studio CL.exe would fail with MSB6001. ``` Error MSB6001: Invalid command line switch for "CL.exe". Item has already been added. Key in dictionary: 'VCInstallDir' Key being added: 'VCINSTALLDIR' ``` For further information, see below: https://social.msdn.microsoft.com/Forums/vstudio/en-US/5de6d7e3-7a38-4712-ba59-be179808bf9e/error-msb6001-invalid-command-line-switch-for-clexe https://github.com/dotnet/msbuild/issues/5726 It's been over 10 years, and Microsoft still claims that case sensitivity thing is a FEATURE. Holy M$, Thank you.
Diffstat (limited to 'src/ui.c')
-rw-r--r--src/ui.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/ui.c b/src/ui.c
index 7f1dc52..da6fd1b 100644
--- a/src/ui.c
+++ b/src/ui.c
@@ -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 {