]> sigrok.org Git - pulseview.git/blobdiff - pv/toolbars/mainbar.hpp
MainBar: Support having no selected device
[pulseview.git] / pv / toolbars / mainbar.hpp
index d5d79c821c67fcf8d0f7a85e4515368924242df0..6e2a706833bc566c687e3d20a6bc7da51919de04 100644 (file)
@@ -18,8 +18,8 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
  */
 
-#ifndef PULSEVIEW_PV_TOOLBARS_MAINBAR_H
-#define PULSEVIEW_PV_TOOLBARS_MAINBAR_H
+#ifndef PULSEVIEW_PV_TOOLBARS_MAINBAR_HPP
+#define PULSEVIEW_PV_TOOLBARS_MAINBAR_HPP
 
 #include <stdint.h>
 
 
 #include <QComboBox>
 #include <QDoubleSpinBox>
+#include <QMenu>
 #include <QToolBar>
 #include <QToolButton>
 
 #include <pv/session.hpp>
+#include <pv/widgets/devicetoolbutton.hpp>
 #include <pv/widgets/popuptoolbutton.hpp>
 #include <pv/widgets/sweeptimingwidget.hpp>
 
 namespace sigrok {
-       class Device;
+class Device;
+class InputFormat;
 }
 
 Q_DECLARE_METATYPE(std::shared_ptr<sigrok::Device>)
@@ -62,17 +65,10 @@ private:
 public:
        MainBar(Session &session, pv::MainWindow &main_window);
 
-       void set_device_list(
-               const std::list< std::shared_ptr<sigrok::Device> > &devices,
-               std::shared_ptr<sigrok::Device> selected);
-
-       std::shared_ptr<sigrok::Device> get_selected_device() const;
+       void update_device_list();
 
        void set_capture_state(pv::Session::capture_state state);
 
-Q_SIGNALS:
-       void run_stop();
-
 private:
        void update_sample_rate_selector();
        void update_sample_rate_selector_value();
@@ -96,13 +92,13 @@ private:
        Session &session_;
        MainWindow &main_window_;
 
-       QComboBox device_selector_;
-       bool updating_device_selector_;
+       pv::widgets::DeviceToolButton device_selector_;
 
        pv::widgets::PopupToolButton configure_button_;
        QAction *configure_button_action_;
 
        pv::widgets::PopupToolButton channels_button_;
+       QAction *channels_button_action_;
 
        pv::widgets::SweepTimingWidget sample_count_;
        pv::widgets::SweepTimingWidget sample_rate_;
@@ -115,9 +111,12 @@ private:
        QIcon icon_green_;
        QIcon icon_grey_;
        QToolButton run_stop_button_;
+       QAction *run_stop_button_action_;
+
+       QToolButton menu_button_;
 };
 
 } // namespace toolbars
 } // namespace pv
 
-#endif // PULSEVIEW_PV_TOOLBARS_MAINBAR_H
+#endif // PULSEVIEW_PV_TOOLBARS_MAINBAR_HPP