Storyboard Pro
Scripting Interface Documentation
preferences Class Reference

With the Preferences functions, you can retrieve information about the whole preference system. The user can set and retrieve the value of any preferences in the software. More...

Public Slots

ColorRGBA getColor (String name, ColorRGBA defaultValue)
 get the color from the given preference name More...
 
void setColor (String name, ColorRGBA color)
 set the color for the given preference name More...
 
double getDouble (String name, double defaultValue)
 get the double value from the given preference name More...
 
void setDouble (String name, double value)
 set the double value for the given preference name More...
 
double getInt (String name, int defaultValue)
 get the integer value from the given preference name More...
 
void setInt (String name, int value)
 set the integer value for the given preference name More...
 
bool getBool (String name, bool defaultValue)
 get the boolean value from the given preference name More...
 
void setBool (String name, bool value)
 get the boolean value for the given preference name More...
 
String getString (String name, String defaultValue)
 get the string value from the given preference name More...
 
void setString (String name, String value)
 set the string value for the given preference name More...
 
double getEnumValue (String name, int defaultValue)
 
void setEnumValue (String name, int value)
 

Public Member Functions

 preferences (QObject *parent, char *name)
 

Detailed Description

With the Preferences functions, you can retrieve information about the whole preference system. The user can set and retrieve the value of any preferences in the software.

The actual name and current value of a preference are in stored in the user configuration file.

The file prefs.xml contains a description of all preferences recognized by the application. The keyword to access each predefined preference is also found in that file.

Scripts can change or retrieve any existing preference, and may create new preferences.

You can use it in Script Editor only.

function toggleAutoSaveLayout()
{
var b;
b = preferences.getBool( "AUTO_SAVE_LAYOUT", false );
print( "preference to automatically save the layout was " + b );
preferences.setBool( "AUTO_SAVE_LAYOUT", !b );
b = preferences.getBool( "AUTO_SAVE_LAYOUT", false );
print( "preference for auto save layout is now " + b );
}

Constructor & Destructor Documentation

◆ preferences()

preferences::preferences ( QObject *  parent,
char *  name 
)

Member Function Documentation

◆ getBool

bool preferences::getBool ( String  name,
bool  defaultValue 
)
slot

get the boolean value from the given preference name

◆ getColor

ColorRGBA preferences::getColor ( String  name,
ColorRGBA  defaultValue 
)
slot

get the color from the given preference name

◆ getDouble

double preferences::getDouble ( String  name,
double  defaultValue 
)
slot

get the double value from the given preference name

◆ getEnumValue

double preferences::getEnumValue ( String  name,
int  defaultValue 
)
slot

◆ getInt

double preferences::getInt ( String  name,
int  defaultValue 
)
slot

get the integer value from the given preference name

◆ getString

String preferences::getString ( String  name,
String  defaultValue 
)
slot

get the string value from the given preference name

◆ setBool

void preferences::setBool ( String  name,
bool  value 
)
slot

get the boolean value for the given preference name

◆ setColor

void preferences::setColor ( String  name,
ColorRGBA  color 
)
slot

set the color for the given preference name

◆ setDouble

void preferences::setDouble ( String  name,
double  value 
)
slot

set the double value for the given preference name

◆ setEnumValue

void preferences::setEnumValue ( String  name,
int  value 
)
slot

◆ setInt

void preferences::setInt ( String  name,
int  value 
)
slot

set the integer value for the given preference name

◆ setString

void preferences::setString ( String  name,
String  value 
)
slot

set the string value for the given preference name