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:
@ -22,9 +22,10 @@
|
||||
#include "types.h"
|
||||
#include "Platform.h"
|
||||
#include "Config.h"
|
||||
#include "main.h"
|
||||
|
||||
#include "LAN_Socket.h"
|
||||
#include "LAN_PCap.h"
|
||||
#include "Net_Slirp.h"
|
||||
#include "Net_PCap.h"
|
||||
#include "Wifi.h"
|
||||
|
||||
#include "MPSettingsDialog.h"
|
||||
@ -33,21 +34,22 @@
|
||||
|
||||
MPSettingsDialog* MPSettingsDialog::currentDlg = nullptr;
|
||||
|
||||
extern bool RunningSomething;
|
||||
|
||||
|
||||
MPSettingsDialog::MPSettingsDialog(QWidget* parent) : QDialog(parent), ui(new Ui::MPSettingsDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setAttribute(Qt::WA_DeleteOnClose);
|
||||
|
||||
emuInstance = ((MainWindow*)parent)->getEmuInstance();
|
||||
|
||||
auto& cfg = emuInstance->getGlobalConfig();
|
||||
grpAudioMode = new QButtonGroup(this);
|
||||
grpAudioMode->addButton(ui->rbAudioAll, 0);
|
||||
grpAudioMode->addButton(ui->rbAudioOneOnly, 1);
|
||||
grpAudioMode->addButton(ui->rbAudioActiveOnly, 2);
|
||||
grpAudioMode->button(Config::MPAudioMode)->setChecked(true);
|
||||
grpAudioMode->button(cfg.GetInt("MP.AudioMode"))->setChecked(true);
|
||||
|
||||
ui->sbReceiveTimeout->setValue(Config::MPRecvTimeout);
|
||||
ui->sbReceiveTimeout->setValue(cfg.GetInt("MP.RecvTimeout"));
|
||||
}
|
||||
|
||||
MPSettingsDialog::~MPSettingsDialog()
|
||||
@ -59,8 +61,9 @@ void MPSettingsDialog::done(int r)
|
||||
{
|
||||
if (r == QDialog::Accepted)
|
||||
{
|
||||
Config::MPAudioMode = grpAudioMode->checkedId();
|
||||
Config::MPRecvTimeout = ui->sbReceiveTimeout->value();
|
||||
auto& cfg = emuInstance->getGlobalConfig();
|
||||
cfg.SetInt("MP.AudioMode", grpAudioMode->checkedId());
|
||||
cfg.SetInt("MP.RecvTimeout", ui->sbReceiveTimeout->value());
|
||||
|
||||
Config::Save();
|
||||
}
|
||||
@ -69,5 +72,3 @@ void MPSettingsDialog::done(int r)
|
||||
|
||||
closeDlg();
|
||||
}
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user