Diffstat (limited to 'noncore/apps/opie-console/transferdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/transferdialog.cpp | 30 |
1 files changed, 24 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 | |||
@@ -29,4 +29,6 @@ TransferDialog::TransferDialog(MainWindow *parent, const char *name) | |||
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); |
@@ -114,4 +116,7 @@ void TransferDialog::slotTransfer() | |||
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...")); |
@@ -139,10 +144,5 @@ void TransferDialog::slotTransfer() | |||
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) |
@@ -158,8 +158,22 @@ void TransferDialog::slotCancel() | |||
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 | { |
@@ -211,4 +225,6 @@ void TransferDialog::slotError(int error, const QString& message) | |||
211 | break; | 225 | break; |
212 | } | 226 | } |
227 | |||
228 | m_autocleanup = 1; | ||
213 | } | 229 | } |
214 | 230 | ||
@@ -218,4 +234,5 @@ void TransferDialog::slotSent() | |||
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 | ||
@@ -225,4 +242,5 @@ void TransferDialog::slotReceived(const QString& 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 | ||