Convert Acknowledgements to markdown and update GUI

Move Acknowledgements to a separate file to enable some code
simplification and improve maintenance and discoverability
for acknowlegements.

Convert the Acknowledgements file to Github flavored markdown
and display it in rich text using QTextBrowser.

Add Acknowledgements.md to NSIS installer
This commit is contained in:
João Valverde 2022-07-27 13:05:08 +01:00 committed by A Wireshark GitLab Utility
parent a0174e4f0b
commit b8ec3199ab
12 changed files with 59 additions and 96 deletions

27
AUTHORS
View File

@ -5144,30 +5144,3 @@ zhudewen <zhudewen[AT]iauto.com>
Øyvind Rønningstad <ronningstad[AT]gmail.com>
Đorđije Manojlović <djordjije.manojlovic[AT]omicronenergy.com>
Дмитрий Цветцих <dmitrycvet[AT]gmail.com>
= Acknowledgements =
Dan Lasley <dlasley[AT]promus.com> gave permission for his dumpit() hex-dump routine to be used.
We use the exception module from Kazlib, a C library written by Kaz Kylheku <kaz[AT]kylheku.com>. Thanks go to him for his well-written library. The Kazlib home page can be found at http://www.kylheku.com/~kaz/kazlib.html
We use Lua <https://www.lua.org/about.html> to extend Wireshark APIs with scripting capabilities. Lua is a powerful, efficient, lightweight, embeddable scripting language developed and maintained by a team at PUC-Rio.
We use Lua BitOp, written by Mike Pall, for bitwise operations on numbers in Lua. The Lua BitOp home page can be found at https://bitop.luajit.org
Snax <snax[AT]shmoo.com> gave permission to use the weak key detection code from Airsnort.
IANA gave permission for their port-numbers file to be used.
We use the natural order string comparison algorithm, written by Martin Pool <mbp[AT]sourcefrog.net>.
Emanuel Eichhammer <support[AT]qcustomplot.com> granted permission to use QCustomPlot.
Some icons made by Freepik, http://www.freepik.com from https://www.flaticon.com
Insecure.Com LLC ("The Nmap Project") has granted the Wireshark Foundation permission to distribute Npcap with our Windows installers.
We use the overflow-safe math functions from the portable snippets repository (https://github.com/nemequ/portable-snippets).
We use the Lrexlib Lua library, specifically the PCRE2 flavour, to provide a regular expression API for Lua. The Lrexlib repository is hosted at https://github.com/rrthomas/lrexlib.

View File

@ -4005,29 +4005,3 @@ Håkon Øye Amundsen <haakon.amundsen[AT]nordicsemi.no>
Jeffrey Wildman <jeffrey.wildman[AT]ll.mit.edu>
Jan Schiefer <jan.schiefer[AT]keysight.com>
Triton Circonflexe <triton+enuiqr[AT]kumal.info>
= Acknowledgements =
Dan Lasley <dlasley[AT]promus.com> gave permission for his dumpit() hex-dump routine to be used.
We use the exception module from Kazlib, a C library written by Kaz Kylheku <kaz[AT]kylheku.com>. Thanks go to him for his well-written library. The Kazlib home page can be found at http://www.kylheku.com/~kaz/kazlib.html
We use Lua <https://www.lua.org/about.html> to extend Wireshark APIs with scripting capabilities. Lua is a powerful, efficient, lightweight, embeddable scripting language developed and maintained by a team at PUC-Rio.
We use Lua BitOp, written by Mike Pall, for bitwise operations on numbers in Lua. The Lua BitOp home page can be found at https://bitop.luajit.org
Snax <snax[AT]shmoo.com> gave permission to use the weak key detection code from Airsnort.
IANA gave permission for their port-numbers file to be used.
We use the natural order string comparison algorithm, written by Martin Pool <mbp[AT]sourcefrog.net>.
Emanuel Eichhammer <support[AT]qcustomplot.com> granted permission to use QCustomPlot.
Some icons made by Freepik, http://www.freepik.com from https://www.flaticon.com
Insecure.Com LLC ("The Nmap Project") has granted the Wireshark Foundation permission to distribute Npcap with our Windows installers.
We use the overflow-safe math functions from the portable snippets repository (https://github.com/nemequ/portable-snippets).
We use the Lrexlib Lua library, specifically the PCRE2 flavour, to provide a regular expression API for Lua. The Lrexlib repository is hosted at https://github.com/rrthomas/lrexlib.

23
Acknowledgements.md Normal file
View File

@ -0,0 +1,23 @@
Dan Lasley <dlasley[AT]promus.com> gave permission for his `dumpit()` hex-dump routine to be used.
We use the exception module from [Kazlib](http://www.kylheku.com/~kaz/kazlib.html), a C library written by Kaz Kylheku <kaz[AT]kylheku.com>. Thanks go to him for his well-written library.
We use [Lua](https://www.lua.org/about.html) to extend Wireshark APIs with scripting capabilities. Lua is a powerful, efficient, lightweight, embeddable scripting language developed and maintained by a team at PUC-Rio.
We use [Lua BitOp](https://bitop.luajit.org), written by Mike Pall, for bitwise operations on numbers in Lua.
Snax <snax[AT]shmoo.com> gave permission to use the weak key detection code from [Airsnort](http://airsnort.shmoo.com).
IANA gave permission for their port-numbers file to be used.
We use the natural order string comparison algorithm, written by Martin Pool <mbp[AT]sourcefrog.net>.
Emanuel Eichhammer <support[AT]qcustomplot.com> granted permission to use [QCustomPlot](https://www.qcustomplot.com).
Some icons made by [Freepik](http://www.freepik.com) from <https://www.flaticon.com>.
Insecure.Com LLC ("The Nmap Project") has granted the Wireshark Foundation permission to distribute [Npcap](https://npcap.com) with our Windows installers.
We use the overflow-safe math functions from the [portable snippets](https://github.com/nemequ/portable-snippets) repository.
We use the [Lrexlib](https://github.com/rrthomas/lrexlib) Lua library, specifically the PCRE2 flavour, to provide a regular expression API for Lua.

View File

@ -1965,6 +1965,7 @@ set(INSTALL_DIRS
# Installed into ${DATAFILE_DIR}
set(INSTALL_FILES
Acknowledgements.md
docbook/ws.css
enterprises.tsv
gpl-2.0-standalone.html

View File

@ -468,6 +468,7 @@ File "${STAGING_DIR}\dumpcap.html"
File "${STAGING_DIR}\extcap.html"
File "${STAGING_DIR}\ipmap.html"
File "${STAGING_DIR}\gpl-2.0-standalone.html"
File "${STAGING_DIR}\Acknowledgements.md"
; C-runtime redistributable
; vc_redist.x64.exe or vc_redist.x86.exe - copy and execute the redistributable installer

View File

@ -150,6 +150,7 @@ Delete "$INSTDIR\audio\*.*"
Delete "$INSTDIR\bearer\*.*"
Delete "$INSTDIR\diameter\*.*"
Delete "$INSTDIR\gpl-2.0-standalone.html"
Delete "$INSTDIR\Acknowledgements.md"
Delete "$INSTDIR\help\*.*"
Delete "$INSTDIR\iconengines\*.*"
Delete "$INSTDIR\imageformats\*.*"

View File

@ -192,6 +192,7 @@ Delete "$INSTDIR\extcap\ciscodump.*"
Delete "$INSTDIR\extcap\udpdump.*"
Delete "$INSTDIR\extcap\wifidump.*"
Delete "$INSTDIR\gpl-2.0-standalone.html"
Delete "$INSTDIR\Acknowledgements.md"
Delete "$INSTDIR\help\*.*"
Delete "$INSTDIR\iconengines\*.*"
Delete "$INSTDIR\imageformats\*.*"

View File

@ -513,6 +513,7 @@ File "${STAGING_DIR}\dumpcap.html"
File "${STAGING_DIR}\extcap.html"
File "${STAGING_DIR}\ipmap.html"
File "${STAGING_DIR}\gpl-2.0-standalone.html"
File "${STAGING_DIR}\Acknowledgements.md"
; C-runtime redistributable
; vc_redist.x64.exe or vc_redist.x86.exe - copy and execute the redistributable installer

View File

@ -48,7 +48,6 @@ def get_git_authors():
def extract_contributors(authors_content):
# Extract names and email addresses from the AUTHORS file Contributors
contributors_content = authors_content.split("= Contributors =", 1)[1]
contributors_content = contributors_content.split("= Acknowledgements =", 1)[0]
CONTRIBUTOR_LINE_REGEX = r"^([\w\.\-\'\x80-\xff]+(\s*[\w+\.\-\'\x80-\xff])*)\s+<([^>]*)>"
contributors = []
state = ""
@ -126,11 +125,8 @@ def main():
git_contributors_text = generate_git_contributors_text(contributors_emails, git_authors_emails)
# Now we can write our output:
acknowledgements_start = author_content.find("\n\n= Acknowledgements =")
before_acknowledgements = author_content[:acknowledgements_start]
acknowledgements = author_content[acknowledgements_start:]
git_contributor_header = '\n\n\n= From git log =\n\n'
output = before_acknowledgements + git_contributor_header + git_contributors_text + '\n' + acknowledgements
git_contributor_header = '\n\n= From git log =\n\n'
output = author_content + git_contributor_header + git_contributors_text + '\n'
stdoutu8.write(output)

View File

@ -63,11 +63,11 @@
#include <QMenu>
#include <QFileInfo>
#include <QMessageBox>
#include <QPlainTextEdit>
AuthorListModel::AuthorListModel(QObject * parent) :
AStringListListModel(parent)
{
bool readAck = false;
QFile f_authors;
f_authors.setFileName(get_datafile_path("AUTHORS-SHORT"));
@ -80,27 +80,18 @@ AStringListListModel(parent)
#endif
QRegularExpression rx("(.*)[<(]([\\s'a-zA-Z0-9._%+-]+(\\[[Aa][Tt]\\])?[a-zA-Z0-9._%+-]+)[>)]");
acknowledgement_.clear();
while (!ReadFile_authors.atEnd()) {
QString line = ReadFile_authors.readLine();
if (! readAck && line.trimmed().length() == 0)
if (line.trimmed().length() == 0)
continue;
if (line.startsWith("------"))
continue;
if (line.contains("Acknowledgements")) {
readAck = true;
continue;
QRegularExpressionMatch match = rx.match(line);
if (match.hasMatch()) {
appendRow(QStringList() << match.captured(1).trimmed() << match.captured(2).trimmed());
}
else if (!readAck) {
QRegularExpressionMatch match = rx.match(line);
if (match.hasMatch())
appendRow(QStringList() << match.captured(1).trimmed() << match.captured(2).trimmed());
}
if (readAck && (!line.isEmpty() || !acknowledgement_.isEmpty()))
acknowledgement_.append(QString("%1\n").arg(line));
}
f_authors.close();
@ -108,11 +99,6 @@ AStringListListModel(parent)
AuthorListModel::~AuthorListModel() { }
QString AuthorListModel::acknowledgment() const
{
return acknowledgement_;
}
QStringList AuthorListModel::headerColumns() const
{
return QStringList() << tr("Name") << tr("Email");
@ -278,6 +264,7 @@ AboutDialog::AboutDialog(QWidget *parent) :
{
ui->setupUi(this);
setAttribute(Qt::WA_DeleteOnClose, true);
QFile f_acknowledgements;
QFile f_license;
AuthorListModel * authorModel = new AuthorListModel(this);
@ -288,10 +275,6 @@ AboutDialog::AboutDialog(QWidget *parent) :
proxyAuthorModel->setColumnToFilter(1);
ui->tblAuthors->setModel(proxyAuthorModel);
ui->tblAuthors->setRootIsDecorated(false);
ui->pte_Authors->clear();
ui->pte_Authors->appendPlainText(authorModel->acknowledgment());
ui->pte_Authors->moveCursor(QTextCursor::Start);
ui->tblAuthors->setContextMenuPolicy(Qt::CustomContextMenu);
connect(ui->tblAuthors, &QTreeView::customContextMenuRequested, this, &AboutDialog::handleCopyMenu);
connect(ui->searchAuthors, &QLineEdit::textChanged, proxyAuthorModel, &AStringListListSortFilterProxyModel::setFilter);
@ -375,6 +358,28 @@ AboutDialog::AboutDialog(QWidget *parent) :
connect(ui->tblShortcuts, &QTreeView::customContextMenuRequested, this, &AboutDialog::handleCopyMenu);
connect(ui->searchShortcuts, &QLineEdit::textChanged, shortcutProxyModel, &AStringListListSortFilterProxyModel::setFilter);
/* Acknowledgements */
f_acknowledgements.setFileName(get_datafile_path("Acknowledgements.md"));
f_acknowledgements.open(QFile::ReadOnly | QFile::Text);
QTextStream ReadFile_acks(&f_acknowledgements);
/* QTextBrowser markdown support added in 5.14. */
#if QT_VERSION >= QT_VERSION_CHECK(5, 14, 0)
QTextBrowser *textBrowserAcks = new QTextBrowser();
textBrowserAcks->setMarkdown(ReadFile_acks.readAll());
textBrowserAcks->setReadOnly(true);
textBrowserAcks->setOpenExternalLinks(true);
textBrowserAcks->moveCursor(QTextCursor::Start);
ui->ackVerticalLayout->addWidget(textBrowserAcks);
#else
QPlainTextEdit *pte = new QPlainTextEdit();
pte->setPlainText(ReadFile_acks.readAll());
pte->setReadOnly(true);
pte->moveCursor(QTextCursor::Start);
ui->ackVerticalLayout->addWidget(pte);
#endif
/* License */
f_license.setFileName(get_datafile_path("gpl-2.0-standalone.html"));

View File

@ -33,14 +33,9 @@ public:
explicit AuthorListModel(QObject * parent = Q_NULLPTR);
virtual ~AuthorListModel();
QString acknowledgment() const;
protected:
virtual QStringList headerColumns() const;
private:
QString acknowledgement_;
};
class PluginListModel : public AStringListListModel

View File

@ -261,15 +261,7 @@
<attribute name="title">
<string>Acknowledgments</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_8">
<item>
<widget class="QPlainTextEdit" name="pte_Authors">
<property name="readOnly">
<bool>true</bool>
</property>
</widget>
</item>
</layout>
<layout class="QVBoxLayout" name="ackVerticalLayout"/>
</widget>
<widget class="QWidget" name="tab_license">
<attribute name="title">