|
Lines 253-259
Link Here
|
| 253 |
if (s != "") |
253 |
if (s != "") |
| 254 |
{ |
254 |
{ |
| 255 |
transmitBar->setProgress(0); |
255 |
transmitBar->setProgress(0); |
| 256 |
localProgress = 0; |
256 |
transmitLocalProgress = 0; |
| 257 |
emit sendFile(s,otherNick); |
257 |
emit sendFile(s,otherNick); |
| 258 |
} |
258 |
} |
| 259 |
} |
259 |
} |
|
Lines 293-299
Link Here
|
| 293 |
connect(xferSocket,SIGNAL(connectionClosed()),this,SLOT(xferSocket_connectionClosed())); |
293 |
connect(xferSocket,SIGNAL(connectionClosed()),this,SLOT(xferSocket_connectionClosed())); |
| 294 |
connect(xferSocket,SIGNAL(xferAborted()),this,SLOT(xferAborted())); |
294 |
connect(xferSocket,SIGNAL(xferAborted()),this,SLOT(xferAborted())); |
| 295 |
connect(xferSocket,SIGNAL(xferProgress(int)),this,SLOT(xferProgress(int))); |
295 |
connect(xferSocket,SIGNAL(xferProgress(int)),this,SLOT(xferProgress(int))); |
| 296 |
localProgress = 0; |
296 |
transmitLocalProgress = 0; |
| 297 |
transmitFileName = filename; |
297 |
transmitFileName = filename; |
| 298 |
xferSocket->fire(); |
298 |
xferSocket->fire(); |
| 299 |
} |
299 |
} |
|
Lines 309-315
Link Here
|
| 309 |
void ChatView::xferSocket_connectionClosed() |
309 |
void ChatView::xferSocket_connectionClosed() |
| 310 |
{ |
310 |
{ |
| 311 |
QString a = getOtherNick(); |
311 |
QString a = getOtherNick(); |
| 312 |
if (localProgress < 100) |
312 |
if (transmitLocalProgress < 100) |
| 313 |
{ |
313 |
{ |
| 314 |
xferSocket->close(); |
314 |
xferSocket->close(); |
| 315 |
emit transferError(a,transmitFileName,XFERABORT); |
315 |
emit transferError(a,transmitFileName,XFERABORT); |
|
Lines 326-339
Link Here
|
| 326 |
/** No descriptions */ |
326 |
/** No descriptions */ |
| 327 |
void ChatView::xferProgress(int progress) |
327 |
void ChatView::xferProgress(int progress) |
| 328 |
{ |
328 |
{ |
| 329 |
localProgress = progress; |
329 |
transmitLocalProgress = progress; |
| 330 |
|
330 |
|
| 331 |
if (progress == 255) |
331 |
if (progress == 255) |
| 332 |
progress = 100; |
332 |
progress = 100; |
| 333 |
|
333 |
|
| 334 |
transmitBar->setProgress(progress); |
334 |
transmitBar->setProgress(progress); |
| 335 |
|
335 |
|
| 336 |
if (localProgress == 255) |
336 |
if (transmitLocalProgress == 255) |
| 337 |
UpdateText(END_OF_TRANSFER_MSG(transmitFileName),C6Config->ForeMessageColor); |
337 |
UpdateText(END_OF_TRANSFER_MSG(transmitFileName),C6Config->ForeMessageColor); |
| 338 |
} |
338 |
} |
| 339 |
|
339 |
|
|
Lines 348-353
Link Here
|
| 348 |
xferSocket->disconnect(); |
348 |
xferSocket->disconnect(); |
| 349 |
xferSocket->close(); |
349 |
xferSocket->close(); |
| 350 |
delete xferSocket; |
350 |
delete xferSocket; |
|
|
351 |
xferSocket = NULL; |
| 351 |
} |
352 |
} |
| 352 |
} |
353 |
} |
| 353 |
|
354 |
|
|
Lines 357-363
Link Here
|
| 357 |
*/ |
358 |
*/ |
| 358 |
void ChatView::stopTransmitButton_clicked() |
359 |
void ChatView::stopTransmitButton_clicked() |
| 359 |
{ |
360 |
{ |
| 360 |
if ((xferSocket != NULL) && (xferSocket->state() == QSocket::Connected)) |
361 |
if ((xferSocket != NULL) && (xferSocket->state() == QSocket::Connected) && (transmitLocalProgress != 255)) |
| 361 |
{ |
362 |
{ |
| 362 |
xferSocket->close(); |
363 |
xferSocket->close(); |
| 363 |
UpdateText(ABORT_TRANSFER_MSG(transmitFileName),C6Config->ForeMessageColor); |
364 |
UpdateText(ABORT_TRANSFER_MSG(transmitFileName),C6Config->ForeMessageColor); |
|
Lines 379-388
Link Here
|
| 379 |
*/ |
380 |
*/ |
| 380 |
void ChatView::activateFileServer() |
381 |
void ChatView::activateFileServer() |
| 381 |
{ |
382 |
{ |
| 382 |
xferServer = new C6XferServer(C6Config,serverPort,this); |
383 |
if (!xferServer) |
| 383 |
connect(xferServer,SIGNAL(receiveProgress(int)),this,SLOT(receiveProgress(int))); |
384 |
{ |
| 384 |
connect(xferServer,SIGNAL(signalFileSpec(QString&,long int)),this,SLOT(receiveFileSpec(QString&, long int ))); |
385 |
xferServer = new C6XferServer(C6Config,serverPort,this); |
| 385 |
connect(xferServer,SIGNAL(receiveAborted()),this,SLOT(receiveAborted())); |
386 |
connect(xferServer,SIGNAL(receiveProgress(int)),this,SLOT(receiveProgress(int))); |
|
|
387 |
connect(xferServer,SIGNAL(signalFileSpec(QString&,long int)),this,SLOT(receiveFileSpec(QString&, long int ))); |
| 388 |
connect(xferServer,SIGNAL(receiveAborted()),this,SLOT(receiveAborted())); |
| 389 |
} |
| 386 |
} |
390 |
} |
| 387 |
|
391 |
|
| 388 |
|
392 |
|
|
Lines 391-406
Link Here
|
| 391 |
*/ |
395 |
*/ |
| 392 |
void ChatView::receiveProgress(int progress) |
396 |
void ChatView::receiveProgress(int progress) |
| 393 |
{ |
397 |
{ |
| 394 |
int localProgress; |
398 |
receiveLocalProgress = progress; |
| 395 |
|
399 |
|
| 396 |
localProgress = progress; |
400 |
if (progress == 255) |
| 397 |
|
401 |
progress = 100; |
| 398 |
if (progress == 101) |
|
|
| 399 |
progress--; |
| 400 |
|
402 |
|
| 401 |
receiveBar->setProgress(progress); |
403 |
receiveBar->setProgress(progress); |
| 402 |
|
404 |
|
| 403 |
if (localProgress == 101) |
405 |
if (receiveLocalProgress == 255) |
| 404 |
UpdateText(END_OF_RECEIVE_MSG(receiveFileName,receiveFileSize),C6Config->ForeMessageColor); |
406 |
UpdateText(END_OF_RECEIVE_MSG(receiveFileName,receiveFileSize),C6Config->ForeMessageColor); |
| 405 |
} |
407 |
} |
| 406 |
|
408 |
|
|
Lines 452-456
Link Here
|
| 452 |
*/ |
454 |
*/ |
| 453 |
void ChatView::stopReceiveButton_clicked() |
455 |
void ChatView::stopReceiveButton_clicked() |
| 454 |
{ |
456 |
{ |
| 455 |
xferServer->stopReceive(); |
457 |
if (xferServer && receiveLocalProgress != 255 && receiveLocalProgress) |
|
|
458 |
{ |
| 459 |
QString a = getOtherNick(); |
| 460 |
|
| 461 |
xferServer->stopReceive(); |
| 462 |
UpdateText(RECEIVE_ABORT_TRANSFER_MSG(receiveFileName,a),C6Config->ForeMessageColor); |
| 463 |
receiveLocalProgress = 0; |
| 464 |
} |
| 456 |
} |
465 |
} |