RTXI  2.4
The Real-Time eXperiment Interface Documentation
main_window.h
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, Weill Cornell Medical College
4 
5  This program is free software: you can redistribute it and/or modify
6  it under the terms of the GNU General Public License as published by
7  the Free Software Foundation, either version 3 of the License, or
8  (at your option) any later version.
9 
10  This program is distributed in the hope that it will be useful,
11  but WITHOUT ANY WARRANTY; without even the implied warranty of
12  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  GNU General Public License for more details.
14 
15  You should have received a copy of the GNU General Public License
16  along with this program. If not, see <http://www.gnu.org/licenses/>.
17 
18  */
19 
20 #ifndef MAIN_WINDOW_H
21 #define MAIN_WINDOW_H
22 
23 #include <QMainWindow>
24 #include <QAction>
25 #include <QMdiArea>
26 #include <QMdiSubWindow>
27 #include <QtWidgets>
28 #include <QObject>
29 
30 class QMenu;
31 
35 class MainWindow : public QMainWindow
36 {
37 
38  Q_OBJECT
39 
40  friend class QApplication;
41 
42 public:
43 
44  virtual ~MainWindow(void);
45 
53  static MainWindow *getInstance(void);
54 
64  QAction* createFileMenuItem(const QString &label);//, const QObject *handler, const char *slot);
65 
70  void clearFileMenu(void);
71 
72 
76  QAction* insertModuleMenuSeparator(void);
77 
88  QAction* createModuleMenuItem(const QString & text);
89  QAction* createModuleMenuItem(const QString & text, const QObject *handler, const char *slot);
90 
98  void setModuleMenuItemParameter(QAction *action, int parameter);
99 
104  void clearModuleMenu(void);
105 
113  void changeModuleMenuItem(QAction *action, QString text);
114 
121  void removeModuleMenuItem(QAction *action);
122 
132  QAction* createUtilMenuItem(const QString &label, const QObject *handler,
133  const char *slot);
134 
144  QAction* createSystemMenuItem(const QString &label, const QObject *handler, const char *slot);
145 
146  /*
147  * Create a window for the widget in the main window
148  */
149  void createMdi(QMdiSubWindow *);
150 
154  void loadWindow(void);
155 
156 private slots:
157  void about(void);
158  void aboutXeno(void);
159  void aboutQt(void);
160  void openDocs(void);
161  void openSubIssue(void);
162 
163  void loadSettings(void);
164  void saveSettings(void);
165  void resetSettings(void);
166 
167  void windowsMenuAboutToShow(void);
168  void windowsMenuActivated(QAction *);
169  void modulesMenuActivated(QAction *);
170  void fileMenuActivated(QAction *);
171  void utilitiesMenuActivated(QAction *);
172 
173 private:
174 
175  /****************************************************************
176  * The constructor, destrutos, and assignment operator are made *
177  * private to control instantiation of the class. *
178  ****************************************************************/
179 
180  MainWindow(void);
181  MainWindow(const MainWindow &) : QMainWindow(NULL, Qt::Window) {};
182  MainWindow &operator = (const MainWindow &)
183  {
184  return *getInstance();
185  };
186 
187  static MainWindow *instance;
188  QMdiArea *mdiArea;
189  QList<QMdiSubWindow *> subWindows;
190 
191  QMenu *fileMenu;
192  QMenu *moduleMenu;
193  QMenu *utilMenu;
194  QMenu *filtersSubMenu;
195  QMenu *signalsSubMenu;
196  QMenu *utilitiesSubMenu;
197  QMenu *systemMenu;
198  QMenu *windowsMenu;
199  QMenu *helpMenu;
200 
201  QAction *load;
202  QAction *save;
203  QAction *reset;
204  QAction *quit;
205  QAction *artxi;
206  QAction *axeno;
207  QAction *aqt;
208  QAction *adocs;
209  QAction *sub_issue;
210  QAction *utilItem;
211 
212  void createFileMenu();
213  void createModuleMenu();
214  void createUtilMenu();
215  void createSystemMenu();
216  void createWindowsMenu();
217  void createHelpMenu();
218  void createFileActions();
219  void createHelpActions();
220  void closeEvent(QCloseEvent *);
221 };
222 #endif /* MAIN_WINDOW_H */
MainWindow::createSystemMenuItem
QAction * createSystemMenuItem(const QString &label, const QObject *handler, const char *slot)
Definition: main_window.cpp:253
MainWindow::~MainWindow
virtual ~MainWindow(void)
Definition: main_window.cpp:66
MainWindow::createMdi
void createMdi(QMdiSubWindow *)
Definition: main_window.cpp:230
MainWindow::clearFileMenu
void clearFileMenu(void)
Definition: main_window.cpp:80
MainWindow::clearModuleMenu
void clearModuleMenu(void)
Definition: main_window.cpp:107
MainWindow::loadWindow
void loadWindow(void)
Definition: main_window.cpp:296
MainWindow::insertModuleMenuSeparator
QAction * insertModuleMenuSeparator(void)
Definition: main_window.cpp:70
MainWindow::setModuleMenuItemParameter
void setModuleMenuItemParameter(QAction *action, int parameter)
Definition: main_window.cpp:102
MainWindow::changeModuleMenuItem
void changeModuleMenuItem(QAction *action, QString text)
Definition: main_window.cpp:112
MainWindow::removeModuleMenuItem
void removeModuleMenuItem(QAction *action)
Definition: main_window.cpp:117
MainWindow::createModuleMenuItem
QAction * createModuleMenuItem(const QString &text)
Definition: main_window.cpp:92
MainWindow::getInstance
static MainWindow * getInstance(void)
Definition: main_window.cpp:454
MainWindow::createFileMenuItem
QAction * createFileMenuItem(const QString &label)
Definition: main_window.cpp:75
MainWindow
Definition: main_window.h:35
MainWindow::QApplication
friend class QApplication
Definition: main_window.h:40
MainWindow::createUtilMenuItem
QAction * createUtilMenuItem(const QString &label, const QObject *handler, const char *slot)
Definition: main_window.cpp:124