itom  4.1.0
mainApplication.h
1 /* ********************************************************************
2  itom software
3  URL: http://www.uni-stuttgart.de/ito
4  Copyright (C) 2020, 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 "python/qDebugStream.h"
28 #include "organizer/scriptEditorOrganizer.h"
29 #include "organizer/paletteOrganizer.h"
30 #include "organizer/uiOrganizer.h"
31 #include "organizer/processOrganizer.h"
32 #include "organizer/designerWidgetOrganizer.h"
33 //
34 #include "widgets/mainWindow.h"
35 
36 #include <qtranslator.h>
37 
38 class QSplashScreen;
39 
40 namespace ito
41 {
42 
43 class PythonStatePublisher;
44 
45 class MainApplication : public QObject
46 {
47  Q_OBJECT
48 
49  public:
50  enum tGuiType { standard, console, none };
52  MainApplication(tGuiType guiType = standard);
54 
55  int loadSettings(const QString userName = "");
56  void setupApplication(const QStringList &scriptsToOpen, const QStringList &scriptsToExecute);
57  void finalizeApplication();
58 
59  int exec();
60  int execPipManagerOnly();
61 
64  static MainApplication* instance();
65 
66  protected:
67  void registerMetaObjects();
68 
69  private:
70  tGuiType m_guiType;
72  QThread* m_pyThread;
86  QTranslator m_translator;
87  QTranslator m_qtTranslator;
88  QTranslator m_commonQtTranslator;
89  QTranslator m_commonPlotTranslator;
90  QTranslator m_widgetsTranslator;
91  QTranslator m_addinmanagerTranslator;
92 
93  QSplashScreen *m_pSplashScreen;
94  QColor m_splashScreenTextColor;
95 
99  QString getSplashScreenFileName() const;
100  QPixmap getSplashScreenPixmap() const;
101 
102  signals:
103  void propertiesChanged();
104 
105  private slots:
106  void setSplashScreenMessage(const QString &text);
107 
108  public slots:
109  void _propertiesChanged() { emit propertiesChanged(); }
110  void mainWindowCloseRequest();
111 };
112 
113 } //end namespace ito
114 
115 #endif
The UiOrganizer is started as singleton instance within itom and organizes all main windows...
Definition: uiOrganizer.h:306
~MainApplication()
destructor
Definition: mainApplication.cpp:144
Definition: pythonEngine.h:114
The MainApplication class is the basic management class for the entire application.
Definition: mainApplication.h:45
ito::ProcessOrganizer * m_processOrganizer
Definition: mainApplication.h:84
Definition: paletteOrganizer.h:117
DesignerWidgetOrganizer * m_designerWidgetOrganizer
Definition: mainApplication.h:82
UiOrganizer * m_uiOrganizer
Definition: mainApplication.h:81
Definition: processOrganizer.h:39
One instance of this class is created by MainApplication::setupApplication and runs in the main threa...
Definition: pythonStatePublisher.h:57
static MainApplication * mainApplicationInstance
static instance pointer initialization
Definition: mainApplication.h:79
organizes script editors, independent on their appearance (docked or window-style) ...
Definition: scriptEditorOrganizer.h:41
QThread * m_pyThread
Definition: mainApplication.h:72
QTranslator m_translator
Definition: mainApplication.h:86
Definition: mainWindow.h:58
void setupApplication(const QStringList &scriptsToOpen, const QStringList &scriptsToExecute)
setup of application
Definition: mainApplication.cpp:336
Definition: apiFunctionsGraph.cpp:39
int exec()
exececution of the main event loop
Definition: mainApplication.cpp:1101
tGuiType m_guiType
Definition: mainApplication.h:70
PaletteOrganizer * m_paletteOrganizer
Definition: mainApplication.h:80
QDebugStream * m_pQout
Definition: mainApplication.h:96
QDebugStream * m_pQerr
Definition: mainApplication.h:97
MainWindow * m_mainWin
Definition: mainApplication.h:77
ScriptEditorOrganizer * m_scriptEditorOrganizer
Definition: mainApplication.h:76
PythonStatePublisher * m_pyStatePublisher
Definition: mainApplication.h:74
Definition: designerWidgetOrganizer.h:75
void finalizeApplication()
setup of application
Definition: mainApplication.cpp:914
ScriptEditorOrganizer * getScriptEditorOrganizer()
Definition: mainApplication.h:62
MainApplication(tGuiType guiType=standard)
constructor
Definition: mainApplication.cpp:109
Definition: qDebugStream.h:38
void mainWindowCloseRequest()
slot invoked if user wants to close application
Definition: mainApplication.cpp:996
PythonEngine * m_pyEngine
Definition: mainApplication.h:73
static MainApplication * instance()
Definition: mainApplication.cpp:96