Konsole
Konsole::SessionManager Class Reference
#include <SessionManager.h>

Detailed Description
Manages running terminal sessions and the profiles which specify various settings for terminal sessions and their displays.Profiles in the manager have a concept of favorite status, which can be used by widgets and dialogs in the application decide which sessions to list and how to display them. The favorite status of a profile can be altered using setFavorite() and retrieved using isFavorite()
Definition at line 57 of file SessionManager.h.
Constructor & Destructor Documentation
| SessionManager::SessionManager | ( | ) |
Constructs a new session manager and loads information about the available profiles.
Definition at line 70 of file SessionManager.cpp.
| SessionManager::~SessionManager | ( | ) | [virtual] |
Definition at line 187 of file SessionManager.cpp.
Member Function Documentation
Returns a list of keys for profiles which have been loaded.
Initially only the profile currently set as the default is loaded.
Favorite profiles are loaded automatically when findFavorites() is called.
All other profiles can be loaded by calling loadAllProfiles(). This may involves opening, reading and parsing all profiles from disk, and should only be done when necessary.
Definition at line 277 of file SessionManager.cpp.
Searches for available profiles on-disk and returns a list of paths of profiles which can be loaded.
Definition at line 160 of file SessionManager.cpp.
Returns the session information object for the profile with the specified key or 0 if no profile with the specified key exists.
If key is empty, a pointer to the default profile is returned.
Definition at line 282 of file SessionManager.cpp.
Registers a new type of session and returns the key which can be passed to createSession() to create new instances of the session.
The favorite status of the session ( as returned by isFavorite() ) is set to false by default.
Definition at line 437 of file SessionManager.cpp.
Loads a profile from the specified path and registers it with the SessionManager.
path may be relative or absolute. The path may just be the base name of the profile to load (eg. if the profile's full path is "<konsole data dir>/My Profile.profile" then both "konsole/My Profile.profile" , "My Profile.profile" and "My Profile" will be accepted)
- Returns:
- The profile key which can be used to create new sessions from this profile using createSession()
Definition at line 102 of file SessionManager.cpp.
| void SessionManager::changeProfile | ( | const QString & | key, | |
| QHash< Profile::Property, QVariant > | propertyMap, | |||
| bool | persistant = true | |||
| ) |
Updates the profile associated with the specified key with the changes specified in propertyMap.
All sessions using the profile will be updated to reflect the new settings.
After the profile is updated, the profileChanged() signal will be emitted.
- Parameters:
-
key The profile's key propertyMap A map between profile properties and values describing the changes persistant If true, the changes are saved to the profile's configuration file, set this to false if you want to preview possible changes to a profile but do not wish to make them permanent.
Definition at line 316 of file SessionManager.cpp.
| Profile * SessionManager::defaultProfile | ( | ) | const |
Returns a Profile object describing the default type of session, which is used if createSession() is called with an empty configPath argument.
Definition at line 293 of file SessionManager.cpp.
| QString SessionManager::defaultProfileKey | ( | ) | const |
Creates a new session using the settings specified by the specified profile key.
The new session has no views associated with it. A new TerminalDisplay view must be created in order to display the output from the terminal session and send keyboard or mouse input to it.
- Parameters:
-
type Specifies the type of session to create. Passing an empty string will create a session using the default configuration.
Definition at line 230 of file SessionManager.cpp.
| void SessionManager::updateSession | ( | Session * | session | ) |
Updates a session's properties to match its current profile.
Definition at line 217 of file SessionManager.cpp.
| bool SessionManager::deleteProfile | ( | const QString & | key | ) |
Deletes the profile with the specified key.
The configuration file associated with the profile is deleted if possible.
Returns true if the profile was successfully deleted or false otherwise.
Definition at line 463 of file SessionManager.cpp.
| void SessionManager::setDefaultProfile | ( | const QString & | key | ) |
Sets the profile with the specified key as the default type.
Definition at line 499 of file SessionManager.cpp.
Returns the set of keys for the user's favorite profiles.
Definition at line 520 of file SessionManager.cpp.
| QList< QKeySequence > SessionManager::shortcuts | ( | ) |
Returns the list of shortcut key sequences which can be used to create new sessions based on existing profiles.
When one of the shortcuts is activated, use findByShortcut() to load the profile associated with the shortcut and obtain its key.
Definition at line 658 of file SessionManager.cpp.
| QString SessionManager::findByShortcut | ( | const QKeySequence & | shortcut | ) |
Finds and loads the profile associated with the specified shortcut key sequence and returns its string key.
Definition at line 663 of file SessionManager.cpp.
| void SessionManager::setShortcut | ( | const QString & | key, | |
| const QKeySequence & | shortcut | |||
| ) |
| QKeySequence SessionManager::shortcut | ( | const QString & | profileKey | ) | const |
Returns the shortcut associated with a particular profile.
Definition at line 708 of file SessionManager.cpp.
| void SessionManager::setFavorite | ( | const QString & | key, | |
| bool | favorite | |||
| ) |
Specifies whether a profile should be included in the user's list of favorite sessions.
Definition at line 527 of file SessionManager.cpp.
| void SessionManager::loadAllProfiles | ( | ) |
Loads all available profiles.
This involves reading each profile configuration file from disk and parsing it. Therefore it should only be done when necessary.
Definition at line 167 of file SessionManager.cpp.
| static void Konsole::SessionManager::setInstance | ( | SessionManager * | instance | ) | [static] |
Sets the global session manager instance.
| SessionManager * SessionManager::instance | ( | ) | [static] |
| void Konsole::SessionManager::profileAdded | ( | const QString & | key | ) | [signal] |
Emitted when a profile is added to the manager.
| void Konsole::SessionManager::profileRemoved | ( | const QString & | key | ) | [signal] |
Emitted when a profile is removed from the manager.
| void Konsole::SessionManager::profileChanged | ( | const QString & | key | ) | [signal] |
Emitted when a profile's properties are modified.
| void Konsole::SessionManager::sessionUpdated | ( | Session * | session | ) | [signal] |
Emitted when a session's settings are updated to match its current profile.
| void Konsole::SessionManager::favoriteStatusChanged | ( | const QString & | key, | |
| bool | favorite | |||
| ) | [signal] |
Emitted when the favorite status of a profile changes.
- Parameters:
-
key The key for the profile favorite Specifies whether the session is a favorite or not
| void Konsole::SessionManager::shortcutChanged | ( | const QString & | key, | |
| const QKeySequence & | newShortcut | |||
| ) | [signal] |
Emitted when the shortcut for a profile is changed.
- Parameters:
-
key The key for the profile newShortcut The new shortcut key sequence for the profile
| void SessionManager::sessionTerminated | ( | QObject * | session | ) | [protected, slot] |
Called to inform the manager that a session has finished executing.
- Parameters:
-
session The Session which has finished executing.
Definition at line 265 of file SessionManager.cpp.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference