Don't switch tabs when a non-active session finishes ( Bug #146639 ). Begin implementation of Send Input to All in new front-end.

svn path=/trunk/KDE/kdebase/apps/konsole/; revision=674139
This commit is contained in:
Robert Knight
2007-06-11 20:44:04 +00:00
parent 13c7c0dfb9
commit 52db452aa4
8 changed files with 231 additions and 12 deletions

View File

@@ -254,13 +254,16 @@ void ViewManager::detachActiveView()
void ViewManager::sessionFinished()
{
// switch to the previous view before deleting the session views to prevent flicker
// occurring as a result of an interval between removing the active view and switching
// to the previous view
previousView();
Session* session = qobject_cast<Session*>(sender());
if ( _sessionMap[qobject_cast<TerminalDisplay*>(activeView())] == session )
{
// switch to the previous view before deleting the session views to prevent flicker
// occurring as a result of an interval between removing the active view and switching
// to the previous view
previousView();
}
Q_ASSERT(session);
QList<TerminalDisplay*> children = _viewSplitter->findChildren<TerminalDisplay*>();
@@ -406,7 +409,8 @@ SessionController* ViewManager::createController(Session* session , TerminalDisp
connect( controller , SIGNAL(focused(SessionController*)) , this , SIGNAL(activeViewChanged(SessionController*)) );
connect( session , SIGNAL(destroyed()) , controller , SLOT(deleteLater()) );
connect( view , SIGNAL(destroyed()) , controller , SLOT(deleteLater()) );
connect( controller , SIGNAL(sendInputToAll(bool)) , this , SLOT(sendInputToAll()) );
return controller;
}
@@ -644,6 +648,22 @@ QList<ViewProperties*> ViewManager::viewProperties() const
return list;
}
void ViewManager::sendInputToAll()
{
SessionGroup* group = new SessionGroup();
group->setMasterMode( SessionGroup::CopyInputToAll );
Session* activeSession = _sessionMap[qobject_cast<TerminalDisplay*>(activeView())];
if ( activeSession != 0 )
{
QListIterator<Session*> iter( SessionManager::instance()->sessions() );
while ( iter.hasNext() )
group->addSession(iter.next());
group->setMasterStatus(activeSession,true);
}
}
uint qHash(QPointer<TerminalDisplay> display)
{
return qHash((TerminalDisplay*)display);