Uranium
Application Framework
Loading...
Searching...
No Matches
UM.Preferences.Preferences Class Reference

Preferences are application based settings that are saved for future use. More...

Public Member Functions

 __init__ (self)
 
 addPreference (self, key, default_value)
 
 setDefault (self, key, default_value)
 Changes the default value of a preference.
 
 setValue (self, key, value)
 
 getValue (self, key)
 
 resetPreference (self, key)
 
 readFromFile (self, file)
 
 writeToFile (self, file)
 
"Preferences" getInstance (cls)
 
str deserialize (self, str serialized)
 Extract data from string and store it in the Configuration parser.
 

Static Public Attributes

int Version = 5
 
 preferenceChanged = Signal()
 

Protected Member Functions

 _splitKey (self, key)
 
 _findPreference (self, key)
 
 _loadFile (self, file)
 

Protected Attributes

 _file
 
 _parser
 
 _preferences
 

Static Protected Attributes

 _instance = None
 

Detailed Description

Preferences are application based settings that are saved for future use.

Typical preferences would be window size, standard machine, etc.

Member Function Documentation

◆ setDefault()

UM.Preferences.Preferences.setDefault (   self,
  key,
  default_value 
)

Changes the default value of a preference.

If the preference is currently set to the old default, the value of the preference will be set to the new default.

Parameters
keyThe key of the preference to set the default of.
default_valueThe new default value of the preference.

The documentation for this class was generated from the following file: