From 928a06c17ef33d80f07a0779a2c315af60af0ef1 Mon Sep 17 00:00:00 2001 From: csoler Date: Mon, 15 Mar 2010 16:26:41 +0000 Subject: [PATCH] trunk/branch uniformisation git-svn-id: http://svn.code.sf.net/p/retroshare/code/branches/v0.5.0@2552 b45a01b8-16f6-495d-af2f-9b41ad6348cc --- libretroshare/src/turtle/p3turtle.cc | 2 +- retroshare-gui/src/gui/SearchDialog.cpp | 1 - retroshare-gui/src/gui/TransfersDialog.cpp | 14 +++++++++----- 3 files changed, 10 insertions(+), 7 deletions(-) diff --git a/libretroshare/src/turtle/p3turtle.cc b/libretroshare/src/turtle/p3turtle.cc index c025c9f05..6889dcdc6 100644 --- a/libretroshare/src/turtle/p3turtle.cc +++ b/libretroshare/src/turtle/p3turtle.cc @@ -1687,7 +1687,7 @@ void p3turtle::monitorFileTunnels(const std::string& name,const std::string& fil // First, check if the hash is tagged for removal (there's a delay) - for(uint i=0;i<_hashes_to_remove.size();++i) + for(uint32_t i=0;i<_hashes_to_remove.size();++i) if(_hashes_to_remove[i] == file_hash) { _hashes_to_remove[i] = _hashes_to_remove.back() ; diff --git a/retroshare-gui/src/gui/SearchDialog.cpp b/retroshare-gui/src/gui/SearchDialog.cpp index b37a8f80a..5a21056bf 100644 --- a/retroshare-gui/src/gui/SearchDialog.cpp +++ b/retroshare-gui/src/gui/SearchDialog.cpp @@ -1210,7 +1210,6 @@ void SearchDialog::copysearchLink() RetroShareLink link(fname, fsize, fhash); - std::cerr << "new link added to clipboard: " << link.toString().toStdString() << std::endl ; if(link.valid()) urls.push_back(link) ; } diff --git a/retroshare-gui/src/gui/TransfersDialog.cpp b/retroshare-gui/src/gui/TransfersDialog.cpp index 448577511..df864def5 100644 --- a/retroshare-gui/src/gui/TransfersDialog.cpp +++ b/retroshare-gui/src/gui/TransfersDialog.cpp @@ -362,7 +362,7 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point ) for (int i = 0; i < lst.count (); i++) { - if ( lst[i].column() == 0 && info.downloadStatus == FT_STATE_WAITING ) + if ( lst[i].column() == 0 && info.downloadStatus == FT_STATE_PAUSED ) all_downld = false ; if ( lst[i].column() == 0 && info.downloadStatus == FT_STATE_DOWNLOADING ) all_paused = false ; @@ -406,6 +406,11 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point ) contextMnu.addAction( openfolderAct); contextMnu.addAction( detailsfileAct); contextMnu.addSeparator(); + + if(info.downloadStatus == FT_STATE_PAUSED) + contextMnu.addAction( resumeAct); + else if(info.downloadStatus != FT_STATE_COMPLETE) + contextMnu.addAction( pauseAct); } contextMnu.addAction( clearcompletedAct); @@ -672,7 +677,7 @@ void TransfersDialog::insertTransfers() QString fileName = QString::fromUtf8(info.fname.c_str()); QString fileHash = QString::fromStdString(info.hash); qlonglong fileSize = info.size; - double fileDlspeed = info.tfRate * 1024.0; + double fileDlspeed = (info.downloadStatus==FT_STATE_PAUSED)?0.0:(info.tfRate * 1024.0); /* get the sources (number of online peers) */ int online = 0; @@ -692,6 +697,7 @@ void TransfersDialog::insertTransfers() case FT_STATE_DOWNLOADING: status = tr("Downloading"); break; case FT_STATE_COMPLETE: status = tr("Complete"); break; case FT_STATE_QUEUED: status = tr("Queued"); break; + case FT_STATE_PAUSED: status = tr("Paused"); break; default: status = tr("Unknown"); break; } @@ -753,10 +759,8 @@ void TransfersDialog::insertTransfers() default: status = tr(""); break; } double peerDlspeed = 0; - if ((uint32_t)pit->status == FT_STATE_DOWNLOADING) - { + if ((uint32_t)pit->status == FT_STATE_DOWNLOADING && info.downloadStatus != FT_STATE_PAUSED) peerDlspeed = pit->tfRate * 1024.0; - } FileProgressInfo peerpinfo ; peerpinfo.cmap = fcinfo.compressed_peer_availability_maps[pit->peerId];