Browse Source
Merge pull request #1065 from DarkLordZach/window-title
qt: Add filename and title id to window title while running
pull/15/merge
Zach Hilman
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with
18 additions and
0 deletions
-
src/core/core.h
-
src/yuzu/main.cpp
|
|
|
@ -187,6 +187,13 @@ public: |
|
|
|
return current_process; |
|
|
|
} |
|
|
|
|
|
|
|
/// Gets the name of the current game |
|
|
|
Loader::ResultStatus GetGameName(std::string& out) const { |
|
|
|
if (app_loader == nullptr) |
|
|
|
return Loader::ResultStatus::ErrorNotInitialized; |
|
|
|
return app_loader->ReadTitle(out); |
|
|
|
} |
|
|
|
|
|
|
|
PerfStats perf_stats; |
|
|
|
FrameLimiter frame_limiter; |
|
|
|
|
|
|
|
|
|
|
|
@ -556,6 +556,15 @@ void GMainWindow::BootGame(const QString& filename) { |
|
|
|
} |
|
|
|
status_bar_update_timer.start(2000); |
|
|
|
|
|
|
|
std::string title_name; |
|
|
|
const auto res = Core::System::GetInstance().GetGameName(title_name); |
|
|
|
if (res != Loader::ResultStatus::Success) |
|
|
|
title_name = FileUtil::GetFilename(filename.toStdString()); |
|
|
|
|
|
|
|
setWindowTitle(QString("yuzu %1| %4 | %2-%3") |
|
|
|
.arg(Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc, |
|
|
|
QString::fromStdString(title_name))); |
|
|
|
|
|
|
|
render_window->show(); |
|
|
|
render_window->setFocus(); |
|
|
|
|
|
|
|
@ -587,6 +596,8 @@ void GMainWindow::ShutdownGame() { |
|
|
|
render_window->hide(); |
|
|
|
game_list->show(); |
|
|
|
game_list->setFilterFocus(); |
|
|
|
setWindowTitle(QString("yuzu %1| %2-%3") |
|
|
|
.arg(Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc)); |
|
|
|
|
|
|
|
// Disable status bar updates
|
|
|
|
status_bar_update_timer.stop(); |
|
|
|
|