itom  3.0.0
mainApplication.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2016, Institut fuer Technische Optik (ITO),
5  Universitaet Stuttgart, Germany
6 
7  This file is part of itom.
8 
9  itom is free software; you can redistribute it and/or modify it
10  under the terms of the GNU Library General Public Licence as published by
11  the Free Software Foundation; either version 2 of the Licence, or (at
12  your option) any later version.
13 
14  itom is distributed in the hope that it will be useful, but
15  WITHOUT ANY WARRANTY; without even the implied warranty of
16  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library
17  General Public Licence for more details.
18 
19  You should have received a copy of the GNU Library General Public License
20  along with itom. If not, see <http://www.gnu.org/licenses/>.
21 *********************************************************************** */
22 
23 #ifndef MAINAPPLICATION_H
24 #define MAINAPPLICATION_H
25 
26 #include "python/pythonEngineInc.h"
27 #include "organizer/scriptEditorOrganizer.h"
28 #include "organizer/paletteOrganizer.h"
29 #include "organizer/uiOrganizer.h"
30 #include "organizer/processOrganizer.h"
31 #include "organizer/designerWidgetOrganizer.h"
32 //
33 #include "widgets/mainWindow.h"
34 
35 #include <qtranslator.h>
36 
37 //using namespace ito;
38 class QSplashScreen;
39 
40 namespace ito
41 {
42 
43 class MainApplication : public QObject
44 {
45  Q_OBJECT
46 
47  public:
48  enum tGuiType { standard, console, none };
50  MainApplication(tGuiType guiType = standard);
52 
53  int loadSettings(const QString userName = "");
54  void setupApplication(const QStringList &scriptsToOpen);
55  void finalizeApplication();
56 
57  int exec();
58  int execPipManagerOnly();
59 
62  static MainApplication* instance();
63 
64  protected:
65  void registerMetaObjects();
66 
67  private:
68  tGuiType m_guiType;
70  QThread* m_pyThread;
82 // bool m_hasGIL; /*!< python global interpreter lock GIL */
83 
84  QTranslator m_translator;
85  QTranslator m_qtTranslator;
86  QTranslator m_commonQtTranslator;
87  QTranslator m_commonPlotTranslator;
88  QTranslator m_widgetsTranslator;
89 
90  QSplashScreen *m_splashScreen;
91 
92  signals:
93  void propertiesChanged();
94 
95  private slots:
96 
97  public slots:
98  void _propertiesChanged() { emit propertiesChanged(); }
100 };
101 
102 } //end namespace ito
103 
104 #endif
The UiOrganizer is started as singleton instance within itom and organizes all main windows...
Definition: uiOrganizer.h:292
~MainApplication()
destructor
Definition: mainApplication.cpp:139
Definition: pythonEngine.h:128
The MainApplication class is the basic management class for the entire application.
Definition: mainApplication.h:43
ito::ProcessOrganizer * m_processOrganizer
Definition: mainApplication.h:81
Definition: paletteOrganizer.h:126
DesignerWidgetOrganizer * m_designerWidgetOrganizer
Definition: mainApplication.h:79
UiOrganizer * m_uiOrganizer
Definition: mainApplication.h:78
Definition: processOrganizer.h:39
static MainApplication * mainApplicationInstance
static instance pointer initialization
Definition: mainApplication.h:76
organizes script editors, independent on their appearance (docked or window-style) ...
Definition: scriptEditorOrganizer.h:36
QThread * m_pyThread
Definition: mainApplication.h:70
QTranslator m_translator
Definition: mainApplication.h:84
Definition: mainWindow.h:55
Definition: apiFunctionsGraph.cpp:39
int exec()
exececution of the main event loop
Definition: mainApplication.cpp:835
tGuiType m_guiType
Definition: mainApplication.h:68
PaletteOrganizer * m_paletteOrganizer
Definition: mainApplication.h:77
void setupApplication(const QStringList &scriptsToOpen)
setup of application
Definition: mainApplication.cpp:162
MainWindow * m_mainWin
Definition: mainApplication.h:74
ScriptEditorOrganizer * m_scriptEditorOrganizer
Definition: mainApplication.h:73
Definition: designerWidgetOrganizer.h:93
void finalizeApplication()
setup of application
Definition: mainApplication.cpp:691
ScriptEditorOrganizer * getScriptEditorOrganizer()
Definition: mainApplication.h:60
MainApplication(tGuiType guiType=standard)
constructor
Definition: mainApplication.cpp:108
void mainWindowCloseRequest()
slot invoked if user wants to close application
Definition: mainApplication.cpp:762
PythonEngine * m_pyEngine
Definition: mainApplication.h:71
static MainApplication * instance()
Definition: mainApplication.cpp:95