Enabled the RetroShare icon of the collection file dialogs.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@5493 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2012-08-31 14:07:15 +00:00
parent 1723bc1cde
commit fb71387a47
6 changed files with 12 additions and 11 deletions

View File

@ -879,7 +879,7 @@ bool RetroshareDirModel::requestDirDetails(void *ref,DirDetails& details,uint32_
return rsFiles->RequestDirDetails(ref, details, flags) ;
}
void RetroshareDirModel::createCollectionFile(const QModelIndexList &list)
void RetroshareDirModel::createCollectionFile(QWidget *parent, const QModelIndexList &list)
{
if(RemoteMode)
{
@ -890,7 +890,7 @@ void RetroshareDirModel::createCollectionFile(const QModelIndexList &list)
std::vector <DirDetails> dirVec;
getDirDetailsFromSelect(list, dirVec);
RsCollectionFile(dirVec).save();
RsCollectionFile(dirVec).save(parent);
}
void RetroshareDirModel::downloadSelected(const QModelIndexList &list)

View File

@ -55,7 +55,7 @@ class RetroshareDirModel : public QAbstractItemModel
/* Callback from GUI */
void downloadSelected(const QModelIndexList &list);
void createCollectionFile(const QModelIndexList &list);
void createCollectionFile(QWidget *parent, const QModelIndexList &list);
void getDirDetailsFromSelect (const QModelIndexList &list, std::vector <DirDetails>& dirVec);

View File

@ -433,7 +433,7 @@ void SharedFilesDialog::createCollectionFile()
std::cerr << "Creating a collection file!" << std::endl;
QModelIndexList lst = getLocalSelected();
localModel->createCollectionFile(lst);
localModel->createCollectionFile(this, lst);
}
void SharedFilesDialog::downloadRemoteSelected()
{

View File

@ -1666,7 +1666,7 @@ QString TransfersDialog::getSources(int row, QStandardItemModel *model)
void TransfersDialog::openCollection()
{
RsCollectionFile Collection;
if (Collection.load()) {
if (Collection.load(this)) {
Collection.downloadFiles();
}
}

View File

@ -166,10 +166,10 @@ bool RsCollectionFile::load(const QString& filename, bool showError /* = true*/)
return ok;
}
bool RsCollectionFile::load()
bool RsCollectionFile::load(QWidget *parent)
{
QString filename;
if (!misc::getOpenFileName(NULL, RshareSettings::LASTDIR_EXTRAFILE, QApplication::translate("RsCollectionFile", "Open collection file"), QApplication::translate("RsCollectionFile", "Collection files") + " (*." + RsCollectionFile::ExtensionString + ")", filename))
if (!misc::getOpenFileName(parent, RshareSettings::LASTDIR_EXTRAFILE, QApplication::translate("RsCollectionFile", "Open collection file"), QApplication::translate("RsCollectionFile", "Collection files") + " (*." + RsCollectionFile::ExtensionString + ")", filename))
return false;
std::cerr << "Got file name: " << filename.toStdString() << std::endl;
@ -197,10 +197,10 @@ bool RsCollectionFile::save(const QString& filename) const
return true;
}
bool RsCollectionFile::save() const
bool RsCollectionFile::save(QWidget *parent) const
{
QString filename;
if(!misc::getSaveFileName(NULL, RshareSettings::LASTDIR_EXTRAFILE, QApplication::translate("RsCollectionFile", "Create collection file"), QApplication::translate("RsCollectionFile", "Collection files") + " (*." + RsCollectionFile::ExtensionString + ")", filename))
if(!misc::getSaveFileName(parent, RshareSettings::LASTDIR_EXTRAFILE, QApplication::translate("RsCollectionFile", "Create collection file"), QApplication::translate("RsCollectionFile", "Collection files") + " (*." + RsCollectionFile::ExtensionString + ")", filename))
return false;
if (!filename.endsWith("." + RsCollectionFile::ExtensionString))

View File

@ -34,6 +34,7 @@
#include <retroshare/rsfiles.h>
class QDomElement ;
class QWidget;
class RsCollectionFile
{
@ -46,11 +47,11 @@ class RsCollectionFile
RsCollectionFile(const std::vector<DirDetails>& file_entries) ;
// Loads file from disk.
bool load();
bool load(QWidget *parent);
bool load(const QString& filename, bool showError = true);
// Save to disk
bool save() const ;
bool save(QWidget *parent) const ;
bool save(const QString& filename) const ;
// Download the content.