BornAgain  1.19.79
Simulate and fit neutron and x-ray scattering at grazing incidence
ActionManager.h
Go to the documentation of this file.
1 // ************************************************************************************************
2 //
3 // BornAgain: simulate and fit reflection and scattering
4 //
5 //! @file GUI/View/Main/ActionManager.h
6 //! @brief Defines class ActionManager
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2021
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_VIEW_MAIN_ACTIONMANAGER_H
16 #define BORNAGAIN_GUI_VIEW_MAIN_ACTIONMANAGER_H
17 
18 #include <QObject>
19 
20 class QMenu;
21 class QAction;
22 class QMenuBar;
23 class MainWindow;
24 class QShortcut;
25 
26 //! Class to handle MainWindow's menu and corresponding actions
27 
28 class ActionManager : public QObject {
29  Q_OBJECT
30 public:
31  ActionManager(MainWindow* parent);
32 
33 private slots:
34  void onAboutToShowFileMenu();
36  void onAboutToShowViewMenu();
37  void setSessionModelViewActive(bool status);
38  void onAboutApplication();
39  void onCurrentViewChanged();
40 
41 private:
42  void updateActionEnabling();
43 
44 private:
46 
47  QAction* m_newAction;
48  QAction* m_openAction;
49  QAction* m_saveAction;
50  QAction* m_saveAsAction;
52  QAction* m_exitAction;
53  QAction* m_webdocAction;
54  QAction* m_aboutAction;
55 
56  QMenuBar* m_menuBar;
57  QMenu* m_fileMenu;
59  QMenu* m_viewMenu;
61  QMenu* m_helpMenu;
62 
63  QShortcut* m_simulateShortcut;
64 
65  void createActions();
66  void createMenus();
67  void createGlobalShortcuts();
68 };
69 
70 #endif // BORNAGAIN_GUI_VIEW_MAIN_ACTIONMANAGER_H
Class to handle MainWindow's menu and corresponding actions.
Definition: ActionManager.h:28
ActionManager(MainWindow *parent)
MainWindow * m_mainWindow
Definition: ActionManager.h:45
void onCurrentViewChanged()
QMenu * m_viewMenu
Definition: ActionManager.h:59
void createGlobalShortcuts()
QAction * m_exitAction
Definition: ActionManager.h:52
QMenu * m_helpMenu
Definition: ActionManager.h:61
QAction * m_newAction
Definition: ActionManager.h:47
QMenu * m_settingsMenu
Definition: ActionManager.h:58
void onAboutToShowViewMenu()
QAction * m_saveAsAction
Definition: ActionManager.h:50
void onAboutToShowFileMenu()
void onAboutToShowSettingsMenu()
void onAboutApplication()
void createActions()
QAction * m_closeProjectAction
Definition: ActionManager.h:51
QMenu * m_fileMenu
Definition: ActionManager.h:57
QMenu * m_recentProjectsMenu
Definition: ActionManager.h:60
QShortcut * m_simulateShortcut
Definition: ActionManager.h:63
QAction * m_openAction
Definition: ActionManager.h:48
void setSessionModelViewActive(bool status)
QAction * m_saveAction
Definition: ActionManager.h:49
QMenuBar * m_menuBar
Definition: ActionManager.h:56
QAction * m_webdocAction
Definition: ActionManager.h:53
void updateActionEnabling()
QAction * m_aboutAction
Definition: ActionManager.h:54