summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/transferdialog.cpp30
-rw-r--r--noncore/apps/opie-console/transferdialog.h3
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
@@ -29,4 +29,6 @@ TransferDialog::TransferDialog(MainWindow *parent, const char *name)
QRadioButton *mode_send, *mode_receive;
+ m_autocleanup = 0;
+
group = new QButtonGroup(QObject::tr("Transfer mode"), this);
mode_send = new QRadioButton(QObject::tr("Send"), group);
@@ -114,4 +116,7 @@ void TransferDialog::slotTransfer()
ok->setEnabled(false);
+ cleanup();
+ m_autocleanup = 0;
+
if(m_transfermode == id_send) statusbar->setText(QObject::tr("Sending..."));
else statusbar->setText(QObject::tr("Receiving..."));
@@ -139,10 +144,5 @@ void TransferDialog::slotTransfer()
}
-void TransferDialog::slotCancel()
-{
- ok->setEnabled(true);
- statusbar->setText(QObject::tr("Ready"));
-
- if((m_lay) || (m_recvlay))
+void TransferDialog::cleanup()
{
if(m_lay)
@@ -158,8 +158,22 @@ void TransferDialog::slotCancel()
m_recvlay = 0l;
}
+}
+
+void TransferDialog::slotCancel()
+{
+ ok->setEnabled(true);
+ statusbar->setText(QObject::tr("Ready"));
+
+ if((m_lay) || (m_recvlay))
+ {
+ cleanup();
+ if(m_autocleanup) close();
+ else
+ {
QMessageBox::information(this,
QObject::tr("Cancelled"),
QObject::tr("The file transfer has been cancelled."));
}
+ }
else
{
@@ -211,4 +225,6 @@ void TransferDialog::slotError(int error, const QString& message)
break;
}
+
+ m_autocleanup = 1;
}
@@ -218,4 +234,5 @@ void TransferDialog::slotSent()
ok->setEnabled(true);
statusbar->setText(QObject::tr("Ready"));
+ m_autocleanup = 1;
}
@@ -225,4 +242,5 @@ void TransferDialog::slotReceived(const QString& file)
ok->setEnabled(true);
statusbar->setText(QObject::tr("Ready"));
+ m_autocleanup = 1;
}
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
@@ -37,4 +37,6 @@ class TransferDialog : public QDialog
};
+ void cleanup();
+
QLineEdit *filename;
QComboBox *protocol;
@@ -46,4 +48,5 @@ class TransferDialog : public QDialog
ReceiveLayer *m_recvlay;
int m_transfermode;
+ int m_autocleanup;
};