mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-10-01 02:35:48 -04:00
share of incoming directory by default
git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1359 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
parent
49e9066afb
commit
990ed277bd
@ -78,7 +78,8 @@ ftFileControl::ftFileControl(std::string fname,
|
||||
}
|
||||
|
||||
ftController::ftController(CacheStrapper *cs, ftDataMultiplex *dm, std::string configDir)
|
||||
:CacheTransfer(cs), p3Config(CONFIG_TYPE_FT_CONTROL), mDataplex(dm), mFtActive(false),mTurtle(NULL)
|
||||
:CacheTransfer(cs), p3Config(CONFIG_TYPE_FT_CONTROL), mDataplex(dm), mFtActive(false),
|
||||
mTurtle(NULL), mShareDownloadDir(true)
|
||||
{
|
||||
/* TODO */
|
||||
}
|
||||
@ -1293,6 +1294,7 @@ bool ftController::CancelCacheFile(RsPeerId id, std::string path, std::string ha
|
||||
|
||||
const std::string download_dir_ss("DOWN_DIR");
|
||||
const std::string partial_dir_ss("PART_DIR");
|
||||
const std::string share_dwl_dir("SHARE_DWL_DIR");
|
||||
|
||||
|
||||
/* p3Config Interface */
|
||||
@ -1323,6 +1325,7 @@ std::list<RsItem *> ftController::saveList(bool &cleanup)
|
||||
/* basic control parameters */
|
||||
configMap[download_dir_ss] = getDownloadDirectory();
|
||||
configMap[partial_dir_ss] = getPartialsDirectory();
|
||||
configMap[share_dwl_dir] = mShareDownloadDir ? "YES" : "NO";
|
||||
|
||||
RsConfigKeyValueSet *rskv = new RsConfigKeyValueSet();
|
||||
|
||||
@ -1462,6 +1465,27 @@ bool ftController::loadConfigMap(std::map<std::string, std::string> &configMap)
|
||||
setPartialsDirectory(mit->second);
|
||||
}
|
||||
|
||||
if (configMap.end() != (mit = configMap.find(share_dwl_dir)))
|
||||
{
|
||||
if (mit->second == "YES")
|
||||
{
|
||||
setShareDownloadDirectory(true);
|
||||
}
|
||||
else if (mit->second == "NO")
|
||||
{
|
||||
setShareDownloadDirectory(false);
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void ftController::setShareDownloadDirectory(bool value)
|
||||
{
|
||||
mShareDownloadDir = value;
|
||||
}
|
||||
|
||||
bool ftController::getShareDownloadDirectory()
|
||||
{
|
||||
return mShareDownloadDir;
|
||||
}
|
||||
|
@ -26,7 +26,7 @@
|
||||
#ifndef FT_CONTROLLER_HEADER
|
||||
#define FT_CONTROLLER_HEADER
|
||||
|
||||
/*
|
||||
/*
|
||||
* ftController
|
||||
*
|
||||
* Top level download controller.
|
||||
@ -69,8 +69,8 @@ class ftFileControl
|
||||
enum {DOWNLOADING,COMPLETED,ERROR_COMPLETION};
|
||||
|
||||
ftFileControl();
|
||||
ftFileControl(std::string fname, std::string tmppath, std::string dest,
|
||||
uint64_t size, std::string hash, uint32_t flags,
|
||||
ftFileControl(std::string fname, std::string tmppath, std::string dest,
|
||||
uint64_t size, std::string hash, uint32_t flags,
|
||||
ftFileCreator *fc, ftTransferModule *tm, uint32_t cb_flags);
|
||||
|
||||
std::string mName;
|
||||
@ -118,14 +118,17 @@ void setFtSearchNExtra(ftSearch *, ftExtraList *);
|
||||
void setTurtleRouter(p3turtle *) ;
|
||||
bool activate();
|
||||
|
||||
void setShareDownloadDirectory(bool value);
|
||||
bool getShareDownloadDirectory();
|
||||
|
||||
virtual void run();
|
||||
|
||||
/***************************************************************/
|
||||
/********************** Controller Access **********************/
|
||||
/***************************************************************/
|
||||
|
||||
bool FileRequest(std::string fname, std::string hash,
|
||||
uint64_t size, std::string dest, uint32_t flags,
|
||||
bool FileRequest(std::string fname, std::string hash,
|
||||
uint64_t size, std::string dest, uint32_t flags,
|
||||
std::list<std::string> &sourceIds);
|
||||
|
||||
bool FileCancel(std::string hash);
|
||||
@ -151,7 +154,7 @@ bool moveFile(const std::string& source,const std::string& dest) ;
|
||||
|
||||
protected:
|
||||
|
||||
virtual bool RequestCacheFile(RsPeerId id, std::string path, std::string hash, uint64_t size);
|
||||
virtual bool RequestCacheFile(RsPeerId id, std::string path, std::string hash, uint64_t size);
|
||||
virtual bool CancelCacheFile(RsPeerId id, std::string path, std::string hash, uint64_t size);
|
||||
|
||||
/***************************************************************/
|
||||
@ -172,7 +175,6 @@ virtual std::list<RsItem *> saveList(bool &cleanup);
|
||||
virtual bool loadList(std::list<RsItem *> load);
|
||||
bool loadConfigMap(std::map<std::string, std::string> &configMap);
|
||||
|
||||
|
||||
private:
|
||||
|
||||
/* RunTime Functions */
|
||||
@ -185,7 +187,7 @@ bool setPeerState(ftTransferModule *tm, std::string id,
|
||||
|
||||
/* pointers to other components */
|
||||
|
||||
ftSearch *mSearch;
|
||||
ftSearch *mSearch;
|
||||
ftDataMultiplex *mDataplex;
|
||||
ftExtraList *mExtraList;
|
||||
p3turtle *mTurtle ;
|
||||
@ -218,6 +220,9 @@ bool setPeerState(ftTransferModule *tm, std::string id,
|
||||
bool mFtActive;
|
||||
bool mFtPendingDone;
|
||||
std::list<ftPendingRequest> mPendingRequests;
|
||||
|
||||
/* share incoming directory */
|
||||
bool mShareDownloadDir;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@ -203,17 +203,17 @@ void ftServer::run()
|
||||
{
|
||||
if ((now - info.lastTS) > 10)
|
||||
{
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cout << "info.lastTS = " << info.lastTS << ", now=" << now << std::endl ;
|
||||
#endif
|
||||
toDels.push_back(sit->first);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(!toDels.empty())
|
||||
mFtDataplex->deleteServers(toDels) ;
|
||||
|
||||
|
||||
#ifdef WIN32
|
||||
Sleep(1000);
|
||||
#else
|
||||
@ -232,11 +232,11 @@ void ftServer::run()
|
||||
/********************** Controller Access **********************/
|
||||
/***************************************************************/
|
||||
|
||||
bool ftServer::FileRequest(std::string fname, std::string hash, uint64_t size,
|
||||
bool ftServer::FileRequest(std::string fname, std::string hash, uint64_t size,
|
||||
std::string dest, uint32_t flags, std::list<std::string> srcIds)
|
||||
{
|
||||
std::cerr << "Requesting " << fname << std::endl ;
|
||||
return mFtController->FileRequest(fname, hash, size,
|
||||
return mFtController->FileRequest(fname, hash, size,
|
||||
dest, flags, srcIds);
|
||||
}
|
||||
|
||||
@ -320,7 +320,7 @@ bool ftServer::FileDetails(std::string hash, uint32_t hintflags, FileInfo &info)
|
||||
/******************* ExtraFileList Access **********************/
|
||||
/***************************************************************/
|
||||
|
||||
bool ftServer::ExtraFileAdd(std::string fname, std::string hash, uint64_t size,
|
||||
bool ftServer::ExtraFileAdd(std::string fname, std::string hash, uint64_t size,
|
||||
uint32_t period, uint32_t flags)
|
||||
{
|
||||
return mFtExtra->addExtraFile(fname, hash, size, period, flags);
|
||||
@ -354,7 +354,7 @@ bool ftServer::ExtraFileMove(std::string fname, std::string hash, uint64_t size,
|
||||
|
||||
int ftServer::RequestDirDetails(std::string uid, std::string path, DirDetails &details)
|
||||
{
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cerr << "ftServer::RequestDirDetails(uid:" << uid;
|
||||
std::cerr << ", path:" << path << ", ...) -> mFiStore";
|
||||
std::cerr << std::endl;
|
||||
@ -367,10 +367,10 @@ int ftServer::RequestDirDetails(std::string uid, std::string path, DirDetails &d
|
||||
#endif
|
||||
return mFiStore->RequestDirDetails(uid, path, details);
|
||||
}
|
||||
|
||||
|
||||
int ftServer::RequestDirDetails(void *ref, DirDetails &details, uint32_t flags)
|
||||
{
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cerr << "ftServer::RequestDirDetails(ref:" << ref;
|
||||
std::cerr << ", flags:" << flags << ", ...) -> mFiStore";
|
||||
std::cerr << std::endl;
|
||||
@ -384,7 +384,7 @@ int ftServer::RequestDirDetails(void *ref, DirDetails &details, uint32_t flags)
|
||||
#endif
|
||||
return mFiStore->RequestDirDetails(ref, details, flags);
|
||||
}
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/******************** Search Interface *************************/
|
||||
/***************************************************************/
|
||||
@ -392,7 +392,7 @@ int ftServer::RequestDirDetails(void *ref, DirDetails &details, uint32_t flags)
|
||||
|
||||
int ftServer::SearchKeywords(std::list<std::string> keywords, std::list<FileDetail> &results,uint32_t flags)
|
||||
{
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cerr << "ftServer::SearchKeywords()";
|
||||
std::cerr << std::endl;
|
||||
|
||||
@ -405,33 +405,33 @@ int ftServer::SearchKeywords(std::list<std::string> keywords, std::list<FileDeta
|
||||
#endif
|
||||
return mFiStore->SearchKeywords(keywords, results,flags);
|
||||
}
|
||||
|
||||
|
||||
int ftServer::SearchBoolExp(Expression * exp, std::list<FileDetail> &results)
|
||||
{
|
||||
return mFiStore->searchBoolExp(exp, results);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/***************************************************************/
|
||||
/*************** Local Shared Dir Interface ********************/
|
||||
/***************************************************************/
|
||||
|
||||
|
||||
bool ftServer::ConvertSharedFilePath(std::string path, std::string &fullpath)
|
||||
{
|
||||
return mFiMon->convertSharedFilePath(path, fullpath);
|
||||
}
|
||||
|
||||
|
||||
void ftServer::ForceDirectoryCheck()
|
||||
{
|
||||
mFiMon->forceDirectoryCheck();
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
bool ftServer::InDirectoryCheck()
|
||||
{
|
||||
return mFiMon->inDirectoryCheck();
|
||||
}
|
||||
|
||||
|
||||
bool ftServer::getSharedDirectories(std::list<std::string> &dirs)
|
||||
{
|
||||
mFiMon->getSharedDirectories(dirs);
|
||||
@ -459,14 +459,14 @@ bool ftServer::removeSharedDirectory(std::string dir)
|
||||
std::list<std::string> dirList;
|
||||
std::list<std::string>::iterator it;
|
||||
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cerr << "ftServer::removeSharedDirectory(" << dir << ")";
|
||||
std::cerr << std::endl;
|
||||
#endif
|
||||
|
||||
mFiMon->getSharedDirectories(dirList);
|
||||
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
for(it = dirList.begin(); it != dirList.end(); it++)
|
||||
{
|
||||
std::cerr << "ftServer::removeSharedDirectory()";
|
||||
@ -475,10 +475,10 @@ bool ftServer::removeSharedDirectory(std::string dir)
|
||||
}
|
||||
#endif
|
||||
|
||||
if (dirList.end() == (it =
|
||||
if (dirList.end() == (it =
|
||||
std::find(dirList.begin(), dirList.end(), dir)))
|
||||
{
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cerr << "ftServer::removeSharedDirectory()";
|
||||
std::cerr << " Cannot Find Directory... Fail";
|
||||
std::cerr << std::endl;
|
||||
@ -488,7 +488,7 @@ bool ftServer::removeSharedDirectory(std::string dir)
|
||||
}
|
||||
|
||||
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cerr << "ftServer::removeSharedDirectory()";
|
||||
std::cerr << " Updating Directories";
|
||||
std::cerr << std::endl;
|
||||
@ -500,6 +500,27 @@ bool ftServer::removeSharedDirectory(std::string dir)
|
||||
return true;
|
||||
}
|
||||
|
||||
void ftServer::setShareDownloadDirectory(bool value)
|
||||
{
|
||||
mFtController->setShareDownloadDirectory(value);
|
||||
}
|
||||
|
||||
bool ftServer::getShareDownloadDirectory()
|
||||
{
|
||||
return mFtController->getShareDownloadDirectory();
|
||||
}
|
||||
|
||||
bool ftServer::shareDownloadDirectory()
|
||||
{
|
||||
std::string dir = mFtController->getDownloadDirectory();
|
||||
return addSharedDirectory(dir);
|
||||
}
|
||||
|
||||
bool ftServer::unshareDownloadDirectory()
|
||||
{
|
||||
std::string dir = mFtController->getDownloadDirectory();
|
||||
return removeSharedDirectory(dir);
|
||||
}
|
||||
|
||||
/***************************************************************/
|
||||
/****************** End of RsFiles Interface *******************/
|
||||
@ -538,7 +559,7 @@ bool ftServer::loadConfigMap(std::map<std::string, std::string> &configMap)
|
||||
/***************************************************************/
|
||||
|
||||
/* Client Send */
|
||||
bool ftServer::sendDataRequest(std::string peerId, std::string hash,
|
||||
bool ftServer::sendDataRequest(std::string peerId, std::string hash,
|
||||
uint64_t size, uint64_t offset, uint32_t chunksize)
|
||||
{
|
||||
if(mTurtleRouter->isTurtlePeer(peerId))
|
||||
@ -579,7 +600,7 @@ bool ftServer::sendData(std::string peerId, std::string hash, uint64_t size, uin
|
||||
uint64_t offset = 0;
|
||||
uint32_t chunk;
|
||||
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cerr << "ftServer::sendData() to " << peerId << std::endl;
|
||||
std::cerr << "hash: " << hash;
|
||||
std::cerr << " offset: " << baseoffset;
|
||||
@ -624,7 +645,7 @@ bool ftServer::sendData(std::string peerId, std::string hash, uint64_t size, uin
|
||||
mP3iface->SendFileData(rfd);
|
||||
|
||||
/* print the data pointer */
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cerr << "ftServer::sendData() Packet: " << std::endl;
|
||||
std::cerr << " offset: " << rfd->fd.file_offset;
|
||||
std::cerr << " chunk: " << chunk;
|
||||
@ -651,7 +672,7 @@ bool ftServer::sendData(std::string peerId, std::string hash, uint64_t size, uin
|
||||
*/
|
||||
int ftServer::tick()
|
||||
{
|
||||
rslog(RSL_DEBUG_BASIC, ftserverzone,
|
||||
rslog(RSL_DEBUG_BASIC, ftserverzone,
|
||||
"filedexserver::tick()");
|
||||
|
||||
if (mP3iface == NULL)
|
||||
@ -661,7 +682,7 @@ int ftServer::tick()
|
||||
#endif
|
||||
|
||||
std::ostringstream out;
|
||||
rslog(RSL_DEBUG_BASIC, ftserverzone,
|
||||
rslog(RSL_DEBUG_BASIC, ftserverzone,
|
||||
"filedexserver::tick() Invalid Interface()");
|
||||
|
||||
return 1;
|
||||
@ -712,13 +733,13 @@ bool ftServer::handleCacheData()
|
||||
int i = 0;
|
||||
int i_init = 0;
|
||||
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
//std::cerr << "ftServer::handleCacheData()" << std::endl;
|
||||
#endif
|
||||
while((ci = mP3iface -> GetSearchResult()) != NULL)
|
||||
{
|
||||
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cerr << "ftServer::handleCacheData() Recvd SearchResult (CacheResponse!)" << std::endl;
|
||||
std::ostringstream out;
|
||||
if (i++ == i_init)
|
||||
@ -747,7 +768,7 @@ bool ftServer::handleCacheData()
|
||||
i_init = i;
|
||||
while((cr = mP3iface -> RequestedSearch()) != NULL)
|
||||
{
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
/* just delete these */
|
||||
std::ostringstream out;
|
||||
out << "Requested Search:" << std::endl;
|
||||
@ -758,7 +779,7 @@ bool ftServer::handleCacheData()
|
||||
}
|
||||
|
||||
|
||||
// Now handle it replacement (pushed cache results)
|
||||
// Now handle it replacement (pushed cache results)
|
||||
{
|
||||
std::list<std::pair<RsPeerId, CacheData> > cacheUpdates;
|
||||
std::list<std::pair<RsPeerId, CacheData> >::iterator it;
|
||||
@ -768,7 +789,7 @@ bool ftServer::handleCacheData()
|
||||
{
|
||||
/* construct reply */
|
||||
RsCacheItem *ci = new RsCacheItem();
|
||||
|
||||
|
||||
/* id from incoming */
|
||||
ci -> PeerId(it->first);
|
||||
|
||||
@ -779,7 +800,7 @@ bool ftServer::handleCacheData()
|
||||
ci -> cacheType = (it->second).cid.type;
|
||||
ci -> cacheSubId = (it->second).cid.subid;
|
||||
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
std::ostringstream out2;
|
||||
out2 << "Outgoing CacheStrapper Update -> RsCacheItem:" << std::endl;
|
||||
ci -> print(out2);
|
||||
@ -788,7 +809,7 @@ bool ftServer::handleCacheData()
|
||||
|
||||
//rslog(RSL_DEBUG_BASIC, ftserverzone, out2.str());
|
||||
mP3iface -> SendSearchResult(ci);
|
||||
|
||||
|
||||
i++;
|
||||
}
|
||||
}
|
||||
@ -808,7 +829,7 @@ bool ftServer::handleFileData()
|
||||
i_init = i;
|
||||
while((fr = mP3iface -> GetFileRequest()) != NULL )
|
||||
{
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cerr << "ftServer::handleFileData() Recvd ftFiler Request" << std::endl;
|
||||
std::ostringstream out;
|
||||
if (i == i_init)
|
||||
@ -820,8 +841,8 @@ bool ftServer::handleFileData()
|
||||
#endif
|
||||
|
||||
i++; /* count */
|
||||
mFtDataplex->recvDataRequest(fr->PeerId(),
|
||||
fr->file.hash, fr->file.filesize,
|
||||
mFtDataplex->recvDataRequest(fr->PeerId(),
|
||||
fr->file.hash, fr->file.filesize,
|
||||
fr->fileoffset, fr->chunksize);
|
||||
|
||||
FileInfo(ffr);
|
||||
@ -832,7 +853,7 @@ FileInfo(ffr);
|
||||
i_init = i;
|
||||
while((fd = mP3iface -> GetFileData()) != NULL )
|
||||
{
|
||||
#ifdef SERVER_DEBUG
|
||||
#ifdef SERVER_DEBUG
|
||||
std::cerr << "ftServer::handleFileData() Recvd ftFiler Data" << std::endl;
|
||||
std::cerr << "hash: " << fd->fd.file.hash;
|
||||
std::cerr << " length: " << fd->fd.binData.bin_len;
|
||||
@ -851,12 +872,12 @@ FileInfo(ffr);
|
||||
|
||||
/* incoming data */
|
||||
mFtDataplex->recvData(fd->PeerId(),
|
||||
fd->fd.file.hash, fd->fd.file.filesize,
|
||||
fd->fd.file_offset,
|
||||
fd->fd.binData.bin_len,
|
||||
fd->fd.file.hash, fd->fd.file.filesize,
|
||||
fd->fd.file_offset,
|
||||
fd->fd.binData.bin_len,
|
||||
fd->fd.binData.bin_data);
|
||||
|
||||
/* we've stolen the data part -> so blank before delete
|
||||
/* we've stolen the data part -> so blank before delete
|
||||
*/
|
||||
fd->fd.binData.TlvShallowClear();
|
||||
delete fd;
|
||||
@ -882,7 +903,7 @@ bool ftServer::addConfiguration(p3ConfigMgr *cfgmgr)
|
||||
cfgmgr->addConfiguration("ft_shared.cfg", mFiMon);
|
||||
cfgmgr->addConfiguration("ft_extra.cfg", mFtExtra);
|
||||
cfgmgr->addConfiguration("ft_transfers.cfg", mFtController);
|
||||
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@
|
||||
#ifndef FT_SERVER_HEADER
|
||||
#define FT_SERVER_HEADER
|
||||
|
||||
/*
|
||||
/*
|
||||
* ftServer.
|
||||
*
|
||||
* Top level File Transfer interface.
|
||||
@ -114,14 +114,14 @@ ftController *getController() const { return mFtController ; }
|
||||
/***
|
||||
* Control of Downloads
|
||||
***/
|
||||
virtual bool FileRequest(std::string fname, std::string hash, uint64_t size,
|
||||
virtual bool FileRequest(std::string fname, std::string hash, uint64_t size,
|
||||
std::string dest, uint32_t flags, std::list<std::string> srcIds);
|
||||
virtual bool FileCancel(std::string hash);
|
||||
virtual bool FileControl(std::string hash, uint32_t flags);
|
||||
virtual bool FileClearCompleted();
|
||||
|
||||
/***
|
||||
* Download/Upload Details
|
||||
* Download/Upload Details
|
||||
***/
|
||||
virtual bool FileDownloads(std::list<std::string> &hashs);
|
||||
virtual bool FileUploads(std::list<std::string> &hashs);
|
||||
@ -130,10 +130,10 @@ virtual bool FileDetails(std::string hash, uint32_t hintflags, FileInfo &info);
|
||||
/***
|
||||
* Extra List Access
|
||||
***/
|
||||
virtual bool ExtraFileAdd(std::string fname, std::string hash, uint64_t size,
|
||||
virtual bool ExtraFileAdd(std::string fname, std::string hash, uint64_t size,
|
||||
uint32_t period, uint32_t flags);
|
||||
virtual bool ExtraFileRemove(std::string hash, uint32_t flags);
|
||||
virtual bool ExtraFileHash(std::string localpath,
|
||||
virtual bool ExtraFileHash(std::string localpath,
|
||||
uint32_t period, uint32_t flags);
|
||||
virtual bool ExtraFileStatus(std::string localpath, FileInfo &info);
|
||||
virtual bool ExtraFileMove(std::string fname, std::string hash, uint64_t size,
|
||||
@ -150,14 +150,14 @@ virtual int SearchKeywords(std::list<std::string> keywords, std::list<FileDetail
|
||||
virtual int SearchBoolExp(Expression * exp, std::list<FileDetail> &results);
|
||||
|
||||
/***
|
||||
* Utility Functions
|
||||
* Utility Functions
|
||||
***/
|
||||
virtual bool ConvertSharedFilePath(std::string path, std::string &fullpath);
|
||||
virtual void ForceDirectoryCheck();
|
||||
virtual bool InDirectoryCheck();
|
||||
|
||||
/***
|
||||
* Directory Handling
|
||||
* Directory Handling
|
||||
***/
|
||||
virtual void setDownloadDirectory(std::string path);
|
||||
virtual void setPartialsDirectory(std::string path);
|
||||
@ -169,6 +169,10 @@ virtual bool setSharedDirectories(std::list<std::string> &dirs);
|
||||
virtual bool addSharedDirectory(std::string dir);
|
||||
virtual bool removeSharedDirectory(std::string dir);
|
||||
|
||||
virtual void setShareDownloadDirectory(bool value);
|
||||
virtual bool getShareDownloadDirectory();
|
||||
virtual bool shareDownloadDirectory();
|
||||
virtual bool unshareDownloadDirectory();
|
||||
|
||||
/***************************************************************/
|
||||
/*************** Control Interface *****************************/
|
||||
@ -180,7 +184,7 @@ virtual bool removeSharedDirectory(std::string dir);
|
||||
public:
|
||||
virtual bool sendData(std::string peerId, std::string hash, uint64_t size,
|
||||
uint64_t offset, uint32_t chunksize, void *data);
|
||||
virtual bool sendDataRequest(std::string peerId,
|
||||
virtual bool sendDataRequest(std::string peerId,
|
||||
std::string hash, uint64_t size,
|
||||
uint64_t offset, uint32_t chunksize);
|
||||
|
||||
@ -217,7 +221,7 @@ bool loadConfigMap(std::map<std::string, std::string> &configMap);
|
||||
|
||||
private:
|
||||
|
||||
/* no need for Mutex protection -
|
||||
/* no need for Mutex protection -
|
||||
* as each component is protected independently.
|
||||
*/
|
||||
|
||||
|
@ -55,7 +55,7 @@ const uint32_t RS_FILE_PEER_OFFLINE = 0x00002000;
|
||||
/************************************
|
||||
* Used To indicate where to search.
|
||||
*
|
||||
* The Order of these is very important,
|
||||
* The Order of these is very important,
|
||||
* it specifies the search order too.
|
||||
*
|
||||
*/
|
||||
@ -101,13 +101,13 @@ virtual ~RsFiles() { return; }
|
||||
/***
|
||||
* Control of Downloads.
|
||||
***/
|
||||
virtual bool FileRequest(std::string fname, std::string hash, uint64_t size,
|
||||
virtual bool FileRequest(std::string fname, std::string hash, uint64_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;
|
||||
|
||||
/***
|
||||
/***
|
||||
* Download / Upload Details.
|
||||
***/
|
||||
virtual bool FileDownloads(std::list<std::string> &hashs) = 0;
|
||||
@ -121,7 +121,7 @@ virtual bool FileDetails(std::string hash, uint32_t hintflags, FileInfo &info) =
|
||||
virtual bool ExtraFileAdd(std::string fname, std::string hash, uint64_t size,
|
||||
uint32_t period, uint32_t flags) = 0;
|
||||
virtual bool ExtraFileRemove(std::string hash, uint32_t flags) = 0;
|
||||
virtual bool ExtraFileHash(std::string localpath,
|
||||
virtual bool ExtraFileHash(std::string localpath,
|
||||
uint32_t period, uint32_t flags) = 0;
|
||||
virtual bool ExtraFileStatus(std::string localpath, FileInfo &info) = 0;
|
||||
virtual bool ExtraFileMove(std::string fname, std::string hash, uint64_t size,
|
||||
@ -157,6 +157,10 @@ virtual bool getSharedDirectories(std::list<std::string> &dirs) = 0;
|
||||
virtual bool addSharedDirectory(std::string dir) = 0;
|
||||
virtual bool removeSharedDirectory(std::string dir) = 0;
|
||||
|
||||
virtual void setShareDownloadDirectory(bool value) = 0;
|
||||
virtual bool getShareDownloadDirectory() = 0;
|
||||
virtual bool shareDownloadDirectory() = 0;
|
||||
virtual bool unshareDownloadDirectory() = 0;
|
||||
|
||||
};
|
||||
|
||||
|
@ -24,6 +24,7 @@
|
||||
#include "rsiface/rsfiles.h"
|
||||
#include "DirectoriesDialog.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
/** Constructor */
|
||||
DirectoriesDialog::DirectoriesDialog(QWidget *parent)
|
||||
@ -39,13 +40,21 @@ DirectoriesDialog::DirectoriesDialog(QWidget *parent)
|
||||
connect(ui.removeButton, SIGNAL(clicked( bool ) ), this , SLOT( removeShareDirectory() ) );
|
||||
connect(ui.incomingButton, SIGNAL(clicked( bool ) ), this , SLOT( setIncomingDirectory() ) );
|
||||
connect(ui.partialButton, SIGNAL(clicked( bool ) ), this , SLOT( setPartialsDirectory() ) );
|
||||
connect(ui.checkBox, SIGNAL(stateChanged(int)), this, SLOT(shareDownloadDirectory(int)));
|
||||
|
||||
ui.addButton->setToolTip(tr("Add a Share Directory"));
|
||||
ui.removeButton->setToolTip(tr("Remove Shared Directory"));
|
||||
ui.incomingButton->setToolTip(tr("Browse"));
|
||||
ui.partialButton->setToolTip(tr("Browse"));
|
||||
|
||||
ui.addButton->setToolTip(tr("Add a Share Directory"));
|
||||
ui.removeButton->setToolTip(tr("Remove Shared Directory"));
|
||||
ui.incomingButton->setToolTip(tr("Browse"));
|
||||
ui.partialButton->setToolTip(tr("Browse"));
|
||||
|
||||
if (rsFiles->getShareDownloadDirectory())
|
||||
{
|
||||
ui.checkBox->setDown(true); /* signal not emitted */
|
||||
}
|
||||
else
|
||||
{
|
||||
ui.checkBox->setDown(false); /* signal not emitted */
|
||||
}
|
||||
|
||||
/* Hide platform specific features */
|
||||
#ifdef Q_WS_WIN
|
||||
@ -57,6 +66,26 @@ DirectoriesDialog::DirectoriesDialog(QWidget *parent)
|
||||
bool
|
||||
DirectoriesDialog::save(QString &errmsg)
|
||||
{
|
||||
/* this is usefull especially when shared incoming files is
|
||||
* default option and when the user don't check/uncheck the
|
||||
* checkBox, so no signal is emitted to update the shared list */
|
||||
if (ui.checkBox->isChecked())
|
||||
{
|
||||
std::list<std::string>::const_iterator it;
|
||||
std::list<std::string> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
if (dirs.end() == std::find(dirs.begin(), dirs.end(), rsFiles->getDownloadDirectory()))
|
||||
{
|
||||
rsFiles->shareDownloadDirectory();
|
||||
}
|
||||
rsFiles->setShareDownloadDirectory(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
rsFiles->unshareDownloadDirectory();
|
||||
rsFiles->setShareDownloadDirectory(false);
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
@ -84,8 +113,6 @@ void DirectoriesDialog::load()
|
||||
ui.partialsDir->setText(QString::fromStdString(rsFiles->getPartialsDirectory()));
|
||||
|
||||
listWidget->update(); /* update display */
|
||||
|
||||
|
||||
}
|
||||
|
||||
void DirectoriesDialog::addShareDirectory()
|
||||
@ -130,6 +157,17 @@ void DirectoriesDialog::setIncomingDirectory()
|
||||
if (dir != "")
|
||||
{
|
||||
rsFiles->setDownloadDirectory(dir);
|
||||
if (ui.checkBox->isChecked())
|
||||
{
|
||||
std::list<std::string>::const_iterator it;
|
||||
std::list<std::string> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
if (dirs.end() == std::find(dirs.begin(), dirs.end(), rsFiles->getDownloadDirectory()))
|
||||
{
|
||||
rsFiles->shareDownloadDirectory();
|
||||
}
|
||||
}
|
||||
}
|
||||
load();
|
||||
}
|
||||
@ -147,3 +185,24 @@ void DirectoriesDialog::setPartialsDirectory()
|
||||
load();
|
||||
}
|
||||
|
||||
void DirectoriesDialog::shareDownloadDirectory(int state)
|
||||
{
|
||||
if (state == Qt::Checked)
|
||||
{
|
||||
std::list<std::string>::const_iterator it;
|
||||
std::list<std::string> dirs;
|
||||
rsFiles->getSharedDirectories(dirs);
|
||||
|
||||
if (dirs.end() == std::find(dirs.begin(), dirs.end(), rsFiles->getDownloadDirectory()))
|
||||
{
|
||||
rsFiles->shareDownloadDirectory();
|
||||
}
|
||||
rsFiles->setShareDownloadDirectory(true);
|
||||
}
|
||||
else
|
||||
{
|
||||
rsFiles->unshareDownloadDirectory();
|
||||
rsFiles->setShareDownloadDirectory(false);
|
||||
}
|
||||
load();
|
||||
}
|
||||
|
@ -15,7 +15,7 @@
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
****************************************************************/
|
||||
|
||||
@ -29,7 +29,7 @@
|
||||
#include "configpage.h"
|
||||
#include "ui_DirectoriesDialog.h"
|
||||
|
||||
class DirectoriesDialog : public ConfigPage
|
||||
class DirectoriesDialog : public ConfigPage
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@ -49,8 +49,9 @@ private slots:
|
||||
void removeShareDirectory();
|
||||
void setIncomingDirectory();
|
||||
void setPartialsDirectory();
|
||||
void shareDownloadDirectory(int state);
|
||||
|
||||
|
||||
|
||||
private:
|
||||
/** A RshareSettings object used for saving/loading settings */
|
||||
RshareSettings* _settings;
|
||||
|
@ -1,7 +1,8 @@
|
||||
<ui version="4.0" >
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DirectoriesDialog</class>
|
||||
<widget class="QWidget" name="DirectoriesDialog" >
|
||||
<property name="geometry" >
|
||||
<widget class="QWidget" name="DirectoriesDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
@ -9,162 +10,162 @@
|
||||
<height>349</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy" >
|
||||
<sizepolicy vsizetype="Expanding" hsizetype="Expanding" >
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="palette" >
|
||||
<property name="palette">
|
||||
<palette>
|
||||
<active>
|
||||
<colorrole role="WindowText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="WindowText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Button" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Button">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>208</red>
|
||||
<green>208</green>
|
||||
<blue>208</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Light" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Light">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Midlight" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Midlight">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>247</red>
|
||||
<green>247</green>
|
||||
<blue>247</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Dark" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Dark">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>104</red>
|
||||
<green>104</green>
|
||||
<blue>104</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Mid" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Mid">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>139</red>
|
||||
<green>139</green>
|
||||
<blue>139</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Text" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Text">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="BrightText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="BrightText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="ButtonText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="ButtonText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Base" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Window" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Window">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>240</red>
|
||||
<green>240</green>
|
||||
<blue>240</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Shadow" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Shadow">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Highlight" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Highlight">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>128</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="HighlightedText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="HighlightedText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Link" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Link">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="LinkVisited" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="LinkVisited">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="AlternateBase" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="AlternateBase">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>231</red>
|
||||
<green>231</green>
|
||||
<blue>231</blue>
|
||||
@ -173,153 +174,153 @@
|
||||
</colorrole>
|
||||
</active>
|
||||
<inactive>
|
||||
<colorrole role="WindowText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="WindowText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Button" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Button">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>208</red>
|
||||
<green>208</green>
|
||||
<blue>208</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Light" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Light">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Midlight" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Midlight">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>247</red>
|
||||
<green>247</green>
|
||||
<blue>247</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Dark" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Dark">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>104</red>
|
||||
<green>104</green>
|
||||
<blue>104</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Mid" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Mid">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>139</red>
|
||||
<green>139</green>
|
||||
<blue>139</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Text" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Text">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="BrightText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="BrightText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="ButtonText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="ButtonText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Base" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Window" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Window">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>240</red>
|
||||
<green>240</green>
|
||||
<blue>240</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Shadow" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Shadow">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Highlight" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Highlight">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>192</red>
|
||||
<green>192</green>
|
||||
<blue>192</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="HighlightedText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="HighlightedText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Link" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Link">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="LinkVisited" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="LinkVisited">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="AlternateBase" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="AlternateBase">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>231</red>
|
||||
<green>231</green>
|
||||
<blue>231</blue>
|
||||
@ -328,153 +329,153 @@
|
||||
</colorrole>
|
||||
</inactive>
|
||||
<disabled>
|
||||
<colorrole role="WindowText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="WindowText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>104</red>
|
||||
<green>104</green>
|
||||
<blue>104</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Button" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Button">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>208</red>
|
||||
<green>208</green>
|
||||
<blue>208</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Light" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Light">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Midlight" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Midlight">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>247</red>
|
||||
<green>247</green>
|
||||
<blue>247</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Dark" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Dark">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>104</red>
|
||||
<green>104</green>
|
||||
<blue>104</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Mid" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Mid">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>139</red>
|
||||
<green>139</green>
|
||||
<blue>139</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Text" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Text">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>104</red>
|
||||
<green>104</green>
|
||||
<blue>104</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="BrightText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="BrightText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="ButtonText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="ButtonText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>104</red>
|
||||
<green>104</green>
|
||||
<blue>104</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Base" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Base">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>240</red>
|
||||
<green>240</green>
|
||||
<blue>240</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Window" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Window">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>240</red>
|
||||
<green>240</green>
|
||||
<blue>240</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Shadow" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Shadow">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>0</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Highlight" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Highlight">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>128</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="HighlightedText" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="HighlightedText">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>255</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="Link" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="Link">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>0</red>
|
||||
<green>0</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="LinkVisited" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="LinkVisited">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>255</red>
|
||||
<green>0</green>
|
||||
<blue>255</blue>
|
||||
</color>
|
||||
</brush>
|
||||
</colorrole>
|
||||
<colorrole role="AlternateBase" >
|
||||
<brush brushstyle="SolidPattern" >
|
||||
<color alpha="255" >
|
||||
<colorrole role="AlternateBase">
|
||||
<brush brushstyle="SolidPattern">
|
||||
<color alpha="255">
|
||||
<red>231</red>
|
||||
<green>231</green>
|
||||
<blue>231</blue>
|
||||
@ -484,7 +485,7 @@
|
||||
</disabled>
|
||||
</palette>
|
||||
</property>
|
||||
<property name="font" >
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Arial</family>
|
||||
<pointsize>10</pointsize>
|
||||
@ -495,61 +496,50 @@
|
||||
<strikeout>false</strikeout>
|
||||
</font>
|
||||
</property>
|
||||
<property name="mouseTracking" >
|
||||
<property name="mouseTracking">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="contextMenuPolicy" >
|
||||
<property name="contextMenuPolicy">
|
||||
<enum>Qt::NoContextMenu</enum>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<property name="leftMargin" >
|
||||
<layout class="QGridLayout">
|
||||
<property name="margin">
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="topMargin" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="rightMargin" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="bottomMargin" >
|
||||
<number>6</number>
|
||||
</property>
|
||||
<property name="horizontalSpacing" >
|
||||
<property name="spacing">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="verticalSpacing" >
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item row="0" column="0" >
|
||||
<widget class="QGroupBox" name="groupBox" >
|
||||
<property name="title" >
|
||||
<item row="0" column="0">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Shared Directories</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<item rowspan="3" row="0" column="0" >
|
||||
<widget class="QListWidget" name="dirList" />
|
||||
<layout class="QGridLayout">
|
||||
<item row="0" column="0" rowspan="3">
|
||||
<widget class="QListWidget" name="dirList"/>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QPushButton" name="addButton" >
|
||||
<property name="minimumSize" >
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="addButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>34</width>
|
||||
<height>34</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize" >
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>34</width>
|
||||
<height>34</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../images.qrc" >:/images/directoryadd_24x24_shadow.png</iconset>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/directoryadd_24x24_shadow.png</normaloff>:/images/directoryadd_24x24_shadow.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
@ -557,27 +547,28 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QPushButton" name="removeButton" >
|
||||
<property name="minimumSize" >
|
||||
<item row="1" column="1">
|
||||
<widget class="QPushButton" name="removeButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>34</width>
|
||||
<height>34</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize" >
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>34</width>
|
||||
<height>34</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../images.qrc" >:/images/directoryremove_24x24_shadow.png</iconset>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/directoryremove_24x24_shadow.png</normaloff>:/images/directoryremove_24x24_shadow.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
@ -585,12 +576,12 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1" >
|
||||
<item row="2" column="1">
|
||||
<spacer>
|
||||
<property name="orientation" >
|
||||
<property name="orientation">
|
||||
<enum>Qt::Vertical</enum>
|
||||
</property>
|
||||
<property name="sizeHint" >
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>20</width>
|
||||
<height>71</height>
|
||||
@ -601,40 +592,41 @@
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" >
|
||||
<widget class="QGroupBox" name="groupBox_2" >
|
||||
<property name="title" >
|
||||
<item row="1" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Incoming Directory</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLineEdit" name="incomingDir" >
|
||||
<property name="readOnly" >
|
||||
<layout class="QGridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="incomingDir">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QPushButton" name="incomingButton" >
|
||||
<property name="minimumSize" >
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="incomingButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize" >
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../images.qrc" >:/images/directoryselect_24x24_shadow.png</iconset>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/directoryselect_24x24_shadow.png</normaloff>:/images/directoryselect_24x24_shadow.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
@ -642,43 +634,57 @@
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="checkBox">
|
||||
<property name="enabled">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Automatically share incoming directory (Recommanded)</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" >
|
||||
<widget class="QGroupBox" name="groupBox_3" >
|
||||
<property name="title" >
|
||||
<item row="2" column="0">
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>Partials Direcrtory</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" >
|
||||
<item row="0" column="0" >
|
||||
<widget class="QLineEdit" name="partialsDir" >
|
||||
<property name="readOnly" >
|
||||
<layout class="QGridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLineEdit" name="partialsDir">
|
||||
<property name="readOnly">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" >
|
||||
<widget class="QPushButton" name="partialButton" >
|
||||
<property name="minimumSize" >
|
||||
<item row="0" column="1">
|
||||
<widget class="QPushButton" name="partialButton">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="maximumSize" >
|
||||
<property name="maximumSize">
|
||||
<size>
|
||||
<width>31</width>
|
||||
<height>31</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="text" >
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
<property name="icon" >
|
||||
<iconset resource="../images.qrc" >:/images/directoryselect_24x24_shadow.png</iconset>
|
||||
<property name="icon">
|
||||
<iconset resource="../images.qrc">
|
||||
<normaloff>:/images/directoryselect_24x24_shadow.png</normaloff>:/images/directoryselect_24x24_shadow.png</iconset>
|
||||
</property>
|
||||
<property name="iconSize" >
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
@ -699,7 +705,7 @@
|
||||
<tabstop>removeButton</tabstop>
|
||||
</tabstops>
|
||||
<resources>
|
||||
<include location="../images.qrc" />
|
||||
<include location="../images.qrc"/>
|
||||
</resources>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
@ -55,7 +55,7 @@ const uint32_t RS_FILE_PEER_OFFLINE = 0x00002000;
|
||||
/************************************
|
||||
* Used To indicate where to search.
|
||||
*
|
||||
* The Order of these is very important,
|
||||
* The Order of these is very important,
|
||||
* it specifies the search order too.
|
||||
*
|
||||
*/
|
||||
@ -101,13 +101,13 @@ virtual ~RsFiles() { return; }
|
||||
/***
|
||||
* Control of Downloads.
|
||||
***/
|
||||
virtual bool FileRequest(std::string fname, std::string hash, uint64_t size,
|
||||
virtual bool FileRequest(std::string fname, std::string hash, uint64_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;
|
||||
|
||||
/***
|
||||
/***
|
||||
* Download / Upload Details.
|
||||
***/
|
||||
virtual bool FileDownloads(std::list<std::string> &hashs) = 0;
|
||||
@ -121,7 +121,7 @@ virtual bool FileDetails(std::string hash, uint32_t hintflags, FileInfo &info) =
|
||||
virtual bool ExtraFileAdd(std::string fname, std::string hash, uint64_t size,
|
||||
uint32_t period, uint32_t flags) = 0;
|
||||
virtual bool ExtraFileRemove(std::string hash, uint32_t flags) = 0;
|
||||
virtual bool ExtraFileHash(std::string localpath,
|
||||
virtual bool ExtraFileHash(std::string localpath,
|
||||
uint32_t period, uint32_t flags) = 0;
|
||||
virtual bool ExtraFileStatus(std::string localpath, FileInfo &info) = 0;
|
||||
virtual bool ExtraFileMove(std::string fname, std::string hash, uint64_t size,
|
||||
@ -157,6 +157,10 @@ virtual bool getSharedDirectories(std::list<std::string> &dirs) = 0;
|
||||
virtual bool addSharedDirectory(std::string dir) = 0;
|
||||
virtual bool removeSharedDirectory(std::string dir) = 0;
|
||||
|
||||
virtual void setShareDownloadDirectory(bool value) = 0;
|
||||
virtual bool getShareDownloadDirectory() = 0;
|
||||
virtual bool shareDownloadDirectory() = 0;
|
||||
virtual bool unshareDownloadDirectory() = 0;
|
||||
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user