2010-06-24 18:26:49 +02:00
|
|
|
/* This file is part of Clementine.
|
2010-11-20 14:27:10 +01:00
|
|
|
Copyright 2010, David Sansome <me@davidsansome.com>
|
2010-06-24 18:26:49 +02:00
|
|
|
|
|
|
|
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-09-04 22:11:14 +02:00
|
|
|
#include <boost/scoped_ptr.hpp>
|
2010-06-24 23:46:18 +02:00
|
|
|
|
|
|
|
class LibraryWatcher;
|
2010-09-04 22:11:14 +02:00
|
|
|
class OrganiseErrorDialog;
|
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;
|
|
|
|
|
2012-01-04 23:21:39 +01: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-09-15 22:00:17 +02:00
|
|
|
int SetSongs(const SongList& songs);
|
|
|
|
int SetUrls(const QList<QUrl>& urls, quint64 total_size = 0);
|
|
|
|
int 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:
|
2012-01-04 23:29:26 +01:00
|
|
|
void showEvent(QShowEvent*);
|
|
|
|
void resizeEvent(QResizeEvent*);
|
2010-06-24 19:34:23 +02:00
|
|
|
|
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-09-04 22:11:14 +02:00
|
|
|
|
|
|
|
boost::scoped_ptr<OrganiseErrorDialog> error_dialog_;
|
2012-01-04 23:29:26 +01:00
|
|
|
|
|
|
|
bool resized_by_user_;
|
2010-06-24 18:26:49 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // ORGANISEDIALOG_H
|