| 261 | } |
| 262 | |
| 263 | void DisplayMessage(const char* title, |
| 264 | const char* contents) { |
| 265 | display_error_mutex.lock(); |
| 266 | |
| 267 | if (config["no_dialogues"].toBool()) { |
| 268 | display_error_mutex.unlock(); |
| 269 | return; |
| 270 | } |
| 271 | |
| 272 | ErrorDisplay ed; |
| 273 | |
| 274 | ed.title = title; |
| 275 | ed.contents = contents; |
| 276 | ed.type = _ok; |
| 277 | |
| 278 | int error_id = PushDisplayError(ed); |
| 279 | |
| 280 | ErrorResponse response; |
| 281 | |
| 282 | // On windows, showing this dialogue on the non-main window seems fine. (not sure i like it though, might wanna not do this, it's helpful for stacktraces in visual studio however). |
| 283 | #if PLATFORM_WINDOWS |
| 284 | response = DisplayLastQueuedError(); |
| 285 | #else |
| 286 | if (IsMainThread()) { |
| 287 | response = DisplayLastQueuedError(); |
| 288 | } else { |
| 289 | response = WaitResponseForDisplayError(error_id); |
| 290 | } |
| 291 | #endif |
| 292 | |
| 293 | display_error_mutex.unlock(); |
| 294 | } |
no test coverage detected