author | hash <hash> | 2002-10-18 17:50:05 (UTC) |
---|---|---|
committer | hash <hash> | 2002-10-18 17:50:05 (UTC) |
commit | 351d2f95d3f5beba26e5879659ddafb84b0f98f4 (patch) (unidiff) | |
tree | f48d66f766ca02950d6295ea00d912d40081c43d | |
parent | addfc9900cbf3da2cdbfa54ea849bc7f7fb1b296 (diff) | |
download | opie-351d2f95d3f5beba26e5879659ddafb84b0f98f4.zip opie-351d2f95d3f5beba26e5879659ddafb84b0f98f4.tar.gz opie-351d2f95d3f5beba26e5879659ddafb84b0f98f4.tar.bz2 |
always autoconnect bug fixed
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 4 |
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 | |||
@@ -339,195 +339,195 @@ void MainWindow::slotDisconnect() { | |||
339 | m_connect->setEnabled( true ); | 339 | m_connect->setEnabled( true ); |
340 | m_disconnect->setEnabled( false ); | 340 | m_disconnect->setEnabled( false ); |
341 | } | 341 | } |
342 | } | 342 | } |
343 | 343 | ||
344 | void MainWindow::slotTerminate() { | 344 | void MainWindow::slotTerminate() { |
345 | if ( currentSession() ) | 345 | if ( currentSession() ) |
346 | currentSession()->layer()->close(); | 346 | currentSession()->layer()->close(); |
347 | 347 | ||
348 | slotClose(); | 348 | slotClose(); |
349 | /* FIXME move to the next session */ | 349 | /* FIXME move to the next session */ |
350 | } | 350 | } |
351 | 351 | ||
352 | void MainWindow::slotConfigure() { | 352 | void MainWindow::slotConfigure() { |
353 | ConfigDialog conf( manager()->all(), factory() ); | 353 | ConfigDialog conf( manager()->all(), factory() ); |
354 | conf.showMaximized(); | 354 | conf.showMaximized(); |
355 | 355 | ||
356 | int ret = conf.exec(); | 356 | int ret = conf.exec(); |
357 | 357 | ||
358 | if ( QDialog::Accepted == ret ) { | 358 | if ( QDialog::Accepted == ret ) { |
359 | manager()->setProfiles( conf.list() ); | 359 | manager()->setProfiles( conf.list() ); |
360 | manager()->save(); | 360 | manager()->save(); |
361 | populateProfiles(); | 361 | populateProfiles(); |
362 | } | 362 | } |
363 | } | 363 | } |
364 | /* | 364 | /* |
365 | * we will remove | 365 | * we will remove |
366 | * this window from the tabwidget | 366 | * this window from the tabwidget |
367 | * remove it from the list | 367 | * remove it from the list |
368 | * delete it | 368 | * delete it |
369 | * and set the currentSession() | 369 | * and set the currentSession() |
370 | */ | 370 | */ |
371 | void MainWindow::slotClose() { | 371 | void MainWindow::slotClose() { |
372 | if (!currentSession() ) | 372 | if (!currentSession() ) |
373 | return; | 373 | return; |
374 | 374 | ||
375 | Session* ses = currentSession(); | 375 | Session* ses = currentSession(); |
376 | qWarning("removing! currentSession %s", currentSession()->name().latin1() ); | 376 | qWarning("removing! currentSession %s", currentSession()->name().latin1() ); |
377 | /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */ | 377 | /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */ |
378 | m_curSession = NULL; | 378 | m_curSession = NULL; |
379 | tabWidget()->remove( /*currentSession()*/ses ); | 379 | tabWidget()->remove( /*currentSession()*/ses ); |
380 | /*it's autodelete */ | 380 | /*it's autodelete */ |
381 | m_sessions.remove( ses ); | 381 | m_sessions.remove( ses ); |
382 | qWarning("after remove!!"); | 382 | qWarning("after remove!!"); |
383 | 383 | ||
384 | if (!currentSession() ) { | 384 | if (!currentSession() ) { |
385 | m_connect->setEnabled( false ); | 385 | m_connect->setEnabled( false ); |
386 | m_disconnect->setEnabled( false ); | 386 | m_disconnect->setEnabled( false ); |
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 | */ |
402 | void MainWindow::slotProfile( int id) { | 402 | void 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 | } |
406 | void MainWindow::create( const Profile& prof ) { | 406 | void 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 | ||
440 | void MainWindow::slotTransfer() | 440 | void 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 | ||
451 | void MainWindow::slotOpenKeb(bool state) { | 451 | void 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 | ||
459 | void MainWindow::slotOpenButtons( bool state ) { | 459 | void 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 | ||
470 | void MainWindow::slotSessionChanged( Session* ses ) { | 470 | void 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 | ||
485 | void MainWindow::slotFullscreen() { | 485 | void 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 | ||
516 | void MainWindow::slotKeyReceived(ushort u, ushort q, bool, bool pressed, bool) { | 516 | void 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 | } |