summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Zach Hilman2018-08-23 14:12:56 -0400
committerGravatar Zach Hilman2018-08-23 14:12:56 -0400
commit67fa51ea2f54355bcf49bed36658151e6153bb44 (patch)
treee066bd93a6d72de7011cabcd096db6ae8bfb8873 /src
parentMerge pull request #1160 from bunnei/surface-reserve (diff)
downloadyuzu-67fa51ea2f54355bcf49bed36658151e6153bb44.tar.gz
yuzu-67fa51ea2f54355bcf49bed36658151e6153bb44.tar.xz
yuzu-67fa51ea2f54355bcf49bed36658151e6153bb44.zip
qt: Add filename and title id to window title while running
Diffstat (limited to 'src')
-rw-r--r--src/core/core.h7
-rw-r--r--src/yuzu/main.cpp11
2 files changed, 18 insertions, 0 deletions
diff --git a/src/core/core.h b/src/core/core.h
index 790e23cae..7188dabdc 100644
--- a/src/core/core.h
+++ b/src/core/core.h
@@ -187,6 +187,13 @@ public:
187 return current_process; 187 return current_process;
188 } 188 }
189 189
190 /// Gets the name of the current game
191 Loader::ResultStatus GetGameName(std::string& out) const {
192 if (app_loader == nullptr)
193 return Loader::ResultStatus::ErrorNotInitialized;
194 return app_loader->ReadTitle(out);
195 }
196
190 PerfStats perf_stats; 197 PerfStats perf_stats;
191 FrameLimiter frame_limiter; 198 FrameLimiter frame_limiter;
192 199
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index c62360bd4..b3a7bba0c 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -545,6 +545,15 @@ void GMainWindow::BootGame(const QString& filename) {
545 } 545 }
546 status_bar_update_timer.start(2000); 546 status_bar_update_timer.start(2000);
547 547
548 std::string title_name;
549 const auto res = Core::System::GetInstance().GetGameName(title_name);
550 if (res != Loader::ResultStatus::Success)
551 title_name = FileUtil::GetFilename(filename.toStdString());
552
553 setWindowTitle(QString("yuzu %1| %4 | %2-%3")
554 .arg(Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc,
555 QString::fromStdString(title_name)));
556
548 render_window->show(); 557 render_window->show();
549 render_window->setFocus(); 558 render_window->setFocus();
550 559
@@ -576,6 +585,8 @@ void GMainWindow::ShutdownGame() {
576 render_window->hide(); 585 render_window->hide();
577 game_list->show(); 586 game_list->show();
578 game_list->setFilterFocus(); 587 game_list->setFilterFocus();
588 setWindowTitle(QString("yuzu %1| %2-%3")
589 .arg(Common::g_build_name, Common::g_scm_branch, Common::g_scm_desc));
579 590
580 // Disable status bar updates 591 // Disable status bar updates
581 status_bar_update_timer.stop(); 592 status_bar_update_timer.stop();