Application should not know about anying about ViewManager

The changes are basically adding a few small helper methods into
MainWindow to hide the existense of ViewManager to Application.
This commit is contained in:
Jekyll Wu
2012-02-27 02:25:07 +08:00
parent 7cdd8129f1
commit 9f52714558
3 changed files with 31 additions and 6 deletions

View File

@@ -97,6 +97,8 @@ MainWindow::MainWindow()
this , SLOT(newFromProfile(Profile::Ptr)));
connect(_viewManager , SIGNAL(newViewRequest()) ,
this , SLOT(newTab()));
connect(_viewManager , SIGNAL(viewDetached(Session*)) ,
this , SIGNAL(viewDetached(Session*)) );
// create main window widgets
setupWidgets();
@@ -454,7 +456,7 @@ Session* MainWindow::createSession(Profile::Ptr profile, const QString& director
// doesn't suffer a change in terminal size right after the session
// starts. Some applications such as GNU Screen and Midnight Commander
// don't like this happening
_viewManager->createView(session);
createView(session);
return session;
}
@@ -483,11 +485,21 @@ Session* MainWindow::createSSHSession(Profile::Ptr profile, const KUrl& url)
// doesn't suffer a change in terminal size right after the session
// starts. some applications such as GNU Screen and Midnight Commander
// don't like this happening
_viewManager->createView(session);
createView(session);
return session;
}
void MainWindow::createView(Session* session)
{
_viewManager->createView(session);
}
void MainWindow::setFocus()
{
_viewManager->activeView()->setFocus();
}
void MainWindow::newWindow()
{
Profile::Ptr defaultProfile = SessionManager::instance()->defaultProfile();