Salome HOME
Merge from BR_V5_DEV 17Feb09
authorvsr <vsr@opencascade.com>
Tue, 17 Feb 2009 08:39:37 +0000 (08:39 +0000)
committervsr <vsr@opencascade.com>
Tue, 17 Feb 2009 08:39:37 +0000 (08:39 +0000)
31 files changed:
Makefile.am
adm_local/Makefile.am
adm_local/unix/Makefile.am
adm_local/unix/config_files/Makefile.am
adm_local/unix/config_files/README [deleted file]
adm_local/unix/config_files/check_PYHELLO.m4
adm_local/unix/make_common_starter.am
bin/Makefile.am
bin/myrunSalome.py
bin/runAppli.in
build_configure
clean_configure [new file with mode: 0755]
configure.ac
doc/Makefile.am [new file with mode: 0755]
idl/Makefile.am
idl/PYHELLO_Gen.idl
resources/Makefile.am
resources/PYHELLO.png
resources/PYHELLOCatalog.xml.in
resources/PYHELLO_en.xml [deleted file]
resources/PYHELLO_small.png [new file with mode: 0755]
resources/SalomeApp.xml
src/Makefile.am
src/PYHELLO/Makefile.am
src/PYHELLO/PYHELLO.py
src/PYHELLOGUI/Makefile.am
src/PYHELLOGUI/PYHELLOGUI.py
src/PYHELLOGUI/PYHELLO_icons.po [deleted file]
src/PYHELLOGUI/PYHELLO_icons.ts [new file with mode: 0644]
src/PYHELLOGUI/PYHELLO_msg_en.po [deleted file]
src/PYHELLOGUI/PYHELLO_msg_en.ts [new file with mode: 0644]

index e4803d74f1c716215f1db288c28d59d0e6b929df..4766f402c74ffbc3bbf0b5875c4a93a8e88417c3 100644 (file)
@@ -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
 #  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`
index 7ae83a6fc82f9b81116b259ad29f7610ead06353..f35273fac7de52921e587cdc5f9641c7f3116fc3 100644 (file)
@@ -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
index facd4e6f4afcae75a48956b85ab2e4687876c2aa..5f6d5f7536c72fc43090c511c2a26518cb92af5d 100644 (file)
@@ -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
index ece5b5b896183e1a06091e5371c9f3fdd83280fd..54b4bc1cbc63adbb92fa2f498a45456b770dd469 100644 (file)
@@ -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 (file)
index feb997b..0000000
+++ /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.
index 6cb9c9dfedd545a7d05da4b0b55e4149d23d34b4..5da66c63ccf2754f65f711b0b6e2a98d10bad3d5 100755 (executable)
@@ -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)
index 533941331b2636b75b0d3b38a7d52983775ec4c9..36ad8c3a7c7e37c3da0591452c8cc09f24250858 100644 (file)
@@ -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
index 9aa385967ab04575f1a4293825fe64b19b2ca101..f9eb701d030cfe8616e253e6114c3358b9c84593 100644 (file)
@@ -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
index 3b4d6cf8e96debe73e04dd283c4b8a06abe9ce54..bf4edf141dd86c5f1753f493e32fb1e886ef84b7 100755 (executable)
@@ -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
 #  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
index cde6cf2c87561723003e3e7443b55fc9c36bcadb..514750a56d92c415c0d0e32e9a48e610cf66c3df 100755 (executable)
@@ -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
 
 
index 3c8e79eb8abf85939d4ddd4dd9891968d2949c30..4f365ace5641a4c5b0adb41b7b709698bc087708 100755 (executable)
@@ -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 (executable)
index 0000000..f57f7b3
--- /dev/null
@@ -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
index d72094c03ee098e4e2884d37949eee145740acb4..315142424deb123f564d6910cd0eebc9eea4967a 100644 (file)
@@ -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/doc/Makefile.am b/doc/Makefile.am
new file mode 100755 (executable)
index 0000000..6e3f6da
--- /dev/null
@@ -0,0 +1,26 @@
+#  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_doc_DATA = dev_guide.pdf
+
+EXTRA_DIST   += dev_guide.txt
index 3e49a1ee49b8b8c68b2e8dbe616310caca79b256..7035f6110bb2b6bcc520bfeb77e8bb6d0c954a3b 100644 (file)
@@ -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
index 665544c80fce22cec5ed65379f8a3f0b0131801f..87cbfcc57efa606b274bd0228771d3149e470e99 100644 (file)
@@ -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__
index 031081601a48be9900ab5c03e895c92c928fe714..45755dc0e999d5f9b2edbd80c05305bdecf932a1 100644 (file)
@@ -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
 #  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
