From 894a2c60597319166b77e56e7b88f1288a7501d3 Mon Sep 17 00:00:00 2001 From: Yoann Audouin Date: Thu, 1 Jul 2021 11:53:43 +0200 Subject: [PATCH] First version of standalone app --- CMakeLists.txt | 78 ++++---- src/CMakeLists.txt | 3 +- src/LightApp/LightApp_Application.cxx | 36 ++-- src/LightApp/resources/LightApp_msg_fr.ts | 2 +- src/LightApplication/CMakeLists.txt | 92 +++++++++ src/LightApplication/LightApplication.cxx | 49 +++++ src/LightApplication/LightApplication.h | 47 +++++ src/LightApplication/LightDesktop.cxx | 127 +++++++++++++ src/LightApplication/LightDesktop.h | 49 +++++ .../resources/LightApplication_images.ts | 19 ++ .../resources/LightApplication_msg_en.ts | 174 ++++++++++++++++++ .../resources/LightApplication_msg_fr.ts | 174 ++++++++++++++++++ .../resources/LightApplication_msg_ja.ts | 168 +++++++++++++++++ .../resources/icon_visibility_off.png | Bin 0 -> 344 bytes .../resources/icon_visibility_on.png | Bin 0 -> 3184 bytes src/LightApplication/resources/view_sync.png | Bin 0 -> 627 bytes src/SUIT/SUIT_Application.cxx | 4 +- src/Session/CMakeLists.txt | 11 +- src/Session/SALOME_Session_Server.cxx | 22 ++- 19 files changed, 985 insertions(+), 70 deletions(-) create mode 100644 src/LightApplication/CMakeLists.txt create mode 100644 src/LightApplication/LightApplication.cxx create mode 100644 src/LightApplication/LightApplication.h create mode 100644 src/LightApplication/LightDesktop.cxx create mode 100644 src/LightApplication/LightDesktop.h create mode 100644 src/LightApplication/resources/LightApplication_images.ts create mode 100644 src/LightApplication/resources/LightApplication_msg_en.ts create mode 100644 src/LightApplication/resources/LightApplication_msg_fr.ts create mode 100644 src/LightApplication/resources/LightApplication_msg_ja.ts create mode 100644 src/LightApplication/resources/icon_visibility_off.png create mode 100644 src/LightApplication/resources/icon_visibility_on.png create mode 100644 src/LightApplication/resources/view_sync.png diff --git a/CMakeLists.txt b/CMakeLists.txt index f2f7a3c39..f0ad22d05 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -112,7 +112,7 @@ IF(NOT SALOME_LIGHT_ONLY) FIND_PACKAGE(SalomeOmniORBPy REQUIRED) ELSE() ADD_DEFINITIONS("-DGUI_DISABLE_CORBA") -ENDIF() +ENDIF() IF(SALOME_BUILD_TESTS) ENABLE_TESTING() FIND_PACKAGE(SalomeCppUnit) @@ -189,8 +189,8 @@ ENDIF() # - VTK viewer: VTK IF(SALOME_USE_VTKVIEWER) - # Required components are listed in the FindSalomeVTK.cmake file: - FIND_PACKAGE(SalomeVTK) + # Required components are listed in the FindSalomeVTK.cmake file: + FIND_PACKAGE(SalomeVTK) SALOME_LOG_OPTIONAL_PACKAGE(VTK SALOME_USE_VTKVIEWER) # VSR: TODO: since ParaView 5.8 the following is not needed, as OPENGL2 is hardcoded: to be removed (everywhere) ADD_DEFINITIONS("-DVTK_OPENGL2") @@ -250,18 +250,18 @@ SET(SALOME_INSTALL_BINS "${SALOME_INSTALL_BINS}" CACHE PATH "Install path: SALOM SET(SALOME_INSTALL_LIBS "${SALOME_INSTALL_LIBS}" CACHE PATH "Install path: SALOME libs") SET(SALOME_INSTALL_IDLS "${SALOME_INSTALL_IDLS}" CACHE PATH "Install path: SALOME IDL files") SET(SALOME_INSTALL_HEADERS "${SALOME_INSTALL_HEADERS}" CACHE PATH "Install path: SALOME headers") -SET(SALOME_INSTALL_SCRIPT_SCRIPTS "${SALOME_INSTALL_SCRIPT_SCRIPTS}" CACHE PATH +SET(SALOME_INSTALL_SCRIPT_SCRIPTS "${SALOME_INSTALL_SCRIPT_SCRIPTS}" CACHE PATH "Install path: SALOME scripts") -SET(SALOME_INSTALL_SCRIPT_DATA "${SALOME_INSTALL_SCRIPT_DATA}" CACHE PATH +SET(SALOME_INSTALL_SCRIPT_DATA "${SALOME_INSTALL_SCRIPT_DATA}" CACHE PATH "Install path: SALOME script data") -SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH +SET(SALOME_INSTALL_SCRIPT_PYTHON "${SALOME_INSTALL_SCRIPT_PYTHON}" CACHE PATH "Install path: SALOME Python scripts") SET(SALOME_INSTALL_PYTHON "${SALOME_INSTALL_PYTHON}" CACHE PATH "Install path: SALOME Python stuff") -SET(SALOME_INSTALL_PYTHON_SHARED "${SALOME_INSTALL_PYTHON_SHARED}" CACHE PATH +SET(SALOME_INSTALL_PYTHON_SHARED "${SALOME_INSTALL_PYTHON_SHARED}" CACHE PATH "Install path: SALOME Python shared modules") SET(SALOME_INSTALL_CMAKE "${SALOME_INSTALL_CMAKE}" CACHE PATH "Install path: SALOME CMake files") -SET(SALOME_INSTALL_CMAKE_LOCAL "${SALOME_INSTALL_CMAKE_LOCAL}" CACHE PATH - "Install path: local SALOME CMake files") +SET(SALOME_INSTALL_CMAKE_LOCAL "${SALOME_INSTALL_CMAKE_LOCAL}" CACHE PATH + "Install path: local SALOME CMake files") SET(SALOME_INSTALL_AMCONFIG_LOCAL "${SALOME_INSTALL_AMCONFIG_LOCAL}" CACHE PATH "Install path: local SALOME config files (obsolete, to be removed)") @@ -269,11 +269,11 @@ SET(SALOME_INSTALL_RES "${SALOME_INSTALL_RES}" CACHE PATH "Install path: SALOME SET(SALOME_INSTALL_DOC "${SALOME_INSTALL_DOC}" CACHE PATH "Install path: SALOME documentation") # Specific to GUI: -SET(SALOME_GUI_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/gui" CACHE PATH +SET(SALOME_GUI_INSTALL_RES_DATA "${SALOME_INSTALL_RES}/gui" CACHE PATH "Install path: SALOME GUI specific data") -SET(SALOME_GUI_INSTALL_RES_SCRIPTS "${SALOME_INSTALL_RES}/gui" CACHE PATH +SET(SALOME_GUI_INSTALL_RES_SCRIPTS "${SALOME_INSTALL_RES}/gui" CACHE PATH "Install path: SALOME GUI scripts") -SET(SALOME_GUI_INSTALL_PLUGINS share/salome/plugins/gui CACHE PATH +SET(SALOME_GUI_INSTALL_PLUGINS share/salome/plugins/gui CACHE PATH "Install path: SALOME GUI plugins") MARK_AS_ADVANCED(SALOME_INSTALL_BINS SALOME_INSTALL_LIBS SALOME_INSTALL_IDLS SALOME_INSTALL_HEADERS) @@ -288,9 +288,9 @@ SALOME_ACCUMULATE_ENVIRONMENT(PYTHONPATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOM ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON} ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS} ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_PYTHON_SHARED}) -SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}) - -# Sources +SALOME_ACCUMULATE_ENVIRONMENT(LD_LIBRARY_PATH NOCHECK ${CMAKE_INSTALL_PREFIX}/${SALOME_INSTALL_LIBS}) + +# Sources # ======== IF(NOT SALOME_LIGHT_ONLY) ADD_SUBDIRECTORY(idl) @@ -316,74 +316,74 @@ INCLUDE(CMakePackageConfigHelpers) # List of targets in this project we want to make visible to the rest of the world. # They all have to be INSTALL'd with the option "EXPORT ${PROJECT_NAME}TargetGroup" -SET(_${PROJECT_NAME}_exposed_targets +SET(_${PROJECT_NAME}_exposed_targets CAM CASCatch DDS Event LightApp LogWindow ObjBrowser - QDS qtx SalomePrs SalomeStyle std SUITApp suit ViewerTools ViewerData + QDS qtx SalomePrs SalomeStyle std SUITApp lightapplication suit ViewerTools ViewerData ImageComposer ) IF(SALOME_USE_OCCVIEWER OR SALOME_USE_VTKVIEWER OR SALOME_USE_GLVIEWER) - LIST(APPEND _${PROJECT_NAME}_exposed_targets + LIST(APPEND _${PROJECT_NAME}_exposed_targets OpenGLUtils) ENDIF(SALOME_USE_OCCVIEWER OR SALOME_USE_VTKVIEWER OR SALOME_USE_GLVIEWER) # SALOME object specific targets: IF(SALOME_USE_SALOMEOBJECT) - LIST(APPEND _${PROJECT_NAME}_exposed_targets + LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomeObject) ENDIF(SALOME_USE_SALOMEOBJECT) # GL specific targets: IF(SALOME_USE_GLVIEWER) - LIST(APPEND _${PROJECT_NAME}_exposed_targets + LIST(APPEND _${PROJECT_NAME}_exposed_targets GLViewer) ENDIF(SALOME_USE_GLVIEWER) # VTK specific targets: IF(SALOME_USE_VTKVIEWER) - LIST(APPEND _${PROJECT_NAME}_exposed_targets + LIST(APPEND _${PROJECT_NAME}_exposed_targets VTKViewer ) IF(SALOME_USE_SALOMEOBJECT) - LIST(APPEND _${PROJECT_NAME}_exposed_targets + LIST(APPEND _${PROJECT_NAME}_exposed_targets SVTK) ENDIF(SALOME_USE_SALOMEOBJECT) ENDIF(SALOME_USE_VTKVIEWER) # OCC specific targets: IF(SALOME_USE_OCCVIEWER) - LIST(APPEND _${PROJECT_NAME}_exposed_targets + LIST(APPEND _${PROJECT_NAME}_exposed_targets OCCViewer) IF(SALOME_USE_SALOMEOBJECT) - LIST(APPEND _${PROJECT_NAME}_exposed_targets + LIST(APPEND _${PROJECT_NAME}_exposed_targets SOCC) ENDIF(SALOME_USE_SALOMEOBJECT) ENDIF(SALOME_USE_OCCVIEWER) # Plot2d specific targets: IF(SALOME_USE_PLOT2DVIEWER) - LIST(APPEND _${PROJECT_NAME}_exposed_targets + LIST(APPEND _${PROJECT_NAME}_exposed_targets Plot2d) IF(SALOME_USE_SALOMEOBJECT) - LIST(APPEND _${PROJECT_NAME}_exposed_targets + LIST(APPEND _${PROJECT_NAME}_exposed_targets SPlot2d) ENDIF(SALOME_USE_SALOMEOBJECT) ENDIF(SALOME_USE_PLOT2DVIEWER) # Qx specific targets: IF(SALOME_USE_QXGRAPHVIEWER) - LIST(APPEND _${PROJECT_NAME}_exposed_targets + LIST(APPEND _${PROJECT_NAME}_exposed_targets QxScene) ENDIF(SALOME_USE_QXGRAPHVIEWER) # GraphicsView specific targets: IF(SALOME_USE_GRAPHICSVIEW) - LIST(APPEND _${PROJECT_NAME}_exposed_targets + LIST(APPEND _${PROJECT_NAME}_exposed_targets GraphicsView) ENDIF(SALOME_USE_GRAPHICSVIEW) # PyEditor/Viewer specific targets: IF(SALOME_USE_PYVIEWER) - LIST(APPEND _${PROJECT_NAME}_exposed_targets + LIST(APPEND _${PROJECT_NAME}_exposed_targets PyEditor PyViewer) ENDIF(SALOME_USE_PYVIEWER) @@ -394,7 +394,7 @@ ENDIF() # Python-based packages specific targets: IF(SALOME_USE_PYCONSOLE) - LIST(APPEND _${PROJECT_NAME}_exposed_targets + LIST(APPEND _${PROJECT_NAME}_exposed_targets PyInterp PyConsole SalomePyQtGUILight) IF(SALOME_USE_PLOT2DVIEWER) LIST(APPEND _${PROJECT_NAME}_exposed_targets SalomePyQt) @@ -431,34 +431,34 @@ SET(OPENGL_ROOT_DIR "${OPENGL_ROOT_DIR}") SET(PARAVIEW_ROOT_DIR "${PARAVIEW_ROOT_DIR}") SET(VTK_ROOT_DIR "${VTK_ROOT_DIR}") SET(QWT_ROOT_DIR "${QWT_ROOT_DIR}") - + SET(CONF_INCLUDE_DIRS "${PROJECT_SOURCE_DIR}/include" "${PROJECT_BINARY_DIR}/include") # Build variables that will be expanded when configuring SalomeConfig.cmake: SALOME_CONFIGURE_PREPARE(OpenCASCADE OpenGL Qt5 PyQt5 Qwt SIP ParaView VTK) -CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in +CONFIGURE_PACKAGE_CONFIG_FILE(${PROJECT_NAME}Config.cmake.in ${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}" PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX - KERNEL_ROOT_DIR SIP_ROOT_DIR QT_ROOT_DIR PYQT_ROOT_DIR OPENCASCADE_ROOT_DIR + KERNEL_ROOT_DIR SIP_ROOT_DIR QT_ROOT_DIR PYQT_ROOT_DIR OPENCASCADE_ROOT_DIR OPENGL_ROOT_DIR PARAVIEW_ROOT_DIR VTK_ROOT_DIR QWT_ROOT_DIR) # - in the install tree (VSR 16/08/2013: TEMPORARILY COMMENT THIS - TO REMOVE?): -# Get the relative path of the include directory so +# Get the relative path of the include directory so # we can register it in the generated configuration files: #SET(CONF_INCLUDE_DIRS "${CMAKE_INSTALL_PREFIX}/${INSTALL_INCLUDE_DIR}") -#CONFIGURE_PACKAGE_CONFIG_FILE(adm_local/cmake_files/${PROJECT_NAME}Config.cmake.in +#CONFIGURE_PACKAGE_CONFIG_FILE(adm_local/cmake_files/${PROJECT_NAME}Config.cmake.in # ${PROJECT_BINARY_DIR}/to_install/${PROJECT_NAME}Config.cmake # INSTALL_DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}" -# PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX -# KERNEL_ROOT_DIR SIP_ROOT_DIR QT_ROOT_DIR PYQT_ROOT_DIR OPENCASCADE_ROOT_DIR +# PATH_VARS CONF_INCLUDE_DIRS SALOME_INSTALL_CMAKE_LOCAL CMAKE_INSTALL_PREFIX +# KERNEL_ROOT_DIR SIP_ROOT_DIR QT_ROOT_DIR PYQT_ROOT_DIR OPENCASCADE_ROOT_DIR # OPENGL_ROOT_DIR PARAVIEW_ROOT_DIR VTK_ROOT_DIR QWT_ROOT_DIR) WRITE_BASIC_PACKAGE_VERSION_FILE(${PROJECT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake VERSION ${${PROJECT_NAME_UC}_VERSION} COMPATIBILITY AnyNewerVersion) - + # Install the CMake configuration files: INSTALL(FILES "${PROJECT_BINARY_DIR}/${PROJECT_NAME}Config.cmake" @@ -466,5 +466,5 @@ INSTALL(FILES DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}") # Install the export set for use with the install-tree -INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}" +INSTALL(EXPORT ${PROJECT_NAME}TargetGroup DESTINATION "${SALOME_INSTALL_CMAKE_LOCAL}" FILE ${PROJECT_NAME}Targets.cmake) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index f5a42a034..443ce10f4 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -41,6 +41,7 @@ ADD_SUBDIRECTORY(ViewerData) ADD_SUBDIRECTORY(ViewerTools) ADD_SUBDIRECTORY(ImageComposer) ADD_SUBDIRECTORY(GUI_PY) +ADD_SUBDIRECTORY(LightApplication) ## # SALOME object @@ -135,7 +136,7 @@ ADD_SUBDIRECTORY(LightApp) ## # Python-based packages, part 2 (LightApp-dependent) ## -IF(SALOME_USE_PYCONSOLE) +IF(SALOME_USE_PYCONSOLE) IF(SALOME_USE_VTKVIEWER) ADD_SUBDIRECTORY(SALOME_PY) ENDIF(SALOME_USE_VTKVIEWER) diff --git a/src/LightApp/LightApp_Application.cxx b/src/LightApp/LightApp_Application.cxx index 88750b9f5..1b43d4ec5 100644 --- a/src/LightApp/LightApp_Application.cxx +++ b/src/LightApp/LightApp_Application.cxx @@ -1030,16 +1030,16 @@ void LightApp_Application::onNewDoc() void LightApp_Application::onOpenDoc() { SUIT_Study* study = activeStudy(); - + if ( !checkExistingDoc( false ) ) return; - + QString aName = getFileName( true, QString(), getFileFilter( true ), QString(), 0 ); if ( aName.isNull() ) //Cancel return; - + onOpenDoc( aName ); - + if ( !study ) // new study will be create in THIS application { updateWindows(); @@ -1226,7 +1226,7 @@ protected: #else QString cmdLine = QString( "%1 %2 \"%3\"" ).arg( myBrowser, myParameters, myUrl ); // remove LD_LIBRARY_PATH from the environement before starting launcher to avoid bad interactions. - // (especially in the case of universal binaries) + // (especially in the case of universal binaries) env.remove("LD_LIBRARY_PATH"); #endif QProcess* proc = new QProcess(); @@ -2850,7 +2850,7 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) int vtkSelectionGroup = pref->addPreference( tr( "PREF_GROUP_SELECTION" ), vtkGroup ); pref->setItemProperty( "columns", 2, vtkSelectionGroup ); // .... -> preselection - int vtkPreselection = pref->addPreference( tr( "PREF_PRESELECTION" ), vtkSelectionGroup, + int vtkPreselection = pref->addPreference( tr( "PREF_PRESELECTION" ), vtkSelectionGroup, LightApp_Preferences::Selector, "VTKViewer", "preselection" ); aValuesList.clear(); anIndicesList.clear(); @@ -2875,7 +2875,7 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref ) int spacemousePref2 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_2" ), vtkSM, LightApp_Preferences::Selector, "VTKViewer", "spacemouse_func2_btn" ); - // .... -> dominant / combined switch + // .... -> dominant / combined switch int spacemousePref3 = pref->addPreference( tr( "PREF_SPACEMOUSE_FUNC_3" ), vtkSM, LightApp_Preferences::Selector, "VTKViewer", "spacemouse_func5_btn" ); // @@ -4181,9 +4181,9 @@ void LightApp_Application::updateWindows() infoPanel()->addAction( action( FileOpenId ), grp ); infoPanel()->addLabel( action( FileOpenId )->statusTip(), grp ); infoPanel()->addAction( action( TutorialsId ), grp ); - infoPanel()->addLabel( action( TutorialsId )->statusTip(), grp ); + //infoPanel()->addLabel( action( TutorialsId )->statusTip(), grp ); infoPanel()->addAction( action( VideosId ), grp ); - infoPanel()->addLabel( action( VideosId )->statusTip(), grp ); + //infoPanel()->addLabel( action( VideosId )->statusTip(), grp ); LightApp_ModuleAction* ma = qobject_cast(action(ModulesListId)); if ( ma && ma->count() > 0 ) @@ -4235,7 +4235,7 @@ void LightApp_Application::loadDockWindowsState() aResMgr->value( "windows_visibility", modName, aDefaultVisibility ); bool hasDefaultVisibility = !aDefaultVisibility.isEmpty(); aResMgr->setWorkingMode( prevMode ); - + if( !storeWin && !storeTb && aDefaultState.isEmpty() && !hasDefaultVisibility) return; @@ -4260,13 +4260,13 @@ void LightApp_Application::loadDockWindowsState() QMap *tbMap = 0; QMap *dwMap = 0; - + QMap userTbMap, userDwMap; dockWindowsState( myWinVis[modName], userTbMap, userDwMap ); QMap defaultTbMap, defaultDwMap; if(hasDefaultVisibility) { - dockWindowsState( aDefaultVisibility, defaultTbMap, defaultDwMap); + dockWindowsState( aDefaultVisibility, defaultTbMap, defaultDwMap); } if(storeTb) { @@ -4288,9 +4288,9 @@ void LightApp_Application::loadDockWindowsState() if(tbMap) { QList tbList = findToolBars(); for ( QList::iterator tit = tbList.begin(); tit != tbList.end(); ++tit ) - { + { QToolBar* tb = *tit; - if ( tbMap->contains( tb->objectName() ) ) { + if ( tbMap->contains( tb->objectName() ) ) { tb->setVisible( (*tbMap)[tb->objectName()] ); } } @@ -4301,11 +4301,11 @@ void LightApp_Application::loadDockWindowsState() for ( QList::iterator dit = dwList.begin(); dit != dwList.end(); ++dit ) { QDockWidget* dw = *dit; - + QObject* po = Qtx::findParent( dw, "QMainWindow" ); if ( po != desktop() ) continue; - + if ( dwMap->contains( dw->objectName() ) ) dw->setVisible( (*dwMap)[dw->objectName()] ); } @@ -5029,7 +5029,7 @@ void LightApp_Application::onDesktopMessage( const QString& message ) } else if ( message.toLower().startsWith("register_module_in_study" ) ) { QString moduleName = message.split( sectionSeparator ).last(); - // Check name of current activating module name in order to avoid ciclik + // Check name of current activating module name in order to avoid ciclik // call because of messages if (!property("activateModule").toBool()) { CAM_Module* mod = module(moduleName); @@ -5092,7 +5092,7 @@ void LightApp_Application::onInfoPanelShown() } /*! - Internal method. + Internal method. Returns all top level toolbars. Note : Result list contains only main window toolbars, not including toolbars from viewers. */ diff --git a/src/LightApp/resources/LightApp_msg_fr.ts b/src/LightApp/resources/LightApp_msg_fr.ts index 96bd587f7..a2df61154 100644 --- a/src/LightApp/resources/LightApp_msg_fr.ts +++ b/src/LightApp/resources/LightApp_msg_fr.ts @@ -64,7 +64,7 @@ CEA/DEN, CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS SALOME_TUTORIALS - Tutorials + Tutorials PRP_SALOME_TUTORIALS diff --git a/src/LightApplication/CMakeLists.txt b/src/LightApplication/CMakeLists.txt new file mode 100644 index 000000000..5b69459d4 --- /dev/null +++ b/src/LightApplication/CMakeLists.txt @@ -0,0 +1,92 @@ +# Copyright (C) 2012-2021 CEA/DEN, EDF R&D, OPEN CASCADE +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +# +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# + +INCLUDE(UseQtExt) + +# --- options --- + +# additional include directories +INCLUDE_DIRECTORIES( + ${QT_INCLUDES} + ${PROJECT_SOURCE_DIR}/src/Qtx + ${PROJECT_SOURCE_DIR}/src/ObjBrowser +) + +# additional preprocessor / compiler flags +ADD_DEFINITIONS(${QT_DEFINITIONS}) + +# libraries to link to +SET(_link_LIBRARIES ${PLATFORM_LIBS} ${QT_LIBRARIES} qtx ObjBrowser) + +# --- headers --- + +# header files / to be processed by moc +SET(_moc_HEADERS + LightApplication.h + LightDesktop.h +) + +# header files / no moc processing +SET(_other_HEADERS +) + +# header files / to install +SET(lightapplication_HEADERS ${_moc_HEADERS} ${_other_HEADERS}) + +# --- resources --- + +# resource files / to be processed by lrelease +SET(_ts_RESOURCES + resources/LightApplication_msg_en.ts + resources/LightApplication_msg_fr.ts + resources/LightApplication_msg_ja.ts + resources/LightApplication_images.ts +) + +# resource files / static +SET(_other_RESOURCES + resources/icon_visibility_on.png + resources/icon_visibility_off.png + resources/view_sync.png +) + +# --- sources --- + +# sources / moc wrappings +QT_WRAP_MOC(_moc_SOURCES ${_moc_HEADERS}) + +# sources / static +SET(_other_SOURCES + LightApplication.cxx + LightDesktop.cxx +) + +# sources / to compile +SET(lightapplication_SOURCES ${_other_SOURCES} ${_moc_SOURCES}) + +# --- rules --- + +ADD_LIBRARY(lightapplication ${lightapplication_SOURCES}) +TARGET_LINK_LIBRARIES(lightapplication ${_link_LIBRARIES}) +INSTALL(TARGETS lightapplication EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) + +INSTALL(FILES ${lightapplication_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) +QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}") + +INSTALL(FILES ${_other_RESOURCES} DESTINATION ${SALOME_GUI_INSTALL_RES_DATA}) \ No newline at end of file diff --git a/src/LightApplication/LightApplication.cxx b/src/LightApplication/LightApplication.cxx new file mode 100644 index 000000000..3b3fa2498 --- /dev/null +++ b/src/LightApplication/LightApplication.cxx @@ -0,0 +1,49 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include "LightApplication.h" +#include "LightDesktop.h" + +/*! + Default constructor +*/ +LightApplication::LightApplication() +: QObject( 0 ) +{ + myDesktop = new LightDesktop(); +} + +/*! + Destructor +*/ +LightApplication::~LightApplication() +{ + +} + +/*! + Shows the application's main widget. For non GUI application must be redefined. +*/ +void LightApplication::start() +{ + myDesktop->show(); +} \ No newline at end of file diff --git a/src/LightApplication/LightApplication.h b/src/LightApplication/LightApplication.h new file mode 100644 index 000000000..fd9412529 --- /dev/null +++ b/src/LightApplication/LightApplication.h @@ -0,0 +1,47 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#ifndef LIGHTAPPLICATION_H +#define LIGHTAPPLICATION_H + +#include "LightDesktop.h" + +#include + + +class LightApplication : public QObject +{ + Q_OBJECT + +public: + LightApplication(); + virtual ~LightApplication(); + + //! Shows the application's main widget. For non GUI application must be redefined. + virtual void start(); + +private: + LightDesktop * myDesktop = 0; + +}; + +#endif \ No newline at end of file diff --git a/src/LightApplication/LightDesktop.cxx b/src/LightApplication/LightDesktop.cxx new file mode 100644 index 000000000..847d8d4b5 --- /dev/null +++ b/src/LightApplication/LightDesktop.cxx @@ -0,0 +1,127 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// + +#include // this include must be the first one as it includes Python.h +#include "LightDesktop.h" + +#include "utilities.h" + + +#include +#include +#include + + +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +/*!\class SUIT_Desktop + * Provide desktop management:\n + * \li menu manager + * \li tool manager + * \li windows + */ + +/*! + Constructor. +*/ +LightDesktop::LightDesktop() +: QtxMainWindow() +{ + myMenuMgr = new QtxActionMenuMgr( this ); + myToolMgr = new QtxActionToolMgr( this ); + myLogoMgr = new QtxLogoMgr( menuBar() ); + + createMenus(); +} + +/*! + Destructor. +*/ +LightDesktop::~LightDesktop() +{ + +} + +void LightDesktop::createMenus() +{ + //QPushButton *mybutton = new QPushButton("Test", this); + //connect(mybutton, &QPushButton::released, this, &LightDesktop::RunScript); + + //this->setCentralWidget(mybutton); + QMenu *fileMenu = menuBar()->addMenu("File"); + fileMenu->addAction("Open File", this, &LightDesktop::RunScript, QKeySequence::Open); + fileMenu->addAction("Dummy", this, SLOT( Dummy()), QKeySequence::New); +} + +void LightDesktop::Dummy() +{ + QMessageBox msgBox; + msgBox.setText("Dummy text"); + msgBox.exec(); +} + +void LightDesktop::RunScript() +{ + QString fileName = QFileDialog::getOpenFileName(this, + tr("Open Python File"), "/home/B61570/work_in_progress/salome2810", "Python Files (*.py)"); + + std::ifstream ifs(fileName.toStdString()); + std::string content( (std::istreambuf_iterator(ifs) ), + (std::istreambuf_iterator() ) ); + + + // Lock Python Global Interperter + MESSAGE("Starting Python script"); + MESSAGE("**********************"); + PyGILState_STATE gstate = PyGILState_Ensure(); + PyObject* myMainMod = PyImport_AddModule("__main__"); + PyObject* myMainDict = PyModule_GetDict(myMainMod); + + PyObject* obj = PyRun_String(content.c_str(), Py_file_input, myMainDict, NULL); + + if(obj == NULL){ + MESSAGE("Script crashed"); + PyErr_Print(); + PyGILState_Release(gstate); + } else{ + MESSAGE("ALL is well"); + Py_DECREF(obj); + } + // Get data from script + //PyObject* py_i = PyObject_GetAttrString(myMainMod, "i"); + //double i = PyFloat_AsDouble(py_i); + //Display value of i value + //std::cerr << "i: " << i << std::endl; + // Release GIL + PyGILState_Release(gstate); +} \ No newline at end of file diff --git a/src/LightApplication/LightDesktop.h b/src/LightApplication/LightDesktop.h new file mode 100644 index 000000000..394f39083 --- /dev/null +++ b/src/LightApplication/LightDesktop.h @@ -0,0 +1,49 @@ +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE +// +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +// +// This library is free software; you can redistribute it and/or +// modify it under the terms of the GNU Lesser General Public +// License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// +// This library is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +// Lesser General Public License for more details. +// +// You should have received a copy of the GNU Lesser General Public +// License along with this library; if not, write to the Free Software +// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// +#ifndef LIGHTDESKTOP_H +#define LIGHTDESKTOP_H + +#include + +class QtxLogoMgr; +class QtxActionMenuMgr; +class QtxActionToolMgr; + +class LightDesktop : public QtxMainWindow +{ + Q_OBJECT + +public: + LightDesktop(); + virtual ~LightDesktop(); + + void RunScript(); + void Dummy(); + void createMenus(); + +private: + QtxActionMenuMgr* myMenuMgr; + QtxActionToolMgr* myToolMgr; + QtxLogoMgr* myLogoMgr; +}; + +#endif \ No newline at end of file diff --git a/src/LightApplication/resources/LightApplication_images.ts b/src/LightApplication/resources/LightApplication_images.ts new file mode 100644 index 000000000..63c601050 --- /dev/null +++ b/src/LightApplication/resources/LightApplication_images.ts @@ -0,0 +1,19 @@ + + + + + @default + + ICON_DATAOBJ_VISIBLE + icon_visibility_on.png + + + ICON_DATAOBJ_INVISIBLE + icon_visibility_off.png + + + ICON_VIEW_SYNC + view_sync.png + + + diff --git a/src/LightApplication/resources/LightApplication_msg_en.ts b/src/LightApplication/resources/LightApplication_msg_en.ts new file mode 100644 index 000000000..03659c6a8 --- /dev/null +++ b/src/LightApplication/resources/LightApplication_msg_en.ts @@ -0,0 +1,174 @@ + + + + + @default + + MEN_DESK_WINDOW + &Window + + + ERR_CANT_DUMP_VIEW + Can't dump view contents to the file. + + + TLT_IMAGE_FILES + Images Files (*.bmp *.png *.jpg *.jpeg) + + + MEN_DESK_WINDOW_CASCADE + &Cascade + + + PRP_DESK_WINDOW_CASCADE + Arranges the windows as overlapping tiles + + + ERR_DIR_NOT_EXIST + The directory "%1" does not exist! + + + ERR_FILE_NOT_DIR + "%1" is not a directory! + + + CONTINUE + Continue + + + CANCEL + Cancel + + + ERR_FILE_NOT_EXIST + The file "%1" does not exist! + + + QUE_DOC_FILEEXISTS + The file %1 already exists. +Do you want to overwrite it ? + + + PRP_DESK_WINDOW_ACTIVATE + Activates this window + + + ERR_PERMISSION_DENIED + Can't save file "%1". +Permission denied. + + + ERR_OPEN_PERMISSION_DENIED + Can't open file "%1". +Permission denied. + + + ERR_DIR_READ_PERMISSION_DENIED + Can't read directory "%1". +Permission denied. + + + ERR_DIR_WRITE_PERMISSION_DENIED + Can't write directory "%1". +Permission denied. + + + ERR_ERROR + Error + + + QUE_FILE_EXISTS + The file %1 already exists. +Do you want to overwrite it? + + + WRN_WARNING + Warning + + + TLT_DUMP_VIEW + Dump View to File + + + PRP_DESK_WINDOW_TILE + Arranges the windows as nonoverlapping tiles + + + MEN_DESK_WINDOW_VTILE + Tile &Vertically + + + INF_DIRECTORIES_FILTER + Directories + + + PRP_DESK_WINDOW_VTILE + Arranges the windows as nonoverlapping vertical tiles + + + MEN_DESK_WINDOW_TILE + &Tile + + + NAME_COLUMN + Name + + + MNU_SYNCHRONIZE_VIEW + Synchronize + + + DSC_SYNCHRONIZE_VIEW + Synchronize view + + + MNU_SYNC_NO_VIEW + [ No appropriate view ] + + + + SUIT_Study + + OPERATION_LAUNCH + Operation launch + + + PREVIOUS_NOT_FINISHED + Previous operation is not finished and will be aborted + + + + SUIT_FileDlg + + LAB_QUICK_PATH + Quick path: + + + BUT_ADD_PATH + Add path + + + INF_DESK_DOC_OPEN + Open File + + + INF_DESK_DOC_SAVE + Save File + + + ALL_FILES_FILTER + All files (*) + + + + SUIT_ViewWindow + + TLT_DUMP_VIEW + Dump view to file + + + TLT_IMAGE_FILES + Images Files (*.bmp *.png *.jpg *.jpeg) + + + diff --git a/src/LightApplication/resources/LightApplication_msg_fr.ts b/src/LightApplication/resources/LightApplication_msg_fr.ts new file mode 100644 index 000000000..97f2cf33d --- /dev/null +++ b/src/LightApplication/resources/LightApplication_msg_fr.ts @@ -0,0 +1,174 @@ + + + + + @default + + MEN_DESK_WINDOW + &Fenêtre + + + ERR_CANT_DUMP_VIEW + Impossible de sauvegarder le contenu de la vue dans le fichier. + + + TLT_IMAGE_FILES + Fichiers images (*.bmp *.png *.jpg *.jpeg) + + + MEN_DESK_WINDOW_CASCADE + &Cascade + + + PRP_DESK_WINDOW_CASCADE + Superpose les fenêtres + + + ERR_DIR_NOT_EXIST + Le répertoire "%1" n'existe pas ! + + + ERR_FILE_NOT_DIR + "%1" n'est pas un répertoire ! + + + CONTINUE + Continuer + + + CANCEL + Annuler + + + ERR_FILE_NOT_EXIST + Le fichier "%1" n'existe pas ! + + + QUE_DOC_FILEEXISTS + Le fichier %1 existe déjà. +Voulez-vous l'écraser ? + + + PRP_DESK_WINDOW_ACTIVATE + Active la fenêtre + + + ERR_PERMISSION_DENIED + Impossible de sauvegarder le fichier "%1". +Autorisation interdite. + + + ERR_OPEN_PERMISSION_DENIED + Impossible d'ouvrir le fichier "%1". +Autorisation interdite. + + + ERR_DIR_READ_PERMISSION_DENIED + Impossible de lire le répertoire "%1". +Autorisation interdite. + + + ERR_DIR_WRITE_PERMISSION_DENIED + Impossible d'écrire dans le répertoire "%1". +Autorisation interdite. + + + ERR_ERROR + Erreur + + + QUE_FILE_EXISTS + Le fichier %1 existe déjà. +Voulez-vous l'écraser ? + + + WRN_WARNING + Avertissement + + + TLT_DUMP_VIEW + Enregistrer la vue dans le fichier + + + PRP_DESK_WINDOW_TILE + Place les fenêtres en mosaïque + + + MEN_DESK_WINDOW_VTILE + Mosaïque &verticale + + + INF_DIRECTORIES_FILTER + Répertoires + + + PRP_DESK_WINDOW_VTILE + Place les fenêtres en mosaïque verticale + + + MEN_DESK_WINDOW_TILE + &Mosaïque + + + NAME_COLUMN + Nom + + + MNU_SYNCHRONIZE_VIEW + Synchroniser + + + DSC_SYNCHRONIZE_VIEW + Synchroniser la vue + + + MNU_SYNC_NO_VIEW + [ Pas de vue appropriée ] + + + + SUIT_Study + + OPERATION_LAUNCH + Lancer l'opération + + + PREVIOUS_NOT_FINISHED + L'opération précédente n'est pas aboutie et sera interrompue + + + + SUIT_FileDlg + + LAB_QUICK_PATH + Emplacement : + + + BUT_ADD_PATH + Ajouter un chemin + + + INF_DESK_DOC_OPEN + Ouvrir un fichier + + + INF_DESK_DOC_SAVE + Sauvegarder un fichier + + + ALL_FILES_FILTER + Tous les fichiers (*) + + + + SUIT_ViewWindow + + TLT_DUMP_VIEW + Enregistrer la vue dans le fichier + + + TLT_IMAGE_FILES + Fichiers images (*.bmp *.png *.jpg *.jpeg) + + + diff --git a/src/LightApplication/resources/LightApplication_msg_ja.ts b/src/LightApplication/resources/LightApplication_msg_ja.ts new file mode 100644 index 000000000..8da7266db --- /dev/null +++ b/src/LightApplication/resources/LightApplication_msg_ja.ts @@ -0,0 +1,168 @@ + + + + + @default + + MEN_DESK_WINDOW + ウィンドウ(&W) + + + ERR_CANT_DUMP_VIEW + ビューの内容をファイルに保存できませんでした。 + + + TLT_IMAGE_FILES + イメージ (*.bmp *.png *.jpg *.jpeg) ファイル + + + MEN_DESK_WINDOW_CASCADE + カスケード(&C) + + + PRP_DESK_WINDOW_CASCADE + Windows ではスーパーイン ポーズ + + + ERR_DIR_NOT_EXIST + ディレクトリ"%1"は存在しません! + + + ERR_FILE_NOT_DIR + "%1"はディレクトリではありません ! + + + CONTINUE + 続行 + + + CANCEL + キャンセル + + + ERR_FILE_NOT_EXIST + ファイル"%1"は存在しません! + + + QUE_DOC_FILEEXISTS + ファイル %1 は既に存在します。それを上書きしますか。 + + + PRP_DESK_WINDOW_ACTIVATE + アクティブ ウィンドウ + + + ERR_PERMISSION_DENIED + ファイル"%1"を保存できません。アクセス許可は、禁じられています。 + + + ERR_OPEN_PERMISSION_DENIED + ファイル"%1"を開けません。アクセス許可は、禁じられています。 + + + ERR_DIR_READ_PERMISSION_DENIED + ディレクトリ"%1"を読み取れません。アクセス許可は、禁じられています。 + + + ERR_DIR_WRITE_PERMISSION_DENIED + ディレクトリ"%1"に書き込めませんでした。アクセス許可は、禁じられています。 + + + ERR_ERROR + エラー + + + QUE_FILE_EXISTS + ファイル %1 は既に存在します。それを上書きしますか。 + + + WRN_WARNING + 注意 ! + + + TLT_DUMP_VIEW + ビューでファイルを保存します。 + + + PRP_DESK_WINDOW_TILE + ウィンドウの場所 + + + MEN_DESK_WINDOW_VTILE + 垂直方向のモザイク(&V) + + + INF_DIRECTORIES_FILTER + ディレクトリ + + + PRP_DESK_WINDOW_VTILE + 垂直方向のモザイクで Windows の場所 + + + MEN_DESK_WINDOW_TILE + モザイク(&T) + + + NAME_COLUMN + 名前 + + + MNU_SYNCHRONIZE_VIEW + 同期 + + + DSC_SYNCHRONIZE_VIEW + ビューを同期します。 + + + MNU_SYNC_NO_VIEW + [適切なビューを使用しない] + + + + SUIT_Study + + OPERATION_LAUNCH + 操作を開始します。 + + + PREVIOUS_NOT_FINISHED + 前の操作が開発し、中断されます。 + + + + SUIT_FileDlg + + LAB_QUICK_PATH + 場所: + + + BUT_ADD_PATH + パスの追加 + + + INF_DESK_DOC_OPEN + ファイルを開く + + + INF_DESK_DOC_SAVE + ファイルを保存します。 + + + ALL_FILES_FILTER + すべてのファイル (*) + + + + SUIT_ViewWindow + + TLT_DUMP_VIEW + ビューでファイルを保存します。 + + + TLT_IMAGE_FILES + イメージ (*.bmp *.png *.jpg *.jpeg) ファイル + + + diff --git a/src/LightApplication/resources/icon_visibility_off.png b/src/LightApplication/resources/icon_visibility_off.png new file mode 100644 index 0000000000000000000000000000000000000000..31c505d82d1b08a54ac666f380e47837c04a9247 GIT binary patch literal 344 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 SUIT_Application::actionIds() const */ QAction* SUIT_Application::createAction( const int id, const QString& text, const QIcon& icon, const QString& menu, const QString& tip, const int key, - QObject* parent, const bool toggle, QObject* reciever, + QObject* parent, const bool toggle, QObject* reciever, const char* member, const QString& shortcutAction ) { return createAction( id, text, icon, menu, tip, QKeySequence(key), parent, toggle, reciever, member, shortcutAction ); @@ -664,7 +664,7 @@ QAction* SUIT_Application::createAction( const int id, const QString& text, cons */ QAction* SUIT_Application::createAction( const int id, const QString& text, const QIcon& icon, const QString& menu, const QString& tip, const QKeySequence& key, - QObject* parent, const bool toggle, QObject* reciever, + QObject* parent, const bool toggle, QObject* reciever, const char* member, const QString& shortcutAction ) { QtxAction* a = new QtxAction( text, icon, menu, key, parent, toggle, shortcutAction ); diff --git a/src/Session/CMakeLists.txt b/src/Session/CMakeLists.txt index 480715f57..c39457539 100644 --- a/src/Session/CMakeLists.txt +++ b/src/Session/CMakeLists.txt @@ -35,7 +35,7 @@ INCLUDE_DIRECTORIES( ${PROJECT_SOURCE_DIR}/src/SUIT ${PROJECT_SOURCE_DIR}/src/Event ${PROJECT_SOURCE_DIR}/src/Style - ${PROJECT_SOURCE_DIR}/src/SUIT + ${PROJECT_SOURCE_DIR}/src/LightApplication ${PROJECT_SOURCE_DIR}/src/STD ${PROJECT_SOURCE_DIR}/src/CAM ${PROJECT_SOURCE_DIR}/src/OBJECT @@ -69,7 +69,7 @@ SET(_link_LIBRARIES ${KERNEL_SalomeLauncher} ${KERNEL_Registry} ${KERNEL_SALOMEBasics} - qtx suit Event SalomeStyle SalomeApp SalomeIDLGUI + qtx lightapplication suit Event SalomeStyle SalomeApp SalomeIDLGUI ) # --- headers --- @@ -108,7 +108,7 @@ SET(SalomeSession_SOURCES ADD_LIBRARY(SalomeSession ${SalomeSession_SOURCES}) TARGET_LINK_LIBRARIES(SalomeSession ${_link_LIBRARIES}) -INSTALL(TARGETS SalomeSession EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) +INSTALL(TARGETS SalomeSession EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_LIBS}) ADD_EXECUTABLE(SALOME_Session_Server SALOME_Session_Server_With_Server.cxx) TARGET_LINK_LIBRARIES(SALOME_Session_Server ${_link_LIBRARIES} SalomeSession) @@ -122,5 +122,10 @@ add_executable(salome2810 salome2810.cxx) target_link_libraries(salome2810 ${QT_LIBRARIES}) install(TARGETS salome2810 DESTINATION ${SALOME_INSTALL_BINS}) +add_executable(salomeLight salomeLight.cxx) +target_link_libraries(salomeLight ${QT_LIBRARIES}) +install(TARGETS salomeLight DESTINATION ${SALOME_INSTALL_BINS}) + + INSTALL(FILES ${SalomeSession_HEADERS} DESTINATION ${SALOME_INSTALL_HEADERS}) QT_INSTALL_TS_RESOURCES("${_ts_RESOURCES}" "${SALOME_GUI_INSTALL_RES_DATA}") diff --git a/src/Session/SALOME_Session_Server.cxx b/src/Session/SALOME_Session_Server.cxx index 621fc466c..f7ca70ebe 100644 --- a/src/Session/SALOME_Session_Server.cxx +++ b/src/Session/SALOME_Session_Server.cxx @@ -56,6 +56,8 @@ #include "SUIT_Session.h" #include "SUIT_Tools.h" +#include "LightApplication.h" + #include #include CORBA_SERVER_HEADER(SALOME_Session) #include CORBA_SERVER_HEADER(SALOMEDS) @@ -77,6 +79,8 @@ #include #include +#include + //! CORBA server for SALOME GUI session /*! * SALOME_Session_Server launches a SALOME session servant. @@ -727,7 +731,11 @@ int AbstractGUIAppMain(int argc, char **argv) // Load SalomeApp dynamic library MESSAGE("creation SUIT_Application"); - SUIT_Application *aGUIApp = aGUISession->startApplication(NamingServiceImplementation::LibName, 0, 0); + MESSAGE(NamingServiceImplementation::LibName ); + //SUIT_Application *aGUIApp = aGUISession->startApplication(NamingServiceImplementation::LibName, 0, 0); + LightApplication *aGUIApp = new LightApplication(); + aGUIApp->start(); + if (aGUIApp) { #ifdef USE_SALOME_STYLE @@ -736,15 +744,17 @@ int AbstractGUIAppMain(int argc, char **argv) Style_Salome::apply(); #endif // USE_SALOME_STYLE - if (!debugExceptions) - app.setHandler(aGUISession->handler()); // after loading SalomeApp application - // aGUISession contains SalomeApp_ExceptionHandler + // if (!debugExceptions) + // app.setHandler(aGUISession->handler()); // after loading SalomeApp application + // // aGUISession contains SalomeApp_ExceptionHandler // Run GUI loop MESSAGE("run(): starting the main event loop"); - if (splash) - splash->finish(aGUIApp->desktop()); + // if (splash) + // splash->finish(aGUIApp->desktop()); + + MESSAGE("run(): running app.exec()"); result = app.exec(); -- 2.39.2