mirror of
https://github.com/azahar-emu/azahar
synced 2025-11-06 15:09:58 +01:00
qt: Prerelease builds now direct users to upgrade via GitHub rather than azahar-emu.org
This commit is contained in:
parent
68aab3e0e5
commit
2087f96e90
@ -170,6 +170,12 @@ void GMainWindow::ShowCommandOutput(std::string title, std::string message) {
|
|||||||
#endif
|
#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_)
|
GMainWindow::GMainWindow(Core::System& system_)
|
||||||
: ui{std::make_unique<Ui::MainWindow>()}, system{system_}, movie{system.Movie()},
|
: ui{std::make_unique<Ui::MainWindow>()}, system{system_}, movie{system.Movie()},
|
||||||
user_data_migrator{this}, config{std::make_unique<QtConfig>()}, emu_thread{nullptr} {
|
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
|
#ifdef ENABLE_QT_UPDATE_CHECKER
|
||||||
if (UISettings::values.check_for_update_on_start) {
|
if (UISettings::values.check_for_update_on_start) {
|
||||||
update_future = QtConcurrent::run([]() -> QString {
|
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 =
|
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) {
|
if (latest_release_tag && latest_release_tag.value() != Common::g_build_fullname) {
|
||||||
return QString::fromStdString(latest_release_tag.value());
|
return QString::fromStdString(latest_release_tag.value());
|
||||||
}
|
}
|
||||||
@ -3926,8 +3928,13 @@ void GMainWindow::OnEmulatorUpdateAvailable() {
|
|||||||
.arg(version_string));
|
.arg(version_string));
|
||||||
update_prompt.exec();
|
update_prompt.exec();
|
||||||
if (update_prompt.button(QMessageBox::Yes) == update_prompt.clickedButton()) {
|
if (update_prompt.button(QMessageBox::Yes) == update_prompt.clickedButton()) {
|
||||||
QDesktopServices::openUrl(
|
std::string update_page_url;
|
||||||
QUrl(QString::fromStdString("https://azahar-emu.org/pages/download/")));
|
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
|
#endif
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user