X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fwidgets%2Fdecodergroupbox.cpp;h=f5b9f2533378e938f0a918510229e4da204f5526;hp=7127ba1310fadaf01ca97c760b6f3e56fca5a898;hb=c063290ac7189bdd15221450f598504f43286b43;hpb=2acdb232d6bb452cfdfaea3ef5218fb4da592329 diff --git a/pv/widgets/decodergroupbox.cpp b/pv/widgets/decodergroupbox.cpp index 7127ba13..f5b9f253 100644 --- a/pv/widgets/decodergroupbox.cpp +++ b/pv/widgets/decodergroupbox.cpp @@ -14,8 +14,7 @@ * 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 + * along with this program; if not, see . */ #include "decodergroupbox.hpp" @@ -25,12 +24,12 @@ #include #include -#include +#include namespace pv { namespace widgets { -DecoderGroupBox::DecoderGroupBox(QString title, QWidget *parent) : +DecoderGroupBox::DecoderGroupBox(QString title, QWidget *parent, bool isDeletable) : QWidget(parent), layout_(new QGridLayout), show_hide_button_(QIcon(":/icons/decoder-shown.svg"), QString(), this) @@ -38,8 +37,7 @@ DecoderGroupBox::DecoderGroupBox(QString title, QWidget *parent) : layout_->setContentsMargins(0, 0, 0, 0); setLayout(layout_); - layout_->addWidget(new QLabel(QString("

%1

").arg(title)), - 0, 0); + layout_->addWidget(new QLabel(QString("

%1

").arg(title)), 0, 0); layout_->setColumnStretch(0, 1); QHBoxLayout *const toolbar = new QHBoxLayout; @@ -51,13 +49,15 @@ DecoderGroupBox::DecoderGroupBox(QString title, QWidget *parent) : this, SIGNAL(show_hide_decoder())); toolbar->addWidget(&show_hide_button_); - QPushButton *const delete_button = new QPushButton( - QIcon(":/icons/decoder-delete.svg"), QString(), this); - delete_button->setFlat(true); - delete_button->setIconSize(QSize(16, 16)); - connect(delete_button, SIGNAL(clicked()), - this, SIGNAL(delete_decoder())); - toolbar->addWidget(delete_button); + if (isDeletable) { + QPushButton *const delete_button = new QPushButton( + QIcon(":/icons/decoder-delete.svg"), QString(), this); + delete_button->setFlat(true); + delete_button->setIconSize(QSize(16, 16)); + connect(delete_button, SIGNAL(clicked()), + this, SIGNAL(delete_decoder())); + toolbar->addWidget(delete_button); + } } void DecoderGroupBox::add_layout(QLayout *layout)