From: Joel Holdsworth Date: Sat, 10 Jan 2015 16:20:43 +0000 (+0000) Subject: MainBar: Added add-decoder button X-Git-Tag: pulseview-0.3.0~266 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=168888e25af380e62280acec3e3f316bbfed09d9;p=pulseview.git MainBar: Added add-decoder button --- diff --git a/icons/add-decoder.svg b/icons/add-decoder.svg new file mode 100644 index 00000000..58167bad --- /dev/null +++ b/icons/add-decoder.svg @@ -0,0 +1,7 @@ + + + + + + + diff --git a/pulseview.qrc b/pulseview.qrc index 3c61bc69..2fdcb064 100644 --- a/pulseview.qrc +++ b/pulseview.qrc @@ -1,5 +1,6 @@ + icons/add-decoder.svg icons/application-exit.png icons/configure.png icons/decoder-delete.svg diff --git a/pv/toolbars/mainbar.cpp b/pv/toolbars/mainbar.cpp index 61a46728..82b5fab0 100644 --- a/pv/toolbars/mainbar.cpp +++ b/pv/toolbars/mainbar.cpp @@ -82,6 +82,15 @@ MainBar::MainBar(Session &session, MainWindow &main_window) : setMovable(false); setFloatable(false); + // Setup the decoder button +#ifdef ENABLE_DECODE + QToolButton *add_decoder_button = new QToolButton(this); + add_decoder_button->setIcon(QIcon::fromTheme("add-decoder", + QIcon(":/icons/add-decoder.svg"))); + add_decoder_button->setPopupMode(QToolButton::InstantPopup); + add_decoder_button->setMenu(main_window_.menu_decoder_add()); +#endif + // Setup the menu QMenu *const menu = new QMenu(this); @@ -137,6 +146,10 @@ MainBar::MainBar(Session &session, MainWindow &main_window) : addWidget(&sample_count_); addWidget(&sample_rate_); addWidget(&run_stop_button_); +#ifdef ENABLE_DECODE + addSeparator(); + addWidget(add_decoder_button); +#endif QWidget *const spacer = new QWidget(); spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);