2010-06-24 18:26:49 +02:00
|
|
|
/* This file is part of Clementine.
|
|
|
|
|
|
|
|
Clementine is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
Clementine is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with Clementine. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef ORGANISEDIALOG_H
|
|
|
|
#define ORGANISEDIALOG_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
#include <QMap>
|
|
|
|
#include <QUrl>
|
|
|
|
|
2010-06-24 20:33:38 +02:00
|
|
|
#include "core/organiseformat.h"
|
2010-06-24 18:26:49 +02:00
|
|
|
#include "core/song.h"
|
|
|
|
|
2010-06-24 23:46:18 +02:00
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
|
|
|
class LibraryWatcher;
|
2010-06-24 20:33:38 +02:00
|
|
|
class TaskManager;
|
2010-06-24 18:26:49 +02:00
|
|
|
class Ui_OrganiseDialog;
|
|
|
|
|
2010-06-24 19:34:23 +02:00
|
|
|
class QAbstractItemModel;
|
|
|
|
|
2010-06-24 18:26:49 +02:00
|
|
|
class OrganiseDialog : public QDialog {
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2010-06-24 20:33:38 +02:00
|
|
|
OrganiseDialog(TaskManager* task_manager, QWidget* parent = 0);
|
2010-06-24 18:26:49 +02:00
|
|
|
~OrganiseDialog();
|
|
|
|
|
|
|
|
static const int kNumberOfPreviews;
|
|
|
|
static const char* kDefaultFormat;
|
2010-06-24 19:34:23 +02:00
|
|
|
static const char* kSettingsGroup;
|
|
|
|
|
2010-07-25 11:32:44 +02:00
|
|
|
QSize sizeHint() const;
|
|
|
|
|
2010-07-25 11:52:29 +02:00
|
|
|
void SetDestinationModel(QAbstractItemModel* model, bool devices = false);
|
2010-06-24 18:26:49 +02:00
|
|
|
|
2010-08-08 15:06:52 +02:00
|
|
|
void SetSongs(const SongList& songs);
|
2010-07-30 00:16:12 +02:00
|
|
|
void SetUrls(const QList<QUrl>& urls, quint64 total_size = 0);
|
|
|
|
void SetFilenames(const QStringList& filenames, quint64 total_size = 0);
|
2010-06-24 22:26:17 +02:00
|
|
|
void SetCopy(bool copy);
|
2010-06-24 18:26:49 +02:00
|
|
|
|
2010-06-24 19:34:23 +02:00
|
|
|
public slots:
|
|
|
|
void accept();
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void showEvent(QShowEvent *);
|
|
|
|
|
2010-06-24 18:26:49 +02:00
|
|
|
private slots:
|
2010-06-24 19:34:23 +02:00
|
|
|
void Reset();
|
|
|
|
|
2010-06-24 18:26:49 +02:00
|
|
|
void InsertTag(const QString& tag);
|
2010-06-24 23:46:18 +02:00
|
|
|
void LoadPreviewSongs(const QString& filename);
|
2010-06-24 18:26:49 +02:00
|
|
|
void UpdatePreviews();
|
|
|
|
|
2010-08-14 13:51:50 +02:00
|
|
|
void OrganiseFinished(const QStringList& files_with_errors);
|
|
|
|
|
2010-06-24 18:26:49 +02:00
|
|
|
private:
|
|
|
|
Ui_OrganiseDialog* ui_;
|
2010-06-24 20:33:38 +02:00
|
|
|
TaskManager* task_manager_;
|
2010-06-24 18:26:49 +02:00
|
|
|
|
|
|
|
OrganiseFormat format_;
|
|
|
|
|
|
|
|
QStringList filenames_;
|
|
|
|
SongList preview_songs_;
|
2010-07-31 00:25:32 +02:00
|
|
|
quint64 total_size_;
|
2010-06-24 18:26:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ORGANISEDIALOG_H
|