mirror of
https://github.com/86Box/86Box.git
synced 2026-02-27 17:34:25 -07:00
Hard reset dialog: Rely on clicked button instead of role.
This commit is contained in:
@@ -1218,8 +1218,8 @@ MainWindow::on_actionHard_Reset_triggered()
|
|||||||
if (confirm_reset) {
|
if (confirm_reset) {
|
||||||
QMessageBox questionbox(QMessageBox::Icon::Question, "86Box", tr("Are you sure you want to hard reset the emulated machine?"), QMessageBox::NoButton, this);
|
QMessageBox questionbox(QMessageBox::Icon::Question, "86Box", tr("Are you sure you want to hard reset the emulated machine?"), QMessageBox::NoButton, this);
|
||||||
questionbox.addButton(tr("Reset"), QMessageBox::AcceptRole);
|
questionbox.addButton(tr("Reset"), QMessageBox::AcceptRole);
|
||||||
questionbox.addButton(tr("Don't reset"), QMessageBox::RejectRole);
|
auto no_reset_button = questionbox.addButton(tr("Don't reset"), QMessageBox::RejectRole);
|
||||||
const auto chkbox = new QCheckBox(tr("Don't show this message again"));
|
const auto chkbox = new QCheckBox(tr("Don't show this message again"));
|
||||||
questionbox.setCheckBox(chkbox);
|
questionbox.setCheckBox(chkbox);
|
||||||
chkbox->setChecked(!confirm_reset);
|
chkbox->setChecked(!confirm_reset);
|
||||||
|
|
||||||
@@ -1227,7 +1227,7 @@ MainWindow::on_actionHard_Reset_triggered()
|
|||||||
confirm_reset = (state == Qt::CheckState::Unchecked);
|
confirm_reset = (state == Qt::CheckState::Unchecked);
|
||||||
});
|
});
|
||||||
questionbox.exec();
|
questionbox.exec();
|
||||||
if (questionbox.result() == QDialog::Accepted) {
|
if (questionbox.clickedButton() == no_reset_button) {
|
||||||
confirm_reset = true;
|
confirm_reset = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user