Merge pull request #2457 from lioncash/about

yuzu/{about_dialog, main}: Specify string conversions explicitly for SCM-related info
This commit is contained in:
bunnei 2019-05-17 15:42:43 -04:00 committed by GitHub
commit fb85d5670d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 23 additions and 11 deletions

View File

@ -9,10 +9,10 @@
AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) { AboutDialog::AboutDialog(QWidget* parent) : QDialog(parent), ui(new Ui::AboutDialog) {
ui->setupUi(this); ui->setupUi(this);
ui->labelLogo->setPixmap(QIcon::fromTheme("yuzu").pixmap(200)); ui->labelLogo->setPixmap(QIcon::fromTheme(QStringLiteral("yuzu")).pixmap(200));
ui->labelBuildInfo->setText( ui->labelBuildInfo->setText(ui->labelBuildInfo->text().arg(
ui->labelBuildInfo->text().arg(Common::g_build_fullname, Common::g_scm_branch, QString::fromUtf8(Common::g_build_fullname), QString::fromUtf8(Common::g_scm_branch),
Common::g_scm_desc, QString(Common::g_build_date).left(10))); QString::fromUtf8(Common::g_scm_desc), QString::fromUtf8(Common::g_build_date).left(10)));
} }
AboutDialog::~AboutDialog() = default; AboutDialog::~AboutDialog() = default;

View File

@ -198,11 +198,11 @@ GMainWindow::GMainWindow()
ConnectMenuEvents(); ConnectMenuEvents();
ConnectWidgetEvents(); ConnectWidgetEvents();
LOG_INFO(Frontend, "yuzu Version: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch, LOG_INFO(Frontend, "yuzu Version: {} | {}-{}", Common::g_build_fullname, Common::g_scm_branch,
Common::g_scm_desc); Common::g_scm_desc);
UpdateWindowTitle();
setWindowTitle(QString("yuzu %1| %2-%3")
.arg(Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc));
show(); show();
Core::System::GetInstance().SetContentProvider( Core::System::GetInstance().SetContentProvider(
@ -936,9 +936,7 @@ void GMainWindow::BootGame(const QString& filename) {
title_name = FileUtil::GetFilename(filename.toStdString()); title_name = FileUtil::GetFilename(filename.toStdString());
} }
setWindowTitle(QString("yuzu %1| %4 | %2-%3") UpdateWindowTitle(QString::fromStdString(title_name));
.arg(Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc,
QString::fromStdString(title_name)));
loading_screen->Prepare(Core::System::GetInstance().GetAppLoader()); loading_screen->Prepare(Core::System::GetInstance().GetAppLoader());
loading_screen->show(); loading_screen->show();
@ -979,8 +977,8 @@ void GMainWindow::ShutdownGame() {
loading_screen->Clear(); loading_screen->Clear();
game_list->show(); game_list->show();
game_list->setFilterFocus(); game_list->setFilterFocus();
setWindowTitle(QString("yuzu %1| %2-%3")
.arg(Common::g_build_fullname, Common::g_scm_branch, Common::g_scm_desc)); UpdateWindowTitle();
// Disable status bar updates // Disable status bar updates
status_bar_update_timer.stop(); status_bar_update_timer.stop();
@ -1767,6 +1765,19 @@ void GMainWindow::OnCaptureScreenshot() {
OnStartGame(); OnStartGame();
} }
void GMainWindow::UpdateWindowTitle(const QString& title_name) {
const QString full_name = QString::fromUtf8(Common::g_build_fullname);
const QString branch_name = QString::fromUtf8(Common::g_scm_branch);
const QString description = QString::fromUtf8(Common::g_scm_desc);
if (title_name.isEmpty()) {
setWindowTitle(QStringLiteral("yuzu %1| %2-%3").arg(full_name, branch_name, description));
} else {
setWindowTitle(QStringLiteral("yuzu %1| %4 | %2-%3")
.arg(full_name, branch_name, description, title_name));
}
}
void GMainWindow::UpdateStatusBar() { void GMainWindow::UpdateStatusBar() {
if (emu_thread == nullptr) { if (emu_thread == nullptr) {
status_bar_update_timer.stop(); status_bar_update_timer.stop();

View File

@ -209,6 +209,7 @@ private slots:
private: private:
std::optional<u64> SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id); std::optional<u64> SelectRomFSDumpTarget(const FileSys::ContentProvider&, u64 program_id);
void UpdateWindowTitle(const QString& title_name = {});
void UpdateStatusBar(); void UpdateStatusBar();
Ui::MainWindow ui; Ui::MainWindow ui;