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 gui2/mainwindow/actionmanager.h
6 //! @brief Defines class CLASS?
7 //!
8 //! @homepage http://www.bornagainproject.org
9 //! @license GNU General Public License v3 or higher (see COPYING)
10 //! @copyright Forschungszentrum Jülich GmbH 2020
11 //! @authors Scientific Computing Group at MLZ (see CITATION, AUTHORS)
12 //
13 // ************************************************************************************************
14 
15 #ifndef BORNAGAIN_GUI2_MAINWINDOW_ACTIONMANAGER_H
16 #define BORNAGAIN_GUI2_MAINWINDOW_ACTIONMANAGER_H
17 
18 #include "darefl_export.h"
19 #include <QObject>
20 
21 class QMainWindow;
22 class QAction;
23 class QMenuBar;
24 class QMenu;
25 
26 namespace gui2 {
27 
28 //! Actions for MainWindow. Equips toolbar and menubar with actions to create, open, save,
29 //! and save-as projects. It doesn't have logic and simply forwards requests further.
30 
31 class DAREFLCORE_EXPORT ActionManager : public QObject {
32  Q_OBJECT
33 
34 public:
35  ActionManager(QMainWindow* mainwindow = nullptr);
36 
37 signals:
39  void openExistingProjectRequest(const QString& dirname);
43 
44 public slots:
45  void setRecentProjectsList(const QStringList& projects);
46 
47 private slots:
48  void aboutToShowFileMenu();
49 
50 private:
51  void createActions();
52  void setupMenus(QMenuBar* menubar);
53 
54  QMainWindow* m_mainWindow{nullptr};
55 
56  QAction* m_createNewProjectAction{nullptr};
57  QAction* m_openExistingProjectAction{nullptr};
58  QAction* m_saveCurrentProjectAction{nullptr};
59  QAction* m_saveProjectAsAction{nullptr};
60  QAction* m_exitAction{nullptr};
61 
62  QMenu* m_recentProjectMenu{nullptr};
63 
64  QStringList m_recentProjects;
65 };
66 
67 } // namespace gui2
68 
69 #endif // BORNAGAIN_GUI2_MAINWINDOW_ACTIONMANAGER_H
Actions for MainWindow.
Definition: actionmanager.h:31
void saveCurrentProjectRequest()
void clearResentProjectListRequest()
QStringList m_recentProjects
Definition: actionmanager.h:64
void openExistingProjectRequest(const QString &dirname)
void createNewProjectRequest()
Based on Qt example "codeeditor" Copyright (C) 2016 The Qt Company Ltd.
Definition: app_constants.h:20