RTXI  2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
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 &) {};
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;
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 updateCheck(void);
213  void createFileMenu();
214  void createModuleMenu();
215  void createUtilMenu();
216  void createSystemMenu();
217  void createWindowsMenu();
218  void createHelpMenu();
219  void createFileActions();
220  void createHelpActions();
221  void closeEvent(QCloseEvent *);
222 };
223 #endif /* MAIN_WINDOW_H */
QMenu * utilitiesSubMenu
Definition: main_window.h:196
static MainWindow * getInstance(void)
QMenu * helpMenu
Definition: main_window.h:199
void clearFileMenu(void)
Definition: main_window.cpp:84
QList< QMdiSubWindow * > subWindows
Definition: main_window.h:189
void changeModuleMenuItem(QAction *action, QString text)
QMenu * signalsSubMenu
Definition: main_window.h:195
QAction * save
Definition: main_window.h:202
void aboutXeno(void)
void createFileActions()
QAction * reset
Definition: main_window.h:203
void openDocs(void)
virtual ~MainWindow(void)
Definition: main_window.cpp:70
void fileMenuActivated(QAction *)
void createHelpActions()
void loadWindow(void)
QMenu * moduleMenu
Definition: main_window.h:192
void createWindowsMenu()
void createFileMenu()
void windowsMenuActivated(QAction *)
QAction * adocs
Definition: main_window.h:208
QAction * createUtilMenuItem(const QString &label, const QObject *handler, const char *slot)
void createModuleMenu()
void createHelpMenu()
void about(void)
void utilitiesMenuActivated(QAction *)
QAction * aqt
Definition: main_window.h:207
void closeEvent(QCloseEvent *)
static MainWindow * instance
Definition: main_window.h:185
void createMdi(QMdiSubWindow *)
QAction * axeno
Definition: main_window.h:206
QAction * createFileMenuItem(const QString &label)
Definition: main_window.cpp:79
void createSystemMenu()
QAction * load
Definition: main_window.h:201
QMenu * filtersSubMenu
Definition: main_window.h:194
MainWindow & operator=(const MainWindow &)
Definition: main_window.h:182
QAction * quit
Definition: main_window.h:204
QMdiArea * mdiArea
Definition: main_window.h:188
QMenu * fileMenu
Definition: main_window.h:191
void aboutQt(void)
QMenu * windowsMenu
Definition: main_window.h:198
void windowsMenuAboutToShow(void)
MainWindow(void)
Definition: main_window.cpp:30
void saveSettings(void)
QMenu * systemMenu
Definition: main_window.h:197
void resetSettings(void)
QMenu * utilMenu
Definition: main_window.h:193
void updateCheck(void)
void modulesMenuActivated(QAction *)
void removeModuleMenuItem(QAction *action)
QAction * sub_issue
Definition: main_window.h:209
QAction * createModuleMenuItem(const QString &text)
Definition: main_window.cpp:96
void setModuleMenuItemParameter(QAction *action, int parameter)
QAction * utilItem
Definition: main_window.h:210
void loadSettings(void)
void openSubIssue(void)
MainWindow(const MainWindow &)
Definition: main_window.h:181
QAction * insertModuleMenuSeparator(void)
Definition: main_window.cpp:74
void createUtilMenu()
QAction * createSystemMenuItem(const QString &label, const QObject *handler, const char *slot)
void clearModuleMenu(void)
QAction * artxi
Definition: main_window.h:205
friend class QApplication
Definition: main_window.h:40