X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=blobdiff_plain;f=pv%2Fmainwindow.hpp;h=3cffb54b47ce85f36a49d5a2c85216714751d0ea;hp=a99e0adf9c7b4604c8b04c22869c45805531890a;hb=bf84211be02b096646cf28cf9dc7480029e4f439;hpb=9b64f2dfe9179f665ef97c0d0ac992274864f4a4 diff --git a/pv/mainwindow.hpp b/pv/mainwindow.hpp index a99e0adf..3cffb54b 100644 --- a/pv/mainwindow.hpp +++ b/pv/mainwindow.hpp @@ -25,14 +25,20 @@ #include #include +#include #include -#include #include -#include +#include +#include "globalsettings.hpp" #include "session.hpp" #include "views/viewbase.hpp" +using std::list; +using std::map; +using std::shared_ptr; +using std::string; + struct srd_decoder; class QVBoxLayout; @@ -56,7 +62,7 @@ class DecoderMenu; #endif } -class MainWindow : public QMainWindow +class MainWindow : public QMainWindow, public GlobalSettingsInterface { Q_OBJECT @@ -65,31 +71,37 @@ private: public: explicit MainWindow(DeviceManager &device_manager, - std::string open_file_name = std::string(), - std::string open_file_format = std::string(), - QWidget *parent = 0); + QWidget *parent = nullptr); ~MainWindow(); - std::shared_ptr get_active_view() const; + shared_ptr get_active_view() const; - std::shared_ptr add_view(const QString &title, + shared_ptr add_view(const QString &title, views::ViewType type, Session &session); - void remove_view(std::shared_ptr view); + void remove_view(shared_ptr view); - std::shared_ptr add_session(); + shared_ptr add_session(); - void remove_session(std::shared_ptr session); + 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(); - std::shared_ptr get_tab_session(int index) const; + shared_ptr get_tab_session(int index) const; void closeEvent(QCloseEvent *event); @@ -106,7 +118,7 @@ private Q_SLOTS: Session *session); void on_focus_changed(); - void on_focused_session_changed(std::shared_ptr session); + void on_focused_session_changed(shared_ptr session); void on_new_session_clicked(); void on_run_stop_clicked(); @@ -123,20 +135,24 @@ private Q_SLOTS: void on_view_coloured_bg_shortcut(); void on_view_sticky_scrolling_shortcut(); + void on_view_show_sampling_points_shortcut(); + void on_view_show_analog_minor_grid_shortcut(); void on_settingViewColouredBg_changed(const QVariant new_value); + void on_settingViewShowSamplingPoints_changed(const QVariant new_value); + void on_settingViewShowAnalogMinorGrid_changed(const QVariant new_value); void on_close_current_tab(); private: DeviceManager &device_manager_; - std::list< std::shared_ptr > sessions_; - std::shared_ptr last_focused_session_; + list< shared_ptr > sessions_; + shared_ptr last_focused_session_; - std::map< QDockWidget*, std::shared_ptr > view_docks_; + map< QDockWidget*, shared_ptr > view_docks_; - std::map< std::shared_ptr, QMainWindow*> session_windows_; + map< shared_ptr, QMainWindow*> session_windows_; QWidget *static_tab_widget_; QToolButton *new_session_button_, *run_stop_button_, *settings_button_; @@ -148,6 +164,8 @@ private: QIcon icon_grey_; QShortcut *view_sticky_scrolling_shortcut_; + QShortcut *view_show_sampling_points_shortcut_; + QShortcut *view_show_analog_minor_grid_shortcut_; QShortcut *view_coloured_bg_shortcut_; QShortcut *run_stop_shortcut_; QShortcut *close_application_shortcut_;