Use nicer settings names.
These are visible on the SDL command line, so they need to be self-documenting.
This commit is contained in:
1 parent
d1bab5b589
commit
971db920e3
4 files changed
+25
-19
No files matched your search
@@ -27,6 +27,7 @@ ReflectableEnum(Display,
|
||||
|
||||
namespace Options {
|
||||
|
||||
static constexpr auto DisplayOptionName = "display";
|
||||
template <typename Owner> class Display {
|
||||
public:
|
||||
Configurable::Display output;
|
||||
@@ -34,11 +35,12 @@ public:
|
||||
|
||||
protected:
|
||||
void declare_display_option() {
|
||||
static_cast<Owner *>(this)->declare(&output, "output");
|
||||
static_cast<Owner *>(this)->declare(&output, DisplayOptionName);
|
||||
AnnounceEnumNS(Configurable, Display);
|
||||
}
|
||||
};
|
||||
|
||||
static constexpr auto QuickLoadOptionName = "accelerate_media_loading";
|
||||
template <typename Owner> class QuickLoad {
|
||||
public:
|
||||
bool quick_load;
|
||||
@@ -46,10 +48,11 @@ public:
|
||||
|
||||
protected:
|
||||
void declare_quickload_option() {
|
||||
static_cast<Owner *>(this)->declare(&quick_load, "quickload");
|
||||
static_cast<Owner *>(this)->declare(&quick_load, QuickLoadOptionName);
|
||||
}
|
||||
};
|
||||
|
||||
static constexpr auto QuickBootOptionName = "shorten_machine_startup";
|
||||
template <typename Owner> class QuickBoot {
|
||||
public:
|
||||
bool quick_boot;
|
||||
@@ -57,10 +60,11 @@ public:
|
||||
|
||||
protected:
|
||||
void declare_quickboot_option() {
|
||||
static_cast<Owner *>(this)->declare(&quick_boot, "quickboot");
|
||||
static_cast<Owner *>(this)->declare(&quick_boot, QuickBootOptionName);
|
||||
}
|
||||
};
|
||||
|
||||
static constexpr auto DynamicCropOptionName = "select_visible_area_dynamically";
|
||||
template <typename Owner> class DynamicCrop {
|
||||
public:
|
||||
bool dynamic_crop;
|
||||
@@ -68,7 +72,7 @@ public:
|
||||
|
||||
protected:
|
||||
void declare_dynamic_crop_option() {
|
||||
static_cast<Owner *>(this)->declare(&dynamic_crop, "dynamiccrop");
|
||||
static_cast<Owner *>(this)->declare(&dynamic_crop, DynamicCropOptionName);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+3
-3
@@ -58,7 +58,7 @@
|
||||
</CommandLineArgument>
|
||||
<CommandLineArgument
|
||||
argument = ""/Users/thomasharte/Library/Mobile\ Documents/com\~apple\~CloudDocs/Soft/Archimedes/Lemmings.adf""
|
||||
isEnabled = "YES">
|
||||
isEnabled = "NO">
|
||||
</CommandLineArgument>
|
||||
<CommandLineArgument
|
||||
argument = "--new=archimedes"
|
||||
@@ -70,11 +70,11 @@
|
||||
</CommandLineArgument>
|
||||
<CommandLineArgument
|
||||
argument = "--rompath=/Users/thomasharte/Projects/CLK/ROMImages"
|
||||
isEnabled = "YES">
|
||||
isEnabled = "NO">
|
||||
</CommandLineArgument>
|
||||
<CommandLineArgument
|
||||
argument = "--help"
|
||||
isEnabled = "NO">
|
||||
isEnabled = "YES">
|
||||
</CommandLineArgument>
|
||||
</CommandLineArguments>
|
||||
</LaunchAction>
|
||||
|
||||
@@ -590,7 +590,7 @@ struct ActivityObserver: public Activity::Observer {
|
||||
_useFastLoadingHack = useFastLoadingHack;
|
||||
|
||||
auto options = configurable_device->get_options();
|
||||
Reflection::set(*options, "quickload", useFastLoadingHack ? true : false);
|
||||
Reflection::set(*options, Configurable::Options::QuickLoadOptionName, useFastLoadingHack ? true : false);
|
||||
configurable_device->set_options(options);
|
||||
}
|
||||
}
|
||||
@@ -611,7 +611,7 @@ struct ActivityObserver: public Activity::Observer {
|
||||
}
|
||||
|
||||
auto options = configurable_device->get_options();
|
||||
Reflection::set(*options, "output", int(display));
|
||||
Reflection::set(*options, Configurable::Options::DisplayOptionName, int(display));
|
||||
configurable_device->set_options(options);
|
||||
}
|
||||
}
|
||||
@@ -651,6 +651,7 @@ struct ActivityObserver: public Activity::Observer {
|
||||
_useAutomaticTapeMotorControl = useAutomaticTapeMotorControl;
|
||||
|
||||
auto options = configurable_device->get_options();
|
||||
// TODO: get name.
|
||||
Reflection::set(*options, "automatic_tape_motor_control", useAutomaticTapeMotorControl ? true : false);
|
||||
configurable_device->set_options(options);
|
||||
}
|
||||
@@ -664,7 +665,7 @@ struct ActivityObserver: public Activity::Observer {
|
||||
_useQuickBootingHack = useQuickBootingHack;
|
||||
|
||||
auto options = configurable_device->get_options();
|
||||
Reflection::set(*options, "quickboot", useQuickBootingHack ? true : false);
|
||||
Reflection::set(*options, Configurable::Options::QuickBootOptionName, useQuickBootingHack ? true : false);
|
||||
configurable_device->set_options(options);
|
||||
}
|
||||
}
|
||||
@@ -677,7 +678,7 @@ struct ActivityObserver: public Activity::Observer {
|
||||
_useDynamicCropping = useDynamicCropping;
|
||||
|
||||
auto options = configurable_device->get_options();
|
||||
Reflection::set(*options, "dynamiccrop", useDynamicCropping ? true : false);
|
||||
Reflection::set(*options, Configurable::Options::DynamicCropOptionName, useDynamicCropping ? true : false);
|
||||
configurable_device->set_options(options);
|
||||
}
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
#include <cstdio>
|
||||
|
||||
#include "../../Numeric/CRC.hpp"
|
||||
#include "../../Configurable/StandardOptions.hpp"
|
||||
|
||||
namespace {
|
||||
|
||||
@@ -529,7 +530,7 @@ void MainWindow::addDisplayMenu(const std::string &machinePrefix, const std::str
|
||||
|
||||
// Get the machine's default setting.
|
||||
auto options = machine->configurable_device()->get_options();
|
||||
auto defaultDisplay = Reflection::get<Configurable::Display>(*options, "output");
|
||||
auto defaultDisplay = Reflection::get<Configurable::Display>(*options, Configurable::Options::DisplayOptionName);
|
||||
|
||||
// Check whether there's an alternative selection in the user settings. If so, apply it.
|
||||
Settings settings;
|
||||
@@ -538,7 +539,7 @@ void MainWindow::addDisplayMenu(const std::string &machinePrefix, const std::str
|
||||
auto userSelectedDisplay = Configurable::Display(settings.value(settingName).toInt());
|
||||
if(userSelectedDisplay != defaultDisplay) {
|
||||
defaultDisplay = userSelectedDisplay;
|
||||
Reflection::set(*options, "output", int(userSelectedDisplay));
|
||||
Reflection::set(*options, Configurable::Options::DisplayOptionName, int(userSelectedDisplay));
|
||||
machine->configurable_device()->set_options(options);
|
||||
}
|
||||
}
|
||||
@@ -568,7 +569,7 @@ void MainWindow::addDisplayMenu(const std::string &machinePrefix, const std::str
|
||||
|
||||
std::lock_guard lock_guard(machineMutex);
|
||||
auto options = machine->configurable_device()->get_options();
|
||||
Reflection::set(*options, "output", int(displaySelection));
|
||||
Reflection::set(*options, Configurable::Options::DisplayOptionName, int(displaySelection));
|
||||
machine->configurable_device()->set_options(options);
|
||||
});
|
||||
}
|
||||
@@ -590,7 +591,7 @@ void MainWindow::addEnhancementsItems(const std::string &machinePrefix, QMenu *m
|
||||
menu->addAction(action); \
|
||||
\
|
||||
const auto settingName = QString::fromStdString(machinePrefix + "." + setting); \
|
||||
if(settings.contains(settingName)) { \
|
||||
if(settings.contains(settingName)) { \
|
||||
const bool isSelected = settings.value(settingName).toBool(); \
|
||||
Reflection::set(*options, setting, isSelected); \
|
||||
} \
|
||||
@@ -599,17 +600,17 @@ void MainWindow::addEnhancementsItems(const std::string &machinePrefix, QMenu *m
|
||||
connect(action, &QAction::triggered, this, [=, this] { \
|
||||
std::lock_guard lock_guard(machineMutex); \
|
||||
auto options = machine->configurable_device()->get_options(); \
|
||||
Reflection::set(*options, setting, action->isChecked()); \
|
||||
Reflection::set(*options, setting, action->isChecked()); \
|
||||
machine->configurable_device()->set_options(options); \
|
||||
\
|
||||
Settings settings; \
|
||||
settings.setValue(settingName, action->isChecked()); \
|
||||
settings.setValue(settingName, action->isChecked()); \
|
||||
}); \
|
||||
}
|
||||
|
||||
QAction *action;
|
||||
Add(offerQuickLoad, "Load Quickly", "quickload", action);
|
||||
Add(offerQuickBoot, "Start Quickly", "quickboot", action);
|
||||
Add(offerQuickLoad, "Load Quickly", Configurable::Options::QuickLoadOptionName, action);
|
||||
Add(offerQuickBoot, "Start Quickly", Configurable::Options::QuickBootOptionName, action);
|
||||
|
||||
if(offerAutomaticTapeControl) menu->addSeparator();
|
||||
Add(offerAutomaticTapeControl, "Start and Stop Tape Automatically", "automatic_tape_motor_control", automaticTapeControlAction);
|
||||
|
||||
Reference in new issue
Block a user