0000952: Download manager

This commit is contained in:
wmayer
2013-05-28 18:14:58 +02:00
parent c64d0594b6
commit effdd7dca8
13 changed files with 1699 additions and 4 deletions

View File

@@ -56,6 +56,7 @@
#include <Gui/DownloadDialog.h>
#include <Gui/Command.h>
#include <Gui/OnlineDocumentation.h>
#include <Gui/DownloadManager.h>
#include <Base/Parameter.h>
#include <Base/Exception.h>
@@ -119,6 +120,8 @@ BrowserView::BrowserView(QWidget* parent)
this, SLOT(onLinkClicked(const QUrl &)));
connect(view->page(), SIGNAL(downloadRequested(const QNetworkRequest &)),
this, SLOT(onDownloadRequested(const QNetworkRequest &)));
connect(view->page(), SIGNAL(unsupportedContent(QNetworkReply*)),
this, SLOT(onUnsupportedContent(QNetworkReply*)));
}
/** Destroys the object and frees any allocated resources */
@@ -181,8 +184,12 @@ bool BrowserView::chckHostAllowed(const QString& host)
void BrowserView::onDownloadRequested(const QNetworkRequest & request)
{
Dialog::DownloadDialog dlg (request.url(),this);
dlg.exec();
Gui::Dialog::DownloadManager::getInstance()->download(request);
}
void BrowserView::onUnsupportedContent(QNetworkReply* reply)
{
Gui::Dialog::DownloadManager::getInstance()->handleUnsupportedContent(reply);
}
void BrowserView::load(const char* URL)

View File

@@ -96,6 +96,7 @@ protected Q_SLOTS:
void onLinkClicked (const QUrl& url);
bool chckHostAllowed(const QString& host);
void onDownloadRequested(const QNetworkRequest& request);
void onUnsupportedContent(QNetworkReply* reply);
private:
WebView* view;