summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/mainwindow.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp24
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
@@ -525,24 +525,27 @@ void MainWindow::slotClose() {
525} 525}
526 526
527/* 527/*
528 * We will get the name 528 * We will get the name
529 * Then the profile 529 * Then the profile
530 * and then we will make a profile 530 * and then we will make a profile
531 */ 531 */
532void MainWindow::slotProfile( int id) { 532void 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}
536void MainWindow::create( const Profile& prof ) { 536void 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"),
543 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>")); 546 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>"));
544 //if(ses) delete ses; 547 //if(ses) delete ses;
545 return; 548 return;
546 } 549 }
547 550
548 m_sessions.append( ses ); 551 m_sessions.append( ses );
@@ -569,28 +572,33 @@ void MainWindow::create( const Profile& prof ) {
569 572
570 573
571 574
572 QWidget *w = currentSession()->widget(); 575 QWidget *w = currentSession()->widget();
573 if(w) w->setFocus(); 576 if(w) w->setFocus();
574 577
575 m_kb->load(currentSession()->profile()); 578 m_kb->load(currentSession()->profile());
576} 579}
577 580
578void MainWindow::slotTransfer() 581void 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
589void MainWindow::slotOpenKeb(bool state) { 597void MainWindow::slotOpenKeb(bool state) {
590 598
591 if (state) m_keyBar->show(); 599 if (state) m_keyBar->show();
592 else m_keyBar->hide(); 600 else m_keyBar->hide();
593 601
594} 602}
595 603
596 604
@@ -598,51 +606,53 @@ void MainWindow::slotOpenButtons( bool state ) {
598 606
599 if ( state ) { 607 if ( state ) {
600 m_buttonBar->show(); 608 m_buttonBar->show();
601 } else { 609 } else {
602 m_buttonBar->hide(); 610 m_buttonBar->hide();
603 } 611 }
604} 612}
605 613
606 614
607 615
608void MainWindow::slotSessionChanged( Session* ses ) { 616void 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 );
616 m_recordScript->setEnabled(!m_curSession->emulationHandler()->isRecording()); 630 m_recordScript->setEnabled(!m_curSession->emulationHandler()->isRecording());
617 m_saveScript->setEnabled(m_curSession->emulationHandler()->isRecording()); 631 m_saveScript->setEnabled(m_curSession->emulationHandler()->isRecording());
618 m_scripts->setItemEnabled(m_runScript_id, true); 632 m_scripts->setItemEnabled(m_runScript_id, true);
619 } else { 633 } else {
620 m_connect->setEnabled( true ); 634 m_connect->setEnabled( true );
621 m_disconnect->setEnabled( false ); 635 m_disconnect->setEnabled( false );
622 m_recordScript->setEnabled( false ); 636 m_recordScript->setEnabled( false );
623 m_saveScript->setEnabled( false ); 637 m_saveScript->setEnabled( false );
624 m_scripts->setItemEnabled(m_runScript_id, false); 638 m_scripts->setItemEnabled(m_runScript_id, false);
625 } 639 }
626 640
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}
643 653
644void MainWindow::slotFullscreen() { 654void MainWindow::slotFullscreen() {
645 655
646 656
647 657
648 if ( m_isFullscreen ) { 658 if ( m_isFullscreen ) {