summaryrefslogtreecommitdiff
Unidiff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/io_modem.cpp6
-rw-r--r--noncore/apps/opie-console/io_serial.cpp1
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp6
3 files changed, 11 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp
index 22a3673..41f553b 100644
--- a/noncore/apps/opie-console/io_modem.cpp
+++ b/noncore/apps/opie-console/io_modem.cpp
@@ -28,13 +28,17 @@ bool IOModem::open() {
28 28
29 int result = d.exec(); 29 int result = d.exec();
30 if(result == QDialog::Accepted) 30 if(result == QDialog::Accepted)
31 { 31 {
32 return true; 32 return true;
33 } 33 }
34 else return false; 34 else
35 {
36 close();
37 return false;
38 }
35} 39}
36 40
37void IOModem::reload( const Profile &config ) { 41void IOModem::reload( const Profile &config ) {
38 42
39 m_device = config.readEntry("Device", MODEM_DEFAULT_DEVICE); 43 m_device = config.readEntry("Device", MODEM_DEFAULT_DEVICE);
40 m_baud = config.readNumEntry("Baud", MODEM_DEFAULT_BAUD); 44 m_baud = config.readNumEntry("Baud", MODEM_DEFAULT_BAUD);
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp
index b89a53b..cc63c58 100644
--- a/noncore/apps/opie-console/io_serial.cpp
+++ b/noncore/apps/opie-console/io_serial.cpp
@@ -43,12 +43,13 @@ void IOSerial::close() {
43bool IOSerial::open() { 43bool IOSerial::open() {
44 if (!m_fd) { 44 if (!m_fd) {
45 struct termios tty; 45 struct termios tty;
46 m_fd = ::open(m_device, O_RDWR | O_NOCTTY | O_NONBLOCK); 46 m_fd = ::open(m_device, O_RDWR | O_NOCTTY | O_NONBLOCK);
47 if (m_fd < 0) { 47 if (m_fd < 0) {
48 emit error(CouldNotOpen, strerror(errno)); 48 emit error(CouldNotOpen, strerror(errno));
49 m_fd = 0;
49 return FALSE; 50 return FALSE;
50 } 51 }
51 tcgetattr(m_fd, &tty); 52 tcgetattr(m_fd, &tty);
52 53
53 /* Baud rate */ 54 /* Baud rate */
54 int speed = baud(m_baud); 55 int speed = baud(m_baud);
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
@@ -315,16 +315,18 @@ void MainWindow::slotRunScript() {
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 else {
321 m_connect->setEnabled( false ); 322 m_connect->setEnabled( false );
322 m_disconnect->setEnabled( true ); 323 m_disconnect->setEnabled( true );
323 } 324 }
324} 325}
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 );
@@ -361,13 +363,15 @@ void MainWindow::slotConfigure() {
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 );