X-Git-Url: http://git.code-monkey.de/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdialogs%2Fabout.cpp;fp=pv%2Fdialogs%2Fabout.cpp;h=a7778549b3438c47ab493bcb00f2516a5f9b6fae;hp=0000000000000000000000000000000000000000;hb=acda14b82957d9a848a5083df6f9b98d05c29fba;hpb=238404062db14998f3b0ca93ae03a47543d219b8 diff --git a/pv/dialogs/about.cpp b/pv/dialogs/about.cpp new file mode 100644 index 0000000..a777854 --- /dev/null +++ b/pv/dialogs/about.cpp @@ -0,0 +1,116 @@ +/* + * This file is part of the PulseView project. + * + * Copyright (C) 2012 Joel Holdsworth + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + */ + +extern "C" { +#include +} + +#include + +#include "about.h" +#include + +extern "C" { +/* __STDC_FORMAT_MACROS is required for PRIu64 and friends (in C++). */ +#define __STDC_FORMAT_MACROS +#include +#include +} + +namespace pv { +namespace dialogs { + +About::About(QWidget *parent) : + QDialog(parent), + ui(new Ui::About) +{ + GSList *l; + struct sr_dev_driver **drivers; + struct sr_input_format **inputs; + struct sr_output_format **outputs; + struct srd_decoder *dec; + QString s; + + ui->setupUi(this); + + /* Setup the version field */ + ui->versionInfo->setText(tr("%1 %2
%3
%4") + .arg(QApplication::applicationName()) + .arg(QApplication::applicationVersion()) + .arg(tr("GNU GPL, version 2 or later")) + .arg(QApplication::organizationDomain())); + + s.append(""); + + /* Set up the supported field */ + s.append(""); + drivers = sr_driver_list(); + for (int i = 0; drivers[i]; ++i) { + s.append(QString("") + .arg(QString(drivers[i]->name)) + .arg(QString(drivers[i]->longname))); + } + + s.append(""); + inputs = sr_input_list(); + for (int i = 0; inputs[i]; ++i) { + s.append(QString("") + .arg(QString(inputs[i]->id)) + .arg(QString(inputs[i]->description))); + } + + s.append(""); + outputs = sr_output_list(); + for (int i = 0; outputs[i]; ++i) { + s.append(QString("") + .arg(QString(outputs[i]->id)) + .arg(QString(outputs[i]->description))); + } + + s.append(""); + for (l = srd_decoder_list(); l; l = l->next) { + dec = (struct srd_decoder *)l->data; + s.append(QString("") + .arg(QString(dec->id)) + .arg(QString(dec->longname))); + } + + s.append("
" + + tr("Supported hardware drivers:") + + "
%1%2
" + + tr("Supported input formats:") + + "
%1%2
" + + tr("Supported output formats:") + + "
%1%2
" + + tr("Supported protocol decoders:") + + "
%1%2
"); + + supportedDoc.reset(new QTextDocument(this)); + supportedDoc->setHtml(s); + ui->supportList->setDocument(supportedDoc.get()); +} + +About::~About() +{ + delete ui; +} + +} // namespace dialogs +} // namespace pv