work some on the UI... make it not labelled Fart

This commit is contained in:
Arisotura 2022-09-15 23:39:30 +02:00
parent 5ebc63c713
commit 3192b9621f
5 changed files with 76 additions and 41 deletions

View File

@ -281,9 +281,9 @@ ConfigEntry ConfigFile[] =
{"AudioInterp", 0, &AudioInterp, 0, false},
{"AudioBitrate", 0, &AudioBitrate, 0, false},
{"AudioVolume", 0, &AudioVolume, 256, false},
{"MicInputType", 0, &MicInputType, 1, false},
{"MicWavPath", 2, &MicWavPath, (std::string)"", false},
{"AudioVolume", 0, &AudioVolume, 256, true},
{"MicInputType", 0, &MicInputType, 1, true},
{"MicWavPath", 2, &MicWavPath, (std::string)"", true},
{"LastROMFolder", 2, &LastROMFolder, (std::string)"", true},
@ -308,9 +308,9 @@ ConfigEntry ConfigFile[] =
{"MouseHideSeconds", 0, &MouseHideSeconds, 5, false},
{"PauseLostFocus", 1, &PauseLostFocus, false, false},
{"DSBatteryLevelOkay", 1, &DSBatteryLevelOkay, true, false},
{"DSiBatteryLevel", 0, &DSiBatteryLevel, 0xF, false},
{"DSiBatteryCharging", 1, &DSiBatteryCharging, true, false},
{"DSBatteryLevelOkay", 1, &DSBatteryLevelOkay, true, true},
{"DSiBatteryLevel", 0, &DSiBatteryLevel, 0xF, true},
{"DSiBatteryCharging", 1, &DSiBatteryCharging, true, true},
{"", -1, nullptr, 0, false}
};
@ -322,7 +322,7 @@ void LoadFile(int inst)
if (inst > 0)
{
char name[100] = {0};
snprintf(name, 99, kUniqueConfigFile, inst);
snprintf(name, 99, kUniqueConfigFile, inst+1);
f = Platform::OpenLocalFile(name, "r");
}
else
@ -392,7 +392,7 @@ void Save()
if (inst > 0)
{
char name[100] = {0};
snprintf(name, 99, kUniqueConfigFile, inst);
snprintf(name, 99, kUniqueConfigFile, inst+1);
f = Platform::OpenLocalFile(name, "w");
}
else

View File

@ -19,6 +19,7 @@
#include <QMessageBox>
#include "Config.h"
#include "Platform.h"
#include "FirmwareSettingsDialog.h"
#include "ui_FirmwareSettingsDialog.h"
@ -66,6 +67,12 @@ FirmwareSettingsDialog::FirmwareSettingsDialog(QWidget* parent) : QDialog(parent
ui->txtMAC->setText(QString::fromStdString(Config::FirmwareMAC));
on_overrideFirmwareBox_toggled();
int inst = Platform::InstanceID();
if (inst > 0)
ui->lblInstanceNum->setText(QString("Configuring settings for instance %1").arg(inst+1));
else
ui->lblInstanceNum->hide();
}
FirmwareSettingsDialog::~FirmwareSettingsDialog()

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>511</width>
<height>338</height>
<height>357</height>
</rect>
</property>
<property name="sizePolicy">
@ -23,6 +23,13 @@
<property name="sizeConstraint">
<enum>QLayout::SetFixedSize</enum>
</property>
<item>
<widget class="QLabel" name="lblInstanceNum">
<property name="text">
<string>Configuring settings for instance X</string>
</property>
</widget>
</item>
<item>
<widget class="QGroupBox" name="grpGeneral">
<property name="title">

View File

