22 : fullName(
std::move(name))
40 , commandController(commandController_)
41 , description(description_)
43 , defaultValue(initialValue)
52 if (
const auto* savedValue =
53 getGlobalCommandController().getSettingsConfig()
86void Setting::notify()
const
107 config.setValueForSetting(base, val.
getString());
130 if (
auto* globalCommandController =
132 return *globalCommandController;
134 return checked_cast<MSXCommandController*>(&commandController)
135 ->getGlobalCommandController();
159 if (newValue != value) {
171 if (!controller->isActive()) {
virtual void additionalInfo(TclObject &result) const =0
Helper method for info().
BaseSetting(std::string_view name)
void info(TclObject &result) const
For SettingInfo.
virtual std::string_view getTypeString() const =0
Returns a string describing the setting type (integer, string, ..) Could be used in a GUI to pick an ...
virtual TclObject getDefaultValue() const =0
Get the default value of this setting.
const TclObject & getFullNameObj() const
Get the name of this setting.
std::string_view getBaseName() const
const TclObject & getBaseNameObj() const
virtual void updateFiltered(UpdateType type, std::string_view name, std::string_view value)=0
Same as update(), but checks that the value for type-name is the same as in the previous call.
virtual Interpreter & getInterpreter()=0
virtual CliComm & getCliComm()=0
virtual void registerSetting(Setting &setting)=0
TODO.
virtual void unregisterSetting(Setting &setting)=0
SettingsConfig & getSettingsConfig()
void setVariable(const TclObject &name, const TclObject &value)
std::string_view getDescription() const final
pure virtual methods ///
void tabCompletion(std::vector< std::string > &tokens) const override
Complete a partly typed value.
bool needLoadSave() const final
Does this setting need to be loaded or saved (settings.xml).
CommandController & getCommandController() const
bool needTransfer() const final
Does this setting need to be transfered on reverse.
Interpreter & getInterpreter() const
TclObject getDefaultValue() const final
Get the default value of this setting.
const TclObject & getValue() const final
Gets the current value of this setting as a TclObject.
void setValue(const TclObject &newValue) final
Change the value of this setting to the given value.
void notifyPropertyChange() const
void additionalInfo(TclObject &result) const override
Helper method for info().
Setting(const Setting &)=delete
void setValueDirect(const TclObject &newValue) final
Similar to setValue(), but doesn't trigger Tcl traces.
void removeValueForSetting(std::string_view setting)
void addListElement(const T &t)
zstring_view getString() const
This file implemented 3 utility functions: