summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/mainwindow.cpp
Side-by-side diff
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() {
currentSession()->emulationLayer()->runScript(&script);
}
}
*/
}
void MainWindow::slotConnect() {
if ( currentSession() ) {
bool ret = currentSession()->layer()->open();
if(!ret) QMessageBox::warning(currentSession()->widgetStack(),
QObject::tr("Failed"),
QObject::tr("Connecting failed for this session."));
- m_connect->setEnabled( false );
- m_disconnect->setEnabled( true );
+ else {
+ m_connect->setEnabled( false );
+ m_disconnect->setEnabled( true );
+ }
}
}
void MainWindow::slotDisconnect() {
if ( currentSession() ) {
currentSession()->layer()->close();
m_connect->setEnabled( true );
m_disconnect->setEnabled( false );
}
}
void MainWindow::slotTerminate() {
@@ -355,25 +357,27 @@ void MainWindow::slotConfigure() {
* we will remove
* this window from the tabwidget
* remove it from the list
* delete it
* and set the currentSession()
*/
void MainWindow::slotClose() {
if (!currentSession() )
return;
Session* ses = currentSession();
qWarning("removing! currentSession %s", currentSession()->name().latin1() );
- tabWidget()->remove( currentSession() );
+ /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */
+ m_curSession = NULL;
+ tabWidget()->remove( /*currentSession()*/ses );
/*it's autodelete */
m_sessions.remove( ses );
qWarning("after remove!!");
if (!currentSession() ) {
m_connect->setEnabled( false );
m_disconnect->setEnabled( false );
m_terminate->setEnabled( false );
m_transfer->setEnabled( false );
m_recordScript->setEnabled( false );
m_saveScript->setEnabled( false );
m_runScript->setEnabled( false );