Konsole
#include <ProfileManager.h>
Public Slots | |
void | saveSettings () |
Signals | |
void | favoriteStatusChanged (Profile::Ptr profile, bool favorite) |
void | profileAdded (Profile::Ptr ptr) |
void | profileChanged (Profile::Ptr ptr) |
void | profileRemoved (Profile::Ptr ptr) |
void | shortcutChanged (Profile::Ptr profile, const QKeySequence &newShortcut) |
Static Public Member Functions | |
static ProfileManager * | instance () |
Detailed Description
Manages 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 profiles 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 48 of file ProfileManager.h.
Constructor & Destructor Documentation
ProfileManager::ProfileManager | ( | ) |
Constructs a new profile manager and loads information about the available profiles.
Definition at line 69 of file ProfileManager.cpp.
|
virtual |
Destroys the ProfileManager.
Definition at line 109 of file ProfileManager.cpp.
Member Function Documentation
void ProfileManager::addProfile | ( | Profile::Ptr | type | ) |
Registers a new type of session.
The favorite status of the session ( as returned by isFavorite() ) is set to false by default.
Definition at line 369 of file ProfileManager.cpp.
QList< Profile::Ptr > ProfileManager::allProfiles | ( | ) |
Returns a list of all available profiles.
Initially only the profile currently set as the default is loaded.
Favorite profiles are loaded automatically when findFavorites() is called.
When this method is called, it calls loadAllProfiles() internally to ensure all available profiles are loaded and usable.
Definition at line 296 of file ProfileManager.cpp.
QStringList ProfileManager::availableProfileNames | ( | ) | const |
Returns a list of names of all available profiles.
Definition at line 202 of file ProfileManager.cpp.
QStringList ProfileManager::availableProfilePaths | ( | ) | const |
Searches for available profiles on-disk and returns a list of paths of profiles which can be loaded.
Definition at line 190 of file ProfileManager.cpp.
void ProfileManager::changeProfile | ( | Profile::Ptr | profile, |
QHash< Profile::Property, QVariant > | propertyMap, | ||
bool | persistent = true |
||
) |
Updates a profile
with the changes specified in propertyMap
.
All sessions currently using the profile will be updated to reflect the new settings.
After the profile is updated, the profileChanged() signal will be emitted.
- Parameters
-
profile The profile to change propertyMap A map between profile properties and values describing the changes persistent 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 330 of file ProfileManager.cpp.
Profile::Ptr ProfileManager::defaultProfile | ( | ) | const |
Returns a Profile object describing the default profile.
Definition at line 308 of file ProfileManager.cpp.
bool ProfileManager::deleteProfile | ( | Profile::Ptr | profile | ) |
Deletes the configuration file used to store a profile.
The profile will continue to exist while sessions are still using it. The profile will be marked as hidden (see Profile::setHidden() ) so that it does not show up in profile lists and future changes to the profile are not stored to disk.
Returns true if the profile was successfully deleted or false otherwise.
Definition at line 379 of file ProfileManager.cpp.
Profile::Ptr ProfileManager::fallbackProfile | ( | ) | const |
Returns a Profile object with hard-coded settings which is always available.
This can be used as a parent for new profiles which provides suitable default settings for all properties.
Definition at line 312 of file ProfileManager.cpp.
|
signal |
Emitted when the favorite status of a profile changes.
- Parameters
-
profile The profile to change favorite Specifies whether the profile is a favorite or not
Profile::Ptr ProfileManager::findByShortcut | ( | const QKeySequence & | shortcut | ) |
Finds and loads the profile associated with the specified shortcut
key sequence and returns a pointer to it.
Definition at line 605 of file ProfileManager.cpp.
QSet< Profile::Ptr > ProfileManager::findFavorites | ( | ) |
Returns the set of the user's favorite profiles.
Definition at line 436 of file ProfileManager.cpp.
|
static |
Returns the profile manager instance.
Definition at line 114 of file ProfileManager.cpp.
void ProfileManager::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 217 of file ProfileManager.cpp.
QList< Profile::Ptr > ProfileManager::loadedProfiles | ( | ) | const |
Returns a list of already loaded profiles.
Definition at line 303 of file ProfileManager.cpp.
Profile::Ptr ProfileManager::loadProfile | ( | const QString & | path | ) |
Loads a profile from the specified path and registers it with the ProfileManager.
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
- Pointer to a profile which can be passed to SessionManager::createSession() to create a new session using this profile.
Definition at line 119 of file ProfileManager.cpp.
|
signal |
Emitted when a profile is added to the manager.
|
signal |
Emitted when a profile's properties are modified.
|
signal |
Emitted when a profile is removed from the manager.
|
slot |
Saves settings (favorites, shortcuts, default profile etc.) to disk.
Definition at line 272 of file ProfileManager.cpp.
void ProfileManager::setDefaultProfile | ( | Profile::Ptr | profile | ) |
Sets the profile
as the default profile for creating new sessions.
Definition at line 415 of file ProfileManager.cpp.
void ProfileManager::setFavorite | ( | Profile::Ptr | profile, |
bool | favorite | ||
) |
Specifies whether a profile should be included in the user's list of favorite profiles.
Definition at line 442 of file ProfileManager.cpp.
void ProfileManager::setShortcut | ( | Profile::Ptr | profile, |
const QKeySequence & | shortcut | ||
) |
Associates a shortcut with a particular profile.
Definition at line 514 of file ProfileManager.cpp.
QKeySequence ProfileManager::shortcut | ( | Profile::Ptr | profile | ) | const |
Returns the shortcut associated with a particular profile.
Definition at line 622 of file ProfileManager.cpp.
|
signal |
Emitted when the shortcut for a profile is changed.
- Parameters
-
profile The profile whose status was changed newShortcut The new shortcut key sequence for the profile
QList< QKeySequence > ProfileManager::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.
Definition at line 600 of file ProfileManager.cpp.
QList< Profile::Ptr > ProfileManager::sortedFavorites | ( | ) |
Definition at line 288 of file ProfileManager.cpp.
void ProfileManager::sortProfiles | ( | QList< Profile::Ptr > & | list | ) |
Definition at line 230 of file ProfileManager.cpp.
The documentation for this class was generated from the following files:
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:31:25 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.