* Fix files not appearing because of filter strings being wrong
* Implement settings save prompt
This commit is contained in:
@@ -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();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user