Diffstat (limited to 'noncore/apps/opie-console/transferdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/transferdialog.cpp | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/transferdialog.cpp b/noncore/apps/opie-console/transferdialog.cpp index 75c4c72..0af1911 100644 --- a/noncore/apps/opie-console/transferdialog.cpp +++ b/noncore/apps/opie-console/transferdialog.cpp | |||
@@ -15,23 +15,24 @@ | |||
15 | #include "metafactory.h" | 15 | #include "metafactory.h" |
16 | #include "mainwindow.h" | 16 | #include "mainwindow.h" |
17 | 17 | ||
18 | #include "transferdialog.h" | 18 | #include "transferdialog.h" |
19 | 19 | ||
20 | TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *) | 20 | TransferDialog::TransferDialog(QWidget *parent, MainWindow *mainwindow, const char *) |
21 | : QDialog(parent, 0l, true), m_win(mainwindow) | 21 | : QDialog(parent, 0l, false), m_win(mainwindow) |
22 | { | 22 | { |
23 | m_lay = 0l; | 23 | m_lay = 0l; |
24 | m_recvlay = 0l; | 24 | m_recvlay = 0l; |
25 | QVBoxLayout *vbox, *vbox2; | 25 | QVBoxLayout *vbox, *vbox2; |
26 | QHBoxLayout *hbox, *hbox2, *hbox3; | 26 | QHBoxLayout *hbox, *hbox2, *hbox3; |
27 | QLabel *file, *mode, *progress, *status; | 27 | QLabel *file, *mode, *progress, *status; |
28 | QButtonGroup *group; | 28 | QButtonGroup *group; |
29 | QRadioButton *mode_send, *mode_receive; | 29 | QRadioButton *mode_send, *mode_receive; |
30 | 30 | ||
31 | m_autocleanup = 0; | 31 | m_autocleanup = 0; |
32 | m_running = true; | ||
32 | 33 | ||
33 | group = new QButtonGroup(QObject::tr("Transfer mode"), this); | 34 | group = new QButtonGroup(QObject::tr("Transfer mode"), this); |
34 | mode_send = new QRadioButton(QObject::tr("Send"), group); | 35 | mode_send = new QRadioButton(QObject::tr("Send"), group); |
35 | mode_receive = new QRadioButton(QObject::tr("Receive"), group); | 36 | mode_receive = new QRadioButton(QObject::tr("Receive"), group); |
36 | group->insert(mode_send, id_send); | 37 | group->insert(mode_send, id_send); |
37 | group->insert(mode_receive, id_receive); | 38 | group->insert(mode_receive, id_receive); |
@@ -164,22 +165,27 @@ void TransferDialog::slotCancel() | |||
164 | ok->setEnabled(true); | 165 | ok->setEnabled(true); |
165 | statusbar->setText(QObject::tr("Ready")); | 166 | statusbar->setText(QObject::tr("Ready")); |
166 | 167 | ||
167 | if((m_lay) || (m_recvlay)) | 168 | if((m_lay) || (m_recvlay)) |
168 | { | 169 | { |
169 | cleanup(); | 170 | cleanup(); |
170 | if(m_autocleanup) close(); | 171 | if(m_autocleanup) |
172 | { | ||
173 | m_running = false; | ||
174 | close(); | ||
175 | } | ||
171 | else | 176 | else |
172 | { | 177 | { |
173 | QMessageBox::information(this, | 178 | QMessageBox::information(this, |
174 | QObject::tr("Cancelled"), | 179 | QObject::tr("Cancelled"), |
175 | QObject::tr("The file transfer has been cancelled.")); | 180 | QObject::tr("The file transfer has been cancelled.")); |
176 | } | 181 | } |
177 | } | 182 | } |
178 | else | 183 | else |
179 | { | 184 | { |
185 | m_running = false; | ||
180 | close(); | 186 | close(); |
181 | } | 187 | } |
182 | } | 188 | } |
183 | 189 | ||
184 | void TransferDialog::slotProgress(const QString& , int progress, int , int , int, int ) | 190 | void TransferDialog::slotProgress(const QString& , int progress, int , int , int, int ) |
185 | { | 191 | { |
@@ -261,6 +267,11 @@ void TransferDialog::slotMode(int id) | |||
261 | selector->setEnabled(false); | 267 | selector->setEnabled(false); |
262 | filename->setEnabled(false); | 268 | filename->setEnabled(false); |
263 | } | 269 | } |
264 | m_transfermode = id; | 270 | m_transfermode = id; |
265 | } | 271 | } |
266 | 272 | ||
273 | bool TransferDialog::isRunning() | ||
274 | { | ||
275 | return m_running; | ||
276 | } | ||
277 | |||