Qt: Simplify Rebind All behavior

This commit is contained in:
Albert Liu 2020-06-14 16:06:29 -07:00
parent fc0560087f
commit fd4e41bc7d

View file

@ -140,16 +140,20 @@ void ControllerSettingsWidget::createPortSettingsUi(int index, PortSettingsUI* u
QPushButton* rebind_all_button = new QPushButton(tr("Rebind All"), ui->widget);
rebind_all_button->connect(rebind_all_button, &QPushButton::clicked, [this, index]() {
if (QMessageBox::question(this, tr("Clear Bindings"), tr("Do you want to clear all currently-bound controls?")) ==
if (QMessageBox::question(this, tr("Rebind All"),
tr("Are you sure you want to rebind all controls? All currently-bound controls will be "
"irreversibly cleared. Rebinding will begin after confirmation.")) !=
QMessageBox::Yes)
{
return;
}
InputBindingWidget* widget = m_port_ui[index].first_button;
while (widget)
{
widget->clearBinding();
widget = widget->getNextWidget();
}
}
if (m_port_ui[index].first_button)
m_port_ui[index].first_button->beginRebindAll();