itom 1.4.0
|
00001 /* ******************************************************************** 00002 itom software 00003 URL: http://www.uni-stuttgart.de/ito 00004 Copyright (C) 2013, Institut für Technische Optik (ITO), 00005 Universität Stuttgart, Germany 00006 00007 This file is part of itom. 00008 00009 itom is free software; you can redistribute it and/or modify it 00010 under the terms of the GNU Library General Public Licence as published by 00011 the Free Software Foundation; either version 2 of the Licence, or (at 00012 your option) any later version. 00013 00014 itom is distributed in the hope that it will be useful, but 00015 WITHOUT ANY WARRANTY; without even the implied warranty of 00016 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library 00017 General Public Licence for more details. 00018 00019 You should have received a copy of the GNU Library General Public License 00020 along with itom. If not, see <http://www.gnu.org/licenses/>. 00021 *********************************************************************** */ 00022 00023 #ifndef MAINAPPLICATION_H 00024 #define MAINAPPLICATION_H 00025 00026 #include "python/pythonEngineInc.h" 00027 #include "organizer/scriptEditorOrganizer.h" 00028 #include "organizer/paletteOrganizer.h" 00029 #include "organizer/uiOrganizer.h" 00030 #include "organizer/processOrganizer.h" 00031 #include "organizer/designerWidgetOrganizer.h" 00032 // 00033 #include "widgets/mainWindow.h" 00034 00035 #include <qtranslator.h> 00036 00037 //using namespace ito; 00038 class QSplashScreen; 00039 00040 namespace ito 00041 { 00042 00043 class MainApplication : public QObject 00044 { 00045 Q_OBJECT 00046 00047 public: 00048 enum tGuiType { standard, console, none }; 00050 MainApplication(tGuiType guiType = standard); 00051 ~MainApplication(); 00052 00053 int loadSettings(const QString userName = ""); 00054 void setupApplication(); 00055 void finalizeApplication(); 00056 00057 int exec(); 00058 00059 inline ScriptEditorOrganizer* getScriptEditorOrganizer() { return m_scriptEditorOrganizer; } 00061 static MainApplication* instance(); 00062 00063 protected: 00064 void registerMetaObjects(); 00065 00066 private: 00067 tGuiType m_guiType; 00069 QThread* m_pyThread; 00070 PythonEngine* m_pyEngine; 00072 ScriptEditorOrganizer* m_scriptEditorOrganizer; 00073 MainWindow* m_mainWin; 00075 static MainApplication* mainApplicationInstance; 00076 PaletteOrganizer* m_paletteOrganizer; 00077 UiOrganizer* m_uiOrganizer; 00078 DesignerWidgetOrganizer* m_designerWidgetOrganizer; 00080 ito::ProcessOrganizer* m_processOrganizer; 00081 // bool m_hasGIL; /*!< python global interpreter lock GIL */ 00082 00083 QTranslator m_Translator; 00084 QTranslator m_qtTranslator; 00085 QTranslator m_commonQtTranslator; 00086 00087 QSplashScreen *m_splashScreen; 00088 00089 signals: 00090 void propertiesChanged(); 00091 00092 private slots: 00093 00094 public slots: 00095 void _propertiesChanged() { emit propertiesChanged(); } 00096 void mainWindowCloseRequest(); 00097 }; 00098 00099 } //end namespace ito 00100 00101 #endif