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

Detailed Description
Represents a terminal set-up which can be used to set the initial state of new terminal sessions or applied to existing sessions.Profiles consist of a number of named properties, which can be retrieved using property() and set using setProperty(). isPropertySet() can be used to check whether a particular property has been set in a profile.
Profiles support a simple form of inheritance. When a new Profile is constructed, a pointer to a parent profile can be passed to the constructor. When querying a particular property of a profile using property(), the profile will return its own value for that property if one has been set or otherwise it will return the parent's value for that property.
Profiles can be loaded from disk using ProfileReader instances and saved to disk using ProfileWriter instances.
Definition at line 64 of file Profile.h.
Member Typedef Documentation
typedef KSharedPtr<ProfileGroup> Konsole::Profile::GroupPtr |
typedef KSharedPtr<Profile> Konsole::Profile::Ptr |
Member Enumeration Documentation
This enum describes the shapes used to draw the cursor in terminal displays.
This enum describes the modes available to remember lines of output produced by the terminal.
- Enumerator:
This enum describes the available properties which a Profile may consist of.
Properties can be set using setProperty() and read using property()
- Enumerator:
-
Path (QString) Path to the profile's configuration file on-disk. Name (QString) The descriptive name of this profile. Title (QString) Title of this profile that will be displayed. Icon (QString) The name of the icon associated with this profile. This is used in menus and tabs to represent the profile.
Command (QString) The command to execute ( excluding arguments ) when creating a new terminal session using this profile. Arguments (QStringList) The arguments which are passed to the program specified by the Command property when creating a new terminal session using this profile. Environment (QStringList) Additional environment variables ( in the form of NAME=VALUE pairs ) which are passed to the program specified by the Command property when creating a new terminal session using this profile. Directory (QString) The initial working directory for sessions created using this profile. LocalTabTitleFormat (QString) The format used for tab titles when running normal commands. RemoteTabTitleFormat (QString) The format used for tab titles when the session is running a remote command (eg. SSH)
ShowMenuBar (bool) Specifies whether the menu bar should be shown in the main application window. TabBarMode (TabBarModeEnum) Specifies when the tab bar should be shown in the main application window. Font (QFont) The font to use in terminal displays using this profile. ColorScheme (QString) The name of the color scheme to use in terminal displays using this profile. Color schemes are managed by the ColorSchemeManager class.
KeyBindings (QString) The name of the key bindings. Key bindings are managed by the KeyboardTranslatorManager class.
HistoryMode (HistoryModeEnum) Specifies the storage type used for keeping the output produced by terminal sessions using this profile. HistorySize (int) Specifies the number of lines of output to remember in terminal sessions using this profile. Once the limit is reached, the oldest lines are lost. Only applicable if the HistoryMode property is FixedSizeHistory
ScrollBarPosition (ScrollBarPositionEnum) Specifies the position of the scroll bar in terminal displays using this profile. BidiRenderingEnabled (bool) Specifies whether the terminal will enable Bidirectional text display BlinkingTextEnabled (bool) Specifies whether text in terminal displays is allowed to blink. FlowControlEnabled (bool) Specifies whether the flow control keys ( typically Ctrl+S , Ctrl+Q ) have any effect. Also known as Xon/Xoff
AllowProgramsToResizeWindow (bool) Specifies whether programs running in the terminal are allowed to resize the terminal display. BlinkingCursorEnabled (bool) Specifies whether the cursor blinks ( in a manner similar to text editing applications ) UseCustomCursorColor (bool) If true, terminal displays use a fixed color to draw the cursor, specified by the CustomCursorColor property. Otherwise the cursor changes color to match the character underneath it.
CursorShape (CursorShapeEnum) The shape used by terminal displays to represent the cursor. CustomCursorColor (QColor) The color used by terminal displays to draw the cursor. Only applicable if the UseCustomCursorColor property is true.
WordCharacters (QString) A string consisting of the characters used to delimit words when selecting text in the terminal display. TabBarPosition (TabBarPositionEnum) Position of the tab-bar relative to the terminal displays. DefaultEncoding (String) Default text codec AntiAliasFonts (bool) Whether fonts should be aliased or not StartInCurrentSessionDir (bool) Whether new sessions should be started in the same directory as the currently active session. ShowNewAndCloseTabButtons (bool) Whether a 'New Tab' and 'Close Tab' buttons should be shown on the tab bar
Constructor & Destructor Documentation
Profile::Profile | ( | Profile::Ptr | parent = Ptr() |
) | [explicit] |
Constructs a new profile.
- Parameters:
-
parent The parent profile. When querying the value of a property using property(), if the property has not been set in this profile then the parent's value for the property will be returned instead.
Definition at line 186 of file Profile.cpp.
Profile::~Profile | ( | ) | [virtual] |
Definition at line 214 of file Profile.cpp.
Member Function Documentation
QStringList Konsole::Profile::arguments | ( | ) | const [inline] |
Profile::GroupPtr Konsole::Profile::asGroup | ( | ) | [inline] |
const Profile::GroupPtr Konsole::Profile::asGroup | ( | ) | const [inline] |
void Profile::clone | ( | Profile::Ptr | profile, | |
bool | differentOnly = true | |||
) |
Copies all properties except Name and Path from the specified profile
into this profile.
- Parameters:
-
profile The profile to copy properties from differentOnly If true, only properties in profile
which have a different value from this profile's current value (either set via setProperty() or inherited from the parent profile) will be set.
Definition at line 191 of file Profile.cpp.
QString Konsole::Profile::colorScheme | ( | ) | const [inline] |
QString Konsole::Profile::command | ( | ) | const [inline] |
QString Konsole::Profile::defaultWorkingDirectory | ( | ) | const [inline] |
QStringList Konsole::Profile::environment | ( | ) | const [inline] |
QFont Konsole::Profile::font | ( | ) | const [inline] |
QString Konsole::Profile::icon | ( | ) | const [inline] |
bool Profile::isEmpty | ( | ) | const |
Returns true if no properties have been set in this Profile instance.
Definition at line 223 of file Profile.cpp.
bool Profile::isHidden | ( | ) | const |
Returns true if this is a 'hidden' profile which should not be displayed in menus or saved to disk.
This is used for the fallback profile, in case there are no profiles on disk which can be loaded, or for overlay profiles created to handle command-line arguments which change profile properties.
Definition at line 217 of file Profile.cpp.
bool Profile::isNameRegistered | ( | const QString & | name | ) | [static] |
Returns true if name
has been associated with an element from the Property enum or false otherwise.
Definition at line 240 of file Profile.cpp.
bool Profile::isPropertySet | ( | Property | property | ) | const [virtual] |
Returns true if the specified property has been set in this Profile instance.
Definition at line 235 of file Profile.cpp.
Profile::Property Profile::lookupByName | ( | const QString & | name | ) | [static] |
Returns the element from the Property enum associated with the specified name
.
- Parameters:
-
The name of the property to look for, this is case insensitive.
Definition at line 248 of file Profile.cpp.
QString Konsole::Profile::name | ( | ) | const [inline] |
Returns the string names associated with the specified property
from the Property enum, in the order the associations were created using registerName().
Definition at line 262 of file Profile.cpp.
const Profile::Ptr Profile::parent | ( | ) | const |
QString Konsole::Profile::path | ( | ) | const [inline] |
Returns the primary name for the specified property
.
TODO More documentation
Definition at line 255 of file Profile.cpp.
Returns the current value of the specified property
, cast to type T.
Internally properties are stored using the QVariant type and cast to T using QVariant::value<T>();
If the specified property
has not been set in this profile, and a non-null parent was specified in the Profile's constructor, the parent's value for property
will be returned.
void Profile::setHidden | ( | bool | hidden | ) |
Specifies whether this is a hidden profile.
See isHidden()
Definition at line 218 of file Profile.cpp.
void Profile::setParent | ( | Profile::Ptr | parent | ) |
Changes the parent profile.
When calling the property() method, if the specified property has not been set for this profile, the parent's value for the property will be returned instead.
Definition at line 220 of file Profile.cpp.
QHash< Profile::Property, QVariant > Profile::setProperties | ( | ) | const [virtual] |
Returns a map of the properties set in this Profile instance.
Definition at line 227 of file Profile.cpp.
Sets the value of the specified property
to value
.
Reimplemented in Konsole::ProfileGroup.
Definition at line 231 of file Profile.cpp.
The documentation for this class was generated from the following files: