all repos — mgba @ ad12bdde9d34ecd477b33e02d02d8d41c115b817

mGBA Game Boy Advance Emulator

Move savestates to file menu
Jeffrey Pfau jeffrey@endrift.com
Sun, 19 Oct 2014 00:39:24 -0700
commit

ad12bdde9d34ecd477b33e02d02d8d41c115b817

parent

e7bf4388a404ab292865e77e6bac0bba6037f511

1 files changed, 31 insertions(+), 31 deletions(-)

jump to
M src/platform/qt/Window.cppsrc/platform/qt/Window.cpp

@@ -252,48 +252,23 @@ menubar->clear();

QMenu* fileMenu = menubar->addMenu(tr("&File")); fileMenu->addAction(tr("Load &ROM..."), this, SLOT(selectROM()), QKeySequence::Open); fileMenu->addAction(tr("Load &BIOS..."), this, SLOT(selectBIOS())); - fileMenu->addSeparator(); -#ifdef USE_PNG - QAction* screenshot = new QAction(tr("Take &screenshot"), fileMenu); - screenshot->setShortcut(tr("F12")); - connect(screenshot, SIGNAL(triggered()), m_display, SLOT(screenshot())); - m_gameActions.append(screenshot); - fileMenu->addAction(screenshot); -#endif - -#ifndef Q_OS_MAC fileMenu->addSeparator(); - fileMenu->addAction(tr("E&xit"), this, SLOT(close()), QKeySequence::Quit); -#endif - QMenu* emulationMenu = menubar->addMenu(tr("&Emulation")); - QAction* reset = new QAction(tr("&Reset"), emulationMenu); - reset->setShortcut(tr("Ctrl+R")); - connect(reset, SIGNAL(triggered()), m_controller, SLOT(reset())); - m_gameActions.append(reset); - emulationMenu->addAction(reset); - - QAction* shutdown = new QAction(tr("Sh&utdown"), emulationMenu); - connect(shutdown, SIGNAL(triggered()), m_controller, SLOT(closeGame())); - m_gameActions.append(shutdown); - emulationMenu->addAction(shutdown); - emulationMenu->addSeparator(); - - QAction* loadState = new QAction(tr("&Load state"), emulationMenu); + QAction* loadState = new QAction(tr("&Load state"), fileMenu); loadState->setShortcut(tr("Ctrl+L")); connect(loadState, &QAction::triggered, [this]() { this->openStateWindow(LoadSave::LOAD); }); m_gameActions.append(loadState); - emulationMenu->addAction(loadState); + fileMenu->addAction(loadState); - QAction* saveState = new QAction(tr("&Save state"), emulationMenu); + QAction* saveState = new QAction(tr("&Save state"), fileMenu); saveState->setShortcut(tr("Ctrl+S")); connect(saveState, &QAction::triggered, [this]() { this->openStateWindow(LoadSave::SAVE); }); m_gameActions.append(saveState); - emulationMenu->addAction(saveState); + fileMenu->addAction(saveState); - QMenu* quickLoadMenu = emulationMenu->addMenu(tr("Quick load")); - QMenu* quickSaveMenu = emulationMenu->addMenu(tr("Quick save")); + QMenu* quickLoadMenu = fileMenu->addMenu(tr("Quick load")); + QMenu* quickSaveMenu = fileMenu->addMenu(tr("Quick save")); int i; for (i = 1; i < 10; ++i) { QAction* quickLoad = new QAction(tr("State &%1").arg(i), quickLoadMenu);

@@ -309,6 +284,31 @@ m_gameActions.append(quickSave);

quickSaveMenu->addAction(quickSave); } +#ifdef USE_PNG + fileMenu->addSeparator(); + QAction* screenshot = new QAction(tr("Take &screenshot"), fileMenu); + screenshot->setShortcut(tr("F12")); + connect(screenshot, SIGNAL(triggered()), m_display, SLOT(screenshot())); + m_gameActions.append(screenshot); + fileMenu->addAction(screenshot); +#endif + +#ifndef Q_OS_MAC + fileMenu->addSeparator(); + fileMenu->addAction(tr("E&xit"), this, SLOT(close()), QKeySequence::Quit); +#endif + + QMenu* emulationMenu = menubar->addMenu(tr("&Emulation")); + QAction* reset = new QAction(tr("&Reset"), emulationMenu); + reset->setShortcut(tr("Ctrl+R")); + connect(reset, SIGNAL(triggered()), m_controller, SLOT(reset())); + m_gameActions.append(reset); + emulationMenu->addAction(reset); + + QAction* shutdown = new QAction(tr("Sh&utdown"), emulationMenu); + connect(shutdown, SIGNAL(triggered()), m_controller, SLOT(closeGame())); + m_gameActions.append(shutdown); + emulationMenu->addAction(shutdown); emulationMenu->addSeparator(); QAction* pause = new QAction(tr("&Pause"), emulationMenu);