mirror of
https://github.com/melonDS-emu/melonDS.git
synced 2025-07-27 00:00:07 -06:00
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:
@ -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();
|
||||
}
|
||||
|
Reference in New Issue
Block a user