2 * This file is part of the PulseView project.
4 * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
22 #include <libsigrokdecode/libsigrokdecode.h>
25 #include <QTextDocument>
30 #include <libsigrokcxx/libsigrokcxx.hpp>
32 using std::shared_ptr;
33 using sigrok::Context;
38 About::About(shared_ptr<Context> context, QWidget *parent) :
43 struct srd_decoder *dec;
50 /* Setup the version field */
51 ui->versionInfo->setText(tr("%1 %2<br />%3<br /><a href=\"%4\">%4</a>")
52 .arg(QApplication::applicationName())
53 .arg(QApplication::applicationVersion())
54 .arg(tr("GNU GPL, version 3 or later"))
55 .arg(QApplication::organizationDomain()));
56 ui->versionInfo->setOpenExternalLinks(true);
60 /* Set up the supported field */
61 s.append("<tr><td colspan=\"2\"><b>" +
62 tr("Supported hardware drivers:") +
64 for (auto entry : context->drivers()) {
65 s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
66 .arg(QString::fromUtf8(entry.first.c_str()))
67 .arg(QString::fromUtf8(entry.second->long_name().c_str())));
70 s.append("<tr><td colspan=\"2\"><b>" +
71 tr("Supported input formats:") +
73 for (auto entry : context->input_formats()) {
74 s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
75 .arg(QString::fromUtf8(entry.first.c_str()))
76 .arg(QString::fromUtf8(entry.second->description().c_str())));
80 s.append("<tr><td colspan=\"2\"><b>" +
81 tr("Supported protocol decoders:") +
83 for (const GSList *l = srd_decoder_list(); l; l = l->next) {
84 dec = (struct srd_decoder *)l->data;
85 s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
86 .arg(QString::fromUtf8(dec->id))
87 .arg(QString::fromUtf8(dec->longname)));
93 supportedDoc.reset(new QTextDocument(this));
94 supportedDoc->setHtml(s);
95 ui->supportList->setDocument(supportedDoc.get());
103 } // namespace dialogs