22 if (!motherBoard)
return nullptr;
24 auto& controller = motherBoard->getMSXCommandController();
28 const BaseSetting* ProxySetting::getSetting()
const
35 if (
auto* setting = getSetting()) {
36 setting->setValue(value);
42 if (
const auto* setting = getSetting()) {
43 return setting->getTypeString();
51 if (
const auto* setting = getSetting()) {
52 return setting->getDescription();
60 if (
const auto* setting = getSetting()) {
61 return setting->getValue();
69 if (
const auto* setting = getSetting()) {
70 return setting->getOptionalValue();
78 if (
const auto* setting = getSetting()) {
79 return setting->getDefaultValue();
87 if (
const auto* setting = getSetting()) {
88 return setting->getRestoreValue();
96 if (
auto* setting = getSetting()) {
98 setting->setValue(value);
106 if (
const auto* setting = getSetting()) {
107 setting->tabCompletion(tokens);
113 if (
const auto* setting = getSetting()) {
114 return setting->needLoadSave();
122 if (
const auto* setting = getSetting()) {
123 return setting->needTransfer();
131 if (
auto* setting = getSetting()) {
132 setting->setDontSaveValue(dontSaveValue);
138 if (
const auto* setting = getSetting()) {
139 setting->additionalInfo(result);
std::string_view getFullName() const
SettingsManager & getSettingsManager()
bool needLoadSave() const override
Does this setting need to be loaded or saved (settings.xml).
void additionalInfo(TclObject &result) const override
Helper method for info().
void setDontSaveValue(const TclObject &dontSaveValue) override
This value will never end up in the settings.xml file.
TclObject getRestoreValue() const override
Get the value that will be set after a Tcl 'unset' command.
std::optional< TclObject > getOptionalValue() const override
Like getValue(), but in case of error returns an empty optional instead of throwing an exception.
TclObject getDefaultValue() const override
Get the default value of this setting.
void tabCompletion(std::vector< std::string > &tokens) const override
Complete a partly typed value.
void setValueDirect(const TclObject &value) override
Similar to setValue(), but doesn't trigger Tcl traces.
ProxySetting(Reactor &reactor, const TclObject &name)
const TclObject & getValue() const override
Get current value as a TclObject.
void setValue(const TclObject &value) override
Change the value of this setting to the given value.
std::string_view getTypeString() const override
Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an ...
std::string_view getDescription() const override
pure virtual methods ///
bool needTransfer() const override
Does this setting need to be transfered on reverse.
Contains the main loop of openMSX.
MSXMotherBoard * getMotherBoard() const
GlobalCommandController & getGlobalCommandController()
BaseSetting * findSetting(std::string_view name) const
Find the setting with given name.
This file implemented 3 utility functions: