Customized Settings and Configurations. Source Dynamics Source Insight 4.0
Iklan
Iklan
Customized Settings and Configurations
Customized Settings and Configurations
You can customize many aspects of Source Insight, such as the color of the screen and the assignments of keystrokes to commands. This collection of options is stored in a configuration file.
Note:
“Saving Window Arrangements with Layouts” on page 140.
The current configuration is loaded and saved automatically, but you can save and load configuration files directly using the Options > Save Configuration and Options > Load Configuration commands. You can also save or load individual parts, such as just key assignments.
By default, all your customizations are saved in a file called config_all.xml
, stored in the Source Insight user data directory. This is a global configuration file that applies no matter what project is open.
Customizing the Keyboard and Menus
A
command
is a user-level operation that Source Insight performs when you select a menu item or type a keystroke. For example, the Open command opens a file; the Save command saves a file. Each command has a name, and an action.
Commands are resources that can be assigned to menus, keystrokes, and mouse clicks, and those assignments are part of a configuration.
Source Insight also lets you define custom commands, which are useful for launching the compiler and other external tools from Source Insight.
See “Custom Commands” on page 132.
Assign keys to a command with Options > Key Assignments.
Keystrokes and mouse clicks are assigned to commands. For example, the Ctrl+O keystroke is assigned to the
Open
command. More than one keystroke may be assigned to a given command. Use the Options > Key
Assignments
command to customize the keyboard. See “Key Assignments” on page 233.
Assign commands to menus with Options > Menu Assignments.
Commands are assigned to menus. For example, the Open command is assigned to the File menu. Use the
Options > Menu Assignments
command to customize the contents of the menus. See “Menu Assignments” on page 255.
Changing Screen Colors and Appearance Options
There are several screen color options in Source Insight, and options that control appearance.
Changing the Visual Theme
To quickly change the visual theme, select Options > Visual Theme and choose a theme. You can also change
and define new themes. See “Visual Themes” on page 138.
Changing Color Settings
To change screen colors for the main application window and various display elements, use the Options >
Preferences: Color
command. See “Color Options” on page 166.
Source Insight 4 User Guide 133
Customized Settings and Configurations
Each panel window has its own font and color settings. Edit the settings and select the desired fonts and colors in all panels. A quick way to set them all at once is to use the Options > Preferences: Color & Fonts tab and click the Set Panel Fonts and Colors button.
Changing the Appearance of Source Code
Source Insight has many display options for formatting source code.
To fine-tune options about how syntax elements are formatted in general, select Options > Preferences: Syn-
tax Formatting
, and Options > Preferences: Syntax Decorations.
See “Syntax Decorations” on page 343.
See “Syntax Formatting” on page 346.
To change the appearance of syntax elements, such as how delimiters are styled, or how declarations appear, select Options > Style Properties. This controls the colors, fonts, font sizes, and other styling applied to these
elements. See “Style Properties” on page 333.
Changing Various Options
The Options > Preferences dialog specifies many of the program options. This multi-page dialog box contains
The Configuration File
Source Insight maintains a configuration file called config_all.xml
, stored in the Settings subdirectory of your Source Insight user directory. (Typically
Documents\Source Insight 4.0\Settings
.) You don't need to load or save this file yourself. That is done automatically. It is saved whenever you make any change to a configuration setting.
134 Source Insight 4 User Guide
Customized Settings and Configurations
Configuration files contain multiple parts for different types of options. Here are some of the things stored in the configuration:
•
Preferences - The Preferences command sets a variety of user options, such as file handling, display options, and language support.
•
File Types - The File Type Options command defines and changes file types. File types let you govern
Source Insight's behavior depending on the name or extension of each file.
•
Key Assignments - The Key Assignments command remaps the keyboard in Source Insight. Each command in Source Insight is listed in this dialog box and each command can be given a keystroke or mouse button shortcut.
•
Menu Assignments - The Menu Assignments command customizes the Source Insight menu bar. Each command in Source Insight is listed in this dialog box and each command can be put on any menu.
When you make changes to your settings via a dialog box setting, or load new configurations, the configuration file on disk is updated too.
The config_all.xml
file contains sections for each part of the configuration. When you load or save a configuration file, you can specify what parts are loaded or saved.
Each user that logs in and runs Source Insight gets a user data directory inside the
Documents\Source
Insight 4.0
folder. Therefore, each user on a particular machine will have their own preferences stored separately.
Note:
It is wise to keep a backup copy of your global configuration file, which will end up containing all your customi-
zations. Once you use the Load Configuration command, or make a change to the customization settings inside
Source Insight, the configuration file will be changed automatically.
It is also a good idea to make a backup copy if you update your Source Insight software. Often, newer builds of
Source Insight will be compatible with older configuration files, but not the other way around. If you should wish to revert to an older build of the software, it is best to use an older configuration file.
Configuration Master File
A special file named config_master.xml
specifies where the various configuration parts come from. It is stored in your Source Insight user directory in the Settings sub directory. It gets created the first time you run
Source Insight. Normally it does not need to ever change after that.
Source Insight 4 User Guide 135
Customized Settings and Configurations
A typical config_master.xml
file looks like this:
<?xml version="1.0" ?>
<SourceInsightMasterConfiguration
AppVer="4.00.0010"
AppVerMinReader="4.00.0008"
>
<Options
OverrideWithFile="config_all.xml"
ProjectDir="Projects"
BackupDir="Backup"
ClipsDir="Clips"
/>
<ConfigurationParts>
<GeneralPreferences file="config_general.xml" />
<DisplayPreferences file="config_display.xml" />
<EditingPreferences file="config_editing.xml" />
<SyntaxFormatting file="config_syntaxformatting.xml" />
<SyntaxDecorations file="config_syntaxdecorations.xml" />
<DisplayColors file="config_displaycolors.xml" />
<FilePreferences file="config_fileprefs.xml" />
<LookupPreferences file="config_lookupprefs.xml" />
<Menus file="config_menus.xml" />
<Keymaps file="config_keymaps.xml" />
<CustomCommands file="config_customcommands.xml" />
<DocumentTypes file="config_documenttypes.xml" />
<Styles file="config_styles.xml" />
<Ftp file="config_ftp.xml" />
<RemoteAccess file="config_remoteaccess.xml" />
<ProjectSync file="config_projectsync.xml" />
<ProjectDefaults file="config_projectdefaults.xml" />
<Logging file="config_logging.xml" />
<Languages file="config_languages.xml" />
<Search file="config_search.xml" />
<Toolbars file="config_toolbars.xml" />
<PrintPageSetup file="config_pagesetup.xml" />
<ProjectReport file="config_projectreport.xml" />
<SymbolPane file="config_symbolpane.xml" />
<ImportLibs file="config_importlibs.xml" />
<SourceFormatter file="config_sourceformatter.xml" />
</ConfigurationParts>
</SourceInsightMasterConfiguration>
Storing All Settings in One Configuration File
An important option in config_masterl.xml is in the
Options
section: an attribute named
OverrideWith-
File
. If this value points to a file, then ALL the configuration parts are maintained in that single file. This is the simplest arrangement, and it is the default setting.
Storing Configuration Parts in Separate Files
If you prefer to store different parts of the configuration in several files, set the
Option
attribute
Override-
WithFile
to an empty string. Then the
ConfigurationParts
XML element is used.
The
ConfigurationParts
element contains elements for each configuration part. In each part, the value of the file
attribute is the file that will contain the given configuration part. For example, Menu settings could be maintained in "config_menus.xml".
Project-Specific Configuration Parts
You may want to have some configuration part be specific to each project. In this case, the configuration part file is stored along with either your project's source code, or the project's data directory.
136 Source Insight 4 User Guide
Customized Settings and Configurations
Any configuration part file attribute can be prefixed with the following tags:
Prefix Tag
project_source: project_data:
File Location
Points to the directory where your project's source files are. You can see and edit this path in
Project > Project Settings
.
Points to the directory where your project's data files are maintained. This is specified when you first create your project.
Example
project_source:config_keymaps.xml
project_data:config_menus.xml
Grouping Configuration Parts into Files
You can group more than one configuration part in a file by specifying the file in multiple configuration part file attributes. For example, you could save the Menus and Keymaps configuration parts in a single file named config_menu_keymap.xml
with these attributes:
<ConfigurationParts>
....
<Menus file="config_menu_keymap.xml"/>
<Keymaps file="config_menu_keymap.xml"/>
....
</ConfigurationParts>
Loading a Configuration
Use the Options > Load Configuration command and select a new configuration file to be loaded. This command loads either the entire configuration contents, or only a specified subset of the configuration, such as
just the menu contents. See “Load Configuration” on page 245.
Saving a Configuration
Use the Options > Save Configuration command to save the contents of the current configuration to any other configuration file. By saving configuration files, you can create several customized versions of Source
Insight, with each one having different menus, keystroke assignments, screen colors, and more. The Save
Configuration command can also save a specified subset of the current configuration.
Source Insight automatically saves any option changes you make, so you normally would not need to use the
Save Configuration command. See “Save Configuration” on page 310.
Resetting the Configuration to Defaults
There are a couple ways to reset all the configuration settings to the factory defaults:
•
Select Options > Preferences: General and click the Use Defaults button. Or,
•
From the command line, use the -reset-config option. For example: sourceinsight4.exe -reset-config
When you reset the configuration, your previous configuration settings are backed up into another file in the
Setting folder. You can use the Options > Load Configuration command to reload it.
Source Insight 4 User Guide 137
Unduh
Iklan