| 60 | } |
| 61 | |
| 62 | void FileDialog::display() |
| 63 | { |
| 64 | // Only call the dialog if it's not already displayed |
| 65 | if (!_openFlag || _isOpened) |
| 66 | { |
| 67 | return; |
| 68 | } |
| 69 | _openFlag = false; |
| 70 | |
| 71 | // Check if we want to save or open |
| 72 | bool save = !(_flags & SelectDirectory) && (_flags & EnterNewFilename); |
| 73 | |
| 74 | mx::StringVec result = launchFileDialog(_filetypes, save, false); |
| 75 | std::string path = result.empty() ? "" : result.front(); |
| 76 | if (!path.empty()) |
| 77 | { |
| 78 | _selectedFilenames.push_back(path); |
| 79 | } |
| 80 | |
| 81 | _isOpened = false; |
| 82 | } |
| 83 | |
| 84 | #if !defined(__APPLE__) |
| 85 | mx::StringVec launchFileDialog(const std::vector<std::pair<std::string, std::string>>& filetypes, bool save, bool multiple) |
no test coverage detected