| 18 | } |
| 19 | |
| 20 | void UserException::WithCancellableProgress( |
| 21 | std::function<void(const ProgressReporter&)> action, |
| 22 | TranslatableString title, TranslatableString message) |
| 23 | { |
| 24 | using namespace BasicUI; |
| 25 | auto progress = |
| 26 | MakeProgress(std::move(title), std::move(message), ProgressShowCancel); |
| 27 | const auto reportProgress = [&](double progressFraction) { |
| 28 | const auto result = progress->Poll(progressFraction * 1000, 1000); |
| 29 | if (result != ProgressResult::Success) |
| 30 | throw UserException {}; |
| 31 | }; |
| 32 | action(reportProgress); |
| 33 | } |
nothing calls this directly
no test coverage detected