X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fmainwindow.hpp;h=2448a3570d45b9f10187a480d6ef7a85dcf5a83d;hp=485b7b6df18243e8a7aa2085290639b86e6268e5;hb=cbf7b5db5c3c04b95daf77bc0e6dc112c15e0195;hpb=0f8f8c180b32413177f3940ea6f216d1cbadf09b diff --git a/pv/mainwindow.hpp b/pv/mainwindow.hpp index 485b7b6d..2448a357 100644 --- a/pv/mainwindow.hpp +++ b/pv/mainwindow.hpp @@ -26,9 +26,10 @@ #include #include +#include #include "session.hpp" -#include "view/viewwidget.hpp" +#include "views/viewbase.hpp" struct srd_decoder; @@ -57,6 +58,9 @@ class MainWindow : public QMainWindow { Q_OBJECT +private: + static const QString WindowTitle; + public: explicit MainWindow(DeviceManager &device_manager, std::string open_file_name = std::string(), @@ -69,10 +73,14 @@ public: QAction* action_view_coloured_bg() const; QAction* action_about() const; - std::shared_ptr get_active_view() const; + std::shared_ptr get_active_view() const; + + std::shared_ptr add_view(const QString &title, + views::ViewType type, Session &session); + + std::shared_ptr add_session(); - std::shared_ptr add_view(const QString &title, - view::ViewType type, Session &session); + void remove_session(std::shared_ptr session); private: void setup_ui(); @@ -89,6 +97,16 @@ private: virtual bool restoreState(const QByteArray &state, int version = 0); private Q_SLOTS: + void on_add_view(const QString &title, views::ViewType type, + Session *session); + + void on_focus_changed(); + + void on_new_session(); + void on_session_name_changed(); + void on_new_view(Session *session); + void on_view_close_clicked(); + void on_actionViewStickyScrolling_triggered(); void on_actionViewColouredBg_triggered(); @@ -98,12 +116,13 @@ private Q_SLOTS: private: DeviceManager &device_manager_; - Session session_; + std::list< std::shared_ptr > sessions_; + + std::map< QDockWidget*, std::shared_ptr > view_docks_; - std::map< std::shared_ptr, - std::shared_ptr > view_docks_; + std::map< std::shared_ptr, QMainWindow*> session_windows_; - std::string open_file_name_, open_file_format_; + QTabWidget session_selector_; QAction *const action_view_sticky_scrolling_; QAction *const action_view_coloured_bg_;