diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/common/scm_rev.cpp.in | 2 | ||||
| -rw-r--r-- | src/common/scm_rev.h | 1 | ||||
| -rw-r--r-- | src/yuzu/about_dialog.cpp | 24 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 21 |
4 files changed, 32 insertions, 16 deletions
diff --git a/src/common/scm_rev.cpp.in b/src/common/scm_rev.cpp.in index ba741c5668..b6bff72867 100644 --- a/src/common/scm_rev.cpp.in +++ b/src/common/scm_rev.cpp.in @@ -17,6 +17,7 @@ #define BUILD_ID "@BUILD_ID@" #define TITLE_BAR_FORMAT_IDLE "@TITLE_BAR_FORMAT_IDLE@" #define TITLE_BAR_FORMAT_RUNNING "@TITLE_BAR_FORMAT_RUNNING@" +#define IS_DEV_BUILD @IS_DEV_BUILD@ namespace Common { @@ -30,6 +31,7 @@ const char g_build_version[] = BUILD_VERSION; const char g_build_id[] = BUILD_ID; const char g_title_bar_format_idle[] = TITLE_BAR_FORMAT_IDLE; const char g_title_bar_format_running[] = TITLE_BAR_FORMAT_RUNNING; +const bool g_is_dev_build = IS_DEV_BUILD; /// Anonymizes SCM data /// This is quite weak. But better than nothing. diff --git a/src/common/scm_rev.h b/src/common/scm_rev.h index 59d0cfcfb3..ee1997950a 100644 --- a/src/common/scm_rev.h +++ b/src/common/scm_rev.h @@ -16,5 +16,6 @@ extern const char g_build_id[]; extern const char g_title_bar_format_idle[]; extern const char g_title_bar_format_running[]; extern const char g_shader_cache_version[]; +extern const bool g_is_dev_build; } // namespace Common diff --git a/src/yuzu/about_dialog.cpp b/src/yuzu/about_dialog.cpp index 6ee52ae088..6ef3072894 100644 --- a/src/yuzu/about_dialog.cpp +++ b/src/yuzu/about_dialog.cpp @@ -1,21 +1,29 @@ // SPDX-FileCopyrightText: Copyright 2018 yuzu Emulator Project // SPDX-License-Identifier: GPL-2.0-or-later +#include "yuzu/about_dialog.h" #include <QIcon> -#include <fmt/ranges.h> #include "common/scm_rev.h" #include "ui_aboutdialog.h" -#include "yuzu/about_dialog.h" +#include <fmt/ranges.h> AboutDialog::AboutDialog(QWidget* parent) - : QDialog(parent), ui{std::make_unique<Ui::AboutDialog>()} { - const auto branch_name = std::string(Common::g_scm_branch); - const auto description = std::string(Common::g_scm_desc); + : QDialog(parent) + , ui{std::make_unique<Ui::AboutDialog>()} +{ + const auto description = std::string(Common::g_build_version); const auto build_id = std::string(Common::g_build_id); - const auto yuzu_build = fmt::format("eden Development Build | {}-{}", branch_name, description); - const auto override_build = - fmt::format(fmt::runtime(std::string(Common::g_title_bar_format_idle)), build_id); + std::string yuzu_build; + if (Common::g_is_dev_build) { + yuzu_build = fmt::format("eden Nightly | {}-{}", description, build_id); + } else { + yuzu_build = fmt::format("eden | {}", description); + } + + const auto override_build = fmt::format(fmt::runtime( + std::string(Common::g_title_bar_format_idle)), + build_id); const auto yuzu_build_version = override_build.empty() ? yuzu_build : override_build; ui->setupUi(this); diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index af6f71c3fd..7e31fdae4d 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp @@ -420,13 +420,13 @@ GMainWindow::GMainWindow(bool has_broken_vulkan) if (UISettings::values.check_for_updates) { update_future = QtConcurrent::run([]() -> QString { const bool is_prerelease = - ((strstr(Common::g_build_fullname, "pre-alpha") != NULL) || - (strstr(Common::g_build_fullname, "alpha") != NULL) || - (strstr(Common::g_build_fullname, "beta") != NULL) || - (strstr(Common::g_build_fullname, "rc") != NULL)); + ((strstr(Common::g_build_version, "pre-alpha") != NULL) || + (strstr(Common::g_build_version, "alpha") != NULL) || + (strstr(Common::g_build_version, "beta") != NULL) || + (strstr(Common::g_build_version, "rc") != NULL)); const std::optional<std::string> latest_release_tag = UpdateChecker::GetLatestRelease(is_prerelease); - if (latest_release_tag && latest_release_tag.value() != Common::g_build_fullname) { + if (latest_release_tag && latest_release_tag.value() != Common::g_build_version) { return QString::fromStdString(latest_release_tag.value()); } return QString{}; @@ -4796,11 +4796,16 @@ void GMainWindow::OnEmulatorUpdateAvailable() { void GMainWindow::UpdateWindowTitle(std::string_view title_name, std::string_view title_version, std::string_view gpu_vendor) { - const auto branch_name = std::string(Common::g_scm_branch); - const auto description = std::string(Common::g_scm_desc); + const auto description = std::string(Common::g_build_version); const auto build_id = std::string(Common::g_build_id); - const auto yuzu_title = fmt::format("eden | {}-{}", branch_name, description); + std::string yuzu_title; + if (Common::g_is_dev_build) { + yuzu_title = fmt::format("eden Nightly | {}-{}", description, build_id); + } else { + yuzu_title = fmt::format("eden | {}", description); + } + const auto override_title = fmt::format(fmt::runtime(std::string(Common::g_title_bar_format_idle)), build_id); const auto window_title = override_title.empty() ? yuzu_title : override_title; |
