diff options
| -rw-r--r-- | src/citra/emu_window/emu_window_sdl2.cpp | 4 | ||||
| -rw-r--r-- | src/citra_qt/bootmanager.cpp | 4 | ||||
| -rw-r--r-- | src/citra_qt/main.cpp | 3 | ||||
| -rw-r--r-- | src/common/CMakeLists.txt | 23 | ||||
| -rw-r--r-- | src/common/scm_rev.cpp.in | 2 | ||||
| -rw-r--r-- | src/common/scm_rev.h | 1 |
6 files changed, 32 insertions, 5 deletions
diff --git a/src/citra/emu_window/emu_window_sdl2.cpp b/src/citra/emu_window/emu_window_sdl2.cpp index 81a3abe3f..00d00905a 100644 --- a/src/citra/emu_window/emu_window_sdl2.cpp +++ b/src/citra/emu_window/emu_window_sdl2.cpp | |||
| @@ -79,8 +79,8 @@ EmuWindow_SDL2::EmuWindow_SDL2() { | |||
| 79 | SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); | 79 | SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 8); |
| 80 | SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0); | 80 | SDL_GL_SetAttribute(SDL_GL_ALPHA_SIZE, 0); |
| 81 | 81 | ||
| 82 | std::string window_title = | 82 | std::string window_title = Common::StringFromFormat("Citra %s| %s-%s ", Common::g_build_name, |
| 83 | Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc); | 83 | Common::g_scm_branch, Common::g_scm_desc); |
| 84 | render_window = SDL_CreateWindow( | 84 | render_window = SDL_CreateWindow( |
| 85 | window_title.c_str(), | 85 | window_title.c_str(), |
| 86 | SDL_WINDOWPOS_UNDEFINED, // x position | 86 | SDL_WINDOWPOS_UNDEFINED, // x position |
diff --git a/src/citra_qt/bootmanager.cpp b/src/citra_qt/bootmanager.cpp index 948db384d..69d18cf0c 100644 --- a/src/citra_qt/bootmanager.cpp +++ b/src/citra_qt/bootmanager.cpp | |||
| @@ -101,8 +101,8 @@ private: | |||
| 101 | GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread) | 101 | GRenderWindow::GRenderWindow(QWidget* parent, EmuThread* emu_thread) |
| 102 | : QWidget(parent), child(nullptr), keyboard_id(0), emu_thread(emu_thread) { | 102 | : QWidget(parent), child(nullptr), keyboard_id(0), emu_thread(emu_thread) { |
| 103 | 103 | ||
| 104 | std::string window_title = | 104 | std::string window_title = Common::StringFromFormat("Citra %s| %s-%s", Common::g_build_name, |
| 105 | Common::StringFromFormat("Citra | %s-%s", Common::g_scm_branch, Common::g_scm_desc); | 105 | Common::g_scm_branch, Common::g_scm_desc); |
| 106 | setWindowTitle(QString::fromStdString(window_title)); | 106 | setWindowTitle(QString::fromStdString(window_title)); |
| 107 | 107 | ||
| 108 | keyboard_id = KeyMap::NewDeviceId(); | 108 | keyboard_id = KeyMap::NewDeviceId(); |
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 513da8001..7a80af890 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp | |||
| @@ -69,7 +69,8 @@ GMainWindow::GMainWindow() : config(new Config()), emu_thread(nullptr) { | |||
| 69 | ConnectMenuEvents(); | 69 | ConnectMenuEvents(); |
| 70 | ConnectWidgetEvents(); | 70 | ConnectWidgetEvents(); |
| 71 | 71 | ||
| 72 | setWindowTitle(QString("Citra | %1-%2").arg(Common::g_scm_branch, Common::g_scm_desc)); | 72 | setWindowTitle(QString("Citra %1| %2-%3") |
| 73 | .arg(Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc)); | ||
| 73 | show(); | 74 | show(); |
| 74 | 75 | ||
| 75 | game_list->PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan); | 76 | game_list->PopulateAsync(UISettings::values.gamedir, UISettings::values.gamedir_deepscan); |
diff --git a/src/common/CMakeLists.txt b/src/common/CMakeLists.txt index 592911c2b..26c83efda 100644 --- a/src/common/CMakeLists.txt +++ b/src/common/CMakeLists.txt | |||
| @@ -1,4 +1,27 @@ | |||
| 1 | # Generate cpp with Git revision from template | 1 | # Generate cpp with Git revision from template |
| 2 | # Also if this is a CI build, add the build name (ie: Nightly, Bleeding Edge) to the scm_rev file as well | ||
| 3 | set(REPO_NAME "") | ||
| 4 | if ($ENV{CI}) | ||
| 5 | if ($ENV{TRAVIS}) | ||
| 6 | set(BUILD_REPOSITORY $ENV{TRAVIS_REPO_SLUG}) | ||
| 7 | elseif($ENV{APPVEYOR}) | ||
| 8 | set(BUILD_REPOSITORY $ENV{APPVEYOR_REPO_NAME}) | ||
| 9 | endif() | ||
| 10 | # regex capture the string nightly or bleeding-edge into CMAKE_MATCH_1 | ||
| 11 | string(REGEX MATCH "citra-emu/citra-?(.*)" OUTVAR ${BUILD_REPOSITORY}) | ||
| 12 | if (${CMAKE_MATCH_COUNT} GREATER 0) | ||
| 13 | # capitalize the first letter of each word in the repo name. | ||
| 14 | string(REPLACE "-" ";" REPO_NAME_LIST ${CMAKE_MATCH_1}) | ||
| 15 | foreach(WORD ${REPO_NAME_LIST}) | ||
| 16 | string(SUBSTRING ${WORD} 0 1 FIRST_LETTER) | ||
| 17 | string(SUBSTRING ${WORD} 1 -1 REMAINDER) | ||
| 18 | string(TOUPPER ${FIRST_LETTER} FIRST_LETTER) | ||
| 19 | # this leaves a trailing space on the last word, but we actually want that | ||
| 20 | # because of how its styled in the title bar. | ||
| 21 | set(REPO_NAME "${REPO_NAME}${FIRST_LETTER}${REMAINDER} ") | ||
| 22 | endforeach() | ||
| 23 | endif() | ||
| 24 | endif() | ||
| 2 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp" @ONLY) | 25 | configure_file("${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp.in" "${CMAKE_CURRENT_SOURCE_DIR}/scm_rev.cpp" @ONLY) |
| 3 | 26 | ||
| 4 | set(SRCS | 27 | set(SRCS |
diff --git a/src/common/scm_rev.cpp.in b/src/common/scm_rev.cpp.in index 79b404bb8..0080db5d5 100644 --- a/src/common/scm_rev.cpp.in +++ b/src/common/scm_rev.cpp.in | |||
| @@ -7,12 +7,14 @@ | |||
| 7 | #define GIT_REV "@GIT_REV@" | 7 | #define GIT_REV "@GIT_REV@" |
| 8 | #define GIT_BRANCH "@GIT_BRANCH@" | 8 | #define GIT_BRANCH "@GIT_BRANCH@" |
| 9 | #define GIT_DESC "@GIT_DESC@" | 9 | #define GIT_DESC "@GIT_DESC@" |
| 10 | #define BUILD_NAME "@REPO_NAME@" | ||
| 10 | 11 | ||
| 11 | namespace Common { | 12 | namespace Common { |
| 12 | 13 | ||
| 13 | const char g_scm_rev[] = GIT_REV; | 14 | const char g_scm_rev[] = GIT_REV; |
| 14 | const char g_scm_branch[] = GIT_BRANCH; | 15 | const char g_scm_branch[] = GIT_BRANCH; |
| 15 | const char g_scm_desc[] = GIT_DESC; | 16 | const char g_scm_desc[] = GIT_DESC; |
| 17 | const char g_build_name[] = BUILD_NAME; | ||
| 16 | 18 | ||
| 17 | } // namespace | 19 | } // namespace |
| 18 | 20 | ||
diff --git a/src/common/scm_rev.h b/src/common/scm_rev.h index 0ef190afa..e22389803 100644 --- a/src/common/scm_rev.h +++ b/src/common/scm_rev.h | |||
| @@ -9,5 +9,6 @@ namespace Common { | |||
| 9 | extern const char g_scm_rev[]; | 9 | extern const char g_scm_rev[]; |
| 10 | extern const char g_scm_branch[]; | 10 | extern const char g_scm_branch[]; |
| 11 | extern const char g_scm_desc[]; | 11 | extern const char g_scm_desc[]; |
| 12 | extern const char g_build_name[]; | ||
| 12 | 13 | ||
| 13 | } // namespace | 14 | } // namespace |