pv/devices/hardwaredevice.cpp
pv/devices/inputfile.cpp
pv/devices/sessionfile.cpp
- pv/dialogs/about.cpp
pv/dialogs/connect.cpp
pv/dialogs/inputoutputoptions.cpp
pv/dialogs/settings.cpp
pv/data/logic.hpp
pv/data/logicsegment.hpp
pv/data/signalbase.hpp
- pv/dialogs/about.hpp
pv/dialogs/connect.hpp
pv/dialogs/inputoutputoptions.hpp
pv/dialogs/settings.hpp
pv/widgets/wellarray.hpp
)
-set(pulseview_FORMS
- pv/dialogs/about.ui
-)
-
set(pulseview_RESOURCES
pulseview.qrc
)
if(Qt5Core_FOUND)
qt5_wrap_cpp(pulseview_HEADERS_MOC ${pulseview_HEADERS})
- qt5_wrap_ui(pulseview_FORMS_HEADERS ${pulseview_FORMS})
qt5_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES})
else()
# Workaround for QTBUG-22829: -DBOOST_NEXT_PRIOR_HPP_INCLUDED.
# https://bugreports.qt.io/browse/QTBUG-22829
qt4_wrap_cpp(pulseview_HEADERS_MOC ${pulseview_HEADERS}
OPTIONS -DBOOST_NEXT_PRIOR_HPP_INCLUDED)
- qt4_wrap_ui(pulseview_FORMS_HEADERS ${pulseview_FORMS})
qt4_add_resources(pulseview_RESOURCES_RCC ${pulseview_RESOURCES})
include(${QT_USE_FILE})
endif()
add_library(${PROJECT_NAME} SHARED
${pulseview_SOURCES}
${pulseview_HEADERS_MOC}
- ${pulseview_FORMS_HEADERS}
${pulseview_RESOURCES_RCC}
)
else()
add_executable(${PROJECT_NAME}
${pulseview_SOURCES}
${pulseview_HEADERS_MOC}
- ${pulseview_FORMS_HEADERS}
${pulseview_RESOURCES_RCC}
)
endif()
Copyright (C) 2010,2011,2012,2013 Contributor Name
+Icons authors and licenses
+--------------------------
+
+icons/information.svg: Bobarino
+ https://en.wikipedia.org/wiki/File:Information.svg
+
+
Mailing list
------------
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:xlink="http://www.w3.org/1999/xlink"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.0"
+ width="256"
+ height="256"
+ id="svg2">
+ <defs
+ id="defs4">
+ <linearGradient
+ id="linearGradient2820">
+ <stop
+ style="stop-color:black;stop-opacity:0.3137255"
+ offset="0"
+ id="stop2822" />
+ <stop
+ style="stop-color:black;stop-opacity:0.19607843"
+ offset="0.92982459"
+ id="stop2826" />
+ <stop
+ style="stop-color:black;stop-opacity:0"
+ offset="1"
+ id="stop2824" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient10053">
+ <stop
+ style="stop-color:white;stop-opacity:1"
+ offset="0"
+ id="stop10055" />
+ <stop
+ style="stop-color:white;stop-opacity:0.47959185"
+ offset="1"
+ id="stop10057" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient7070">
+ <stop
+ style="stop-color:white;stop-opacity:0.94897962"
+ offset="0"
+ id="stop7072" />
+ <stop
+ style="stop-color:white;stop-opacity:0.74489796"
+ offset="1"
+ id="stop7074" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4153">
+ <stop
+ style="stop-color:#2a4fe4;stop-opacity:1"
+ offset="0"
+ id="stop4155" />
+ <stop
+ style="stop-color:#447bfa;stop-opacity:1"
+ offset="0.2"
+ id="stop7080" />
+ <stop
+ style="stop-color:#69a3ff;stop-opacity:1"
+ offset="0.625"
+ id="stop7084" />
+ <stop
+ style="stop-color:#89beff;stop-opacity:1"
+ offset="0.75"
+ id="stop7082" />
+ <stop
+ style="stop-color:#80beff;stop-opacity:1"
+ offset="1"
+ id="stop4157" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient4145">
+ <stop
+ style="stop-color:black;stop-opacity:1"
+ offset="0"
+ id="stop4147" />
+ <stop
+ style="stop-color:black;stop-opacity:0"
+ offset="1"
+ id="stop4149" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient25332">
+ <stop
+ style="stop-color:#385ae5;stop-opacity:1"
+ offset="0"
+ id="stop25334" />
+ <stop
+ style="stop-color:#66a1ff;stop-opacity:1"
+ offset="0"
+ id="stop26309" />
+ <stop
+ style="stop-color:#66a1f0;stop-opacity:0.94117647"
+ offset="1"
+ id="stop25336" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient23386">
+ <stop
+ style="stop-color:#2b51e4;stop-opacity:0"
+ offset="0"
+ id="stop23388" />
+ <stop
+ style="stop-color:black;stop-opacity:0"
+ offset="1"
+ id="stop23390" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient15560">
+ <stop
+ style="stop-color:#1864ed;stop-opacity:1"
+ offset="0"
+ id="stop15562" />
+ <stop
+ style="stop-color:#3a7bef;stop-opacity:0.25510204"
+ offset="1"
+ id="stop15564" />
+ </linearGradient>
+ <linearGradient
+ id="linearGradient15536">
+ <stop
+ style="stop-color:white;stop-opacity:1"
+ offset="0"
+ id="stop15538" />
+ <stop
+ style="stop-color:white;stop-opacity:0.59090906"
+ offset="1"
+ id="stop15540" />
+ </linearGradient>
+ <filter
+ id="filter9681">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="1.7392633"
+ id="feGaussianBlur9683" />
+ </filter>
+ <filter
+ id="filter22413">
+ <feGaussianBlur
+ inkscape:collect="always"
+ stdDeviation="0.33355481"
+ id="feGaussianBlur22415" />
+ </filter>
+ <linearGradient
+ x1="168.97348"
+ y1="226.79765"
+ x2="94.360741"
+ y2="42.124634"
+ id="linearGradient4159"
+ xlink:href="#linearGradient4153"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ x1="162.12244"
+ y1="228.19299"
+ x2="101.21178"
+ y2="40.729256"
+ id="linearGradient7076"
+ xlink:href="#linearGradient7070"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ x1="127.8125"
+ y1="31.59375"
+ x2="127.8125"
+ y2="118.62509"
+ id="linearGradient10059"
+ xlink:href="#linearGradient10053"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ x1="150.76942"
+ y1="72.579872"
+ x2="162.2932"
+ y2="131.31783"
+ id="linearGradient2818"
+ xlink:href="#linearGradient2820"
+ gradientUnits="userSpaceOnUse" />
+ <radialGradient
+ cx="130.61937"
+ cy="132.01637"
+ r="115.95089"
+ fx="130.61937"
+ fy="132.01637"
+ id="radialGradient3721"
+ xlink:href="#linearGradient2820"
+ gradientUnits="userSpaceOnUse" />
+ <linearGradient
+ x1="127.8125"
+ y1="31.59375"
+ x2="127.8125"
+ y2="118.62509"
+ id="linearGradient4614"
+ xlink:href="#linearGradient15536"
+ gradientUnits="userSpaceOnUse" />
+ </defs>
+ <g
+ style="opacity:1;fill:url(#linearGradient2818);fill-opacity:1;display:inline"
+ id="layer2">
+ <path
+ d="M 246.57026,132.01637 C 246.57026,196.05428 194.65728,247.96726 130.61937,247.96726 C 66.581461,247.96726 14.668479,196.05428 14.66848,132.01637 C 14.668479,67.978461 66.581461,16.065479 130.61937,16.065479 C 194.65728,16.065479 246.57026,67.978461 246.57026,132.01637 L 246.57026,132.01637 z "
+ transform="matrix(0.995962,0,0,0.995962,-0.171109,-0.165469)"
+ style="opacity:1;fill:url(#radialGradient3721);fill-opacity:1;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path12053" />
+ </g>
+ <g
+ style="opacity:1;display:inline"
+ id="layer4">
+ <path
+ d="M 230.50477,134.46112 C 230.50477,189.04765 186.25364,233.29877 131.66712,233.29877 C 77.080585,233.29878 32.82946,189.04765 32.82946,134.46112 C 32.82946,79.87459 77.080585,35.623465 131.66711,35.623465 C 186.25364,35.623465 230.50477,79.87459 230.50477,134.46112 L 230.50477,134.46112 z "
+ transform="matrix(1.082583,0,0,1.082583,-14.54063,-17.56537)"
+ style="opacity:1;fill:#3a73ef;fill-opacity:1;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path2175" />
+ <path
+ d="M 230.50477,134.46112 C 230.50477,189.04765 186.25364,233.29877 131.66712,233.29877 C 77.080585,233.29878 32.82946,189.04765 32.82946,134.46112 C 32.82946,79.87459 77.080585,35.623465 131.66711,35.623465 C 186.25364,35.623465 230.50477,79.87459 230.50477,134.46112 L 230.50477,134.46112 z "
+ transform="matrix(1.042113,0,0,1.042113,-9.212006,-12.12368)"
+ style="opacity:1;fill:url(#linearGradient7076);fill-opacity:1;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path13592" />
+ <path
+ d="M 230.50477,134.46112 C 230.50477,189.04765 186.25364,233.29877 131.66712,233.29877 C 77.080585,233.29878 32.82946,189.04765 32.82946,134.46112 C 32.82946,79.87459 77.080585,35.623465 131.66711,35.623465 C 186.25364,35.623465 230.50477,79.87459 230.50477,134.46112 L 230.50477,134.46112 z "
+ transform="matrix(0.951055,0,0,0.951055,2.777393,0.12014)"
+ style="opacity:1;fill:url(#linearGradient4159);fill-opacity:1;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+ id="path14565" />
+ </g>
+ <g
+ style="opacity:1;display:inline"
+ id="layer5" />
+ <g
+ style="opacity:1;display:inline"
+ id="layer3">
+ <g
+ id="g15568">
+ <path
+ d="M 123.30585,191.07575 C 129.02124,187.76374 138.24211,176.49437 141.6732,168.65732 C 141.6732,168.65732 138.1399,167.1567 138.1399,167.1567 C 131.0411,179.5796 120.02693,188.70016 123.71066,173.32458 C 123.71066,173.32458 145.45687,105.04964 145.45687,105.04964 C 139.77784,104.57639 111.00423,109.17626 106.51327,110.10356 C 106.51327,110.10356 105.79723,113.88169 105.79723,113.88169 C 115.61397,114.21756 116.94651,118.2341 116.23663,121.5238 C 116.23663,121.5238 99.927949,173.57586 99.927949,173.57586 C 99.927949,173.57586 97.881571,179.46474 97.947071,183.84902 C 98.105167,193.86006 111.11196,197.7125 123.30585,191.07575 z "
+ style="opacity:1;fill:white;fill-opacity:1;stroke:none;stroke-width:0.1;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="path3339" />
+ <path
+ d="M 151.9268,75.963402 C 151.93091,83.589999 145.74948,89.774755 138.12288,89.774755 C 130.49628,89.774755 124.31485,83.589999 124.31896,75.963402 C 124.31485,68.336805 130.49628,62.152049 138.12288,62.152049 C 145.74948,62.152049 151.93091,68.336805 151.9268,75.963402 L 151.9268,75.963402 z "
+ transform="matrix(1.006031,0,0,1.006031,-1.167682,-0.583638)"
+ style="opacity:1;fill:white;fill-opacity:1;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1;display:inline"
+ id="path7182" />
+ </g>
+ </g>
+ <g
+ style="opacity:1;fill:url(#linearGradient4614);fill-opacity:1;display:inline"
+ id="layer7">
+ <path
+ d="M 128,31.59375 C 86.871341,31.59375 51.74836,57.401715 37.90625,93.6875 C 56.732365,110.35912 96.245675,118.37197 128.03125,118.625 C 128.07285,118.62467 128.02111,118.62533 128.0625,118.625 C 160.09769,118.36974 199.12268,109.67594 217.71875,92.6875 C 203.61988,56.922098 168.75455,31.593751 128,31.59375 z "
+ style="opacity:0.45;fill:url(#linearGradient4614);fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:0.1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1"
+ id="path18502" />
+ </g>
+</svg>
<qresource prefix="/" >
<file>icons/add-decoder.svg</file>
<file>icons/application-exit.png</file>
+ <file>icons/channels.svg</file>
<file>icons/configure.png</file>
<file>icons/decoder-delete.svg</file>
<file>icons/decoder-hidden.svg</file>
<file>icons/document-new.png</file>
<file>icons/document-open.png</file>
<file>icons/document-save-as.png</file>
- <file>icons/channels.svg</file>
+ <file>icons/information.svg</file>
<file>icons/menu.svg</file>
<file>icons/sigrok-logo-notext.png</file>
<file>icons/sigrok-logo-notext.svg</file>
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#ifdef ENABLE_DECODE
-#include <libsigrokdecode/libsigrokdecode.h>
-#endif
-
-#include <QTextDocument>
-
-#include "about.hpp"
-#include <ui_about.h>
-
-#include <libsigrokcxx/libsigrokcxx.hpp>
-
-using std::shared_ptr;
-using sigrok::Context;
-
-namespace pv {
-namespace dialogs {
-
-About::About(shared_ptr<Context> context, QWidget *parent) :
- QDialog(parent),
- ui(new Ui::About)
-{
-#ifdef ENABLE_DECODE
- struct srd_decoder *dec;
-#endif
-
- QString s;
-
- ui->setupUi(this);
-
- /* Setup the version field */
- ui->versionInfo->setText(tr("%1 %2<br />%3<br /><a href=\"%4\">%4</a>")
- .arg(QApplication::applicationName(),
- QApplication::applicationVersion(),
- tr("GNU GPL, version 3 or later"),
- QApplication::organizationDomain()));
- ui->versionInfo->setOpenExternalLinks(true);
-
- s.append("<table>");
-
- /* Set up the supported field */
- s.append("<tr><td colspan=\"2\"><b>" +
- tr("Supported hardware drivers:") +
- "</b></td></tr>");
- for (auto entry : context->drivers()) {
- s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
- .arg(QString::fromUtf8(entry.first.c_str()),
- QString::fromUtf8(entry.second->long_name().c_str())));
- }
-
- s.append("<tr><td colspan=\"2\"><b>" +
- tr("Supported input formats:") +
- "</b></td></tr>");
- for (auto entry : context->input_formats()) {
- s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
- .arg(QString::fromUtf8(entry.first.c_str()),
- QString::fromUtf8(entry.second->description().c_str())));
- }
-
- s.append("<tr><td colspan=\"2\"><b>" +
- tr("Supported output formats:") +
- "</b></td></tr>");
- for (auto entry : context->output_formats()) {
- s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
- .arg(QString::fromUtf8(entry.first.c_str()),
- QString::fromUtf8(entry.second->description().c_str())));
- }
-
-#ifdef ENABLE_DECODE
- s.append("<tr><td colspan=\"2\"><b>" +
- tr("Supported protocol decoders:") +
- "</b></td></tr>");
- for (const GSList *l = srd_decoder_list(); l; l = l->next) {
- dec = (struct srd_decoder *)l->data;
- s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
- .arg(QString::fromUtf8(dec->id),
- QString::fromUtf8(dec->longname)));
- }
-#endif
-
- s.append("</table>");
-
- supportedDoc = new QTextDocument(this);
- supportedDoc->setHtml(s);
- ui->supportList->setDocument(supportedDoc);
-}
-
-About::~About()
-{
- delete ui;
-}
-
-} // namespace dialogs
-} // namespace pv
+++ /dev/null
-/*
- * This file is part of the PulseView project.
- *
- * Copyright (C) 2012 Joel Holdsworth <joel@airwebreathe.org.uk>
- *
- * 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, see <http://www.gnu.org/licenses/>.
- */
-
-#ifndef PULSEVIEW_PV_ABOUT_HPP
-#define PULSEVIEW_PV_ABOUT_HPP
-
-#include <QDialog>
-
-#include <memory>
-
-class QTextDocument;
-
-namespace sigrok {
- class Context;
-}
-
-namespace Ui {
-class About;
-}
-
-namespace pv {
-namespace dialogs {
-
-class About : public QDialog
-{
- Q_OBJECT
-
-public:
- explicit About(std::shared_ptr<sigrok::Context> context, QWidget *parent = 0);
- ~About();
-
-private:
- Ui::About *ui;
- QTextDocument *supportedDoc;
-};
-
-} // namespace dialogs
-} // namespace pv
-
-#endif // PULSEVIEW_PV_ABOUT_HPP
+++ /dev/null
-<?xml version="1.0" encoding="UTF-8"?>
-<ui version="4.0">
- <class>About</class>
- <widget class="QDialog" name="About">
- <property name="windowModality">
- <enum>Qt::WindowModal</enum>
- </property>
- <property name="geometry">
- <rect>
- <x>0</x>
- <y>0</y>
- <width>600</width>
- <height>400</height>
- </rect>
- </property>
- <property name="windowTitle">
- <string>About</string>
- </property>
- <property name="whatsThis">
- <string/>
- </property>
- <layout class="QVBoxLayout" name="verticalLayout">
- <item>
- <layout class="QGridLayout" name="gridLayout">
- <item row="0" column="0">
- <widget class="QLabel" name="icon">
- <property name="text">
- <string/>
- </property>
- <property name="pixmap">
- <pixmap resource="pulseview.qrc">:/icons/sigrok-logo-notext.svg</pixmap>
- </property>
- </widget>
- </item>
- <item row="0" column="1">
- <widget class="QLabel" name="versionInfo">
- <property name="text">
- <string/>
- </property>
- </widget>
- </item>
- <item row="1" column="1">
- <widget class="QTextBrowser" name="supportList"/>
- </item>
- </layout>
- </item>
- <item>
- <widget class="QDialogButtonBox" name="buttonBox">
- <property name="orientation">
- <enum>Qt::Horizontal</enum>
- </property>
- <property name="standardButtons">
- <set>QDialogButtonBox::Ok</set>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- <resources>
- <include location="pulseview.qrc"/>
- </resources>
- <connections>
- <connection>
- <sender>buttonBox</sender>
- <signal>accepted()</signal>
- <receiver>About</receiver>
- <slot>accept()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>248</x>
- <y>254</y>
- </hint>
- <hint type="destinationlabel">
- <x>157</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- <connection>
- <sender>buttonBox</sender>
- <signal>rejected()</signal>
- <receiver>About</receiver>
- <slot>reject()</slot>
- <hints>
- <hint type="sourcelabel">
- <x>316</x>
- <y>260</y>
- </hint>
- <hint type="destinationlabel">
- <x>286</x>
- <y>274</y>
- </hint>
- </hints>
- </connection>
- </connections>
-</ui>
* along with this program; if not, see <http://www.gnu.org/licenses/>.
*/
-#include "settings.hpp"
-#include "pv/globalsettings.hpp"
-
+#include <QApplication>
#include <QCheckBox>
#include <QDialogButtonBox>
#include <QFormLayout>
#include <QGroupBox>
#include <QHBoxLayout>
+#include <QLabel>
+#include <QString>
+#include <QTextBrowser>
+#include <QTextDocument>
#include <QVBoxLayout>
+#include "settings.hpp"
+
+#include "pv/devicemanager.hpp"
+#include "pv/globalsettings.hpp"
+
+#include <libsigrokcxx/libsigrokcxx.hpp>
+
+#ifdef ENABLE_DECODE
+#include <libsigrokdecode/libsigrokdecode.h>
+#endif
+
namespace pv {
namespace dialogs {
-Settings::Settings(QWidget *parent) :
- QDialog(parent, nullptr)
+Settings::Settings(DeviceManager &device_manager, QWidget *parent) :
+ QDialog(parent, nullptr),
+ device_manager_(device_manager)
{
const int icon_size = 64;
+ resize(600, 400);
+
page_list = new QListWidget;
page_list->setViewMode(QListView::IconMode);
page_list->setIconSize(QSize(icon_size, icon_size));
viewButton->setText(tr("Views"));
viewButton->setTextAlignment(Qt::AlignHCenter);
viewButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
+
+ // About page
+ pages->addWidget(get_about_page(pages));
+
+ QListWidgetItem *aboutButton = new QListWidgetItem(page_list);
+ aboutButton->setIcon(QIcon(":/icons/information.svg"));
+ aboutButton->setText(tr("About"));
+ aboutButton->setTextAlignment(Qt::AlignHCenter);
+ aboutButton->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled);
}
QWidget *Settings::get_view_settings_form(QWidget *parent) const
return form;
}
+QWidget *Settings::get_about_page(QWidget *parent) const
+{
+#ifdef ENABLE_DECODE
+ struct srd_decoder *dec;
+#endif
+
+ QLabel *icon = new QLabel();
+ icon->setPixmap(QPixmap(QString::fromUtf8(":/icons/sigrok-logo-notext.svg")));
+
+ /* Setup the version field */
+ QLabel *version_info = new QLabel();
+ version_info->setText(tr("%1 %2<br />%3<br /><a href=\"http://%4\">%4</a>")
+ .arg(QApplication::applicationName(),
+ QApplication::applicationVersion(),
+ tr("GNU GPL, version 3 or later"),
+ QApplication::organizationDomain()));
+ version_info->setOpenExternalLinks(true);
+
+ std::shared_ptr<sigrok::Context> context = device_manager_.context();
+
+ QString s;
+ s.append("<table>");
+
+ /* Set up the supported field */
+ s.append("<tr><td colspan=\"2\"><b>" +
+ tr("Supported hardware drivers:") +
+ "</b></td></tr>");
+ for (auto entry : context->drivers()) {
+ s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
+ .arg(QString::fromUtf8(entry.first.c_str()),
+ QString::fromUtf8(entry.second->long_name().c_str())));
+ }
+
+ s.append("<tr><td colspan=\"2\"><b>" +
+ tr("Supported input formats:") +
+ "</b></td></tr>");
+ for (auto entry : context->input_formats()) {
+ s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
+ .arg(QString::fromUtf8(entry.first.c_str()),
+ QString::fromUtf8(entry.second->description().c_str())));
+ }
+
+ s.append("<tr><td colspan=\"2\"><b>" +
+ tr("Supported output formats:") +
+ "</b></td></tr>");
+ for (auto entry : context->output_formats()) {
+ s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
+ .arg(QString::fromUtf8(entry.first.c_str()),
+ QString::fromUtf8(entry.second->description().c_str())));
+ }
+
+#ifdef ENABLE_DECODE
+ s.append("<tr><td colspan=\"2\"><b>" +
+ tr("Supported protocol decoders:") +
+ "</b></td></tr>");
+ for (const GSList *l = srd_decoder_list(); l; l = l->next) {
+ dec = (struct srd_decoder *)l->data;
+ s.append(QString("<tr><td><i>%1</i></td><td>%2</td></tr>")
+ .arg(QString::fromUtf8(dec->id),
+ QString::fromUtf8(dec->longname)));
+ }
+#endif
+
+ s.append("</table>");
+
+ QTextDocument *supported_doc = new QTextDocument();
+ supported_doc->setHtml(s);
+
+ QTextBrowser *support_list = new QTextBrowser();
+ support_list->setDocument(supported_doc);
+
+ QGridLayout *layout = new QGridLayout();
+ layout->addWidget(icon, 0, 0, 1, 1);
+ layout->addWidget(version_info, 0, 1, 1, 1);
+ layout->addWidget(support_list, 1, 1, 1, 1);
+
+ QWidget *page = new QWidget(parent);
+ page->setLayout(layout);
+
+ return page;
+}
+
void Settings::accept()
{
GlobalSettings settings;
#include <QStackedWidget>
namespace pv {
+
+class DeviceManager;
+
namespace dialogs {
class Settings : public QDialog
Q_OBJECT
public:
- Settings(QWidget *parent = 0);
+ Settings(DeviceManager &device_manager, QWidget *parent = 0);
void create_pages();
QWidget *get_view_settings_form(QWidget *parent) const;
+ QWidget *get_about_page(QWidget *parent) const;
void accept();
void reject();
void on_view_colouredBG_changed(int state);
private:
+ DeviceManager &device_manager_;
QListWidget *page_list;
QStackedWidget *pages;
};
#include "globalsettings.hpp"
#include "util.hpp"
#include "devices/hardwaredevice.hpp"
-#include "dialogs/about.hpp"
#include "dialogs/settings.hpp"
#include "toolbars/mainbar.hpp"
#include "view/view.hpp"
device_manager_(device_manager),
session_selector_(this),
session_state_mapper_(this),
- action_about_(new QAction(this)),
icon_red_(":/icons/status-red.svg"),
icon_green_(":/icons/status-green.svg"),
icon_grey_(":/icons/status-grey.svg")
remove_session(sessions_.front());
}
-QAction* MainWindow::action_about() const
-{
- return action_about_;
-}
-
shared_ptr<views::ViewBase> MainWindow::get_active_view() const
{
// If there's only one view, use it...
view_coloured_bg_shortcut_ = new QShortcut(QKeySequence(Qt::Key_B), this, SLOT(on_view_coloured_bg_shortcut()));
view_coloured_bg_shortcut_->setAutoRepeat(false);
- action_about_->setObjectName(QString::fromUtf8("actionAbout"));
- action_about_->setToolTip(tr("&About..."));
-
// Set up the tab area
new_session_button_ = new QToolButton();
new_session_button_->setIcon(QIcon::fromTheme("document-new",
void MainWindow::on_settings_clicked()
{
- dialogs::Settings dlg;
+ dialogs::Settings dlg(device_manager_);
dlg.exec();
}
}
}
-void MainWindow::on_actionAbout_triggered()
-{
- dialogs::About dlg(device_manager_.context(), this);
- dlg.exec();
-}
-
void MainWindow::on_close_current_tab()
{
int tab = session_selector_.currentIndex();
~MainWindow();
- QAction* action_about() const;
-
std::shared_ptr<views::ViewBase> get_active_view() const;
std::shared_ptr<views::ViewBase> add_view(const QString &title,
void on_settingViewColouredBg_changed(const QVariant new_value);
- void on_actionAbout_triggered();
-
void on_close_current_tab();
private:
QTabWidget session_selector_;
QSignalMapper session_state_mapper_;
- QAction *const action_about_;
-
QIcon icon_red_;
QIcon icon_green_;
QIcon icon_grey_;