summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/transferdialog.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/transferdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/transferdialog.cpp44
1 files changed, 31 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)
+ m_autocleanup = 0;
+
group = new QButtonGroup(QObject::tr("Transfer mode"), this);
@@ -115,2 +117,5 @@ void TransferDialog::slotTransfer()
+ cleanup();
+ m_autocleanup = 0;
+
if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending..."));
@@ -140,2 +145,18 @@ void TransferDialog::slotTransfer()
+void TransferDialog::cleanup()
+{
+ if(m_lay)
+ {
+ m_lay->cancel();
+ delete m_lay;
+ m_lay = 0l;
+ }
+ if(m_recvlay)
+ {
+ m_recvlay->cancel();
+ delete m_recvlay;
+ m_recvlay = 0l;
+ }
+}
+
void TransferDialog::slotCancel()
@@ -147,17 +168,10 @@ void TransferDialog::slotCancel()
{
- if(m_lay)
- {
- m_lay->cancel();
- delete m_lay;
- m_lay = 0l;
- }
- if(m_recvlay)
+ cleanup();
+ if(m_autocleanup) close();
+ else
{
- m_recvlay->cancel();
- delete m_recvlay;
- m_recvlay = 0l;
+ QMessageBox::information(this,
+ QObject::tr("Cancelled"),
+ QObject::tr("The file transfer has been cancelled."));
}
- QMessageBox::information(this,
- QObject::tr("Cancelled"),
- QObject::tr("The file transfer has been cancelled."));
}
@@ -212,2 +226,4 @@ void TransferDialog::slotError(int error, const QString& message)
}
+
+ m_autocleanup = 1;
}
@@ -219,2 +235,3 @@ void TransferDialog::slotSent()
statusbar->setText(QObject::tr("Ready"));
+ m_autocleanup = 1;
}
@@ -226,2 +243,3 @@ void TransferDialog::slotReceived(const QString& file)
statusbar->setText(QObject::tr("Ready"));
+ m_autocleanup = 1;
}