author | josef <josef> | 2002-10-18 09:43:59 (UTC) |
---|---|---|
committer | josef <josef> | 2002-10-18 09:43:59 (UTC) |
commit | c01fc99488d4ff9e1de2eb4d93fc200ed8e19a81 (patch) (unidiff) | |
tree | cabcb28b9b95c741dd15ddeb016d1ebf01cf9224 | |
parent | 997c466fd91843699280a770cbf34e6917dcee8a (diff) | |
download | opie-c01fc99488d4ff9e1de2eb4d93fc200ed8e19a81.zip opie-c01fc99488d4ff9e1de2eb4d93fc200ed8e19a81.tar.gz opie-c01fc99488d4ff9e1de2eb4d93fc200ed8e19a81.tar.bz2 |
- autoconnect after setting default values, otherwise connect/disconnect menu
items are overwritten
Please review!
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index b813442..9a226bb 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp | |||
@@ -400,63 +400,64 @@ void MainWindow::slotClose() { | |||
400 | * We will get the name | 400 | * We will get the name |
401 | * Then the profile | 401 | * Then the profile |
402 | * and then we will make a profile | 402 | * and then we will make a profile |
403 | */ | 403 | */ |
404 | void MainWindow::slotProfile( int id) { | 404 | void MainWindow::slotProfile( int id) { |
405 | Profile prof = manager()->profile( m_sessionsPop->text( id) ); | 405 | Profile prof = manager()->profile( m_sessionsPop->text( id) ); |
406 | create( prof ); | 406 | create( prof ); |
407 | } | 407 | } |
408 | void MainWindow::create( const Profile& prof ) { | 408 | void MainWindow::create( const Profile& prof ) { |
409 | Session *ses = manager()->fromProfile( prof, tabWidget() ); | 409 | Session *ses = manager()->fromProfile( prof, tabWidget() ); |
410 | 410 | ||
411 | if((!ses) || (!ses->layer()) || (!ses->widgetStack())) | 411 | if((!ses) || (!ses->layer()) || (!ses->widgetStack())) |
412 | { | 412 | { |
413 | QMessageBox::warning(this, | 413 | QMessageBox::warning(this, |
414 | QObject::tr("Session failed"), | 414 | QObject::tr("Session failed"), |
415 | QObject::tr("<qt>Cannot open session: Not all components were found.</qt>")); | 415 | QObject::tr("<qt>Cannot open session: Not all components were found.</qt>")); |
416 | //if(ses) delete ses; | 416 | //if(ses) delete ses; |
417 | return; | 417 | return; |
418 | } | 418 | } |
419 | 419 | ||
420 | m_sessions.append( ses ); | 420 | m_sessions.append( ses ); |
421 | tabWidget()->add( ses ); | 421 | tabWidget()->add( ses ); |
422 | m_curSession = ses; | 422 | m_curSession = ses; |
423 | 423 | ||
424 | // is io_layer wants direct connection, then autoconnect | ||
425 | if ( ( m_curSession->layer() )->supports()[0] = 1 ) { | ||
426 | slotConnect(); | ||
427 | } | ||
428 | |||
429 | // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it | 424 | // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it |
430 | m_connect->setEnabled( true ); | 425 | m_connect->setEnabled( true ); |
431 | m_disconnect->setEnabled( false ); | 426 | m_disconnect->setEnabled( false ); |
432 | m_terminate->setEnabled( true ); | 427 | m_terminate->setEnabled( true ); |
433 | m_transfer->setEnabled( true ); | 428 | m_transfer->setEnabled( true ); |
434 | m_recordScript->setEnabled( true ); | 429 | m_recordScript->setEnabled( true ); |
435 | m_saveScript->setEnabled( true ); | 430 | m_saveScript->setEnabled( true ); |
436 | m_runScript->setEnabled( true ); | 431 | m_runScript->setEnabled( true ); |
437 | m_fullscreen->setEnabled( true ); | 432 | m_fullscreen->setEnabled( true ); |
438 | m_closewindow->setEnabled( true ); | 433 | m_closewindow->setEnabled( true ); |
434 | |||
435 | |||
436 | // is io_layer wants direct connection, then autoconnect | ||
437 | if ( ( m_curSession->layer() )->supports()[0] = 1 ) { | ||
438 | slotConnect(); | ||
439 | } | ||
439 | } | 440 | } |
440 | 441 | ||
441 | void MainWindow::slotTransfer() | 442 | void MainWindow::slotTransfer() |
442 | { | 443 | { |
443 | if ( currentSession() ) { | 444 | if ( currentSession() ) { |
444 | TransferDialog dlg(this); | 445 | TransferDialog dlg(this); |
445 | dlg.showMaximized(); | 446 | dlg.showMaximized(); |
446 | dlg.exec(); | 447 | dlg.exec(); |
447 | } | 448 | } |
448 | } | 449 | } |
449 | 450 | ||
450 | 451 | ||
451 | void MainWindow::slotOpenKeb(bool state) { | 452 | void MainWindow::slotOpenKeb(bool state) { |
452 | 453 | ||
453 | if (state) m_keyBar->show(); | 454 | if (state) m_keyBar->show(); |
454 | else m_keyBar->hide(); | 455 | else m_keyBar->hide(); |
455 | 456 | ||
456 | } | 457 | } |
457 | 458 | ||
458 | 459 | ||
459 | void MainWindow::slotOpenButtons( bool state ) { | 460 | void MainWindow::slotOpenButtons( bool state ) { |
460 | 461 | ||
461 | if ( state ) { | 462 | if ( state ) { |
462 | m_buttonBar->show(); | 463 | m_buttonBar->show(); |