Various Gui improvements:

* Added fallback to only <id> if peer is unknown in LinkCloud.
 * Added CheckFiles, and display status icon to SharedFiles.
 * Fixed SMPlayer startup and added play slot in Main Window.
 * Added Play Files to Local Shared Files. (context menu)
 * Added Play File to completed File Transfers. (context menu)
 * Ensured that selected Transfer stays selected.
 * Corrected Download State enumeration
 * Renamed Peer Details/ Authenticate to Make Friend / Peer Details
 * Removed Network View from Application Window.
 * Mods to RemoteDirModel to get Paths from files.
 * updated Rs Interface files.



git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@450 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
drbob 2008-03-31 18:37:50 +00:00
parent 29a74b9898
commit e07783ac2b
14 changed files with 323 additions and 112 deletions

View file

@ -692,3 +692,53 @@ void RemoteDirModel::openSelected(QModelIndexList list)
recommendSelected(list);
}
void RemoteDirModel::getFilePaths(QModelIndexList list, std::list<std::string> &fullpaths)
{
std::cerr << "RemoteDirModel::getFilePaths()" << std::endl;
if (RemoteMode)
{
std::cerr << "No File Paths for remote files" << std::endl;
return;
}
/* translate */
QModelIndexList::iterator it;
for(it = list.begin(); it != list.end(); it++)
{
void *ref = it -> internalPointer();
DirDetails details;
uint32_t flags = DIR_FLAGS_DETAILS;
flags |= DIR_FLAGS_LOCAL;
if (!rsicontrol->RequestDirDetails(ref, details, flags))
{
std::cerr << "getFilePaths() Bad Request" << std::endl;
continue;
}
if (details.type != DIR_TYPE_FILE)
{
std::cerr << "getFilePaths() Not File" << std::endl;
continue; /* not file! */
}
std::cerr << "::::::::::::File Details:::: " << std::endl;
std::cerr << "Name: " << details.name << std::endl;
std::cerr << "Hash: " << details.hash << std::endl;
std::cerr << "Size: " << details.count << std::endl;
std::cerr << "Path: " << details.path << std::endl;
std::string filepath = details.path + "/";
filepath += details.name;
std::cerr << "Constructed FilePath: " << filepath << std::endl;
if (fullpaths.end() == std::find(fullpaths.begin(), fullpaths.end(), filepath))
{
fullpaths.push_back(filepath);
}
}
std::cerr << "::::::::::::Done getFilePaths" << std::endl;
}

View file

@ -3,6 +3,8 @@
#include <QAbstractItemModel>
#include <vector>
#include <list>
#include <string>
class RemoteDirModel : public QAbstractItemModel
{
@ -40,6 +42,8 @@ class RemoteDirModel : public QAbstractItemModel
void recommendSelectedOnly(QModelIndexList list);
void openSelected(QModelIndexList list);
void getFilePaths(QModelIndexList list, std::list<std::string> &fullpaths);
public slots:
void collapsed ( const QModelIndex & index ) { update(index); }

View file

@ -193,6 +193,10 @@ virtual int StartupRetroShare(RsInit *config) = 0;
virtual int RequestDirDetails(std::string uid, std::string path, DirDetails &details) = 0;
virtual int RequestDirDetails(void *ref, DirDetails &details, uint32_t flags) = 0;
virtual bool ConvertSharedFilePath(std::string path, std::string &fullpath) = 0;
virtual void ForceDirectoryCheck() = 0;
virtual bool InDirectoryCheck() = 0;
/****************************************/
/* Search Actions */
virtual int SearchKeywords(std::list<std::string> keywords, std::list<FileDetail> &results) = 0;

View file

@ -65,11 +65,6 @@ virtual bool GetPopupMessageList(std::map<uint32_t, std::string> &list) = 0;
virtual bool SetSysMessageMode(uint32_t sysid, uint32_t mode) = 0;
virtual bool SetPopupMessageMode(uint32_t ptype, uint32_t mode) = 0;
/* Input from libretroshare */
virtual bool AddPopupMessage(uint32_t ptype, std::string name, std::string msg) = 0;
virtual bool AddSysMessage(uint32_t sysid, uint32_t type,
std::string title, std::string msg) = 0;
};