new $.oPreference(category, keyword, type, description, descriptionText)
openHarmony/openHarmony_preferences.js, line 413
The constructor for the oPreference Class.
Name | Type | Description |
---|---|---|
category |
string | The category of the preference |
keyword |
string | The keyword used by the preference |
type |
string | The type of value held by the preference |
description |
string | A short string of description |
descriptionText |
string | The complete tooltip text for the preference |
Example
// To access the preferences of Harmony, grab the preference object in the $.oApp class:
var prefs = $.app.preferences;
// It's then possible to access all available preferences of the software:
for (var i in prefs){
log (i+" "+prefs[i]);
}
// accessing the preference value can be done directly by using the dot notation:
prefs.USE_OVERLAY_UNDERLAY_ART = true;
log (prefs.USE_OVERLAY_UNDERLAY_ART);
//the details objects of the preferences object allows access to more information about each preference
var details = prefs.details
log(details.USE_OVERLAY_UNDERLAY_ART.category+" "+details.USE_OVERLAY_UNDERLAY_ART.id+" "+details.USE_OVERLAY_UNDERLAY_ART.type);
for (var i in details){
log(i+" "+JSON.stringify(details[i])) // each object inside detail is a complete oPreference instance
}
// the preference object also holds a categories array with the list of all categories
log (prefs.categories)
Members
-
value
-
get and set a preference value