mirror of https://github.com/mgba-emu/mgba.git
Qt: Fix Apply button for key and controller configurations
This commit is contained in:
parent
b5c62da070
commit
c83833bfd4
1
CHANGES
1
CHANGES
|
@ -38,6 +38,7 @@ Bugfixes:
|
|||
- GB: Fix crash when masking savedata
|
||||
- GB Audio: Fix serialization of channel 3 and NR52 properties
|
||||
- GB: Properly initialize sramRealVf variable
|
||||
- Qt: Fix Apply button for key and controller configurations
|
||||
Misc:
|
||||
- SDL: Remove scancode key input
|
||||
- GBA Video: Clean up unused timers
|
||||
|
|
|
@ -32,6 +32,7 @@ public:
|
|||
|
||||
public slots:
|
||||
void setAll();
|
||||
void save();
|
||||
|
||||
protected:
|
||||
virtual void resizeEvent(QResizeEvent*) override;
|
||||
|
@ -42,7 +43,6 @@ protected:
|
|||
|
||||
private slots:
|
||||
void setNext();
|
||||
void save();
|
||||
void refresh();
|
||||
#ifdef BUILD_SDL
|
||||
void setAxisValue(int axis, int32_t value);
|
||||
|
|
|
@ -130,27 +130,33 @@ SettingsView::SettingsView(ConfigController* controller, InputController* inputC
|
|||
#endif
|
||||
|
||||
connect(m_ui.biosBrowse, SIGNAL(clicked()), this, SLOT(selectBios()));
|
||||
connect(m_ui.buttonBox, SIGNAL(accepted()), this, SLOT(updateConfig()));
|
||||
connect(m_ui.buttonBox, &QDialogButtonBox::clicked, [this](QAbstractButton* button) {
|
||||
if (m_ui.buttonBox->buttonRole(button) == QDialogButtonBox::ApplyRole) {
|
||||
updateConfig();
|
||||
}
|
||||
});
|
||||
|
||||
GBAKeyEditor* editor = new GBAKeyEditor(inputController, InputController::KEYBOARD, QString(), this);
|
||||
m_ui.stackedWidget->addWidget(editor);
|
||||
m_ui.tabs->addItem("Keyboard");
|
||||
connect(m_ui.buttonBox, SIGNAL(accepted()), editor, SLOT(save()));
|
||||
|
||||
GBAKeyEditor* buttonEditor = nullptr;
|
||||
#ifdef BUILD_SDL
|
||||
inputController->recalibrateAxes();
|
||||
const char* profile = inputController->profileForType(SDL_BINDING_BUTTON);
|
||||
editor = new GBAKeyEditor(inputController, SDL_BINDING_BUTTON, profile);
|
||||
m_ui.stackedWidget->addWidget(editor);
|
||||
buttonEditor = new GBAKeyEditor(inputController, SDL_BINDING_BUTTON, profile);
|
||||
m_ui.stackedWidget->addWidget(buttonEditor);
|
||||
m_ui.tabs->addItem("Controllers");
|
||||
connect(m_ui.buttonBox, SIGNAL(accepted()), editor, SLOT(save()));
|
||||
connect(m_ui.buttonBox, SIGNAL(accepted()), buttonEditor, SLOT(save()));
|
||||
#endif
|
||||
|
||||
connect(m_ui.buttonBox, SIGNAL(accepted()), this, SLOT(updateConfig()));
|
||||
connect(m_ui.buttonBox, &QDialogButtonBox::clicked, [this, editor, buttonEditor](QAbstractButton* button) {
|
||||
if (m_ui.buttonBox->buttonRole(button) == QDialogButtonBox::ApplyRole) {
|
||||
updateConfig();
|
||||
editor->save();
|
||||
if (buttonEditor) {
|
||||
buttonEditor->save();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
ShortcutView* shortcutView = new ShortcutView();
|
||||
shortcutView->setController(shortcutController);
|
||||
shortcutView->setInputController(inputController);
|
||||
|
|
Loading…
Reference in New Issue