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

Detailed Description
Provides the menu actions to manipulate a single terminal session and view pair.The actions provided by this class are defined in the sessionui.rc XML file.
SessionController monitors the session and provides access to basic information about the session such as title(), icon() and currentDir(). SessionController provides notifications of activity in the session via the activity() signal.
When the controlled view receives the focus, the focused() signal is emitted with a pointer to the controller. This can be used by main application window which contains the view to plug the controller's actions into the menu when the view is focused.
Definition at line 84 of file SessionController.h.
Public Slots | |
void | openUrl (const KUrl &url) |
Signals | |
void | focused (SessionController *controller) |
Public Member Functions | |
virtual bool | confirmClose () const |
virtual QString | currentDir () const |
virtual bool | eventFilter (QObject *watched, QEvent *event) |
bool | isValid () const |
virtual void | rename () |
IncrementalSearchBar * | searchBar () const |
QPointer< Session > | session () |
SessionController (Session *session, TerminalDisplay *view, QObject *parent) | |
void | setSearchBar (IncrementalSearchBar *searchBar) |
void | setShowMenuAction (QAction *action) |
virtual KUrl | url () const |
QPointer< TerminalDisplay > | view () |
~SessionController () |
Constructor & Destructor Documentation
SessionController::SessionController | ( | Session * | session, | |
TerminalDisplay * | view, | |||
QObject * | parent | |||
) |
Constructs a new SessionController which operates on session
and view
.
Definition at line 73 of file SessionController.cpp.
SessionController::~SessionController | ( | ) |
Definition at line 169 of file SessionController.cpp.
Member Function Documentation
bool SessionController::confirmClose | ( | ) | const [virtual] |
Sub-classes may re-implement this method to display a message to the user to allow them to confirm whether to close a view.
The default implementation always returns true
Reimplemented from Konsole::ViewProperties.
Definition at line 688 of file SessionController.cpp.
QString SessionController::currentDir | ( | ) | const [virtual] |
Returns the current directory associated with a view.
This may be the same as url() The default implementation returns an empty string.
Reimplemented from Konsole::ViewProperties.
Definition at line 251 of file SessionController.cpp.
void Konsole::SessionController::focused | ( | SessionController * | controller | ) | [signal] |
Emitted when the view associated with the controller is focused.
This can be used by other classes to plug the controller's actions into a window's menus.
bool Konsole::SessionController::isValid | ( | ) | const [inline] |
Returns true if the controller is valid.
A valid controller is one which has a non-null session() and view().
Equivalent to "!session().isNull() && !view().isNull()"
Definition at line 262 of file SessionController.h.
void SessionController::openUrl | ( | const KUrl & | url | ) | [slot] |
Issues a command to the session to navigate to the specified URL.
This may not succeed if the foreground program does not understand the command sent to it ( 'cd path' for local URLs ) or is not responding to input.
openUrl() currently supports urls for local paths and those using the 'ssh' protocol ( eg. ssh://joebloggs )
Definition at line 318 of file SessionController.cpp.
void SessionController::rename | ( | ) | [virtual] |
Requests the renaming of this view.
The default implementation does nothing.
Reimplemented from Konsole::ViewProperties.
Definition at line 313 of file SessionController.cpp.
IncrementalSearchBar * SessionController::searchBar | ( | ) | const |
Returns the session associated with this controller.
Definition at line 97 of file SessionController.h.
void SessionController::setSearchBar | ( | IncrementalSearchBar * | searchBar | ) |
Sets the widget used for searches through the session's output.
When the user clicks on the "Search Output" menu action the searchBar
's show() method will be called. The SessionController will then connect to the search bar's signals to update the search when the widget's controls are pressed.
Definition at line 402 of file SessionController.cpp.
void SessionController::setShowMenuAction | ( | QAction * | action | ) |
Sets the action displayed in the session's context menu to hide or show the menu bar.
Definition at line 433 of file SessionController.cpp.
KUrl SessionController::url | ( | ) | const [virtual] |
Returns the URL current associated with a view.
The default implementation returns an empty URL.
Reimplemented from Konsole::ViewProperties.
Definition at line 267 of file SessionController.cpp.
QPointer<TerminalDisplay> Konsole::SessionController::view | ( | ) | [inline] |
Returns the view associated with this controller.
Definition at line 99 of file SessionController.h.
The documentation for this class was generated from the following files: