Qt: Make quick save/load and solar sensor shortcuts adjustable
Jeffrey Pfau jeffrey@endrift.com
Thu, 09 Apr 2015 23:04:04 -0700
2 files changed,
6 insertions(+),
4 deletions(-)
M
CHANGES
→
CHANGES
@@ -4,6 +4,7 @@ - Ability to hide individual background layers, or OBJs
- Ability to mute individual audio channels - Palette viewer - Volume control + - More shortcuts are editable (e.g. quick save/load, solar sensor) Bugfixes: - GBA: Fix timers not updating timing when writing to only the reload register - All: Fix sanitize-deb script not cleaning up after itself
M
src/platform/qt/Window.cpp
→
src/platform/qt/Window.cpp
@@ -580,21 +580,21 @@ addControlledAction(fileMenu, saveState, "saveState");
QMenu* quickLoadMenu = fileMenu->addMenu(tr("Quick load")); QMenu* quickSaveMenu = fileMenu->addMenu(tr("Quick save")); + m_shortcutController->addMenu(quickLoadMenu); + m_shortcutController->addMenu(quickSaveMenu); int i; for (i = 1; i < 10; ++i) { QAction* quickLoad = new QAction(tr("State &%1").arg(i), quickLoadMenu); quickLoad->setShortcut(tr("F%1").arg(i)); connect(quickLoad, &QAction::triggered, [this, i]() { m_controller->loadState(i); }); m_gameActions.append(quickLoad); - addAction(quickLoad); - quickLoadMenu->addAction(quickLoad); + addControlledAction(quickLoadMenu, quickLoad, QString("quickLoad.%1").arg(i)); QAction* quickSave = new QAction(tr("State &%1").arg(i), quickSaveMenu); quickSave->setShortcut(tr("Shift+F%1").arg(i)); connect(quickSave, &QAction::triggered, [this, i]() { m_controller->saveState(i); }); m_gameActions.append(quickSave); - addAction(quickSave); - quickSaveMenu->addAction(quickSave); + addControlledAction(quickSaveMenu, quickSave, QString("quickSave.%1").arg(i)); } fileMenu->addSeparator();@@ -687,6 +687,7 @@
emulationMenu->addSeparator(); QMenu* solarMenu = emulationMenu->addMenu(tr("Solar sensor")); + m_shortcutController->addMenu(solarMenu); QAction* solarIncrease = new QAction(tr("Increase solar level"), solarMenu); connect(solarIncrease, SIGNAL(triggered()), m_controller, SLOT(increaseLuminanceLevel())); addControlledAction(solarMenu, solarIncrease, "increaseLuminanceLevel");