mirror of
https://github.com/86Box/86Box.git
synced 2026-02-22 01:25:33 -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) {
|
||||
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("Don't reset"), QMessageBox::RejectRole);
|
||||
const auto chkbox = new QCheckBox(tr("Don't show this message again"));
|
||||
auto no_reset_button = questionbox.addButton(tr("Don't reset"), QMessageBox::RejectRole);
|
||||
const auto chkbox = new QCheckBox(tr("Don't show this message again"));
|
||||
questionbox.setCheckBox(chkbox);
|
||||
chkbox->setChecked(!confirm_reset);
|
||||
|
||||
@@ -1227,7 +1227,7 @@ MainWindow::on_actionHard_Reset_triggered()
|
||||
confirm_reset = (state == Qt::CheckState::Unchecked);
|
||||
});
|
||||
questionbox.exec();
|
||||
if (questionbox.result() == QDialog::Accepted) {
|
||||
if (questionbox.clickedButton() == no_reset_button) {
|
||||
confirm_reset = true;
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user