| 2793 | } |
| 2794 | |
| 2795 | std::string SimulatorBase::openFileDialog(const std::string &defaultPath, const std::string filterName, const std::string fileFilter) |
| 2796 | { |
| 2797 | std::string fileName = ""; |
| 2798 | #ifdef USE_NFD_FILE_DIALOG |
| 2799 | NFD_Init(); |
| 2800 | |
| 2801 | nfdchar_t* outPath; |
| 2802 | nfdfilteritem_t filterItem[1] = { { filterName.c_str(), fileFilter.c_str() } }; |
| 2803 | nfdresult_t result = NFD_OpenDialog(&outPath, filterItem, 1, defaultPath.c_str()); |
| 2804 | if (result == NFD_OKAY) |
| 2805 | { |
| 2806 | fileName = outPath; |
| 2807 | NFD_FreePath(outPath); |
| 2808 | } |
| 2809 | else if (result == NFD_CANCEL) |
| 2810 | { |
| 2811 | } |
| 2812 | else |
| 2813 | { |
| 2814 | LOG_ERR << "Error: " << NFD_GetError(); |
| 2815 | } |
| 2816 | |
| 2817 | NFD_Quit(); |
| 2818 | #endif |
| 2819 | |
| 2820 | return fileName; |
| 2821 | } |
| 2822 | |
| 2823 | std::string SimulatorBase::saveFileDialog(const std::string& defaultPath, const std::string &defaultName, const std::string filterName, const std::string fileFilter) |
| 2824 | { |
nothing calls this directly
no test coverage detected