merge doublemelon (#2067)

non-exhaustive (but exhausting) list of changes:

* base laid for multiple window support, but will likely require more work to work correctly
* encapsulation of frontend state for proper multi-instance support
* (JIT still needs a fix for the NDS::Current workaround but we can get there later)
* new, more flexible configuration system
This commit is contained in:
Arisotura
2024-06-15 13:52:47 +02:00
committed by GitHub
parent 8e9b88d01d
commit 25a7b1ca1d
111 changed files with 16802 additions and 5042 deletions

View File

@ -20,6 +20,7 @@
#include "types.h"
#include "Config.h"
#include "main.h"
#include "DateTimeDialog.h"
#include "ui_DateTimeDialog.h"
@ -32,8 +33,11 @@ DateTimeDialog::DateTimeDialog(QWidget* parent) : QDialog(parent), ui(new Ui::Da
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose);
emuInstance = ((MainWindow*)parent)->getEmuInstance();
auto& cfg = emuInstance->getLocalConfig();
QDateTime now = QDateTime::currentDateTime();
customTime = now.addSecs(Config::RTCOffset);
customTime = now.addSecs(cfg.GetInt64("RTC.Offset"));
ui->chkChangeTime->setChecked(false);
ui->chkResetTime->setChecked(false);
@ -59,13 +63,15 @@ void DateTimeDialog::done(int r)
{
if (r == QDialog::Accepted)
{
auto& cfg = emuInstance->getLocalConfig();
if (ui->chkChangeTime->isChecked())
{
QDateTime now = QDateTime::currentDateTime();
Config::RTCOffset = now.secsTo(ui->txtNewCustomTime->dateTime());
cfg.SetInt64("RTC.Offset", now.secsTo(ui->txtNewCustomTime->dateTime()));
}
else if (ui->chkResetTime->isChecked())
Config::RTCOffset = 0;
cfg.SetInt64("RTC.Offset", 0);
Config::Save();
}