index 16a20c116e8243a6b49ed862613d2cc49bdf4caa..f3a2ab698e81bdd9bbb3a1c8f812f14eabe739c1 100644 (file)
Binary files a/resources/PYHELLO.png and b/resources/PYHELLO.png differ
index dae8a28f9b31a180cea862cd9c34aa1b95713e6f..f99af068dc9c81cc628a71fff21968e1724fb18f 100644 (file)
@@ -1,4 +1,27 @@
 <?xml version='1.0' encoding='us-ascii' ?>
+<!--
+  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
+
+-->
  
 <!-- XML component catalog -->
 <begin-catalog>
diff --git a/resources/PYHELLO_en.xml b/resources/PYHELLO_en.xml
deleted file mode 100644 (file)
index 72070e3..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-<?xml version='1.0' encoding='us-ascii'?>
-<!DOCTYPE application PUBLIC "" "desktop.dtd">
-<application title="PYHELLO component" date="9/12/2001" author="C Caremoli" appId="PYHELLO" >
-<desktop>
-
-<!-- ### MENUBAR ###  -->
-<menubar>
- <menu-item label-id="PYHELLO" item-id="90" pos-id="3">
-  <popup-item item-id="941" label-id="HELLO" icon-id="" tooltip-id="Shows sample dialog box" accel-id="" toggle-id="" execute-action=""/>
-  <separator/>
-  <popup-item item-id="942" label-id="Create object" icon-id="" tooltip-id="Creates and publishes an object" accel-id="" toggle-id="" execute-action=""/>
- </menu-item>
-</menubar>
-
-<!-- ### TOOLBARS ###  -->
-<toolbar label-id="PYHELLO">
- <toolbutton-item item-id="941" label-id="HELLO" icon-id="ExecPYHELLO.png" tooltip-id="Shows sample dialog box" accel-id="" toggle-id="" execute-action=""/>
-</toolbar>
-
-<!-- ### POPUP MENUS ###  -->
-<popupmenu label-id="Popup for ObjectBrowser" context-id="ObjectBrowser" parent-id="" object-id="1000">
-   <popup-item item-id="951" pos-id="" label-id="Delete all" icon-id="" tooltip-id="Removes all children" accel-id="" toggle-id="" execute-action=""/>
-</popupmenu>
-
-<popupmenu label-id="Popup for ObjectBrowser" context-id="ObjectBrowser" parent-id="" object-id="1010">
-   <popup-item item-id="952" pos-id="" label-id="Show me" icon-id="" tooltip-id="Shows an object's name" accel-id="" toggle-id="" execute-action=""/>
-   <popup-item item-id="953" pos-id="" label-id="Delete me" icon-id="" tooltip-id="Removes an object from the study" accel-id="" toggle-id="" execute-action=""/>
-</popupmenu>
-
-</desktop>
-</application>
-
diff --git a/resources/PYHELLO_small.png b/resources/PYHELLO_small.png
new file mode 100755 (executable)
index 0000000..474a537
Binary files /dev/null and b/resources/PYHELLO_small.png differ
index 4912c7e886c41402ba128b630d219c77931777ea..532ddcef2aa66394015447b7ea6da1ebfe50fe42 100644 (file)
@@ -1,3 +1,26 @@
+<!--
+  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
+
+-->
 <document>
   <section name="PYHELLO">
     <!-- Major module parameters -->
index eb795efbc7fe6d0b018aa893be631bc90353db15..d374535f697fa85eb6dd8a7f5c6767136bdfa091 100755 (executable)
@@ -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
index 8fed1af69268cee8fdebc7347f3ba94e9d58ffb4..bfde71ae74a00dbb5205d7991a97bda84012e4b9 100755 (executable)
@@ -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
index 0a12777c6055306401dd103d57c0eb95331c3103..98108fe174061574a1b22badfd3a96180341ccbc 100644 (file)
@@ -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
index 11f1121c8a25c72a36bbfcc248d5e7e94915383c..c6b2f87a301960c9c51935ddfb456a05c314d264 100755 (executable)
@@ -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
index af4ce65cef3099716156d0549af17f028b43cfef..297eb4b317129a92d2a49e56a7a5040254bb86a7 100644 (file)
@@ -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
 #  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.po b/src/PYHELLOGUI/PYHELLO_icons.po
deleted file mode 100644 (file)
index 7268d4d..0000000
+++ /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 <EMAIL@ADDRESS>\n"
-"Content-Type: text/plain; charset=iso-8859-1\n"
-
diff --git a/src/PYHELLOGUI/PYHELLO_icons.ts b/src/PYHELLOGUI/PYHELLO_icons.ts
new file mode 100644 (file)
index 0000000..8025ecd
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE TS>
+<!--
+  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
+
+-->
+<TS version="1.1" />
diff --git a/src/PYHELLOGUI/PYHELLO_msg_en.po b/src/PYHELLOGUI/PYHELLO_msg_en.po
deleted file mode 100644 (file)
index 7268d4d..0000000
+++ /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 <EMAIL@ADDRESS>\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 (file)
index 0000000..8025ecd
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE TS>
+<!--
+  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
+
+-->
+<TS version="1.1" />