]> sigrok.org Git - pulseview.git/blame - pv/dialogs/about.cpp
Remove obsolete input module support.
[pulseview.git] / pv / dialogs / about.cpp
CommitLineData
40eb2ff4 1/*
b3f22de0 2 * This file is part of the PulseView project.
40eb2ff4
JH
3 *
4 * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
5 *
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.
10 *
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.
15 *
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
19 */
20
269528f5 21#ifdef ENABLE_DECODE
aaabd61b 22#include <libsigrokdecode/libsigrokdecode.h>
269528f5 23#endif
40eb2ff4
JH
24
25#include <QTextDocument>
26
27#include "about.h"
51e77110 28#include <ui_about.h>
40eb2ff4 29
40eb2ff4
JH
30/* __STDC_FORMAT_MACROS is required for PRIu64 and friends (in C++). */
31#define __STDC_FORMAT_MACROS
32#include <glib.h>
33#include <libsigrok/libsigrok.h>
e82fd481 34
40eb2ff4 35
51e77110 36namespace pv {
acda14b8 37namespace dialogs {
51e77110 38
40eb2ff4
JH
39About::About(QWidget *parent) :
40 QDialog(parent),
41 ui(new Ui::About)
42{
40eb2ff4 43 struct sr_dev_driver **drivers;
d52d8455 44
269528f5 45#ifdef ENABLE_DECODE
40eb2ff4 46 struct srd_decoder *dec;
269528f5 47#endif
d52d8455 48
40eb2ff4
JH
49 QString s;
50
51 ui->setupUi(this);
52
53 /* Setup the version field */
54 ui->versionInfo->setText(tr("%1 %2<br />%3<br /><a href=\"%4\">%4</a>")
55 .arg(QApplication::applicationName())
56 .arg(QApplication::applicationVersion())
0ec7aba5 57 .arg(tr("GNU GPL, version 3 or later"))
40eb2ff4 58 .arg(QApplication::organizationDomain()));
eb2b2d91 59 ui->versionInfo->setOpenExternalLinks(true);
40eb2ff4 60
be20a3b8
JH
61 s.append("<table>");
62
40eb2ff4 63 /* Set up the supported field */
be20a3b8
JH
64 s.append("<tr><td colspan=\"2\"><b>" +
65 tr("Supported hardware drivers:") +
66 "</b></td></tr>");
40eb2ff4
JH
67 drivers = sr_driver_list();
68 for (int i = 0; drivers[i]; ++i) {
69 s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
27e8df22
JH
70 .arg(QString::fromUtf8(drivers[i]->name))
71 .arg(QString::fromUtf8(drivers[i]->longname)));
40eb2ff4 72 }
40eb2ff4 73
269528f5 74#ifdef ENABLE_DECODE
be20a3b8
JH
75 s.append("<tr><td colspan=\"2\"><b>" +
76 tr("Supported protocol decoders:") +
77 "</b></td></tr>");
83259518 78 for (const GSList *l = srd_decoder_list(); l; l = l->next) {
40eb2ff4
JH
79 dec = (struct srd_decoder *)l->data;
80 s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
27e8df22
JH
81 .arg(QString::fromUtf8(dec->id))
82 .arg(QString::fromUtf8(dec->longname)));
40eb2ff4 83 }
269528f5 84#endif
be20a3b8 85
40eb2ff4
JH
86 s.append("</table>");
87
88 supportedDoc.reset(new QTextDocument(this));
89 supportedDoc->setHtml(s);
90 ui->supportList->setDocument(supportedDoc.get());
91}
92
93About::~About()
94{
95 delete ui;
96}
51e77110 97
acda14b8 98} // namespace dialogs
51e77110 99} // namespace pv