#import <CrescatAppDelegate.h>
Collaboration diagram for CrescatAppDelegate:

The application delegate in Crescat has three main chores.
First, it must initialize and serve defaults. It uses its +initialize method to set up the initial values, and has numerous class methods that supply the default values for things like colors, terminal size, etc.
Second, and related, it maintains the database, indexed by host and user name, of settings for sessions.
Third, it handles AppleScript accessors (currently only one).
Definition at line 32 of file CrescatAppDelegate.h.
Public Member Functions | |
| (IBAction) | - showPreferences: |
| Show the Preferences window and bring it front. | |
| (IBAction) | - showSessionManager: |
| Show the Session Manager window and bring it forward. | |
| (IBAction) | - showFindPanel: |
| Show the Find panel and make it key. | |
| (FindPanelController *) | - findController |
| Return the singleton controller for the Find panel. | |
Static Public Member Functions | |
| (NSColor *) | + foreColor |
| Default foreground color. | |
| (NSColor *) | + backColor |
| Default background color. | |
| (NSColor *) | + cursorColor |
| Default cursor color. | |
| (float) | + cursorProportion |
| Default cursor size. | |
| (float) | + proportionFromCursorDescription: |
| Text cursor descriptions to proportions. | |
| (NSString *) | + protocolParamFromIndex: |
| Translate menu indices to SSH protocol choices. | |
| (NSString *) | + cipherParamFromIndex: |
| Translate menu indices to cipher choices Accepts an index in the range 0. | |
| (NSFont *) | + defaultFont |
| Default terminal font. | |
| (NSFont *) | + printingFont |
| Default printing font. | |
| (int) | + defaultRows |
| Default height of new terminals. | |
| (int) | + defaultColumns |
| Default width of new terminals. | |
| (BOOL) | + searchCaseSensitive |
| Are Find-panel searches case-sensitive? Queries the application delegate's controller for the Find panel to determine whether searching is to be case-sensitive. | |
| (BOOL) | + searchWraps |
| Do Find-panel searches wrap around? Queries the controller for the Find panel to determine whether searches that fail at the end of the terminal buffer should retry with the buffer between the top and the start of the search. | |
| (NSString *) | + searchString |
| The Find string. | |
| (BOOL) | + closeWhenSessionCloses |
| Does the document close when the connection ends? Returns whether Crescat document windows are supposed to close when the ssh sessions they embody close. | |
| (NSArray *) | + hosts |
| Array of the names of all known ssh hosts. | |
| (NSString *) | + lastHost |
| Name of the last host logged into. | |
| (void) | + setLastHost: |
| Record the last-logged ssh host in defaults. | |
| (NSArray *) | + userIDsForHost: |
| Known user IDs for use on a host. | |
| (NSString *) | + lastUserForHost: |
| The name of the last user on a host. | |
| (void) | + setLastUser:forHost: |
| Set the last-used user name for a host. | |
| (NSDictionary *) | + settingsForHost:userID: |
| Retrieve the settings for a host/user combination. | |
| (void) | + setSettings:forHost:userID: |
| Set preferences for a host/user combination. | |
| (void) | + deleteHostName:userID: |
| Remove a host/user (or all of a host) from the defaults. | |
| (NSMutableDictionary *) | + defaultHostSettings |
| Settings for hosts not otherwise known. | |
| (PreferenceController *) | + sharedPreferenceController |
| Return the preference-window controller. | |
| (int) | + registerSessionWithBanner: |
| Return an ordinal for a window title. | |
Protected Attributes | |
| PreferenceController * | prefController |
| HostManager * | hostManager |
| FindPanelController * | findPanel |
| NSCountedSet * | sessionCounters |
|
|
Default background color. Returns the background (space) color as set in the user defaults. It corresponds to the "terminalDefaults.backColor" default.
Referenced by LoginInfoController::setFromDictionary:, and LoginInfoController::setReasonableDefaults. |
|
|
Translate menu indices to cipher choices Accepts an index in the range 0.
.2 and returns the
Referenced by MyDocument::startSession. |
|
|
Does the document close when the connection ends? Returns whether Crescat document windows are supposed to close when the ssh sessions they embody close. Corresponds to "terminalDefaults.closeOnClose," which defaults to NO.
|
|
|
Default cursor color. Returns the cursor color as set in the user defaults. It corresponds to the "terminalDefaults.cursorColor" default.
Referenced by defaultHostSettings(), TerminalSection::initWithRows:columns:, LoginInfoController::setFromDictionary:, and LoginInfoController::setReasonableDefaults. |
|
|
Default cursor size. Returns the portion of a character block taken up by the cursor. Corresponds to the "terminalDefaults.cursorStyle" user preference. In practice (see -[TerminalSection drawBackground] only 1.0, 0.5, and < 0 are significant; anything else is equivalent to 1.0.
Referenced by TerminalSection::initWithRows:columns:. |
|
|
Default width of new terminals. New terminal sessions for host/user combinations not previously seen will use terminals with this many characters per line. Corresponds to the "terminalDefaults.defaultColumns" default.
Referenced by defaultHostSettings(), LoginInfoController::setFromDictionary:, and LoginInfoController::setReasonableDefaults. |
|
|
Default terminal font. This is the terminal font set by the user in the application preferences. It corresponds to the "terminalDefaults.terminalFont" default entry. Crescat has not been tested extensively with any font other than Monaco, nor much at all with any proportional font.
Referenced by TerminalSection::initWithRows:columns:, IntegratedTSView::initWithRows:columns:, and IntegratedTSView::sizeIncrement. |
|
|
Settings for hosts not otherwise known. This method returns the defaults dictionary at "terminalDefaults", which is the configuration to be used for new host/user combinations.
Referenced by HostManager::addHost:, LoginInfoController::prepareUI, and MyDocument::sessionParamsSuffice. |
|
|
Default height of new terminals. New terminal sessions for host/user combinations not previously seen will use terminals with this many lines. Corresponds to the "terminalDefaults.defaultRows" default.
Referenced by defaultHostSettings(), LoginInfoController::setFromDictionary:, and LoginInfoController::setReasonableDefaults. |
|
||||||||||||
|
Remove a host/user (or all of a host) from the defaults. If nilForAll is an NSString, removes the named host/user combination from the defaults database. If nilForAll is nil, removes the host, and all its users, from the database.
Referenced by HostManager::deleteSelection:, HostManager::effectChangeInRow:, and CrescatApplication::handleRemoveSessionCommand:. |
|
|
Return the singleton controller for the Find panel. Initializes the singleton FindPanelController if necessary, and returns it.
|
|
|
Default foreground color. Returns the foreground (character) color as set in the user defaults. It corresponds to the "terminalDefaults.foreColor" default.
Referenced by LoginInfoController::setFromDictionary:, and LoginInfoController::setReasonableDefaults. |
|
|
Array of the names of all known ssh hosts. The top-level grouping for items in the host-manager interface (see HostManager.m) is an entity maintained by the defaults system, an dictionary of dictionaries. Each entry in the top-level dictionary corresponds to a known ssh host. The host dictionaries include addresses plus a dictionary keyed on user names for use on each host, containing settings for use with each host x user pair. Corresponds to the default "hosts". This method returns the key array of the top-level dictionary: The name of every host.
Referenced by initialize(), LoginInfoController::initWithParent:, knownHosts(), PreferenceController::loadUI, HostManager::makeDataCache, LoginInfoController::prepareUI, and valueInKnownHostsAtIndex:(). |
|
|
Name of the last host logged into. Crescat defaults the login panel to the last host the user logged into. (But see useLastSelection.) This is stored in the "lastHost" default. This is the getter for that value.
Referenced by PreferenceController::loadUI, and LoginInfoController::prepareUI. |
|
|
The name of the last user on a host. Crescat likes to present the last-used user name when a host is selected in the login panel. This corresponds to "hosts[hostName].lastUser" in the defaults.
Referenced by LoginInfoController::hostAction:, and LoginInfoController::prepareUI. |
|
|
Default printing font. This is the printing font set by the user in the application preferences. It corresponds to the "terminalDefaults.printingFont" default entry. The size is the maximum that will be used; Crescat is apt to use a smaller font to fit the width of the screen onto one page.
Referenced by MyDocument::printAttributedString:, and MyDocument::printShowingPrintPanel:. |
|
|
Text cursor descriptions to proportions. Translates "Underline" to -1, "Half-Block" to 0.5, and anything else to 1.0. This is a crude function for turning preference-menu selections into cursor proportions.
|
|
|
Translate menu indices to SSH protocol choices.
Accepts an index in the range of 0..3, and returns the
Referenced by MyDocument::startSession. |
|
|
Return an ordinal for a window title. MyDocument names session windows userName @ host. There may be more than one session with the same combination, so MyDocument wants to number them serially. This method takes the banner text and gives the ordinal number for that banner (so userName @ host can become userName @ host -- 2)
Referenced by MyDocument::dataArrivedFromPty:. |
|
|
Are Find-panel searches case-sensitive? Queries the application delegate's controller for the Find panel to determine whether searching is to be case-sensitive. This is not saved in the defaults system.
Referenced by TallTextView::performFindPanelAction:. |
|
|
The Find string. The Find panel puts its target string on the find pasteboard, and accepts changes from the find pasteboard. This method returns the contents of the find pasteboard if there is a string there.
Referenced by TallTextView::performFindPanelAction:, and TallTextView::validateUserInterfaceItem:. |
|
|
Do Find-panel searches wrap around? Queries the controller for the Find panel to determine whether searches that fail at the end of the terminal buffer should retry with the buffer between the top and the start of the search. This setting is not saved in the defaults system.
Referenced by TallTextView::performFindPanelAction:. |
|
|
Record the last-logged ssh host in defaults. This is the setter for the "lastHost" default. If "terminalDefaults.useLastHost" is NO (it defaults to YES), this method has no effect.
Referenced by LoginInfoController::harvestUI. |
|
||||||||||||
|
Set the last-used user name for a host. This is the setter corresponding to -lastUserForHost:. The name will be stored in the defaults at "hosts[hostName].lastUser". Additionally: If a default user (one with an empty name) had previously been defined for the given host, the default user will be renamed to the given user name, on the theory that we have been accumulating settings anonymously, and now have learned the name to attach to them.
Referenced by LoginInfoController::harvestUI. |
|
||||||||||||||||
|
Set preferences for a host/user combination. This method sets the entry "hosts[hostName].users[userID]" in the defaults to the dictionary in the settings parameter.
Referenced by HostManager::effectChangeInRow:, LoginInfoController::harvestUI, MyDocument::showSessionSettings:, and MyDocument::terminalView:changedGeometryToRows:columns:. |
|
||||||||||||
|
Retrieve the settings for a host/user combination. Preferences, such as colors, terminal geometry, protocols, etc., are stored by Crescat per-host/per-user. This method retrieves those settings by doing two dictionary lookups: "hosts[hostName].users[userName]". The result is an NSDictionary.
Referenced by CrescatApplication::handleGetSessionCommand:, LoginInfoController::hostAction:, HostManager::makeDataCache, and LoginInfoController::prepareUI. |
|
|
Return the preference-window controller. The application delegate owns the PreferenceController object that runs the application preferences window. This method returns a pointer to that object.
Referenced by IntegratedTSView::awakeFromNib, TerminalSection::conformHighlighting, TallTextView::drawPageBorderWithSize:, TermLayoutManager::init, TerminalSection::initWithRows:columns:, and TerminalSection::scheduleHighlighting:. |
|
|
Show the Find panel and make it key. Initializes the singleton FindPanelController if necessary, makes the associated Find panel visible, and makes it key. An IBAction.
Referenced by validateUserInterfaceItem:(). |
|
|
Show the Preferences window and bring it front. Initializes the singleton PreferenceController from the terminalDefaults default setting (if necessary), makes the resulting Preference window visible, and orders it front. An IBAction.
Referenced by validateUserInterfaceItem:(). |
|
|
Show the Session Manager window and bring it forward. Initializes the singleton HostManager controller if necessary, makes the associated Session Manager window visible, and orders it front. An IBAction.
Referenced by validateUserInterfaceItem:(). |
|
|
Known user IDs for use on a host. The named host is looked up, and the keys of its "users" dictionary are returned. The return value is all the names of known users for the given host. This corresponds to "hosts[hostName].users.@keys".
Referenced by CrescatApplication::handleKnownUsersCommand:, and HostManager::makeDataCache. |
|
|
Definition at line 36 of file CrescatAppDelegate.h. Referenced by findController(). |
|
|
Definition at line 35 of file CrescatAppDelegate.h. Referenced by showSessionManager:(). |
|
|
Definition at line 34 of file CrescatAppDelegate.h. Referenced by preferenceController(). |
|
|
Definition at line 37 of file CrescatAppDelegate.h. Referenced by init(). |
1.4.4