@ -1340,6 +1340,8 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
setAttribute(Qt::WA_DeleteOnClose);
setAcceptDrops(true);
int inst = Platform::InstanceID();
QMenuBar* menubar = new QMenuBar();
{
QMenu* menu = menubar->addMenu("File");
@ -1471,55 +1473,70 @@ MainWindow::MainWindow(QWidget* parent) : QMainWindow(parent)
actEnableCheats->setCheckable(true);
connect(actEnableCheats, &QAction::triggered, this, &MainWindow::onEnableCheats);
actSetupCheats = menu->addAction("Setup cheat codes");
actSetupCheats->setMenuRole(QAction::NoRole);
connect(actSetupCheats, &QAction::triggered, this, &MainWindow::onSetupCheats);
//if (inst == 0)
{
actSetupCheats = menu->addAction("Setup cheat codes");
actSetupCheats->setMenuRole(QAction::NoRole);
connect(actSetupCheats, &QAction::triggered, this, &MainWindow::onSetupCheats);
menu->addSeparator();
actROMInfo = menu->addAction("ROM info");
connect(actROMInfo, &QAction::triggered, this, &MainWindow::onROMInfo);
menu->addSeparator();
actROMInfo = menu->addAction("ROM info");
connect(actROMInfo, &QAction::triggered, this, &MainWindow::onROMInfo);
actRAMInfo = menu->addAction("RAM search");
connect(actRAMInfo, &QAction::triggered, this, &MainWindow::onRAMInfo);
actRAMInfo = menu->addAction("RAM search");
connect(actRAMInfo, &QAction::triggered, this, &MainWindow::onRAMInfo);
actTitleManager = menu->addAction("Manage DSi titles");
connect(actTitleManager, &QAction::triggered, this, &MainWindow::onOpenTitleManager);
actTitleManager = menu->addAction("Manage DSi titles");
connect(actTitleManager, &QAction::triggered, this, &MainWindow::onOpenTitleManager);
}
// TEST!!
menu->addSeparator();
actTest = menu->addAction("Fart");
connect(actTest, &QAction::triggered, this, &MainWindow::onTest);
{
menu->addSeparator();
QMenu* submenu = menu->addMenu("Multiplayer");
actMPNewInstance = submenu->addAction("Launch new instance");
connect(actMPNewInstance, &QAction::triggered, this, &MainWindow::onMPNewInstance);
}
}
{
QMenu* menu = menubar->addMenu("Config");
actEmuSettings = menu->addAction("Emu settings");
connect(actEmuSettings, &QAction::triggered, this, &MainWindow::onOpenEmuSettings);
//if (inst == 0)
{
actEmuSettings = menu->addAction("Emu settings");
connect(actEmuSettings, &QAction::triggered, this, &MainWindow::onOpenEmuSettings);
#ifdef __APPLE__
QAction* actPreferences = menu->addAction("Preferences...");
connect(actPreferences, &QAction::triggered, this, &MainWindow::onOpenEmuSettings);
actPreferences->setMenuRole(QAction::PreferencesRole);
QAction* actPreferences = menu->addAction("Preferences...");
connect(actPreferences, &QAction::triggered, this, &MainWindow::onOpenEmuSettings);
actPreferences->setMenuRole(QAction::PreferencesRole);
#endif
}
actInputConfig = menu->addAction("Input and hotkeys");
connect(actInputConfig, &QAction::triggered, this, &MainWindow::onOpenInputConfig);
actVideoSettings = menu->addAction("Video settings");
connect(actVideoSettings, &QAction::triggered, this, &MainWindow::onOpenVideoSettings);
//if (inst == 0)
{
actVideoSettings = menu->addAction("Video settings");
connect(actVideoSettings, &QAction::triggered, this, &MainWindow::onOpenVideoSettings);
}
actAudioSettings = menu->addAction("Audio settings");
connect(actAudioSettings, &QAction::triggered, this, &MainWindow::onOpenAudioSettings);
actWifiSettings = menu->addAction("Wifi settings");
connect(actWifiSettings, &QAction::triggered, this, &MainWindow::onOpenWifiSettings);
actInterfaceSettings = menu->addAction("Interface settings");
connect(actInterfaceSettings, &QAction::triggered, this, &MainWindow::onOpenInterfaceSettings);
//if (inst == 0)
{
actWifiSettings = menu->addAction("Wifi settings");
connect(actWifiSettings, &QAction::triggered, this, &MainWindow::onOpenWifiSettings);
}
actFirmwareSettings = menu->addAction("Firmware settings");
connect(actFirmwareSettings, &QAction::triggered, this, &MainWindow::onOpenFirmwareSettings);
actInterfaceSettings = menu->addAction("Interface settings");
connect(actInterfaceSettings, &QAction::triggered, this, &MainWindow::onOpenInterfaceSettings);
actPathSettings = menu->addAction("Path settings");
connect(actPathSettings, &QAction::triggered, this, &MainWindow::onOpenPathSettings);
@ -2616,17 +2633,21 @@ void MainWindow::onOpenTitleManager()
TitleManagerDialog* dlg = TitleManagerDialog::openDlg(this);
}
void MainWindow::onTest()
void MainWindow::onMPNewInstance()
{
//QProcess::startDetached(QApplication::applicationFilePath());
QProcess ass;
QProcess newinst;
newinst.setProgram(QApplication::applicationFilePath());
newinst.setArguments(QApplication::arguments().mid(1, QApplication::arguments().length()-1));
#ifdef __WIN32__
ass.setCreateProcessArgumentsModifier([] (QProcess::CreateProcessArguments *args)
newinst.setCreateProcessArgumentsModifier([] (QProcess::CreateProcessArguments *args)
{
args->flags |= CREATE_NEW_CONSOLE;
});
#endif
ass.startDetached(QApplication::applicationFilePath());
newinst.startDetached();
}
void MainWindow::onOpenEmuSettings()

View File

@ -255,7 +255,7 @@ private slots:
void onROMInfo();
void onRAMInfo();
void onOpenTitleManager();
void onTest();
void onMPNewInstance();
void onOpenEmuSettings();
void onEmuSettingsDialogFinished(int res);
@ -345,7 +345,7 @@ public:
QAction* actROMInfo;
QAction* actRAMInfo;
QAction* actTitleManager;
QAction* actTest;
QAction* actMPNewInstance;
QAction* actEmuSettings;
QAction* actPowerManagement;