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 /* __STDC_FORMAT_MACROS is required for PRIu64 and friends (in C++). */
31 #define __STDC_FORMAT_MACROS
33 #include <libsigrok/libsigrok.h>
39 About::About(QWidget *parent) :
43 struct sr_dev_driver **drivers;
44 struct sr_input_format **inputs;
45 struct sr_output_format **outputs;
48 struct srd_decoder *dec;
55 /* Setup the version field */
56 ui->versionInfo->setText(tr("%1 %2<br />%3<br /><a href=\"%4\">%4</a>")
57 .arg(QApplication::applicationName())
58 .arg(QApplication::applicationVersion())
59 .arg(tr("GNU GPL, version 3 or later"))
60 .arg(QApplication::organizationDomain()));
61 ui->versionInfo->setOpenExternalLinks(true);
65 /* Set up the supported field */
66 s.append("<tr><td colspan=\"2\"><b>" +
67 tr("Supported hardware drivers:") +
69 drivers = sr_driver_list();
70 for (int i = 0; drivers[i]; ++i) {
71 s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
72 .arg(QString::fromUtf8(drivers[i]->name))
73 .arg(QString::fromUtf8(drivers[i]->longname)));
76 s.append("<tr><td colspan=\"2\"><b>" +
77 tr("Supported input formats:") +
79 inputs = sr_input_list();
80 for (int i = 0; inputs[i]; ++i) {
81 s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
82 .arg(QString::fromUtf8(inputs[i]->id))
83 .arg(QString::fromUtf8(inputs[i]->description)));
86 s.append("<tr><td colspan=\"2\"><b>" +
87 tr("Supported output formats:") +
89 outputs = sr_output_list();
90 for (int i = 0; outputs[i]; ++i) {
91 s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
92 .arg(QString::fromUtf8(outputs[i]->id))
93 .arg(QString::fromUtf8(outputs[i]->description)));
97 s.append("<tr><td colspan=\"2\"><b>" +
98 tr("Supported protocol decoders:") +
100 for (const GSList *l = srd_decoder_list(); l; l = l->next) {
101 dec = (struct srd_decoder *)l->data;
102 s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
103 .arg(QString::fromUtf8(dec->id))
104 .arg(QString::fromUtf8(dec->longname)));
108 s.append("</table>");
110 supportedDoc.reset(new QTextDocument(this));
111 supportedDoc->setHtml(s);
112 ui->supportList->setDocument(supportedDoc.get());
120 } // namespace dialogs