From cd7d967b0ac3b8d338ab03aab3a0ea75b8435a95 Mon Sep 17 00:00:00 2001 From: SimoneN64 Date: Fri, 21 Jun 2024 21:39:49 +0200 Subject: [PATCH] just some touches to the gui --- src/backend/Core.cpp | 3 +++ src/frontend/KaizenQt.cpp | 4 ++++ src/frontend/mainwindow.ui | 2 +- 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/backend/Core.cpp b/src/backend/Core.cpp index a3834919..db1969f1 100644 --- a/src/backend/Core.cpp +++ b/src/backend/Core.cpp @@ -31,6 +31,9 @@ void Core::LoadROM(const std::string& rom_) { cpu->GetMem().LoadROM(isArchive, rom); GameDB::match(cpu->GetMem()); + if(cpu->GetMem().rom.gameNameDB.empty()) { + cpu->GetMem().rom.gameNameDB = fs::path(rom).stem(); + } cpu->GetMem().mmio.vi.isPal = cpu->GetMem().IsROMPAL(); cpu->GetMem().mmio.si.pif.InitDevices(cpu->GetMem().saveType); cpu->GetMem().mmio.si.pif.mempakPath = rom; diff --git a/src/frontend/KaizenQt.cpp b/src/frontend/KaizenQt.cpp index c6803404..e3de7e1e 100644 --- a/src/frontend/KaizenQt.cpp +++ b/src/frontend/KaizenQt.cpp @@ -38,6 +38,9 @@ void KaizenQt::ConnectMainWindowSignalsToSlots() noexcept { }); connect(mainWindow.get(), &MainWindowController::Reset, emuThread.get(), &EmuThread::Reset); connect(mainWindow.get(), &MainWindowController::Stop, emuThread.get(), &EmuThread::Stop); + connect(mainWindow.get(), &MainWindowController::Stop, this, [this]() { + mainWindow->setWindowTitle("Kaizen"); + }); connect(mainWindow.get(), &MainWindowController::Pause, emuThread.get(), &EmuThread::TogglePause); } @@ -55,6 +58,7 @@ void KaizenQt::dropEvent(QDropEvent* event) { void KaizenQt::LoadROM(const QString& fileName) noexcept { emuThread->start(); emuThread->core.LoadROM(fileName.toStdString()); + mainWindow->setWindowTitle(emuThread->core.cpu->GetMem().rom.gameNameDB.c_str()); } void KaizenQt::closeEvent(QCloseEvent*) { diff --git a/src/frontend/mainwindow.ui b/src/frontend/mainwindow.ui index 9dda72b4..c1ad4475 100644 --- a/src/frontend/mainwindow.ui +++ b/src/frontend/mainwindow.ui @@ -7,7 +7,7 @@ 0 0 800 - 600 + 646