From dda3bcd18b7d7e5c10316a1865537be48fafe76b Mon Sep 17 00:00:00 2001 From: Martchus Date: Sat, 8 Aug 2015 02:33:31 +0200 Subject: [PATCH] selectable links in element structure, added switch for hex/decimal system --- misc/htmlinfo.cpp | 45 ++++++++++++++++++++++++++++++++++----------- 1 file changed, 34 insertions(+), 11 deletions(-) diff --git a/misc/htmlinfo.cpp b/misc/htmlinfo.cpp index 6c5097e..1efd9a1 100644 --- a/misc/htmlinfo.cpp +++ b/misc/htmlinfo.cpp @@ -155,6 +155,11 @@ QString mkSection() return QStringLiteral(""); } +QString mkSection(const QString &id) +{ + return QStringLiteral("").arg(id); +} + void mkTrack(QByteArray &res, const AbstractTrack *track, unsigned int trackNumber) { res.append(QStringLiteral("%1 #%2").arg(QCoreApplication::translate("HtmlInfo", "Track"), QString::number(trackNumber))); @@ -372,13 +377,13 @@ template void mkElementNode(QByteArray &res, const ElementTyp if(element->isParsed()) { res.append(QStringLiteral("
  • ")); if(element->firstChild()) { - res.append(QStringLiteral("")); + res.append(QStringLiteral("")); } - res.append(QCoreApplication::translate("HtmlInfo", "
  • %1 @%2, size: %3").arg( - QString::fromLatin1(element->idToString().c_str()), QString::number(element->startOffset()), - QString::number(element->totalSize()))); + res.append(QCoreApplication::translate("HtmlInfo", "%1 @%2, size: %4").arg( + QString::fromLatin1(element->idToString().c_str()), QString::number(element->startOffset()), QString::number(element->startOffset(), 16), + QString::number(element->totalSize()), QString::number(element->totalSize(), 16))); if(element->firstChild()) { - res.append(QStringLiteral("")); + res.append(QStringLiteral("")); mkElementNode(res, element->firstChild()); } res.append(QStringLiteral("
  • ")); @@ -512,6 +517,12 @@ QByteArray generateInfo(const MediaFileInfo &file, NotificationList &originalNot "}" ".has-helptext {" "cursor: help;" + "}" + "#structure_links a {" + "margin-right: 5px;" + "}" + "#structure .parent-node {" + "color: #337AB7;" "}")); #ifdef GUI_QTWIDGETS if(ApplicationInstances::hasWidgetsApp()) { @@ -532,8 +543,8 @@ QByteArray generateInfo(const MediaFileInfo &file, NotificationList &originalNot "" "
    ")); // general information @@ -690,7 +711,9 @@ QByteArray generateInfo(const MediaFileInfo &file, NotificationList &originalNot // structure if(file.containerFormat() == ContainerFormat::Mp4 || file.containerFormat() == ContainerFormat::Matroska) { res.append(mkSection()); - res.append(mkRow(QCoreApplication::translate("HtmlInfo", "Structure"), QCoreApplication::translate("HtmlInfo", "expand all, collapse all"))); + res.append(mkRow(QCoreApplication::translate("HtmlInfo", "Structure"), + QCoreApplication::translate("HtmlInfo", "expand all collapse all " + "hex"))); res.append(QStringLiteral("
    ")); switch(file.containerFormat()) { case ContainerFormat::Mp4: