* Fix files not appearing because of filter strings being wrong

* Implement settings save prompt
This commit is contained in:
Cacodemon345
2021-12-20 00:30:42 +06:00
parent 61563bea57
commit da9b8f4b64
3 changed files with 34 additions and 4 deletions

View File

@@ -13,7 +13,14 @@
#include "qt_settingsotherremovable.hpp"
#include "qt_settingsotherperipherals.hpp"
extern "C"
{
#include <86box/86box.h>
}
#include <QDebug>
#include <QMessageBox>
#include <QCheckBox>
class SettingsModel : public QAbstractListModel {
public:
@@ -129,3 +136,23 @@ void Settings::save() {
otherRemovable->save();
otherPeripherals->save();
}
void Settings::accept()
{
if (confirm_save)
{
QMessageBox questionbox(QMessageBox::Icon::Question, "86Box", "Do you want to save the settings?\n\nThis will hard reset the emulated machine.", QMessageBox::Save | QMessageBox::Cancel, this);
QCheckBox *chkbox = new QCheckBox("Do not ask me again");
questionbox.setCheckBox(chkbox);
chkbox->setChecked(!confirm_save);
QObject::connect(chkbox, &QCheckBox::stateChanged, [](int state) {
confirm_save = (state == Qt::CheckState::Unchecked);
});
questionbox.exec();
if (questionbox.result() == QMessageBox::Cancel) {
confirm_save = true;
return;
}
}
QDialog::accept();
}