comparison src/uicommon/gftpui.c @ 876:2d4e6fca8e7c

2007-2-6 Brian Masney <masneyb@gftp.org> * src/text/textui.c src/gtk/gtkui_transfer.c src/uicommon/gftpui.h - added new function: gftpui_cancel_file_transfer() * src/uicommon/gftpui.c - use gftpui_cancel_file_transfer() to cancel the file transfers * lib/gftp.h lib/misc.c src/gtk/transfer.c - added pointer for the thread_id of the transfer to the gftp_transfer structure. This will be used in the GTK+ port so that the transfer can be stopped.
author masneyb
date Wed, 07 Feb 2007 02:43:57 +0000
parents 42f9ce5e4bff
children a41a3590d696
comparison
equal deleted inserted replaced
875:19dacfb69433 876:2d4e6fca8e7c
1346 if (tdata->started && !(curfle->transfer_action & GFTP_TRANS_ACTION_SKIP)) 1346 if (tdata->started && !(curfle->transfer_action & GFTP_TRANS_ACTION_SKIP))
1347 { 1347 {
1348 curfle->transfer_action = GFTP_TRANS_ACTION_SKIP; 1348 curfle->transfer_action = GFTP_TRANS_ACTION_SKIP;
1349 if (tdata->curfle != NULL && curfle == tdata->curfle->data) 1349 if (tdata->curfle != NULL && curfle == tdata->curfle->data)
1350 { 1350 {
1351 tdata->cancel = 1; 1351 gftpui_cancel_file_transfer (tdata);
1352 tdata->fromreq->cancel = 1;
1353 tdata->toreq->cancel = 1;
1354 tdata->skip_file = 1; 1352 tdata->skip_file = 1;
1355 } 1353 }
1356 else if (!curfle->transfer_done) 1354 else if (!curfle->transfer_done)
1357 tdata->total_bytes -= curfle->size; 1355 tdata->total_bytes -= curfle->size;
1358 } 1356 }
1371 { 1369 {
1372 g_static_mutex_lock (&tdata->structmutex); 1370 g_static_mutex_lock (&tdata->structmutex);
1373 1371
1374 if (tdata->started) 1372 if (tdata->started)
1375 { 1373 {
1376 tdata->cancel = 1; 1374 gftpui_cancel_file_transfer (tdata);
1377 tdata->fromreq->cancel = 1;
1378 tdata->toreq->cancel = 1;
1379 tdata->skip_file = 0; 1375 tdata->skip_file = 0;
1380 } 1376 }
1381 else 1377 else
1382 tdata->done = 1; 1378 tdata->done = 1;
1383 1379
1550 gftpui_common_transfer_files (gftp_transfer * tdata) 1546 gftpui_common_transfer_files (gftp_transfer * tdata)
1551 { 1547 {
1552 int ret, skipped_files; 1548 int ret, skipped_files;
1553 1549
1554 tdata->curfle = tdata->files; 1550 tdata->curfle = tdata->files;
1551 gftpui_common_num_child_threads++;
1552
1555 gettimeofday (&tdata->starttime, NULL); 1553 gettimeofday (&tdata->starttime, NULL);
1556 memcpy (&tdata->lasttime, &tdata->starttime, sizeof (tdata->lasttime)); 1554 memcpy (&tdata->lasttime, &tdata->starttime, sizeof (tdata->lasttime));
1557 1555
1558 skipped_files = 0; 1556 skipped_files = 0;
1559 while (tdata->curfle != NULL) 1557 while (tdata->curfle != NULL)
1594 tdata->fromreq->logging_function (gftp_logging_error, tdata->fromreq, 1592 tdata->fromreq->logging_function (gftp_logging_error, tdata->fromreq,
1595 _("There were %d files or directories that could not be transferred. Check the log for which items were not properly transferred."), 1593 _("There were %d files or directories that could not be transferred. Check the log for which items were not properly transferred."),
1596 skipped_files); 1594 skipped_files);
1597 1595
1598 tdata->done = 1; 1596 tdata->done = 1;
1597 gftpui_common_num_child_threads--;
1598
1599 return (1); 1599 return (1);
1600 } 1600 }
1601 1601
1602 1602
1603 void 1603 void