DolphinQt: Make the mapping window clear button use ControllerEmu's clear functionality.

This commit is contained in:
Jordan Woyak
2019-02-06 17:40:58 -06:00
parent 46918f420d
commit 64c3c52ef3
10 changed files with 12 additions and 44 deletions

View File

@ -143,7 +143,7 @@ void MappingWindow::ConnectWidgets()
connect(m_devices_refresh, &QPushButton::clicked, this, &MappingWindow::RefreshDevices);
connect(m_devices_combo, static_cast<void (QComboBox::*)(int)>(&QComboBox::currentIndexChanged),
this, &MappingWindow::OnDeviceChanged);
connect(m_reset_clear, &QPushButton::clicked, this, [this] { emit ClearFields(); });
connect(m_reset_clear, &QPushButton::clicked, this, &MappingWindow::OnClearFieldsPressed);
connect(m_reset_default, &QPushButton::clicked, this, &MappingWindow::OnDefaultFieldsPressed);
connect(m_profiles_save, &QPushButton::clicked, this, &MappingWindow::OnSaveProfilePressed);
connect(m_profiles_load, &QPushButton::clicked, this, &MappingWindow::OnLoadProfilePressed);
@ -380,6 +380,16 @@ void MappingWindow::OnDefaultFieldsPressed()
emit Save();
}
void MappingWindow::OnClearFieldsPressed()
{
// Loading an empty inifile section clears everything.
IniFile::Section sec;
m_controller->LoadConfig(&sec);
m_controller->UpdateReferences(g_controller_interface);
emit Update();
emit Save();
}
bool MappingWindow::IsIterativeInput() const
{
return m_iterative_input->isChecked();