RTXI  3.0.0
The Real-Time eXperiment Interface Reference Manual
main_window.hpp
Go to the documentation of this file.
1 /*
2  The Real-Time eXperiment Interface (RTXI)
3  Copyright (C) 2011 Georgia Institute of Technology, University of Utah,
4  Will Cornell Medical College
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 
19  */
20 
21 #ifndef MAIN_WINDOW_H
22 #define MAIN_WINDOW_H
23 
24 #include <QAction>
25 #include <QMainWindow>
26 #include <QMdiArea>
27 #include <QMdiSubWindow>
28 #include <QMenu>
29 #include <QTextEdit>
30 #include <QTextItem>
31 
32 #include <qdialog.h>
33 
34 #include "event.hpp"
35 
36 class SaveSettingsDialog : public QDialog
37 {
38 public:
39 private:
40  QTextItem* settings_group_desc; // NOLINT
41  QTextEdit* settings_group_edit; // NOLINT
42 };
43 
47 class MainWindow : public QMainWindow
48 {
49  Q_OBJECT
50 public:
51  explicit MainWindow(Event::Manager* ev_manager);
52 
61  QAction* createFileMenuItem(const QString& label);
62 
66  void clearFileMenu();
67 
71  QAction* insertWidgetMenuSeparator();
72 
82  QAction* createWidgetMenuItem(const QString& text);
83  QAction* createWidgetMenuItem(const QString& text,
84  const QObject* receiver,
85  const char* member);
86 
93  static void setWidgetMenuItemParameter(QAction* action, int parameter);
94 
98  void clearWidgetMenu();
99 
106  static void changeWidgetMenuItem(QAction* action, const QString& text);
107 
113  void removeWidgetMenuItem(QAction* action);
114 
123  QAction* createUtilMenuItem(const QString& label,
124  const QObject* handler,
125  const char* slot);
126 
135  QAction* createSystemMenuItem(const QString& label,
136  const QObject* handler,
137  const char* slot);
138 
142  void loadWindow();
143 
144 private slots:
145  void about();
146  void aboutXeno();
147  void aboutQt();
148  static void openDocs();
149  static void openSubIssue();
150 
151  void loadSettings();
152  void saveSettings();
153  void resetSettings();
154 
155  void windowsMenuAboutToShow();
156  void windowsMenuActivated(QAction* id);
157  void modulesMenuActivated(QAction* /*unused*/);
158  void fileMenuActivated(QAction* id);
159  void utilitiesMenuActivated(QAction* /*unused*/);
160  void systemMenuActivated(QAction* id);
161 
162 private:
163  void loadWidget(const QString& module_name);
164  Event::Manager* event_manager;
165  QMdiArea* mdiArea = nullptr;
166  QList<QMdiSubWindow*> subWindows;
167 
168  QMenu* fileMenu = nullptr;
169  QMenu* moduleMenu = nullptr;
170  QMenu* utilMenu = nullptr;
171  QMenu* filtersSubMenu = nullptr;
172  QMenu* signalsSubMenu = nullptr;
173  QMenu* utilitiesSubMenu = nullptr;
174  QMenu* systemMenu = nullptr;
175  QMenu* windowsMenu = nullptr;
176  QMenu* helpMenu = nullptr;
177 
178  QAction* load = nullptr;
179  QAction* save = nullptr;
180  QAction* reset = nullptr;
181  QAction* quit = nullptr;
182  QAction* artxi = nullptr;
183  QAction* axeno = nullptr;
184  QAction* aqt = nullptr;
185  QAction* adocs = nullptr;
186  QAction* sub_issue = nullptr;
187  QAction* utilItem = nullptr;
188  QAction* loadDynamicWidget = nullptr;
189  QAction* openDataRecorder = nullptr;
190  QAction* openRTBenchmarks = nullptr;
191  QAction* openUserPrefs = nullptr;
192  QAction* openControlPanel = nullptr;
193  QAction* openConnector = nullptr;
194  QAction* openOscilloscope = nullptr;
195  QAction* openRTXIWizard = nullptr;
196 
197  void createFileMenu();
198  void createWidgetMenu();
199  void createUtilMenu();
200  void createSystemMenu();
201  void createSystemActions();
202  void createWindowsMenu();
203  void createHelpMenu();
204  void createFileActions();
205  void createHelpActions();
206  void closeEvent(QCloseEvent* event) override;
207 };
208 #endif /* MAIN_WINDOW_H */
static void changeWidgetMenuItem(QAction *action, const QString &text)
QAction * insertWidgetMenuSeparator()
Definition: main_window.cpp:89
void removeWidgetMenuItem(QAction *action)
QAction * createFileMenuItem(const QString &label)
Definition: main_window.cpp:94
MainWindow(Event::Manager *ev_manager)
Definition: main_window.cpp:50
static void setWidgetMenuItemParameter(QAction *action, int parameter)
QAction * createSystemMenuItem(const QString &label, const QObject *handler, const char *slot)
void clearFileMenu()
Definition: main_window.cpp:99
QAction * createUtilMenuItem(const QString &label, const QObject *handler, const char *slot)
void clearWidgetMenu()
void loadWindow()
QAction * createWidgetMenuItem(const QString &text)