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

Konsole

  • Konsole
  • Part
Public Slots | Signals | Public Member Functions | Protected Member Functions | List of all members
Konsole::Part Class Reference

#include <Part.h>

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

Public Slots

void changeSessionSettings (const QString &text)
 
void createSession (const QString &profileName=QString(), const QString &directory=QString())
 
QString currentWorkingDirectory () const
 
void openTeletype (int ptyMasterFd)
 
QStringList profileNameList () const
 
void setMonitorActivityEnabled (bool enabled)
 
void setMonitorSilenceEnabled (bool enabled)
 
void showEditCurrentProfileDialog (QWidget *parent)
 
void showManageProfilesDialog (QWidget *parent)
 

Signals

void activityDetected ()
 
void currentDirectoryChanged (const QString &dir)
 
void overrideShortcut (QKeyEvent *event, bool &override)
 
void silenceDetected ()
 

Public Member Functions

 Part (QWidget *parentWidget, QObject *parent, const QVariantList &)
 
virtual ~Part ()
 
virtual int foregroundProcessId ()
 
virtual QString foregroundProcessName ()
 
virtual void sendInput (const QString &text)
 
virtual void showShellInDir (const QString &dir)
 
virtual void startProgram (const QString &program, const QStringList &arguments)
 
virtual int terminalProcessId ()
 

Protected Member Functions

virtual bool openFile ()
 
virtual bool openUrl (const KUrl &url)
 

Detailed Description

A re-usable terminal emulator component using the KParts framework which can be used to embed terminal emulators into other applications.

Definition at line 48 of file Part.h.

Constructor & Destructor Documentation

Part::Part ( QWidget *  parentWidget,
QObject *  parent,
const QVariantList &   
)
explicit

Constructs a new Konsole part with the specified parent.

Definition at line 51 of file Part.cpp.

Part::~Part ( )
virtual

Definition at line 89 of file Part.cpp.

Member Function Documentation

void Konsole::Part::activityDetected ( )
signal

Emitted when activity has been detected in the active session.

Monitoring for activity has to be enabled first using setMonitorActivityEnabled().

void Part::changeSessionSettings ( const QString &  text)
slot

Sends a profile change command to the active session.

This is equivalent to using the konsoleprofile tool within the session to change its settings. The text string is a semi-colon separated list of property=value pairs, eg. "colors=Linux Colors"

See the documentation for konsoleprofile for information on the format of text

This is experimental API and not guaranteed to be present in later KDE 4 releases.

Definition at line 313 of file Part.cpp.

void Part::createSession ( const QString &  profileName = QString(),
const QString &  directory = QString() 
)
slot

creates and run a session using the specified profile and directory

Parameters
profileNameSpecifies the name of the profile to create session
directoryspecifies The initial working directory of the created session

This is highly experimental. Do not use it at the moment

Definition at line 211 of file Part.cpp.

void Konsole::Part::currentDirectoryChanged ( const QString &  dir)
signal

Emitted when the current working directory of the active session has changed.

QString Part::currentWorkingDirectory ( ) const
slot

Returns the current working directory of the active session.

TODO: this should better be moved into TerminalInterfaceV2.

Definition at line 204 of file Part.cpp.

int Part::foregroundProcessId ( )
virtual

Reimplemented from TerminalInterfaceV2.

Definition at line 182 of file Part.cpp.

QString Part::foregroundProcessName ( )
virtual

Reimplemented from TerminalInterfaceV2.

Definition at line 193 of file Part.cpp.

bool Part::openFile ( )
protectedvirtual

Reimplemented from KParts::PartBase.

Definition at line 106 of file Part.cpp.

void Part::openTeletype ( int  ptyMasterFd)
slot

Connects to an existing pseudo-teletype.

See Session::openTeletype(). This must be called before the session is started by startProgram(), or showShellInDir()

Parameters
ptyMasterFdThe file descriptor of the pseudo-teletype (pty) master

Definition at line 148 of file Part.cpp.

bool Part::openUrl ( const KUrl &  url)
protectedvirtual

Definition at line 326 of file Part.cpp.

void Konsole::Part::overrideShortcut ( QKeyEvent *  event,
bool &  override 
)
signal

Emitted when the key sequence for a shortcut, which is also a valid terminal key sequence, is pressed while the terminal has focus.

By responding to this signal, the controlling application can choose whether to execute the action associated with the shortcut or ignore the shortcut and send the key sequence to the terminal application.

In the embedded terminal, shortcuts are overridden and sent to the terminal by default. Set override to false to prevent this happening and allow the shortcut to be triggered normally.

overrideShortcut() is not called for shortcuts which are not valid terminal key sequences, eg. shortcuts with two or more modifiers.

Parameters
eventDescribes the keys that were pressed.
overrideSet this to false to prevent the terminal display from overriding the shortcut
QStringList Part::profileNameList ( ) const
slot

Returns a list of names of all available profiles.

This is highly experimental. Do not use it at the moment

Definition at line 228 of file Part.cpp.

void Part::sendInput ( const QString &  text)
virtual

Reimplemented from TerminalInterface.

Definition at line 169 of file Part.cpp.

void Part::setMonitorActivityEnabled ( bool  enabled)
slot

Toggles monitoring for activity in the active session.

If activity is detected, the activityDetected() signal is emitted.

Parameters
enabledWhether to enable or disable monitoring for activity.

Definition at line 367 of file Part.cpp.

void Part::setMonitorSilenceEnabled ( bool  enabled)
slot

Toggles monitoring for silence in the active session.

If silence is detected, the silenceDetected() signal is emitted.

Parameters
enabledWhether to enable or disable monitoring for silence.

Definition at line 354 of file Part.cpp.

void Part::showEditCurrentProfileDialog ( QWidget *  parent)
slot

Shows the dialog used to edit the profile used by the active session.

The dialog will be non-modal and will delete itself when it is closed.

This is experimental API and not guaranteed to be present in later KDE 4 releases.

Parameters
parentThe parent widget of the new dialog.

Definition at line 303 of file Part.cpp.

void Part::showManageProfilesDialog ( QWidget *  parent)
slot

Shows the dialog used to manage profiles in Konsole.

The dialog will be non-modal and will delete itself when it is closed.

This is experimental API and not guaranteed to be present in later KDE 4 releases.

Parameters
parentThe parent widget of the new dialog.

Definition at line 295 of file Part.cpp.

void Part::showShellInDir ( const QString &  dir)
virtual

Reimplemented from TerminalInterface.

Definition at line 155 of file Part.cpp.

void Konsole::Part::silenceDetected ( )
signal

Emitted when silence has been detected in the active session.

Monitoring for silence has to be enabled first using setMonitorSilenceEnabled().

void Part::startProgram ( const QString &  program,
const QStringList &  arguments 
)
virtual

Reimplemented from TerminalInterface.

Definition at line 131 of file Part.cpp.

int Part::terminalProcessId ( )
virtual

Reimplemented from TerminalInterfaceV2.

Definition at line 175 of file Part.cpp.


The documentation for this class was generated from the following files:
  • Part.h
  • Part.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