author | josef <josef> | 2002-10-15 22:36:10 (UTC) |
---|---|---|
committer | josef <josef> | 2002-10-15 22:36:10 (UTC) |
commit | 65ef0e86a879332cbf8b1575886d3c36c7d2d9bd (patch) (unidiff) | |
tree | b0b3f192c52dc15d639977e1d592412531d826eb | |
parent | 626b45872e1774b694727792f7306a39277e413e (diff) | |
download | opie-65ef0e86a879332cbf8b1575886d3c36c7d2d9bd.zip opie-65ef0e86a879332cbf8b1575886d3c36c7d2d9bd.tar.gz opie-65ef0e86a879332cbf8b1575886d3c36c7d2d9bd.tar.bz2 |
- 3 small fixes, please review:
- disable all relevant menu items when last session has been closed
(but this might not be the correct bugfix, so consider it temporary)
- don't set menu status to connected when connection fails
- modem sessions: when user cancels connection, close serial connection first
again, so we can reconnect (re-dial) later without problems
-rw-r--r-- | noncore/apps/opie-console/io_modem.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_serial.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 10 |
3 files changed, 13 insertions, 4 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 | |||
@@ -31,7 +31,11 @@ bool IOModem::open() { | |||
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 | ||
37 | void IOModem::reload( const Profile &config ) { | 41 | void IOModem::reload( const Profile &config ) { |
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 | |||
@@ -46,6 +46,7 @@ bool IOSerial::open() { | |||
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); |
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 | |||
@@ -318,8 +318,10 @@ void MainWindow::slotConnect() { | |||
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 | ||
@@ -364,7 +366,9 @@ void MainWindow::slotClose() { | |||
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!!"); |