added dynamic menu for choosing download directory for files being transfered, and change the name of the destination file

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@6156 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2013-02-27 16:59:16 +00:00
parent a086fd6d88
commit 5b4739352e
7 changed files with 180 additions and 10 deletions

View file

@ -1619,6 +1619,43 @@ std::string ftController::getPartialsDirectory()
return mPartialsPath;
}
bool ftController::setDestinationDirectory(const std::string& hash,const std::string& dest_dir)
{
RsStackMutex stack(ctrlMutex); /******* LOCKED ********/
std::map<std::string, ftFileControl*>::iterator it = mDownloads.find(hash);
if (it == mDownloads.end())
return false;
std::cerr << "(II) Changing destination of file " << it->second->mDestination << std::endl;
it->second->mDestination = dest_dir + '/' + it->second->mName ;
std::cerr << "(II) ...to " << it->second->mDestination << std::endl;
return true ;
}
bool ftController::setDestinationName(const std::string& hash,const std::string& dest_name)
{
RsStackMutex stack(ctrlMutex); /******* LOCKED ********/
std::map<std::string, ftFileControl*>::iterator it = mDownloads.find(hash);
if (it == mDownloads.end())
return false;
std::cerr << "(II) Changing destination of file " << it->second->mDestination << std::endl;
std::string dest_path ;
RsDirUtil::removeTopDir(it->second->mDestination, dest_path); /* remove fname */
it->second->mDestination = dest_path + '/' + dest_name ;
it->second->mName = dest_name ;
std::cerr << "(II) ...to " << it->second->mDestination << std::endl;
return true ;
}
bool ftController::FileDetails(const std::string &hash, FileInfo &info)
{
RsStackMutex stack(ctrlMutex); /******* LOCKED ********/