19 if (!motherBoard)
return nullptr;
21 auto& controller = motherBoard->getMSXCommandController();
25const BaseSetting* ProxySetting::getSetting()
const
32 if (
auto*
setting = getSetting()) {
39 if (
const auto*
setting = getSetting()) {
40 return setting->getTypeString();
48 if (
const auto*
setting = getSetting()) {
49 return setting->getDescription();
57 if (
const auto*
setting = getSetting()) {
66 if (
const auto*
setting = getSetting()) {
67 return setting->getOptionalValue();
75 if (
const auto*
setting = getSetting()) {
76 return setting->getDefaultValue();
84 if (
const auto*
setting = getSetting()) {
85 return setting->getRestoreValue();
93 if (
auto*
setting = getSetting()) {
103 if (
const auto*
setting = getSetting()) {
104 setting->tabCompletion(tokens);
110 if (
const auto*
setting = getSetting()) {
111 return setting->needLoadSave();
119 if (
const auto*
setting = getSetting()) {
120 return setting->needTransfer();
128 if (
auto*
setting = getSetting()) {
129 setting->setDontSaveValue(dontSaveValue);
135 if (
const auto*
setting = getSetting()) {
136 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: