PowerAda Site-Specific Customization

From OC Systems Wiki!
Jump to: navigation, search

There are many features in PowerAda which may be customized for the site, project or individual:

Setup File

The PowerAda installation includes the file powerada/setup, which is to be executed by users in their current shell process to define the powerada environment. This is a good place to put related environment variable definitions, such as those needed by the CM tools, third-party bindings, or the target application.

Powerada Tools and CM Menus

The menus are custom-built when powerada starts up from UIL files read from $POWERADA/tools/lib/app-defaults. These support the addition of site-specific tools and Configuration Management (CM) operations. Since these customizations are a bit complicated, they are explained in detail in separate sections at the end of this chapter: Customizing the Tools Menu and Customizing the Configuration Management Integration.

Fonts and Colors

Users can customize PowerAda's fonts and colors as they wish. This is described in "GUI Customization" in Chapter 4.

Powerada Preferences

PowerAda allows each user to customize the tools used for editing and printing files, the terminal emulator used for working at the command line, the columns displayed (and their widths) in the browsers, build options and defaults for find operations.

Within each PowerAda user's home directory, there is a .powerada directory. This contains three files which hold the settings the user has chosen:

  • adbgrc: This is currently unused: Future versions of PowerAda may place debugger-specific preferences in it.
  • commonrc: This holds preferences shared between PowerAda and the debugger such as the selected editor.
  • poweradarc: This holds PowerAda-specific preferences such as the columns shown in the directory or sublibrary browsers.

Often it is desirable to customize these site-wide before users begin to use PowerAda. To support this, when PowerAda initializes and cannot find one or more of the files in the user's .powerada directory, it will copy the files from $POWERADA/tools/lib. Therefore, by modifying these files, you can create a set of default preferences which the users will pick up the first time they start PowerAda.

The easiest way to do this is to run powerada itself, set up the options, quit powerada (the settings are not actually saved to disk until you exit) and then copy the files. For instance, after running powerada, enter the following commands (it is assumed that you are logged in with the user ID which performed the installation):

cd $POWERADA/tools/lib
cp poweradarc poweradarc.sav
cp commonrc commonrc.sav
cp ~/.powerada/poweradarc .
cp ~/.powerada/commonrc .

There are a number of changes you may want to make; here are a few suggestions:

  • Change the help viewer. By default this is set to XMosaic on AIX, since this is distributed with PowerAda. However, if you have Netscape installed, you may wish to use this instead. You can change this through the Preferences dialog (from the Project menu) to point to a browser of your choice.

    Note: the documentation itself is all found under $POWERADA/html, so this path must be visible to the machine on which your HTML browser is running.

  • Modify the columns displayed in the directory and sublibrary browsers. You can change whether the columns are displayed (use the Show Columns menu from the Directory or Sublibrary menu) and their width (you can drag the right hand edge of each column). See File Views and Unit Views for more details.

  • Change the default build options: Choose Update Project (from the Build Menu) and select the Options button to give you the build and compile options. Remember to select the 'Save These Build Options' check-box to actually save your changed settings. See "Powerada Build Windows" in Chapter 4 for more details.

XEmacs Fonts, Colors, and Other Options

Users can customize XEmacs as they wish by editing $HOME/.emacs. = See "Using XEmacs with Powerada" and "GUI Customization" in Chapter 4.

An XEmacs installation is included with PowerAda on all platforms, and includes a number of XEmacs extensions. These are in $POWERADA/contrib/xemacs/lib/xemacs/site-lisp. This directory also contains default.el, which is loaded during XEmacs start-up. This file loads the OCS XEmacs extensions, and can be modified to make site-wide XEmacs configuration changes. We suggest creating a separate file, such as projectname.el, rather than modifying default.el. Then add this line to the end of default.el:

        (require 'projectname)

XEmacs Ada Indentation and Case Rules

XEmacs includes Ada-specific extensions to automatically format code. The distribution is set to work with a tab width of 3 spaces. If this does not match your coding standards, modify the configuration as described above by adding these lines:

        ;; Set tab widths to 4
        (setq ocs-tab-width 4)
        (setq ocs-pretty-print-command "afmt -n 4")

The default installation uses LRM95 capitalization. If this is not appropriate, add one of the following lines to your configuration file:

        ;; Procedure Fred Is

If none of these settings are appropriate, refer to the ocs-style.el and ada-mode.el files, or contact OC Systems.