X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;f=pv%2Ftoolbars%2Fsamplingbar.h;h=2397e2aa5c20b6821b4e2159f20bd9598a5346fd;hb=8dbbc7f0b9ea59d0f0d62225772f8a56eee125f5;hp=e59d2f9f0b195da8417c126de2ea6f4ec7f53539;hpb=e95e8563a1de0d2045cb8f30083889896b6c94df;p=pulseview.git diff --git a/pv/toolbars/samplingbar.h b/pv/toolbars/samplingbar.h index e59d2f9..2397e2a 100644 --- a/pv/toolbars/samplingbar.h +++ b/pv/toolbars/samplingbar.h @@ -24,9 +24,7 @@ #include #include -#include - -#include +#include #include #include @@ -37,16 +35,18 @@ #include #include +namespace sigrok { + class Device; +} + +Q_DECLARE_METATYPE(std::shared_ptr) + class QAction; namespace pv { class SigSession; -namespace device { -class DevInst; -} - namespace toolbars { class SamplingBar : public QToolBar @@ -62,15 +62,14 @@ public: SamplingBar(SigSession &session, QWidget *parent); void set_device_list( - const std::list< boost::shared_ptr > - &devices, - boost::shared_ptr selected); + const std::list< std::pair, std::string> > &devices, + std::shared_ptr selected); - boost::shared_ptr get_selected_device() const; + std::shared_ptr get_selected_device() const; void set_capture_state(pv::SigSession::capture_state state); -signals: +Q_SIGNALS: void run_stop(); private: @@ -81,7 +80,7 @@ private: void commit_sample_rate(); void commit_sample_count(); -private slots: +private Q_SLOTS: void on_device_selected(); void on_sample_count_changed(); void on_sample_rate_changed(); @@ -89,30 +88,31 @@ private slots: void on_config_changed(); +protected: + bool eventFilter(QObject *watched, QEvent *event); + private: - SigSession &_session; + SigSession &session_; - QComboBox _device_selector; - std::map > - _device_selector_map; - bool _updating_device_selector; + QComboBox device_selector_; + bool updating_device_selector_; - pv::widgets::PopupToolButton _configure_button; - QAction *_configure_button_action; + pv::widgets::PopupToolButton configure_button_; + QAction *configure_button_action_; - pv::widgets::PopupToolButton _probes_button; + pv::widgets::PopupToolButton channels_button_; - pv::widgets::SweepTimingWidget _sample_count; - pv::widgets::SweepTimingWidget _sample_rate; - bool _updating_sample_rate; - bool _updating_sample_count; + pv::widgets::SweepTimingWidget sample_count_; + pv::widgets::SweepTimingWidget sample_rate_; + bool updating_sample_rate_; + bool updating_sample_count_; - bool _sample_count_supported; + bool sample_count_supported_; - QIcon _icon_red; - QIcon _icon_green; - QIcon _icon_grey; - QToolButton _run_stop_button; + QIcon icon_red_; + QIcon icon_green_; + QIcon icon_grey_; + QToolButton run_stop_button_; }; } // namespace toolbars