From fb5f01e46ac3c64fbddeea913ce238c27f092ec3 Mon Sep 17 00:00:00 2001 From: Jeffrey Pfau Date: Sat, 18 Oct 2014 01:07:42 -0700 Subject: [PATCH] Show project name and game title in title bar --- src/platform/qt/Window.cpp | 5 +++++ src/platform/qt/main.cpp | 2 ++ 2 files changed, 7 insertions(+) diff --git a/src/platform/qt/Window.cpp b/src/platform/qt/Window.cpp index 8c528437e..90626af73 100644 --- a/src/platform/qt/Window.cpp +++ b/src/platform/qt/Window.cpp @@ -24,6 +24,7 @@ Window::Window(QWidget* parent) , m_gdbController(nullptr) #endif { + setWindowTitle(PROJECT_NAME); m_controller = new GameController(this); QGLFormat format(QGLFormat(QGL::Rgba | QGL::DoubleBuffer)); @@ -167,6 +168,9 @@ void Window::gameStarted(GBAThread* context) { foreach (QAction* action, m_gameActions) { action->setDisabled(false); } + char title[13] = { '\0' }; + GBAGetGameTitle(context->gba, title); + setWindowTitle(tr(PROJECT_NAME " - %1").arg(title)); attachWidget(m_display); m_screenWidget->setScaledContents(true); } @@ -175,6 +179,7 @@ void Window::gameStopped() { foreach (QAction* action, m_gameActions) { action->setDisabled(true); } + setWindowTitle(tr(PROJECT_NAME)); detachWidget(m_display); m_screenWidget->setScaledContents(false); redoLogo(); diff --git a/src/platform/qt/main.cpp b/src/platform/qt/main.cpp index 226d74fce..f536628d4 100644 --- a/src/platform/qt/main.cpp +++ b/src/platform/qt/main.cpp @@ -3,6 +3,8 @@ int main(int argc, char* argv[]) { QApplication application(argc, argv); + QApplication::setApplicationName(PROJECT_NAME); + QApplication::setApplicationVersion(PROJECT_VERSION); QGBA::Window window; window.show();