qt: Prerelease builds now direct users to upgrade via GitHub rather than azahar-emu.org
Some checks are pending
citra-build / source (push) Waiting to run
citra-build / linux (appimage) (push) Waiting to run
citra-build / linux (fresh) (push) Waiting to run
citra-build / macos (arm64) (push) Waiting to run
citra-build / macos (x86_64) (push) Waiting to run
citra-build / macos-universal (push) Blocked by required conditions
citra-build / windows (msvc) (push) Waiting to run
citra-build / windows (msys2) (push) Waiting to run
citra-build / android (push) Waiting to run
citra-format / clang-format (push) Waiting to run
citra-transifex / transifex (push) Waiting to run

This commit is contained in:
OpenSauce04 2025-08-10 21:17:50 +01:00 committed by OpenSauce
parent 68aab3e0e5
commit 2087f96e90

View File

@ -170,6 +170,12 @@ void GMainWindow::ShowCommandOutput(std::string title, std::string message) {
#endif
}
bool IsPrerelease() {
return ((strstr(Common::g_build_fullname, "alpha") != NULL) ||
(strstr(Common::g_build_fullname, "beta") != NULL) ||
(strstr(Common::g_build_fullname, "rc") != NULL));
}
GMainWindow::GMainWindow(Core::System& system_)
: ui{std::make_unique<Ui::MainWindow>()}, system{system_}, movie{system.Movie()},
user_data_migrator{this}, config{std::make_unique<QtConfig>()}, emu_thread{nullptr} {
@ -398,12 +404,8 @@ GMainWindow::GMainWindow(Core::System& system_)
#ifdef ENABLE_QT_UPDATE_CHECKER
if (UISettings::values.check_for_update_on_start) {
update_future = QtConcurrent::run([]() -> QString {
const bool is_prerelease = // TODO: This can be done better -OS
((strstr(Common::g_build_fullname, "alpha") != NULL) ||
(strstr(Common::g_build_fullname, "beta") != NULL) ||
(strstr(Common::g_build_fullname, "rc") != NULL));
const std::optional<std::string> latest_release_tag =
UpdateChecker::GetLatestRelease(is_prerelease);
UpdateChecker::GetLatestRelease(IsPrerelease());
if (latest_release_tag && latest_release_tag.value() != Common::g_build_fullname) {
return QString::fromStdString(latest_release_tag.value());
}
@ -3926,8 +3928,13 @@ void GMainWindow::OnEmulatorUpdateAvailable() {
.arg(version_string));
update_prompt.exec();
if (update_prompt.button(QMessageBox::Yes) == update_prompt.clickedButton()) {
QDesktopServices::openUrl(
QUrl(QString::fromStdString("https://azahar-emu.org/pages/download/")));
std::string update_page_url;
if (IsPrerelease()) {
update_page_url = "https://github.com/azahar-emu/azahar/releases";
} else {
update_page_url = "https://azahar-emu.org/pages/download/";
}
QDesktopServices::openUrl(QUrl(QString::fromStdString(update_page_url)));
}
}
#endif