Qt: Close game inspector windows when game ends
Jeffrey Pfau jeffrey@endrift.com
Wed, 29 Apr 2015 21:09:32 -0700
3 files changed,
9 insertions(+),
0 deletions(-)
M
src/platform/qt/MemoryModel.cpp
→
src/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.cpp
→
src/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.cpp
→
src/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]);