mirror of https://github.com/mgba-emu/mgba.git
Merge branch 'master' (early part) into medusa
This commit is contained in:
commit
647513e276
|
@ -193,6 +193,7 @@ Window::Window(CoreManager* manager, ConfigController* config, int playerId, QWi
|
||||||
#ifdef M_CORE_DS
|
#ifdef M_CORE_DS
|
||||||
m_inputController.addPlatform(mPLATFORM_DS, &DSInputInfo);
|
m_inputController.addPlatform(mPLATFORM_DS, &DSInputInfo);
|
||||||
#endif
|
#endif
|
||||||
|
setupOptions();
|
||||||
}
|
}
|
||||||
|
|
||||||
Window::~Window() {
|
Window::~Window() {
|
||||||
|
@ -1469,20 +1470,6 @@ void Window::setupMenu(QMenuBar* menubar) {
|
||||||
m_platformActions.insert(mPLATFORM_GBA, frameRewind);
|
m_platformActions.insert(mPLATFORM_GBA, frameRewind);
|
||||||
m_platformActions.insert(mPLATFORM_GB, frameRewind);
|
m_platformActions.insert(mPLATFORM_GB, frameRewind);
|
||||||
|
|
||||||
ConfigOption* videoSync = m_config->addOption("videoSync");
|
|
||||||
videoSync->addBoolean(tr("Sync to &video"), &m_actions, "emu");
|
|
||||||
videoSync->connect([this](const QVariant&) {
|
|
||||||
reloadConfig();
|
|
||||||
}, this);
|
|
||||||
m_config->updateOption("videoSync");
|
|
||||||
|
|
||||||
ConfigOption* audioSync = m_config->addOption("audioSync");
|
|
||||||
audioSync->addBoolean(tr("Sync to &audio"), &m_actions, "emu");
|
|
||||||
audioSync->connect([this](const QVariant&) {
|
|
||||||
reloadConfig();
|
|
||||||
}, this);
|
|
||||||
m_config->updateOption("audioSync");
|
|
||||||
|
|
||||||
m_actions.addSeparator("emu");
|
m_actions.addSeparator("emu");
|
||||||
|
|
||||||
m_actions.addMenu(tr("Solar sensor"), "solar", "emu");
|
m_actions.addMenu(tr("Solar sensor"), "solar", "emu");
|
||||||
|
@ -1715,6 +1702,33 @@ void Window::setupMenu(QMenuBar* menubar) {
|
||||||
m_controller->endVideoLog();
|
m_controller->endVideoLog();
|
||||||
}, "tools");
|
}, "tools");
|
||||||
|
|
||||||
|
m_actions.addHiddenAction(tr("Exit fullscreen"), "exitFullScreen", this, &Window::exitFullScreen, "frame", QKeySequence("Esc"));
|
||||||
|
|
||||||
|
m_actions.addHeldAction(tr("GameShark Button (held)"), "holdGSButton", [this](bool held) {
|
||||||
|
if (m_controller) {
|
||||||
|
mCheatPressButton(m_controller->cheatDevice(), held);
|
||||||
|
}
|
||||||
|
}, "tools", QKeySequence(Qt::Key_Apostrophe));
|
||||||
|
|
||||||
|
for (Action* action : m_gameActions) {
|
||||||
|
action->setEnabled(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
m_shortcutController->rebuildItems();
|
||||||
|
m_actions.rebuildMenu(menuBar(), this, *m_shortcutController);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Window::setupOptions() {
|
||||||
|
ConfigOption* videoSync = m_config->addOption("videoSync");
|
||||||
|
videoSync->connect([this](const QVariant&) {
|
||||||
|
reloadConfig();
|
||||||
|
}, this);
|
||||||
|
|
||||||
|
ConfigOption* audioSync = m_config->addOption("audioSync");
|
||||||
|
audioSync->connect([this](const QVariant&) {
|
||||||
|
reloadConfig();
|
||||||
|
}, this);
|
||||||
|
|
||||||
ConfigOption* skipBios = m_config->addOption("skipBios");
|
ConfigOption* skipBios = m_config->addOption("skipBios");
|
||||||
skipBios->connect([this](const QVariant&) {
|
skipBios->connect([this](const QVariant&) {
|
||||||
reloadConfig();
|
reloadConfig();
|
||||||
|
@ -1824,21 +1838,6 @@ void Window::setupMenu(QMenuBar* menubar) {
|
||||||
dynamicTitle->connect([this](const QVariant&) {
|
dynamicTitle->connect([this](const QVariant&) {
|
||||||
updateTitle();
|
updateTitle();
|
||||||
}, this);
|
}, this);
|
||||||
|
|
||||||
m_actions.addHiddenAction(tr("Exit fullscreen"), "exitFullScreen", this, &Window::exitFullScreen, "frame", QKeySequence("Esc"));
|
|
||||||
|
|
||||||
m_actions.addHeldAction(tr("GameShark Button (held)"), "holdGSButton", [this](bool held) {
|
|
||||||
if (m_controller) {
|
|
||||||
mCheatPressButton(m_controller->cheatDevice(), held);
|
|
||||||
}
|
|
||||||
}, "tools", QKeySequence(Qt::Key_Apostrophe));
|
|
||||||
|
|
||||||
for (Action* action : m_gameActions) {
|
|
||||||
action->setEnabled(false);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_shortcutController->rebuildItems();
|
|
||||||
m_actions.rebuildMenu(menuBar(), this, *m_shortcutController);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Window::attachWidget(QWidget* widget) {
|
void Window::attachWidget(QWidget* widget) {
|
||||||
|
|
|
@ -157,6 +157,7 @@ private:
|
||||||
static const int MUST_RESTART_TIMEOUT = 10000;
|
static const int MUST_RESTART_TIMEOUT = 10000;
|
||||||
|
|
||||||
void setupMenu(QMenuBar*);
|
void setupMenu(QMenuBar*);
|
||||||
|
void setupOptions();
|
||||||
void openStateWindow(LoadSave);
|
void openStateWindow(LoadSave);
|
||||||
|
|
||||||
void attachWidget(QWidget* widget);
|
void attachWidget(QWidget* widget);
|
||||||
|
|
Loading…
Reference in New Issue