2015-04-22 19:33:53 +02:00
|
|
|
#ifndef SETTINGS_H
|
|
|
|
#define SETTINGS_H
|
|
|
|
|
2016-10-24 20:15:10 +02:00
|
|
|
#include "./knownfieldmodel.h"
|
2018-03-11 18:58:50 +01:00
|
|
|
#include "./targetlevelmodel.h"
|
2016-10-24 20:15:10 +02:00
|
|
|
|
2018-03-11 18:58:20 +01:00
|
|
|
#include <tagparser/abstractcontainer.h>
|
|
|
|
#include <tagparser/settings.h>
|
2016-10-24 20:15:10 +02:00
|
|
|
#include <tagparser/tag.h>
|
2018-03-11 18:58:50 +01:00
|
|
|
#include <tagparser/tagvalue.h>
|
2015-04-22 19:33:53 +02:00
|
|
|
|
2016-10-24 20:15:10 +02:00
|
|
|
#include <qtutilities/settingsdialog/qtsettings.h>
|
2015-04-22 19:33:53 +02:00
|
|
|
|
2016-10-24 20:15:10 +02:00
|
|
|
#include <QByteArray>
|
2020-09-08 19:37:23 +02:00
|
|
|
#include <QRegularExpression>
|
2018-03-11 18:58:50 +01:00
|
|
|
#include <QString>
|
2016-08-14 22:49:47 +02:00
|
|
|
|
2015-04-22 19:33:53 +02:00
|
|
|
namespace Settings {
|
|
|
|
|
2018-03-11 18:58:50 +01:00
|
|
|
enum class ActionEnabled { Ask, Yes, No };
|
2015-04-22 19:33:53 +02:00
|
|
|
|
2018-03-11 18:58:50 +01:00
|
|
|
enum class AdoptFields { Never, WithinDirectory, Always };
|
2016-10-24 20:15:10 +02:00
|
|
|
|
2018-03-11 18:58:50 +01:00
|
|
|
enum class MultipleTagHandling { SingleEditorPerTarget, SeparateEditors };
|
2016-10-24 20:15:10 +02:00
|
|
|
|
2020-09-08 19:37:23 +02:00
|
|
|
struct CustomSubstitution {
|
|
|
|
QRegularExpression regex;
|
|
|
|
QString replacement;
|
|
|
|
bool enabled = false;
|
|
|
|
};
|
|
|
|
|
2018-03-11 18:58:50 +01:00
|
|
|
struct AutoCompletition {
|
2016-10-24 20:15:10 +02:00
|
|
|
AutoCompletition();
|
|
|
|
bool insertTitleFromFilename = false;
|
|
|
|
bool trimWhitespaces = true;
|
|
|
|
bool formatNames = false;
|
|
|
|
bool fixUmlauts = false;
|
2020-09-08 19:37:23 +02:00
|
|
|
CustomSubstitution customSubstitution;
|
2016-10-24 20:15:10 +02:00
|
|
|
KnownFieldModel fields;
|
|
|
|
};
|
|
|
|
|
2018-03-11 18:58:50 +01:00
|
|
|
struct Editor {
|
2016-10-24 20:15:10 +02:00
|
|
|
Editor();
|
2018-07-10 16:35:50 +02:00
|
|
|
std::string backupDirectory;
|
2016-10-24 20:15:10 +02:00
|
|
|
AdoptFields adoptFields = AdoptFields::Never;
|
|
|
|
bool saveAndShowNextOnEnter = false;
|
|
|
|
bool askBeforeDeleting = true;
|
|
|
|
MultipleTagHandling multipleTagHandling = MultipleTagHandling::SingleEditorPerTarget;
|
|
|
|
bool hideTagSelectionComboBox = false;
|
|
|
|
bool forceFullParse = false;
|
2016-04-21 23:55:22 +02:00
|
|
|
#ifndef TAGEDITOR_NO_WEBVIEW
|
2016-10-24 20:15:10 +02:00
|
|
|
bool noWebView = false;
|
2016-04-21 23:55:22 +02:00
|
|
|
#endif
|
2016-10-24 20:15:10 +02:00
|
|
|
bool hideCoverButtons = false;
|
|
|
|
AutoCompletition autoCompletition;
|
|
|
|
KnownFieldModel fields;
|
|
|
|
TargetLevelModel defaultTargets;
|
|
|
|
};
|
2015-04-22 19:33:53 +02:00
|
|
|
|
2018-03-11 18:58:50 +01:00
|
|
|
enum class UnsupportedFieldHandling { Ignore, Discard };
|
2016-08-14 22:49:47 +02:00
|
|
|
|
2018-03-11 18:58:50 +01:00
|
|
|
struct FileBrowser {
|
2016-10-24 20:15:10 +02:00
|
|
|
bool hideBackupFiles = true;
|
|
|
|
bool readOnly = true;
|
|
|
|
};
|
|
|
|
|
2018-03-11 18:58:50 +01:00
|
|
|
struct FileLayout {
|
2016-10-24 20:15:10 +02:00
|
|
|
bool forceRewrite = true;
|
2018-03-06 23:10:13 +01:00
|
|
|
TagParser::ElementPosition preferredTagPosition = TagParser::ElementPosition::BeforeData;
|
2016-10-24 20:15:10 +02:00
|
|
|
bool forceTagPosition = true;
|
2018-03-06 23:10:13 +01:00
|
|
|
TagParser::ElementPosition preferredIndexPosition = TagParser::ElementPosition::BeforeData;
|
2016-10-24 20:15:10 +02:00
|
|
|
bool forceIndexPosition = true;
|
|
|
|
std::size_t minPadding = 0;
|
|
|
|
std::size_t maxPadding = 0;
|
|
|
|
std::size_t preferredPadding = 0;
|
|
|
|
};
|
|
|
|
|
2018-03-11 18:58:50 +01:00
|
|
|
struct TagProcessing {
|
2018-03-06 23:10:13 +01:00
|
|
|
TagParser::TagTextEncoding preferredEncoding = TagParser::TagTextEncoding::Utf8;
|
2016-10-24 20:15:10 +02:00
|
|
|
UnsupportedFieldHandling unsupportedFieldHandling = UnsupportedFieldHandling::Ignore;
|
|
|
|
bool autoTagManagement = true;
|
2021-08-21 01:22:29 +02:00
|
|
|
bool preserveModificationTime = false;
|
2018-03-11 18:58:20 +01:00
|
|
|
TagParser::TagCreationSettings creationSettings;
|
2016-10-24 20:15:10 +02:00
|
|
|
FileLayout fileLayout;
|
|
|
|
};
|
|
|
|
|
2018-03-11 18:58:50 +01:00
|
|
|
struct MainWindow {
|
2016-10-24 20:15:10 +02:00
|
|
|
QByteArray geometry;
|
|
|
|
QByteArray state;
|
|
|
|
QString currentFileBrowserDirectory;
|
|
|
|
bool layoutLocked = false;
|
|
|
|
};
|
|
|
|
|
2018-03-11 18:58:50 +01:00
|
|
|
struct DbQuery {
|
2016-10-24 20:15:10 +02:00
|
|
|
DbQuery();
|
|
|
|
bool widgetShown = false;
|
|
|
|
bool override = false;
|
|
|
|
KnownFieldModel fields;
|
|
|
|
QString musicBrainzUrl;
|
|
|
|
QString coverArtArchiveUrl;
|
|
|
|
QString lyricsWikiaUrl;
|
2019-09-02 21:47:11 +02:00
|
|
|
QString makeItPersonalUrl;
|
2016-10-24 20:15:10 +02:00
|
|
|
};
|
|
|
|
|
2018-03-11 18:58:50 +01:00
|
|
|
struct RenamingUtility {
|
2016-10-24 20:15:10 +02:00
|
|
|
int scriptSource = 0;
|
|
|
|
QString externalScript;
|
|
|
|
QString editorScript;
|
|
|
|
};
|
|
|
|
|
2018-03-11 18:58:50 +01:00
|
|
|
struct Settings {
|
2016-10-24 20:15:10 +02:00
|
|
|
Editor editor;
|
|
|
|
FileBrowser fileBrowser;
|
|
|
|
TagProcessing tagPocessing;
|
|
|
|
MainWindow mainWindow;
|
|
|
|
DbQuery dbQuery;
|
|
|
|
RenamingUtility renamingUtility;
|
2019-06-10 22:49:46 +02:00
|
|
|
QtUtilities::QtSettings qt;
|
2016-10-24 20:15:10 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
Settings &values();
|
2015-04-22 19:33:53 +02:00
|
|
|
void restore();
|
|
|
|
void save();
|
|
|
|
|
2018-03-11 18:58:50 +01:00
|
|
|
} // namespace Settings
|
2015-04-22 19:33:53 +02:00
|
|
|
|
|
|
|
#endif // SETTINGS_H
|