]> sigrok.org Git - pulseview.git/blobdiff - pv/mainwindow.hpp
Session: Fix issue #67 by improving error handling
[pulseview.git] / pv / mainwindow.hpp
index 522ab1c0478ea7d1def85a90ada942733735f182..493e3a55cc0dec32b3ca6e1471138dd0a0bdeac7 100644 (file)
@@ -31,7 +31,6 @@
 
 #include "session.hpp"
 #include "subwindows/subwindowbase.hpp"
-#include "views/viewbase.hpp"
 
 using std::list;
 using std::map;
@@ -53,6 +52,7 @@ class MainBar;
 
 namespace view {
 class View;
+class ViewBase;
 }
 
 namespace widgets {
@@ -61,6 +61,9 @@ class DecoderMenu;
 #endif
 }
 
+using pv::views::ViewBase;
+using pv::views::ViewType;
+
 class MainWindow : public QMainWindow
 {
        Q_OBJECT
@@ -78,9 +81,9 @@ public:
 
        shared_ptr<views::ViewBase> get_active_view() const;
 
-       shared_ptr<views::ViewBase> add_view(views::ViewType type, Session &session);
+       shared_ptr<views::ViewBase> add_view(ViewType type, Session &session);
 
-       void remove_view(shared_ptr<views::ViewBase> view);
+       void remove_view(shared_ptr<ViewBase> view);
 
        shared_ptr<subwindows::SubWindowBase> add_subwindow(
                subwindows::SubWindowType type, Session &session);
@@ -112,14 +115,20 @@ private:
 
        virtual bool restoreState(const QByteArray &state, int version = 0);
 
+Q_SIGNALS:
+       void session_error_raised(const QString text, const QString info_text);
+
+public Q_SLOTS:
+       void on_run_stop_clicked();
+       void on_session_error_raised(const QString text, const QString info_text);
+
 private Q_SLOTS:
-       void on_add_view(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> session);
 
        void on_new_session_clicked();
-       void on_run_stop_clicked();
        void on_settings_clicked();
 
        void on_session_name_changed();