1
/* This file is part of Clementine.
2
Copyright 2010, David Sansome <me@davidsansome.com>
4
Clementine is free software: you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation, either version 3 of the License, or
7
(at your option) any later version.
9
Clementine is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
18
#ifndef MAGNATUNEDOWNLOADDIALOG_H
19
#define MAGNATUNEDOWNLOADDIALOG_H
22
#include <QNetworkReply>
23
#include <QStringList>
25
#include <boost/scoped_ptr.hpp>
27
#include "core/song.h"
29
class MagnatuneService;
30
class Ui_MagnatuneDownloadDialog;
33
class QXmlStreamReader;
35
class MagnatuneDownloadDialog : public QDialog {
38
MagnatuneDownloadDialog(MagnatuneService* service, QWidget *parent = 0);
39
~MagnatuneDownloadDialog();
41
void Show(const SongList& songs);
44
void Finished(const QStringList& albums);
50
void closeEvent(QCloseEvent* e);
56
void Error(QNetworkReply::NetworkError);
57
void MetadataFinished();
58
void DownloadProgress(qint64 received, qint64 total);
59
void DownloadReadyRead();
60
void DownloadFinished();
62
void ShowError(const QString& message);
63
void AllFinished(bool error);
66
QString GetOutputFilename();
69
Ui_MagnatuneDownloadDialog* ui_;
70
MagnatuneService* service_;
72
QNetworkAccessManager* network_;
73
QNetworkReply* current_reply_;
74
boost::scoped_ptr<QFile> download_file_;
79
#endif // MAGNATUNEDOWNLOADDIALOG_H