BornAgain  1.19.0
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/coregui/mainwindow/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 2018
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI_COREGUI_MAINWINDOW_ACTIONMANAGER_H
16 #define BORNAGAIN_GUI_COREGUI_MAINWINDOW_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 toggleCheckForUpdates(bool status);
38  void setSessionModelViewActive(bool status);
39  void onAboutApplication();
40  void onCurrentViewChanged();
41 #ifdef BORNAGAIN_PYTHON
43 #endif // BORNAGAIN_PYTHON
44 
45 private:
47 
48  QAction* m_newAction;
49  QAction* m_openAction;
50  QAction* m_saveAction;
51  QAction* m_saveAsAction;
52  QAction* m_exitAction;
53  QAction* m_aboutAction;
54 
55  QMenuBar* m_menuBar;
56  QMenu* m_fileMenu;
58  QMenu* m_viewMenu;
60  QMenu* m_helpMenu;
61  QMenu* m_importMenu;
62 
64 
65  void createActions();
66  void createMenus();
67  void createGlobalShortcuts();
68 };
69 
70 #endif // BORNAGAIN_GUI_COREGUI_MAINWINDOW_ACTIONMANAGER_H
Class to handle MainWindow's menu and corresponding actions.
Definition: actionmanager.h:28
ActionManager(MainWindow *parent)
MainWindow * m_mainWindow
Definition: actionmanager.h:46
void onCurrentViewChanged()
QMenu * m_viewMenu
Definition: actionmanager.h:58
void createGlobalShortcuts()
QAction * m_exitAction
Definition: actionmanager.h:52
QMenu * m_helpMenu
Definition: actionmanager.h:60
QAction * m_newAction
Definition: actionmanager.h:48
QMenu * m_settingsMenu
Definition: actionmanager.h:57
void onAboutToShowViewMenu()
QAction * m_saveAsAction
Definition: actionmanager.h:51
void onAboutToShowFileMenu()
void onAboutToShowSettingsMenu()
void onAboutApplication()
void createActions()
QMenu * m_importMenu
Definition: actionmanager.h:61
QMenu * m_fileMenu
Definition: actionmanager.h:56
void toggleCheckForUpdates(bool status)
QMenu * m_recentProjectsMenu
Definition: actionmanager.h:59
QAction * m_openAction
Definition: actionmanager.h:49
void setSessionModelViewActive(bool status)
QShortcut * m_runSimulationShortcut
Definition: actionmanager.h:63
void onImportFromPythonScript()
QAction * m_saveAction
Definition: actionmanager.h:50
QMenuBar * m_menuBar
Definition: actionmanager.h:55
QAction * m_aboutAction
Definition: actionmanager.h:53