From dd15f8b7104678da5969a3e93a4b14cd3640955c Mon Sep 17 00:00:00 2001 From: josef Date: Fri, 18 Oct 2002 10:25:44 +0000 Subject: - implement proper disconnect for modem connections - let transfer dialog use widgetStack() --- diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp index bd6b50f..7bf9352 100644 --- a/noncore/apps/opie-console/dialer.cpp +++ b/noncore/apps/opie-console/dialer.cpp @@ -84,6 +84,12 @@ Dialer::~Dialer() { } +void Dialer::setHangupOnly() +{ + state = state_cancel; + usercancel = 1; +} + void Dialer::slotCancel() { if(state != state_online) diff --git a/noncore/apps/opie-console/dialer.h b/noncore/apps/opie-console/dialer.h index 4011880..84444b9 100644 --- a/noncore/apps/opie-console/dialer.h +++ b/noncore/apps/opie-console/dialer.h @@ -14,6 +14,7 @@ class Dialer : public QDialog public: Dialer(const Profile& profile, int fd, QWidget *parent = NULL, const char *name = NULL); ~Dialer(); + void setHangupOnly(); public slots: void slotCancel(); diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp index c04aad1..2f0c04e 100644 --- a/noncore/apps/opie-console/io_modem.cpp +++ b/noncore/apps/opie-console/io_modem.cpp @@ -15,7 +15,10 @@ IOModem::~IOModem() { void IOModem::close() { - // maybe do a hangup here just in case...? + // Hangup, discarding result + Dialer d(m_profile, rawIO()); + d.setHangupOnly(); + d.exec(); IOSerial::close(); } diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 9a226bb..55e9836 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -442,8 +442,9 @@ void MainWindow::create( const Profile& prof ) { void MainWindow::slotTransfer() { if ( currentSession() ) { - TransferDialog dlg(this); + TransferDialog dlg(currentSession()->widgetStack(), this); dlg.showMaximized(); + //currentSession()->widgetStack()->add(dlg); dlg.exec(); } } diff --git a/noncore/apps/opie-console/transferdialog.cpp b/noncore/apps/opie-console/transferdialog.cpp index f9a0b87..ac5b1d0 100644 --- a/noncore/apps/opie-console/transferdialog.cpp +++ b/noncore/apps/opie-console/transferdialog.cpp @@ -17,8 +17,8 @@ #include "transferdialog.h" -TransferDialog::TransferDialog(MainWindow *parent, const char *name) -: QDialog(0l, 0l, true), m_win(parent) +TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *name) +: QDialog(parent, 0l, true), m_win(mainwindow) { m_lay = 0l; m_recvlay = 0l; diff --git a/noncore/apps/opie-console/transferdialog.h b/noncore/apps/opie-console/transferdialog.h index 1b27f16..d87be6a 100644 --- a/noncore/apps/opie-console/transferdialog.h +++ b/noncore/apps/opie-console/transferdialog.h @@ -16,7 +16,7 @@ class TransferDialog : public QDialog { Q_OBJECT public: - TransferDialog(MainWindow *parent = 0l, const char *name = 0l); + TransferDialog(QWidget *parent = 0l, MainWindow *mainwindow = 0l, const char *name = 0l); ~TransferDialog(); public slots: -- cgit v0.9.0.2