summaryrefslogtreecommitdiff
authorjosef <josef>2002-10-20 19:22:38 (UTC)
committer josef <josef>2002-10-20 19:22:38 (UTC)
commitd5433091ba9741f0fae104d038b906e353065e2d (patch) (unidiff)
tree70def8957a6b38f8b6cfb45fa352b5a77f2298a1
parent557c615b4b07adb798283981f3769dd817a80bf1 (diff)
downloadopie-d5433091ba9741f0fae104d038b906e353065e2d.zip
opie-d5433091ba9741f0fae104d038b906e353065e2d.tar.gz
opie-d5433091ba9741f0fae104d038b906e353065e2d.tar.bz2
Some fixes for receiving files via {x,y,z}modem:
- let transfer dialog reset progress bar when finished - typo: s/Sent/Received in received confirmation dialog - specify filename for xmodem (the man page is not very clear about this, but it doesn't work without filename!) - add --overwrite Here's the big problem: For user security, I'd rather use --rename than --overwrite (or make it configurable). But: * --rename is not supported at all by rx/rz/... * --overwrite is not supported by ymodem * --overwrite is always used by xmodem even if not used I want to kick the authors of rz now... Anybody knows a solution?
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/filereceive.cpp7
-rw-r--r--noncore/apps/opie-console/transferdialog.cpp7
2 files changed, 12 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/filereceive.cpp b/noncore/apps/opie-console/filereceive.cpp
index e517862..e387273 100644
--- a/noncore/apps/opie-console/filereceive.cpp
+++ b/noncore/apps/opie-console/filereceive.cpp
@@ -50,13 +50,18 @@ void FileReceive::receive( const QString& dir ) {
50 case SY: 50 case SY:
51 typus = "--ymodem"; 51 typus = "--ymodem";
52 break; 52 break;
53 } 53 }
54 54
55 /* we should never return from here */ 55 /* we should never return from here */
56 execlp("rz", "rz", typus, NULL ); 56 if( m_type == SX )
57 // FIXME: file name should be configurable - currently we ensure it
58 // doesn't get overwritten by -E (--rename)
59 execlp("rz", "rz", typus, "--overwrite", QObject::tr("SynchronizedFile").latin1(), NULL );
60 else
61 execlp("rz", "rz", typus, "--overwrite", NULL );
57 62
58 char resultByte = 1; 63 char resultByte = 1;
59 if (m_info[1] ) 64 if (m_info[1] )
60 ::write(m_info[1], &resultByte, 1 ); 65 ::write(m_info[1], &resultByte, 1 );
61 66
62 _exit( -1 ); 67 _exit( -1 );
diff --git a/noncore/apps/opie-console/transferdialog.cpp b/noncore/apps/opie-console/transferdialog.cpp
index ac5b1d0..f89723c 100644
--- a/noncore/apps/opie-console/transferdialog.cpp
+++ b/noncore/apps/opie-console/transferdialog.cpp
@@ -227,22 +227,27 @@ void TransferDialog::slotError(int error, const QString& message)
227 227
228 m_autocleanup = 1; 228 m_autocleanup = 1;
229} 229}
230 230
231void TransferDialog::slotSent() 231void TransferDialog::slotSent()
232{ 232{
233 progressbar->setProgress(100);
233 QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been sent.")); 234 QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been sent."));
234 ok->setEnabled(true); 235 ok->setEnabled(true);
236 progressbar->setProgress(0);
235 statusbar->setText(QObject::tr("Ready")); 237 statusbar->setText(QObject::tr("Ready"));
236 m_autocleanup = 1; 238 m_autocleanup = 1;
237} 239}
238 240
239void TransferDialog::slotReceived(const QString& file) 241void TransferDialog::slotReceived(const QString& file)
240{ 242{
241 QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been received as %1.").arg(file)); 243 progressbar->setProgress(100);
244 QMessageBox::information(this, QObject::tr("Received"), QObject::tr("File has been received."));
245 //QMessageBox::information(this, QObject::tr("Sent"), QObject::tr("File has been received as %1.").arg(file));
242 ok->setEnabled(true); 246 ok->setEnabled(true);
247 progressbar->setProgress(0);
243 statusbar->setText(QObject::tr("Ready")); 248 statusbar->setText(QObject::tr("Ready"));
244 m_autocleanup = 1; 249 m_autocleanup = 1;
245} 250}
246 251
247void TransferDialog::slotMode(int id) 252void TransferDialog::slotMode(int id)
248{ 253{