Merge branch 'master' (early part) into medusa

This commit is contained in:
Vicki Pfau 2022-05-30 17:18:12 -07:00
commit 647513e276
2 changed files with 29 additions and 29 deletions

View File

@ -193,6 +193,7 @@ Window::Window(CoreManager* manager, ConfigController* config, int playerId, QWi
#ifdef M_CORE_DS
m_inputController.addPlatform(mPLATFORM_DS, &DSInputInfo);
#endif
setupOptions();
}
Window::~Window() {
@ -1469,20 +1470,6 @@ void Window::setupMenu(QMenuBar* menubar) {
m_platformActions.insert(mPLATFORM_GBA, 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.addMenu(tr("Solar sensor"), "solar", "emu");
@ -1715,6 +1702,33 @@ void Window::setupMenu(QMenuBar* menubar) {
m_controller->endVideoLog();
}, "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");
skipBios->connect([this](const QVariant&) {
reloadConfig();
@ -1824,21 +1838,6 @@ void Window::setupMenu(QMenuBar* menubar) {
dynamicTitle->connect([this](const QVariant&) {
updateTitle();
}, 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) {

View File

@ -157,6 +157,7 @@ private:
static const int MUST_RESTART_TIMEOUT = 10000;
void setupMenu(QMenuBar*);
void setupOptions();
void openStateWindow(LoadSave);
void attachWidget(QWidget* widget);