mirror of
https://github.com/RetroDECK/Duckstation.git
synced 2024-11-30 09:35:40 +00:00
Qt: Simplify Rebind All behavior
This commit is contained in:
parent
fc0560087f
commit
fd4e41bc7d
|
@ -124,7 +124,7 @@ void ControllerSettingsWidget::createPortSettingsUi(int index, PortSettingsUI* u
|
||||||
QPushButton* clear_all_button = new QPushButton(tr("Clear All"), ui->widget);
|
QPushButton* clear_all_button = new QPushButton(tr("Clear All"), ui->widget);
|
||||||
clear_all_button->connect(clear_all_button, &QPushButton::clicked, [this, index]() {
|
clear_all_button->connect(clear_all_button, &QPushButton::clicked, [this, index]() {
|
||||||
if (QMessageBox::question(this, tr("Clear Bindings"),
|
if (QMessageBox::question(this, tr("Clear Bindings"),
|
||||||
tr("Are you sure you want to clear all bound controls? This cannot be reversed.")) !=
|
tr("Are you sure you want to clear all bound controls? This can not be reversed.")) !=
|
||||||
QMessageBox::Yes)
|
QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
|
@ -140,15 +140,19 @@ void ControllerSettingsWidget::createPortSettingsUi(int index, PortSettingsUI* u
|
||||||
|
|
||||||
QPushButton* rebind_all_button = new QPushButton(tr("Rebind All"), ui->widget);
|
QPushButton* rebind_all_button = new QPushButton(tr("Rebind All"), ui->widget);
|
||||||
rebind_all_button->connect(rebind_all_button, &QPushButton::clicked, [this, index]() {
|
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)
|
QMessageBox::Yes)
|
||||||
{
|
{
|
||||||
InputBindingWidget* widget = m_port_ui[index].first_button;
|
return;
|
||||||
while (widget)
|
}
|
||||||
{
|
|
||||||
widget->clearBinding();
|
InputBindingWidget* widget = m_port_ui[index].first_button;
|
||||||
widget = widget->getNextWidget();
|
while (widget)
|
||||||
}
|
{
|
||||||
|
widget->clearBinding();
|
||||||
|
widget = widget->getNextWidget();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_port_ui[index].first_button)
|
if (m_port_ui[index].first_button)
|
||||||
|
|
Loading…
Reference in a new issue