summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/mainwindow.cpp
authorzecke <zecke>2002-10-15 13:02:56 (UTC)
committer zecke <zecke>2002-10-15 13:02:56 (UTC)
commit09ba4d2c79a41b185902519639032a49c85deadb (patch) (unidiff)
treef1d9676bf3401bb93e527c8608a9307bf4adf244 /noncore/apps/opie-console/mainwindow.cpp
parentb555d0c687db83cde89f1a75fccbd59723878621 (diff)
downloadopie-09ba4d2c79a41b185902519639032a49c85deadb.zip
opie-09ba4d2c79a41b185902519639032a49c85deadb.tar.gz
opie-09ba4d2c79a41b185902519639032a49c85deadb.tar.bz2
Add a Feature Support BitArray to the IOLayer
This way we know what an IOLayer supports Adjust IOSerial and MyPty to that change Fix the after close window the previous session window is empty bug in Mainwindow::remove we had a problem first we removed the currentSession from the tab and then deleted the session The problem is that removePage on OTabWidget does signal currentChanged so we did not delete the session intended but the wrong one because m_curSession got adjusted after a removePage... 3rd fix the close and reopen bug in MyPty
Diffstat (limited to 'noncore/apps/opie-console/mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 94c99bc..29dbcf3 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -351,29 +351,30 @@ void MainWindow::slotConfigure() {
351} 351}
352/* 352/*
353 * we will remove 353 * we will remove
354 * this window from the tabwidget 354 * this window from the tabwidget
355 * remove it from the list 355 * remove it from the list
356 * delete it 356 * delete it
357 * and set the currentSession() 357 * and set the currentSession()
358 */ 358 */
359void MainWindow::slotClose() { 359void MainWindow::slotClose() {
360 if (!currentSession() ) 360 if (!currentSession() )
361 return; 361 return;
362 362
363 Session* ses = currentSession();
364 qWarning("removing! currentSession %s", currentSession()->name().latin1() );
363 tabWidget()->remove( currentSession() ); 365 tabWidget()->remove( currentSession() );
364 /*it's autodelete */ 366 /*it's autodelete */
365 m_sessions.remove( m_curSession ); 367 m_sessions.remove( ses );
366 m_curSession = m_sessions.first(); 368 qWarning("after remove!!");
367 tabWidget()->setCurrent( m_curSession );
368 369
369 if (!currentSession() ) { 370 if (!currentSession() ) {
370 m_connect->setEnabled( false ); 371 m_connect->setEnabled( false );
371 m_disconnect->setEnabled( false ); 372 m_disconnect->setEnabled( false );
372 m_terminate->setEnabled( false ); 373 m_terminate->setEnabled( false );
373 m_transfer->setEnabled( false ); 374 m_transfer->setEnabled( false );
374 m_recordScript->setEnabled( false ); 375 m_recordScript->setEnabled( false );
375 m_saveScript->setEnabled( false ); 376 m_saveScript->setEnabled( false );
376 m_runScript->setEnabled( false ); 377 m_runScript->setEnabled( false );
377 m_fullscreen->setEnabled( false ); 378 m_fullscreen->setEnabled( false );
378 m_closewindow->setEnabled( false ); 379 m_closewindow->setEnabled( false );
379 } 380 }
@@ -386,25 +387,25 @@ void MainWindow::slotClose() {
386 */ 387 */
387void MainWindow::slotProfile( int id) { 388void MainWindow::slotProfile( int id) {
388 Profile prof = manager()->profile( m_sessionsPop->text( id) ); 389 Profile prof = manager()->profile( m_sessionsPop->text( id) );
389 create( prof ); 390 create( prof );
390} 391}
391void MainWindow::create( const Profile& prof ) { 392void MainWindow::create( const Profile& prof ) {
392 Session *ses = manager()->fromProfile( prof, tabWidget() ); 393 Session *ses = manager()->fromProfile( prof, tabWidget() );
393 394
394 if((!ses) || (!ses->layer()) || (!ses->widgetStack())) 395 if((!ses) || (!ses->layer()) || (!ses->widgetStack()))
395 { 396 {
396 QMessageBox::warning(this, 397 QMessageBox::warning(this,
397 QObject::tr("Session failed"), 398 QObject::tr("Session failed"),
398 QObject::tr("Cannot open session: Not all components were found.")); 399 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>"));
399 //if(ses) delete ses; 400 //if(ses) delete ses;
400 return; 401 return;
401 } 402 }
402 403
403 m_sessions.append( ses ); 404 m_sessions.append( ses );
404 tabWidget()->add( ses ); 405 tabWidget()->add( ses );
405 m_curSession = ses; 406 m_curSession = ses;
406 407
407 // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it 408 // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it
408 m_connect->setEnabled( true ); 409 m_connect->setEnabled( true );
409 m_disconnect->setEnabled( false ); 410 m_disconnect->setEnabled( false );
410 m_terminate->setEnabled( true ); 411 m_terminate->setEnabled( true );
@@ -424,24 +425,25 @@ void MainWindow::slotTransfer()
424 dlg.exec(); 425 dlg.exec();
425 } 426 }
426} 427}
427 428
428 429
429void MainWindow::slotOpenKeb(bool state) { 430void MainWindow::slotOpenKeb(bool state) {
430 431
431 if (state) m_keyBar->show(); 432 if (state) m_keyBar->show();
432 else m_keyBar->hide(); 433 else m_keyBar->hide();
433 434
434} 435}
435void MainWindow::slotSessionChanged( Session* ses ) { 436void MainWindow::slotSessionChanged( Session* ses ) {
437 qWarning("changed!");
436 if ( ses ) { 438 if ( ses ) {
437 m_curSession = ses; 439 m_curSession = ses;
438 440
439 if ( m_curSession->isConnected() ) { 441 if ( m_curSession->isConnected() ) {
440 m_connect->setEnabled( false ); 442 m_connect->setEnabled( false );
441 m_disconnect->setEnabled( true ); 443 m_disconnect->setEnabled( true );
442 } else { 444 } else {
443 m_connect->setEnabled( true ); 445 m_connect->setEnabled( true );
444 m_disconnect->setEnabled( false ); 446 m_disconnect->setEnabled( false );
445 } 447 }
446 } 448 }
447} 449}