2018-02-27 18:06:05 +01:00
|
|
|
/*
|
|
|
|
* Strawberry Music Player
|
|
|
|
* This file was part of Clementine.
|
|
|
|
* Copyright 2010, David Sansome <me@davidsansome.com>
|
2021-03-20 21:14:47 +01:00
|
|
|
* Copyright 2018-2021, Jonas Kvinge <jonas@jkvinge.net>
|
2018-02-27 18:06:05 +01:00
|
|
|
*
|
|
|
|
* Strawberry 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.
|
|
|
|
*
|
|
|
|
* Strawberry 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 Strawberry. If not, see <http://www.gnu.org/licenses/>.
|
2018-08-09 18:39:44 +02:00
|
|
|
*
|
2018-02-27 18:06:05 +01:00
|
|
|
*/
|
|
|
|
|
2019-08-11 22:30:28 +02:00
|
|
|
#ifndef COLLECTIONSETTINGSPAGE_H
|
|
|
|
#define COLLECTIONSETTINGSPAGE_H
|
2018-02-27 18:06:05 +01:00
|
|
|
|
|
|
|
#include "config.h"
|
|
|
|
|
2018-05-01 00:41:33 +02:00
|
|
|
#include <QObject>
|
2020-02-09 02:29:35 +01:00
|
|
|
#include <QString>
|
|
|
|
#include <QStringList>
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2018-05-01 00:41:33 +02:00
|
|
|
#include "settingspage.h"
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2020-02-09 02:29:35 +01:00
|
|
|
class QModelIndex;
|
2018-05-01 00:41:33 +02:00
|
|
|
class SettingsDialog;
|
|
|
|
class Ui_CollectionSettingsPage;
|
|
|
|
|
2018-02-27 18:06:05 +01:00
|
|
|
class CollectionSettingsPage : public SettingsPage {
|
|
|
|
Q_OBJECT
|
|
|
|
|
2020-04-07 16:49:15 +02:00
|
|
|
public:
|
|
|
|
explicit CollectionSettingsPage(SettingsDialog *dialog);
|
2020-06-15 21:55:05 +02:00
|
|
|
~CollectionSettingsPage() override;
|
2018-02-27 18:06:05 +01:00
|
|
|
|
|
|
|
static const char *kSettingsGroup;
|
2020-02-07 23:18:18 +01:00
|
|
|
static const char *kSettingsCacheSize;
|
|
|
|
static const char *kSettingsCacheSizeUnit;
|
|
|
|
static const char *kSettingsDiskCacheEnable;
|
|
|
|
static const char *kSettingsDiskCacheSize;
|
|
|
|
static const char *kSettingsDiskCacheSizeUnit;
|
2020-04-29 00:33:38 +02:00
|
|
|
static const int kSettingsCacheSizeDefault;
|
|
|
|
static const int kSettingsDiskCacheSizeDefault;
|
2020-02-07 23:18:18 +01:00
|
|
|
|
2021-02-26 21:03:51 +01:00
|
|
|
enum SaveCoverType {
|
|
|
|
SaveCoverType_Cache = 1,
|
|
|
|
SaveCoverType_Album = 2,
|
|
|
|
SaveCoverType_Embedded = 3
|
|
|
|
};
|
|
|
|
|
|
|
|
enum SaveCoverFilename {
|
|
|
|
SaveCoverFilename_Hash = 1,
|
|
|
|
SaveCoverFilename_Pattern = 2
|
|
|
|
};
|
|
|
|
|
2020-02-07 23:18:18 +01:00
|
|
|
enum CacheSizeUnit {
|
|
|
|
CacheSizeUnit_KB,
|
|
|
|
CacheSizeUnit_MB,
|
|
|
|
CacheSizeUnit_GB,
|
|
|
|
CacheSizeUnit_TB,
|
|
|
|
};
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2020-06-15 21:55:05 +02:00
|
|
|
void Load() override;
|
|
|
|
void Save() override;
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2020-04-07 16:49:15 +02:00
|
|
|
private slots:
|
2018-02-27 18:06:05 +01:00
|
|
|
void Add();
|
|
|
|
void Remove();
|
|
|
|
|
2021-01-26 16:48:04 +01:00
|
|
|
void CurrentRowChanged(const QModelIndex &idx);
|
2020-04-29 00:33:38 +02:00
|
|
|
void DiskCacheEnable(const int state);
|
2019-03-11 23:07:11 +01:00
|
|
|
void CoverSaveInAlbumDirChanged();
|
2020-04-29 00:33:38 +02:00
|
|
|
void ClearPixmapDiskCache();
|
2021-01-12 20:36:10 +01:00
|
|
|
void CacheSizeUnitChanged(int index);
|
|
|
|
void DiskCacheSizeUnitChanged(int index);
|
2018-02-27 18:06:05 +01:00
|
|
|
|
2020-04-07 16:49:15 +02:00
|
|
|
private:
|
2018-02-27 18:06:05 +01:00
|
|
|
Ui_CollectionSettingsPage *ui_;
|
2020-10-17 17:29:09 +02:00
|
|
|
bool initialized_model_;
|
2018-02-27 18:06:05 +01:00
|
|
|
};
|
|
|
|
|
2019-08-11 22:30:28 +02:00
|
|
|
#endif // COLLECTIONSETTINGSPAGE_H
|