all repos — mgba @ 370bbd83baee3f823e1d4c8ac81534d9ed60874a

mGBA Game Boy Advance Emulator

Qt: Rename GamePakView to OverrideView
Jeffrey Pfau jeffrey@endrift.com
Thu, 29 Jan 2015 00:37:11 -0800
commit

370bbd83baee3f823e1d4c8ac81534d9ed60874a

parent

b9c7016c3012ea2484d9da796b52f9c2af7ac0aa

M src/platform/qt/CMakeLists.txtsrc/platform/qt/CMakeLists.txt

@@ -43,13 +43,13 @@ GBAApp.cpp

GBAKeyEditor.cpp GIFView.cpp GameController.cpp - GamePakView.cpp GamepadAxisEvent.cpp GamepadButtonEvent.cpp InputController.cpp KeyEditor.cpp LoadSaveState.cpp LogView.cpp + OverrideView.cpp SavestateButton.cpp SensorView.cpp SettingsView.cpp

@@ -61,9 +61,9 @@ VideoView.cpp)

qt5_wrap_ui(UI_FILES GIFView.ui - GamePakView.ui LoadSaveState.ui LogView.ui + OverrideView.ui SensorView.ui SettingsView.ui ShortcutView.ui
M src/platform/qt/GamePakView.cppsrc/platform/qt/OverrideView.cpp

@@ -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 * 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/. */ -#include "GamePakView.h" +#include "OverrideView.h" #include "ConfigController.h" #include "GameController.h"

@@ -14,7 +14,7 @@ }

using namespace QGBA; -GamePakView::GamePakView(GameController* controller, ConfigController* config, QWidget* parent) +OverrideView::OverrideView(GameController* controller, ConfigController* config, QWidget* parent) : QWidget(parent) , m_controller(controller) , m_config(config)

@@ -47,14 +47,14 @@ gameStarted(controller->thread());

} } -void GamePakView::saveOverride() { +void OverrideView::saveOverride() { if (!m_config) { return; } m_config->saveOverride(m_override); } -void GamePakView::updateOverrides() { +void OverrideView::updateOverrides() { m_override = (GBACartridgeOverride) { "", static_cast<SavedataType>(m_ui.savetype->currentIndex() - 1),

@@ -94,7 +94,7 @@ m_controller->clearOverride();

} } -void GamePakView::gameStarted(GBAThread* thread) { +void OverrideView::gameStarted(GBAThread* thread) { if (!thread->gba) { gameStopped(); return;

@@ -132,7 +132,7 @@

m_ui.save->setEnabled(m_config); } -void GamePakView::gameStopped() { +void OverrideView::gameStopped() { m_ui.savetype->setCurrentIndex(0); m_ui.savetype->setEnabled(true);
M src/platform/qt/GamePakView.hsrc/platform/qt/OverrideView.h

@@ -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 * 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/. */ -#ifndef QGBA_GAMEPAK_VIEW -#define QGBA_GAMEPAK_VIEW +#ifndef QGBA_OVERRIDE_VIEW +#define QGBA_OVERRIDE_VIEW #include <QWidget> -#include "ui_GamePakView.h" +#include "ui_OverrideView.h" extern "C" { #include "gba-overrides.h"

@@ -21,11 +21,11 @@

class ConfigController; class GameController; -class GamePakView : public QWidget { +class OverrideView : public QWidget { Q_OBJECT public: - GamePakView(GameController* controller, ConfigController* config, QWidget* parent = nullptr); + OverrideView(GameController* controller, ConfigController* config, QWidget* parent = nullptr); public slots: void saveOverride();

@@ -36,7 +36,7 @@ void gameStarted(GBAThread*);

void gameStopped(); private: - Ui::GamePakView m_ui; + Ui::OverrideView m_ui; GameController* m_controller; ConfigController* m_config;
M src/platform/qt/GamePakView.uisrc/platform/qt/OverrideView.ui

@@ -1,7 +1,7 @@

<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> - <class>GamePakView</class> - <widget class="QWidget" name="GamePakView"> + <class>OverrideView</class> + <widget class="QWidget" name="OverrideView"> <property name="geometry"> <rect> <x>0</x>
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -20,9 +20,9 @@ #include "GBAKeyEditor.h"

#include "GDBController.h" #include "GDBWindow.h" #include "GIFView.h" -#include "GamePakView.h" #include "LoadSaveState.h" #include "LogView.h" +#include "OverrideView.h" #include "SensorView.h" #include "SettingsView.h" #include "ShortcutController.h"

@@ -225,11 +225,11 @@ shortcutView->setAttribute(Qt::WA_DeleteOnClose);

shortcutView->show(); } -void Window::openGamePakWindow() { - GamePakView* gamePakWindow = new GamePakView(m_controller, m_config); - connect(this, SIGNAL(shutdown()), gamePakWindow, SLOT(close())); - gamePakWindow->setAttribute(Qt::WA_DeleteOnClose); - gamePakWindow->show(); +void Window::openOverrideWindow() { + OverrideView* overrideWindow = new OverrideView(m_controller, m_config); + connect(this, SIGNAL(shutdown()), overrideWindow, SLOT(close())); + overrideWindow->setAttribute(Qt::WA_DeleteOnClose); + overrideWindow->show(); } void Window::openSensorWindow() { SensorView* sensorWindow = new SensorView(m_controller);

@@ -675,13 +675,13 @@ QAction* viewLogs = new QAction(tr("View &logs..."), toolsMenu);

connect(viewLogs, SIGNAL(triggered()), m_logView, SLOT(show())); addControlledAction(toolsMenu, viewLogs, "viewLogs"); - QAction* gamePak = new QAction(tr("Game &Pak overrides..."), toolsMenu); - connect(gamePak, SIGNAL(triggered()), this, SLOT(openGamePakWindow())); - addControlledAction(toolsMenu, gamePak, "gamePakOverrides"); + QAction* overrides = new QAction(tr("Game &overrides..."), toolsMenu); + connect(overrides, SIGNAL(triggered()), this, SLOT(openOverrideWindow())); + addControlledAction(toolsMenu, overrides, "overrideWindow"); - QAction* gamePakSensors = new QAction(tr("Game &Pak sensors..."), toolsMenu); - connect(gamePakSensors, SIGNAL(triggered()), this, SLOT(openSensorWindow())); - addControlledAction(toolsMenu, gamePakSensors, "gamePakSensors"); + QAction* sensors = new QAction(tr("Game &Pak sensors..."), toolsMenu); + connect(sensors, SIGNAL(triggered()), this, SLOT(openSensorWindow())); + addControlledAction(toolsMenu, sensors, "sensorWindow"); #ifdef USE_GDB_STUB QAction* gdbWindow = new QAction(tr("Start &GDB server..."), toolsMenu);
M src/platform/qt/Window.hsrc/platform/qt/Window.h

@@ -67,7 +67,7 @@ void openKeymapWindow();

void openSettingsWindow(); void openShortcutWindow(); - void openGamePakWindow(); + void openOverrideWindow(); void openSensorWindow(); #ifdef BUILD_SDL