-rw-r--r-- | noncore/apps/opie-console/transferdialog.cpp | 44 | ||||
-rw-r--r-- | noncore/apps/opie-console/transferdialog.h | 3 |
2 files changed, 34 insertions, 13 deletions
diff --git a/noncore/apps/opie-console/transferdialog.cpp b/noncore/apps/opie-console/transferdialog.cpp index 0083cc1..f9a0b87 100644 --- a/noncore/apps/opie-console/transferdialog.cpp +++ b/noncore/apps/opie-console/transferdialog.cpp | |||
@@ -30,2 +30,4 @@ TransferDialog::TransferDialog(MainWindow *parent, const char *name) | |||
30 | 30 | ||
31 | m_autocleanup = 0; | ||
32 | |||
31 | group = new QButtonGroup(QObject::tr("Transfer mode"), this); | 33 | group = new QButtonGroup(QObject::tr("Transfer mode"), this); |
@@ -115,2 +117,5 @@ void TransferDialog::slotTransfer() | |||
115 | 117 | ||
118 | cleanup(); | ||
119 | m_autocleanup = 0; | ||
120 | |||
116 | if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending...")); | 121 | if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending...")); |
@@ -140,2 +145,18 @@ void TransferDialog::slotTransfer() | |||
140 | 145 | ||
146 | void TransferDialog::cleanup() | ||
147 | { | ||
148 | if(m_lay) | ||
149 | { | ||
150 | m_lay->cancel(); | ||
151 | delete m_lay; | ||
152 | m_lay = 0l; | ||
153 | } | ||
154 | if(m_recvlay) | ||
155 | { | ||
156 | m_recvlay->cancel(); | ||
157 | delete m_recvlay; | ||
158 | m_recvlay = 0l; | ||
159 | } | ||
160 | } | ||
161 | |||
141 | void TransferDialog::slotCancel() | 162 | void TransferDialog::slotCancel() |
@@ -147,17 +168,10 @@ void TransferDialog::slotCancel() | |||
147 | { | 168 | { |
148 | if(m_lay) | 169 | cleanup(); |
149 | { | 170 | if(m_autocleanup) close(); |
150 | m_lay->cancel(); | 171 | else |
151 | delete m_lay; | ||
152 | m_lay = 0l; | ||
153 | } | ||
154 | if(m_recvlay) | ||
155 | { | 172 | { |
156 | m_recvlay->cancel(); | 173 | QMessageBox::information(this, |
157 | delete m_recvlay; | 174 | QObject::tr("Cancelled"), |
158 | m_recvlay = 0l; | 175 | QObject::tr("The file transfer has been cancelled.")); |
159 | } | 176 | } |
160 | QMessageBox::information(this, | ||
161 | QObject::tr("Cancelled"), | ||
162 | QObject::tr("The file transfer has been cancelled.")); | ||
163 | } | 177 | } |
@@ -212,2 +226,4 @@ void TransferDialog::slotError(int error, const QString& message) | |||
212 | } | 226 | } |
227 | |||
228 | m_autocleanup = 1; | ||
213 | } | 229 | } |
@@ -219,2 +235,3 @@ void TransferDialog::slotSent() | |||
219 | statusbar->setText(QObject::tr("Ready")); | 235 | statusbar->setText(QObject::tr("Ready")); |
236 | m_autocleanup = 1; | ||
220 | } | 237 | } |
@@ -226,2 +243,3 @@ void TransferDialog::slotReceived(const QString& file) | |||
226 | statusbar->setText(QObject::tr("Ready")); | 243 | statusbar->setText(QObject::tr("Ready")); |
244 | m_autocleanup = 1; | ||
227 | } | 245 | } |
diff --git a/noncore/apps/opie-console/transferdialog.h b/noncore/apps/opie-console/transferdialog.h index de3a5cf..1b27f16 100644 --- a/noncore/apps/opie-console/transferdialog.h +++ b/noncore/apps/opie-console/transferdialog.h | |||
@@ -38,2 +38,4 @@ class TransferDialog : public QDialog | |||
38 | 38 | ||
39 | void cleanup(); | ||
40 | |||
39 | QLineEdit *filename; | 41 | QLineEdit *filename; |
@@ -47,2 +49,3 @@ class TransferDialog : public QDialog | |||
47 | int m_transfermode; | 49 | int m_transfermode; |
50 | int m_autocleanup; | ||
48 | }; | 51 | }; |