| 443 | } |
| 444 | |
| 445 | nfdresult_t NFD_OpenDialogMultipleN(const nfdpathset_t** outPaths, |
| 446 | const nfdnfilteritem_t* filterList, |
| 447 | nfdfiltersize_t filterCount, |
| 448 | const nfdnchar_t* defaultPath) { |
| 449 | GtkWidget* widget = gtk_file_chooser_dialog_new("Open Files", |
| 450 | nullptr, |
| 451 | GTK_FILE_CHOOSER_ACTION_OPEN, |
| 452 | "_Cancel", |
| 453 | GTK_RESPONSE_CANCEL, |
| 454 | "_Open", |
| 455 | GTK_RESPONSE_ACCEPT, |
| 456 | nullptr); |
| 457 | |
| 458 | // guard to destroy the widget when returning from this function |
| 459 | Widget_Guard widgetGuard(widget); |
| 460 | |
| 461 | // set select multiple |
| 462 | gtk_file_chooser_set_select_multiple(GTK_FILE_CHOOSER(widget), TRUE); |
| 463 | |
| 464 | /* Build the filter list */ |
| 465 | AddFiltersToDialog(GTK_FILE_CHOOSER(widget), filterList, filterCount); |
| 466 | |
| 467 | /* Set the default path */ |
| 468 | SetDefaultPath(GTK_FILE_CHOOSER(widget), defaultPath); |
| 469 | |
| 470 | if (RunDialogWithFocus(GTK_DIALOG(widget)) == GTK_RESPONSE_ACCEPT) { |
| 471 | // write out the file name |
| 472 | GSList* fileList = gtk_file_chooser_get_filenames(GTK_FILE_CHOOSER(widget)); |
| 473 | |
| 474 | *outPaths = static_cast<void*>(fileList); |
| 475 | return NFD_OKAY; |
| 476 | } else { |
| 477 | return NFD_CANCEL; |
| 478 | } |
| 479 | } |
| 480 | |
| 481 | nfdresult_t NFD_SaveDialogN(nfdnchar_t** outPath, |
| 482 | const nfdnfilteritem_t* filterList, |
nothing calls this directly
no test coverage detected