all repos — mgba @ c8d348880497cbb357f66f9a3c1c3a4e2cdb41cb

mGBA Game Boy Advance Emulator

src/platform/qt/CheatsView.cpp (view raw)

 1/* Copyright (c) 2013-2015 Jeffrey Pfau
 2 *
 3 * This Source Code Form is subject to the terms of the Mozilla Public
 4 * License, v. 2.0. If a copy of the MPL was not distributed with this
 5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 6#include "CheatsView.h"
 7
 8#include <QFileDialog>
 9
10using namespace QGBA;
11
12CheatsView::CheatsView(GBACheatDevice* device, QWidget* parent)
13	: QWidget(parent)
14	, m_model(device)
15{
16	m_ui.setupUi(this);
17
18	m_ui.cheatList->setModel(&m_model);
19
20	connect(m_ui.load, SIGNAL(clicked()), this, SLOT(load()));
21}
22
23void CheatsView::load() {
24	QString filename = QFileDialog::getOpenFileName(this, tr("Select cheats file"));
25	if (!filename.isEmpty()) {
26		m_model.loadFile(filename);
27	}
28}