pv/view/decode/annotation.cpp
pv/widgets/colourbutton.cpp
pv/widgets/colourpopup.cpp
+ pv/widgets/decodergroupbox.cpp
pv/widgets/decodermenu.cpp
pv/widgets/popup.cpp
pv/widgets/popuptoolbutton.cpp
pv/view/viewport.h
pv/widgets/colourbutton.h
pv/widgets/colourpopup.h
+ pv/widgets/decodergroupbox.h
pv/widgets/decodermenu.h
pv/widgets/popup.h
pv/widgets/popuptoolbutton.h
--- /dev/null
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg id="svg2989" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="16" width="16" version="1.1" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <metadata id="metadata2994">
+ <rdf:RDF>
+ <cc:Work rdf:about="">
+ <dc:format>image/svg+xml</dc:format>
+ <dc:type rdf:resource="http://purl.org/dc/dcmitype/StillImage"/>
+ <dc:title/>
+ </cc:Work>
+ </rdf:RDF>
+ </metadata>
+ <g id="layer1" stroke-linejoin="miter" style="stroke-dasharray:none;" transform="translate(0,-1036.3622)" stroke="#000" stroke-linecap="square" stroke-miterlimit="4" stroke-width="2" fill="none">
+ <path id="path3007" style="stroke-dasharray:none;" d="m11,1047.4-6-6"/>
+ <path id="path2986" style="stroke-dasharray:none;" d="m5,1047.4,6-6"/>
+ </g>
+</svg>
<qresource prefix="/" >
<file>icons/application-exit.png</file>
<file>icons/configure.png</file>
+ <file>icons/decoder-delete.svg</file>
<file>icons/document-open.png</file>
<file>icons/probes.svg</file>
<file>icons/sigrok-logo-notext.png</file>
#include <pv/view/logicsignal.h>
#include <pv/view/view.h>
#include <pv/view/decode/annotation.h>
+#include <pv/widgets/decodergroupbox.h>
#include <pv/widgets/decodermenu.h>
using namespace boost;
const srd_decoder *const decoder = dec->decoder();
assert(decoder);
- form->addRow(new QLabel(tr("<h3>%1</h3>").arg(decoder->name), parent));
+ pv::widgets::DecoderGroupBox *const group =
+ new pv::widgets::DecoderGroupBox(decoder->name);
+ QFormLayout *const decoder_form = new QFormLayout;
+ group->add_layout(decoder_form);
// Add the mandatory probes
for(probe = decoder->probes; probe; probe = probe->next) {
QComboBox *const combo = create_probe_selector(parent, dec, p);
connect(combo, SIGNAL(currentIndexChanged(int)),
this, SLOT(on_probe_selected(int)));
- form->addRow(tr("<b>%1</b> (%2) *")
+ decoder_form->addRow(tr("<b>%1</b> (%2) *")
.arg(p->name).arg(p->desc), combo);
const ProbeSelector s = {combo, dec, p};
QComboBox *const combo = create_probe_selector(parent, dec, p);
connect(combo, SIGNAL(currentIndexChanged(int)),
this, SLOT(on_probe_selected(int)));
- form->addRow(tr("<b>%1</b> (%2)")
+ decoder_form->addRow(tr("<b>%1</b> (%2)")
.arg(p->name).arg(p->desc), combo);
const ProbeSelector s = {combo, dec, p};
// Add the options
shared_ptr<prop::binding::DecoderOptions> binding(
new prop::binding::DecoderOptions(_decoder_stack, dec));
- binding->add_properties_to_form(form, true);
+ binding->add_properties_to_form(decoder_form, true);
_bindings.push_back(binding);
+
+ form->addRow(group);
}
QComboBox* DecodeTrace::create_probe_selector(
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#include "decodergroupbox.h"
+
+#include <QAction>
+#include <QHBoxLayout>
+#include <QLabel>
+#include <QToolBar>
+#include <QVBoxLayout>
+
+#include <assert.h>
+
+namespace pv {
+namespace widgets {
+
+DecoderGroupBox::DecoderGroupBox(QString title, QWidget *parent) :
+ QWidget(parent),
+ _layout(new QGridLayout)
+{
+ _layout->setContentsMargins(0, 0, 0, 0);
+ setLayout(_layout);
+
+ _layout->addWidget(new QLabel(QString("<h2>%1</h2><hl/>").arg(title)),
+ 0, 0);
+ _layout->setColumnStretch(0, 1);
+
+ QToolBar *const toolbar = new QToolBar;
+ toolbar->setIconSize(QSize(16, 16));
+ _layout->addWidget(toolbar, 0, 1);
+
+ QAction *const delete_action = new QAction(
+ QIcon(":/icons/decoder-delete.svg"), tr("Delete"), this);
+ connect(delete_action, SIGNAL(triggered()),
+ this, SIGNAL(delete_decoder()));
+ toolbar->addAction(delete_action);
+}
+
+void DecoderGroupBox::add_layout(QLayout *layout)
+{
+ assert(layout);
+ _layout->addLayout(layout, 1, 0, 1, 2);
+}
+
+} // widgets
+} // pv
--- /dev/null
+/*
+ * This file is part of the PulseView project.
+ *
+ * Copyright (C) 2013 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, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
+ */
+
+#ifndef PULSEVIEW_PV_WIDGETS_DECODERGROUPBox_H
+#define PULSEVIEW_PV_WIDGETS_DECODERGROUPBOX_H
+
+#include <QWidget>
+
+class QGridLayout;
+class QToolBar;
+
+namespace pv {
+namespace widgets {
+
+class DecoderGroupBox : public QWidget
+{
+ Q_OBJECT
+
+public:
+ DecoderGroupBox(QString title, QWidget *parent = NULL);
+
+ void add_layout(QLayout *layout);
+
+signals:
+ void delete_decoder();
+
+private:
+ QGridLayout *const _layout;
+};
+
+} // widgets
+} // pv
+
+#endif // PULSEVIEW_PV_WIDGETS_DECODERGROUPBOX_H
${PROJECT_SOURCE_DIR}/pv/view/decode/annotation.cpp
${PROJECT_SOURCE_DIR}/pv/widgets/colourbutton.cpp
${PROJECT_SOURCE_DIR}/pv/widgets/colourpopup.cpp
+ ${PROJECT_SOURCE_DIR}/pv/widgets/decodergroupbox.cpp
${PROJECT_SOURCE_DIR}/pv/widgets/decodermenu.cpp
${PROJECT_SOURCE_DIR}/pv/widgets/popup.cpp
${PROJECT_SOURCE_DIR}/pv/widgets/wellarray.cpp
${PROJECT_SOURCE_DIR}/pv/view/viewport.h
${PROJECT_SOURCE_DIR}/pv/widgets/colourbutton.h
${PROJECT_SOURCE_DIR}/pv/widgets/colourpopup.h
+ ${PROJECT_SOURCE_DIR}/pv/widgets/decodergroupbox.h
${PROJECT_SOURCE_DIR}/pv/widgets/decodermenu.h
${PROJECT_SOURCE_DIR}/pv/widgets/popup.h
${PROJECT_SOURCE_DIR}/pv/widgets/wellarray.h