mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-08-08 06:12:43 -04:00
ported branch v0.5.0 commits 2529 and 2544 to trunk
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@2545 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
a4d1e61aa2
commit
cc17744ee3
13 changed files with 123 additions and 105 deletions
|
@ -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 ;
|
||||
|
@ -384,10 +384,6 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
|
|||
if(all_downloading)
|
||||
contextMnu.addMenu( chunkMenu);
|
||||
|
||||
if(!all_paused)
|
||||
contextMnu.addAction( pauseAct);
|
||||
if(!all_downld)
|
||||
contextMnu.addAction( resumeAct);
|
||||
|
||||
if(info.downloadStatus != FT_STATE_COMPLETE)
|
||||
contextMnu.addAction( cancelAct);
|
||||
|
@ -406,6 +402,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);
|
||||
|
@ -414,7 +415,9 @@ void TransfersDialog::downloadListCostumPopupMenu( QPoint point )
|
|||
if(single)
|
||||
contextMnu.addAction( copylinkAct);
|
||||
#endif
|
||||
contextMnu.addAction( pastelinkAct);
|
||||
if(!RSLinkClipboard::empty())
|
||||
contextMnu.addAction( pastelinkAct);
|
||||
|
||||
contextMnu.addSeparator();
|
||||
// contextMnu.addAction( clearQueueAct);
|
||||
contextMnu.addSeparator();
|
||||
|
@ -670,7 +673,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;
|
||||
|
@ -690,6 +693,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;
|
||||
}
|
||||
|
||||
|
@ -751,10 +755,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];
|
||||
|
@ -1072,15 +1074,12 @@ void TransfersDialog::showDetailsDialog()
|
|||
|
||||
void TransfersDialog::pasteLink()
|
||||
{
|
||||
QList<QUrl> urllist = QApplication::clipboard()->mimeData()->urls() ;
|
||||
const std::vector<RetroShareLink>& links(RSLinkClipboard::pasteLinks()) ;
|
||||
|
||||
for(QList<QUrl>::const_iterator it(urllist.begin());it!=urllist.end();++it)
|
||||
{
|
||||
RetroShareLink link(*it) ;
|
||||
|
||||
if (link.valid())
|
||||
rsFiles->FileRequest(link.name().toStdString(), link.hash().toStdString(),link.size(), "", RS_FILE_HINTS_NETWORK_WIDE, std::list<std::string>());
|
||||
}
|
||||
for(uint32_t i=0;i<links.size();++i)
|
||||
if (links[i].valid())
|
||||
if(!rsFiles->FileRequest(links[i].name().toStdString(), links[i].hash().toStdString(),links[i].size(), "", RS_FILE_HINTS_NETWORK_WIDE, std::list<std::string>()))
|
||||
QMessageBox::critical(NULL,"Download refused","The file "+links[i].name()+" could not be downloaded. Do you already have it ?") ;
|
||||
}
|
||||
|
||||
void TransfersDialog::getIdOfSelectedItems(std::set<QStandardItem *>& items)
|
||||
|
@ -1125,6 +1124,7 @@ bool TransfersDialog::controlTransferFile(uint32_t flags)
|
|||
std::set<QStandardItem *>::iterator it;
|
||||
getIdOfSelectedItems(items);
|
||||
for (it = items.begin(); it != items.end(); it ++) {
|
||||
std::cerr << "changing file mode for hash " << (*it)->data(Qt::DisplayRole).toString().toStdString() << " to " << flags << std::endl;
|
||||
result &= rsFiles->FileControl((*it)->data(Qt::DisplayRole).toString().toStdString(), flags);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue