Updated interface files.

Added SrcIds to FileRequests().



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@699 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-08-17 16:14:03 +00:00
parent eb8dacc798
commit f9b22cc5d2
6 changed files with 31 additions and 16 deletions

View File

@ -289,8 +289,8 @@ void MessagesDialog::getallrecommended()
{
std::cerr << "MessagesDialog::getallrecommended() Calling File Request";
std::cerr << std::endl;
rsFiles -> FileRequest(*fit, *hit, *sit, "", 0);
std::list<std::string> srcIds;
rsFiles -> FileRequest(*fit, *hit, *sit, "", 0, srcIds);
}
}

View File

@ -229,10 +229,11 @@ void SearchDialog::download()
{
std::cerr << "SearchDialog::download() Calling File Request";
std::cerr << std::endl;
std::list<std::string> srcIds;
rsFiles -> FileRequest((item->text(SR_NAME_COL)).toStdString(),
(item->text(SR_HASH_COL)).toStdString(),
(item->text(SR_SIZE_COL)).toInt(),
"", 0);
"", 0, srcIds);
}
else
{

View File

@ -540,7 +540,9 @@ void SubFileItem::download()
// TEMP
std::cerr << "SubFileItem::download() Calling File Request";
std::cerr << std::endl;
rsFiles->FileRequest(mFileName, mFileHash, mFileSize, "", 0);
std::list<std::string> srcIds;
srcIds.push_back(mSrcId);
rsFiles->FileRequest(mFileName, mFileHash, mFileSize, "", 0, srcIds);
}

View File

@ -152,11 +152,12 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
return QVariant();
}
#if 0
/*if (role == Qt::BackgroundRole)
{*/
/*** colour entries based on rank/age/count **/
/*** rank (0-10) ***/
/*uint32_t r = details.rank;
/ *uint32_t r = details.rank;
if (r > 10) r = 10;
r = 200 + r * 5; /* 0->250 */
@ -225,6 +226,7 @@ RemoteDirModel::RemoteDirModel(bool mode, QObject *parent)
return QVariant();
}
}*/
#endif
if (role == Qt::DecorationRole)
{
@ -694,8 +696,10 @@ void RemoteDirModel::downloadSelected(QModelIndexList list)
{
std::cerr << "RemoteDirModel::downloadSelected() Calling File Request";
std::cerr << std::endl;
std::list<std::string> srcIds;
srcIds.push_back(details.id);
rsFiles -> FileRequest(details.name, details.hash,
details.count, "", 0);
details.count, "", 0, srcIds);
}
}
}

View File

@ -38,16 +38,19 @@ extern RsFiles *rsFiles;
class Expression;
const uint32_t RS_FILE_CTRL_PAUSE = 0x0100;
const uint32_t RS_FILE_CTRL_START = 0x0200;
/* These are used mainly by ftController at the moment */
const uint32_t RS_FILE_CTRL_PAUSE = 0x00000100;
const uint32_t RS_FILE_CTRL_START = 0x00000200;
const uint32_t RS_FILE_CTRL_TRICKLE = 0x0001;
const uint32_t RS_FILE_CTRL_SLOW = 0x0002;
const uint32_t RS_FILE_CTRL_STANDARD = 0x0003;
const uint32_t RS_FILE_CTRL_FAST = 0x0004;
const uint32_t RS_FILE_CTRL_STREAM_AUDIO = 0x0005;
const uint32_t RS_FILE_CTRL_STREAM_VIDEO = 0x0006;
const uint32_t RS_FILE_RATE_TRICKLE = 0x00000001;
const uint32_t RS_FILE_RATE_SLOW = 0x00000002;
const uint32_t RS_FILE_RATE_STANDARD = 0x00000003;
const uint32_t RS_FILE_RATE_FAST = 0x00000004;
const uint32_t RS_FILE_RATE_STREAM_AUDIO = 0x00000005;
const uint32_t RS_FILE_RATE_STREAM_VIDEO = 0x00000006;
const uint32_t RS_FILE_PEER_ONLINE = 0x00001000;
const uint32_t RS_FILE_PEER_OFFLINE = 0x00002000;
/************************************
* Used To indicate where to search.
@ -67,6 +70,7 @@ const uint32_t RS_FILE_HINTS_DOWNLOAD = 0x00000010;
const uint32_t RS_FILE_HINTS_UPLOAD = 0x00000020;
const uint32_t RS_FILE_HINTS_SPEC_ONLY = 0x01000000;
const uint32_t RS_FILE_HINTS_NO_SEARCH = 0x02000000;
const uint32_t RS_FILE_EXTRA_DELETE = 0x0010;
@ -86,8 +90,8 @@ virtual ~RsFiles() { return; }
/***
* Control of Downloads.
***/
virtual bool FileRequest(std::string fname, std::string hash,
uint32_t size, std::string dest, uint32_t flags) = 0;
virtual bool FileRequest(std::string fname, std::string hash, uint32_t size,
std::string dest, uint32_t flags, std::list<std::string> srcIds) = 0;
virtual bool FileCancel(std::string hash) = 0;
virtual bool FileControl(std::string hash, uint32_t flags) = 0;
virtual bool FileClearCompleted() = 0;

View File

@ -105,6 +105,10 @@ class FileTransferInfo: public FileInfo
FileTransferInfo() { return; }
};
std::ostream &operator<<(std::ostream &out, const FileInfo &info);
/* matched to the uPnP states */
#define UPNP_STATE_UNINITIALISED 0
#define UPNP_STATE_UNAVAILABILE 1