X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fdialogs%2Fabout.cpp;h=28ba92f2cb48d3fdabb02fd85169b605ed6c2752;hp=c4827962c59afda9891b62a99cd2268ae8c44234;hb=238419770d6bc2d5e4db3dd6e15fec32eb2a3dc6;hpb=9ab0d1f7b53d4e10f6ee7abd0b02816eafac5f99 diff --git a/pv/dialogs/about.cpp b/pv/dialogs/about.cpp index c4827962..28ba92f2 100644 --- a/pv/dialogs/about.cpp +++ b/pv/dialogs/about.cpp @@ -24,25 +24,21 @@ #include -#include "about.h" +#include "about.hpp" #include -/* __STDC_FORMAT_MACROS is required for PRIu64 and friends (in C++). */ -#define __STDC_FORMAT_MACROS -#include -#include +#include +using std::shared_ptr; +using sigrok::Context; namespace pv { namespace dialogs { -About::About(QWidget *parent) : +About::About(shared_ptr context, QWidget *parent) : QDialog(parent), ui(new Ui::About) { - struct sr_dev_driver **drivers; - struct sr_input_format **inputs; - #ifdef ENABLE_DECODE struct srd_decoder *dec; #endif @@ -65,21 +61,28 @@ About::About(QWidget *parent) : s.append("" + tr("Supported hardware drivers:") + ""); - drivers = sr_driver_list(); - for (int i = 0; drivers[i]; ++i) { + for (auto entry : context->drivers()) { s.append(QString("%1%2") - .arg(QString::fromUtf8(drivers[i]->name)) - .arg(QString::fromUtf8(drivers[i]->longname))); + .arg(QString::fromUtf8(entry.first.c_str())) + .arg(QString::fromUtf8(entry.second->long_name().c_str()))); } s.append("" + tr("Supported input formats:") + ""); - inputs = sr_input_list(); - for (int i = 0; inputs[i]; ++i) { + for (auto entry : context->input_formats()) { + s.append(QString("%1%2") + .arg(QString::fromUtf8(entry.first.c_str())) + .arg(QString::fromUtf8(entry.second->description().c_str()))); + } + + s.append("" + + tr("Supported output formats:") + + ""); + for (auto entry : context->output_formats()) { s.append(QString("%1%2") - .arg(QString::fromUtf8(inputs[i]->id)) - .arg(QString::fromUtf8(inputs[i]->description))); + .arg(QString::fromUtf8(entry.first.c_str())) + .arg(QString::fromUtf8(entry.second->description().c_str()))); } #ifdef ENABLE_DECODE