X-Git-Url: http://git.code-monkey.de/?a=blobdiff_plain;ds=sidebyside;f=pv%2Fmainwindow.hpp;h=5f4609d90b42e3824d3116b1431cc05abcfc1ab3;hb=5e685656d6686eb66a39450d1b324f6382fc60c5;hp=6541ccc6dff181e2cf386ed75657f5c0ecf11d1c;hpb=8ad61f4071a69445a6917d214b6592878447ddb1;p=pulseview.git diff --git a/pv/mainwindow.hpp b/pv/mainwindow.hpp index 6541ccc..5f4609d 100644 --- a/pv/mainwindow.hpp +++ b/pv/mainwindow.hpp @@ -30,6 +30,7 @@ #include #include +#include "globalsettings.hpp" #include "session.hpp" #include "views/viewbase.hpp" @@ -61,7 +62,7 @@ class DecoderMenu; #endif } -class MainWindow : public QMainWindow +class MainWindow : public QMainWindow, public GlobalSettingsInterface { Q_OBJECT @@ -70,12 +71,12 @@ private: public: explicit MainWindow(DeviceManager &device_manager, - string open_file_name = string(), - string open_file_format = string(), QWidget *parent = nullptr); ~MainWindow(); + static void show_session_error(const QString text, const QString info_text); + shared_ptr get_active_view() const; shared_ptr add_view(const QString &title, @@ -87,11 +88,19 @@ public: void remove_session(shared_ptr session); + void add_session_with_file(string open_file_name, string open_file_format); + + void add_default_session(); + + void save_sessions(); + void restore_sessions(); + + void on_setting_changed(const QString &key, const QVariant &value); + private: void setup_ui(); void save_ui_settings(); - void restore_ui_settings(); shared_ptr get_tab_session(int index) const; @@ -102,11 +111,7 @@ private: virtual bool restoreState(const QByteArray &state, int version = 0); - void session_error(const QString text, const QString info_text); - private Q_SLOTS: - void show_session_error(const QString text, const QString info_text); - void on_add_view(const QString &title, views::ViewType type, Session *session);