Adapt to changes in c++utilities
This commit is contained in:
parent
f70941a262
commit
66c9250246
|
@ -5,7 +5,7 @@
|
|||
using namespace TagParser;
|
||||
|
||||
#if defined(TAGEDITOR_GUI_QTWIDGETS) || defined(TAGEDITOR_GUI_QTQUICK)
|
||||
using namespace Models;
|
||||
using namespace QtUtilities;
|
||||
#else
|
||||
#define QT_TR_NOOP(x) x
|
||||
#endif
|
||||
|
@ -133,7 +133,7 @@ KnownFieldModel::KnownFieldModel(QObject *parent, DefaultSelection defaultSelect
|
|||
// clang-format on
|
||||
}
|
||||
|
||||
KnownFieldModel::KnownFieldModel(const QList<Models::ChecklistItem> &items, QObject *parent)
|
||||
KnownFieldModel::KnownFieldModel(const QList<ChecklistItem> &items, QObject *parent)
|
||||
: ChecklistModel(parent)
|
||||
{
|
||||
setItems(items);
|
||||
|
|
|
@ -11,14 +11,14 @@
|
|||
#endif
|
||||
|
||||
namespace TagParser {
|
||||
DECLARE_ENUM_CLASS(KnownField, unsigned int);
|
||||
enum class KnownField : unsigned int;
|
||||
}
|
||||
|
||||
namespace Settings {
|
||||
|
||||
class KnownFieldModel
|
||||
#if defined(TAGEDITOR_GUI_QTWIDGETS) || defined(TAGEDITOR_GUI_QTQUICK)
|
||||
: public Models::ChecklistModel
|
||||
: public QtUtilities::ChecklistModel
|
||||
#endif
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -29,10 +29,10 @@ public:
|
|||
|
||||
#if defined(TAGEDITOR_GUI_QTWIDGETS) || defined(TAGEDITOR_GUI_QTQUICK)
|
||||
static QString translatedFieldName(TagParser::KnownField field);
|
||||
static Models::ChecklistItem mkItem(TagParser::KnownField field, Qt::CheckState checkState = Qt::Checked);
|
||||
static QtUtilities::ChecklistItem mkItem(TagParser::KnownField field, Qt::CheckState checkState = Qt::Checked);
|
||||
|
||||
explicit KnownFieldModel(QObject *parent = nullptr, DefaultSelection defaultSelection = DefaultSelection::None);
|
||||
explicit KnownFieldModel(const QList<Models::ChecklistItem> &items, QObject *parent = nullptr);
|
||||
explicit KnownFieldModel(const QList<QtUtilities::ChecklistItem> &items, QObject *parent = nullptr);
|
||||
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||
QString labelForId(const QVariant &id) const override;
|
||||
|
@ -40,9 +40,9 @@ public:
|
|||
};
|
||||
|
||||
#if defined(TAGEDITOR_GUI_QTWIDGETS) || defined(TAGEDITOR_GUI_QTQUICK)
|
||||
inline Models::ChecklistItem KnownFieldModel::mkItem(TagParser::KnownField field, Qt::CheckState checkState)
|
||||
inline QtUtilities::ChecklistItem KnownFieldModel::mkItem(TagParser::KnownField field, Qt::CheckState checkState)
|
||||
{
|
||||
return Models::ChecklistItem(static_cast<int>(field), translatedFieldName(field), checkState);
|
||||
return QtUtilities::ChecklistItem(static_cast<int>(field), translatedFieldName(field), checkState);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@
|
|||
#include <c++utilities/application/fakeqtconfigarguments.h>
|
||||
#endif
|
||||
#include <c++utilities/application/commandlineutils.h>
|
||||
#include <c++utilities/application/failure.h>
|
||||
#include <c++utilities/misc/parseerror.h>
|
||||
|
||||
#include <functional>
|
||||
#include <iostream>
|
||||
|
@ -21,7 +21,8 @@
|
|||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
using namespace ApplicationUtilities;
|
||||
using namespace CppUtilities;
|
||||
using namespace QtUtilities;
|
||||
|
||||
namespace Cli {
|
||||
|
||||
|
@ -203,13 +204,13 @@ int main(int argc, char *argv[])
|
|||
parser.setMainArguments({ &qtConfigArgs.qtWidgetsGuiArg(), &printFieldNamesArg, &displayFileInfoArg, &displayTagInfoArg,
|
||||
&setTagInfoArgs.setTagInfoArg, &extractFieldArg, &exportArg, &genInfoArg, &timeSpanFormatArg, &noColorArg, &helpArg });
|
||||
// parse given arguments
|
||||
parser.parseArgsExt(argc, argv, ParseArgumentBehavior::CheckConstraints | ParseArgumentBehavior::ExitOnFailure);
|
||||
parser.parseArgs(argc, argv, ParseArgumentBehavior::CheckConstraints | ParseArgumentBehavior::ExitOnFailure);
|
||||
|
||||
// start GUI/CLI
|
||||
if (qtConfigArgs.areQtGuiArgsPresent()) {
|
||||
#if defined(TAGEDITOR_GUI_QTWIDGETS)
|
||||
return QtGui::runWidgetsGui(argc, argv, qtConfigArgs,
|
||||
defaultFileArg.isPresent() && !defaultFileArg.values().empty() ? ConversionUtilities::fromNativeFileName(defaultFileArg.values().front())
|
||||
defaultFileArg.isPresent() && !defaultFileArg.values().empty() ? fromNativeFileName(defaultFileArg.values().front())
|
||||
: QString(),
|
||||
renamingUtilityArg.isPresent());
|
||||
#else
|
||||
|
|
|
@ -12,6 +12,7 @@
|
|||
#include <QFile>
|
||||
#include <QSettings>
|
||||
|
||||
using namespace QtUtilities;
|
||||
using namespace TagParser;
|
||||
|
||||
namespace Settings {
|
||||
|
@ -28,7 +29,7 @@ Editor::Editor()
|
|||
}
|
||||
|
||||
DbQuery::DbQuery()
|
||||
: fields(QList<Models::ChecklistItem>() << KnownFieldModel::mkItem(KnownField::Title) << KnownFieldModel::mkItem(KnownField::TrackPosition)
|
||||
: fields(QList<ChecklistItem>() << KnownFieldModel::mkItem(KnownField::Title) << KnownFieldModel::mkItem(KnownField::TrackPosition)
|
||||
<< KnownFieldModel::mkItem(KnownField::DiskPosition) << KnownFieldModel::mkItem(KnownField::Album)
|
||||
<< KnownFieldModel::mkItem(KnownField::Artist) << KnownFieldModel::mkItem(KnownField::Year)
|
||||
<< KnownFieldModel::mkItem(KnownField::Genre) << KnownFieldModel::mkItem(KnownField::Cover, Qt::Unchecked)
|
||||
|
@ -63,7 +64,7 @@ void restore()
|
|||
default:
|
||||
v.editor.adoptFields = AdoptFields::Never;
|
||||
break;
|
||||
};
|
||||
}
|
||||
v.editor.saveAndShowNextOnEnter = settings.value(QStringLiteral("saveandshownextonenter"), false).toBool();
|
||||
v.editor.askBeforeDeleting = settings.value(QStringLiteral("askbeforedeleting"), true).toBool();
|
||||
switch (settings.value(QStringLiteral("multipletaghandling"), 0).toInt()) {
|
||||
|
@ -113,14 +114,14 @@ void restore()
|
|||
break;
|
||||
default:
|
||||
v.tagPocessing.preferredEncoding = TagParser::TagTextEncoding::Utf8;
|
||||
};
|
||||
}
|
||||
switch (settings.value(QStringLiteral("unsupportedfieldhandling"), 0).toInt()) {
|
||||
case 1:
|
||||
v.tagPocessing.unsupportedFieldHandling = UnsupportedFieldHandling::Discard;
|
||||
break;
|
||||
default:
|
||||
v.tagPocessing.unsupportedFieldHandling = UnsupportedFieldHandling::Ignore;
|
||||
};
|
||||
}
|
||||
v.tagPocessing.autoTagManagement = settings.value(QStringLiteral("autotagmanagement"), true).toBool();
|
||||
settings.beginGroup(QStringLiteral("id3v1"));
|
||||
switch (settings.value(QStringLiteral("usage"), 0).toInt()) {
|
||||
|
@ -133,7 +134,7 @@ void restore()
|
|||
default:
|
||||
v.tagPocessing.creationSettings.id3v1usage = TagUsage::Always;
|
||||
break;
|
||||
};
|
||||
}
|
||||
settings.endGroup();
|
||||
settings.beginGroup(QStringLiteral("id3v2"));
|
||||
switch (settings.value(QStringLiteral("usage"), 0).toInt()) {
|
||||
|
@ -145,7 +146,7 @@ void restore()
|
|||
break;
|
||||
default:
|
||||
v.tagPocessing.creationSettings.id3v2usage = TagUsage::Always;
|
||||
};
|
||||
}
|
||||
v.tagPocessing.creationSettings.id3v2MajorVersion = static_cast<std::uint8_t>(settings.value(QStringLiteral("versiontobeused")).toUInt());
|
||||
if (v.tagPocessing.creationSettings.id3v2MajorVersion < 1 || v.tagPocessing.creationSettings.id3v2MajorVersion > 4) {
|
||||
v.tagPocessing.creationSettings.id3v2MajorVersion = 3;
|
||||
|
|
|
@ -105,7 +105,7 @@ struct Settings {
|
|||
MainWindow mainWindow;
|
||||
DbQuery dbQuery;
|
||||
RenamingUtility renamingUtility;
|
||||
Dialogs::QtSettings qt;
|
||||
QtUtilities::QtSettings qt;
|
||||
};
|
||||
|
||||
Settings &values();
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
#include <tagparser/tagtarget.h>
|
||||
|
||||
using namespace Models;
|
||||
using namespace QtUtilities;
|
||||
using namespace TagParser;
|
||||
|
||||
namespace Settings {
|
||||
|
@ -63,7 +63,7 @@ TargetLevelModel::TargetLevelModel(QObject *parent, DefaultSelection defaultSele
|
|||
setItems(items);
|
||||
}
|
||||
|
||||
TargetLevelModel::TargetLevelModel(const QList<Models::ChecklistItem> &items, QObject *parent)
|
||||
TargetLevelModel::TargetLevelModel(const QList<ChecklistItem> &items, QObject *parent)
|
||||
: ChecklistModel(parent)
|
||||
{
|
||||
setItems(items);
|
||||
|
|
|
@ -7,30 +7,30 @@
|
|||
#include <QList>
|
||||
|
||||
namespace TagParser {
|
||||
DECLARE_ENUM_CLASS(TagTargetLevel, unsigned char);
|
||||
enum class TagTargetLevel : unsigned char;
|
||||
}
|
||||
|
||||
namespace Settings {
|
||||
|
||||
class TargetLevelModel : public Models::ChecklistModel {
|
||||
class TargetLevelModel : public QtUtilities::ChecklistModel {
|
||||
Q_OBJECT
|
||||
public:
|
||||
enum class DefaultSelection { None, MostUsefulTargets };
|
||||
|
||||
static const char *fieldName(TagParser::TagTargetLevel targetLevel);
|
||||
static QString translatedFieldName(TagParser::TagTargetLevel targetLevel);
|
||||
static Models::ChecklistItem mkItem(TagParser::TagTargetLevel targetLevel, Qt::CheckState checkState = Qt::Checked);
|
||||
static QtUtilities::ChecklistItem mkItem(TagParser::TagTargetLevel targetLevel, Qt::CheckState checkState = Qt::Checked);
|
||||
|
||||
explicit TargetLevelModel(QObject *parent = nullptr, DefaultSelection defaultSelection = DefaultSelection::None);
|
||||
explicit TargetLevelModel(const QList<Models::ChecklistItem> &items, QObject *parent = nullptr);
|
||||
explicit TargetLevelModel(const QList<QtUtilities::ChecklistItem> &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(TagParser::TagTargetLevel field, Qt::CheckState checkState)
|
||||
inline QtUtilities::ChecklistItem TargetLevelModel::mkItem(TagParser::TagTargetLevel field, Qt::CheckState checkState)
|
||||
{
|
||||
return Models::ChecklistItem(static_cast<int>(field), translatedFieldName(field), checkState);
|
||||
return QtUtilities::ChecklistItem(static_cast<int>(field), translatedFieldName(field), checkState);
|
||||
}
|
||||
|
||||
} // namespace Settings
|
||||
|
|
|
@ -11,7 +11,7 @@
|
|||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
using namespace ConversionUtilities;
|
||||
using namespace CppUtilities;
|
||||
using namespace TagParser;
|
||||
|
||||
namespace Cli {
|
||||
|
|
|
@ -21,16 +21,14 @@
|
|||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
using namespace ApplicationUtilities;
|
||||
using namespace ConversionUtilities;
|
||||
using namespace ChronoUtilities;
|
||||
using namespace CppUtilities;
|
||||
using namespace CppUtilities::EscapeCodes;
|
||||
using namespace TagParser;
|
||||
using namespace Settings;
|
||||
using namespace EscapeCodes;
|
||||
|
||||
namespace Cli {
|
||||
|
||||
ChronoUtilities::TimeSpanOutputFormat timeSpanOutputFormat = TimeSpanOutputFormat::WithMeasures;
|
||||
CppUtilities::TimeSpanOutputFormat timeSpanOutputFormat = TimeSpanOutputFormat::WithMeasures;
|
||||
|
||||
/*!
|
||||
* \class InterruptHandler
|
||||
|
|
34
cli/helper.h
34
cli/helper.h
|
@ -16,7 +16,7 @@
|
|||
#include <unordered_map>
|
||||
#include <vector>
|
||||
|
||||
namespace ApplicationUtilities {
|
||||
namespace CppUtilities {
|
||||
class Argument;
|
||||
}
|
||||
|
||||
|
@ -252,20 +252,20 @@ constexpr bool isDigit(char c)
|
|||
std::string incremented(const std::string &str, unsigned int toIncrement = 1);
|
||||
|
||||
void printDiagMessages(const TagParser::Diagnostics &diag, const char *head = nullptr, bool beVerbose = false);
|
||||
void printProperty(const char *propName, const char *value, const char *suffix = nullptr, ApplicationUtilities::Indentation indentation = 4);
|
||||
void printProperty(const char *propName, const char *value, const char *suffix = nullptr, CppUtilities::Indentation indentation = 4);
|
||||
void printProperty(
|
||||
const char *propName, ElementPosition elementPosition, const char *suffix = nullptr, ApplicationUtilities::Indentation indentation = 4);
|
||||
const char *propName, ElementPosition elementPosition, const char *suffix = nullptr, CppUtilities::Indentation indentation = 4);
|
||||
|
||||
inline void printProperty(
|
||||
const char *propName, const std::string &value, const char *suffix = nullptr, ApplicationUtilities::Indentation indentation = 4)
|
||||
const char *propName, const std::string &value, const char *suffix = nullptr, CppUtilities::Indentation indentation = 4)
|
||||
{
|
||||
printProperty(propName, value.data(), suffix, indentation);
|
||||
}
|
||||
|
||||
extern ChronoUtilities::TimeSpanOutputFormat timeSpanOutputFormat;
|
||||
extern CppUtilities::TimeSpanOutputFormat timeSpanOutputFormat;
|
||||
|
||||
inline void printProperty(
|
||||
const char *propName, ChronoUtilities::TimeSpan timeSpan, const char *suffix = nullptr, ApplicationUtilities::Indentation indentation = 4)
|
||||
const char *propName, CppUtilities::TimeSpan timeSpan, const char *suffix = nullptr, CppUtilities::Indentation indentation = 4)
|
||||
{
|
||||
if (!timeSpan.isNull()) {
|
||||
printProperty(propName, timeSpan.toString(timeSpanOutputFormat), suffix, indentation);
|
||||
|
@ -273,35 +273,35 @@ inline void printProperty(
|
|||
}
|
||||
|
||||
inline void printProperty(
|
||||
const char *propName, ChronoUtilities::DateTime dateTime, const char *suffix = nullptr, ApplicationUtilities::Indentation indentation = 4)
|
||||
const char *propName, CppUtilities::DateTime dateTime, const char *suffix = nullptr, CppUtilities::Indentation indentation = 4)
|
||||
{
|
||||
if (!dateTime.isNull()) {
|
||||
printProperty(propName, dateTime.toString(), suffix, indentation);
|
||||
}
|
||||
}
|
||||
|
||||
template <typename NumberType, Traits::EnableIfAny<std::is_integral<NumberType>, std::is_floating_point<NumberType>> * = nullptr>
|
||||
template <typename NumberType, CppUtilities::Traits::EnableIfAny<std::is_integral<NumberType>, std::is_floating_point<NumberType>> * = nullptr>
|
||||
inline void printProperty(
|
||||
const char *propName, const NumberType value, const char *suffix = nullptr, bool force = false, ApplicationUtilities::Indentation indentation = 4)
|
||||
const char *propName, const NumberType value, const char *suffix = nullptr, bool force = false, CppUtilities::Indentation indentation = 4)
|
||||
{
|
||||
if (value != 0 || force) {
|
||||
printProperty(propName, ConversionUtilities::numberToString<NumberType>(value), suffix, indentation);
|
||||
printProperty(propName, CppUtilities::numberToString<NumberType>(value), suffix, indentation);
|
||||
}
|
||||
}
|
||||
|
||||
void printField(const FieldScope &scope, const Tag *tag, TagType tagType, bool skipEmpty);
|
||||
void printNativeFields(const Tag *tag);
|
||||
|
||||
ChronoUtilities::TimeSpanOutputFormat parseTimeSpanOutputFormat(
|
||||
const ApplicationUtilities::Argument &usageArg, ChronoUtilities::TimeSpanOutputFormat defaultFormat);
|
||||
TagUsage parseUsageDenotation(const ApplicationUtilities::Argument &usageArg, TagUsage defaultUsage);
|
||||
TagTextEncoding parseEncodingDenotation(const ApplicationUtilities::Argument &encodingArg, TagTextEncoding defaultEncoding);
|
||||
CppUtilities::TimeSpanOutputFormat parseTimeSpanOutputFormat(
|
||||
const CppUtilities::Argument &usageArg, CppUtilities::TimeSpanOutputFormat defaultFormat);
|
||||
TagUsage parseUsageDenotation(const CppUtilities::Argument &usageArg, TagUsage defaultUsage);
|
||||
TagTextEncoding parseEncodingDenotation(const CppUtilities::Argument &encodingArg, TagTextEncoding defaultEncoding);
|
||||
ElementPosition parsePositionDenotation(
|
||||
const ApplicationUtilities::Argument &posArg, const ApplicationUtilities::Argument &valueArg, ElementPosition defaultPos);
|
||||
std::uint64_t parseUInt64(const ApplicationUtilities::Argument &arg, std::uint64_t defaultValue);
|
||||
const CppUtilities::Argument &posArg, const CppUtilities::Argument &valueArg, ElementPosition defaultPos);
|
||||
std::uint64_t parseUInt64(const CppUtilities::Argument &arg, std::uint64_t defaultValue);
|
||||
TagTarget::IdContainerType parseIds(const std::string &concatenatedIds);
|
||||
bool applyTargetConfiguration(TagTarget &target, const std::string &configStr);
|
||||
FieldDenotations parseFieldDenotations(const ApplicationUtilities::Argument &fieldsArg, bool readOnly);
|
||||
FieldDenotations parseFieldDenotations(const CppUtilities::Argument &fieldsArg, bool readOnly);
|
||||
std::string tagName(const Tag *tag);
|
||||
bool stringToBool(const std::string &str);
|
||||
extern bool logLineFinalized;
|
||||
|
|
11
cli/json.cpp
11
cli/json.cpp
|
@ -9,6 +9,7 @@
|
|||
#include <c++utilities/conversion/stringconversion.h>
|
||||
|
||||
using namespace std;
|
||||
using namespace CppUtilities;
|
||||
using namespace TagParser;
|
||||
|
||||
namespace ReflectiveRapidJSON {
|
||||
|
@ -74,22 +75,22 @@ TagValue::TagValue(const TagParser::TagValue &tagValue, RAPIDJSON_NAMESPACE::Doc
|
|||
break;
|
||||
case TagDataType::Picture:
|
||||
if (tagValue.dataSize() > (1024 * 1024)) {
|
||||
throw ConversionUtilities::ConversionException("size is too big");
|
||||
throw ConversionException("size is too big");
|
||||
}
|
||||
ReflectiveRapidJSON::JsonReflector::push(ConversionUtilities::encodeBase64(reinterpret_cast<const std::uint8_t *>(tagValue.dataPointer()), static_cast<std::uint32_t>(tagValue.dataSize())), value, allocator);
|
||||
ReflectiveRapidJSON::JsonReflector::push(encodeBase64(reinterpret_cast<const std::uint8_t *>(tagValue.dataPointer()), static_cast<std::uint32_t>(tagValue.dataSize())), value, allocator);
|
||||
kind = "picture";
|
||||
break;
|
||||
case TagDataType::Binary:
|
||||
if (tagValue.dataSize() > (1024 * 1024)) {
|
||||
throw ConversionUtilities::ConversionException("size is too big");
|
||||
throw ConversionException("size is too big");
|
||||
}
|
||||
ReflectiveRapidJSON::JsonReflector::push(ConversionUtilities::encodeBase64(reinterpret_cast<const std::uint8_t *>(tagValue.dataPointer()), static_cast<std::uint32_t>(tagValue.dataSize())), value, allocator);
|
||||
ReflectiveRapidJSON::JsonReflector::push(encodeBase64(reinterpret_cast<const std::uint8_t *>(tagValue.dataPointer()), static_cast<std::uint32_t>(tagValue.dataSize())), value, allocator);
|
||||
kind = "binary";
|
||||
break;
|
||||
default:
|
||||
value.SetNull();
|
||||
}
|
||||
} catch (const ConversionUtilities::ConversionException &e) {
|
||||
} catch (const ConversionException &e) {
|
||||
ReflectiveRapidJSON::JsonReflector::push(string(e.what()), value, allocator);
|
||||
kind = "error";
|
||||
}
|
||||
|
|
|
@ -55,7 +55,7 @@ struct FileInfo : ReflectiveRapidJSON::JsonSerializable<FileInfo> {
|
|||
const char *mimeType;
|
||||
std::vector<TagInfo> tags;
|
||||
std::string formatSummary;
|
||||
ChronoUtilities::TimeSpan duration;
|
||||
CppUtilities::TimeSpan duration;
|
||||
};
|
||||
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@
|
|||
#endif
|
||||
|
||||
#include <c++utilities/application/commandlineutils.h>
|
||||
#include <c++utilities/application/failure.h>
|
||||
#include <c++utilities/misc/parseerror.h>
|
||||
#include <c++utilities/conversion/conversionexception.h>
|
||||
#include <c++utilities/conversion/stringbuilder.h>
|
||||
#include <c++utilities/conversion/stringconversion.h>
|
||||
|
@ -53,15 +53,12 @@
|
|||
#include <memory>
|
||||
|
||||
using namespace std;
|
||||
using namespace ApplicationUtilities;
|
||||
using namespace ConversionUtilities;
|
||||
using namespace ChronoUtilities;
|
||||
using namespace IoUtilities;
|
||||
using namespace EscapeCodes;
|
||||
using namespace CppUtilities;
|
||||
using namespace CppUtilities::EscapeCodes;
|
||||
using namespace Settings;
|
||||
using namespace TagParser;
|
||||
#if defined(TAGEDITOR_GUI_QTWIDGETS) || defined(TAGEDITOR_GUI_QTQUICK)
|
||||
using namespace Utility;
|
||||
using namespace QtUtilities;
|
||||
#endif
|
||||
|
||||
namespace Cli {
|
||||
|
|
|
@ -3,64 +3,64 @@
|
|||
|
||||
#include <c++utilities/application/argumentparser.h>
|
||||
|
||||
namespace ApplicationUtilities {
|
||||
namespace CppUtilities {
|
||||
class Argument;
|
||||
}
|
||||
|
||||
namespace Cli {
|
||||
|
||||
struct SetTagInfoArgs {
|
||||
SetTagInfoArgs(ApplicationUtilities::Argument &filesArg, ApplicationUtilities::Argument &verboseArg);
|
||||
ApplicationUtilities::Argument &filesArg;
|
||||
ApplicationUtilities::Argument &verboseArg;
|
||||
ApplicationUtilities::ConfigValueArgument docTitleArg;
|
||||
ApplicationUtilities::ConfigValueArgument removeOtherFieldsArg;
|
||||
ApplicationUtilities::ConfigValueArgument treatUnknownFilesAsMp3FilesArg;
|
||||
ApplicationUtilities::ConfigValueArgument id3v1UsageArg;
|
||||
ApplicationUtilities::ConfigValueArgument id3v2UsageArg;
|
||||
ApplicationUtilities::ConfigValueArgument mergeMultipleSuccessiveTagsArg;
|
||||
ApplicationUtilities::ConfigValueArgument id3v2VersionArg;
|
||||
ApplicationUtilities::ConfigValueArgument id3InitOnCreateArg;
|
||||
ApplicationUtilities::ConfigValueArgument id3TransferOnRemovalArg;
|
||||
ApplicationUtilities::ConfigValueArgument encodingArg;
|
||||
ApplicationUtilities::ConfigValueArgument removeTargetArg;
|
||||
ApplicationUtilities::ConfigValueArgument addAttachmentArg;
|
||||
ApplicationUtilities::ConfigValueArgument updateAttachmentArg;
|
||||
ApplicationUtilities::ConfigValueArgument removeAttachmentArg;
|
||||
ApplicationUtilities::ConfigValueArgument removeExistingAttachmentsArg;
|
||||
ApplicationUtilities::ConfigValueArgument minPaddingArg;
|
||||
ApplicationUtilities::ConfigValueArgument maxPaddingArg;
|
||||
ApplicationUtilities::ConfigValueArgument prefPaddingArg;
|
||||
ApplicationUtilities::ConfigValueArgument tagPosValueArg;
|
||||
ApplicationUtilities::ConfigValueArgument forceTagPosArg;
|
||||
ApplicationUtilities::ConfigValueArgument tagPosArg;
|
||||
ApplicationUtilities::ConfigValueArgument indexPosValueArg;
|
||||
ApplicationUtilities::ConfigValueArgument forceIndexPosArg;
|
||||
ApplicationUtilities::ConfigValueArgument indexPosArg;
|
||||
ApplicationUtilities::ConfigValueArgument forceRewriteArg;
|
||||
ApplicationUtilities::ConfigValueArgument valuesArg;
|
||||
ApplicationUtilities::ConfigValueArgument outputFilesArg;
|
||||
ApplicationUtilities::ConfigValueArgument backupDirArg;
|
||||
ApplicationUtilities::ConfigValueArgument layoutOnlyArg;
|
||||
ApplicationUtilities::OperationArgument setTagInfoArg;
|
||||
SetTagInfoArgs(CppUtilities::Argument &filesArg, CppUtilities::Argument &verboseArg);
|
||||
CppUtilities::Argument &filesArg;
|
||||
CppUtilities::Argument &verboseArg;
|
||||
CppUtilities::ConfigValueArgument docTitleArg;
|
||||
CppUtilities::ConfigValueArgument removeOtherFieldsArg;
|
||||
CppUtilities::ConfigValueArgument treatUnknownFilesAsMp3FilesArg;
|
||||
CppUtilities::ConfigValueArgument id3v1UsageArg;
|
||||
CppUtilities::ConfigValueArgument id3v2UsageArg;
|
||||
CppUtilities::ConfigValueArgument mergeMultipleSuccessiveTagsArg;
|
||||
CppUtilities::ConfigValueArgument id3v2VersionArg;
|
||||
CppUtilities::ConfigValueArgument id3InitOnCreateArg;
|
||||
CppUtilities::ConfigValueArgument id3TransferOnRemovalArg;
|
||||
CppUtilities::ConfigValueArgument encodingArg;
|
||||
CppUtilities::ConfigValueArgument removeTargetArg;
|
||||
CppUtilities::ConfigValueArgument addAttachmentArg;
|
||||
CppUtilities::ConfigValueArgument updateAttachmentArg;
|
||||
CppUtilities::ConfigValueArgument removeAttachmentArg;
|
||||
CppUtilities::ConfigValueArgument removeExistingAttachmentsArg;
|
||||
CppUtilities::ConfigValueArgument minPaddingArg;
|
||||
CppUtilities::ConfigValueArgument maxPaddingArg;
|
||||
CppUtilities::ConfigValueArgument prefPaddingArg;
|
||||
CppUtilities::ConfigValueArgument tagPosValueArg;
|
||||
CppUtilities::ConfigValueArgument forceTagPosArg;
|
||||
CppUtilities::ConfigValueArgument tagPosArg;
|
||||
CppUtilities::ConfigValueArgument indexPosValueArg;
|
||||
CppUtilities::ConfigValueArgument forceIndexPosArg;
|
||||
CppUtilities::ConfigValueArgument indexPosArg;
|
||||
CppUtilities::ConfigValueArgument forceRewriteArg;
|
||||
CppUtilities::ConfigValueArgument valuesArg;
|
||||
CppUtilities::ConfigValueArgument outputFilesArg;
|
||||
CppUtilities::ConfigValueArgument backupDirArg;
|
||||
CppUtilities::ConfigValueArgument layoutOnlyArg;
|
||||
CppUtilities::OperationArgument setTagInfoArg;
|
||||
};
|
||||
|
||||
extern const char *const fieldNames;
|
||||
extern const char *const fieldNamesForSet;
|
||||
void applyGeneralConfig(const ApplicationUtilities::Argument &timeSapnFormatArg);
|
||||
void printFieldNames(const ApplicationUtilities::ArgumentOccurrence &occurrence);
|
||||
void displayFileInfo(const ApplicationUtilities::ArgumentOccurrence &, const ApplicationUtilities::Argument &filesArg,
|
||||
const ApplicationUtilities::Argument &verboseArg);
|
||||
void generateFileInfo(const ApplicationUtilities::ArgumentOccurrence &, const ApplicationUtilities::Argument &inputFileArg,
|
||||
const ApplicationUtilities::Argument &outputFileArg, const ApplicationUtilities::Argument &validateArg);
|
||||
void displayTagInfo(const ApplicationUtilities::Argument &fieldsArg, const ApplicationUtilities::Argument &showUnsupportedArg,
|
||||
const ApplicationUtilities::Argument &filesArg, const ApplicationUtilities::Argument &verboseArg);
|
||||
void applyGeneralConfig(const CppUtilities::Argument &timeSapnFormatArg);
|
||||
void printFieldNames(const CppUtilities::ArgumentOccurrence &occurrence);
|
||||
void displayFileInfo(const CppUtilities::ArgumentOccurrence &, const CppUtilities::Argument &filesArg,
|
||||
const CppUtilities::Argument &verboseArg);
|
||||
void generateFileInfo(const CppUtilities::ArgumentOccurrence &, const CppUtilities::Argument &inputFileArg,
|
||||
const CppUtilities::Argument &outputFileArg, const CppUtilities::Argument &validateArg);
|
||||
void displayTagInfo(const CppUtilities::Argument &fieldsArg, const CppUtilities::Argument &showUnsupportedArg,
|
||||
const CppUtilities::Argument &filesArg, const CppUtilities::Argument &verboseArg);
|
||||
void setTagInfo(const Cli::SetTagInfoArgs &args);
|
||||
void extractField(const ApplicationUtilities::Argument &fieldArg, const ApplicationUtilities::Argument &attachmentArg,
|
||||
const ApplicationUtilities::Argument &inputFilesArg, const ApplicationUtilities::Argument &outputFileArg,
|
||||
const ApplicationUtilities::Argument &verboseArg);
|
||||
void exportToJson(const ApplicationUtilities::ArgumentOccurrence &, const ApplicationUtilities::Argument &filesArg,
|
||||
const ApplicationUtilities::Argument &prettyArg);
|
||||
void extractField(const CppUtilities::Argument &fieldArg, const CppUtilities::Argument &attachmentArg,
|
||||
const CppUtilities::Argument &inputFilesArg, const CppUtilities::Argument &outputFileArg,
|
||||
const CppUtilities::Argument &verboseArg);
|
||||
void exportToJson(const CppUtilities::ArgumentOccurrence &, const CppUtilities::Argument &filesArg,
|
||||
const CppUtilities::Argument &prettyArg);
|
||||
|
||||
} // namespace Cli
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@ QT_FORWARD_DECLARE_CLASS(QNetworkReply)
|
|||
|
||||
namespace TagParser {
|
||||
class TagValue;
|
||||
DECLARE_ENUM_CLASS(KnownField, unsigned int);
|
||||
enum class KnownField : unsigned int;
|
||||
} // namespace TagParser
|
||||
|
||||
namespace QtGui {
|
||||
|
|
|
@ -19,8 +19,8 @@
|
|||
#include <fstream>
|
||||
|
||||
using namespace std;
|
||||
using namespace IoUtilities;
|
||||
using namespace ConversionUtilities;
|
||||
using namespace CppUtilities;
|
||||
using namespace QtUtilities;
|
||||
using namespace TagParser;
|
||||
|
||||
namespace QtGui {
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
|
||||
#include <QApplication>
|
||||
|
||||
using namespace CppUtilities;
|
||||
using namespace TagParser;
|
||||
using namespace ConversionUtilities;
|
||||
|
||||
namespace QtGui {
|
||||
|
||||
|
|
|
@ -31,9 +31,8 @@
|
|||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
using namespace ConversionUtilities;
|
||||
using namespace Dialogs;
|
||||
using namespace Models;
|
||||
using namespace CppUtilities;
|
||||
using namespace QtUtilities;
|
||||
using namespace Settings;
|
||||
using namespace Utility;
|
||||
using namespace TagParser;
|
||||
|
|
|
@ -88,7 +88,7 @@
|
|||
<number>2</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="Widgets::ClearSpinBox" name="trackSpinBox">
|
||||
<widget class="QtUtilities::ClearSpinBox" name="trackSpinBox">
|
||||
<property name="minimumSize">
|
||||
<size>
|
||||
<width>60</width>
|
||||
|
@ -101,7 +101,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Widgets::ClearLineEdit" name="titleLineEdit">
|
||||
<widget class="QtUtilities::ClearLineEdit" name="titleLineEdit">
|
||||
<property name="placeholderText">
|
||||
<string>?</string>
|
||||
</property>
|
||||
|
@ -117,7 +117,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="Widgets::ClearLineEdit" name="albumLineEdit">
|
||||
<widget class="QtUtilities::ClearLineEdit" name="albumLineEdit">
|
||||
<property name="placeholderText">
|
||||
<string>?</string>
|
||||
</property>
|
||||
|
@ -131,7 +131,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="4" column="1">
|
||||
<widget class="Widgets::ClearLineEdit" name="artistLineEdit">
|
||||
<widget class="QtUtilities::ClearLineEdit" name="artistLineEdit">
|
||||
<property name="placeholderText">
|
||||
<string>?</string>
|
||||
</property>
|
||||
|
@ -411,7 +411,7 @@ row</string>
|
|||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Widgets::ClearLineEdit</class>
|
||||
<class>QtUtilities::ClearLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header location="global">qtutilities/widgets/clearlineedit.h</header>
|
||||
</customwidget>
|
||||
|
@ -422,7 +422,7 @@ row</string>
|
|||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Widgets::ClearSpinBox</class>
|
||||
<class>QtUtilities::ClearSpinBox</class>
|
||||
<extends>QSpinBox</extends>
|
||||
<header location="global">qtutilities/widgets/clearspinbox.h</header>
|
||||
</customwidget>
|
||||
|
|
|
@ -17,7 +17,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="Widgets::ClearLineEdit" name="musicBrainzUrlLineEdit">
|
||||
<widget class="QtUtilities::ClearLineEdit" name="musicBrainzUrlLineEdit">
|
||||
<property name="placeholderText">
|
||||
<string>https://musicbrainz.org/ws/2</string>
|
||||
</property>
|
||||
|
@ -31,7 +31,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="Widgets::ClearLineEdit" name="coverArtArchiveUrlLineEdit">
|
||||
<widget class="QtUtilities::ClearLineEdit" name="coverArtArchiveUrlLineEdit">
|
||||
<property name="placeholderText">
|
||||
<string>http://coverartarchive.org</string>
|
||||
</property>
|
||||
|
@ -55,7 +55,7 @@
|
|||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Widgets::ClearLineEdit</class>
|
||||
<class>QtUtilities::ClearLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header location="global">qtutilities/widgets/clearlineedit.h</header>
|
||||
</customwidget>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Widgets::PathSelection" name="directoryWidget" native="true"/>
|
||||
<widget class="QtUtilities::PathSelection" name="directoryWidget" native="true"/>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="NotificationLabel" name="notificationLabel" native="true"/>
|
||||
|
@ -50,7 +50,7 @@
|
|||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Widgets::PathSelection</class>
|
||||
<class>QtUtilities::PathSelection</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">qtutilities/widgets/pathselection.h</header>
|
||||
<container>1</container>
|
||||
|
|
|
@ -15,8 +15,8 @@
|
|||
#include <QMessageBox>
|
||||
|
||||
using namespace std;
|
||||
using namespace Models;
|
||||
using namespace Dialogs;
|
||||
using namespace CppUtilities;
|
||||
using namespace QtUtilities;
|
||||
using namespace TagParser;
|
||||
|
||||
namespace QtGui {
|
||||
|
|
|
@ -7,7 +7,7 @@
|
|||
|
||||
#include <memory>
|
||||
|
||||
namespace Models {
|
||||
namespace QtUtilities {
|
||||
class ChecklistModel;
|
||||
}
|
||||
|
||||
|
@ -38,10 +38,10 @@ private slots:
|
|||
|
||||
private:
|
||||
std::unique_ptr<Ui::EnterTargetDialog> m_ui;
|
||||
Models::ChecklistModel *m_tracksModel;
|
||||
Models::ChecklistModel *m_chaptersModel;
|
||||
Models::ChecklistModel *m_editionsModel;
|
||||
Models::ChecklistModel *m_attachmentsModel;
|
||||
QtUtilities::ChecklistModel *m_tracksModel;
|
||||
QtUtilities::ChecklistModel *m_chaptersModel;
|
||||
QtUtilities::ChecklistModel *m_editionsModel;
|
||||
QtUtilities::ChecklistModel *m_attachmentsModel;
|
||||
TagParser::ContainerFormat m_currentContainerFormat;
|
||||
};
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="Widgets::ClearLineEdit" name="levelNameLineEdit"/>
|
||||
<widget class="QtUtilities::ClearLineEdit" name="levelNameLineEdit"/>
|
||||
</item>
|
||||
<item row="4" column="0">
|
||||
<widget class="QLabel" name="tracksLabel">
|
||||
|
@ -185,7 +185,7 @@
|
|||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Widgets::ClearLineEdit</class>
|
||||
<class>QtUtilities::ClearLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header location="global">qtutilities/widgets/clearlineedit.h</header>
|
||||
</customwidget>
|
||||
|
|
|
@ -28,8 +28,8 @@
|
|||
#include <QStringBuilder>
|
||||
|
||||
using namespace std;
|
||||
using namespace ChronoUtilities;
|
||||
using namespace ConversionUtilities;
|
||||
using namespace CppUtilities;
|
||||
using namespace QtUtilities;
|
||||
using namespace TagParser;
|
||||
using namespace Utility;
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
ENABLE_QT_RESOURCES_OF_STATIC_DEPENDENCIES
|
||||
|
||||
using namespace ApplicationUtilities;
|
||||
using namespace CppUtilities;
|
||||
|
||||
namespace QtGui {
|
||||
|
||||
|
|
|
@ -5,14 +5,14 @@
|
|||
|
||||
QT_FORWARD_DECLARE_CLASS(QString)
|
||||
|
||||
namespace ApplicationUtilities {
|
||||
namespace CppUtilities {
|
||||
class QtConfigArguments;
|
||||
}
|
||||
|
||||
namespace QtGui {
|
||||
|
||||
int runWidgetsGui(
|
||||
int argc, char *argv[], const ApplicationUtilities::QtConfigArguments &qtConfigArgs, const QString &path, bool launchRenamingUtility = false);
|
||||
int argc, char *argv[], const CppUtilities::QtConfigArguments &qtConfigArgs, const QString &path, bool launchRenamingUtility = false);
|
||||
}
|
||||
|
||||
#endif // INITIATE_H
|
||||
|
|
|
@ -32,11 +32,8 @@
|
|||
|
||||
using namespace std;
|
||||
using namespace Utility;
|
||||
using namespace QtUtilities;
|
||||
using namespace TagParser;
|
||||
using namespace Dialogs;
|
||||
using namespace Widgets;
|
||||
using namespace ThreadingUtils;
|
||||
using namespace ConversionUtilities;
|
||||
|
||||
namespace QtGui {
|
||||
|
||||
|
@ -306,7 +303,7 @@ void MainWindow::handleFileStatusChange(bool opened, bool hasTag)
|
|||
m_ui->actionReload->setEnabled(opened);
|
||||
m_ui->actionExternalPlayer->setEnabled(opened);
|
||||
// window title
|
||||
setWindowTitle(Dialogs::generateWindowTitle(opened ? DocumentStatus::Saved : DocumentStatus::NoDocument, m_ui->tagEditorWidget->currentPath()));
|
||||
setWindowTitle(generateWindowTitle(opened ? DocumentStatus::Saved : DocumentStatus::NoDocument, m_ui->tagEditorWidget->currentPath()));
|
||||
}
|
||||
|
||||
/*!
|
||||
|
@ -335,7 +332,7 @@ void MainWindow::spawnExternalPlayer()
|
|||
{
|
||||
const QString ¤tPath = m_ui->tagEditorWidget->currentPath();
|
||||
if (!currentPath.isEmpty()) {
|
||||
DesktopUtils::openLocalFileOrDir(currentPath);
|
||||
openLocalFileOrDir(currentPath);
|
||||
} else {
|
||||
m_ui->statusBar->showMessage(tr("No file opened."));
|
||||
}
|
||||
|
@ -368,7 +365,7 @@ void MainWindow::toggleDbQueryWidget()
|
|||
void MainWindow::showAboutDlg()
|
||||
{
|
||||
if (!m_aboutDlg) {
|
||||
m_aboutDlg = new Dialogs::AboutDialog(this, tr("A tag editing utility supporting ID3, MP4 (iTunes style), Vorbis and Matroska tags."),
|
||||
m_aboutDlg = new AboutDialog(this, tr("A tag editing utility supporting ID3, MP4 (iTunes style), Vorbis and Matroska tags."),
|
||||
QImage(QStringLiteral(":/tageditor/icons/hicolor/128x128/apps/tageditor.png")));
|
||||
}
|
||||
if (m_aboutDlg->isHidden()) {
|
||||
|
|
|
@ -14,10 +14,10 @@ QT_FORWARD_DECLARE_CLASS(QFileSystemModel)
|
|||
QT_FORWARD_DECLARE_CLASS(QItemSelectionModel)
|
||||
|
||||
namespace TagParser {
|
||||
DECLARE_ENUM_CLASS(TagType, unsigned int);
|
||||
enum class TagType : unsigned int;
|
||||
}
|
||||
|
||||
namespace Dialogs {
|
||||
namespace QtUtilities {
|
||||
class AboutDialog;
|
||||
class SettingsDialog;
|
||||
} // namespace Dialogs
|
||||
|
@ -88,8 +88,8 @@ private:
|
|||
FileFilterProxyModel *m_fileFilterModel;
|
||||
bool m_internalFileSelection;
|
||||
// dialogs
|
||||
Dialogs::AboutDialog *m_aboutDlg;
|
||||
Dialogs::SettingsDialog *m_settingsDlg;
|
||||
QtUtilities::AboutDialog *m_aboutDlg;
|
||||
QtUtilities::SettingsDialog *m_settingsDlg;
|
||||
std::unique_ptr<RenameFilesDialog> m_renameFilesDlg;
|
||||
DbQueryWidget *m_dbQueryWidget;
|
||||
};
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
#include <QStyle>
|
||||
|
||||
using namespace std;
|
||||
using namespace ChronoUtilities;
|
||||
using namespace CppUtilities;
|
||||
using namespace TagParser;
|
||||
using namespace Utility;
|
||||
|
||||
|
|
|
@ -14,7 +14,7 @@
|
|||
#include <memory>
|
||||
|
||||
using namespace std;
|
||||
using namespace Widgets;
|
||||
using namespace QtUtilities;
|
||||
|
||||
namespace QtGui {
|
||||
|
||||
|
@ -63,10 +63,10 @@ void PathLineEdit::contextMenuEvent(QContextMenuEvent *event)
|
|||
if (fileInfo.exists()) {
|
||||
if (fileInfo.isFile()) {
|
||||
connect(menu->addAction(QIcon::fromTheme(QStringLiteral("system-run")), tr("Open")), &QAction::triggered,
|
||||
bind(&DesktopUtils::openLocalFileOrDir, text()));
|
||||
bind(&openLocalFileOrDir, text()));
|
||||
} else if (fileInfo.isDir()) {
|
||||
connect(menu->addAction(QIcon::fromTheme(QStringLiteral("system-file-manager")), tr("Explore")), &QAction::triggered,
|
||||
bind(&DesktopUtils::openLocalFileOrDir, text()));
|
||||
bind(&openLocalFileOrDir, text()));
|
||||
}
|
||||
}
|
||||
menu->exec(event->globalPos());
|
||||
|
|
|
@ -11,7 +11,7 @@ QT_END_NAMESPACE
|
|||
|
||||
namespace QtGui {
|
||||
|
||||
class PathLineEdit : public Widgets::ClearLineEdit {
|
||||
class PathLineEdit : public QtUtilities::ClearLineEdit {
|
||||
Q_OBJECT
|
||||
Q_PROPERTY(QAbstractItemModel *completionModel READ completionModel WRITE setCompletionModel)
|
||||
|
||||
|
|
|
@ -48,7 +48,8 @@
|
|||
|
||||
using namespace std;
|
||||
using namespace TagParser;
|
||||
using namespace ConversionUtilities;
|
||||
using namespace CppUtilities;
|
||||
using namespace QtUtilities;
|
||||
|
||||
namespace QtGui {
|
||||
|
||||
|
@ -233,7 +234,7 @@ void PicturePreviewSelection::updateSizeAndMimeType(size_t fileSize, const QSize
|
|||
QStringList info;
|
||||
info.reserve(3);
|
||||
if (fileSize) {
|
||||
info << QString::fromStdString(ConversionUtilities::dataSizeToString(fileSize));
|
||||
info << QString::fromStdString(dataSizeToString(fileSize));
|
||||
}
|
||||
if (!resolution.isEmpty()) {
|
||||
info << QString::number(resolution.width()) % QStringLiteral(" x ") % QString::number(resolution.height()) % QStringLiteral(" px");
|
||||
|
|
|
@ -19,12 +19,12 @@ QT_FORWARD_DECLARE_CLASS(QGraphicsRectItem)
|
|||
namespace TagParser {
|
||||
class Tag;
|
||||
class TagValue;
|
||||
DECLARE_ENUM_CLASS(KnownField, unsigned int);
|
||||
enum class KnownField : unsigned int;
|
||||
} // namespace TagParser
|
||||
|
||||
namespace QtGui {
|
||||
|
||||
DECLARE_ENUM_CLASS(PreviousValueHandling, int);
|
||||
enum class PreviousValueHandling : int;
|
||||
|
||||
namespace Ui {
|
||||
class PicturePreviewSelection;
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="Widgets::ClearLineEdit" name="descriptionLineEdit">
|
||||
<widget class="QtUtilities::ClearLineEdit" name="descriptionLineEdit">
|
||||
<property name="placeholderText">
|
||||
<string>empty</string>
|
||||
</property>
|
||||
|
@ -199,7 +199,7 @@
|
|||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>Widgets::ClearLineEdit</class>
|
||||
<class>QtUtilities::ClearLineEdit</class>
|
||||
<extends>QLineEdit</extends>
|
||||
<header location="global">qtutilities/widgets/clearlineedit.h</header>
|
||||
</customwidget>
|
||||
|
|
|
@ -22,7 +22,7 @@
|
|||
#include <QStyle>
|
||||
#include <QTextStream>
|
||||
|
||||
using namespace Dialogs;
|
||||
using namespace QtUtilities;
|
||||
using namespace RenamingUtility;
|
||||
|
||||
namespace QtGui {
|
||||
|
@ -210,10 +210,10 @@ void RenameFilesDialog::showPreviewProgress(int itemsProcessed, int errorsOccure
|
|||
{
|
||||
m_itemsProcessed = itemsProcessed;
|
||||
m_errorsOccured = errorsOccured;
|
||||
QString text = tr("%1 files/directories processed", 0, itemsProcessed).arg(itemsProcessed);
|
||||
QString text = tr("%1 files/directories processed", nullptr, itemsProcessed).arg(itemsProcessed);
|
||||
if (m_errorsOccured > 0) {
|
||||
text.append(QChar('\n'));
|
||||
text.append(tr("%1 error(s) occured", 0, errorsOccured).arg(errorsOccured));
|
||||
text.append(tr("%1 error(s) occured", nullptr, errorsOccured).arg(errorsOccured));
|
||||
}
|
||||
m_ui->notificationLabel->setText(text);
|
||||
}
|
||||
|
@ -225,7 +225,7 @@ void RenameFilesDialog::showPreviewResults()
|
|||
m_ui->applyChangingsPushButton->setHidden(false);
|
||||
if (m_engine->rootItem()) {
|
||||
m_ui->notificationLabel->setText(tr("Preview has been generated."));
|
||||
m_ui->notificationLabel->appendLine(tr("%1 files/directories have been processed.", 0, m_itemsProcessed).arg(m_itemsProcessed));
|
||||
m_ui->notificationLabel->appendLine(tr("%1 files/directories have been processed.", nullptr, m_itemsProcessed).arg(m_itemsProcessed));
|
||||
m_ui->notificationLabel->setNotificationType(NotificationType::Information);
|
||||
m_ui->applyChangingsPushButton->setEnabled(true);
|
||||
} else {
|
||||
|
@ -238,7 +238,7 @@ void RenameFilesDialog::showPreviewResults()
|
|||
m_ui->notificationLabel->setNotificationType(NotificationType::Warning);
|
||||
}
|
||||
if (m_errorsOccured) {
|
||||
m_ui->notificationLabel->appendLine(tr("%1 error(s) occured.", 0, m_errorsOccured).arg(m_errorsOccured));
|
||||
m_ui->notificationLabel->appendLine(tr("%1 error(s) occured.", nullptr, m_errorsOccured).arg(m_errorsOccured));
|
||||
m_ui->notificationLabel->setNotificationType(NotificationType::Warning);
|
||||
}
|
||||
}
|
||||
|
@ -249,14 +249,14 @@ void RenameFilesDialog::showChangsingsResults()
|
|||
m_ui->generatePreviewPushButton->setHidden(false);
|
||||
m_ui->applyChangingsPushButton->setHidden(false);
|
||||
m_ui->notificationLabel->setText(tr("Changins applied."));
|
||||
m_ui->notificationLabel->appendLine(tr("%1 files/directories have been processed.", 0, m_itemsProcessed).arg(m_itemsProcessed));
|
||||
m_ui->notificationLabel->appendLine(tr("%1 files/directories have been processed.", nullptr, m_itemsProcessed).arg(m_itemsProcessed));
|
||||
m_ui->notificationLabel->setNotificationType(NotificationType::Information);
|
||||
if (m_engine->isAborted()) {
|
||||
m_ui->notificationLabel->appendLine(tr("Applying has been aborted prematurely."));
|
||||
m_ui->notificationLabel->setNotificationType(NotificationType::Warning);
|
||||
}
|
||||
if (m_errorsOccured) {
|
||||
m_ui->notificationLabel->appendLine(tr("%1 error(s) occured.", 0, m_errorsOccured).arg(m_errorsOccured));
|
||||
m_ui->notificationLabel->appendLine(tr("%1 error(s) occured.", nullptr, m_errorsOccured).arg(m_errorsOccured));
|
||||
m_ui->notificationLabel->setNotificationType(NotificationType::Warning);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -42,7 +42,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="Widgets::PathSelection" name="directoryWidget" native="true"/>
|
||||
<widget class="QtUtilities::PathSelection" name="directoryWidget" native="true"/>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
|
@ -745,7 +745,7 @@
|
|||
<header>gui/codeedit.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>Widgets::PathSelection</class>
|
||||
<class>QtUtilities::PathSelection</class>
|
||||
<extends>QWidget</extends>
|
||||
<header location="global">qtutilities/widgets/pathselection.h</header>
|
||||
<container>1</container>
|
||||
|
|
|
@ -33,6 +33,7 @@ using namespace std;
|
|||
using namespace std::placeholders;
|
||||
using namespace Settings;
|
||||
using namespace TagParser;
|
||||
using namespace QtUtilities;
|
||||
|
||||
namespace QtGui {
|
||||
|
||||
|
@ -638,33 +639,33 @@ QWidget *FileLayoutPage::setupWidget()
|
|||
*/
|
||||
|
||||
SettingsDialog::SettingsDialog(QWidget *parent)
|
||||
: Dialogs::SettingsDialog(parent)
|
||||
: QtUtilities::SettingsDialog(parent)
|
||||
{
|
||||
// setup categories
|
||||
QList<Dialogs::OptionCategory *> categories;
|
||||
Dialogs::OptionCategory *category;
|
||||
QList<OptionCategory *> categories;
|
||||
OptionCategory *category;
|
||||
|
||||
category = new Dialogs::OptionCategory(this);
|
||||
category = new OptionCategory(this);
|
||||
category->setDisplayName(tr("Tag processing"));
|
||||
category->assignPages(QList<Dialogs::OptionPage *>() << new TagProcessingGeneralOptionPage << new Id3v1OptionPage << new Id3v2OptionPage
|
||||
category->assignPages(QList<OptionPage *>() << 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;
|
||||
|
||||
category = new Dialogs::OptionCategory(this);
|
||||
category = new OptionCategory(this);
|
||||
category->setDisplayName(tr("Editor"));
|
||||
category->setIcon(
|
||||
QIcon::fromTheme(QStringLiteral("document-edit"), QIcon(QStringLiteral(":/tageditor/icons/hicolor/32x32/settingscategories/key-enter.png"))));
|
||||
category->assignPages(QList<Dialogs::OptionPage *>()
|
||||
category->assignPages(QList<OptionPage *>()
|
||||
<< new EditorGeneralOptionPage << new EditorTempOptionPage(this) << new EditorFieldsOptionPage << new InfoOptionPage
|
||||
<< new EditorAutoCorrectionOptionPage << new EditorDbQueryOptionsPage);
|
||||
categories << category;
|
||||
|
||||
category = new Dialogs::OptionCategory(this);
|
||||
category = new OptionCategory(this);
|
||||
category->setDisplayName(tr("File browser"));
|
||||
category->setIcon(QIcon::fromTheme(
|
||||
QStringLiteral("view-list-tree"), QIcon(QStringLiteral(":/tageditor/icons/hicolor/32x32/settingscategories/system-file-manager.png"))));
|
||||
category->assignPages(QList<Dialogs::OptionPage *>() << new FileBrowserGeneralOptionPage);
|
||||
category->assignPages(QList<OptionPage *>() << new FileBrowserGeneralOptionPage);
|
||||
categories << category;
|
||||
|
||||
categories << values().qt.category();
|
||||
|
|
|
@ -47,7 +47,7 @@ END_DECLARE_OPTION_PAGE
|
|||
|
||||
DECLARE_UI_FILE_BASED_OPTION_PAGE_CUSTOM_SETUP(FileLayoutPage)
|
||||
|
||||
class SettingsDialog : public Dialogs::SettingsDialog {
|
||||
class SettingsDialog : public QtUtilities::SettingsDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit SettingsDialog(QWidget *parent = nullptr);
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
using namespace ConversionUtilities;
|
||||
using namespace CppUtilities;
|
||||
using namespace TagParser;
|
||||
|
||||
namespace QtGui {
|
||||
|
|
|
@ -17,7 +17,7 @@ QT_FORWARD_DECLARE_CLASS(QVBoxLayout)
|
|||
namespace TagParser {
|
||||
class Tag;
|
||||
class TagValue;
|
||||
DECLARE_ENUM_CLASS(KnownField, unsigned int);
|
||||
enum class KnownField : unsigned int;
|
||||
} // namespace TagParser
|
||||
|
||||
namespace QtGui {
|
||||
|
|
|
@ -57,20 +57,15 @@
|
|||
|
||||
using namespace std;
|
||||
using namespace std::placeholders;
|
||||
using namespace EscapeCodes;
|
||||
using namespace Utility;
|
||||
using namespace Dialogs;
|
||||
using namespace Widgets;
|
||||
using namespace CppUtilities;
|
||||
using namespace CppUtilities::EscapeCodes;
|
||||
using namespace QtUtilities;
|
||||
using namespace TagParser;
|
||||
using namespace Models;
|
||||
using namespace ConversionUtilities;
|
||||
using namespace Utility;
|
||||
|
||||
namespace QtGui {
|
||||
|
||||
/*!
|
||||
* \brief The LoadingResult enum specifies whether the file could be parsed.
|
||||
*/
|
||||
DECLARE_ENUM(LoadingResult, char){ ParsingSuccessful, FatalParsingError, IoError };
|
||||
enum LoadingResult : char { ParsingSuccessful, FatalParsingError, IoError };
|
||||
|
||||
/*!
|
||||
* \class QtGui::TagEditorWidget
|
||||
|
@ -298,7 +293,7 @@ void TagEditorWidget::updateDocumentTitleEdits()
|
|||
|
||||
// add missing line edits
|
||||
while (i < segmentCount) {
|
||||
auto *lineEdit = new Widgets::ClearLineEdit;
|
||||
auto *const lineEdit = new ClearLineEdit;
|
||||
if (static_cast<size_t>(i) < titles.size()) {
|
||||
lineEdit->setText(QString::fromUtf8(titles[i].data()));
|
||||
}
|
||||
|
|
|
@ -20,7 +20,7 @@ QT_FORWARD_DECLARE_CLASS(QFile)
|
|||
QT_FORWARD_DECLARE_CLASS(QTemporaryFile)
|
||||
|
||||
namespace TagParser {
|
||||
DECLARE_ENUM_CLASS(TagType, unsigned int);
|
||||
enum class TagType : unsigned int;
|
||||
}
|
||||
|
||||
namespace QtGui {
|
||||
|
|
|
@ -42,10 +42,9 @@
|
|||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
using namespace Models;
|
||||
using namespace Widgets;
|
||||
using namespace CppUtilities;
|
||||
using namespace QtUtilities;
|
||||
using namespace TagParser;
|
||||
using namespace ConversionUtilities;
|
||||
|
||||
namespace QtGui {
|
||||
|
||||
|
@ -66,7 +65,7 @@ TagFieldEdit::TagFieldEdit(const QList<TagParser::Tag *> &tags, TagParser::Known
|
|||
, m_dataType(determineDataType())
|
||||
, m_lineEdit(nullptr)
|
||||
, m_comboBox(nullptr)
|
||||
, m_spinBoxes(QPair<Widgets::ClearSpinBox *, Widgets::ClearSpinBox *>(nullptr, nullptr))
|
||||
, m_spinBoxes(QPair<QtUtilities::ClearSpinBox *, QtUtilities::ClearSpinBox *>(nullptr, nullptr))
|
||||
, m_pictureSelection(nullptr)
|
||||
, m_plainTextEdit(nullptr)
|
||||
, m_descriptionLineEdit(nullptr)
|
||||
|
@ -416,7 +415,7 @@ ClearSpinBox *TagFieldEdit::setupSpinBox()
|
|||
/*!
|
||||
* \brief Internally called by setupUi() to setup a a pair of spin boxes.
|
||||
*/
|
||||
QPair<Widgets::ClearSpinBox *, Widgets::ClearSpinBox *> &TagFieldEdit::setupPositionInSetSpinBoxes()
|
||||
QPair<QtUtilities::ClearSpinBox *, QtUtilities::ClearSpinBox *> &TagFieldEdit::setupPositionInSetSpinBoxes()
|
||||
{
|
||||
auto *const subLayout = new QHBoxLayout;
|
||||
|
||||
|
|
|
@ -14,12 +14,12 @@ QT_FORWARD_DECLARE_CLASS(QLabel)
|
|||
namespace TagParser {
|
||||
class TagValue;
|
||||
class Tag;
|
||||
DECLARE_ENUM_CLASS(KnownField, unsigned int);
|
||||
DECLARE_ENUM_CLASS(TagDataType, unsigned int);
|
||||
DECLARE_ENUM_CLASS(TagTextEncoding, unsigned int);
|
||||
enum class KnownField : unsigned int;
|
||||
enum class TagDataType : unsigned int;
|
||||
enum class TagTextEncoding : unsigned int;
|
||||
} // namespace TagParser
|
||||
|
||||
namespace Widgets {
|
||||
namespace QtUtilities {
|
||||
class ButtonOverlay;
|
||||
class ClearLineEdit;
|
||||
class ClearComboBox;
|
||||
|
@ -71,21 +71,21 @@ private slots:
|
|||
private:
|
||||
TagParser::TagDataType determineDataType();
|
||||
void setupUi();
|
||||
Widgets::ClearLineEdit *setupLineEdit();
|
||||
Widgets::ClearPlainTextEdit *setupPlainTextEdit();
|
||||
Widgets::ClearComboBox *setupGenreComboBox();
|
||||
Widgets::ClearSpinBox *setupSpinBox();
|
||||
QPair<Widgets::ClearSpinBox *, Widgets::ClearSpinBox *> &setupPositionInSetSpinBoxes();
|
||||
QtUtilities::ClearLineEdit *setupLineEdit();
|
||||
QtUtilities::ClearPlainTextEdit *setupPlainTextEdit();
|
||||
QtUtilities::ClearComboBox *setupGenreComboBox();
|
||||
QtUtilities::ClearSpinBox *setupSpinBox();
|
||||
QPair<QtUtilities::ClearSpinBox *, QtUtilities::ClearSpinBox *> &setupPositionInSetSpinBoxes();
|
||||
PicturePreviewSelection *setupPictureSelection();
|
||||
QWidget *setupFileSelection();
|
||||
Widgets::ClearLineEdit *setupDescriptionLineEdit();
|
||||
QtUtilities::ClearLineEdit *setupDescriptionLineEdit();
|
||||
QLabel *setupTypeNotSupportedLabel();
|
||||
bool updateValue(PreviousValueHandling previousValueHandling = PreviousValueHandling::Clear);
|
||||
bool updateValue(TagParser::Tag *tag, PreviousValueHandling previousValueHandling = PreviousValueHandling::Clear);
|
||||
bool updateValue(
|
||||
const TagParser::TagValue &value, PreviousValueHandling previousValueHandling = PreviousValueHandling::Clear, bool resetRestoreButton = true);
|
||||
Widgets::IconButton *setupRestoreButton();
|
||||
Widgets::IconButton *setupLockButton();
|
||||
QtUtilities::IconButton *setupRestoreButton();
|
||||
QtUtilities::IconButton *setupLockButton();
|
||||
void showRestoreButton();
|
||||
QString applyAutoCorrection(const QString &textValue);
|
||||
void concretizePreviousValueHandling(PreviousValueHandling &previousValueHandling);
|
||||
|
@ -95,14 +95,14 @@ private:
|
|||
TagParser::KnownField m_field;
|
||||
TagParser::TagDataType m_dataType;
|
||||
QList<QWidget *> m_widgets;
|
||||
Widgets::ClearLineEdit *m_lineEdit;
|
||||
Widgets::ClearComboBox *m_comboBox;
|
||||
QPair<Widgets::ClearSpinBox *, Widgets::ClearSpinBox *> m_spinBoxes;
|
||||
QtUtilities::ClearLineEdit *m_lineEdit;
|
||||
QtUtilities::ClearComboBox *m_comboBox;
|
||||
QPair<QtUtilities::ClearSpinBox *, QtUtilities::ClearSpinBox *> m_spinBoxes;
|
||||
PicturePreviewSelection *m_pictureSelection;
|
||||
Widgets::ClearPlainTextEdit *m_plainTextEdit;
|
||||
Widgets::ClearLineEdit *m_descriptionLineEdit;
|
||||
Widgets::IconButton *m_restoreButton;
|
||||
Widgets::IconButton *m_lockButton;
|
||||
QtUtilities::ClearPlainTextEdit *m_plainTextEdit;
|
||||
QtUtilities::ClearLineEdit *m_descriptionLineEdit;
|
||||
QtUtilities::IconButton *m_restoreButton;
|
||||
QtUtilities::IconButton *m_lockButton;
|
||||
bool m_isLocked;
|
||||
bool m_autoCorrectionApplied;
|
||||
};
|
||||
|
|
|
@ -53,8 +53,8 @@
|
|||
#endif
|
||||
|
||||
using namespace std;
|
||||
using namespace ConversionUtilities;
|
||||
using namespace ChronoUtilities;
|
||||
using namespace CppUtilities;
|
||||
using namespace QtUtilities;
|
||||
using namespace TagParser;
|
||||
using namespace Utility;
|
||||
|
||||
|
|
|
@ -20,10 +20,11 @@
|
|||
|
||||
#include <iostream>
|
||||
|
||||
using namespace ConversionUtilities;
|
||||
using namespace std;
|
||||
using namespace CppUtilities;
|
||||
using namespace QtUtilities;
|
||||
using namespace Utility;
|
||||
using namespace TagParser;
|
||||
using namespace std;
|
||||
|
||||
namespace RenamingUtility {
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@
|
|||
#include <tagparser/diagnostics.h>
|
||||
#include <tagparser/mediafileinfo.h>
|
||||
|
||||
namespace TestUtilities {
|
||||
namespace CppUtilities {
|
||||
|
||||
/*!
|
||||
* \brief Prints a DiagMessage to enable using it in CPPUNIT_ASSERT_EQUAL.
|
||||
|
@ -20,7 +20,7 @@ inline std::ostream &operator<<(std::ostream &os, const TagParser::DiagMessage &
|
|||
|
||||
} // namespace TestUtilities
|
||||
|
||||
using namespace TestUtilities;
|
||||
using namespace CppUtilities;
|
||||
|
||||
#include <c++utilities/tests/testutils.h>
|
||||
|
||||
|
@ -31,11 +31,8 @@ using namespace TestUtilities;
|
|||
#include <iostream>
|
||||
|
||||
using namespace std;
|
||||
using namespace TestUtilities;
|
||||
using namespace TestUtilities::Literals;
|
||||
using namespace ConversionUtilities;
|
||||
using namespace CppUtilities::Literals;
|
||||
using namespace TagParser;
|
||||
|
||||
using namespace CPPUNIT_NS;
|
||||
|
||||
enum class TagStatus { Original, TestMetaDataPresent, Removed };
|
||||
|
@ -1005,7 +1002,7 @@ void CliTests::testJsonExport()
|
|||
string stdout, stderr;
|
||||
|
||||
const auto file(testFilePath("matroska_wave1/test3.mkv"));
|
||||
const auto expectedJson(IoUtilities::readFile(testFilePath("matroska_wave1-test3.json"), 2048));
|
||||
const auto expectedJson(readFile(testFilePath("matroska_wave1-test3.json"), 2048));
|
||||
const char *const args[] = { "tageditor", "export", "--pretty", "-f", file.data(), nullptr };
|
||||
TESTUTILS_ASSERT_EXEC(args);
|
||||
CPPUNIT_ASSERT_EQUAL(expectedJson, stdout);
|
||||
|
|
Loading…
Reference in New Issue