• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • applications API Reference
  • KDE Home
  • Contact Us
 

Konsole

  • Konsole
  • ProfileManager
Public Slots | Signals | Public Member Functions | Static Public Member Functions | List of all members
Konsole::ProfileManager Class Reference

#include <ProfileManager.h>

Inheritance diagram for Konsole::ProfileManager:
Inheritance graph
[legend]

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)
 

Public Member Functions

 ProfileManager ()
 
virtual ~ProfileManager ()
 
void addProfile (Profile::Ptr type)
 
QList< Profile::Ptr > allProfiles ()
 
QStringList availableProfileNames () const
 
QStringList availableProfilePaths () const
 
void changeProfile (Profile::Ptr profile, QHash< Profile::Property, QVariant > propertyMap, bool persistent=true)
 
Profile::Ptr defaultProfile () const
 
bool deleteProfile (Profile::Ptr profile)
 
Profile::Ptr fallbackProfile () const
 
Profile::Ptr findByShortcut (const QKeySequence &shortcut)
 
QSet< Profile::Ptr > findFavorites ()
 
void loadAllProfiles ()
 
QList< Profile::Ptr > loadedProfiles () const
 
Profile::Ptr loadProfile (const QString &path)
 
void setDefaultProfile (Profile::Ptr profile)
 
void setFavorite (Profile::Ptr profile, bool favorite)
 
void setShortcut (Profile::Ptr profile, const QKeySequence &shortcut)
 
QKeySequence shortcut (Profile::Ptr profile) const
 
QList< QKeySequence > shortcuts ()
 
QList< Profile::Ptr > sortedFavorites ()
 
void sortProfiles (QList< Profile::Ptr > &list)
 
- Public Member Functions inherited from QObject
 QObject (QObject *parent)
 
 QObject (QObject *parent, const char *name)
 
virtual  ~QObject ()
 
bool blockSignals (bool block)
 
QObject * child (const char *objName, const char *inheritsClass, bool recursiveSearch) const
 
const QObjectList & children () const
 
const char * className () const
 
bool connect (const QObject *sender, const char *signal, const char *method, Qt::ConnectionType type) const
 
void deleteLater ()
 
void destroyed (QObject *obj)
 
bool disconnect (const QObject *receiver, const char *method)
 
bool disconnect (const char *signal, const QObject *receiver, const char *method)
 
void dumpObjectInfo ()
 
void dumpObjectTree ()
 
QList< QByteArray > dynamicPropertyNames () const
 
virtual bool event (QEvent *e)
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 
T findChild (const QString &name) const
 
QList< T > findChildren (const QRegExp &regExp) const
 
QList< T > findChildren (const QString &name) const
 
bool inherits (const char *className) const
 
void insertChild (QObject *object)
 
void installEventFilter (QObject *filterObj)
 
bool isA (const char *className) const
 
bool isWidgetType () const
 
void killTimer (int id)
 
virtual const QMetaObject * metaObject () const
 
void moveToThread (QThread *targetThread)
 
const char * name () const
 
const char * name (const char *defaultName) const
 
QString objectName () const
 
QObject * parent () const
 
QVariant property (const char *name) const
 
void removeChild (QObject *object)
 
void removeEventFilter (QObject *obj)
 
void setName (const char *name)
 
void setObjectName (const QString &name)
 
void setParent (QObject *parent)
 
bool setProperty (const char *name, const QVariant &value)
 
bool signalsBlocked () const
 
int startTimer (int interval)
 
QThread * thread () const
 

Static Public Member Functions

static ProfileManager * instance ()
 
- Static Public Member Functions inherited from QObject
bool connect (const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
 
bool connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type)
 
bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *method)
 
bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method)
 
QString tr (const char *sourceText, const char *disambiguation, int n)
 
QString trUtf8 (const char *sourceText, const char *disambiguation, int n)
 

Additional Inherited Members

- Protected Member Functions inherited from QObject
bool checkConnectArgs (const char *signal, const QObject *object, const char *method)
 
virtual void childEvent (QChildEvent *event)
 
virtual void connectNotify (const char *signal)
 
virtual void customEvent (QEvent *event)
 
virtual void disconnectNotify (const char *signal)
 
int receivers (const char *signal) const
 
QObject * sender () const
 
int senderSignalIndex () const
 
virtual void timerEvent (QTimerEvent *event)
 
- Static Protected Member Functions inherited from QObject
QByteArray normalizeSignalSlot (const char *signalSlot)
 
- Properties inherited from QObject
 objectName
 

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.

ProfileManager::~ProfileManager ( )
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
profileThe profile to change
propertyMapA map between profile properties and values describing the changes
persistentIf 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.

void Konsole::ProfileManager::favoriteStatusChanged ( Profile::Ptr  profile,
bool  favorite 
)
signal

Emitted when the favorite status of a profile changes.

Parameters
profileThe profile to change
favoriteSpecifies 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.

ProfileManager * ProfileManager::instance ( )
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.

void Konsole::ProfileManager::profileAdded ( Profile::Ptr  ptr)
signal

Emitted when a profile is added to the manager.

void Konsole::ProfileManager::profileChanged ( Profile::Ptr  ptr)
signal

Emitted when a profile's properties are modified.

void Konsole::ProfileManager::profileRemoved ( Profile::Ptr  ptr)
signal

Emitted when a profile is removed from the manager.

void ProfileManager::saveSettings ( )
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.

void Konsole::ProfileManager::shortcutChanged ( Profile::Ptr  profile,
const QKeySequence &  newShortcut 
)
signal

Emitted when the shortcut for a profile is changed.

Parameters
profileThe profile whose status was changed
newShortcutThe 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:
  • ProfileManager.h
  • ProfileManager.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat May 9 2020 03:56:28 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

Konsole

Skip menu "Konsole"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

applications API Reference

Skip menu "applications API Reference"
  •   kate
  •       kate
  •   KTextEditor
  •   Kate
  • Konsole

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal