Configuration¶
Description¶
The Configuration object is used as a base class of other configuration objects. Mostly it is used to generate a custom configuration group in the configuration tab of the fluentum dashboard. Also it saves the settings taken.
› Inherits: | Object |
---|---|
› Inherited by: | ApplicationConfiguration, NetworkConfiguration, SystemConfiguration |
Properties¶
error¶
This property holds the most recently occurred error or Configuration.NoError if no error occurred. If the same error occurs multiple times this property does not change. Use the errorOccurred() signal to detect multiple occurrences of the same error.
› Type: | Error |
---|---|
› Signal: | errorChanged() |
› Attributes: | Readonly |
errorString¶
This property holds the current human readable error string corresponding to the current value in the error property. It may include additional information such as failure reasons or locations.
› Type: | String |
---|---|
› Signal: | errorStringChanged() |
› Attributes: | Readonly |
name¶
This property holds the name property which usually is used as headline in the configuration tab of fluentum.
› Type: | String |
---|---|
› Signal: | nameChanged() |
› Attributes: | Writable |
objects¶
This property holds a list of ConfigurationObject objects which should be saved.
› Type: | List<ConfigurationObject> |
---|---|
› Signal: | objectsChanged() |
› Attributes: | Readonly |
saveMode¶
This property holds the save mode of this configuration.
› Type: | SaveMode |
---|---|
› Default: | Configuration.SaveOnUpdate |
› Signal: | saveModeChanged() |
› Attributes: | Writable |
Methods¶
remove()¶
This method removes the configuration file from storage.
This method was introduced in InCore 2.7.
toDataMap()¶
This method is similar to Object.serializeProperties() but only returns the serialized DataObject.data properties of each ConfigurationItem.
This method was introduced in InCore 2.6.
› Returns: | Map |
---|
Signals¶
aboutToBeUpdated()¶
This signal is emitted before the configuration is being updated through object deserialization, e.g. when using in conjunction with an JsonRpcService and loading settings through RPC calls.
errorOccurred()¶
This signal is emitted whenever an error has occurred, regardless of whether the error property has changed or not. In contrast to the change notification signal of the error property this signal is also emitted several times if a certain error occurs several times in succession.
objectsDataChanged(SignedInteger index)¶
This signal is emitted whenever the List.dataChanged() signal is emitted, i.e. the item at index
in the objects list itself emitted the dataChanged() signal.
updated()¶
This signal is emitted after the configuration has been updated through object deserialization, e.g. when using in conjunction with an JsonRpcService and loading settings through RPC calls.
Enumerations¶
Error¶
This enumeration describes all errors which can occur in Configuration objects. The most recently occurred error is stored in the error property.
Name | Value | Description |
---|---|---|
Configuration.NoError |
0 |
No error occurred or was detected. |
Configuration.ConfigurationFileReadError |
1 |
Could not open configuration file for reading. |
Configuration.ConfigurationFileWriteError |
2 |
Could not open configuration file for writing. |
Configuration.ConfigurationFileParseError |
3 |
Could not parse configuration file. |
SaveMode¶
This enumeration describes when and under which circumstances the configuration is saved to the configured storage.
Name | Value | Description |
---|---|---|
Configuration.SaveManually |
0 |
Save configuration manually whenever save() is called. |
Configuration.SaveOnUpdate |
1 |
Save configuration whenever settings are updated through property deserialization. |