itom
Loading...
Searching...
No Matches
mainApplication.h
1/* ********************************************************************
2 itom software
3 URL: http://www.uni-stuttgart.de/ito
4 Copyright (C) 2023, Institut für Technische Optik (ITO),
5 Universität 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#pragma once
24
25#include "python/pythonEngineInc.h"
26#include "python/qDebugStream.h"
27#include "python/pythonLogger.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
38class QSplashScreen;
39
40namespace ito
41{
42
43class PythonStatePublisher;
44
45class 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);
58
59 int exec();
60 int execPipManagerOnly();
61
64 static MainApplication* instance();
65
66 protected:
67 void registerMetaObjects();
68
69 private:
70 bool m_devFlag = false;
72 tGuiType m_guiType;
74 QThread* m_pyThread;
88 QTranslator m_translator;
89 QTranslator m_qtTranslator;
90 QTranslator m_commonQtTranslator;
91 QTranslator m_commonPlotTranslator;
92 QTranslator m_widgetsTranslator;
93 QTranslator m_addinmanagerTranslator;
94
95 QSplashScreen *m_pSplashScreen;
96 QColor m_splashScreenTextColor;
97
102 QString getSplashScreenFileName() const;
103 QPixmap getSplashScreenPixmap() const;
104
105 signals:
106 void propertiesChanged();
107
108 private slots:
109 void setSplashScreenMessage(const QString &text);
110
111 public slots:
112 void _propertiesChanged() { emit propertiesChanged(); }
113 void mainWindowCloseRequest(bool considerPythonBusy);
114};
115
116} //end namespace ito
Definition designerWidgetOrganizer.h:77
The MainApplication class is the basic management class for the entire application.
Definition mainApplication.h:46
int exec()
exececution of the main event loop
Definition mainApplication.cpp:1243
PythonStatePublisher * m_pyStatePublisher
Definition mainApplication.h:76
~MainApplication()
destructor
Definition mainApplication.cpp:158
tGuiType m_guiType
Definition mainApplication.h:72
QDebugStream * m_pQerr
Definition mainApplication.h:99
UiOrganizer * m_uiOrganizer
Definition mainApplication.h:83
QThread * m_pyThread
Definition mainApplication.h:74
void finalizeApplication()
setup of application
Definition mainApplication.cpp:1056
MainApplication(tGuiType guiType=standard)
constructor
Definition mainApplication.cpp:114
DesignerWidgetOrganizer * m_designerWidgetOrganizer
Definition mainApplication.h:84
ScriptEditorOrganizer * m_scriptEditorOrganizer
Definition mainApplication.h:78
QTranslator m_translator
Definition mainApplication.h:88
ScriptEditorOrganizer * getScriptEditorOrganizer()
Definition mainApplication.h:62
MainWindow * m_mainWin
Definition mainApplication.h:79
void mainWindowCloseRequest(bool considerPythonBusy)
slot invoked if user wants to close application
Definition mainApplication.cpp:1138
static MainApplication * mainApplicationInstance
static instance pointer initialization
Definition mainApplication.h:81
PythonLogger m_pythonLogger
Definition mainApplication.h:100
PaletteOrganizer * m_paletteOrganizer
Definition mainApplication.h:82
void setupApplication(const QStringList &scriptsToOpen, const QStringList &scriptsToExecute)
setup of application
Definition mainApplication.cpp:398
bool m_devFlag
Definition mainApplication.h:70
PythonEngine * m_pyEngine
Definition mainApplication.h:75
ito::ProcessOrganizer * m_processOrganizer
Definition mainApplication.h:86
QDebugStream * m_pQout
Definition mainApplication.h:98
static MainApplication * instance()
Definition mainApplication.cpp:101
Definition mainWindow.h:56
Definition paletteOrganizer.h:118
Definition processOrganizer.h:38
Definition pythonEngine.h:118
Copies python errors to the logger.
Definition pythonLogger.h:24
One instance of this class is created by MainApplication::setupApplication and runs in the main threa...
Definition pythonStatePublisher.h:58
Definition qDebugStream.h:39
organizes script editors, independent on their appearance (docked or window-style)
Definition scriptEditorOrganizer.h:43
The UiOrganizer is started as singleton instance within itom and organizes all main windows,...
Definition uiOrganizer.h:303
Definition apiFunctionsGraph.cpp:40