Added new button "Open Collection" in TransfersDialog.

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@4691 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
thunder2 2011-11-25 23:46:41 +00:00
parent 031629d528
commit bab7ebaa5b
10 changed files with 993 additions and 905 deletions

View file

@ -21,7 +21,6 @@
#include <stdexcept>
#include <QDesktopServices>
#include <QMessageBox>
#include <QUrl>
#include "RsCollectionFile.h"
#include "RsUrlHandler.h"
@ -30,14 +29,9 @@ bool RsUrlHandler::openUrl(const QUrl& url)
{
if(url.scheme() == QString("file") && url.toLocalFile().endsWith("."+RsCollectionFile::ExtensionString))
{
try
{
RsCollectionFile(url.toLocalFile().toUtf8().constData()).downloadFiles() ;
}
catch(std::runtime_error& e)
{
QMessageBox::warning(NULL,QObject::tr("Treatment of collection file has failed."),QObject::tr("The collection file ") + url.toLocalFile() + QObject::tr(" could not be openned. Reported error is: ") + QString::fromStdString(e.what())) ;
return false ;
RsCollectionFile Collection;
if (Collection.load(url.toLocalFile().toUtf8().constData())) {
Collection.downloadFiles() ;
}
return true;
}