77{
78
81 const auto response {[sm, reported_version](const int result) {
82#ifndef MIDI2LR_BETA
83 if (result) {
84 if (juce::URL("https://github.com/rsjaffe/MIDI2LR/releases").launchInDefaultBrowser()) {
86 }
87 }
88 else {
90 }
91#else
92 if (result) {
93 std::ignore =
94 juce::URL("https://github.com/rsjaffe/MIDI2LR/releases").launchInDefaultBrowser();
95 }
96#endif
97 }};
98
99 try {
101 juce::NativeMessageBox::showYesNoBox(juce::AlertWindow::AlertIconType::QuestionIcon,
102 fmt::format(
103 fmt::runtime(juce::translate("A new version of {} is available.").toStdString()),
104 "MIDI2LR"),
105 juce::translate("Do you want to download the latest version?") + ' '
106 + IntToVersion(static_cast<unsigned int>(reported_version)),
107 nullptr, juce::ModalCallbackFunction::create(response));
108 }
109 catch (const std::exception& e) {
111 }
112}
void SetLastVersionFound(int version_number)
Definition SettingsManager.h:70
int new_version_
Definition VersionChecker.h:41
std::atomic< bool > thread_should_exit_
Definition VersionChecker.h:43