| 75 | } |
| 76 | |
| 77 | void UpdateManager::Start(bool suppressModal) |
| 78 | { |
| 79 | auto& instance = GetInstance(); |
| 80 | |
| 81 | if (!suppressModal && !prefUpdatesNoticeShown.Read()) |
| 82 | { |
| 83 | // DefaultUpdatesCheckingFlag survives the "Reset Preferences" |
| 84 | // action, so check, if the updates were previously disabled as well. |
| 85 | if (DefaultUpdatesCheckingFlag->Read()) |
| 86 | { |
| 87 | UpdateNoticeDialog notice(nullptr); |
| 88 | |
| 89 | int result = notice.ShowModal(); |
| 90 | SendAnonymousUsageInfo->Write(result != wxNO); |
| 91 | GetInstance().UpdatePrefs(); |
| 92 | } |
| 93 | |
| 94 | prefUpdatesNoticeShown.Write(true); |
| 95 | gPrefs->Flush(); |
| 96 | } |
| 97 | |
| 98 | static std::once_flag flag; |
| 99 | std::call_once(flag, [&instance] { |
| 100 | instance.mTimer.SetOwner(&instance, ID_TIMER); |
| 101 | instance.mTimer.StartOnce(1); |
| 102 | }); |
| 103 | } |
| 104 | |
| 105 | VersionPatch UpdateManager::GetVersionPatch() const |
| 106 | { |
no test coverage detected