From b4819d6ccb337fc9d75dcbf7fdbff148018c4b12 Mon Sep 17 00:00:00 2001 From: vsr Date: Thu, 9 Aug 2012 12:20:37 +0000 Subject: [PATCH] Merge from V6_main_20120808 08Aug12 --- Makefile.am | 32 +-- adm_local/Makefile.am | 30 +- adm_local/unix/Makefile.am | 30 +- adm_local/unix/config_files/Makefile.am | 30 +- adm_local/unix/config_files/check_PYLIGHT.m4 | 28 +- adm_local/unix/make_common_starter.am | 36 ++- bin/Makefile.am | 30 +- bin/VERSION.in | 4 +- build_configure | 57 ++-- clean_configure | 40 ++- configure.ac | 74 ++--- resources/LightApp.xml | 20 ++ resources/Makefile.am | 36 ++- resources/PYLIGHT_en.xml | 20 ++ resources/SalomeApp.xml | 14 - resources/SalomeApp.xml.in | 35 +++ src/Makefile.am | 30 +- src/PYLIGHTGUI/Makefile.am | 31 +- src/PYLIGHTGUI/PYLIGHTGUI.py | 282 ++++++++++++------- src/PYLIGHTGUI/PYLIGHT_DataModel.py | 30 +- src/PYLIGHTGUI/PYLIGHT_icons.ts | 27 +- src/PYLIGHTGUI/PYLIGHT_msg_en.ts | 34 +-- src/PYLIGHTGUI/PYLIGHT_msg_fr.ts | 11 + 23 files changed, 540 insertions(+), 421 deletions(-) delete mode 100644 resources/SalomeApp.xml create mode 100644 resources/SalomeApp.xml.in create mode 100644 src/PYLIGHTGUI/PYLIGHT_msg_fr.ts diff --git a/Makefile.am b/Makefile.am index a9bc1c1..92060dd 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,27 +1,25 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2009-2012 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 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. # -# 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 # -# 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 # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # Author : Roman NIKOLAEV Open CASCADE S.A.S. (roman.nikolaev@opencascade.com) # Date : 13/04/2009 - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \ @@ -30,7 +28,7 @@ ACLOCAL_AMFLAGS = -I adm_local/unix/config_files \ SUBDIRS = adm_local resources src bin -DISTCLEANFILES = a.out aclocal.m4 configure +DISTCLEANFILES = a.out aclocal.m4 configure local-install.sh hack_libtool EXTRA_DIST += \ build_configure \ diff --git a/adm_local/Makefile.am b/adm_local/Makefile.am index f35273f..98ec131 100644 --- a/adm_local/Makefile.am +++ b/adm_local/Makefile.am @@ -1,24 +1,22 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2009-2012 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 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. # -# 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 # -# 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 +# 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 5f6d5f7..9957566 100644 --- a/adm_local/unix/Makefile.am +++ b/adm_local/unix/Makefile.am @@ -1,24 +1,22 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2009-2012 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 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. # -# 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 # -# 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 +# 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 8e13ce0..c56f080 100644 --- a/adm_local/unix/config_files/Makefile.am +++ b/adm_local/unix/config_files/Makefile.am @@ -1,24 +1,22 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2009-2012 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 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. # -# 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 # -# 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 +# 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 = \ diff --git a/adm_local/unix/config_files/check_PYLIGHT.m4 b/adm_local/unix/config_files/check_PYLIGHT.m4 index 957ba22..fbb32cd 100755 --- a/adm_local/unix/config_files/check_PYLIGHT.m4 +++ b/adm_local/unix/config_files/check_PYLIGHT.m4 @@ -1,23 +1,21 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2009-2012 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 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. # -# 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 # -# 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 # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # Author : Roman NIKOLAEV Open CASCADE S.A.S. (roman.nikolaev@opencascade.com) # Date : 13/04/2009 diff --git a/adm_local/unix/make_common_starter.am b/adm_local/unix/make_common_starter.am index 36ad8c3..fe8e1e7 100644 --- a/adm_local/unix/make_common_starter.am +++ b/adm_local/unix/make_common_starter.am @@ -1,24 +1,30 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2009-2012 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 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. # -# 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 # -# 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 # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com + +# ============================================================ +# The following is to avoid PACKAGE_... env variable +# redefinition compilation warnings +# ============================================================ # +AM_CXXFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h +AM_CPPFLAGS = @KERNEL_CXXFLAGS@ -include SALOMEconfig.h + # ============================================================ # This file defines the common definitions used in several # Makefile. This file must be included, if needed, by the file diff --git a/bin/Makefile.am b/bin/Makefile.am index 76ed72c..8a53a72 100644 --- a/bin/Makefile.am +++ b/bin/Makefile.am @@ -1,27 +1,25 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2009-2012 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 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. # -# 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 # -# 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 # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # Author : Roman NIKOLAEV Open CASCADE S.A.S. (roman.nikolaev@opencascade.com) # Date : 13/04/2009 - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am nodist_salomescript_DATA = \ diff --git a/bin/VERSION.in b/bin/VERSION.in index 3e9913a..9dcdb4e 100755 --- a/bin/VERSION.in +++ b/bin/VERSION.in @@ -1 +1,3 @@ -THIS IS SALOME - PYLIGHT VERSION: @VERSION@ +[SALOME PYLIGHT] : @VERSION@ +[DEVELOPMENT] : @VERSION_DEV@ +[DESCRIPTION] : Sample Python SALOME module diff --git a/build_configure b/build_configure index 2bc396d..727ec31 100755 --- a/build_configure +++ b/build_configure @@ -1,27 +1,26 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +#!/bin/bash +# Copyright (C) 2009-2012 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 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. # -# 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 # -# 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 # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # Author : Roman NIKOLAEV Open CASCADE S.A.S. (roman.nikolaev@opencascade.com) # Date : 13/04/2009 - +# ORIG_DIR=`pwd` CONF_DIR=`echo $0 | sed -e "s,[^/]*$,,;s,/$,,;s,^$,.,"` @@ -45,18 +44,16 @@ fi cd ${CONF_DIR} ABS_CONF_DIR=`pwd` - -mkdir -p salome_adm/unix/config_files -cp -f ${KERNEL_ROOT_DIR}/salome_adm/unix/SALOMEconfig.h.in salome_adm/unix +######################################################################## # ____________________________________________________________________ # aclocal creates the aclocal.m4 file from the standard macro and the -# custom macro embedded in the directory salome_adm/unix/config_files +# custom macro embedded in the directory adm_local/unix/config_files # and KERNEL config_files directory. # output: # aclocal.m4 # autom4te.cache (directory) -echo "====================================================== aclocal" +echo "======================================================= aclocal" aclocal -I adm_local/unix/config_files \ -I ${KERNEL_ROOT_DIR}/salome_adm/unix/config_files \ @@ -68,10 +65,10 @@ aclocal -I adm_local/unix/config_files \ # version. The files are created in the directory specified with the # AC_CONFIG_AUX_DIR() tag (see configure.ac). # output: -# salome_adm/unix/config_files/config.guess -# salome_adm/unix/config_files/config.sub -# salome_adm/unix/config_files/ltmain.sh -#echo "====================================================== libtoolize" +# adm_local/unix/config_files/config.guess +# adm_local/unix/config_files/config.sub +# adm_local/unix/config_files/ltmain.sh +echo "==================================================== libtoolize" libtoolize --force --copy --automake || exit 1 @@ -91,11 +88,11 @@ autoconf # AC_CONFIG_AUX_DIR() tag (see configure.ac). This step also # creates the Makefile.in files from the Makefile.am files. # output: -# salome_adm/unix/config_files/compile -# salome_adm/unix/config_files/depcomp -# salome_adm/unix/config_files/install-sh -# salome_adm/unix/config_files/missing -# salome_adm/unix/config_files/py-compile +# adm_local/unix/config_files/compile +# adm_local/unix/config_files/depcomp +# adm_local/unix/config_files/install-sh +# adm_local/unix/config_files/missing +# adm_local/unix/config_files/py-compile # Makefile.in (from Makefile.am) echo "====================================================== automake" diff --git a/clean_configure b/clean_configure index 2e99380..28a9a40 100755 --- a/clean_configure +++ b/clean_configure @@ -1,33 +1,25 @@ #!/bin/sh -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2009-2012 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 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. # -# 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 # -# 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 +# 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 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 +find . -name Makefile.in | xargs rm -f +( cd adm_local/unix/config_files && rm -f config.* depcomp install-sh l*.m4 ltmain.sh missing py-compile ) diff --git a/configure.ac b/configure.ac index 29d4f27..447a1be 100644 --- a/configure.ac +++ b/configure.ac @@ -1,38 +1,34 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2009-2012 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 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. # -# 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 # -# 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 +# 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.ac file - # Author : Roman NIKOLAEV Open CASCADE S.A.S. (roman.nikolaev@opencascade.com) # Date : 13/04/2009 - - -AC_INIT([Salome2 Project PYLIGHT module], [5.1.1], [webmaster.salome@opencascade.com], [SalomePYLIGHT]) -AC_CONFIG_AUX_DIR(salome_adm/unix/config_files) +# +AC_INIT([Salome2 Project PYLIGHT module], [6.5.0], [webmaster.salome@opencascade.com], [SalomePYLIGHT]) +AC_CONFIG_AUX_DIR(adm_local/unix/config_files) AC_CANONICAL_HOST AC_CANONICAL_TARGET -AM_INIT_AUTOMAKE +AM_INIT_AUTOMAKE([-Wno-portability]) XVERSION=`echo $VERSION | awk -F. '{printf("0x%02x%02x%02x",$1,$2,$3)}'` AC_SUBST(XVERSION) @@ -40,6 +36,8 @@ AC_SUBST(XVERSION) # set up MODULE_NAME variable for dynamic construction of directories (resources, etc.) MODULE_NAME=pylight AC_SUBST(MODULE_NAME) +VERSION_DEV=1 +AC_SUBST(VERSION_DEV) dnl dnl Initialize source and build root directories @@ -80,6 +78,7 @@ echo AC_PROG_MAKE_SET AC_PROG_INSTALL +AC_LOCAL_INSTALL dnl dnl libtool macro check for CC, LD, NM, LN_S, RANLIB, STRIP + for shared libraries @@ -101,7 +100,7 @@ dnl Fix up the INSTALL macro if it s a relative path. We want the dnl full-path to the binary instead. case "$INSTALL" in *install-sh*) - INSTALL='\${KERNEL_ROOT_DIR}'/salome_adm/unix/config_files/install-sh + INSTALL='\${KERNEL_ROOT_DIR}'/adm_local/unix/config_files/install-sh ;; esac @@ -189,19 +188,30 @@ AC_OUTPUT_COMMANDS([ \ chmod +x ./bin/*; \ ]) +AC_HACK_LIBTOOL +AC_CONFIG_COMMANDS([hack_libtool],[ +sed -i "s%^CC=\"\(.*\)\"%hack_libtool (){ \n\ + $(pwd)/hack_libtool \1 \"\$[@]\" \n\ +}\n\ +CC=\"hack_libtool\"%g" libtool +sed -i "s%\(\s*\)for searchdir in \$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path; do%\1searchdirs=\"\$newlib_search_path \$lib_search_path \$sys_lib_search_path \$shlib_search_path\"\n\1for searchdir in \$searchdirs; do%g" libtool +sed -i "s%\(\s*\)searchdirs=\"\$newlib_search_path \$lib_search_path \(.*\)\"%\1searchdirs=\"\$newlib_search_path \$lib_search_path\"\n\1sss_beg=\"\"\n\1sss_end=\"\2\"%g" libtool +sed -i "s%\(\s*\)\(for searchdir in \$searchdirs; do\)%\1for sss in \$searchdirs; do\n\1 if ! test -d \$sss; then continue; fi\n\1 ssss=\$(cd \$sss; pwd)\n\1 if test \"\$ssss\" != \"\" \&\& test -d \$ssss; then\n\1 case \$ssss in\n\1 /usr/lib | /usr/lib64 ) ;;\n\1 * ) sss_beg=\"\$sss_beg \$ssss\" ;;\n\1 esac\n\1 fi\n\1done\n\1searchdirs=\"\$sss_beg \$sss_end\"\n\1\2%g" libtool +],[]) + # This list is initiated using autoscan and must be updated manually # when adding a new file .in to manage. When you execute # autoscan, the Makefile list is generated in the output file configure.scan. # This could be helpfull to update de configuration. AC_OUTPUT([ \ - ./salome_adm/unix/SALOMEconfig.h \ - ./adm_local/Makefile \ - ./adm_local/unix/Makefile \ - ./adm_local/unix/config_files/Makefile \ - ./bin/VERSION \ - ./bin/Makefile \ - ./src/Makefile \ - ./src/PYLIGHTGUI/Makefile \ - ./resources/Makefile \ + adm_local/Makefile \ + adm_local/unix/Makefile \ + adm_local/unix/config_files/Makefile \ + bin/VERSION \ + bin/Makefile \ + src/Makefile \ + src/PYLIGHTGUI/Makefile \ + resources/Makefile \ + resources/SalomeApp.xml \ Makefile \ ]) diff --git a/resources/LightApp.xml b/resources/LightApp.xml index 84f2dad..b16fa29 100644 --- a/resources/LightApp.xml +++ b/resources/LightApp.xml @@ -1,3 +1,23 @@ +
diff --git a/resources/Makefile.am b/resources/Makefile.am index f8c0e44..6b152c1 100644 --- a/resources/Makefile.am +++ b/resources/Makefile.am @@ -1,27 +1,25 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2009-2012 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 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. # -# 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 # -# 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 # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # Author : Roman NIKOLAEV Open CASCADE S.A.S. (roman.nikolaev@opencascade.com) # Date : 13/04/2009 - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am dist_salomeres_DATA = \ @@ -30,6 +28,6 @@ dist_salomeres_DATA = \ PYLIGHT_line_icon.png \ PYLIGHT_paragraph_icon.png \ queen.txt \ - LightApp.xml \ - SalomeApp.xml - \ No newline at end of file + LightApp.xml + +nodist_salomeres_SCRIPTS = SalomeApp.xml \ No newline at end of file diff --git a/resources/PYLIGHT_en.xml b/resources/PYLIGHT_en.xml index 98e62a5..c91672c 100644 --- a/resources/PYLIGHT_en.xml +++ b/resources/PYLIGHT_en.xml @@ -1,4 +1,24 @@ + diff --git a/resources/SalomeApp.xml b/resources/SalomeApp.xml deleted file mode 100644 index 84f2dad..0000000 --- a/resources/SalomeApp.xml +++ /dev/null @@ -1,14 +0,0 @@ - -
- - - - -
- -
- - -
- -
diff --git a/resources/SalomeApp.xml.in b/resources/SalomeApp.xml.in new file mode 100644 index 0000000..d635b8f --- /dev/null +++ b/resources/SalomeApp.xml.in @@ -0,0 +1,35 @@ + + +
+ + + + + +
+ +
+ + +
+ +
diff --git a/src/Makefile.am b/src/Makefile.am index 7d037de..590ab59 100755 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,27 +1,25 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2009-2012 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 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. # -# 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 # -# 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 # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # Author : Roman NIKOLAEV Open CASCADE S.A.S. (roman.nikolaev@opencascade.com) # Date : 13/04/2009 - +# include $(top_srcdir)/adm_local/unix/make_common_starter.am SUBDIRS = PYLIGHTGUI diff --git a/src/PYLIGHTGUI/Makefile.am b/src/PYLIGHTGUI/Makefile.am index 64ad10c..878ba30 100755 --- a/src/PYLIGHTGUI/Makefile.am +++ b/src/PYLIGHTGUI/Makefile.am @@ -1,24 +1,22 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2009-2012 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 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. # -# 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 # -# 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 +# 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 @@ -34,4 +32,5 @@ dist_salomescript_SCRIPTS = \ # resources files nodist_salomeres_DATA = \ PYLIGHT_msg_en.qm \ + PYLIGHT_msg_fr.qm \ PYLIGHT_icons.qm diff --git a/src/PYLIGHTGUI/PYLIGHTGUI.py b/src/PYLIGHTGUI/PYLIGHTGUI.py index 29d5024..b96f789 100644 --- a/src/PYLIGHTGUI/PYLIGHTGUI.py +++ b/src/PYLIGHTGUI/PYLIGHTGUI.py @@ -1,27 +1,25 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2009-2012 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 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. # -# 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 # -# 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 # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -# Author : Roman NIKOLAEV Open CASCADE S.A.S. (roman.nikolaev@opencascade.com) +# Author : Roman NIKOLAEV, Open CASCADE S.A.S. (roman.nikolaev@opencascade.com) # Date : 13/04/2009 - +# import traceback from SalomePyQt import * import PYLIGHT_DataModel @@ -34,129 +32,218 @@ import libSalomePy import vtk # Get SALOME PyQt interface -sgPyQt=SalomePyQt() +sgPyQt = SalomePyQt() # Get SALOME Swig interface sg = libSALOME_Swig.SALOMEGUI_Swig() -# Create DataModel -DM = PYLIGHT_DataModel.PYLIGHT_DataModel() +################################################ +# GUI context class +# Used to store actions, menus, toolbars, etc... +################################################ + +class GUIcontext: + + # constructor + def __init__( self ): + # Load File action + sgPyQt.createAction(dict_actions["loadfile"], "Load text File", "Load text file") + # Save File action + sgPyQt.createAction(dict_actions["savefile"], "Save text File", "Save text file") + # Insert Line action + sgPyQt.createAction(dict_actions["insertLine"], "Insert Line", "Insert new text line") + # Insert new line action + sgPyQt.createAction(dict_actions["insertLine"], "Insert Line", "Insert new line") + # Edit selected line action + sgPyQt.createAction(dict_actions["editLine"], "Edit Line", "Edit selected line") + # Remove selected line action + sgPyQt.createAction(dict_actions["removeLine"], "Remove Lines", "Remove selected lines") + # Clear all paragraphs + sgPyQt.createAction(dict_actions["clearAll"], "Clear All", "Clear all paragraphs") + # Display line + sgPyQt.createAction(dict_actions["displayLine"], "Display Line", "Display selected line") + # Erase line + sgPyQt.createAction(dict_actions["eraseLine"], "Erase Line", "Erase selected line") + # Separator + separator = sgPyQt.createSeparator() + + # Get Menu 'File' + menuFile = sgPyQt.createMenu( "File", -1, -1 ) + # Add actions in the menu 'File' + sgPyQt.createMenu( separator, menuFile, -1, 10) + sgPyQt.createMenu( dict_actions["loadfile"], menuFile, 10 ); + sgPyQt.createMenu( dict_actions["savefile"], menuFile, 10 ); + sgPyQt.createMenu( separator, menuFile, -1, 10) + # Create 'PyLight' menu + menuPyLight = sgPyQt.createMenu( "PyLight", -1, -1, 50) + # Add actions in the menu 'PyLight' + sgPyQt.createMenu( dict_actions["insertLine"], menuPyLight, 10 ); + sgPyQt.createMenu( dict_actions["editLine"], menuPyLight, 10 ); + sgPyQt.createMenu( dict_actions["removeLine"], menuPyLight, 10 ); + sgPyQt.createMenu( separator, menuPyLight, -1, 10); + sgPyQt.createMenu( dict_actions["clearAll"], menuPyLight, 10 ); + sgPyQt.createMenu( separator, menuPyLight, -1, 10); + sgPyQt.createMenu( dict_actions["displayLine"], menuPyLight, 10 ); + sgPyQt.createMenu( dict_actions["eraseLine"], menuPyLight, 10 ); + + # Create DataModel + self.DM = PYLIGHT_DataModel.PYLIGHT_DataModel() + + pass # def __init__( self ) + + pass # class GUIcontext + +################################################ +# Global variables and functions +################################################ + +### +# get active study ID +### +def _getStudyId(): + return sgPyQt.getStudyId() + +# verbosity level +__verbose__ = None + +### +# Get verbose level +### +def verbose(): + global __verbose__ + if __verbose__ is None: + try: + __verbose__ = int( os.getenv( 'SALOME_VERBOSE', 0 ) ) + except: + __verbose__ = 0 + pass + pass + return __verbose__ + +# study-to-context map +__study2context__ = {} +# current context +__current_context__ = None + +### +# 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__ + +################################################ # Create actions and menus def initialize(): - - print "PYLIGHTGUI::initialize()" - # Load File action - sgPyQt.createAction(dict_actions["loadfile"], "Load text File", "Load text file") - # Save File action - sgPyQt.createAction(dict_actions["savefile"], "Save text File", "Save text file") - # Insert Line action - sgPyQt.createAction(dict_actions["insertLine"], "Insert Line", "Insert new text line") - # Separator - separator = sgPyQt.createSeparator() - # Get Menu 'File' - menuFile = sgPyQt.createMenu( "File", -1, -1 ) - # Add actions in the menu 'File' - sgPyQt.createMenu( separator ,menuFile, -1, 10) - sgPyQt.createMenu( dict_actions["loadfile"], menuFile, 10 ); - sgPyQt.createMenu( dict_actions["savefile"], menuFile, 10 ); - sgPyQt.createMenu( separator ,menuFile, -1, 10) - - # Insert new line action - sgPyQt.createAction(dict_actions["insertLine"], "Insert Line", "Insert new line") - # Edit selected line action - sgPyQt.createAction(dict_actions["editLine"], "Edit Line", "Edit selected line") - # Remove selected line action - sgPyQt.createAction(dict_actions["removeLine"], "Remove Lines", "Remove selected lines") - # Clear all paragraphs - sgPyQt.createAction(dict_actions["clearAll"], "Clear All", "Clear all paragraphs") - # Display line - sgPyQt.createAction(dict_actions["displayLine"], "Display Line", "Display selected line") - # Erase line - sgPyQt.createAction(dict_actions["eraseLine"], "Erase Line", "Erase selected line") - - # Create 'PyLight' menu - menuPyLight = sgPyQt.createMenu( "PyLight",-1,-1,50) - # Add actions in the menu 'PyLight' - sgPyQt.createMenu( dict_actions["insertLine"], menuPyLight, 10 ); - sgPyQt.createMenu( dict_actions["editLine"], menuPyLight, 10 ); - sgPyQt.createMenu( dict_actions["removeLine"], menuPyLight, 10 ); - sgPyQt.createMenu( separator, menuPyLight, -1, 10); - sgPyQt.createMenu( dict_actions["clearAll"], menuPyLight, 10 ); - sgPyQt.createMenu( separator, menuPyLight, -1, 10); - sgPyQt.createMenu( dict_actions["displayLine"], menuPyLight, 10 ); - sgPyQt.createMenu( dict_actions["eraseLine"], menuPyLight, 10 ); - + if verbose(): print "PYLIGHTGUI::initialize()" return +# called when module is activated +# returns True if activating is successfull and False otherwise +def activate(): + if verbose() : print "PYLIGHTGUI.activate() : study : %d" % _getStudyId() + ctx = _setContext( _getStudyId() ) + return True + +# called when module is deactivated +def deactivate(): + if verbose() : print "PYLIGHTGUI.deactivate() : study : %d" % _getStudyId() + pass + +# called when active study is changed +# active study ID is passed as parameter +def activeStudyChanged( studyID ): + if verbose() : print "PYLIGHTGUI.activeStudyChanged(): study : %d" % studyID + ctx = _setContext( _getStudyId() ) + pass # Process GUI action def OnGUIEvent(commandID): - print "PYLIGHTGUI::OnGUIEvent : commandID =",commandID + if verbose() : print "PYLIGHTGUI::OnGUIEvent : commandID = %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 # Customize popup menu def createPopupMenu(popup, context): + if verbose() : print "PYLIGHTGUI.createPopupMenu(): context = %s" % context - - if context != 'ObjectBrowser': return + studyId = _getStudyId() + ctx = _setContext( studyId ) selcount = sg.SelectedCount() if selcount == 1: entry = sg.getSelected( 0 ) - obj = DM.getObject(entry) + obj = ctx.DM.getObject(entry) if obj is not None: if obj.getText() != "\n": - #Line is selected + # Line is selected popup.addAction(sgPyQt.action(dict_actions["editLine"])) popup.addAction(sgPyQt.action(dict_actions["removeLine"])) popup.addSeparator() popup.addAction(sgPyQt.action(dict_actions["displayLine"])) popup.addAction(sgPyQt.action(dict_actions["displayLine"])) popup.addAction(sgPyQt.action(dict_actions["eraseLine"])) - - + pass else: - #Paragraph is selected + # Paragraph is selected popup.addAction(sgPyQt.action(dict_actions["insertLine"])) popup.addAction(sgPyQt.action(dict_actions["clearParagraph"])) + pass + pass else: - onlyLines = True + onlyLines = True + pass + pass # if selcount == 1 pass # For saving data in the study def saveFiles(prefix): - print "PYLIGHTGUI::saveFile()" + if verbose(): print "PYLIGHTGUI::saveFile()" + ctx = _setContext( _getStudyId() ) postfix = "PYLIGHT.txt" filename = prefix+postfix - DM.saveFile(QString(filename)) + ctx.DM.saveFile(QString(filename)) return postfix # For restore data from the study def openFiles(filelist): - print "PYLIGHTGUI::openFile()" + if verbose(): print "PYLIGHTGUI::openFile()" + ctx = _setContext( _getStudyId() ) filename = filelist[0] filename.append(filelist[1]) - DM.loadFile(filename) + ctx.DM.loadFile(filename) return True # Loading a text file def loadfile(): + ctx = _setContext( _getStudyId() ) aFilter = "Text files (*.txt)" filename = QFileDialog.getOpenFileName(sgPyQt.getDesktop(), "Open text file", "", aFilter, "Choose a text file to open") if filename.isEmpty(): return if os.access(str(filename),os.R_OK): - DM.loadFile(filename) + ctx.DM.loadFile(filename) else: QMessageBox.warning(sgPyQt.getDesktop(), "Error!", @@ -167,16 +254,16 @@ def loadfile(): # Saving a text file def savefile(): + ctx = _setContext( _getStudyId() ) aFilter = "Text files (*.txt)" filename = QFileDialog.getSaveFileName(sgPyQt.getDesktop(),"Save text file", "", aFilter, "Choose a text file to save") if filename.contains(".txt") == 0: filename.append(".txt") pass fn = filename - print filename # Get directory name and check access if os.access(str(fn.left(fn.lastIndexOf("/"))), os.W_OK): - DM.saveFile(filename) + ctx.DM.saveFile(filename) else: QMessageBox.warning(sgPyQt.getDesktop(), "Error!", @@ -188,6 +275,7 @@ def insertLine(): ''' Insert new line in the selected paragraph. ''' + ctx = _setContext( _getStudyId() ) #Get result res = QInputDialog.getText(sgPyQt.getDesktop(), "Add new line", @@ -200,19 +288,19 @@ def insertLine(): # Nb selected objects selcount = sg.SelectedCount() # Nb object in the Data Model - paragrCount = len(DM.getParagraphs()) + paragrCount = len(ctx.DM.getParagraphs()) # Create first paragraph if paragrCount == 0: - DM.createObject() + ctx.DM.createObject() # If line not empty create first line if text != "\n": - DM.createObject(text,DM.getParagraphs()[0]) + ctx.DM.createObject(text,ctx.DM.getParagraphs()[0]) sg.updateObjBrowser(True) return # Create paragraph if text == "\n": - DM.createObject() + ctx.DM.createObject() sg.updateObjBrowser(True) return else: @@ -223,11 +311,11 @@ def insertLine(): return if selcount == 1: entry = sg.getSelected( 0 ) - obj = DM.getObject(entry) + obj = ctx.DM.getObject(entry) if obj is not None: # Create line if(obj.getText() == "\n"): - DM.createObject(text,entry) + ctx.DM.createObject(text,entry) sg.updateObjBrowser(True); return else: @@ -243,9 +331,10 @@ def insertLine(): # Edit selected line def editLine(): + ctx = _setContext( _getStudyId() ) if sg.SelectedCount() == 1: entry = sg.getSelected( 0 ) - obj = DM.getObject(entry) + obj = ctx.DM.getObject(entry) if(obj.getText() != "\n"): #Get text line res = QInputDialog.getText(sgPyQt.getDesktop(), @@ -271,13 +360,14 @@ def editLine(): # Remove selected lines def removeLine(): + ctx = _setContext( _getStudyId() ) selcount = sg.SelectedCount() onlyLines = True lines = [] while selcount != 0: entry = sg.getSelected( selcount - 1) #Check what only lines selected - if DM.getObject(entry).getText() == "\n": + if ctx.DM.getObject(entry).getText() == "\n": onlyLines = False break lines.append(entry) @@ -293,17 +383,18 @@ def removeLine(): renderer.RemoveActor(actor) pass pass - DM.removeObjects(lines) + ctx.DM.removeObjects(lines) sg.updateObjBrowser(True) pass pass # Remove all lines from all paragraphs def clearAll(): - paragraphs = DM.getParagraphs() + ctx = _setContext( _getStudyId() ) + paragraphs = ctx.DM.getParagraphs() for paragr in paragraphs: lines = sgPyQt.getChildren(paragr) - DM.removeObjects(lines) + ctx.DM.removeObjects(lines) renderer=libSalomePy.getRenderer() for l in lines: actor = getActor(l) @@ -316,10 +407,11 @@ def clearAll(): # Display the selected line def displayLine(): + ctx = _setContext( _getStudyId() ) if sg.SelectedCount() != 1: return entry = sg.getSelected(0) - text = DM.getObject(entry).getText() + text = ctx.DM.getObject(entry).getText() if text == "\n": return renderer=libSalomePy.getRenderer() @@ -341,17 +433,19 @@ def displayLine(): # Clear remove all lines under selected paragraph def clearParagraph(): + ctx = _setContext( _getStudyId() ) lines = sgPyQt.getChildren(sg.getSelected(0)) - DM.removeObjects(lines) + ctx.DM.removeObjects(lines) sg.updateObjBrowser(True) pass # Erase the selected line def eraseLine(): + ctx = _setContext( _getStudyId() ) if sg.SelectedCount() != 1: return entry = sg.getSelected(0) - text = DM.getObject(entry).getText() + text = ctx.DM.getObject(entry).getText() if text == "\n": return renderer=libSalomePy.getRenderer() diff --git a/src/PYLIGHTGUI/PYLIGHT_DataModel.py b/src/PYLIGHTGUI/PYLIGHT_DataModel.py index eae48d6..76db17a 100644 --- a/src/PYLIGHTGUI/PYLIGHT_DataModel.py +++ b/src/PYLIGHTGUI/PYLIGHT_DataModel.py @@ -1,27 +1,25 @@ -# Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE +# Copyright (C) 2009-2012 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 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. # -# 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 # -# 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 # -# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com # Author : Roman NIKOLAEV Open CASCADE S.A.S. (roman.nikolaev@opencascade.com) # Date : 13/04/2009 - +# import SalomePyQt from PyQt4.QtCore import * diff --git a/src/PYLIGHTGUI/PYLIGHT_icons.ts b/src/PYLIGHTGUI/PYLIGHT_icons.ts index dadb246..96b8a03 100644 --- a/src/PYLIGHTGUI/PYLIGHT_icons.ts +++ b/src/PYLIGHTGUI/PYLIGHT_icons.ts @@ -1,27 +1,6 @@ - - + + + @default diff --git a/src/PYLIGHTGUI/PYLIGHT_msg_en.ts b/src/PYLIGHTGUI/PYLIGHT_msg_en.ts index 8025ecd..2ee4f7f 100644 --- a/src/PYLIGHTGUI/PYLIGHT_msg_en.ts +++ b/src/PYLIGHTGUI/PYLIGHT_msg_en.ts @@ -1,25 +1,11 @@ + - - + + + @default + + + + + + diff --git a/src/PYLIGHTGUI/PYLIGHT_msg_fr.ts b/src/PYLIGHTGUI/PYLIGHT_msg_fr.ts new file mode 100644 index 0000000..1e4dea3 --- /dev/null +++ b/src/PYLIGHTGUI/PYLIGHT_msg_fr.ts @@ -0,0 +1,11 @@ + + + + + @default + + + + + + -- 2.39.2