summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/mainwindow.cpp
Unidiff
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, 7 insertions, 3 deletions
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index 4326609..9ccefa0 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -309,26 +309,28 @@ void MainWindow::slotRunScript() {
309 currentSession()->emulationLayer()->runScript(&script); 309 currentSession()->emulationLayer()->runScript(&script);
310 } 310 }
311 } 311 }
312 */ 312 */
313} 313}
314 314
315void MainWindow::slotConnect() { 315void MainWindow::slotConnect() {
316 if ( currentSession() ) { 316 if ( currentSession() ) {
317 bool ret = currentSession()->layer()->open(); 317 bool ret = currentSession()->layer()->open();
318 if(!ret) QMessageBox::warning(currentSession()->widgetStack(), 318 if(!ret) QMessageBox::warning(currentSession()->widgetStack(),
319 QObject::tr("Failed"), 319 QObject::tr("Failed"),
320 QObject::tr("Connecting failed for this session.")); 320 QObject::tr("Connecting failed for this session."));
321 m_connect->setEnabled( false ); 321 else {
322 m_disconnect->setEnabled( true ); 322 m_connect->setEnabled( false );
323 m_disconnect->setEnabled( true );
324 }
323 } 325 }
324} 326}
325 327
326void MainWindow::slotDisconnect() { 328void MainWindow::slotDisconnect() {
327 if ( currentSession() ) { 329 if ( currentSession() ) {
328 currentSession()->layer()->close(); 330 currentSession()->layer()->close();
329 m_connect->setEnabled( true ); 331 m_connect->setEnabled( true );
330 m_disconnect->setEnabled( false ); 332 m_disconnect->setEnabled( false );
331 } 333 }
332} 334}
333 335
334void MainWindow::slotTerminate() { 336void MainWindow::slotTerminate() {
@@ -355,25 +357,27 @@ void MainWindow::slotConfigure() {
355 * we will remove 357 * we will remove
356 * this window from the tabwidget 358 * this window from the tabwidget
357 * remove it from the list 359 * remove it from the list
358 * delete it 360 * delete it
359 * and set the currentSession() 361 * and set the currentSession()
360 */ 362 */
361void MainWindow::slotClose() { 363void MainWindow::slotClose() {
362 if (!currentSession() ) 364 if (!currentSession() )
363 return; 365 return;
364 366
365 Session* ses = currentSession(); 367 Session* ses = currentSession();
366 qWarning("removing! currentSession %s", currentSession()->name().latin1() ); 368 qWarning("removing! currentSession %s", currentSession()->name().latin1() );
367 tabWidget()->remove( currentSession() ); 369 /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */
370 m_curSession = NULL;
371 tabWidget()->remove( /*currentSession()*/ses );
368 /*it's autodelete */ 372 /*it's autodelete */
369 m_sessions.remove( ses ); 373 m_sessions.remove( ses );
370 qWarning("after remove!!"); 374 qWarning("after remove!!");
371 375
372 if (!currentSession() ) { 376 if (!currentSession() ) {
373 m_connect->setEnabled( false ); 377 m_connect->setEnabled( false );
374 m_disconnect->setEnabled( false ); 378 m_disconnect->setEnabled( false );
375 m_terminate->setEnabled( false ); 379 m_terminate->setEnabled( false );
376 m_transfer->setEnabled( false ); 380 m_transfer->setEnabled( false );
377 m_recordScript->setEnabled( false ); 381 m_recordScript->setEnabled( false );
378 m_saveScript->setEnabled( false ); 382 m_saveScript->setEnabled( false );
379 m_runScript->setEnabled( false ); 383 m_runScript->setEnabled( false );