mirror of https://github.com/mgba-emu/mgba.git
Qt: Rename GamePakView to OverrideView
This commit is contained in:
parent
b9c7016c30
commit
370bbd83ba
|
@ -43,13 +43,13 @@ set(SOURCE_FILES
|
||||||
GBAKeyEditor.cpp
|
GBAKeyEditor.cpp
|
||||||
GIFView.cpp
|
GIFView.cpp
|
||||||
GameController.cpp
|
GameController.cpp
|
||||||
GamePakView.cpp
|
|
||||||
GamepadAxisEvent.cpp
|
GamepadAxisEvent.cpp
|
||||||
GamepadButtonEvent.cpp
|
GamepadButtonEvent.cpp
|
||||||
InputController.cpp
|
InputController.cpp
|
||||||
KeyEditor.cpp
|
KeyEditor.cpp
|
||||||
LoadSaveState.cpp
|
LoadSaveState.cpp
|
||||||
LogView.cpp
|
LogView.cpp
|
||||||
|
OverrideView.cpp
|
||||||
SavestateButton.cpp
|
SavestateButton.cpp
|
||||||
SensorView.cpp
|
SensorView.cpp
|
||||||
SettingsView.cpp
|
SettingsView.cpp
|
||||||
|
@ -61,9 +61,9 @@ set(SOURCE_FILES
|
||||||
|
|
||||||
qt5_wrap_ui(UI_FILES
|
qt5_wrap_ui(UI_FILES
|
||||||
GIFView.ui
|
GIFView.ui
|
||||||
GamePakView.ui
|
|
||||||
LoadSaveState.ui
|
LoadSaveState.ui
|
||||||
LogView.ui
|
LogView.ui
|
||||||
|
OverrideView.ui
|
||||||
SensorView.ui
|
SensorView.ui
|
||||||
SettingsView.ui
|
SettingsView.ui
|
||||||
ShortcutView.ui
|
ShortcutView.ui
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
/* Copyright (c) 2013-2014 Jeffrey Pfau
|
/* Copyright (c) 2013-2015 Jeffrey Pfau
|
||||||
*
|
*
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
#include "GamePakView.h"
|
#include "OverrideView.h"
|
||||||
|
|
||||||
#include "ConfigController.h"
|
#include "ConfigController.h"
|
||||||
#include "GameController.h"
|
#include "GameController.h"
|
||||||
|
@ -14,7 +14,7 @@ extern "C" {
|
||||||
|
|
||||||
using namespace QGBA;
|
using namespace QGBA;
|
||||||
|
|
||||||
GamePakView::GamePakView(GameController* controller, ConfigController* config, QWidget* parent)
|
OverrideView::OverrideView(GameController* controller, ConfigController* config, QWidget* parent)
|
||||||
: QWidget(parent)
|
: QWidget(parent)
|
||||||
, m_controller(controller)
|
, m_controller(controller)
|
||||||
, m_config(config)
|
, m_config(config)
|
||||||
|
@ -47,14 +47,14 @@ GamePakView::GamePakView(GameController* controller, ConfigController* config, Q
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GamePakView::saveOverride() {
|
void OverrideView::saveOverride() {
|
||||||
if (!m_config) {
|
if (!m_config) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
m_config->saveOverride(m_override);
|
m_config->saveOverride(m_override);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GamePakView::updateOverrides() {
|
void OverrideView::updateOverrides() {
|
||||||
m_override = (GBACartridgeOverride) {
|
m_override = (GBACartridgeOverride) {
|
||||||
"",
|
"",
|
||||||
static_cast<SavedataType>(m_ui.savetype->currentIndex() - 1),
|
static_cast<SavedataType>(m_ui.savetype->currentIndex() - 1),
|
||||||
|
@ -94,7 +94,7 @@ void GamePakView::updateOverrides() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void GamePakView::gameStarted(GBAThread* thread) {
|
void OverrideView::gameStarted(GBAThread* thread) {
|
||||||
if (!thread->gba) {
|
if (!thread->gba) {
|
||||||
gameStopped();
|
gameStopped();
|
||||||
return;
|
return;
|
||||||
|
@ -132,7 +132,7 @@ void GamePakView::gameStarted(GBAThread* thread) {
|
||||||
m_ui.save->setEnabled(m_config);
|
m_ui.save->setEnabled(m_config);
|
||||||
}
|
}
|
||||||
|
|
||||||
void GamePakView::gameStopped() {
|
void OverrideView::gameStopped() {
|
||||||
m_ui.savetype->setCurrentIndex(0);
|
m_ui.savetype->setCurrentIndex(0);
|
||||||
m_ui.savetype->setEnabled(true);
|
m_ui.savetype->setEnabled(true);
|
||||||
|
|
|
@ -1,14 +1,14 @@
|
||||||
/* Copyright (c) 2013-2014 Jeffrey Pfau
|
/* Copyright (c) 2013-2015 Jeffrey Pfau
|
||||||
*
|
*
|
||||||
* This Source Code Form is subject to the terms of the Mozilla Public
|
* This Source Code Form is subject to the terms of the Mozilla Public
|
||||||
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
* License, v. 2.0. If a copy of the MPL was not distributed with this
|
||||||
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
|
||||||
#ifndef QGBA_GAMEPAK_VIEW
|
#ifndef QGBA_OVERRIDE_VIEW
|
||||||
#define QGBA_GAMEPAK_VIEW
|
#define QGBA_OVERRIDE_VIEW
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
|
||||||
#include "ui_GamePakView.h"
|
#include "ui_OverrideView.h"
|
||||||
|
|
||||||
extern "C" {
|
extern "C" {
|
||||||
#include "gba-overrides.h"
|
#include "gba-overrides.h"
|
||||||
|
@ -21,11 +21,11 @@ namespace QGBA {
|
||||||
class ConfigController;
|
class ConfigController;
|
||||||
class GameController;
|
class GameController;
|
||||||
|
|
||||||
class GamePakView : public QWidget {
|
class OverrideView : public QWidget {
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
GamePakView(GameController* controller, ConfigController* config, QWidget* parent = nullptr);
|
OverrideView(GameController* controller, ConfigController* config, QWidget* parent = nullptr);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void saveOverride();
|
void saveOverride();
|
||||||
|
@ -36,7 +36,7 @@ private slots:
|
||||||
void gameStopped();
|
void gameStopped();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Ui::GamePakView m_ui;
|
Ui::OverrideView m_ui;
|
||||||
|
|
||||||
GameController* m_controller;
|
GameController* m_controller;
|
||||||
ConfigController* m_config;
|
ConfigController* m_config;
|
|
@ -1,7 +1,7 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>GamePakView</class>
|
<class>OverrideView</class>
|
||||||
<widget class="QWidget" name="GamePakView">
|
<widget class="QWidget" name="OverrideView">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
|
@ -20,9 +20,9 @@
|
||||||
#include "GDBController.h"
|
#include "GDBController.h"
|
||||||
#include "GDBWindow.h"
|
#include "GDBWindow.h"
|
||||||
#include "GIFView.h"
|
#include "GIFView.h"
|
||||||
#include "GamePakView.h"
|
|
||||||
#include "LoadSaveState.h"
|
#include "LoadSaveState.h"
|
||||||
#include "LogView.h"
|
#include "LogView.h"
|
||||||
|
#include "OverrideView.h"
|
||||||
#include "SensorView.h"
|
#include "SensorView.h"
|
||||||
#include "SettingsView.h"
|
#include "SettingsView.h"
|
||||||
#include "ShortcutController.h"
|
#include "ShortcutController.h"
|
||||||
|
@ -225,11 +225,11 @@ void Window::openShortcutWindow() {
|
||||||
shortcutView->show();
|
shortcutView->show();
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::openGamePakWindow() {
|
void Window::openOverrideWindow() {
|
||||||
GamePakView* gamePakWindow = new GamePakView(m_controller, m_config);
|
OverrideView* overrideWindow = new OverrideView(m_controller, m_config);
|
||||||
connect(this, SIGNAL(shutdown()), gamePakWindow, SLOT(close()));
|
connect(this, SIGNAL(shutdown()), overrideWindow, SLOT(close()));
|
||||||
gamePakWindow->setAttribute(Qt::WA_DeleteOnClose);
|
overrideWindow->setAttribute(Qt::WA_DeleteOnClose);
|
||||||
gamePakWindow->show();
|
overrideWindow->show();
|
||||||
}
|
}
|
||||||
void Window::openSensorWindow() {
|
void Window::openSensorWindow() {
|
||||||
SensorView* sensorWindow = new SensorView(m_controller);
|
SensorView* sensorWindow = new SensorView(m_controller);
|
||||||
|
@ -675,13 +675,13 @@ void Window::setupMenu(QMenuBar* menubar) {
|
||||||
connect(viewLogs, SIGNAL(triggered()), m_logView, SLOT(show()));
|
connect(viewLogs, SIGNAL(triggered()), m_logView, SLOT(show()));
|
||||||
addControlledAction(toolsMenu, viewLogs, "viewLogs");
|
addControlledAction(toolsMenu, viewLogs, "viewLogs");
|
||||||
|
|
||||||
QAction* gamePak = new QAction(tr("Game &Pak overrides..."), toolsMenu);
|
QAction* overrides = new QAction(tr("Game &overrides..."), toolsMenu);
|
||||||
connect(gamePak, SIGNAL(triggered()), this, SLOT(openGamePakWindow()));
|
connect(overrides, SIGNAL(triggered()), this, SLOT(openOverrideWindow()));
|
||||||
addControlledAction(toolsMenu, gamePak, "gamePakOverrides");
|
addControlledAction(toolsMenu, overrides, "overrideWindow");
|
||||||
|
|
||||||
QAction* gamePakSensors = new QAction(tr("Game &Pak sensors..."), toolsMenu);
|
QAction* sensors = new QAction(tr("Game &Pak sensors..."), toolsMenu);
|
||||||
connect(gamePakSensors, SIGNAL(triggered()), this, SLOT(openSensorWindow()));
|
connect(sensors, SIGNAL(triggered()), this, SLOT(openSensorWindow()));
|
||||||
addControlledAction(toolsMenu, gamePakSensors, "gamePakSensors");
|
addControlledAction(toolsMenu, sensors, "sensorWindow");
|
||||||
|
|
||||||
#ifdef USE_GDB_STUB
|
#ifdef USE_GDB_STUB
|
||||||
QAction* gdbWindow = new QAction(tr("Start &GDB server..."), toolsMenu);
|
QAction* gdbWindow = new QAction(tr("Start &GDB server..."), toolsMenu);
|
||||||
|
|
|
@ -67,7 +67,7 @@ public slots:
|
||||||
void openSettingsWindow();
|
void openSettingsWindow();
|
||||||
void openShortcutWindow();
|
void openShortcutWindow();
|
||||||
|
|
||||||
void openGamePakWindow();
|
void openOverrideWindow();
|
||||||
void openSensorWindow();
|
void openSensorWindow();
|
||||||
|
|
||||||
#ifdef BUILD_SDL
|
#ifdef BUILD_SDL
|
||||||
|
|
Loading…
Reference in New Issue