| 535 | } |
| 536 | |
| 537 | nfdresult_t NFD_PickFolderN(nfdnchar_t** outPath, const nfdnchar_t* defaultPath) { |
| 538 | GtkWidget* widget = gtk_file_chooser_dialog_new("Select folder", |
| 539 | nullptr, |
| 540 | GTK_FILE_CHOOSER_ACTION_SELECT_FOLDER, |
| 541 | "_Cancel", |
| 542 | GTK_RESPONSE_CANCEL, |
| 543 | "_Select", |
| 544 | GTK_RESPONSE_ACCEPT, |
| 545 | nullptr); |
| 546 | |
| 547 | // guard to destroy the widget when returning from this function |
| 548 | Widget_Guard widgetGuard(widget); |
| 549 | |
| 550 | /* Set the default path */ |
| 551 | SetDefaultPath(GTK_FILE_CHOOSER(widget), defaultPath); |
| 552 | |
| 553 | if (RunDialogWithFocus(GTK_DIALOG(widget)) == GTK_RESPONSE_ACCEPT) { |
| 554 | // write out the file name |
| 555 | *outPath = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(widget)); |
| 556 | |
| 557 | return NFD_OKAY; |
| 558 | } else { |
| 559 | return NFD_CANCEL; |
| 560 | } |
| 561 | } |
| 562 | |
| 563 | nfdresult_t NFD_PathSet_GetCount(const nfdpathset_t* pathSet, nfdpathsetsize_t* count) { |
| 564 | assert(pathSet); |
nothing calls this directly
no test coverage detected