author | josef <josef> | 2002-10-16 17:25:49 (UTC) |
---|---|---|
committer | josef <josef> | 2002-10-16 17:25:49 (UTC) |
commit | 1a305f211913ce4a4d73ed0b36a0be535c0e03ec (patch) (unidiff) | |
tree | 5b6e4a814107750e0edb2b10ab6a04a658f5c4f4 /noncore/apps | |
parent | 9a7e223378c2d178f575b14f7632843f39faf461 (diff) | |
download | opie-1a305f211913ce4a4d73ed0b36a0be535c0e03ec.zip opie-1a305f211913ce4a4d73ed0b36a0be535c0e03ec.tar.gz opie-1a305f211913ce4a4d73ed0b36a0be535c0e03ec.tar.bz2 |
- if send/receive child processes exit, clicking on 'cancel' doesn't inform the
user about process cancellation because this is already done at this time.
-rw-r--r-- | noncore/apps/opie-console/transferdialog.cpp | 30 | ||||
-rw-r--r-- | noncore/apps/opie-console/transferdialog.h | 3 |
2 files changed, 27 insertions, 6 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 | |||
@@ -28,6 +28,8 @@ TransferDialog::TransferDialog(MainWindow *parent, const char *name) | |||
28 | QButtonGroup *group; | 28 | QButtonGroup *group; |
29 | QRadioButton *mode_send, *mode_receive; | 29 | QRadioButton *mode_send, *mode_receive; |
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); |
32 | mode_send = new QRadioButton(QObject::tr("Send"), group); | 34 | mode_send = new QRadioButton(QObject::tr("Send"), group); |
33 | mode_receive = new QRadioButton(QObject::tr("Receive"), group); | 35 | mode_receive = new QRadioButton(QObject::tr("Receive"), group); |
@@ -113,6 +115,9 @@ void TransferDialog::slotTransfer() | |||
113 | 115 | ||
114 | ok->setEnabled(false); | 116 | ok->setEnabled(false); |
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...")); |
117 | else statusbar->setText(QObject::tr("Receiving...")); | 122 | else statusbar->setText(QObject::tr("Receiving...")); |
118 | 123 | ||
@@ -138,12 +143,7 @@ void TransferDialog::slotTransfer() | |||
138 | } | 143 | } |
139 | } | 144 | } |
140 | 145 | ||
141 | void TransferDialog::slotCancel() | 146 | void TransferDialog::cleanup() |
142 | { | ||
143 | ok->setEnabled(true); | ||
144 | statusbar->setText(QObject::tr("Ready")); | ||
145 | |||
146 | if((m_lay) || (m_recvlay)) | ||
147 | { | 147 | { |
148 | if(m_lay) | 148 | if(m_lay) |
149 | { | 149 | { |
@@ -157,10 +157,24 @@ void TransferDialog::slotCancel() | |||
157 | delete m_recvlay; | 157 | delete m_recvlay; |
158 | m_recvlay = 0l; | 158 | m_recvlay = 0l; |
159 | } | 159 | } |
160 | } | ||
161 | |||
162 | void TransferDialog::slotCancel() | ||
163 | { | ||
164 | ok->setEnabled(true); | ||
165 | statusbar->setText(QObject::tr("Ready")); | ||
166 | |||
167 | if((m_lay) || (m_recvlay)) | ||
168 | { | ||
169 | cleanup(); | ||
170 | if(m_autocleanup) close(); | ||
171 | else | ||
172 | { | ||
160 | QMessageBox::information(this, | 173 | QMessageBox::information(this, |
161 | QObject::tr("Cancelled"), | 174 | QObject::tr("Cancelled"), |
162 | QObject::tr("The file transfer has been cancelled.")); | 175 | QObject::tr("The file transfer has been cancelled.")); |
163 | } | 176 | } |
177 | } | ||
164 | else | 178 | else |
165 | { | 179 | { |
166 | close(); | 180 | close(); |
@@ -210,6 +224,8 @@ void TransferDialog::slotError(int error, const QString& message) | |||
210 | QObject::tr("Unknown error occured.")); | 224 | QObject::tr("Unknown error occured.")); |
211 | break; | 225 | break; |
212 | } | 226 | } |
227 | |||
228 | m_autocleanup = 1; | ||
213 | } | 229 | } |
214 | 230 | ||
215 | void TransferDialog::slotSent() | 231 | void TransferDialog::slotSent() |
@@ -217,6 +233,7 @@ void TransferDialog::slotSent() | |||
217 | QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been sent.")); | 233 | QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been sent.")); |
218 | ok->setEnabled(true); | 234 | ok->setEnabled(true); |
219 | statusbar->setText(QObject::tr("Ready")); | 235 | statusbar->setText(QObject::tr("Ready")); |
236 | m_autocleanup = 1; | ||
220 | } | 237 | } |
221 | 238 | ||
222 | void TransferDialog::slotReceived(const QString& file) | 239 | void TransferDialog::slotReceived(const QString& file) |
@@ -224,6 +241,7 @@ void TransferDialog::slotReceived(const QString& file) | |||
224 | QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been received as %1.").arg(file)); | 241 | QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been received as %1.").arg(file)); |
225 | ok->setEnabled(true); | 242 | ok->setEnabled(true); |
226 | statusbar->setText(QObject::tr("Ready")); | 243 | statusbar->setText(QObject::tr("Ready")); |
244 | m_autocleanup = 1; | ||
227 | } | 245 | } |
228 | 246 | ||
229 | void TransferDialog::slotMode(int id) | 247 | void TransferDialog::slotMode(int id) |
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 | |||
@@ -36,6 +36,8 @@ class TransferDialog : public QDialog | |||
36 | id_receive | 36 | id_receive |
37 | }; | 37 | }; |
38 | 38 | ||
39 | void cleanup(); | ||
40 | |||
39 | QLineEdit *filename; | 41 | QLineEdit *filename; |
40 | QComboBox *protocol; | 42 | QComboBox *protocol; |
41 | QProgressBar *progressbar; | 43 | QProgressBar *progressbar; |
@@ -45,6 +47,7 @@ class TransferDialog : public QDialog | |||
45 | FileTransferLayer* m_lay; | 47 | FileTransferLayer* m_lay; |
46 | ReceiveLayer *m_recvlay; | 48 | ReceiveLayer *m_recvlay; |
47 | int m_transfermode; | 49 | int m_transfermode; |
50 | int m_autocleanup; | ||
48 | }; | 51 | }; |
49 | 52 | ||
50 | #endif | 53 | #endif |