all repos — mgba @ a7ad78d46ec43258eacde85174f23f6f3f0ec2ea

mGBA Game Boy Advance Emulator

Qt: Close game inspector windows when game ends
Jeffrey Pfau jeffrey@endrift.com
Wed, 29 Apr 2015 21:09:32 -0700
commit

a7ad78d46ec43258eacde85174f23f6f3f0ec2ea

parent

a01f9921f56c00d6755f85aafccfc1a416664ed4

M src/platform/qt/MemoryModel.cppsrc/platform/qt/MemoryModel.cpp

@@ -21,6 +21,7 @@ using namespace QGBA;

MemoryModel::MemoryModel(QWidget* parent) : QAbstractScrollArea(parent) + , m_cpu(nullptr) , m_top(0) { m_font.setFamily("Source Code Pro");
M src/platform/qt/MemoryView.cppsrc/platform/qt/MemoryView.cpp

@@ -6,6 +6,8 @@ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

#include "MemoryView.h" +#include "GameController.h" + using namespace QGBA; MemoryView::MemoryView(GameController* controller, QWidget* parent)

@@ -15,4 +17,5 @@ {

m_ui.setupUi(this); m_ui.hexfield->setController(controller); + connect(controller, SIGNAL(gameStopped(GBAThread*)), this, SLOT(close())); }
M src/platform/qt/PaletteView.cppsrc/platform/qt/PaletteView.cpp

@@ -33,9 +33,14 @@ m_ui.b->setFont(font);

connect(m_ui.bgGrid, SIGNAL(indexPressed(int)), this, SLOT(selectIndex(int))); connect(m_ui.objGrid, &Swatch::indexPressed, [this] (int index) { selectIndex(index + 256); }); + + connect(controller, SIGNAL(gameStopped(GBAThread*)), this, SLOT(close())); } void PaletteView::updatePalette() { + if (!m_controller->thread() || !m_controller->thread()->gba) { + return; + } const uint16_t* palette = m_controller->thread()->gba->video.palette; for (int i = 0; i < 256; ++i) { m_ui.bgGrid->setColor(i, palette[i]);