summaryrefslogtreecommitdiff
authorjosef <josef>2002-10-26 11:56:08 (UTC)
committer josef <josef>2002-10-26 11:56:08 (UTC)
commit0d58e14f2bcfa2a1f5c9a197d5bb544571824207 (patch) (side-by-side diff)
tree86a60a7b02f5458263982a77d2d05f3b49672ced
parent88504fa6ed3e4ec1c11d3e1cde13c821b1a9b846 (diff)
downloadopie-0d58e14f2bcfa2a1f5c9a197d5bb544571824207.zip
opie-0d58e14f2bcfa2a1f5c9a197d5bb544571824207.tar.gz
opie-0d58e14f2bcfa2a1f5c9a197d5bb544571824207.tar.bz2
- Ah! That's how to use the widget stack
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index e3c3c38..936b1b2 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -543,101 +543,102 @@ void MainWindow::slotProfile( int id) {
void MainWindow::create( const Profile& prof ) {
if(m_curSession)
if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide();
Session *ses = manager()->fromProfile( prof, tabWidget() );
if((!ses) || (!ses->layer()) || (!ses->widgetStack()))
{
QMessageBox::warning(this,
QObject::tr("Session failed"),
QObject::tr("<qt>Cannot open session: Not all components were found.</qt>"));
//if(ses) delete ses;
return;
}
m_sessions.append( ses );
tabWidget()->add( ses );
tabWidget()->repaint();
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_fullscreen->setEnabled( true );
m_closewindow->setEnabled( true );
m_transfer->setEnabled( false );
m_recordScript->setEnabled( false );
m_saveScript->setEnabled( false );
m_scripts->setItemEnabled(m_runScript_id, false);
// 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();
m_kb->load(currentSession()->profile());
}
void MainWindow::slotTransfer()
{
if ( currentSession() ) {
Session *mysession = currentSession();
- TransferDialog dlg(mysession->widgetStack(), this);
+ TransferDialog dlg(/*mysession->widgetStack()*/this, this);
mysession->setTransferDialog(&dlg);
- dlg.show();
+ //dlg.reparent(mysession->widgetStack(), QPoint(0, 0));
//dlg.showMaximized();
- //currentSession()->widgetStack()->add(dlg);
+ currentSession()->widgetStack()->addWidget(&dlg, -1);
+ dlg.show();
//dlg.exec();
while(dlg.isRunning()) qApp->processEvents();
mysession->setTransferDialog(0l);
}
}
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(m_curSession)
if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide();
if(ses)
if(ses->transferDialog()) ses->transferDialog()->show();
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 );
m_recordScript->setEnabled(!m_curSession->emulationHandler()->isRecording());
m_saveScript->setEnabled(m_curSession->emulationHandler()->isRecording());
m_scripts->setItemEnabled(m_runScript_id, true);
} else {
m_connect->setEnabled( true );
m_disconnect->setEnabled( false );
m_recordScript->setEnabled( false );
m_saveScript->setEnabled( false );