diff --git a/CMakeLists.txt b/CMakeLists.txt index 28cd18d..c752ba8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -14,6 +14,7 @@ set(META_VERSION_PATCH 1) # add project files set(HEADER_FILES application/knownfieldmodel.h + application/targetlevelmodel.h application/main.h application/settings.h cli/mainfeatures.h @@ -22,6 +23,7 @@ set(HEADER_FILES ) set(SRC_FILES application/knownfieldmodel.cpp + application/targetlevelmodel.cpp application/main.cpp application/settings.cpp cli/mainfeatures.cpp @@ -95,6 +97,7 @@ set(WIDGETS_UI_FILES gui/id3v2optionpage.ui gui/id3v1optionpage.ui gui/tagprocessinggeneraloptionpage.ui + gui/tagprocessingtargetsoptionpage.ui gui/editorgeneraloptionpage.ui gui/filebrowsergeneraloptionpage.ui gui/mainwindow.ui diff --git a/application/knownfieldmodel.cpp b/application/knownfieldmodel.cpp index 9798ea4..634217e 100644 --- a/application/knownfieldmodel.cpp +++ b/application/knownfieldmodel.cpp @@ -61,6 +61,7 @@ KnownFieldModel::KnownFieldModel(QObject *parent, DefaultSelection defaultSelect ChecklistModel(parent) { QList items; + items.reserve(27); Qt::CheckState defaultSelected = defaultSelection == DefaultSelection::CommonFields ? Qt::Checked : Qt::Unchecked; items << mkItem(KnownField::Title, defaultSelected); items << mkItem(KnownField::Album, defaultSelected); diff --git a/application/knownfieldmodel.h b/application/knownfieldmodel.h index 29300c8..8d875c3 100644 --- a/application/knownfieldmodel.h +++ b/application/knownfieldmodel.h @@ -1,5 +1,5 @@ -#ifndef KNOWNFIELDSELECTION_H -#define KNOWNFIELDSELECTION_H +#ifndef KNOWNFIELDMODEL_H +#define KNOWNFIELDMODEL_H #include @@ -40,4 +40,4 @@ inline Models::ChecklistItem KnownFieldModel::mkItem(Media::KnownField field, Qt } -#endif // KNOWNFIELDSELECTION_H +#endif // KNOWNFIELDMODEL_H diff --git a/application/main.cpp b/application/main.cpp index 29b4a48..2a55062 100644 --- a/application/main.cpp +++ b/application/main.cpp @@ -31,24 +31,24 @@ SetTagInfoArgs::SetTagInfoArgs(Argument &filesArg, Argument &verboseArg) : filesArg(filesArg), verboseArg(verboseArg), docTitleArg("doc-title", "d", "specifies the document title (has no affect if not supported by the container)"), - removeOtherFieldsArg("remove-other-fields", string(), "if present ALL unspecified tag fields will be removed (to remove a specific field use eg. \"album=\")"), - treatUnknownFilesAsMp3FilesArg("treat-unknown-as-mp3", string(), "if present unknown files will be treatet as MP3 files"), - id3v1UsageArg("id3v1-usage", string(), "specifies the ID3v1 usage (only used when already present by default); only relevant when dealing with MP3 files (or files treated as such)"), - id3v2UsageArg("id3v2-usage", string(), "specifies the ID3v2 usage (always used by default); only relevant when dealing with MP3 files (or files treated as such)"), - mergeMultipleSuccessiveTagsArg("merge-successive-tags", string(), "if present multiple successive ID3v2 tags will be merged"), - id3v2VersionArg("id3v2-version", string(), "forces a specific ID3v2 version to be used; only relevant when ID3v2 is used"), - encodingArg("encoding", string(), "specifies the preferred encoding"), - removeTargetsArg("remove-targets", string(), "removes all tags with the specified targets (which must be separated by \",\")"), - attachmentsArg("attachments", string(), "specifies attachments to be added/updated/removed (multiple attachments must be separated by \",\""), + removeOtherFieldsArg("remove-other-fields", nullptr, "if present ALL unspecified tag fields will be removed (to remove a specific field use eg. \"album=\")"), + treatUnknownFilesAsMp3FilesArg("treat-unknown-as-mp3", nullptr, "if present unknown files will be treatet as MP3 files"), + id3v1UsageArg("id3v1-usage", nullptr, "specifies the ID3v1 usage (only used when already present by default); only relevant when dealing with MP3 files (or files treated as such)"), + id3v2UsageArg("id3v2-usage", nullptr, "specifies the ID3v2 usage (always used by default); only relevant when dealing with MP3 files (or files treated as such)"), + mergeMultipleSuccessiveTagsArg("merge-successive-tags", nullptr, "if present multiple successive ID3v2 tags will be merged"), + id3v2VersionArg("id3v2-version", nullptr, "forces a specific ID3v2 version to be used; only relevant when ID3v2 is used"), + encodingArg("encoding", nullptr, "specifies the preferred encoding"), + removeTargetsArg("remove-targets", nullptr, "removes all tags with the specified targets (which must be separated by \",\")"), + attachmentsArg("attachments", nullptr, "specifies attachments to be added/updated/removed (multiple attachments must be separated by \",\""), removeExistingAttachmentsArg("remove-existing-attachments", "ra", "specifies names/IDs of existing attachments to be removed"), - minPaddingArg("min-padding", string(), "specifies the minimum padding before the media data"), - maxPaddingArg("max-padding", string(), "specifies the maximum padding before the media data"), - prefPaddingArg("preferred-padding", string(), "specifies the preferred padding before the media data"), - tagPosArg("tag-pos", string(), "specifies the preferred tag position"), - forceTagPosArg("force-tag-pos", string(), "forces the specified tag postion to be used even if it requires the file to be rewritten"), - indexPosArg("index-pos", string(), "specifies the preferred index position"), - forceIndexPosArg("force-index-pos", string(), "forces the specified index postion to be used even if it requires the file to be rewritten"), - forceRewriteArg("force-rewrite", string(), "forces the file to rewritten from the scratch"), + minPaddingArg("min-padding", nullptr, "specifies the minimum padding before the media data"), + maxPaddingArg("max-padding", nullptr, "specifies the maximum padding before the media data"), + prefPaddingArg("preferred-padding", nullptr, "specifies the preferred padding before the media data"), + tagPosArg("tag-pos", nullptr, "specifies the preferred tag position"), + forceTagPosArg("force-tag-pos", nullptr, "forces the specified tag postion to be used even if it requires the file to be rewritten"), + indexPosArg("index-pos", nullptr, "specifies the preferred index position"), + forceIndexPosArg("force-index-pos", nullptr, "forces the specified index postion to be used even if it requires the file to be rewritten"), + forceRewriteArg("force-rewrite", nullptr, "forces the file to rewritten from the scratch"), setTagInfoArg("set-tag-info", "set", "sets the values of all specified tag fields") { docTitleArg.setCombinable(true); @@ -135,7 +135,7 @@ int main(int argc, char *argv[]) outputFileArg.setRequired(true); outputFileArg.setCombinable(true); // print field names - Argument printFieldNamesArg("print-field-names", string(), "prints available field names"); + Argument printFieldNamesArg("print-field-names", nullptr, "prints available field names"); printFieldNamesArg.setCallback(Cli::printFieldNames); // display general file info Argument displayFileInfoArg("display-file-info", "info", "displays general file information"); @@ -162,19 +162,19 @@ int main(int argc, char *argv[]) Argument validateArg("validate", "c", "validates the file integrity as accurately as possible; the structure of the file will be parsed completely"); validateArg.setDenotesOperation(true); validateArg.setCombinable(true); - Argument genInfoArg("html-info", string(), "generates technical information about the specified file as HTML document"); + Argument genInfoArg("html-info", nullptr, "generates technical information about the specified file as HTML document"); genInfoArg.setDenotesOperation(true); genInfoArg.setSecondaryArguments({&fileArg, &validateArg, &outputFileArg}); genInfoArg.setCallback(std::bind(Cli::generateFileInfo, _1, std::cref(fileArg), std::cref(outputFileArg), std::cref(validateArg))); // remove backup files - Argument remBackupFilesArg("remove-backup-files", string(), "removes all files with \".bak\" suffix in the given directory and in subdirectories if recursive option is present"); + Argument remBackupFilesArg("remove-backup-files", nullptr, "removes all files with \".bak\" suffix in the given directory and in subdirectories if recursive option is present"); remBackupFilesArg.setDenotesOperation(true); remBackupFilesArg.setCallback(std::bind(Cli::removeBackupFiles, _1, std::cref(recursiveArg))); remBackupFilesArg.setValueNames({"directory"}); remBackupFilesArg.setRequiredValueCount(1); remBackupFilesArg.setSecondaryArguments({&recursiveArg}); // renaming utility - Argument renamingUtilityArg("renaming-utility", string(), "launches the renaming utility instead of the main GUI"); + Argument renamingUtilityArg("renaming-utility", nullptr, "launches the renaming utility instead of the main GUI"); renamingUtilityArg.setCombinable(true); // set arguments to parser qtConfigArgs.qtWidgetsGuiArg().addSecondaryArgument(&filesArg); diff --git a/application/settings.cpp b/application/settings.cpp index 35c17a7..706b8c1 100644 --- a/application/settings.cpp +++ b/application/settings.cpp @@ -1,5 +1,6 @@ #include "./settings.h" #include "./knownfieldmodel.h" +#include "./targetlevelmodel.h" #include #include @@ -169,6 +170,13 @@ size_t &preferredPadding() return v; } +// targets +TargetLevelModel &defaultTargetsModel() +{ + static TargetLevelModel model(nullptr, TargetLevelModel::DefaultSelection::MostUsefulTargets); + return model; +} + // fields KnownFieldModel &selectedFieldsModel() { @@ -387,6 +395,7 @@ void restore() keepVersionOfExistingId3v2Tag() = settings.value(QStringLiteral("keepversionofexistingtag"), true).toBool(); mergeMultipleSuccessiveId3v2Tags() = settings.value(QStringLiteral("mergemultiplesuccessivetags"), true).toBool(); settings.endGroup(); + defaultTargetsModel().restore(settings, QStringLiteral("targets")); settings.beginGroup(QStringLiteral("filelayout")); forceRewrite() = settings.value(QStringLiteral("forcerewrite"), true).toBool(); switch(settings.value(QStringLiteral("tagpos")).toInt()) { @@ -483,6 +492,7 @@ void save() settings.setValue(QStringLiteral("keepversionofexistingtag"), keepVersionOfExistingId3v2Tag()); settings.setValue(QStringLiteral("mergemultiplesuccessivetags"), mergeMultipleSuccessiveId3v2Tags()); settings.endGroup(); + defaultTargetsModel().save(settings, QStringLiteral("targets")); settings.beginGroup(QStringLiteral("filelayout")); settings.setValue(QStringLiteral("forcerewrite"), forceRewrite()); settings.setValue(QStringLiteral("tagpos"), static_cast(preferredTagPosition())); diff --git a/application/settings.h b/application/settings.h index a86ac10..ff97e6e 100644 --- a/application/settings.h +++ b/application/settings.h @@ -79,6 +79,10 @@ size_t &minPadding(); size_t &maxPadding(); size_t &preferredPadding(); +// targets +class TargetLevelModel; +TargetLevelModel &defaultTargetsModel(); + // fields class KnownFieldModel; KnownFieldModel &selectedFieldsModel(); diff --git a/application/targetlevelmodel.cpp b/application/targetlevelmodel.cpp new file mode 100644 index 0000000..789f60d --- /dev/null +++ b/application/targetlevelmodel.cpp @@ -0,0 +1,92 @@ +#include "./targetlevelmodel.h" + +#include + +using namespace Models; +using namespace Media; + +namespace Settings { + +/* + TRANSLATOR Settings::TargetLevelModel + Necessary for lupdate. +*/ + +const char *TargetLevelModel::fieldName(TagTargetLevel targetLevel) +{ + switch(targetLevel) { + case TagTargetLevel::Unspecified: + return QT_TR_NOOP("unspecified, everything"); + case TagTargetLevel::Shot: + return QT_TR_NOOP("shot"); + case TagTargetLevel::Subtrack: + return QT_TR_NOOP("subtrack, part, movement, scene"); + case TagTargetLevel::Track: + return QT_TR_NOOP("track, song, chapter"); + case TagTargetLevel::Part: + return QT_TR_NOOP("part, session"); + case TagTargetLevel::Album: + return QT_TR_NOOP("album, opera, concert, movie, episode"); + case TagTargetLevel::Edition: + return QT_TR_NOOP("edition, issue, volume, opus, season, sequel"); + case TagTargetLevel::Collection: + return QT_TR_NOOP("collection"); + default: + return QT_TR_NOOP("unknown"); + } +} + +QString TargetLevelModel::translatedFieldName(TagTargetLevel targetLevel) +{ + return tr(fieldName(targetLevel)); +} + +QString TargetLevelModel::labelForId(const QVariant &id) const +{ + return translatedFieldName(static_cast(id.toInt())); +} + +TargetLevelModel::TargetLevelModel(QObject *parent, DefaultSelection defaultSelection) : + ChecklistModel(parent) +{ + QList items; + items.reserve(8); + Qt::CheckState defaultSelected = defaultSelection == DefaultSelection::MostUsefulTargets ? Qt::Checked : Qt::Unchecked; + items << mkItem(TagTargetLevel::Unspecified, defaultSelected); + items << mkItem(TagTargetLevel::Shot, Qt::Unchecked); + items << mkItem(TagTargetLevel::Subtrack, Qt::Unchecked); + items << mkItem(TagTargetLevel::Track, defaultSelected); + items << mkItem(TagTargetLevel::Part, Qt::Unchecked); + items << mkItem(TagTargetLevel::Album, Qt::Unchecked); + items << mkItem(TagTargetLevel::Edition, Qt::Unchecked); + items << mkItem(TagTargetLevel::Collection, Qt::Unchecked); + setItems(items); +} + +TargetLevelModel::TargetLevelModel(const QList &items, QObject *parent) : + ChecklistModel(parent) +{ + setItems(items); +} + +QVariant TargetLevelModel::headerData(int section, Qt::Orientation orientation, int role) const +{ + switch(orientation) { + case Qt::Horizontal: + switch(role) { + case Qt::DisplayRole: + switch(section) { + case 0: + return tr("Target level"); + default: + ; + } + } + break; + default: + ; + } + return QVariant(); +} + +} diff --git a/application/targetlevelmodel.h b/application/targetlevelmodel.h new file mode 100644 index 0000000..c8087d0 --- /dev/null +++ b/application/targetlevelmodel.h @@ -0,0 +1,43 @@ +#ifndef TARGETLEVELMODEL_H +#define TARGETLEVELMODEL_H + +#include + +#include +#include + +namespace Media { +DECLARE_ENUM(TagTargetLevel, unsigned char) +} + +namespace Settings { + +class TargetLevelModel : public Models::ChecklistModel +{ + Q_OBJECT +public: + enum class DefaultSelection + { + None, + MostUsefulTargets + }; + + static const char *fieldName(Media::TagTargetLevel targetLevel); + static QString translatedFieldName(Media::TagTargetLevel targetLevel); + static Models::ChecklistItem mkItem(Media::TagTargetLevel targetLevel, Qt::CheckState checkState = Qt::Checked); + + explicit TargetLevelModel(QObject *parent = nullptr, DefaultSelection defaultSelection = DefaultSelection::None); + explicit TargetLevelModel(const QList &items, QObject *parent = nullptr); + + QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const; + virtual QString labelForId(const QVariant &id) const; +}; + +inline Models::ChecklistItem TargetLevelModel::mkItem(Media::TagTargetLevel field, Qt::CheckState checkState) +{ + return Models::ChecklistItem(static_cast(field), translatedFieldName(field), checkState); +} + +} + +#endif // TARGETLEVELMODEL_H diff --git a/cli/mainfeatures.cpp b/cli/mainfeatures.cpp index 5c24d2f..f00a0f0 100644 --- a/cli/mainfeatures.cpp +++ b/cli/mainfeatures.cpp @@ -791,7 +791,7 @@ void displayTagInfo(const StringVector ¶meterValues, const Argument &filesAr // write tag name and target, eg. MP4/iTunes tag cout << tag->typeName(); if(!tag->target().isEmpty()) { - cout << " targeting \"" << tag->target().toString() << "\""; + cout << " targeting \"" << tag->targetString() << "\""; } cout << endl; // iterate through fields specified by the user diff --git a/gui/entertargetdialog.cpp b/gui/entertargetdialog.cpp index 34552e8..ff3dfe4 100644 --- a/gui/entertargetdialog.cpp +++ b/gui/entertargetdialog.cpp @@ -64,7 +64,8 @@ EnterTargetDialog::EnterTargetDialog(QWidget *parent) : m_tracksModel(new ChecklistModel(this)), m_chaptersModel(new ChecklistModel(this)), m_editionsModel(new ChecklistModel(this)), - m_attachmentsModel(new ChecklistModel(this)) + m_attachmentsModel(new ChecklistModel(this)), + m_currentContainerFormat(ContainerFormat::Unknown) { // setup UI m_ui->setupUi(this); @@ -79,7 +80,7 @@ EnterTargetDialog::EnterTargetDialog(QWidget *parent) : m_ui->attachmentsListView->setModel(m_attachmentsModel); // connect signals and slots connect(m_ui->levelSpinBox, static_cast(&QSpinBox::valueChanged), this, &EnterTargetDialog::updateLevelNamePlaceholderText); - connect(m_ui->confirmPushButton, &QPushButton::clicked, this, &EnterTargetDialog::accept); + connect(m_ui->confirmPushButton, &QPushButton::clicked, this, &EnterTargetDialog::accept); connect(m_ui->abortPushButton, &QPushButton::clicked, this, &EnterTargetDialog::reject); } @@ -88,7 +89,8 @@ EnterTargetDialog::~EnterTargetDialog() void EnterTargetDialog::updateLevelNamePlaceholderText(int i) { - m_ui->levelNameLineEdit->setPlaceholderText(QString::fromLocal8Bit(matroskaTargetTypeName(static_cast(i)))); + const char *levelName = i >= 0 ? tagTargetLevelName(containerTargetLevel(m_currentContainerFormat, static_cast(i))) : nullptr; + m_ui->levelNameLineEdit->setPlaceholderText(levelName ? QString::fromUtf8(levelName) : QString()); } Media::TagTarget EnterTargetDialog::target() const @@ -105,6 +107,7 @@ Media::TagTarget EnterTargetDialog::target() const void EnterTargetDialog::setTarget(const TagTarget &target, const MediaFileInfo *file) { + m_currentContainerFormat = file ? file->containerFormat() : ContainerFormat::Unknown; if(m_ui->levelSpinBox->maximum() >= 0 && target.level() <= static_cast(m_ui->levelSpinBox->maximum()) && (m_ui->levelSpinBox->minimum() < 0 || target.level() >= static_cast(m_ui->levelSpinBox->minimum()))) { diff --git a/gui/entertargetdialog.h b/gui/entertargetdialog.h index 0282607..05a77c1 100644 --- a/gui/entertargetdialog.h +++ b/gui/entertargetdialog.h @@ -13,6 +13,7 @@ class ChecklistModel; namespace Media { class MediaFileInfo; +enum class ContainerFormat; } namespace QtGui { @@ -42,6 +43,7 @@ private: Models::ChecklistModel *m_chaptersModel; Models::ChecklistModel *m_editionsModel; Models::ChecklistModel *m_attachmentsModel; + Media::ContainerFormat m_currentContainerFormat; }; } diff --git a/gui/fileinfomodel.cpp b/gui/fileinfomodel.cpp index 7919e5b..863ae9c 100644 --- a/gui/fileinfomodel.cpp +++ b/gui/fileinfomodel.cpp @@ -339,7 +339,7 @@ void FileInfoModel::updateCache() auto *tagItem = defaultItem(tag->typeName()); ItemHelper tagHelper(tagItem); tagHelper.appendRow(tr("Version"), tag->version()); - tagHelper.appendRow(tr("Target level"), tag->target().toString()); + tagHelper.appendRow(tr("Target level"), tag->targetString()); tagHelper.appendRow(tr("Size"), dataSizeToString(tag->size())); tagHelper.appendRow(tr("Field count"), tag->fieldCount()); tagsItem->appendRow(tagItem); diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp index 1756ebf..b94d987 100644 --- a/gui/mainwindow.cpp +++ b/gui/mainwindow.cpp @@ -318,13 +318,10 @@ void MainWindow::showSettingsDlg() { if(!m_settingsDlg) { m_settingsDlg = new SettingsDialog(this); - //connect(m_settingsDlg, &SettingsDialog::accept, this, &MainWindow::applySettingsFromDialog); - //connect(m_settingsDlg, &SettingsDialog::accept, m_ui->tagEditorWidget, &TagEditorWidget::applySettingsFromDialog); - } - if(m_settingsDlg->exec() == QDialog::Accepted) { - applySettingsFromDialog(); - m_ui->tagEditorWidget->applySettingsFromDialog(); + connect(m_settingsDlg, &SettingsDialog::applied, this, &MainWindow::applySettingsFromDialog); + connect(m_settingsDlg, &SettingsDialog::applied, m_ui->tagEditorWidget, &TagEditorWidget::applySettingsFromDialog); } + m_settingsDlg->exec(); } /*! diff --git a/gui/settingsdialog.cpp b/gui/settingsdialog.cpp index 15d97ac..195cdbb 100644 --- a/gui/settingsdialog.cpp +++ b/gui/settingsdialog.cpp @@ -3,6 +3,7 @@ #include "../application/settings.h" #include "../application/knownfieldmodel.h" +#include "../application/targetlevelmodel.h" #include #include @@ -140,6 +141,7 @@ QWidget *EditorTempOptionPage::setupWidget() // EditorFieldsOptionPage EditorFieldsOptionPage::EditorFieldsOptionPage(QWidget *parentWidget) : + EditorFieldsOptionPageBase(parentWidget), m_model(nullptr) {} @@ -443,6 +445,40 @@ void Id3v2OptionPage::reset() } } +// TagProcessingTargetsOptionPage +TagProcessingTargetsOptionPage::TagProcessingTargetsOptionPage(QWidget *parentWidget) : + TagProcessingTargetsOptionPageBase(parentWidget), + m_model(nullptr) +{} + +TagProcessingTargetsOptionPage::~TagProcessingTargetsOptionPage() +{} + +bool TagProcessingTargetsOptionPage::apply() +{ + if(hasBeenShown() && m_model) { + Settings::defaultTargetsModel().setItems(m_model->items()); + } + return true; +} + +void TagProcessingTargetsOptionPage::reset() +{ + if(hasBeenShown() && m_model) { + m_model->setItems(Settings::defaultTargetsModel().items()); + } +} + +QWidget *TagProcessingTargetsOptionPage::setupWidget() +{ + auto *w = TagProcessingTargetsOptionPageBase::setupWidget(); + if(!m_model) { + m_model = new TargetLevelModel(w); + } + ui()->targetsToBeAddedListView->setModel(m_model); + return w; +} + // FileLayoutPage FileLayoutPage::FileLayoutPage(QWidget *parentWidget) : FileLayoutPageBase(parentWidget) @@ -548,8 +584,8 @@ SettingsDialog::SettingsDialog(QWidget *parent) : category = new Dialogs::OptionCategory(this); category->setDisplayName(tr("Tag processing")); category->assignPages(QList() - << new TagProcessingGeneralOptionPage - << new Id3v1OptionPage << new Id3v2OptionPage << new FileLayoutPage); + << new TagProcessingGeneralOptionPage << new Id3v1OptionPage + << new Id3v2OptionPage << new TagProcessingTargetsOptionPage << new FileLayoutPage); category->setIcon(QIcon::fromTheme(QStringLiteral("tag"), QIcon(QStringLiteral(":/tageditor/icons/hicolor/32x32/settingscategories/tag.png")))); categories << category; diff --git a/gui/settingsdialog.h b/gui/settingsdialog.h index 071d94c..7006c04 100644 --- a/gui/settingsdialog.h +++ b/gui/settingsdialog.h @@ -11,6 +11,7 @@ #include "ui_tagprocessinggeneraloptionpage.h" #include "ui_id3v1optionpage.h" #include "ui_id3v2optionpage.h" +#include "ui_tagprocessingtargetsoptionpage.h" #include "ui_filelayout.h" #include @@ -20,6 +21,7 @@ namespace Settings { class KnownFieldModel; +class TargetLevelModel; } DECLARE_EXTERN_UI_FILE_BASED_OPTION_PAGE(QtAppearanceOptionPage) @@ -54,6 +56,11 @@ DECLARE_UI_FILE_BASED_OPTION_PAGE(Id3v1OptionPage) DECLARE_UI_FILE_BASED_OPTION_PAGE(Id3v2OptionPage) +BEGIN_DECLARE_UI_FILE_BASED_OPTION_PAGE(TagProcessingTargetsOptionPage) + DECLARE_SETUP_WIDGETS + Settings::TargetLevelModel *m_model; +END_DECLARE_OPTION_PAGE + DECLARE_UI_FILE_BASED_OPTION_PAGE_CUSTOM_SETUP(FileLayoutPage) class SettingsDialog : public Dialogs::SettingsDialog diff --git a/gui/tagedit.cpp b/gui/tagedit.cpp index dd40f4e..ce27fba 100644 --- a/gui/tagedit.cpp +++ b/gui/tagedit.cpp @@ -144,7 +144,7 @@ QString TagEdit::generateLabel() const res.append(tr(" with different targets")); } else { if(!target.isEmpty()) { - res.append(tr(" targeting %1").arg(QString::fromLocal8Bit(target.toString().c_str()))); + res.append(tr(" targeting %1").arg(QString::fromLocal8Bit(m_tags.front()->targetString().c_str()))); } } return res; diff --git a/gui/tageditorwidget.cpp b/gui/tageditorwidget.cpp index 5e6f7ae..9d03fbf 100644 --- a/gui/tageditorwidget.cpp +++ b/gui/tageditorwidget.cpp @@ -6,6 +6,7 @@ #include "./fileinfomodel.h" #include "../application/settings.h" +#include "../application/targetlevelmodel.h" #include "../misc/htmlinfo.h" #include "../misc/utility.h" @@ -56,6 +57,7 @@ using namespace Dialogs; using namespace Widgets; using namespace ThreadingUtils; using namespace Media; +using namespace Models; namespace QtGui { @@ -237,7 +239,7 @@ void TagEditorWidget::updateDocumentTitleEdits() { // get container, segment count and present titles AbstractContainer *container = m_fileInfo.container(); - int segmentCount = container ? static_cast(container->segmentCount()) : 0; + const int segmentCount = container ? static_cast(container->segmentCount()) : 0; const vector &titles = container ? container->titles() : vector(); // get layout @@ -470,7 +472,9 @@ void TagEditorWidget::updateTagManagementMenu() if(m_fileInfo.areTagsSupported() && m_fileInfo.container()) { // there is a container object which is able to create tags QString label; - if(m_fileInfo.containerFormat() == ContainerFormat::Matroska) { + switch(m_fileInfo.containerFormat()) { + case ContainerFormat::Matroska: + case ContainerFormat::Webm: // tag format supports targets (Matroska tags are currently the only tag format supporting targets.) label = tr("Matroska tag"); connect(m_addTagMenu->addAction(label), &QAction::triggered, std::bind(&TagEditorWidget::addTag, this, [this] (MediaFileInfo &file) -> Media::Tag * { @@ -483,7 +487,9 @@ void TagEditorWidget::updateTagManagementMenu() } return nullptr; })); - } else { + break; + + default: // tag format does not support targets if(!m_fileInfo.container()->tagCount()) { switch(m_fileInfo.containerFormat()) { @@ -491,7 +497,7 @@ void TagEditorWidget::updateTagManagementMenu() label = tr("MP4/iTunes tag"); break; case ContainerFormat::Ogg: - label = tr("Vorbis/Opus comment"); + label = tr("Vorbis comment"); break; default: label = tr("Tag"); @@ -502,16 +508,28 @@ void TagEditorWidget::updateTagManagementMenu() } } } else { - // there is no container object which is able to create tags; creation of ID3 tags is always possible - if(!m_fileInfo.hasId3v1Tag()) { - connect(m_addTagMenu->addAction(tr("ID3v1 tag")), &QAction::triggered, std::bind(&TagEditorWidget::addTag, this, [] (MediaFileInfo &file) { - return file.createId3v1Tag(); - })); - } - if(!m_fileInfo.hasId3v2Tag()) { - connect(m_addTagMenu->addAction(tr("ID3v2 tag")), &QAction::triggered, std::bind(&TagEditorWidget::addTag, this, [] (MediaFileInfo &file) { - return file.createId3v2Tag(); - })); + // there is no container object which is able to create tags + switch(m_fileInfo.containerFormat()) { + case ContainerFormat::Flac: + if(!m_fileInfo.vorbisComment()) { + connect(m_addTagMenu->addAction(tr("Vorbis comment")), &QAction::triggered, std::bind(&TagEditorWidget::addTag, this, [] (MediaFileInfo &file) { + return file.createVorbisComment(); + })); + } + break; + + default: + // creation of ID3 tags is always possible + if(!m_fileInfo.hasId3v1Tag()) { + connect(m_addTagMenu->addAction(tr("ID3v1 tag")), &QAction::triggered, std::bind(&TagEditorWidget::addTag, this, [] (MediaFileInfo &file) { + return file.createId3v1Tag(); + })); + } + if(!m_fileInfo.hasId3v2Tag()) { + connect(m_addTagMenu->addAction(tr("ID3v2 tag")), &QAction::triggered, std::bind(&TagEditorWidget::addTag, this, [] (MediaFileInfo &file) { + return file.createId3v2Tag(); + })); + } } } // add "Remove tag" and "Change target" actions @@ -539,7 +557,7 @@ void TagEditorWidget::updateTagManagementMenu() } /*! - * \brief Inserts the title from the filename keeping a possibly available title from the tags. + * \brief Inserts the title from the filename if no title is available from the tags. * \remarks Does nothing if there are no tags assigned and if this feature is not enabled in the settings. */ void TagEditorWidget::insertTitleFromFilename() @@ -548,8 +566,13 @@ void TagEditorWidget::insertTitleFromFilename() QString title; int trackNum; parseFileName(QString::fromLocal8Bit(m_fileInfo.fileName().c_str()), title, trackNum); - TagValue titleValue = qstringToTagValue(title, TagTextEncoding::Utf16LittleEndian); + const TagValue titleValue = qstringToTagValue(title, TagTextEncoding::Utf16LittleEndian); foreachTagEdit([&titleValue] (TagEdit *edit) { + for(const Tag *tag : edit->tags()) { + if(tag->supportsTarget() && tag->isTargetingLevel(TagTargetLevel::Part)) { + return; + } + } edit->setValue(KnownField::Title, titleValue, PreviousValueHandling::Keep); }); } @@ -849,11 +872,19 @@ void TagEditorWidget::showFile(char result) } // create appropriate tags according to file type and user preferences when automatic tag management is enabled if(Settings::autoTagManagement()) { + const QList &targetItems = Settings::defaultTargetsModel().items(); + vector requiredTargets; + requiredTargets.reserve(2); + for(const ChecklistItem &targetItem : targetItems) { + if(targetItem.isChecked()) { + requiredTargets.emplace_back(containerTargetLevelValue(m_fileInfo.containerFormat(), static_cast(targetItem.id().toInt()))); + } + } if(!m_fileInfo.createAppropriateTags(false, Settings::id3v1usage(), Settings::id3v2usage(), Settings::mergeMultipleSuccessiveId3v2Tags(), - Settings::keepVersionOfExistingId3v2Tag(), Settings::id3v2versionToBeUsed())) { + Settings::keepVersionOfExistingId3v2Tag(), Settings::id3v2versionToBeUsed(), requiredTargets)) { if(confirmCreationOfId3TagForUnsupportedFile()) { m_fileInfo.createAppropriateTags(true, Settings::id3v1usage(), Settings::id3v2usage(), Settings::mergeMultipleSuccessiveId3v2Tags(), - Settings::keepVersionOfExistingId3v2Tag(), Settings::id3v2versionToBeUsed()); + Settings::keepVersionOfExistingId3v2Tag(), Settings::id3v2versionToBeUsed(), requiredTargets); } } // tags might have been adjusted -> reload tags diff --git a/gui/tageditorwidget.h b/gui/tageditorwidget.h index fbe727c..80bc2f7 100644 --- a/gui/tageditorwidget.h +++ b/gui/tageditorwidget.h @@ -50,7 +50,7 @@ class TagEditorWidget : public QWidget public: explicit TagEditorWidget(QWidget *parent = nullptr); - virtual ~TagEditorWidget(); + ~TagEditorWidget(); public: QMutex &fileOperationMutex(); diff --git a/gui/tagprocessinggeneraloptionpage.ui b/gui/tagprocessinggeneraloptionpage.ui index c56f421..be3cf82 100644 --- a/gui/tagprocessinggeneraloptionpage.ui +++ b/gui/tagprocessinggeneraloptionpage.ui @@ -6,8 +6,8 @@ 0 0 - 361 - 398 + 647 + 330 @@ -106,7 +106,7 @@ <span style="font-weight: bold;">Automatic tag management</span> -<br>If enabled, appropriate tags will be created and removed according to the settings automatically when opening a file. Otherwise you have to do this manually and settings like ID3 usage have no effect. +<br>If enabled, appropriate tags will be created and removed according to the settings automatically when opening a file. Otherwise you have to do this manually (eg. adding an ID3 tag if none is present yet) and settings like ID3 usage have no effect. true @@ -138,7 +138,7 @@ - + diff --git a/gui/tagprocessingtargetsoptionpage.ui b/gui/tagprocessingtargetsoptionpage.ui new file mode 100644 index 0000000..de8aa94 --- /dev/null +++ b/gui/tagprocessingtargetsoptionpage.ui @@ -0,0 +1,80 @@ + + + QtGui::TagProcessingTargetsOptionPage + + + + 0 + 0 + 647 + 330 + + + + Targets + + + QGroupBox { font-weight: bold }; + + + + + + font-weight: bold; + + + Target levels to be added when opening a file + + + + + + + 1 + + + false + + + QListView::Free + + + QListView::LeftToRight + + + true + + + 3 + + + true + + + + + + + <html> +<head/> +<body> +Remarks +<ul style="margin-left: -20px; margin-top: -3px; text-indent: 0px "> +<li>It is ensured that at least one tag for each selected target level is present when opening a file.</li> +<li>Has no effect if automatic tag management is disabled.</li> +<li>Has no effect when targets are not supported by the file format.</li> +<ul></body></html> + + + Qt::AutoText + + + true + + + + + + + + diff --git a/misc/htmlinfo.cpp b/misc/htmlinfo.cpp index 3a4fe32..6c82da4 100644 --- a/misc/htmlinfo.cpp +++ b/misc/htmlinfo.cpp @@ -935,7 +935,7 @@ public: rowMaker.mkRow(QCoreApplication::translate("HtmlInfo", "Version"), qstr(tag->version())); } if(tag->supportsTarget() && !tag->target().isEmpty()) { - rowMaker.mkRow(QCoreApplication::translate("HtmlInfo", "Target level"), qstr(tag->target().toString())); + rowMaker.mkRow(QCoreApplication::translate("HtmlInfo", "Target level"), qstr(tag->targetString())); } rowMaker.mkRow(QCoreApplication::translate("HtmlInfo", "Size"), qstr(dataSizeToString(tag->size(), true))); rowMaker.mkRow(QCoreApplication::translate("HtmlInfo", "Field count"), QString::number(tag->fieldCount())); diff --git a/translations/tageditor_de_DE.ts b/translations/tageditor_de_DE.ts index 474c2bf..65944b2 100644 --- a/translations/tageditor_de_DE.ts +++ b/translations/tageditor_de_DE.ts @@ -21,174 +21,6 @@ hide - - - Path - - - - - - - - Size - - - - - - Duration - - - - - Overall avg. bitrate - - - - - - Mime-type - - - - - - - - - - show details - - - - - Container - - - - - Title - - - - - - - Version - - - - - Channel count - - - - - Attachment - - - - - Description - - - - - Chapter - - - - - Name (%1) - - - - - Start time - - - - - End time - - - - - Edition - - - - - Chapters - - - - - , size: - - - - - section has not been analyzed - - - - - Info for %1 - - - - - Title (segment %1) - - - - - Read version - - - - - Document type - - - - - Document version - - - - - Document read version - - - - - Padding size - - - - - Tags - - - - - Target level - - - - - Field count - - - - - - Tracks - - Track @@ -259,6 +91,13 @@ The version/level of the track's format. + + + + + Version + + Extension @@ -279,6 +118,20 @@ The raw format/codec identifier extracted from the container. + + + + + + Size + + + + + + Duration + + Avg. bitrate @@ -367,6 +220,11 @@ Channel configuration + + + Channel count + + Bit depth @@ -421,97 +279,84 @@ Labeled as + + + Attachment + + + + + + Mime-type + + + + + Description + + + + + Chapter + + + + + Name (%1) + + + + + Start time + + + + + End time + + hidden + + + + Tracks + + + + + Edition + + ordered + + + Chapters + + + + + , size: + + + + + section has not been analyzed + + Notifications (reparsing after saving) - - - %1 tag(s) assigned - - - - - - - - file has %1 track(s) - - - - - - - - %1 attachment(s) assigned - - - - - - - - file has %1 edition(s) - - - - - - - - chapters - - - - - file has %1 chapter(s) - - - - - - - - expand all - - - - - collapse all - - - - - hex - - - - - Attachments - - - - - Editions/chapters - - - - - Structure - - Notifications @@ -545,6 +390,161 @@ Time + + + Info for %1 + + + + + Path + + + + + Overall avg. bitrate + + + + + Container + + + + + + + + + + show details + + + + + Title (segment %1) + + + + + Title + + + + + Read version + + + + + Document type + + + + + Document version + + + + + Document read version + + + + + Padding size + + + + + Tags + + + + + %1 tag(s) assigned + + + + + + + + Target level + + + + + Field count + + + + + file has %1 track(s) + + + + + + + + Attachments + + + + + %1 attachment(s) assigned + + + + + + + + Editions/chapters + + + + + file has %1 edition(s) + + + + + + + + chapters + + + + + file has %1 chapter(s) + + + + + + + + Structure + + + + + expand all + + + + + collapse all + + + + + hex + + QtGui::AttachmentsEdit @@ -824,6 +824,11 @@ QtGui::EditorFieldsOptionPage + + + Fields + + Fields to be shown @@ -843,14 +848,14 @@ Remarks <ul></body></html> - - - Fields - - QtGui::EditorGeneralOptionPage + + + General + + Keep field values from previously shown file when the value of the opened file is empty @@ -861,11 +866,6 @@ Remarks No, disable this feature - - - Handling of multiple tags - - Yes, but only if both files are in the sa&me directory @@ -876,6 +876,11 @@ Remarks Yes, &regardless where the files are stored + + + Handling of multiple tags + + Use one editor for ta&gs with the same target @@ -911,26 +916,21 @@ Remarks Hide cover buttons - - - General - - QtGui::EditorTempOptionPage - - - Directory to store temporary/backup files - - Temp files - + + Directory to store temporary/backup files + + + + To avoid unnecessary copying this directory should be on the same partition as the files you want to edit. @@ -990,6 +990,11 @@ Remarks QtGui::FileBrowserGeneralOptionPage + + + General + + Miscellaneous @@ -1005,20 +1010,6 @@ Remarks Read only - - - General - - - - - QtGui::FileFilterProxyModel - - - - Necessary for lupdate. - - QtGui::FileInfoModel @@ -1443,6 +1434,11 @@ Remarks QtGui::FileLayoutPage + + + File layout + + force rewrite when applying changes @@ -1522,17 +1518,12 @@ another position would prevent rewriting the entire file - - File layout - - - - + Minimum padding must be less or equal than maximum padding. - + These options might be ignored if not supported by either the format or the implementation. @@ -1562,6 +1553,11 @@ another position would prevent rewriting the entire file QtGui::Id3v1OptionPage + + + ID3v1 + + Usage when saving MP3 files @@ -1582,14 +1578,14 @@ another position would prevent rewriting the entire file &Remove existing ID3v1 tag - - - ID3v1 - - QtGui::Id3v2OptionPage + + + ID3v2 + + Usage when saving MP3 files @@ -1610,6 +1606,11 @@ another position would prevent rewriting the entire file &Never create an ID3v2 tag and remove existing + + + Version to be used + + &2.3.0 @@ -1625,6 +1626,11 @@ another position would prevent rewriting the entire file 2.2.&0 + + + Keep version of existing tag if present + + Behavior when multiple successive ID3v2 tags are found @@ -1640,21 +1646,6 @@ another position would prevent rewriting the entire file Keep &them separate - - - Version to be used - - - - - Keep version of existing tag if present - - - - - ID3v2 - - QtGui::InfoOptionPage @@ -1676,15 +1667,6 @@ another position would prevent rewriting the entire file - - QtGui::InfoWidgetBase - - - - Necessary for lupdate. - - - QtGui::MainWindow @@ -1702,6 +1684,11 @@ another position would prevent rewriting the entire file Di&rectory + + + ? + + A&pplication @@ -1712,6 +1699,11 @@ another position would prevent rewriting the entire file F&ile selection + + + Select next file + + &MusicBrains search (beta) @@ -1722,6 +1714,11 @@ another position would prevent rewriting the entire file Save &entered tags + + + Ctrl+S + + &Delete all tags @@ -1737,21 +1734,41 @@ another position would prevent rewriting the entire file &Close + + + Ctrl+Q + + &Select next file + + + F6 + + &Rename files using tags + + + F2 + + &Open + + + Ctrl+O + + &Save file information as HTML document @@ -1787,6 +1804,21 @@ another position would prevent rewriting the entire file &Settings + + + F8 + + + + + &Reload (reverts all changes!) + + + + + F5 + + &Play (external player) @@ -1817,62 +1849,6 @@ another position would prevent rewriting the entire file Ctrl+Shift+S - - - ? - - - - - Ctrl+S - - - - - Ctrl+O - - - - - F8 - - - - - Ctrl+Q - - - - - Select next file - - - - - F6 - - - - - F2 - - - - - &Reload (reverts all changes!) - - - - - F5 - - - - - - Necessary for lupdate. - - No file opened. @@ -1884,51 +1860,51 @@ another position would prevent rewriting the entire file - + Unable to show the next file because it can't be found anymore. - + Open file - - + Save changes as - - + Save file information - - - No file is opened. - - - - - Unable to save file information because the current process hasn't been finished yet. - - - - + Unable to write to file. %1 - + Unable to open file. - + No file information available. + + + No file is opened. + + + + + Unable to save file information because the current process hasn't been finished yet. + + QtGui::MusicBrainzResultsModel @@ -1945,12 +1921,6 @@ another position would prevent rewriting the entire file QtGui::NotificationModel - - - - Necessary for lupdate. - - Context @@ -1974,12 +1944,6 @@ another position would prevent rewriting the entire file QtGui::PathLineEdit - - - - Necessary for lupdate. - - Select directory ... @@ -2044,12 +2008,6 @@ another position would prevent rewriting the entire file Restore - - - - Necessary for lupdate. - - Other @@ -2314,11 +2272,6 @@ another position would prevent rewriting the entire file Base directory - - - Select - - Include subdirectories @@ -2329,6 +2282,11 @@ another position would prevent rewriting the entire file ECMA Script used to generate new file and directory names + + + Paste + + Use external file @@ -2340,20 +2298,8 @@ another position would prevent rewriting the entire file - - closes the window or aborts the currently running process - - - - - - - Close - - - - - Paste + + Select @@ -2367,9 +2313,15 @@ another position would prevent rewriting the entire file - - - Abort + + closes the window or aborts the currently running process + + + + + + + Close @@ -2392,12 +2344,6 @@ another position would prevent rewriting the entire file Apply generated names - - - - Necessary for lupdate. - - from file @@ -2413,17 +2359,43 @@ another position would prevent rewriting the entire file default script + + + There is no external script file is selected. + + + + + Unable to open external script file. + + Generating preview ... + + + + Abort + + The script is not valid. Error in line %1: %3 + + + An error occured when parsing the script: %1 + + + + + The script is empty. + + The selected directory doesn't exist. @@ -2442,20 +2414,19 @@ Error in line %1: %3 - - - Preview has been generated. - - - - - %1 error(s) occured. + + %1 error(s) occured + + + Preview has been generated. + + @@ -2470,39 +2441,20 @@ Error in line %1: %3 No files and directories have been found. - - - %1 error(s) occured - - - - - - - - There is no external script file is selected. - - - - - Unable to open external script file. - - - - - An error occured when parsing the script: %1 - - - - - The script is empty. - - Generation of preview has been aborted prematurely. + + + + %1 error(s) occured. + + + + + Changins applied. @@ -2542,35 +2494,29 @@ Error in line %1: %3 QtGui::SettingsDialog - + Necessary for lupdate. - + Tag processing - + Editor - + File browser QtGui::TagEdit - - - - Necessary for lupdate. - - with different targets @@ -2650,7 +2596,7 @@ the file reverting all unsaved changings. - + Abort @@ -2715,203 +2661,204 @@ the file reverting all unsaved changings. - + Add tag - + Remove tag - + Change target - + Segment %1 - + Attachments - + Matroska tag - + MP4/iTunes tag - + + + Vorbis comment + + + + Tag - + ID3v1 tag - + ID3v2 tag - - + + Copy - - Unable to load the selected file "%1" because the current process hasn't finished yet. - - - - - The file is beeing parsed ... - - - - - Unable to reload the file because the current process hasn't finished yet. - - - - - Currently is not file opened. - - - - - The file could not be opened because an IO error occurred. - - - - - File could be parsed correctly. - - - - - File couldn't be parsed correctly. - - - - - There are critical parsing notifications. - - - - - There are warnings. - - - - - There is no (supported) tag assigned. - - - - - File format is not supported (an ID3 tag can be added anyways). - - - - - The file %1 has been opened. - - - - - Unable to apply the entered tags to the file because the current process hasn't finished yet. - - - - - Saving tags ... - - - - - No file has been opened. - - - - - Unable to delete all tags from the file because the current process hasn't been finished yet. - - - - - Do you really want to delete all tags from the file? - - - - - don't show this message again - - - - - Deleting all tags ... - - - - - The selected file stores no tag (at least no supported), so there is nothing to delete. - - - - - No file has been opened, so no tags can be deleted. - - - - - Unable to start saving process because there an other process hasn't finished yet. - - - - - Cancelling ... - - - - - Vorbis/Opus comment - - - - + Expand all - + Collapse all - - No write access; the file has been opened in read-only mode. + + The file is beeing parsed ... + + + + + Unable to load the selected file "%1" because the current process hasn't finished yet. + + + + + Currently is not file opened. + + + + + Unable to reload the file because the current process hasn't finished yet. + + + + + The file could not be opened because an IO error occurred. + File could be parsed correctly. + + + + + File couldn't be parsed correctly. + + + + + There are critical parsing notifications. + + + + + There are warnings. + + + + + No write access; the file has been opened in read-only mode. + + + + + File format is not supported (an ID3 tag can be added anyways). + + + + The file is composed of multiple segments. Dealing with such files has not been tested yet and might be broken. + + + There is no (supported) tag assigned. + + + + + The file %1 has been opened. + + + + + Saving tags ... + + + + + No file has been opened. + + + + + Unable to apply the entered tags to the file because the current process hasn't finished yet. + + + + + Do you really want to delete all tags from the file? + + + + + don't show this message again + + + + + Deleting all tags ... + + + + + The selected file stores no tag (at least no supported), so there is nothing to delete. + + + + + No file has been opened, so no tags can be deleted. + + + + + Unable to delete all tags from the file because the current process hasn't been finished yet. + + + + + Cancelling ... + + + + + Unable to start saving process because there an other process hasn't finished yet. + + - + The tags have been saved, but there is/are %1 warning(s) @@ -2919,7 +2866,7 @@ the file reverting all unsaved changings. - + and %1 error(s). @@ -2927,7 +2874,7 @@ the file reverting all unsaved changings. - + The tags have been saved, but there is/are %1 warning(s). @@ -2935,84 +2882,78 @@ the file reverting all unsaved changings. - + The tags have been saved. - + The tags couldn't be saved. See the info box for detail. - + The tags couldn't be saved because an IO error occured. - + Automatic tag management - + The container format of the selected file is not supported. The file can be treated as MP3 file (an ID3 tag according to the settings will be created). This might break the file. Do you want to continue? - + Treat file as MP3 file - + The currently opened file changed on the disk. - + A tag (with the selected target) already exists. - + The tag can not be created. - - Unable to remove the tag because the current process hasn't been finished yet. - - - - + Unable to remove the tag because no file is opened. - - Unable to change the target because the current process hasn't been finished yet. + + Unable to remove the tag because the current process hasn't been finished yet. - + Unable to change the target because no file is opened. - + Can not change the target of the selected tag because the tag does not support targets. + + + Unable to change the target because the current process hasn't been finished yet. + + QtGui::TagFieldEdit - - - - Necessary for lupdate. - - @@ -3023,31 +2964,6 @@ the file reverting all unsaved changings. empty - - - Country - - - - - Folk - - - - - Jazz - - - - - Rock - - - - - Reggae - - Blues @@ -3263,6 +3179,11 @@ the file reverting all unsaved changings. Contemporary Christian + + + Country + + Crossover @@ -3398,6 +3319,11 @@ the file reverting all unsaved changings. Fast Fusion + + + Folk + + Folk-Rock @@ -3558,6 +3484,11 @@ the file reverting all unsaved changings. Jam Band + + + Jazz + + Jazz & Funk @@ -3783,6 +3714,11 @@ the file reverting all unsaved changings. Rave + + + Reggae + + Retro @@ -3798,6 +3734,11 @@ the file reverting all unsaved changings. Rhythmic Soul + + + Rock + + Rock & Roll @@ -4006,21 +3947,16 @@ the file reverting all unsaved changings. QtGui::TagProcessingGeneralOptionPage + + + General + + Preferred text encoding (will be used if the tag format supports it) - - - UTF-8 - - - - - Handling of unknown/unsupported fields - - &no preference (most appropriate encoding will be used) @@ -4031,6 +3967,11 @@ the file reverting all unsaved changings. ISO &8859-1/Latin-1 + + + UTF-8 + + UTF-&16 Little Endian @@ -4041,6 +3982,11 @@ the file reverting all unsaved changings. UTF-1&6 Big Endian + + + Handling of unknown/unsupported fields + + Ignore &them but keep them when saving @@ -4054,7 +4000,7 @@ the file reverting all unsaved changings. <span style="font-weight: bold;">Automatic tag management</span> -<br>If enabled, appropriate tags will be created and removed according to the settings automatically when opening a file. Otherwise you have to do this manually and settings like ID3 usage have no effect. +<br>If enabled, appropriate tags will be created and removed according to the settings automatically when opening a file. Otherwise you have to do this manually (eg. adding an ID3 tag if none is present yet) and settings like ID3 usage have no effect. @@ -4062,9 +4008,30 @@ the file reverting all unsaved changings. enable automatic tag management (default) + + + QtGui::TagProcessingTargetsOptionPage - - General + + Targets + + + + + Target levels to be added when opening a file + + + + + <html> +<head/> +<body> +Remarks +<ul style="margin-left: -20px; margin-top: -3px; text-indent: 0px "> +<li>It is ensured that at least one tag for each selected target level is present when opening a file.</li> +<li>Has no effect if automatic tag management is disabled.</li> +<li>Has no effect when targets are not supported by the file format.</li> +<ul></body></html> @@ -4112,12 +4079,6 @@ the file reverting all unsaved changings. RenamingUtility::RemamingEngine - - - - Necessary for lupdate. - - Program is not callable. @@ -4234,28 +4195,14 @@ the file reverting all unsaved changings. - - RenamingUtility::ScriptFunctions - - - - Necessary for lupdate. - - - Settings::KnownFieldModel - + Necessary for lupdate. - - - Field - - Title @@ -4396,5 +4343,69 @@ the file reverting all unsaved changings. Vendor + + + Field + + + + + Settings::TargetLevelModel + + + + Necessary for lupdate. + + + + + unspecified, everything + + + + + shot + + + + + subtrack, part, movement, scene + + + + + track, song, chapter + + + + + part, session + + + + + album, opera, concert, movie, episode + + + + + edition, issue, volume, opus, season, sequel + + + + + collection + + + + + unknown + + + + + Target level + + diff --git a/translations/tageditor_en_US.ts b/translations/tageditor_en_US.ts index 03d8674..c6a9458 100644 --- a/translations/tageditor_en_US.ts +++ b/translations/tageditor_en_US.ts @@ -362,6 +362,14 @@ Notifications + + + %1 notification(s) available + + + + + show notifications @@ -455,9 +463,9 @@ %1 tag(s) assigned - - %1 tag assigned - %1 tags assigned + + + @@ -473,9 +481,9 @@ file has %1 track(s) - - file has %1 track - file has %1 tracks + + + @@ -486,9 +494,9 @@ %1 attachment(s) assigned - - %1 attachment assigned - %1 attachments assigned + + + @@ -499,9 +507,9 @@ file has %1 edition(s) - - file has %1 edition - file has %1 editions + + + @@ -512,9 +520,9 @@ file has %1 chapter(s) - - file has %1 chapter - file has %1 chapters + + + @@ -537,14 +545,6 @@ hex - - - %1 notification(s) available - - %1 notification available - %1 notifications available - - QtGui::AttachmentsEdit @@ -639,59 +639,6 @@ QtGui::DbQueryWidget - - - Search hasn't been started. - - - - - Insufficient search criteria supplied - - - - - Retrieving meta data ... - - - - - Aborted - - - - - No results available - - - - - %1 result(s) available - - %1 result available - %1 results available - - - - - Retrieving cover art to be applied ... - - - - - Show cover - - - - - Retrieving cover art ... - - - - - Cover - %1 - - MusicBrainz search @@ -750,6 +697,59 @@ Apply results + + + Search hasn't been started. + + + + + Insufficient search criteria supplied + + + + + Retrieving meta data ... + + + + + Aborted + + + + + No results available + + + + + %1 result(s) available + + + + + + + + Retrieving cover art to be applied ... + + + + + Show cover + + + + + Retrieving cover art ... + + + + + Cover - %1 + + QtGui::EditorAutoCorrectionOptionPage @@ -930,7 +930,7 @@ Remarks - + To avoid unnecessary copying this directory should be on the same partition as the files you want to edit. @@ -1011,15 +1011,6 @@ Remarks - - QtGui::FileFilterProxyModel - - - - Necessary for lupdate. - - - QtGui::FileInfoModel @@ -1117,9 +1108,9 @@ Remarks %1 tag(s) assigned - - %1 tag assigned - %1 tags assigned + + + @@ -1141,9 +1132,9 @@ Remarks %1 track(s) contained - - %1 track contained - %1 tracks contained + + + @@ -1347,9 +1338,9 @@ Remarks %1 attachment(s) present - - %1 attachment present - %1 attachments present + + + @@ -1396,9 +1387,9 @@ Remarks %1 edition(s) present - - %1 edition present - %1 editions present + + + @@ -1419,9 +1410,9 @@ Remarks %1 chapter(s) present - - %1 chapter present - %1 chapters present + + + @@ -1527,12 +1518,12 @@ another position would prevent rewriting the entire file - + Minimum padding must be less or equal than maximum padding. - + These options might be ignored if not supported by either the format or the implementation. @@ -1676,23 +1667,8 @@ another position would prevent rewriting the entire file - - QtGui::InfoWidgetBase - - - - Necessary for lupdate. - - - QtGui::MainWindow - - - - Necessary for lupdate. - - Tag editor @@ -1719,13 +1695,13 @@ another position would prevent rewriting the entire file - - Select next file + + F&ile selection - - F&ile selection + + Select next file @@ -1884,48 +1860,48 @@ another position would prevent rewriting the entire file - + Unable to show the next file because it can't be found anymore. - + Open file - - + Save changes as - - + Save file information - - + Unable to write to file. %1 - + Unable to open file. - + No file information available. - + No file is opened. - + Unable to save file information because the current process hasn't been finished yet. @@ -1945,12 +1921,6 @@ another position would prevent rewriting the entire file QtGui::NotificationModel - - - - Necessary for lupdate. - - Context @@ -1974,12 +1944,6 @@ another position would prevent rewriting the entire file QtGui::PathLineEdit - - - - Necessary for lupdate. - - Select directory ... @@ -1998,12 +1962,6 @@ another position would prevent rewriting the entire file QtGui::PicturePreviewSelection - - - - Necessary for lupdate. - - Form @@ -2304,158 +2262,6 @@ another position would prevent rewriting the entire file QtGui::RenameFilesDialog - - - - Necessary for lupdate. - - - - - %1 files/directories processed - - %1 file/directory processed - %1 files/directories processed - - - - - Preview has been generated. - - - - - No files and directories have been found. - - - - - Generation of preview has been aborted prematurely. - - - - - - %1 error(s) occured. - - %1 error occured. - %1 errors occured. - - - - - - %1 files/directories have been processed. - - %1 file/directory has been processed. - %1 files/directories have been processed. - - - - - from file - - - - - from clipboard - - - - - default script - - - - - There is no external script file is selected. - - - - - Unable to open external script file. - - - - - Generating preview ... - - - - - - Abort - - - - - The script is not valid. -Error in line %1: %3 - - - - - An error occured when parsing the script: %1 - - - - - The script is empty. - - - - - The selected directory doesn't exist. - - - - - Applying changings ... - - - - - %1 error(s) occured - - %1 error occured - %1 errors occured - - - - - Changins applied. - - - - - Applying has been aborted prematurely. - - - - - Unable to open script file. - - - - - Select script - - - - - Clipboard contains no text. - - - - - Expand all - - - - - Collapse all - - Rename files and directories @@ -2538,39 +2344,179 @@ Error in line %1: %3 Apply generated names + + + from file + + + + + from clipboard + + + + + default script + + + + + There is no external script file is selected. + + + + + Unable to open external script file. + + + + + Generating preview ... + + + + + + Abort + + + + + The script is not valid. +Error in line %1: %3 + + + + + An error occured when parsing the script: %1 + + + + + The script is empty. + + + + + The selected directory doesn't exist. + + + + + Applying changings ... + + + + + %1 files/directories processed + + + + + + + + %1 error(s) occured + + + + + + + + Preview has been generated. + + + + + + %1 files/directories have been processed. + + + + + + + + No files and directories have been found. + + + + + Generation of preview has been aborted prematurely. + + + + + + %1 error(s) occured. + + + + + + + + Changins applied. + + + + + Applying has been aborted prematurely. + + + + + Unable to open script file. + + + + + Select script + + + + + Clipboard contains no text. + + + + + Expand all + + + + + Collapse all + + QtGui::SettingsDialog - + Necessary for lupdate. - + Tag processing - + Editor - + File browser QtGui::TagEdit - - - - Necessary for lupdate. - - with different targets @@ -2584,296 +2530,6 @@ Error in line %1: %3 QtGui::TagEditorWidget - - - Add tag - - - - - Remove tag - - - - - Change target - - - - - Segment %1 - - - - - Attachments - - - - - Matroska tag - - - - - MP4/iTunes tag - - - - - Vorbis/Opus comment - - - - - Tag - - - - - ID3v1 tag - - - - - ID3v2 tag - - - - - - Copy - - - - - Expand all - - - - - Collapse all - - - - - The file is beeing parsed ... - - - - - Unable to load the selected file "%1" because the current process hasn't finished yet. - - - - - Currently is not file opened. - - - - - Unable to reload the file because the current process hasn't finished yet. - - - - - The file could not be opened because an IO error occurred. - - - - - File could be parsed correctly. - - - - - File couldn't be parsed correctly. - - - - - There are critical parsing notifications. - - - - - There are warnings. - - - - - No write access; the file has been opened in read-only mode. - - - - - File format is not supported (an ID3 tag can be added anyways). - - - - - The file is composed of multiple segments. Dealing with such files has not been tested yet and might be broken. - - - - - There is no (supported) tag assigned. - - - - - The file %1 has been opened. - - - - - Saving tags ... - - - - - No file has been opened. - - - - - Unable to apply the entered tags to the file because the current process hasn't finished yet. - - - - - Do you really want to delete all tags from the file? - - - - - don't show this message again - - - - - Deleting all tags ... - - - - - The selected file stores no tag (at least no supported), so there is nothing to delete. - - - - - No file has been opened, so no tags can be deleted. - - - - - Unable to delete all tags from the file because the current process hasn't been finished yet. - - - - - Cancelling ... - - - - - Unable to start saving process because there an other process hasn't finished yet. - - - - - The tags have been saved, but there is/are %1 warning(s) - - The tags have been saved, but there is %1 warning - The tags have been saved, but there are %1 warnings - - - - - and %1 error(s). - - - - - - - - The tags have been saved, but there is/are %1 warning(s). - - The tags have been saved, but there is %1 warning. - The tags have been saved, but there are %1 warnings. - - - - - The tags have been saved. - - - - - The tags couldn't be saved. See the info box for detail. - - - - - The tags couldn't be saved because an IO error occured. - - - - - Automatic tag management - - - - - The container format of the selected file is not supported. The file can be treated as MP3 file (an ID3 tag according to the settings will be created). This might break the file. Do you want to continue? - - - - - Treat file as MP3 file - - - - - The currently opened file changed on the disk. - - - - - A tag (with the selected target) already exists. - - - - - The tag can not be created. - - - - - Unable to remove the tag because no file is opened. - - - - - Unable to remove the tag because the current process hasn't been finished yet. - - - - - Unable to change the target because no file is opened. - - - - - Can not change the target of the selected tag because the tag does not support targets. - - - - - Unable to change the target because the current process hasn't been finished yet. - - No file selected @@ -2940,7 +2596,7 @@ the file reverting all unsaved changings. - + Abort @@ -3004,15 +2660,300 @@ the file reverting all unsaved changings. Manage tags automatically when loading file + + + Add tag + + + + + Remove tag + + + + + Change target + + + + + Segment %1 + + + + + Attachments + + + + + Matroska tag + + + + + MP4/iTunes tag + + + + + + Vorbis comment + + + + + Tag + + + + + ID3v1 tag + + + + + ID3v2 tag + + + + + + Copy + + + + + Expand all + + + + + Collapse all + + + + + The file is beeing parsed ... + + + + + Unable to load the selected file "%1" because the current process hasn't finished yet. + + + + + Currently is not file opened. + + + + + Unable to reload the file because the current process hasn't finished yet. + + + + + The file could not be opened because an IO error occurred. + + + + + File could be parsed correctly. + + + + + File couldn't be parsed correctly. + + + + + There are critical parsing notifications. + + + + + There are warnings. + + + + + No write access; the file has been opened in read-only mode. + + + + + File format is not supported (an ID3 tag can be added anyways). + + + + + The file is composed of multiple segments. Dealing with such files has not been tested yet and might be broken. + + + + + There is no (supported) tag assigned. + + + + + The file %1 has been opened. + + + + + Saving tags ... + + + + + No file has been opened. + + + + + Unable to apply the entered tags to the file because the current process hasn't finished yet. + + + + + Do you really want to delete all tags from the file? + + + + + don't show this message again + + + + + Deleting all tags ... + + + + + The selected file stores no tag (at least no supported), so there is nothing to delete. + + + + + No file has been opened, so no tags can be deleted. + + + + + Unable to delete all tags from the file because the current process hasn't been finished yet. + + + + + Cancelling ... + + + + + Unable to start saving process because there an other process hasn't finished yet. + + + + + The tags have been saved, but there is/are %1 warning(s) + + + + + + + + and %1 error(s). + + + + + + + + The tags have been saved, but there is/are %1 warning(s). + + + + + + + + The tags have been saved. + + + + + The tags couldn't be saved. See the info box for detail. + + + + + The tags couldn't be saved because an IO error occured. + + + + + Automatic tag management + + + + + The container format of the selected file is not supported. The file can be treated as MP3 file (an ID3 tag according to the settings will be created). This might break the file. Do you want to continue? + + + + + Treat file as MP3 file + + + + + The currently opened file changed on the disk. + + + + + A tag (with the selected target) already exists. + + + + + The tag can not be created. + + + + + Unable to remove the tag because no file is opened. + + + + + Unable to remove the tag because the current process hasn't been finished yet. + + + + + Unable to change the target because no file is opened. + + + + + Can not change the target of the selected tag because the tag does not support targets. + + + + + Unable to change the target because the current process hasn't been finished yet. + + QtGui::TagFieldEdit - - - - Necessary for lupdate. - - @@ -4059,7 +4000,7 @@ the file reverting all unsaved changings. <span style="font-weight: bold;">Automatic tag management</span> -<br>If enabled, appropriate tags will be created and removed according to the settings automatically when opening a file. Otherwise you have to do this manually and settings like ID3 usage have no effect. +<br>If enabled, appropriate tags will be created and removed according to the settings automatically when opening a file. Otherwise you have to do this manually (eg. adding an ID3 tag if none is present yet) and settings like ID3 usage have no effect. @@ -4068,6 +4009,32 @@ the file reverting all unsaved changings. + + QtGui::TagProcessingTargetsOptionPage + + + Targets + + + + + Target levels to be added when opening a file + + + + + <html> +<head/> +<body> +Remarks +<ul style="margin-left: -20px; margin-top: -3px; text-indent: 0px "> +<li>It is ensured that at least one tag for each selected target level is present when opening a file.</li> +<li>Has no effect if automatic tag management is disabled.</li> +<li>Has no effect when targets are not supported by the file format.</li> +<ul></body></html> + + + RenamingUtility::FileSystemItem @@ -4112,12 +4079,6 @@ the file reverting all unsaved changings. RenamingUtility::RemamingEngine - - - - Necessary for lupdate. - - Program is not callable. @@ -4234,19 +4195,10 @@ the file reverting all unsaved changings. - - RenamingUtility::ScriptFunctions - - - - Necessary for lupdate. - - - Settings::KnownFieldModel - + Necessary for lupdate. @@ -4392,9 +4344,68 @@ the file reverting all unsaved changings. - + Field + + Settings::TargetLevelModel + + + + Necessary for lupdate. + + + + + unspecified, everything + + + + + shot + + + + + subtrack, part, movement, scene + + + + + track, song, chapter + + + + + part, session + + + + + album, opera, concert, movie, episode + + + + + edition, issue, volume, opus, season, sequel + + + + + collection + + + + + unknown + + + + + Target level + + +