-
Notifications
You must be signed in to change notification settings - Fork 22
Rails Configuration
The basic idea is that a collection of user defined settings is a user profile and can be saved as a configuration file. Each user profile depends on a system profile, which defines default settings.
Currently there is only one pre-defined system profile (called default), but this allows predefined settings for pbem, moderated face-to-face or online playing later on.
There is a User Interface available under Options => Configuration which allows to change the configurations. It consists of two panels: The upper part allows to select a profile, create a new or load a saved profile. The second panel allows changes of the various options, which are collected by the different panes. The bottom row provides buttons to store and apply the new settings or cancel the changes.
The composition of the UI is adjustable by changing the content of the xml-file data/Properties.xml
.
The section tags refer to the tabbed panes and the property tags to the options. The property names are the same as in the old configuration files. The property type attribute defines the UI element used and should be self explaining.
The text for sections (pane) and properties can be changed in LocalisedText. Keys are defined using the following patterns:
- Section label: Config.section.{name of section} Example: Config.section.UI=Windows/Fonts
- Property label: Config.label.{name of property} Example: Config.label.locale=Language Setting
- Property toolTip: Config.toolTip.{name of property} Example: Config.toolTip.local.player.name=Player name used as suffix for game save
- Property infoText: Config.infoText.{name of property} Example: Config.infoText.locale=te_ST shows local text keys. Requires restart.
User Interface is created dynmaically by rails.ui.swing.ConfigWindow.
Behind the scenes configuration options are managed by net.sf.rails.util.Config
and the properties are defined using net.sf.rails.util.ConfigItem
.
System profiles are stored in folder data.profiles. Inside this folder default.profiles lists the names and files of all system profiles. The list of user profiles is stored in the working directory of Rails in the file user.profiles. User configurations can be stored anywhere in the folder system.
There exists a configuration mechanism in older Rails versions a Configuration File.