summaryrefslogtreecommitdiff
Unidiff
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
@@ -32,49 +32,54 @@ void FileReceive::receive( const QString& dir ) {
32 m_info[0] = m_info[1] = 0; 32 m_info[0] = m_info[1] = 0;
33 33
34 m_pid = fork(); 34 m_pid = fork();
35 switch( m_pid ) { 35 switch( m_pid ) {
36 case -1: 36 case -1:
37 //emit error 37 //emit error
38 slotExec(); 38 slotExec();
39 break; 39 break;
40 /* child */ 40 /* child */
41 case 0: { 41 case 0: {
42 setupChild(); 42 setupChild();
43 char* typus = NULL; 43 char* typus = NULL;
44 switch(m_type ) { 44 switch(m_type ) {
45 case SZ: 45 case SZ:
46 break; 46 break;
47 case SX: 47 case SX:
48 typus = "-X"; 48 typus = "-X";
49 break; 49 break;
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 );
63 break; 68 break;
64 } 69 }
65 default: { 70 default: {
66 if ( m_info[1] ) 71 if ( m_info[1] )
67 close( m_info[1] ); 72 close( m_info[1] );
68 73
69 if ( m_info[0] ) for (;;) { 74 if ( m_info[0] ) for (;;) {
70 char resultByte; int len; 75 char resultByte; int len;
71 len = read(m_info[0], &resultByte, 1 ); 76 len = read(m_info[0], &resultByte, 1 );
72 /* len == 1 start up failed */ 77 /* len == 1 start up failed */
73 if ( len == 1 ) { 78 if ( len == 1 ) {
74 emit error( StartError, tr("Could not start") ); 79 emit error( StartError, tr("Could not start") );
75 return; 80 return;
76 } 81 }
77 if ( len == -1 ) 82 if ( len == -1 )
78 if ( (errno == ECHILD ) || (errno == EINTR ) ) 83 if ( (errno == ECHILD ) || (errno == EINTR ) )
79 continue; 84 continue;
80 85
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
@@ -209,53 +209,58 @@ void TransferDialog::slotError(int error, const QString& message)
209 break; 209 break;
210 case FileTransferLayer::Undefined: 210 case FileTransferLayer::Undefined:
211 QMessageBox::critical(this, 211 QMessageBox::critical(this,
212 QObject::tr("Error"), 212 QObject::tr("Error"),
213 QObject::tr("Undefined error occured.")); 213 QObject::tr("Undefined error occured."));
214 break; 214 break;
215 case FileTransferLayer::Incomplete: 215 case FileTransferLayer::Incomplete:
216 QMessageBox::critical(this, 216 QMessageBox::critical(this,
217 QObject::tr("Error"), 217 QObject::tr("Error"),
218 QObject::tr("Incomplete transfer.")); 218 QObject::tr("Incomplete transfer."));
219 break; 219 break;
220 case FileTransferLayer::Unknown: 220 case FileTransferLayer::Unknown:
221 default: 221 default:
222 QMessageBox::critical(this, 222 QMessageBox::critical(this,
223 QObject::tr("Error"), 223 QObject::tr("Error"),
224 QObject::tr("Unknown error occured.")); 224 QObject::tr("Unknown error occured."));
225 break; 225 break;
226 } 226 }
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{
249 if(id == id_send) 254 if(id == id_send)
250 { 255 {
251 selector->setEnabled(true); 256 selector->setEnabled(true);
252 filename->setEnabled(true); 257 filename->setEnabled(true);
253 } 258 }
254 else 259 else
255 { 260 {
256 selector->setEnabled(false); 261 selector->setEnabled(false);
257 filename->setEnabled(false); 262 filename->setEnabled(false);
258 } 263 }
259 m_transfermode = id; 264 m_transfermode = id;
260} 265}
261 266