X-Git-Url: https://sigrok.org/gitweb/?a=blobdiff_plain;f=pv%2Fmainwindow.hpp;h=e10d1817f947ecb68387cf2f8bd154a3736050cf;hb=cd38c84cb223ba9ecb01d9b0fc0ac11cd9e1d7a1;hp=6f3676c214f24c7343ed62bde29fe1446d1d036f;hpb=8ba6f8b7541409dd33fd4ddd1b51494f555773c9;p=pulseview.git diff --git a/pv/mainwindow.hpp b/pv/mainwindow.hpp index 6f3676c2..e10d1817 100644 --- a/pv/mainwindow.hpp +++ b/pv/mainwindow.hpp @@ -26,13 +26,11 @@ #include #include -#include #include #include #include "session.hpp" #include "subwindows/subwindowbase.hpp" -#include "views/viewbase.hpp" using std::list; using std::map; @@ -54,6 +52,7 @@ class MainBar; namespace view { class View; +class ViewBase; } namespace widgets { @@ -62,6 +61,9 @@ class DecoderMenu; #endif } +using pv::views::ViewBase; +using pv::views::ViewType; + class MainWindow : public QMainWindow { Q_OBJECT @@ -79,10 +81,9 @@ public: shared_ptr get_active_view() const; - shared_ptr add_view(const QString &title, - views::ViewType type, Session &session); + shared_ptr add_view(ViewType type, Session &session); - void remove_view(shared_ptr view); + void remove_view(shared_ptr view); shared_ptr add_subwindow( subwindows::SubWindowType type, Session &session); @@ -101,6 +102,7 @@ public: private: void setup_ui(); + void update_acq_button(Session *session); void save_ui_settings(); void restore_ui_settings(); @@ -113,21 +115,23 @@ private: virtual bool restoreState(const QByteArray &state, int version = 0); +public Q_SLOTS: + void on_run_stop_clicked(); + private Q_SLOTS: - void on_add_view(const QString &title, views::ViewType type, - Session *session); + void on_add_view(ViewType type, Session *session); void on_focus_changed(); void on_focused_session_changed(shared_ptr session); void on_new_session_clicked(); - void on_run_stop_clicked(); void on_settings_clicked(); void on_session_name_changed(); - void on_capture_state_changed(QObject *obj); + void on_session_device_changed(); + void on_session_capture_state_changed(int state); - void on_new_view(Session *session); + void on_new_view(Session *session, int view_type); void on_view_close_clicked(); void on_tab_changed(int index); @@ -157,7 +161,6 @@ private: QWidget *static_tab_widget_; QToolButton *new_session_button_, *run_stop_button_, *settings_button_; QTabWidget session_selector_; - QSignalMapper session_state_mapper_; QIcon icon_red_; QIcon icon_green_;