From 71580803af58c477837920a156a31118ea6657db Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 17 Feb 2009 08:39:37 +0000 Subject: [PATCH] Merge from BR_V5_DEV 17Feb09 --- Makefile.am | 23 +- adm_local/Makefile.am | 41 +- adm_local/unix/Makefile.am | 40 +- adm_local/unix/config_files/Makefile.am | 42 +- adm_local/unix/config_files/README | 3 - adm_local/unix/config_files/check_PYHELLO.m4 | 21 + adm_local/unix/make_common_starter.am | 68 ++- bin/Makefile.am | 59 +- bin/myrunSalome.py | 9 +- bin/runAppli.in | 23 +- build_configure | 25 +- clean_configure | 35 ++ configure.ac | 35 +- .../PYHELLO_icons.po => doc/Makefile.am | 21 +- idl/Makefile.am | 61 +- idl/PYHELLO_Gen.idl | 29 +- resources/Makefile.am | 16 +- resources/PYHELLO.png | Bin 831 -> 4146 bytes resources/PYHELLOCatalog.xml.in | 23 + resources/PYHELLO_en.xml | 32 -- resources/PYHELLO_small.png | Bin 0 -> 933 bytes resources/SalomeApp.xml | 23 + src/Makefile.am | 38 +- src/PYHELLO/Makefile.am | 41 +- src/PYHELLO/PYHELLO.py | 7 +- src/PYHELLOGUI/Makefile.am | 44 +- src/PYHELLOGUI/PYHELLOGUI.py | 542 ++++++++++++++---- src/PYHELLOGUI/PYHELLO_icons.ts | 25 + src/PYHELLOGUI/PYHELLO_msg_en.po | 29 - src/PYHELLOGUI/PYHELLO_msg_en.ts | 25 + 30 files changed, 943 insertions(+), 437 deletions(-) delete mode 100644 adm_local/unix/config_files/README create mode 100755 clean_configure rename src/PYHELLOGUI/PYHELLO_icons.po => doc/Makefile.am (56%) mode change 100644 => 100755 delete mode 100644 resources/PYHELLO_en.xml create mode 100755 resources/PYHELLO_small.png create mode 100644 src/PYHELLOGUI/PYHELLO_icons.ts delete mode 100644 src/PYHELLOGUI/PYHELLO_msg_en.po create mode 100644 src/PYHELLOGUI/PYHELLO_msg_en.ts diff --git a/Makefile.am b/Makefile.am index e4803d7..4766f40 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,4 +1,7 @@ -# Copyright (C) 2005 CEA/DEN, EDF R&D, OPEN CASCADE, PRINCIPIA R&D +# Copyright (C) 2007-2008 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 @@ -14,29 +17,27 @@ # 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 +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # -* Makefile *- -# # Author : Patrick GOLDBRONN (CEA) # Date : 28/06/2001 # Modified by : Alexander BORODIN (OCN) - autotools usage # $Header: # - include $(top_srcdir)/adm_local/unix/make_common_starter.am +ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \ + -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ + -I ${GUI_ROOT_DIR}/adm_local/unix/config_files -SUBDIRS = idl adm_local resources src bin - -DIST_SUBDIRS = idl adm_local resources src bin +SUBDIRS = idl adm_local resources src bin doc DISTCLEANFILES = a.out aclocal.m4 configure -EXTRA_DIST+= \ - build_configure \ - clean_configure \ - LICENCE +EXTRA_DIST += \ + build_configure \ + clean_configure dist-hook: rm -rf `find $(distdir) -name CVS` diff --git a/adm_local/Makefile.am b/adm_local/Makefile.am index 7ae83a6..f35273f 100644 --- a/adm_local/Makefile.am +++ b/adm_local/Makefile.am @@ -1,19 +1,24 @@ -# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG -# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT -# 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. -# -# 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 -# +# Copyright (C) 2007-2008 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. +# +# 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 $(top_srcdir)/adm_local/unix/make_common_starter.am + SUBDIRS = unix diff --git a/adm_local/unix/Makefile.am b/adm_local/unix/Makefile.am index facd4e6..5f6d5f7 100644 --- a/adm_local/unix/Makefile.am +++ b/adm_local/unix/Makefile.am @@ -1,22 +1,24 @@ -# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG -# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT -# 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. -# -# 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 -# - +# Copyright (C) 2007-2008 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. +# +# 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 $(top_srcdir)/adm_local/unix/make_common_starter.am SUBDIRS = config_files diff --git a/adm_local/unix/config_files/Makefile.am b/adm_local/unix/config_files/Makefile.am index ece5b5b..54b4bc1 100644 --- a/adm_local/unix/config_files/Makefile.am +++ b/adm_local/unix/config_files/Makefile.am @@ -1,23 +1,25 @@ -# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG -# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT -# 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. -# -# 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 -# +# Copyright (C) 2007-2008 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. +# +# 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 $(top_srcdir)/adm_local/unix/make_common_starter.am -dist_admlocalm4_DATA= \ - README \ +dist_admlocalm4_DATA = \ check_PYHELLO.m4 diff --git a/adm_local/unix/config_files/README b/adm_local/unix/config_files/README deleted file mode 100644 index feb997b..0000000 --- a/adm_local/unix/config_files/README +++ /dev/null @@ -1,3 +0,0 @@ -This file is only here for CVS: -CVS does not always create empty directory, and adm_local/unix/config_file -is needed by build_configure. diff --git a/adm_local/unix/config_files/check_PYHELLO.m4 b/adm_local/unix/config_files/check_PYHELLO.m4 index 6cb9c9d..5da66c6 100755 --- a/adm_local/unix/config_files/check_PYHELLO.m4 +++ b/adm_local/unix/config_files/check_PYHELLO.m4 @@ -1,3 +1,24 @@ +dnl Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +dnl +dnl Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +dnl CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS +dnl +dnl This library is free software; you can redistribute it and/or +dnl modify it under the terms of the GNU Lesser General Public +dnl License as published by the Free Software Foundation; either +dnl version 2.1 of the License. +dnl +dnl This library is distributed in the hope that it will be useful, +dnl but WITHOUT ANY WARRANTY; without even the implied warranty of +dnl MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +dnl Lesser General Public License for more details. +dnl +dnl You should have received a copy of the GNU Lesser General Public +dnl License along with this library; if not, write to the Free Software +dnl Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +dnl +dnl See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +dnl # Check availability of PYHELLO binary distribution # # Author : Marc Tajchman (CEA, 2002) diff --git a/adm_local/unix/make_common_starter.am b/adm_local/unix/make_common_starter.am index 5339413..36ad8c3 100644 --- a/adm_local/unix/make_common_starter.am +++ b/adm_local/unix/make_common_starter.am @@ -1,49 +1,83 @@ +# Copyright (C) 2007-2008 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. +# +# 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 # # ============================================================ # This file defines the common definitions used in several # Makefile. This file must be included, if needed, by the file # Makefile.am. # ============================================================ -# - # Standard directory for installation -salomeincludedir = $(includedir)/@PACKAGE@ -libdir = $(prefix)/lib@LIB_LOCATION_SUFFIX@/@PACKAGE@ -bindir = $(prefix)/bin/@PACKAGE@ +# +salomeincludedir = $(includedir)/salome +libdir = $(prefix)/lib@LIB_LOCATION_SUFFIX@/salome +bindir = $(prefix)/bin/salome salomescriptdir = $(bindir) +salomepythondir = $(pythondir)/salome +salomepyexecdir = $(pyexecdir)/salome # Directory for installing idl files -salomeidldir = $(prefix)/idl/@PACKAGE@ +salomeidldir = $(prefix)/idl/salome # Directory for installing resource files -salomeresdir = $(prefix)/share/@PACKAGE@/resources/@MODULE_NAME@ +salomeresdir = $(prefix)/share/salome/resources/@MODULE_NAME@ # Directories for installing admin files -admlocaldir = $(prefix)/adm_local -admlocalunixdir = $(admlocaldir)/unix -admlocalm4dir = $(admlocaldir)/unix/config_files +admlocaldir = $(prefix)/adm_local +admlocalunixdir = $(admlocaldir)/unix +admlocalm4dir = $(admlocaldir)/unix/config_files # Shared modules installation directory -sharedpkgpythondir =$(pkgpythondir)/shared_modules +sharedpkgpythondir = $(salomepythondir)/shared_modules # Documentation directory -docdir = $(datadir)/doc/@PACKAGE@ +docdir = $(datadir)/doc/salome # common rules -# moc-files generation +# meta object implementation files generation (moc) %_moc.cxx: %.h $(MOC) $< -o $@ -# qm-files generation -%.qm: %.po - $(MSG2QM) $< $@ +# translation (*.qm) files generation (lrelease) +%.qm: %.ts + $(LRELEASE) $< -qm $@ + +# resource files generation (qrcc) +qrc_%.cxx: %.qrc + $(QRCC) $< -o $@ -name $(*F) + +# qt forms files generation (uic) +ui_%.h: %.ui + $(UIC) -o $@ $< -EXTRA_DIST=$(MOC_FILES:%_moc.cxx=%.h) $(nodist_salomeres_DATA:%.qm=%.po) +# extra distributed files +EXTRA_DIST = $(MOC_FILES:%_moc.cxx=%.h) $(QRC_FILES:qrc_%.cxx=%.qrc) \ + $(UIC_FILES:ui_%.h=%.ui) $(nodist_salomeres_DATA:%.qm=%.ts) +# customize clean operation mostlyclean-local: rm -f @builddir@/*_moc.cxx rm -f @builddir@/*.qm + rm -f @builddir@/ui_*.h + rm -f @builddir@/qrc_*.cxx # tests tests: unittest diff --git a/bin/Makefile.am b/bin/Makefile.am index 9aa3859..f9eb701 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -1,40 +1,35 @@ -# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG -# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT -# 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. -# -# 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 -# -* Makefile *- +# Copyright (C) 2007-2008 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. +# +# 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 +# +# -* Makefile *- # Author : Guillaume Boulant (CSSI) # Module : COMPONENT # - include $(top_srcdir)/adm_local/unix/make_common_starter.am -# -# =============================================================== -# Files to be installed -# =============================================================== -# - -# These files are data, module or lib files - -dist_salomescript_DATA= \ +dist_salomescript_SCRIPTS = \ myrunSalome.py -nodist_salomescript_DATA= \ - VERSION \ - runAppli -EXTRA_DIST+= VERSION.in runAppli.in +nodist_salomescript_SCRIPTS = \ + runAppli + +nodist_salomescript_DATA = \ + VERSION diff --git a/bin/myrunSalome.py b/bin/myrunSalome.py index 3b4d6cf..bf4edf1 100755 --- a/bin/myrunSalome.py +++ b/bin/myrunSalome.py @@ -1,4 +1,7 @@ -# Copyright (C) 2005 CEA/DEN, EDF R&D +# Copyright (C) 2007-2008 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 @@ -14,10 +17,10 @@ # 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 +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # #!/usr/bin/env python - +# def test(clt): """ Test function that creates an instance of PYHELLO component diff --git a/bin/runAppli.in b/bin/runAppli.in index cde6cf2..514750a 100755 --- a/bin/runAppli.in +++ b/bin/runAppli.in @@ -1,4 +1,25 @@ #!/bin/sh +# Copyright (C) 2007-2008 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. +# +# 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 +# if [ -z "${KERNEL_ROOT_DIR}" ] ; then export KERNEL_ROOT_DIR=@KERNEL_ROOT_DIR@ @@ -41,6 +62,6 @@ searchFreePort() { searchFreePort -${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python -i $PYHELLO_ROOT_DIR/bin/salome/myrunSalome.py --modules=PYHELLO --containers=cpp,python --killall +${KERNEL_ROOT_DIR}/bin/salome/envSalome.py python -i $PYHELLO_ROOT_DIR/bin/salome/myrunSalome.py --modules=PYHELLO --killall diff --git a/build_configure b/build_configure index 3c8e79e..4f365ac 100755 --- a/build_configure +++ b/build_configure @@ -1,14 +1,31 @@ #!/bin/bash - +# Copyright (C) 2007-2008 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. +# +# 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 # # Tool for updating list of .in file for the SALOME project # and regenerating configure script -# # Author : # Modified by : Alexander BORODIN (OCN) - autotools usage # Date : 10/10/2002 - - +# ORIG_DIR=`pwd` CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"` diff --git a/clean_configure b/clean_configure new file mode 100755 index 0000000..f57f7b3 --- /dev/null +++ b/clean_configure @@ -0,0 +1,35 @@ +#!/bin/sh +# Copyright (C) 2007-2008 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. +# +# 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 +# +rm -rf autom4te.cache aclocal.m4 configure make_config +find . -name "*~" -print -exec rm {} \; +find . -name "*.pyc" -print -exec rm {} \; +#exit +# ==================== ON SORT AVANT + +find bin -name Makefile.in | xargs rm -f +find doc -name Makefile.in | xargs rm -f +find idl -name Makefile.in | xargs rm -f +find resources -name Makefile.in | xargs rm -f +find salome_adm -name Makefile.in | xargs rm -f +find src -name Makefile.in | xargs rm -f +rm -f Makefile.in diff --git a/configure.ac b/configure.ac index d72094c..3151424 100644 --- a/configure.ac +++ b/configure.ac @@ -1,21 +1,35 @@ +# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE # -# PLEASE DO NOT MODIFY configure.in FILE +# Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS # -# ALL CHANGES WILL BE DISCARDED BY THE NEXT -# build_configure COMMAND +# 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. # -# CHANGES MUST BE MADE IN configure.in.base FILE +# 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 # +# PLEASE DO NOT MODIFY configure.in FILE +# ALL CHANGES WILL BE DISCARDED BY THE NEXT +# build_configure COMMAND +# CHANGES MUST BE MADE IN configure.in.base FILE # Author : Marc Tajchman (CEA) # Date : 28/06/2001 # Modified by : Patrick GOLDBRONN (CEA) # Modified by : Marc Tajchman (CEA) -# # Created from configure.in.base # - -AC_INIT([Salome2 Project PYHELLO module], [4.1.1], [webmaster.salome@opencascade.com], [salome]) +AC_INIT([Salome2 Project PYHELLO module], [5.1.0], [webmaster.salome@opencascade.com], [SalomePYHELLO]) AC_CONFIG_AUX_DIR(salome_adm/unix/config_files) AC_CANONICAL_HOST AC_CANONICAL_TARGET @@ -125,11 +139,11 @@ CORBA=adm_local/unix/$corba echo echo --------------------------------------------- -echo testing msg2qm +echo testing QT echo --------------------------------------------- echo -CHECK_MSG2QM +CHECK_QT echo echo --------------------------------------------- @@ -168,7 +182,7 @@ echo --------------------------------------------- echo echo Configure -variables="python_ok omniORB_ok msg2qm_ok Kernel_ok" +variables="python_ok omniORB_ok qt_ok Kernel_ok" for var in $variables do @@ -209,6 +223,7 @@ AC_OUTPUT([ \ ./bin/VERSION \ ./bin/runAppli \ ./bin/Makefile \ + ./doc/Makefile \ ./src/Makefile \ ./src/PYHELLO/Makefile \ ./src/PYHELLOGUI/Makefile \ diff --git a/src/PYHELLOGUI/PYHELLO_icons.po b/doc/Makefile.am old mode 100644 new mode 100755 similarity index 56% rename from src/PYHELLOGUI/PYHELLO_icons.po rename to doc/Makefile.am index 7268d4d..6e3f6da --- a/src/PYHELLOGUI/PYHELLO_icons.po +++ b/doc/Makefile.am @@ -1,4 +1,7 @@ -# Copyright (C) 2005 CEA/DEN, EDF R&D +# Copyright (C) 2007-2008 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 @@ -14,16 +17,10 @@ # 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 +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # -# This is a Qt message file in .po format. Each msgid starts with -# a scope. This scope should *NOT* be translated - eg. "Foo::Bar" -# would be translated to "Pub", not "Foo::Pub". -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n" -"PO-Revision-Date: YYYY-MM-DD\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" +include $(top_srcdir)/adm_local/unix/make_common_starter.am + +dist_doc_DATA = dev_guide.pdf +EXTRA_DIST += dev_guide.txt diff --git a/idl/Makefile.am b/idl/Makefile.am index 3e49a1e..7035f61 100644 --- a/idl/Makefile.am +++ b/idl/Makefile.am @@ -1,37 +1,35 @@ -# Copyright (C) 2005 OPEN CASCADE, CEA, EDF R&D, LEG -# PRINCIPIA R&D, EADS CCR, Lip6, BV, CEDRAT -# 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. -# -# 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 -# - +# Copyright (C) 2007-2008 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. +# +# 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 # # This Makefile is responsible of generating the client and server # implementation of IDL interfaces for both C++ and python usage. # The building process of the C++ files is in charge of each source # package and then is not manage here. # - include $(top_srcdir)/adm_local/unix/make_common_starter.am BASEIDL_FILES = PYHELLO_Gen.idl -EXTRA_DIST+= $(BASEIDL_FILES) - # This variable defines the files to be installed -salomeidl_DATA = $(BASEIDL_FILES) +dist_salomeidl_DATA = $(BASEIDL_FILES) # These variables defines the building process of CORBA files OMNIORB_IDL = @OMNIORB_IDL@ @@ -41,7 +39,6 @@ OMNIORB_IDLPYFLAGS = \ -I$(top_builddir)/idl/salome \ -I$(KERNEL_ROOT_DIR)/idl/salome - IDLCXXFLAGS = \ -bcxx \ @IDLCXXFLAGS@ \ @@ -52,25 +49,17 @@ IDLPYFLAGS = \ @IDLPYFLAGS@ \ -I$(KERNEL_ROOT_DIR)/idl/salome -# install python client (generated from idl file -install: install-pyidl install-idl - -# create directory $(idldir) and copy idl files into it -install-idl: $(BASEIDL_FILES) - $(INSTALL) -d $(salomeidldir) - cp -p $^ $(salomeidldir) - -install-pyidl: $(BASEIDL_FILES) - $(INSTALL) -d $(PYTHON_SITE_INSTALL) +install-exec-local: $(BASEIDL_FILES:%=$(top_srcdir)/idl/%) + $(INSTALL) -d $(DESTDIR)$(salomepythondir) @for file in $^ dummy; do \ if [ $$file != "dummy" ]; then \ - $(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(PYTHON_SITE_INSTALL) $$file ; \ + $(OMNIORB_IDL) $(OMNIORB_IDLPYFLAGS) -C$(DESTDIR)$(salomepythondir) $$file ; \ fi ; \ done ; # uninstall-local removes too much, but it works in distcheck uninstall-local: - rm -rf $(pkgpythondir)/* + rm -rf $(DESTDIR)$(salomepythondir)/* mostlyclean-local: -rm -f *.py diff --git a/idl/PYHELLO_Gen.idl b/idl/PYHELLO_Gen.idl index 665544c..87cbfcc 100644 --- a/idl/PYHELLO_Gen.idl +++ b/idl/PYHELLO_Gen.idl @@ -1,20 +1,23 @@ -// Copyright (C) 2005 CEA/DEN, EDF R&D +// Copyright (C) 2007-2008 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. +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // -// 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. +// 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. // -// 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 +// 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. // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +// 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 __PYHELLO_GEN__ #define __PYHELLO_GEN__ diff --git a/resources/Makefile.am b/resources/Makefile.am index 0310816..45755dc 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -1,4 +1,6 @@ -# Copyright (C) 2005 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +# Copyright (C) 2007-2008 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 @@ -15,20 +17,20 @@ # 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 +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # # -* Makefile *- -# # Author : Patrick GOLDBRONN (CEA) # Date : 28/06/2001 # Modified by : Alexander BORODIN (OCN) - autotools usage - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am dist_salomeres_DATA = \ PYHELLO.png \ + PYHELLO_small.png \ ExecPYHELLO.png \ - SalomeApp.xml \ - PYHELLO_en.xml + SalomeApp.xml -nodist_salomeres_DATA = PYHELLOCatalog.xml +# VSR: little trick to avoid putting if PYHELLOCatalog.xml to the distribution archive +nodist_salomeres_SCRIPTS = PYHELLOCatalog.xml diff --git a/resources/PYHELLO.png b/resources/PYHELLO.png index 16a20c116e8243a6b49ed862613d2cc49bdf4caa..f3a2ab698e81bdd9bbb3a1c8f812f14eabe739c1 100644 GIT binary patch literal 4146 zcmW+(dpy(a`~U1<6JwLbhz%wADhw&aMj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wxBA)n8qH7KP3u&gskDFGN6$uKrHiZR_rN}14Z`#4UOD2mcG?k`2H zR>Ak*lO&RzojSEzojZ3H7#Ydnx>Y>S!*Qx8Whj-lnV+9O0`^K_pA-mTo88@AMn}KJ z7|q1QePfzG&~%qf-#0DirL!QIOhM^sp!GqyxAfM0;JR*$E!QXNfM)! zMk!6R=`lO|^T2T%xGP+@P7nmdag3BPS}T;&NSUCNAq)?B_pZgn#3h!Omr@gz0)P5V z|6*n3H?Cd#fsKtn*xTDDib6ho2q=}ddH(!&d}d~5Xf{1ATsY6|+rJEi9|OO7wQla- zT{QiRMhM%?&i-WX-(ND>Z0?wDVPV0{&CUJ$IvunIuUz@gJbU)kEH2(l=}xsaq1)Y) z&B$cFVQOj;%SxFKwEs^>2-{3fPJP*@>HnO+0hzznl0FD~L;wH)07*qoM6N<$f + diff --git a/resources/PYHELLO_en.xml b/resources/PYHELLO_en.xml deleted file mode 100644 index 72070e3..0000000 --- a/resources/PYHELLO_en.xml +++ /dev/null @@ -1,32 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/resources/PYHELLO_small.png b/resources/PYHELLO_small.png new file mode 100755 index 0000000000000000000000000000000000000000..474a537825449f079f68d14de661db882f2466a0 GIT binary patch literal 933 zcmV;W16urvP)Z)o3!APUidL-npO0h0_Oqn-`wvec|O1#@vvAHAeyh zP;&%e^S=aOfEWmX5Qr3z0W{#ud1SKZp_%zi0x2*9#=r#d6tDy=B>t=>EUBf|UObs> z#GZE{Q>|Y2j{f~n<+9rnQRDXN^c^2p-r@;S*(Lb3Z3u_(nSQv$~x75s5Nk(g;rm z_28scPwE~-$RHln4L6@`by`1lFDf-T`baf0oiEwpuzT9A)^{vBvlGuI zm(w&Esc<@cTPo+C%E&vUCTI@RcsL2$jWeZAx|}pDx#%s`YWIb0H-%;0^*e{p>q6yo zl`VcLgg6$)+}H%l;bi$jtHbMw^DO{V9icG|H&c|pyxo|SQ%Ze{H=uYGV9=mNfY z>(y5fiv^rw0Ui0QxjD*tmmp_z@uiK??%uF)X5BHr?zP0jlsC7wUf!N}Ap#=x(fS5g z+Yh78^q zFBMj=&&`7abS7YSx5H7ZP4fNk9NuryYIV7G?HlIX6CnK$%jk2U{E08R00000NkvXX Hu0mjfX(hO6 literal 0 HcmV?d00001 diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml index 4912c7e..532ddce 100644 --- a/resources/SalomeApp.xml +++ b/resources/SalomeApp.xml @@ -1,3 +1,26 @@ +
diff --git a/src/Makefile.am b/src/Makefile.am index eb795ef..d374535 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,28 +1,28 @@ -# Copyright (C) 2003 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. -# -# 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 +# Copyright (C) 2007-2008 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. +# +# 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 # # File : Makefile.in # Author : (CEA) # Modified by : Alexander BORODIN (OCN) - autotools usage - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am SUBDIRS = PYHELLO PYHELLOGUI diff --git a/src/PYHELLO/Makefile.am b/src/PYHELLO/Makefile.am index 8fed1af..bfde71a 100755 --- a/src/PYHELLO/Makefile.am +++ b/src/PYHELLO/Makefile.am @@ -1,32 +1,31 @@ -# SuperVisionTest AddComponent : example of component that adds two numbers +# Copyright (C) 2007-2008 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. # -# Copyright (C) 2003 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. -# -# 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 +# 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 # +# SuperVisionTest AddComponent : example of component that adds two numbers # File : Makefile.in # Author : , CEA # Modified by : Alexander BORODIN (OCN) - autotools usage - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am # Scripts to be installed -dist_salomescript_DATA = \ +dist_salomescript_SCRIPTS = \ PYHELLO.py diff --git a/src/PYHELLO/PYHELLO.py b/src/PYHELLO/PYHELLO.py index 0a12777..98108fe 100644 --- a/src/PYHELLO/PYHELLO.py +++ b/src/PYHELLO/PYHELLO.py @@ -1,4 +1,7 @@ -# Copyright (C) 2005 CEA/DEN, EDF R&D +# Copyright (C) 2007-2008 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 @@ -14,7 +17,7 @@ # 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 +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # import PYHELLO_ORB__POA import SALOME_ComponentPy diff --git a/src/PYHELLOGUI/Makefile.am b/src/PYHELLOGUI/Makefile.am index 11f1121..c6b2f87 100755 --- a/src/PYHELLOGUI/Makefile.am +++ b/src/PYHELLOGUI/Makefile.am @@ -1,37 +1,33 @@ -# SuperVisionTest AddComponent : example of component that adds two numbers +# Copyright (C) 2007-2008 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 # -# Copyright (C) 2003 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. -# -# 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 +# 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. # +# 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 +# +# SuperVisionTest AddComponent : example of component that adds two numbers # File : Makefile.in # Author : , CEA # Modified by : Alexander BORODIN (OCN) - autotools usage - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am -# header files -salomeinclude_HEADERS = - # Scripts to be installed -dist_salomescript_DATA = \ +dist_salomescript_SCRIPTS = \ PYHELLOGUI.py # resources files diff --git a/src/PYHELLOGUI/PYHELLOGUI.py b/src/PYHELLOGUI/PYHELLOGUI.py index af4ce65..297eb4b 100644 --- a/src/PYHELLOGUI/PYHELLOGUI.py +++ b/src/PYHELLOGUI/PYHELLOGUI.py @@ -1,4 +1,7 @@ -# Copyright (C) 2005 CEA/DEN, EDF R&D +# Copyright (C) 2007-2008 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 @@ -14,10 +17,17 @@ # 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 +# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com +# +# --- +# File : PYHELLOGUI.py +# Author : Vadim SANDLER, Open CASCADE S.A.S. (vadim.sandler@opencascade.com) +# --- # -from qt import * import traceback +import os +from PyQt4.QtGui import * +from PyQt4.QtCore import * from omniORB import CORBA from SALOME_NamingServicePy import * @@ -28,15 +38,94 @@ import SALOMEDS_Attributes_idl import PYHELLO_ORB ################################################ -# module name -__MODULE_NAME__ = "PYHELLO" -__MODULE_ID__ = 1000 -__OBJECT_ID__ = 1010 +# GUI context class +# Used to store actions, menus, toolbars, etc... +################################################ + +class GUIcontext: + # module name + MODULE_NAME = "PYHELLO" + # module icon + MODULE_PIXMAP = "PYHELLO_small.png" + # data objects IDs + MODULE_ID = 1000 + OBJECT_ID = 1010 + FOREIGN_ID = -1 + # menus/toolbars/actions IDs + PYHELLO_MENU_ID = 90 + HELLO_ID = 941 + CREATE_OBJECT_ID = 942 + OPTIONS_ID = 943 + OPTION_1_ID = 944 + OPTION_2_ID = 945 + OPTION_3_ID = 946 + PYHELLO_TB_ID = 90 + DELETE_ALL_ID = 951 + SHOW_ME_ID = 952 + DELETE_ME_ID = 953 + RENAME_ME_ID = 954 + # default object name + DEFAULT_NAME = "Object" + + # constructor + def __init__( self ): + # create top-level menu + mid = sgPyQt.createMenu( "PyHello", -1, GUIcontext.PYHELLO_MENU_ID, sgPyQt.defaultMenuGroup() ) + # create toolbar + tid = sgPyQt.createTool( "PyHello" ) + # create actions and fill menu and toolbar with actions + a = sgPyQt.createAction( GUIcontext.HELLO_ID, "Hello", "Hello", "Show hello dialog box", "ExecPYHELLO.png" ) + sgPyQt.createMenu( a, mid ) + sgPyQt.createTool( a, tid ) + a = sgPyQt.createSeparator() + sgPyQt.createMenu( a, mid ) + a = sgPyQt.createAction( GUIcontext.CREATE_OBJECT_ID, "Create object", "Create object", "Create object" ) + sgPyQt.createMenu( a, mid ) + a = sgPyQt.createSeparator() + sgPyQt.createMenu( a, mid ) + try: + ag = sgPyQt.createActionGroup( GUIcontext.OPTIONS_ID ) + ag.setText( "Creation mode" ) + ag.setUsesDropDown(True) + a = sgPyQt.createAction( GUIcontext.OPTION_1_ID, "Default name", "Default name", "Use default name for the objects" ) + a.setCheckable( True ) + ag.add( a ) + a = sgPyQt.createAction( GUIcontext.OPTION_2_ID, "Generate name", "Generate name", "Generate name for the objects" ) + a.setCheckable( True ) + ag.add( a ) + a = sgPyQt.createAction( GUIcontext.OPTION_3_ID, "Ask name", "Ask name", "Request object name from the user" ) + a.setCheckable( True ) + ag.add( a ) + sgPyQt.createMenu( ag, mid ) + sgPyQt.createTool( ag, tid ) + default_mode = sgPyQt.integerSetting( "PYHELLO", "creation_mode", 0 ) + sgPyQt.action( GUIcontext.OPTION_1_ID + default_mode ).setChecked( True ) + except: + pass + # the following action are used in context popup + a = sgPyQt.createAction( GUIcontext.DELETE_ALL_ID, "Delete all", "Delete all", "Delete all objects" ) + a = sgPyQt.createAction( GUIcontext.SHOW_ME_ID, "Show", "Show", "Show object name" ) + a = sgPyQt.createAction( GUIcontext.DELETE_ME_ID, "Delete", "Delete", "Remove object" ) + a = sgPyQt.createAction( GUIcontext.RENAME_ME_ID, "Rename", "Rename", "Rename object" ) + pass + pass + +################################################ +# Global variables ################################################ +# study-to-context map +__study2context__ = {} +# current context +__current_context__ = None +# object counter +__id__ = 0 + +################################################ + # Get SALOME PyQt interface import SalomePyQt -sgPyQt=SalomePyQt.SalomePyQt() +sgPyQt = SalomePyQt.SalomePyQt() # Get SALOME Swig interface import libSALOME_Swig @@ -59,19 +148,47 @@ studyManager = obj._narrow( SALOMEDS.StudyManager ) ################################################ # Internal methods +################################################ + +### +# Check verbose mode +### +__verbose__ = None +def verbose(): + global __verbose__ + if __verbose__ is None: + try: + __verbose__ = int( os.getenv('SALOME_VERBOSE', 0) ) + except: + __verbose__ = 0 + pass + pass + return __verbose__ -# --- get PYHELLO engine --- +### +# get PYHELLO engine +### def _getEngine(): - engine = lcc.FindOrLoadComponent( "FactoryServerPy", __MODULE_NAME__ ) + engine = lcc.FindOrLoadComponent( "FactoryServerPy", GUIcontext.MODULE_NAME ) return engine -# --- get active study --- +### +# get active study ID +### +def _getStudyId(): + return sgPyQt.getStudyId() + +### +# get active study +### def _getStudy(): - studyId = sgPyQt.getStudyId() + studyId = _getStudyId() study = studyManager.GetStudyByID( studyId ) return study - -# --- returns 1 if object has children --- + +### +# returns True if object has children +### def _hasChildren( sobj ): if sobj: study = _getStudy() @@ -79,118 +196,265 @@ def _hasChildren( sobj ): while iter.More(): name = iter.Value().GetName() if name: - return 1 + return True iter.Next() - return 0 + pass + pass + return False -# --- finds or creates component object --- +### +# finds or creates component object +### def _findOrCreateComponent(): study = _getStudy() - father = study.FindComponent( __MODULE_NAME__ ) + father = study.FindComponent( GUIcontext.MODULE_NAME ) if father is None: builder = study.NewBuilder() - father = builder.NewComponent( __MODULE_NAME__ ) + father = builder.NewComponent( GUIcontext.MODULE_NAME ) attr = builder.FindOrCreateAttribute( father, "AttributeName" ) - attr.SetValue( __MODULE_NAME__ ) + attr.SetValue( GUIcontext.MODULE_NAME ) + attr = builder.FindOrCreateAttribute( father, "AttributePixMap" ) + attr.SetPixMap( GUIcontext.MODULE_PIXMAP ) attr = builder.FindOrCreateAttribute( father, "AttributeLocalID" ) - attr.SetValue( __MODULE_ID__ ) + attr.SetValue( GUIcontext.MODULE_ID ) try: builder.DefineComponentInstance( father, _getEngine() ) pass except: pass + pass return father - + +### +# get current GUI context +### +def _getContext(): + global __current_context__ + return __current_context__ + +### +# set and return current GUI context +# study ID is passed as parameter +### +def _setContext( studyID ): + global __study2context__, __current_context__ + if not __study2context__.has_key(studyID): + __study2context__[studyID] = GUIcontext() + pass + __current_context__ = __study2context__[studyID] + return __current_context__ + +### +# increment object counter in the map +### +def _incObjToMap( m, id ): + if id not in m: m[id] = 0 + m[id] += 1 + pass + +### +# analyse selection +### +def _getSelection(): + selcount = sg.SelectedCount() + seltypes = {} + study = _getStudy() + for i in range( selcount ): + entry = sg.getSelected( i ) + if entry: + sobj = study.FindObjectID( entry ) + if sobj is not None: + test, anAttr = sobj.FindAttribute( "AttributeLocalID" ) + if test: + ID = anAttr._narrow( SALOMEDS.AttributeLocalID ).Value() + if ID >= 0: + _incObjToMap( seltypes, ID ) + continue + pass + pass + pass + _incObjToMap( seltypes, GUIcontext.FOREIGN_ID ) + pass + return selcount, seltypes + ################################################ # Callback functions +################################################ + +# called when module is initialized +# perform initialization actions +def initialize(): + if verbose() : print "PYHELLOGUI.initialize() : study : %d" % _getStudyId() + # set default preferences values + if not sgPyQt.hasSetting( "PYHELLO", "def_obj_name"): + sgPyQt.addSetting( "PYHELLO", "def_obj_name", GUIcontext.DEFAULT_NAME ) + if not sgPyQt.hasSetting( "PYHELLO", "creation_mode"): + sgPyQt.addSetting( "PYHELLO", "creation_mode", 0 ) + pass -# set workspace (obsolete method, not used) -def setWorkSpace( pyws ): - print "PYHELLOGUI::setWorkSpace : ", pyws +# called when module is initialized +# return map of popup windows to be used by the module +def windows(): + if verbose() : print "PYHELLOGUI.windows() : study : %d" % _getStudyId() + wm = {} + wm[SalomePyQt.WT_ObjectBrowser] = Qt.LeftDockWidgetArea + wm[SalomePyQt.WT_PyConsole] = Qt.BottomDockWidgetArea + return wm + +# called when module is initialized +# return list of 2d/3d views to be used ny the module +def views(): + if verbose() : print "PYHELLOGUI.views() : study : %d" % _getStudyId() + return [] + +# called when module is initialized +# export module's preferences +def createPreferences(): + if verbose() : print "PYHELLOGUI.createPreferences() : study : %d" % _getStudyId() + gid = sgPyQt.addPreference( "General" ) + gid = sgPyQt.addPreference( "Object creation", gid ) + pid = sgPyQt.addPreference( "Default name", gid, SalomePyQt.PT_String, "PYHELLO", "def_obj_name" ) + pid = sgPyQt.addPreference( "Default creation mode", gid, SalomePyQt.PT_Selector, "PYHELLO", "creation_mode" ) + strings = QStringList() + strings.append( "Default name" ) + strings.append( "Generate name" ) + strings.append( "Ask name" ) + indexes = [] + indexes.append( QVariant(0) ) + indexes.append( QVariant(1) ) + indexes.append( QVariant(2) ) + sgPyQt.setPreferenceProperty( pid, "strings", QVariant( strings ) ) + sgPyQt.setPreferenceProperty( pid, "indexes", QVariant( indexes ) ) pass # called when module is activated -def setSettings(): - print "PYHELLOGUI::setSettings" +# returns True if activating is successfull and False otherwise +def activate(): + if verbose() : print "PYHELLOGUI.activate() : study : %d" % _getStudyId() + ctx = _setContext( _getStudyId() ) + return True + +# called when module is deactivated +def deactivate(): + if verbose() : print "PYHELLOGUI.deactivate() : study : %d" % _getStudyId() pass # called when active study is changed +# active study ID is passed as parameter def activeStudyChanged( studyID ): - print "PYHELLOGUI::activeStudyChanged: study ID =", studyID + if verbose() : print "PYHELLOGUI.activeStudyChanged(): study : %d" % studyID + ctx = _setContext( _getStudyId() ) pass -# define popup menu -def definePopup( context, object, parent ): - object = "" - parent = "" - +# called when popup menu is invoked +# popup menu and menu context are passed as parameters +def createPopupMenu( popup, context ): + if verbose() : print "PYHELLOGUI.createPopupMenu(): context = %s" % context + ctx = _setContext( _getStudyId() ) study = _getStudy() - if sg.SelectedCount() == 1: - entry = sg.getSelected( 0 ) - if entry != '': - sobj = study.FindObjectID( entry ) - if sobj is not None: - test, anAttr = sobj.FindAttribute( "AttributeLocalID" ) - if test : - id = anAttr._narrow( SALOMEDS.AttributeLocalID ).Value() - if ( id >= 0 ): - object = str( id ) - print "PYHELLOGUI::definePopup :", context, object, parent - return context, object, parent - -# customize popup menu -def customPopup( popup, context, object, parent ): - print "PYHELLOGUI::customPopup :", context, object, parent - try: - id = int( object ) - if id == __MODULE_ID__: - study = _getStudy() - if sg.SelectedCount() == 1: - entry = sg.getSelected( 0 ) - if entry != '': - sobj = study.FindObjectID( entry ) - if sobj and not _hasChildren( sobj ): - popup.removeItem( 951 ) # remove 'Delete All' command - except: + selcount, selected = _getSelection() + print selcount, selected + if selcount == 1: + # one object is selected + if GUIcontext.MODULE_ID in selected: + # menu for component + popup.addAction( sgPyQt.action( GUIcontext.DELETE_ALL_ID ) ) + elif GUIcontext.OBJECT_ID in selected: + # menu for object + popup.addAction( sgPyQt.action( GUIcontext.SHOW_ME_ID ) ) + popup.addAction( sgPyQt.action( GUIcontext.RENAME_ME_ID ) ) + popup.addSeparator() + popup.addAction( sgPyQt.action( GUIcontext.DELETE_ME_ID ) ) + pass + pass + elif selcount > 1: + # several objects are selected + if len( selected ) == 1: + if GUIcontext.MODULE_ID in selected: + # menu for component + popup.addAction( sgPyQt.action( GUIcontext.DELETE_ALL_ID ) ) + elif GUIcontext.OBJECT_ID in selected: + # menu for list of objects + popup.addAction( sgPyQt.action( GUIcontext.DELETE_ME_ID ) ) + pass + pass pass pass -# process GUI action -def OnGUIEvent(commandID) : - print "PYHELLOGUI::OnGUIEvent : commandID =",commandID +# called when GUI action is activated +# action ID is passed as parameter +def OnGUIEvent( commandID ): + if verbose() : print "PYHELLOGUI.OnGUIEvent(): command = %d" % commandID if dict_command.has_key( commandID ): try: dict_command[commandID]() except: traceback.print_exc() else: - print "The command is not implemented: ",commandID + if verbose() : print "The command is not implemented: %d" % commandID + pass + +# called when module's preferences are changed +# preference's resources section and setting name are passed as parameters +def preferenceChanged( section, setting ): + if verbose() : print "PYHELLOGUI.preferenceChanged(): %s / %s" % ( section, setting ) + pass + +# called when active view is changed +# view ID is passed as parameter +def activeViewChanged( viewID ): + if verbose() : print "PYHELLOGUI.activeViewChanged(): %d" % viewID + pass + +# called when active view is cloned +# cloned view ID is passed as parameter +def viewCloned( viewID ): + if verbose() : print "PYHELLOGUI.viewCloned(): %d" % viewID + pass + +# called when active view is viewClosed +# view ID is passed as parameter +def viewClosed( viewID ): + if verbose() : print "PYHELLOGUI.viewClosed(): %d" % viewID + pass ################################################ # GUI actions implementation +################################################ -# ----------------------- # -# Sample dialog box -# ----------------------- # +### +# 'HELLO' dialog box +### class MyDialog( QDialog ): # constructor def __init__( self, parent = None, modal = 0): - QDialog.__init__( self, parent, "MyDialog", modal ) - self.setCaption( "HELLO!" ) - vb = QVBoxLayout( self, 8 ) - vb.setAutoAdd( 1 ) - hb0 = QHBox( self ) - label = QLabel( "Prenom: ", hb0 ) - self.entry = QLineEdit( hb0 ) + QDialog.__init__( self, parent ) + self.setObjectName( "MyDialog" ) + self.setModal( modal ) + self.setWindowTitle( "HELLO!" ) + vb = QVBoxLayout( self ) + vb.setMargin( 8 ) + + hb0 = QHBoxLayout( self ) + label = QLabel( "Prenom: ", self ) + hb0.addWidget( label ) + self.entry = QLineEdit( self ) self.entry.setMinimumWidth( 200 ) + hb0.addWidget( self.entry ) + vb.addLayout( hb0 ) - hb1 = QHBox( self ) - bOk = QPushButton( "&OK", hb1 ) + hb1 = QHBoxLayout( self ) + bOk = QPushButton( "&OK", self ) self.connect( bOk, SIGNAL( 'clicked()' ), self, SLOT( 'accept()' ) ) - dummy = QWidget( hb1 ) - bCancel = QPushButton( "&Cancel", hb1 ) + hb1.addWidget( bOk ) + + hb1.addStretch( 10 ) + + bCancel = QPushButton( "&Cancel", self ) self.connect( bCancel, SIGNAL( 'clicked()' ), self, SLOT( 'close()' ) ) - hb1.setStretchFactor( dummy, 10 ) + hb1.addWidget( bCancel ) + + vb.addLayout( hb1 ) pass # OK button slot @@ -204,34 +468,64 @@ class MyDialog( QDialog ): QMessageBox.warning( self, 'Error!', 'Please, enter the name!' ) pass -# ----------------------- # +### +# Show 'HELLO' dialog box +### def ShowHELLO(): # create dialog box d = MyDialog( sgPyQt.getDesktop(), 1 ) # show dialog box - d.exec_loop() - -__id__ = 0 + d.exec_() + pass -# ----------------------- # +### +# Create new object +### def CreateObject(): - global __id__ + default_name = str( sgPyQt.stringSetting( "PYHELLO", "def_obj_name", GUIcontext.DEFAULT_NAME ).trimmed() ) + try: + if sgPyQt.action( GUIcontext.OPTION_3_ID ).isChecked(): + # request object name from the user + name, ok = QInputDialog.getText( sgPyQt.getDesktop(), + "Create Object", + "Enter object name:", + QLineEdit.Normal, + default_name ) + if not ok: return + name = str( name.trimmed() ) + elif sgPyQt.action( GUIcontext.OPTION_2_ID ).isChecked(): + # generate object name + global __id__ + __id__ = __id__ + 1 + name = "%s %d" % ( default_name, __id__ ) + else: + name = default_name + pass + pass + except: + # generate object name + global __id__ + __id__ = __id__ + 1 + name = "%s %d" % ( default_name, __id__ ) + pass + if not name: return study = _getStudy() builder = study.NewBuilder() father = _findOrCreateComponent() object = builder.NewObject( father ) attr = builder.FindOrCreateAttribute( object, "AttributeName" ) - __id__ = __id__ + 1 - attr.SetValue( "Object " + str( __id__ ) ) + attr.SetValue( name ) attr = builder.FindOrCreateAttribute( object, "AttributeLocalID" ) - attr.SetValue( __OBJECT_ID__ ) - sg.updateObjBrowser(True) + attr.SetValue( GUIcontext.OBJECT_ID ) + sg.updateObjBrowser( True ) pass -# ----------------------- # +### +# Delete all objects +### def DeleteAll(): study = _getStudy() - father = study.FindComponent( __MODULE_NAME__ ) + father = study.FindComponent( GUIcontext.MODULE_NAME ) if father: iter = study.NewChildIterator( father ) builder = study.NewBuilder() @@ -239,10 +533,14 @@ def DeleteAll(): sobj = iter.Value() iter.Next() builder.RemoveObjectWithChildren( sobj ) - sg.updateObjBrowser(True) + pass + sg.updateObjBrowser( True ) + pass pass -# ----------------------- # +### +# Show object's name +### def ShowMe(): study = _getStudy() entry = sg.getSelected( 0 ) @@ -252,26 +550,62 @@ def ShowMe(): test, attr = sobj.FindAttribute( "AttributeName" ) if test: QMessageBox.information( sgPyQt.getDesktop(), 'Info', "My name is '%s'" % attr.Value() ) - + pass + pass + pass pass -# ----------------------- # +### +# Delete selected object(s) +### def Delete(): study = _getStudy() + builder = study.NewBuilder() + if sg.SelectedCount() <= 0: return + for i in range( sg.SelectedCount() ): + entry = sg.getSelected( i ) + if entry != '': + sobj = study.FindObjectID( entry ) + if ( sobj ): + builder.RemoveObject( sobj ) + pass + pass + pass + sg.updateObjBrowser( True ) + pass + +### +# Rename selected object +### +def Rename(): + study = _getStudy() + builder = study.NewBuilder() entry = sg.getSelected( 0 ) if entry != '': sobj = study.FindObjectID( entry ) if ( sobj ): - builder = study.NewBuilder() - builder.RemoveObject( sobj ) - sg.updateObjBrowser(True) + name, ok = QInputDialog.getText( sgPyQt.getDesktop(), + "Object name", + "Enter object name:", + QLineEdit.Normal, + sobj.GetName() ) + name = str( name.trimmed() ) + if not ok or not name: return + attr = builder.FindOrCreateAttribute( sobj, "AttributeName" ) + attr.SetValue( name ) + sg.updateObjBrowser( True ) + pass + pass pass -# ----------------------- # +### +# Commands dictionary +### dict_command = { - 941 : ShowHELLO, - 942 : CreateObject, - 951 : DeleteAll, - 952 : ShowMe, - 953 : Delete, + GUIcontext.HELLO_ID : ShowHELLO, + GUIcontext.CREATE_OBJECT_ID : CreateObject, + GUIcontext.DELETE_ALL_ID : DeleteAll, + GUIcontext.SHOW_ME_ID : ShowMe, + GUIcontext.DELETE_ME_ID : Delete, + GUIcontext.RENAME_ME_ID : Rename, } diff --git a/src/PYHELLOGUI/PYHELLO_icons.ts b/src/PYHELLOGUI/PYHELLO_icons.ts new file mode 100644 index 0000000..8025ecd --- /dev/null +++ b/src/PYHELLOGUI/PYHELLO_icons.ts @@ -0,0 +1,25 @@ + + + diff --git a/src/PYHELLOGUI/PYHELLO_msg_en.po b/src/PYHELLOGUI/PYHELLO_msg_en.po deleted file mode 100644 index 7268d4d..0000000 --- a/src/PYHELLOGUI/PYHELLO_msg_en.po +++ /dev/null @@ -1,29 +0,0 @@ -# Copyright (C) 2005 CEA/DEN, EDF R&D -# -# 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. -# -# 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 -# -# This is a Qt message file in .po format. Each msgid starts with -# a scope. This scope should *NOT* be translated - eg. "Foo::Bar" -# would be translated to "Pub", not "Foo::Pub". -msgid "" -msgstr "" -"Project-Id-Version: PROJECT VERSION\n" -"POT-Creation-Date: 2002-05-28 10:57:43 AM CEST\n" -"PO-Revision-Date: YYYY-MM-DD\n" -"Last-Translator: FULLNAME \n" -"Content-Type: text/plain; charset=iso-8859-1\n" - diff --git a/src/PYHELLOGUI/PYHELLO_msg_en.ts b/src/PYHELLOGUI/PYHELLO_msg_en.ts new file mode 100644 index 0000000..8025ecd --- /dev/null +++ b/src/PYHELLOGUI/PYHELLO_msg_en.ts @@ -0,0 +1,25 @@ + + + -- 2.39.2