Commit 403cae69 authored by Robert Knight's avatar Robert Knight
Browse files

Add a new view to each container when a new session is created. Resizing the...

Add a new view to each container when a new session is created.  Resizing the split-view gets quite slow if there are lots of sessions open, will need to address that later.

svn path=/branches/work/konsole-split-view/; revision=602990
parent 8774a555
......@@ -10,6 +10,10 @@ TODO before merging with /trunk
- Prompt user when closing a session. Ensure the same close prompt
is shown no matter how the user closes the session.
- Resizing a split view is currently quite slow, presumably because of the work
done in TEWidget::resizeEvent() for each view.
Find some way to fix this situation.
- Ensure that when a new session is created, new views are created in all active containers.
- Update colour scheme of all views when user selects a new scheme via the Settings menu.
......
......@@ -433,6 +433,11 @@ TEWidget::TEWidget(QWidget *parent)
setLayout( gridLayout );
setLineWidth(0);
//set up a warning message when the user presses Ctrl+S to avoid confusion
connect( this,SIGNAL(flowControlKeyPressed(bool)),this,SLOT(outputSuspended(bool)) );
}
//FIXME: make proper destructor
......
......@@ -75,6 +75,11 @@ public:
* is the ViewSplitter widget at the top of the hierarchy.
*/
ViewContainer* activeContainer() const;
/**
* Returns a list of the containers held by this splitter
*/
QList<ViewContainer*> containers() const {return _containers;}
signals:
/** Signal emitted when the last child widget is removed from the splitter */
......
......@@ -2830,6 +2830,25 @@ TEWidget* Konsole::createSessionView(TESession* session /*session*/)
return display;
}
void Konsole::createViews(TESession* session)
{
NavigationItem* item = session->navigationItem();
ViewContainer* const activeContainer = _view->activeSplitter()->activeContainer();
QListIterator<ViewContainer*> containerIter(_view->containers());
while (containerIter.hasNext())
{
ViewContainer* container = containerIter.next();
TEWidget* display = createSessionView(session);
container->addView(display,item);
if ( container == activeContainer )
container->setActiveView(display);
session->addView( display );
}
}
TESession* Konsole::newSession(SessionInfo* type)
{
//create a session and attach the display to it
......@@ -2846,12 +2865,7 @@ TESession* Konsole::newSession(SessionInfo* type)
else
session->setHistory(HistoryTypeNone());
NavigationItem* item = session->navigationItem();
ViewContainer* container = _view->activeSplitter()->activeContainer();
TEWidget* display = createSessionView(session);
container->addView(display,item);
container->setActiveView(display);
session->addView( display );
createViews( session );
//set color scheme
ColorSchema* sessionScheme = colors->find( type->colorScheme() );
......@@ -2914,11 +2928,10 @@ TESession* Konsole::newSession(SessionInfo* type)
this,SLOT(changeTabTextColor(TESession*, int)) );
//set up a warning message when the user presses Ctrl+S to avoid confusion
connect( display,SIGNAL(flowControlKeyPressed(bool)),display,SLOT(outputSuspended(bool)) );
//SPLIT-VIEW Fix
//activate and run
te = display;
te = session->primaryView(); //display;
addSession(session);
runSession(session);
......
......@@ -289,6 +289,7 @@ private:
void resetScreenSessions();
TEWidget* createSessionView(TESession* session);
void createViews(TESession* session);
// void initTEWidget(TEWidget* new_te, TEWidget* default_te);
......
Supports Markdown
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