| 41 | } |
| 42 | |
| 43 | UpdateOverlay::UpdateOverlay(Screen& screen, const AutoUpdater::Update& update, std::function<void()> onInstalled) |
| 44 | : Overlay(screen), mUpdate(update), mOnInstalled(std::move(onInstalled)) |
| 45 | { |
| 46 | mText = i18n::t("updater.downloading", {update.version}); |
| 47 | mWorker = std::thread([this]() { |
| 48 | const AutoUpdater::Outcome outcome = AutoUpdater::install(mUpdate); |
| 49 | mOutcome = outcome; |
| 50 | mFinished.store(true, std::memory_order_release); |
| 51 | }); |
| 52 | } |
| 53 | |
| 54 | UpdateOverlay::~UpdateOverlay() |
| 55 | { |