summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 27407d9..cf1fbc3 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -387,147 +387,147 @@ void MainWindow::slotClose() {
387 m_terminate->setEnabled( false ); 387 m_terminate->setEnabled( false );
388 m_transfer->setEnabled( false ); 388 m_transfer->setEnabled( false );
389 m_recordScript->setEnabled( false ); 389 m_recordScript->setEnabled( false );
390 m_saveScript->setEnabled( false ); 390 m_saveScript->setEnabled( false );
391 m_runScript->setEnabled( false ); 391 m_runScript->setEnabled( false );
392 m_fullscreen->setEnabled( false ); 392 m_fullscreen->setEnabled( false );
393 m_closewindow->setEnabled( false ); 393 m_closewindow->setEnabled( false );
394 } 394 }
395} 395}
396 396
397/* 397/*
398 * We will get the name 398 * We will get the name
399 * Then the profile 399 * Then the profile
400 * and then we will make a profile 400 * and then we will make a profile
401 */ 401 */
402void MainWindow::slotProfile( int id) { 402void MainWindow::slotProfile( int id) {
403 Profile prof = manager()->profile( m_sessionsPop->text( id) ); 403 Profile prof = manager()->profile( m_sessionsPop->text( id) );
404 create( prof ); 404 create( prof );
405} 405}
406void MainWindow::create( const Profile& prof ) { 406void MainWindow::create( const Profile& prof ) {
407 Session *ses = manager()->fromProfile( prof, tabWidget() ); 407 Session *ses = manager()->fromProfile( prof, tabWidget() );
408 408
409 if((!ses) || (!ses->layer()) || (!ses->widgetStack())) 409 if((!ses) || (!ses->layer()) || (!ses->widgetStack()))
410 { 410 {
411 QMessageBox::warning(this, 411 QMessageBox::warning(this,
412 QObject::tr("Session failed"), 412 QObject::tr("Session failed"),
413 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>")); 413 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>"));
414 //if(ses) delete ses; 414 //if(ses) delete ses;
415 return; 415 return;
416 } 416 }
417 417
418 m_sessions.append( ses ); 418 m_sessions.append( ses );
419 tabWidget()->add( ses ); 419 tabWidget()->add( ses );
420 m_curSession = ses; 420 m_curSession = ses;
421 421
422 // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it 422 // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it
423 m_connect->setEnabled( true ); 423 m_connect->setEnabled( true );
424 m_disconnect->setEnabled( false ); 424 m_disconnect->setEnabled( false );
425 m_terminate->setEnabled( true ); 425 m_terminate->setEnabled( true );
426 m_transfer->setEnabled( true ); 426 m_transfer->setEnabled( true );
427 m_recordScript->setEnabled( true ); 427 m_recordScript->setEnabled( true );
428 m_saveScript->setEnabled( true ); 428 m_saveScript->setEnabled( true );
429 m_runScript->setEnabled( true ); 429 m_runScript->setEnabled( true );
430 m_fullscreen->setEnabled( true ); 430 m_fullscreen->setEnabled( true );
431 m_closewindow->setEnabled( true ); 431 m_closewindow->setEnabled( true );
432 432
433 433
434 // is io_layer wants direct connection, then autoconnect 434 // is io_layer wants direct connection, then autoconnect
435 if ( ( m_curSession->layer() )->supports()[0] = 1 ) { 435 if ( ( m_curSession->layer() )->supports()[0] == 1 ) {
436 slotConnect(); 436 slotConnect();
437 } 437 }
438} 438}
439 439
440void MainWindow::slotTransfer() 440void MainWindow::slotTransfer()
441{ 441{
442 if ( currentSession() ) { 442 if ( currentSession() ) {
443 TransferDialog dlg(currentSession()->widgetStack(), this); 443 TransferDialog dlg(currentSession()->widgetStack(), this);
444 dlg.showMaximized(); 444 dlg.showMaximized();
445 //currentSession()->widgetStack()->add(dlg); 445 //currentSession()->widgetStack()->add(dlg);
446 dlg.exec(); 446 dlg.exec();
447 } 447 }
448} 448}
449 449
450 450
451void MainWindow::slotOpenKeb(bool state) { 451void MainWindow::slotOpenKeb(bool state) {
452 452
453 if (state) m_keyBar->show(); 453 if (state) m_keyBar->show();
454 else m_keyBar->hide(); 454 else m_keyBar->hide();
455 455
456} 456}
457 457
458 458
459void MainWindow::slotOpenButtons( bool state ) { 459void MainWindow::slotOpenButtons( bool state ) {
460 460
461 if ( state ) { 461 if ( state ) {
462 m_buttonBar->show(); 462 m_buttonBar->show();
463 } else { 463 } else {
464 m_buttonBar->hide(); 464 m_buttonBar->hide();
465 } 465 }
466} 466}
467 467
468 468
469 469
470void MainWindow::slotSessionChanged( Session* ses ) { 470void MainWindow::slotSessionChanged( Session* ses ) {
471 qWarning("changed!"); 471 qWarning("changed!");
472 if ( ses ) { 472 if ( ses ) {
473 m_curSession = ses; 473 m_curSession = ses;
474 qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) ); 474 qDebug(QString("is connected : %1").arg( m_curSession->layer()->isConnected() ) );
475 if ( m_curSession->layer()->isConnected() ) { 475 if ( m_curSession->layer()->isConnected() ) {
476 m_connect->setEnabled( false ); 476 m_connect->setEnabled( false );
477 m_disconnect->setEnabled( true ); 477 m_disconnect->setEnabled( true );
478 } else { 478 } else {
479 m_connect->setEnabled( true ); 479 m_connect->setEnabled( true );
480 m_disconnect->setEnabled( false ); 480 m_disconnect->setEnabled( false );
481 } 481 }
482 } 482 }
483} 483}
484 484
485void MainWindow::slotFullscreen() { 485void MainWindow::slotFullscreen() {
486 486
487 487
488 488
489 if ( m_isFullscreen ) { 489 if ( m_isFullscreen ) {
490 ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), false ); 490 ( m_curSession->widgetStack() )->reparent( savedParentFullscreen, 0, QPoint(0,0), false );
491 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken ); 491 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::Panel | QFrame::Sunken );
492 492
493 setCentralWidget( m_consoleWindow ); 493 setCentralWidget( m_consoleWindow );
494 ( m_curSession->widgetStack() )->show(); 494 ( m_curSession->widgetStack() )->show();
495 ( m_curSession->emulationHandler() )->cornerButton()->hide(); 495 ( m_curSession->emulationHandler() )->cornerButton()->hide();
496 disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); 496 disconnect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
497 497
498 } else { 498 } else {
499 savedParentFullscreen = ( m_curSession->widgetStack() )->parentWidget(); 499 savedParentFullscreen = ( m_curSession->widgetStack() )->parentWidget();
500 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame ); 500 ( m_curSession->widgetStack() )->setFrameStyle( QFrame::NoFrame );
501 ( m_curSession->widgetStack() )->reparent( 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop 501 ( m_curSession->widgetStack() )->reparent( 0, WStyle_Tool | WStyle_Customize | WStyle_StaysOnTop
502 , QPoint(0,0), false ); 502 , QPoint(0,0), false );
503 ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() ); 503 ( m_curSession->widgetStack() )->resize( qApp->desktop()->width(), qApp->desktop()->height() );
504 ( m_curSession->widgetStack() )->setFocus(); 504 ( m_curSession->widgetStack() )->setFocus();
505 ( m_curSession->widgetStack() )->show(); 505 ( m_curSession->widgetStack() )->show();
506 506
507 ( ( m_curSession->emulationHandler() )->cornerButton() )->show(); 507 ( ( m_curSession->emulationHandler() )->cornerButton() )->show();
508 508
509 connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) ); 509 connect( ( m_curSession->emulationHandler() )->cornerButton(), SIGNAL( pressed() ), this, SLOT( slotFullscreen() ) );
510 } 510 }
511 511
512 m_isFullscreen = !m_isFullscreen; 512 m_isFullscreen = !m_isFullscreen;
513} 513}
514 514
515 515
516void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool pressed, bool) { 516void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool pressed, bool) {
517 517
518 qWarning("unicode: %x, qkey: %x, %s", u, q, pressed ? "pressed" : "released"); 518 //qWarning("unicode: %x, qkey: %x, %s", u, q, pressed ? "pressed" : "released");
519 519
520 if ( m_curSession ) { 520 if ( m_curSession ) {
521 521
522 QEvent::Type state; 522 QEvent::Type state;
523 523
524 if (pressed) state = QEvent::KeyPress; 524 if (pressed) state = QEvent::KeyPress;
525 else state = QEvent::KeyRelease; 525 else state = QEvent::KeyRelease;
526 526
527 QKeyEvent ke(state, q, u, 0, QString(QChar(u))); 527 QKeyEvent ke(state, q, u, 0, QString(QChar(u)));
528 528
529 // where should i send this event? doesnt work sending it here 529 // where should i send this event? doesnt work sending it here
530 QApplication::sendEvent((QObject *)m_curSession->widget(), &ke); 530 QApplication::sendEvent((QObject *)m_curSession->widget(), &ke);
531 ke.ignore(); 531 ke.ignore();
532 } 532 }
533} 533}