summaryrefslogtreecommitdiff
path: root/noncore
authorjosef <josef>2002-10-20 16:39:25 (UTC)
committer josef <josef>2002-10-20 16:39:25 (UTC)
commit1f106a8b44ae659f30361588f53354e8f1985974 (patch) (side-by-side diff)
tree7d5fc441c776ec8ad5313350ea78c3289cca2bc2 /noncore
parentd3936c24518e9fea48a060eaef02e64a89646657 (diff)
downloadopie-1f106a8b44ae659f30361588f53354e8f1985974.zip
opie-1f106a8b44ae659f30361588f53354e8f1985974.tar.gz
opie-1f106a8b44ae659f30361588f53354e8f1985974.tar.bz2
- fix focus handling:
If a new session is created, it gets the focus. Likewise, if we switch the session. Before the patch, one had to click inside the term window to be able to type.
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 49f9653..afac542 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -414,92 +414,98 @@ void MainWindow::create( const Profile& prof ) {
return;
}
m_sessions.append( ses );
tabWidget()->add( ses );
m_curSession = ses;
// dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it
m_connect->setEnabled( true );
m_disconnect->setEnabled( false );
m_terminate->setEnabled( true );
m_transfer->setEnabled( true );
m_recordScript->setEnabled( true );
m_saveScript->setEnabled( true );
m_runScript->setEnabled( true );
m_fullscreen->setEnabled( true );
m_closewindow->setEnabled( true );
// is io_layer wants direct connection, then autoconnect
//if ( ( m_curSession->layer() )->supports()[0] == 1 ) {
if (prof.autoConnect()) {
slotConnect();
}
+
+ QWidget *w = currentSession()->widget();
+ if(w) w->setFocus();
}
void MainWindow::slotTransfer()
{
if ( currentSession() ) {
TransferDialog dlg(currentSession()->widgetStack(), this);
dlg.showMaximized();
//currentSession()->widgetStack()->add(dlg);
dlg.exec();
}
}
void MainWindow::slotOpenKeb(bool state) {
if (state) m_keyBar->show();
else m_keyBar->hide();
}
void MainWindow::slotOpenButtons( bool state ) {
if ( state ) {
m_buttonBar->show();
} else {
m_buttonBar->hide();
}
}
void MainWindow::slotSessionChanged( Session* ses ) {
qWarning("changed!");
if ( ses ) {
m_curSession = ses;
qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) );
if ( m_curSession->layer()->isConnected() ) {
m_connect->setEnabled( false );
m_disconnect->setEnabled( true );
} else {
m_connect->setEnabled( true );
m_disconnect->setEnabled( false );
}
+
+ QWidget *w = m_curSession->widget();
+ if(w) w->setFocus();
}
}
void MainWindow::slotFullscreen() {
if ( m_isFullscreen ) {
( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), false );
( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken );
setCentralWidget( m_consoleWindow );
( m_curSession->widgetStack() )->show();
( m_curSession->emulationHandler() )->cornerButton()->hide();
disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
} else {
savedParentFullscreen = ( m_curSession->widgetStack() )->parentWidget();
( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame );
( m_curSession->widgetStack() )->reparent( 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop
, QPoint(0,0), false );
( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() );
( m_curSession->widgetStack() )->setFocus();
( m_curSession->widgetStack() )->show();