summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/transferdialog.cpp
Unidiff
Diffstat (limited to 'noncore/apps/opie-console/transferdialog.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/transferdialog.cpp53
1 files changed, 52 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/transferdialog.cpp b/noncore/apps/opie-console/transferdialog.cpp
index 45522a8..d639de6 100644
--- a/noncore/apps/opie-console/transferdialog.cpp
+++ b/noncore/apps/opie-console/transferdialog.cpp
@@ -96,3 +96,2 @@ void TransferDialog::slotTransfer()
96 statusbar->setText(QObject::tr("Sending...")); 96 statusbar->setText(QObject::tr("Sending..."));
97 progressbar->setProgress(1);
98 97
@@ -107,2 +106,5 @@ void TransferDialog::slotTransfer()
107 transfer->sendFile(filename->text()); 106 transfer->sendFile(filename->text());
107 connect(transfer, SIGNAL(progress(const QString&, int, int, int, int, int)), SLOT(slotProgress(const QString&, int, int, int, int, int)));
108 connect(transfer, SIGNAL(error(int, const QString&)), SLOT(slotError(int, const QString&)));
109 connect(transfer, SIGNAL(sent()), SLOT(slotSent()));
108} 110}
@@ -128 +130,50 @@ void TransferDialog::slotCancel()
128 130
131void TransferDialog::slotProgress(const QString& file, int progress, int speed, int hours, int minutes, int seconds)
132{
133 progressbar->setProgress(progress);
134}
135
136void TransferDialog::slotError(int error, const QString& message)
137{
138 switch(error)
139 {
140 case FileTransferLayer::NotSupported:
141 QMessageBox::critical(this,
142 QObject::tr("Error"),
143 QObject::tr("Operation not supported."));
144 break;
145 case FileTransferLayer::StartError:
146 QMessageBox::critical(this,
147 QObject::tr("Error"),
148 QObject::tr("Operation not supported."));
149 break;
150 case FileTransferLayer::NoError:
151 QMessageBox::critical(this,
152 QObject::tr("Error"),
153 QObject::tr("Operation not supported."));
154 break;
155 case FileTransferLayer::Undefined:
156 QMessageBox::critical(this,
157 QObject::tr("Error"),
158 QObject::tr("Operation not supported."));
159 break;
160 case FileTransferLayer::Incomplete:
161 QMessageBox::critical(this,
162 QObject::tr("Error"),
163 QObject::tr("Operation not supported."));
164 break;
165 case FileTransferLayer::Unknown:
166 default:
167 QMessageBox::critical(this,
168 QObject::tr("Error"),
169 QObject::tr("Operation not supported."));
170 break;
171 }
172}
173
174void TransferDialog::slotSent()
175{
176 QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been sent."));
177 ok->setEnabled(true);
178}
179