diff options
| -rw-r--r-- | src/yuzu/about_dialog.cpp | 8 | ||||
| -rw-r--r-- | src/yuzu/main.cpp | 25 | ||||
| -rw-r--r-- | src/yuzu/main.h | 1 |
3 files changed, 23 insertions, 11 deletions
diff --git a/src/yuzu/about_dialog.cpp b/src/yuzu/about_dialog.cpp index 3efa65a38..d39b3f07a 100644 --- a/src/yuzu/about_dialog.cpp +++ b/src/yuzu/about_dialog.cpp | |||
| @@ -9,10 +9,10 @@ | |||
| 9 | 9 | ||
| 10 | AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) { | 10 | AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) { |
| 11 | ui->setupUi(this); | 11 | ui->setupUi(this); |
| 12 | ui->labelLogo->setPixmap(QIcon::fromTheme("yuzu").pixmap(200)); | 12 | ui->labelLogo->setPixmap(QIcon::fromTheme(QStringLiteral("yuzu")).pixmap(200)); |
| 13 | ui->labelBuildInfo->setText( | 13 | ui->labelBuildInfo->setText(ui->labelBuildInfo->text().arg( |
| 14 | ui->labelBuildInfo->text().arg(Common::g_build_fullname, Common::g_scm_branch, | 14 | QString::fromUtf8(Common::g_build_fullname), QString::fromUtf8(Common::g_scm_branch), |
| 15 | Common::g_scm_desc, QString(Common::g_build_date).left(10))); | 15 | QString::fromUtf8(Common::g_scm_desc), QString::fromUtf8(Common::g_build_date).left(10))); |
| 16 | } | 16 | } |
| 17 | 17 | ||
| 18 | AboutDialog::~AboutDialog() = default; | 18 | AboutDialog::~AboutDialog() = default; |
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp index e33e3aaaf..a59abf6e8 100644 --- a/src/yuzu/main.cpp +++ b/src/yuzu/main.cpp | |||
| @@ -198,11 +198,11 @@ GMainWindow::GMainWindow() | |||
| 198 | 198 | ||
| 199 | ConnectMenuEvents(); | 199 | ConnectMenuEvents(); |
| 200 | ConnectWidgetEvents(); | 200 | ConnectWidgetEvents(); |
| 201 | |||
| 201 | LOG_INFO(Frontend, "yuzu Version: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch, | 202 | LOG_INFO(Frontend, "yuzu Version: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch, |
| 202 | Common::g_scm_desc); | 203 | Common::g_scm_desc); |
| 204 | UpdateWindowTitle(); | ||
| 203 | 205 | ||
| 204 | setWindowTitle(QString("yuzu %1| %2-%3") | ||
| 205 | .arg(Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc)); | ||
| 206 | show(); | 206 | show(); |
| 207 | 207 | ||
| 208 | Core::System::GetInstance().SetContentProvider( | 208 | Core::System::GetInstance().SetContentProvider( |
| @@ -936,9 +936,7 @@ void GMainWindow::BootGame(const QString& filename) { | |||
| 936 | title_name = FileUtil::GetFilename(filename.toStdString()); | 936 | title_name = FileUtil::GetFilename(filename.toStdString()); |
| 937 | } | 937 | } |
| 938 | 938 | ||
| 939 | setWindowTitle(QString("yuzu %1| %4 | %2-%3") | 939 | UpdateWindowTitle(QString::fromStdString(title_name)); |
| 940 | .arg(Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc, | ||
| 941 | QString::fromStdString(title_name))); | ||
| 942 | 940 | ||
| 943 | loading_screen->Prepare(Core::System::GetInstance().GetAppLoader()); | 941 | loading_screen->Prepare(Core::System::GetInstance().GetAppLoader()); |
| 944 | loading_screen->show(); | 942 | loading_screen->show(); |
| @@ -979,8 +977,8 @@ void GMainWindow::ShutdownGame() { | |||
| 979 | loading_screen->Clear(); | 977 | loading_screen->Clear(); |
| 980 | game_list->show(); | 978 | game_list->show(); |
| 981 | game_list->setFilterFocus(); | 979 | game_list->setFilterFocus(); |
| 982 | setWindowTitle(QString("yuzu %1| %2-%3") | 980 | |
| 983 | .arg(Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc)); | 981 | UpdateWindowTitle(); |
| 984 | 982 | ||
| 985 | // Disable status bar updates | 983 | // Disable status bar updates |
| 986 | status_bar_update_timer.stop(); | 984 | status_bar_update_timer.stop(); |
| @@ -1767,6 +1765,19 @@ void GMainWindow::OnCaptureScreenshot() { | |||
| 1767 | OnStartGame(); | 1765 | OnStartGame(); |
| 1768 | } | 1766 | } |
| 1769 | 1767 | ||
| 1768 | void GMainWindow::UpdateWindowTitle(const QString& title_name) { | ||
| 1769 | const QString full_name = QString::fromUtf8(Common::g_build_fullname); | ||
| 1770 | const QString branch_name = QString::fromUtf8(Common::g_scm_branch); | ||
| 1771 | const QString description = QString::fromUtf8(Common::g_scm_desc); | ||
| 1772 | |||
| 1773 | if (title_name.isEmpty()) { | ||
| 1774 | setWindowTitle(QStringLiteral("yuzu %1| %2-%3").arg(full_name, branch_name, description)); | ||
| 1775 | } else { | ||
| 1776 | setWindowTitle(QStringLiteral("yuzu %1| %4 | %2-%3") | ||
| 1777 | .arg(full_name, branch_name, description, title_name)); | ||
| 1778 | } | ||
| 1779 | } | ||
| 1780 | |||
| 1770 | void GMainWindow::UpdateStatusBar() { | 1781 | void GMainWindow::UpdateStatusBar() { |
| 1771 | if (emu_thread == nullptr) { | 1782 | if (emu_thread == nullptr) { |
| 1772 | status_bar_update_timer.stop(); | 1783 | status_bar_update_timer.stop(); |
diff --git a/src/yuzu/main.h b/src/yuzu/main.h index fb2a193cb..7bf82e665 100644 --- a/src/yuzu/main.h +++ b/src/yuzu/main.h | |||
| @@ -209,6 +209,7 @@ private slots: | |||
| 209 | 209 | ||
| 210 | private: | 210 | private: |
| 211 | std::optional<u64> SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id); | 211 | std::optional<u64> SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id); |
| 212 | void UpdateWindowTitle(const QString& title_name = {}); | ||
| 212 | void UpdateStatusBar(); | 213 | void UpdateStatusBar(); |
| 213 | 214 | ||
| 214 | Ui::MainWindow ui; | 215 | Ui::MainWindow ui; |