Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index c44b359..5f6dc12 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -531,12 +531,15 @@ void MainWindow::slotClose() { | |||
531 | */ | 531 | */ |
532 | void MainWindow::slotProfile( int id) { | 532 | void MainWindow::slotProfile( int id) { |
533 | Profile prof = manager()->profile( m_sessionsPop->text( id) ); | 533 | Profile prof = manager()->profile( m_sessionsPop->text( id) ); |
534 | create( prof ); | 534 | create( prof ); |
535 | } | 535 | } |
536 | void MainWindow::create( const Profile& prof ) { | 536 | void MainWindow::create( const Profile& prof ) { |
537 | if(m_curSession) | ||
538 | if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); | ||
539 | |||
537 | Session *ses = manager()->fromProfile( prof, tabWidget() ); | 540 | Session *ses = manager()->fromProfile( prof, tabWidget() ); |
538 | 541 | ||
539 | if((!ses) || (!ses->layer()) || (!ses->widgetStack())) | 542 | if((!ses) || (!ses->layer()) || (!ses->widgetStack())) |
540 | { | 543 | { |
541 | QMessageBox::warning(this, | 544 | QMessageBox::warning(this, |
542 | QObject::tr("Session failed"), | 545 | QObject::tr("Session failed"), |
@@ -575,16 +578,21 @@ void MainWindow::create( const Profile& prof ) { | |||
575 | m_kb->load(currentSession()->profile()); | 578 | m_kb->load(currentSession()->profile()); |
576 | } | 579 | } |
577 | 580 | ||
578 | void MainWindow::slotTransfer() | 581 | void MainWindow::slotTransfer() |
579 | { | 582 | { |
580 | if ( currentSession() ) { | 583 | if ( currentSession() ) { |
581 | TransferDialog dlg(currentSession()->widgetStack(), this); | 584 | Session *mysession = currentSession(); |
582 | dlg.showMaximized(); | 585 | TransferDialog dlg(mysession->widgetStack(), this); |
586 | mysession->setTransferDialog(&dlg); | ||
587 | dlg.show(); | ||
588 | //dlg.showMaximized(); | ||
583 | //currentSession()->widgetStack()->add(dlg); | 589 | //currentSession()->widgetStack()->add(dlg); |
584 | dlg.exec(); | 590 | //dlg.exec(); |
591 | while(dlg.isRunning()) qApp->processEvents(); | ||
592 | mysession->setTransferDialog(0l); | ||
585 | } | 593 | } |
586 | } | 594 | } |
587 | 595 | ||
588 | 596 | ||
589 | void MainWindow::slotOpenKeb(bool state) { | 597 | void MainWindow::slotOpenKeb(bool state) { |
590 | 598 | ||
@@ -604,12 +612,18 @@ void MainWindow::slotOpenButtons( bool state ) { | |||
604 | } | 612 | } |
605 | 613 | ||
606 | 614 | ||
607 | 615 | ||
608 | void MainWindow::slotSessionChanged( Session* ses ) { | 616 | void MainWindow::slotSessionChanged( Session* ses ) { |
609 | qWarning("changed!"); | 617 | qWarning("changed!"); |
618 | |||
619 | if(m_curSession) | ||
620 | if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); | ||
621 | if(ses) | ||
622 | if(ses->transferDialog()) ses->transferDialog()->show(); | ||
623 | |||
610 | if ( ses ) { | 624 | if ( ses ) { |
611 | m_curSession = ses; | 625 | m_curSession = ses; |
612 | qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); | 626 | qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); |
613 | if ( m_curSession->layer()->isConnected() ) { | 627 | if ( m_curSession->layer()->isConnected() ) { |
614 | m_connect->setEnabled( false ); | 628 | m_connect->setEnabled( false ); |
615 | m_disconnect->setEnabled( true ); | 629 | m_disconnect->setEnabled( true ); |
@@ -627,16 +641,12 @@ void MainWindow::slotSessionChanged( Session* ses ) { | |||
627 | if ( ( m_curSession->layer() )->supports()[1] == 0 ) { | 641 | if ( ( m_curSession->layer() )->supports()[1] == 0 ) { |
628 | m_transfer->setEnabled( false ); | 642 | m_transfer->setEnabled( false ); |
629 | } else { | 643 | } else { |
630 | m_transfer->setEnabled( true ); | 644 | m_transfer->setEnabled( true ); |
631 | } | 645 | } |
632 | 646 | ||
633 | |||
634 | |||
635 | |||
636 | |||
637 | QWidget *w = m_curSession->widget(); | 647 | QWidget *w = m_curSession->widget(); |
638 | if(w) w->setFocus(); | 648 | if(w) w->setFocus(); |
639 | 649 | ||
640 | m_kb->load(currentSession()->profile()); | 650 | m_kb->load(currentSession()->profile()); |
641 | } | 651 | } |
642 | } | 652 | } |