]> sigrok.org Git - pulseview.git/commitdiff
MainBar: Added add-decoder button
authorJoel Holdsworth <redacted>
Sat, 10 Jan 2015 16:20:43 +0000 (16:20 +0000)
committerJoel Holdsworth <redacted>
Sat, 10 Jan 2015 16:32:16 +0000 (16:32 +0000)
icons/add-decoder.svg [new file with mode: 0644]
pulseview.qrc
pv/toolbars/mainbar.cpp

diff --git a/icons/add-decoder.svg b/icons/add-decoder.svg
new file mode 100644 (file)
index 0000000..58167ba
--- /dev/null
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg id="svg2" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://www.w3.org/2000/svg" height="24" width="24" version="1.0" xmlns:cc="http://creativecommons.org/ns#" xmlns:dc="http://purl.org/dc/elements/1.1/">
+ <path id="path2989" d="m1.5 12.5h21" stroke="#888a85" stroke-linecap="square" stroke-width="1px" fill="none"/>
+ <path id="path2991" d="m3.5 12.5 2-5h2l2 5-2 5h-2z" stroke="#967b00" stroke-width="1px" fill="#edd400"/>
+ <path id="path3012" d="m9.5 12.5 2-5 7 4e-7 2 5-2 5-7-0.000005z" stroke="#4e9a06" stroke-width="1px" fill="#73d216"/>
+</svg>
index 3c61bc69a327a022e382532d66a71f5b4e6a7edb..2fdcb06487738ee5dca8b2922a07e84787326f63 100644 (file)
@@ -1,5 +1,6 @@
 <RCC>
     <qresource prefix="/" >
 <RCC>
     <qresource prefix="/" >
+       <file>icons/add-decoder.svg</file>
        <file>icons/application-exit.png</file>
        <file>icons/configure.png</file>
        <file>icons/decoder-delete.svg</file>
        <file>icons/application-exit.png</file>
        <file>icons/configure.png</file>
        <file>icons/decoder-delete.svg</file>
index 61a467281520de949664fb15b41746e7b8a54c8a..82b5fab04dc097cdaebfcb2f62dc19ff34164a1b 100644 (file)
@@ -82,6 +82,15 @@ MainBar::MainBar(Session &session, MainWindow &main_window) :
        setMovable(false);
        setFloatable(false);
 
        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);
 
        // 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_);
        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);
 
        QWidget *const spacer = new QWidget();
        spacer->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Expanding);