summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 21de5c0..eaa78c8 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -491,48 +491,53 @@ void MainWindow::slotClose() {
491 m_recordScript->setEnabled( false ); 491 m_recordScript->setEnabled( false );
492 m_saveScript->setEnabled( false ); 492 m_saveScript->setEnabled( false );
493 m_scripts->setItemEnabled(m_runScript_id, false); 493 m_scripts->setItemEnabled(m_runScript_id, false);
494 m_fullscreen->setEnabled( false ); 494 m_fullscreen->setEnabled( false );
495 m_wrap->setEnabled( false ); 495 m_wrap->setEnabled( false );
496 m_closewindow->setEnabled( false ); 496 m_closewindow->setEnabled( false );
497 } 497 }
498 498
499 m_kb->loadDefaults(); 499 m_kb->loadDefaults();
500} 500}
501 501
502/* 502/*
503 * We will get the name 503 * We will get the name
504 * Then the profile 504 * Then the profile
505 * and then we will make a profile 505 * and then we will make a profile
506 */ 506 */
507void MainWindow::slotProfile( int id) { 507void MainWindow::slotProfile( int id) {
508 Profile prof = manager()->profile( m_sessionsPop->text( id) ); 508 Profile prof = manager()->profile( m_sessionsPop->text( id) );
509 create( prof ); 509 create( prof );
510} 510}
511 511
512 512
513 513
514void MainWindow::create( const Profile& prof ) { 514void MainWindow::create( const Profile& prof ) {
515 char *homeDir = getenv("HOME");
516
517 if ( homeDir )
518 ::chdir( homeDir );
519
515 if(m_curSession) 520 if(m_curSession)
516 if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide(); 521 if(m_curSession->transferDialog()) m_curSession->transferDialog()->hide();
517 522
518 Session *ses = manager()->fromProfile( prof, tabWidget() ); 523 Session *ses = manager()->fromProfile( prof, tabWidget() );
519 524
520 if((!ses) || (!ses->layer()) || (!ses->widgetStack())) 525 if((!ses) || (!ses->layer()) || (!ses->widgetStack()))
521 { 526 {
522 QMessageBox::warning(this, 527 QMessageBox::warning(this,
523 QObject::tr("Session failed"), 528 QObject::tr("Session failed"),
524 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>")); 529 QObject::tr("<qt>Cannot open session: Not all components were found.</qt>"));
525 //if(ses) delete ses; 530 //if(ses) delete ses;
526 return; 531 return;
527 } 532 }
528 533
529 m_sessions.append( ses ); 534 m_sessions.append( ses );
530 tabWidget()->add( ses ); 535 tabWidget()->add( ses );
531 tabWidget()->repaint(); 536 tabWidget()->repaint();
532 m_curSession = ses; 537 m_curSession = ses;
533 538
534 // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it 539 // dicide if its a local term ( then no connction and no tranfer), maybe make a wrapper method out of it
535 m_connect->setEnabled( true ); 540 m_connect->setEnabled( true );
536 m_disconnect->setEnabled( false ); 541 m_disconnect->setEnabled( false );
537 m_terminate->setEnabled( true ); 542 m_terminate->setEnabled( true );
538 m_fullscreen->setEnabled( true ); 543 m_fullscreen->setEnabled( true );