Commit 8d27a2d3 authored by Kurt Hindenburg's avatar Kurt Hindenburg

Add new DBus method setCurrentSession

DBus slot that sets the current (active) session window using unique
session Id.

Differential Revision: https://phabricator.kde.org/D7066
parent fa10e567
......@@ -1106,6 +1106,19 @@ int ViewManager::currentSession()
return -1;
}
void ViewManager::setCurrentSession(int sessionId)
{
QHash<TerminalDisplay *, Session *>::const_iterator i;
for (i = _sessionMap.constBegin(); i != _sessionMap.constEnd(); ++i) {
if (i.value()->sessionId() == sessionId) {
ViewContainer *container = _viewSplitter->activeContainer();
if (container != nullptr) {
container->setActiveView(i.key());
}
}
}
}
int ViewManager::newSession()
{
Profile::Ptr profile = ProfileManager::instance()->defaultProfile();
......
......@@ -241,6 +241,9 @@ public Q_SLOTS:
/** DBus slot that returns the current (active) session window */
Q_SCRIPTABLE int currentSession();
/** DBus slot that sets the current (active) session window */
Q_SCRIPTABLE void setCurrentSession(int sessionId);
/** DBus slot that creates a new session in the current view.
* @param profile the name of the profile to be used
* started.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment