]> SALOME platform Git repositories - modules/gui.git/commitdiff
Salome HOME
Merge branch 'asl/hydro_porting_741' occ/shape_reparation
authorvsr <vsr@opencascade.com>
Mon, 6 Oct 2014 11:27:00 +0000 (15:27 +0400)
committervsr <vsr@opencascade.com>
Mon, 6 Oct 2014 11:27:00 +0000 (15:27 +0400)
170 files changed:
CMakeLists.txt
adm_local/cmake_files/FindSalomeGUI.cmake
doc/salome/gui/images/closestudy.png
doc/salome/gui/images/disconnect_study.png [new file with mode: 0644]
doc/salome/gui/images/menu_file.png [new file with mode: 0644]
doc/salome/gui/images/studymanagement.png [changed mode: 0755->0644]
doc/salome/gui/input/introduction_to_gui.doc
doc/salome/gui/input/salome_desktop.doc
doc/salome/gui/input/study_management_chapter.doc
src/CAF/CAF_Application.cxx
src/CAF/CAF_Study.cxx
src/CAM/CAM_Module.cxx
src/CAM/CAM_Module.h
src/CMakeLists.txt
src/DDS/DDS.h
src/DDS/DDS_DicGroup.h
src/DDS/DDS_DicItem.h
src/DDS/DDS_Dictionary.cxx
src/GLViewer/GLViewer_ViewFrame.cxx
src/GLViewer/resources/GLViewer_msg_en.ts
src/GLViewer/resources/GLViewer_msg_fr.ts
src/GLViewer/resources/GLViewer_msg_ja.ts
src/GUI_PY/CMakeLists.txt
src/GUI_PY/dockwidgets.py [new file with mode: 0644]
src/GUI_PY/test_dockwidgets.py [new file with mode: 0644]
src/GraphicsView/CMakeLists.txt
src/GraphicsView/GraphicsView_Object.cxx
src/GraphicsView/GraphicsView_Object.h
src/GraphicsView/GraphicsView_ViewFrame.cxx
src/GraphicsView/GraphicsView_ViewFrame.h
src/GraphicsView/GraphicsView_ViewPort.cxx
src/GraphicsView/GraphicsView_ViewPort.h
src/GraphicsView/GraphicsView_Viewer.cxx
src/GraphicsView/GraphicsView_Viewer.h
src/GuiHelpers/StandardApp_Module.cxx
src/HelpBrowser/CMakeLists.txt [new file with mode: 0644]
src/HelpBrowser/COPYING [new file with mode: 0644]
src/HelpBrowser/HelpBrowser.cxx [new file with mode: 0644]
src/HelpBrowser/HelpBrowser.qrc [new file with mode: 0644]
src/HelpBrowser/qtlocalpeer.cpp [new file with mode: 0644]
src/HelpBrowser/qtlocalpeer.h [new file with mode: 0644]
src/HelpBrowser/qtlockedfile.cpp [new file with mode: 0644]
src/HelpBrowser/qtlockedfile.h [new file with mode: 0644]
src/HelpBrowser/qtlockedfile_unix.cpp [new file with mode: 0644]
src/HelpBrowser/qtlockedfile_win.cpp [new file with mode: 0644]
src/HelpBrowser/qtsingleapplication.cpp [new file with mode: 0644]
src/HelpBrowser/qtsingleapplication.h [new file with mode: 0644]
src/LightApp/LightApp_Application.cxx
src/LightApp/LightApp_Application.h
src/LightApp/resources/LightApp.xml
src/LightApp/resources/LightApp_images.ts
src/LightApp/resources/LightApp_msg_en.ts
src/LightApp/resources/LightApp_msg_fr.ts
src/LightApp/resources/LightApp_msg_ja.ts
src/OBJECT/SALOME_DataMapOfIOMapOfInteger.hxx
src/OCCViewer/CMakeLists.txt
src/OCCViewer/OCCViewer.qrc [new file with mode: 0644]
src/OCCViewer/OCCViewer_ClipPlaneInteractor.cxx
src/OCCViewer/OCCViewer_ClippingDlg.cxx
src/OCCViewer/OCCViewer_CubeAxesDlg.cxx
src/OCCViewer/OCCViewer_Trihedron.cxx [changed mode: 0755->0644]
src/OCCViewer/OCCViewer_Trihedron.h
src/OCCViewer/OCCViewer_Utilities.cxx [changed mode: 0644->0755]
src/OCCViewer/OCCViewer_Utilities.h [changed mode: 0644->0755]
src/OCCViewer/OCCViewer_VService.cxx
src/OCCViewer/OCCViewer_ViewFrame.cxx
src/OCCViewer/OCCViewer_ViewModel.cxx
src/OCCViewer/OCCViewer_ViewModel.h
src/OCCViewer/OCCViewer_ViewPort3d.cxx
src/OCCViewer/OCCViewer_ViewWindow.cxx
src/OCCViewer/images/hatch.png [new file with mode: 0644]
src/OCCViewer/resources/OCCViewer_msg_en.ts
src/OCCViewer/resources/OCCViewer_msg_fr.ts
src/OCCViewer/resources/OCCViewer_msg_ja.ts
src/Plot2d/Plot2d_PlotItems.cxx
src/Plot2d/Plot2d_ViewFrame.cxx
src/Plot2d/Plot2d_ViewWindow.cxx
src/Plot2d/resources/Plot2d_msg_en.ts
src/Plot2d/resources/Plot2d_msg_fr.ts
src/Plot2d/resources/Plot2d_msg_ja.ts
src/PyConsole/PyConsole_Console.cxx
src/PyConsole/PyConsole_Console.h
src/PyConsole/PyConsole_Editor.cxx
src/PyConsole/PyConsole_Editor.h
src/PyConsole/PyConsole_EnhInterp.cxx
src/PyConsole/PyConsole_Event.h
src/PyConsole/PyConsole_Interp.cxx
src/PyConsole/PyConsole_Interp.h
src/PyConsole/resources/PyConsole_msg_en.ts
src/PyConsole/resources/PyConsole_msg_fr.ts
src/PyConsole/resources/PyConsole_msg_ja.ts
src/PyInterp/CMakeLists.txt
src/PyInterp/PyInterp_Dispatcher.cxx
src/PyInterp/PyInterp_Event.cxx
src/PyInterp/PyInterp_Interp.cxx
src/PyInterp/PyInterp_Interp.h
src/PyInterp/PyInterp_Request.cxx
src/PyInterp/PyInterp_Request.h
src/PyInterp/PyInterp_Utils.cxx [new file with mode: 0644]
src/PyInterp/PyInterp_Utils.h [new file with mode: 0644]
src/Qtx/Qtx.cxx
src/Qtx/Qtx.h
src/Qtx/Qtx.qrc
src/Qtx/QtxActionToolMgr.cxx
src/Qtx/QtxActionToolMgr.h
src/Qtx/QtxTranslator.h
src/Qtx/QtxWebBrowser.cxx
src/Qtx/QtxWebBrowser.h
src/Qtx/images/appicon.png [new file with mode: 0644]
src/Qtx/images/close.png [new file with mode: 0644]
src/Qtx/images/open.png [new file with mode: 0644]
src/Qtx/resources/Qtx_msg_fr.ts
src/QxScene/QxScene_ViewWindow.cxx
src/QxScene/resources/QxSceneViewer_msg_en.ts
src/QxScene/resources/QxSceneViewer_msg_fr.ts
src/QxScene/resources/QxSceneViewer_msg_ja.ts
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyInterp.cxx
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyInterp.h
src/SALOME_PYQT/SALOME_PYQT_GUILight/SALOME_PYQT_PyModule.cxx
src/SALOME_PYQT/SalomePyQt/CMakeLists.txt
src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx
src/SALOME_PYQT/SalomePyQt/SalomePyQt.h
src/SALOME_PYQT/SalomePyQt/SalomePyQt.sip
src/SALOME_SWIG/SALOMEGUI_Swig.cxx
src/SOCC/SOCC_ViewModel.cxx
src/STD/STD_Application.cxx
src/STD/STD_Application.h
src/STD/resources/STD_msg_en.ts
src/STD/resources/STD_msg_fr.ts
src/STD/resources/STD_msg_ja.ts
src/SUIT/SUIT_Application.cxx
src/SUIT/SUIT_Application.h
src/SUIT/SUIT_MessageBox.cxx
src/SUIT/SUIT_MessageBox.h
src/SUIT/SUIT_ResourceMgr.cxx
src/SUITApp/SUITApp.cxx
src/SUITApp/SUITApp_init_python.cxx
src/SVTK/SALOME_Actor.cxx
src/SVTK/SALOME_Actor.h
src/SVTK/SVTK_ViewWindow.cxx
src/SVTK/resources/SVTK_msg_en.ts
src/SVTK/resources/SVTK_msg_fr.ts
src/SVTK/resources/SVTK_msg_ja.ts
src/SalomeApp/SalomeApp_Application.cxx
src/SalomeApp/SalomeApp_Application.h
src/SalomeApp/SalomeApp_DataObject.cxx
src/SalomeApp/SalomeApp_DoubleSpinBox.cxx
src/SalomeApp/SalomeApp_ExceptionHandler.cxx
src/SalomeApp/SalomeApp_IntSpinBox.cxx
src/SalomeApp/SalomeApp_NoteBook.cxx
src/SalomeApp/SalomeApp_PyInterp.cxx
src/SalomeApp/SalomeApp_PyInterp.h
src/SalomeApp/SalomeApp_Study.cxx
src/SalomeApp/resources/SalomeApp.xml
src/SalomeApp/resources/SalomeApp_msg_en.ts
src/SalomeApp/resources/SalomeApp_msg_fr.ts
src/SalomeApp/resources/SalomeApp_msg_ja.ts
src/SalomeApp/salome_pluginsmanager.py
src/Session/SALOME_Session_Server.cxx
src/TreeData/DockWidgets.cxx
src/TreeData/DockWidgets.hxx
src/TreeData/TreeGuiManager.cxx
src/TreeData/TreeGuiManager.hxx
src/VTKViewer/VTKViewer_FramedTextActor.cxx
src/VTKViewer/VTKViewer_FramedTextActor.h
src/VTKViewer/VTKViewer_PolyDataMapper.cxx
src/VTKViewer/VTKViewer_ViewWindow.cxx
src/VTKViewer/resources/VTKViewer_msg_en.ts
src/VTKViewer/resources/VTKViewer_msg_fr.ts
src/VTKViewer/resources/VTKViewer_msg_ja.ts

index d95bc62a10aff2c5b14c24b35f2103ec2ac16c10..bc15a54bdb4942e3495cd0517d78533f9b33754e 100755 (executable)
@@ -34,7 +34,7 @@ SET(${PROJECT_NAME_UC}_MINOR_VERSION 4)
 SET(${PROJECT_NAME_UC}_PATCH_VERSION 1)
 SET(${PROJECT_NAME_UC}_VERSION
   ${${PROJECT_NAME_UC}_MAJOR_VERSION}.${${PROJECT_NAME_UC}_MINOR_VERSION}.${${PROJECT_NAME_UC}_PATCH_VERSION})
-SET(${PROJECT_NAME_UC}_VERSION_DEV 0)
+SET(${PROJECT_NAME_UC}_VERSION_DEV 1)
 
 # Find KERNEL
 # ===========
@@ -156,7 +156,7 @@ ELSE()
 ENDIF()
 IF(SALOME_USE_VTKVIEWER)
   # Required components are listed in the FindSalomeVTK.cmake file: 
-  FIND_PACKAGE(SalomeVTK 6.1
+  FIND_PACKAGE(SalomeVTK) 
   SALOME_LOG_OPTIONAL_PACKAGE(VTK SALOME_USE_VTKVIEWER)
 ELSE()
   ADD_DEFINITIONS("-DDISABLE_VTKVIEWER")
index 90e66d9e278446881f48ea271d0ae3281f8b5472..185fb268b14d7ceb33dbd4facb66c35167741f05 100644 (file)
@@ -42,29 +42,43 @@ FOREACH(_res ${SalomeGUI_EXTRA_ENV})
 ENDFOREACH()
 
 #----------------------------------------------------------------------------
-# FULL_GUI is a macro useful for determining whether a GUI module 
-# builded in full mode 
+# SALOME_GUI_WITH_CORBA is a macro useful for determining whether a SALOME GUI module 
+# is built in not light mode (with CORBA)
+#----------------------------------------------------------------------------
+MACRO(SALOME_GUI_WITH_CORBA)
+  IF(SALOME_GUI_LIGHT_ONLY)
+    MESSAGE(FATAL_ERROR "\nWe absolutely need a Salome GUI module with CORBA.\nPlease set option SALOME_LIGHT_ONLY to OFF when building GUI module.")
+  ENDIF()
+ENDMACRO(SALOME_GUI_WITH_CORBA)
+
+#----------------------------------------------------------------------------
+# FULL_GUI is a macro useful for determining whether a GUI module
+# builded in full mode
+#----------------------------------------------------------------------------
+MACRO(FULL_GUI)
+  SET(_options)
+  LIST(APPEND _options SALOME_USE_OCCVIEWER SALOME_USE_GLVIEWER SALOME_USE_VTKVIEWER
+              SALOME_USE_PLOT2DVIEWER SALOME_USE_GRAPHICSVIEW SALOME_USE_QXGRAPHVIEWER
+              SALOME_USE_SALOMEOBJECT SALOME_USE_PYCONSOLE)
+  SALOME_GUI_MODE(${_options})
+ENDMACRO(FULL_GUI)
+
+#----------------------------------------------------------------------------
+# SALOME_GUI_MODE is a macro useful for determining whether a GUI module
+# builded in particular mode 
 #----------------------------------------------------------------------------
 #########################################################################
 # FULL_GUI()
 # 
-# USAGE: FULL_GUI(with_corba)
+# USAGE: FULL_GUI(_options)
 #
 # ARGUMENTS:
-#   with_corba [input] TRUE or FALSE - use CORBA for building module or no.
+#   _options [input] List - The list of CMake options given to SALOME GUI
 #
-MACRO(FULL_GUI with_corba)
-  SET(_options)
-  IF(${with_corba} AND ${SALOME_GUI_LIGHT_ONLY})
-    SET(_corba_message "We absolutely need a Salome GUI module with CORBA.\nPlease set option SALOME_LIGHT_ONLY to OFF when building GUI module.")
-  ENDIF() 
-  
-  LIST(APPEND _options SALOME_USE_OCCVIEWER SALOME_USE_GLVIEWER SALOME_USE_VTKVIEWER
-              SALOME_USE_PLOT2DVIEWER SALOME_USE_GRAPHICSVIEW SALOME_USE_QXGRAPHVIEWER
-              SALOME_USE_SALOMEOBJECT SALOME_USE_PYCONSOLE)
-              
+MACRO(SALOME_GUI_MODE _options)
+  MESSAGE(STATUS "Checking status of GUI options ${_options}")
   SET(_message) 
-  FOREACH(_option ${_options}) 
+  FOREACH(_option ${_options})
     IF(NOT ${_option})
       LIST(APPEND _message ${_option})
     ENDIF()
@@ -79,5 +93,4 @@ MACRO(FULL_GUI with_corba)
   ELSEIF(_corba_message)
     MESSAGE(FATAL_ERROR "${_corba_message}") 
   ENDIF() 
-  
-ENDMACRO(FULL_GUI)
+ENDMACRO(SALOME_GUI_MODE)
index 4099cc8030d79d3855b842b8803f847f76ba7c36..f53bd1dfe0fc9c3e53349ce6b7e673e7250f691c 100755 (executable)
Binary files a/doc/salome/gui/images/closestudy.png and b/doc/salome/gui/images/closestudy.png differ
diff --git a/doc/salome/gui/images/disconnect_study.png b/doc/salome/gui/images/disconnect_study.png
new file mode 100644 (file)
index 0000000..74c14f8
Binary files /dev/null and b/doc/salome/gui/images/disconnect_study.png differ
diff --git a/doc/salome/gui/images/menu_file.png b/doc/salome/gui/images/menu_file.png
new file mode 100644 (file)
index 0000000..ca8d843
Binary files /dev/null and b/doc/salome/gui/images/menu_file.png differ
old mode 100755 (executable)
new mode 100644 (file)
index a7a4b97..2f7b61e
Binary files a/doc/salome/gui/images/studymanagement.png and b/doc/salome/gui/images/studymanagement.png differ
index 449baa0ce3afe6724c20671a024a18a25f988287..1814130db825bc5879c3f18490dfe2ba278825e8 100644 (file)
@@ -4,13 +4,13 @@
 
 \image html view2.png
 
-\n SALOME GUI is based on SUIT (Salome User Interface
+\b SALOME \b GUI is based on SUIT (Salome User Interface
 Toolkit) that proposes very flexible, powerful and safe mechanisms of
 interaction with SALOME tool components (both CORBA and standalone),
 resource management, viewers and selection handling,
-exception and signals processing. This approach brings to the top
-Salome multi-desktop dockable-windowed user interface.
-\n All Graphical User Interfaces of standard modules have plug-in
+exception and signals processing.
+
+All Graphical User Interfaces of standard modules have plug-in
 structure, i.e. each module is placed in a dynamic library which is
 loaded on demand. So, all modules add their own menu items, buttons
 in toolbar, windows etc.
@@ -22,7 +22,7 @@ basic GUI functionalities, common for all modules.
 
 <ul>
 <li>\b File menu corresponds to \subpage study_management_page "Study management" functionalities
-(creation, saving, loading, editing studies, etc.).</li>
+(creation, saving, loading, editing studies, connecting, disconnecting, etc.).</li>
 <li>\b Edit menu gives access to <b> Copy/Paste</b> allowing to paste the
 objects from one study into the other. The availability of this
 functionality depends on the module and the nature of an operation or
index 2c60c00e3f8edf8f582556e6939da58261292608..d4a64281f81ad4fcbe8164ea07e3bbc92e77d83d 100644 (file)
@@ -2,34 +2,30 @@
 
 \page salome_desktop_page SALOME desktop
 
-<b>Multi-Desktop Approach</b> used in Salome means that there is a separate Desktop
-for each Study and all windows connected to the same Study (viewers, dockable
-windows, etc.) are placed in one container. 
-This approach positively differs from the classic multi document interface 
-if many windows are used, i.e. when one document contains a lot of
-viewers, dialogs, etc. Each desktop also has its own menu and toolbar.
+SALOME applies <b>Single Document Interface</b> (SDI) approach. Only one 
+\ref study_management_page "study (document)" can be opened at the moment.
 
-The main SALOME Desktop consists of the following sections and toolbars:
+The front-end of the application is represented as a single Desktop top-level window
+that embeds all GUI operations. Desktop window provides access to standard GUI elements
+like viewers, main menu, toolbars, dock windows, dialog boxes, etc. 
 
-\image html desktop.png
+The main elements of the SALOME Desktop are represented on the picture below:
 
+\image html desktop.png
 
-<b>Basic parts of the SALOME Desktop:</b>
-<ul>
-<li><b>Main menu</b> - This is a set of context-sensitive menus, which will
+The main parts of the SALOME Desktop are:
+- <b>Main menu</b> - This is a set of context-sensitive menus, which will
 be updated according to the functionality of the currently active component. In
-general, these menus contain all functional options of SALOME platform.</li>
-<li><b>Standard toolbar</b> - contains standard actions
+general, these menus contain all functional options of SALOME platform.
+<b>Standard toolbar</b> - contains standard actions
 that allow creating new or opening existing study, saving study, deleting
-objects etc.</li>
-<li><b>Components toolbar</b> - allows activating
-components in SALOME platform.</li>
-<li><b>Module toolbars</b> - contains actions specific to the
-currently active module.</li>
-<li><b>Viewer toolbar</b> - provides a set of tools destined for visualization
-of the presentations in the viewer.</li>
-</ul>
-
+objects etc.
+- <b>Components toolbar</b> - allows activating
+components in SALOME platform.
+- <b>Module toolbars</b> - contain actions specific to the
+currently active module.
+- <b>Viewer toolbar</b> - provides a set of tools destined for visualization
+of the presentations in the viewer.
 
 All toolbars in the \b SALOME Platform are context-sensitive. Loading of a definite component
 (Geometry, Mesh etc.) will automatically add some additional
@@ -37,17 +33,15 @@ toolbars specific to this component. To display/hide a toolbar, in the main menu
 
 By default all toolbars are located on top of the SALOME desktop, but you can relocate a toolbar by dragging it with the mouse and dropping in any place of the window.
 
-<b>Parts of  the study window:</b>
-<ul>
-<li><b>Object browser</b> - Management of objects created or imported into
-SALOME application.</li>
-<li>\b Viewer - This window is destined for visualization of
-presentations.</li>
-<li><b>Python console</b> - Window for Python interpreter. This window
+Parts of the study window:
+- <b>Object browser</b> - Management of objects created or imported into
+SALOME application.
+- \b Viewer - This window is destined for visualization of
+presentations.
+- <b>Python console</b> - Window for Python interpreter. This window
 functions like a standard document: the pop-up menu invoked by
 right-click in this window gives access to
-<b>Copy/Paste/SelectAll/ClearAll</b> options.</li>
-</ul>
+<b>Copy/Paste/SelectAll/ClearAll</b> options.
 
 Object Browser, Python Console, MenuBar, etc are, in fact, separate dockable windows.
 Dockable windows can be placed in special areas, on the borders of
@@ -65,38 +59,31 @@ All parts of Salome desktop and study window can be managed through \b View menu
 
 \image html viewmenu.png
 
-<ul>
-<li>\b Toolbars - allows to show and hide toolbars</li>
-<li>\b Windows - allows to show and hide dockable windows, such as
-Object Browser and Python Console</li>
-<li><b> Status Bar </b> allows showing and hiding the Status Bar.</li>
-<li>\ref themes_page "Theme" - allows to select and edit the style (colors and fonts) for Salome session.</li>
-</ul>
+- \b Toolbars - allows to show and hide toolbars.
+- \b Windows - allows to show and hide dockable windows, such as
+Object Browser and Python Console.
+- <b> Status Bar </b> allows showing and hiding the Status Bar.
+- \ref themes_page "Theme" - allows to select and edit the style (colors and fonts) for Salome session.
 
 If there are several viewer windows in your current study and you want to display more then one at the same time, you can use the functionalities provided by the \b Window menu.
 
 \image html windowmenu.png
 
-<ul>
-<li><b>New window </b> - allows to open a new instance of any viewer.</li> 
-<li><b>Close</b> - closes the currently active viewer window.</li> 
-<li><b>Close all</b> - closes all viewer windows.</li>
-<li><b>Group all</b> - arranges all created viewer windows on the same desktop</li>
-<li><b>Arrange Views</b> - allows choosing the necessary views and their layout.
+- <b>New window </b> - allows to open a new instance of any viewer.
+- <b>Close</b> - closes the currently active viewer window.
+- <b>Close all</b> - closes all viewer windows.
+- <b>Group all</b> - arranges all created viewer windows on the same desktop.
+- <b>Arrange Views</b> - allows choosing the necessary views and their layout (see image below).
+  - The radio-buttons in <b>Views Layout</b> section allow choosing the number of views to be arranged (2, 3 or 4). The buttons with images allow choosing the view layout (depending on the chosen number of views). 
+  - <b>Views List</b>  contains the list of opened view windows, where it is possible to check in the necessary views. 
+  - <b>Close the remaining views</b> check-box allows closing all non-selected views.    
+  - <b>Stack the remaining views</b> check-box allows stacking all non-selected views in the last tab area.
 
 \image html arrange_views_dlg.png
 
-- The radio-buttons in <b>Views Layout</b> section allow choosing the number of views to be arranged (2, 3 or 4). The buttons with images allow choosing the view layout (depending on the chosen number of views). 
-- <b>Views List</b>  contains the list of opened view windows, where it is possible to check in the necessary views. 
-- <b>Close the remaining views</b> check-box allows closing all non-selected views.    
-- <b>Stack the remaining views</b> check-box allows stacking all non-selected views in the last tab area.
-      
-<li><b>Split Vertically</b> and <b>Split Horizontally</b> allow splitting 
-the representation area into two parts, in horizontal or vertical direction.</li>
-<li>List of all opened viewer windows provides fast access to them.</li>
-<li>\b Rename - allows renaming the currently selected viewer window. </li>
-</ul>
-
-
+- <b>Split Vertically</b> and <b>Split Horizontally</b> allow splitting 
+the representation area into two parts, in horizontal or vertical direction.
+- List of all opened viewer windows provides fast access to them.
+- \b Rename - allows renaming the currently selected viewer window.
 
 */
index 9e4f618d4ea69ee9081126b381d8d33ebf5c890e..945971e3e13d80ccb699a9d8ff7a8dab4a10f7c2 100644 (file)
@@ -2,47 +2,43 @@
 
 \page study_management_page Study management
 
-Study is a document within GUI, where you can carry out all
+Study is a document within application, where you can carry out all
 operations provided by the SALOME functionality. 
 This is a certain abstraction layer between actual
 document data (probably, remote data available through CORBA) and data
 presentation (in the Object Browser). The study is composed of Data
-Object instances, united in a tree-like structure.
+Object instances, combined into a tree-like structure.
 
-All operations with studies are available from the \b File menu.
+All operations with study are available from the \b File menu.
 
-\image html studymanagement.png
+\note SALOME is a single-study application. It means that only one study
+can be opened at the moment.
 
-\b New - creates a new study. The study will be created
-with default name \b Study1. It is possible to create
-several studies, each accessible from the task bar.
+Immediately after application start-up there is (normally) no active study.
+However, you have access to the embedded Python console, that can be used to initialize
+the study by means of Python API (see documentation on SALOME KERNEL module for more details).
 
-\b Open - allows to open an existing study by browsing for it in a
-standard Search File dialog box, choosing the required
-*.hdf file and clicking \b Open button.
+The following operations are available from the \b File menu:
 
-\b Reopen - reloads the current study from the *.hdf file. This menu command
-can be used to reverse the study to the latest saved state.
+\image html menu_file.png
 
-\b Connect - allows to open an unloaded study.
-\image html loadstudy2.png
-Select one of the studies, which has been previously
-created and unloaded and click \b Ok button.
+As soon as study is created, loaded from the file or from the data server,
+some additional operations become available from the \b File menu:
 
-\note SALOME is a multi-study platform. It means that simultaneously you can
-work with several studies. 
-
-\b Close - closes the current study, alternatively it is
-possible to click on the cross in the upper right corner of the study window.
+\image html studymanagement.png
 
-\note If the study has not been previously saved, this option will
-call the following dialog box with several options:
+\b New - creates a new study. The study will be created
+with default name \b Study1. If there is already opened study,
+you will be asked to close it before creating new one.
 
-\image html closestudy.png
+\b Open - allows to open an existing study by browsing for it in a
+standard Open File dialog box, choosing the required
+*.hdf file and clicking \a Open button.
+If there is already opened study, you will be asked to close it
+before opening new one.
 
-Here, \b Unload option unloads the current study from the SALOME
-Desktop. It can be reloaded in the same working session, but if you quit the SALOME application, all changes
-in the unloaded study will be lost.
+\b Reopen - reloads the current study from the associated *.hdf file.
+This menu command can be used to reverse the study to the latest saved state.
 
 \b Save - saves the current study. Saving a study you also save its layout, i.e. all positions and sizes
 of dockable windows. It means that the difference in settings of the
@@ -53,11 +49,34 @@ indicate which common windows are necessary for working, and only they
 will be displayed when this module is active.
 
 \note If the study hasn't been previously saved, \b Save will
-call the standard Search File dialog box where you can enter the name
+call the standard Save File dialog box where you can enter the name
 for your study and save it.
 
-\b Save \b as - allows to save the current study with a new name. Input  a new name for the study in the standard
-Search File dialog box and click \b Save button.
+\b Save \b as - allows to save the current study with a new name.
+Input a new name for the study in the standard
+Search File dialog box and click \a Save button.
+
+\b Close - closes the current study; alternatively closing of the study
+can be done by clicking on the cross in the upper right corner of the desktop window.
+
+\note If the study has not been previously saved, you will be prompted
+by the following dialog box with several options:
+
+\image html closestudy.png
+
+\b Connect - allows to open an unloaded or created outside GUI study.
+
+\note Connect is available only if there is an opened study on the data server.
+
+\b Disconnect - unloads the current study from the desktop. The study stays opened
+in the data server; it can be then reloaded in the same working session
+(\b Connect operation), but if you quit SALOME application, all changes in the
+unloaded study can be lost.
+
+\note If the study has not been previously saved, you will be prompted
+by the following dialog box with several options:
+
+\image html disconnect_study.png
 
 <b>Dump study</b> - allows to Dump a SALOME Study in one or several
 Python scripts. The following dialog box allows to browse for the location and
@@ -76,13 +95,13 @@ is played, otherwise the objects will not be published in the Study.
 saved in the Python file.
 </li>
 </ul>
-To confirm your choice click \b Save.
+To confirm your choice click \a Save.
 
 <b>Load Script</b> - allows to load a saved Python Script.
 
 \image html loadscript.png
 
-To confirm your choice click \b Open.
+To confirm your choice click \a Open.
 
 <b>Properties</b> - allows to show/edit the properties of the current study.
 
index 8b9125fb5a72cf74f0e388407cbae5ef00c4202f..c87d0cf2c7f4a03c48e5ce7baedd078e525c2626 100755 (executable)
@@ -190,7 +190,8 @@ void CAF_Application::createActions()
   createMenu( EditRedoId, editMenu, 0 );
   createMenu( separator(), editMenu, -1, 0 );
 
-  int stdTBar = createTool( tr( "INF_DESK_TOOLBAR_STANDARD" ) );
+  int stdTBar = createTool( tr( "INF_DESK_TOOLBAR_STANDARD" ),   // title (language-dependant)
+                           QString( "SalomeStandard" ) );       // name (language-independant)
 
   createTool( separator(), stdTBar );
   createTool( EditUndoId, stdTBar );
index d8cfa68b468e87f1ea8f3ca1a5ac4c255d575c9b..0b60a95fda03f699e000f94fcb53f529a18e3ee5 100755 (executable)
@@ -108,9 +108,7 @@ bool CAF_Study::createDocument( const QString& doc )
   if ( res && app && !app->stdApp().IsNull() )
   {
     try {
-#if OCC_VERSION_LARGE > 0x06010000
       OCC_CATCH_SIGNALS;
-#endif
       TColStd_SequenceOfExtendedString formats;
       app->stdApp()->Formats( formats );
       if ( !formats.IsEmpty() )
@@ -149,15 +147,8 @@ bool CAF_Study::openDocument( const QString& fname )
 
   bool status = false;
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
-
-#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
     status = app->Open( CAF_Tools::toExtString( fname ), myStdDoc ) == PCDM_RS_OK;
-#else
-    status = app->Open( CAF_Tools::toExtString( fname ), myStdDoc ) == CDF_RS_OK;
-#endif
   }
   catch ( Standard_Failure ) {
     status = false;
@@ -185,15 +176,9 @@ bool CAF_Study::saveDocumentAs( const QString& fname )
 
   bool status = false;
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if ( save )
-#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
       status = app->Save( stdDoc() ) == PCDM_SS_OK;
-#else
-      status = app->Save( stdDoc() ) == CDF_SS_OK;
-#endif
     else
     {
       TCollection_ExtendedString format, path( CAF_Tools::toExtString( fname ) );
@@ -202,11 +187,7 @@ bool CAF_Study::saveDocumentAs( const QString& fname )
       if ( format.Length() )
         stdDoc()->ChangeStorageFormat( format );
 
-#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
       status = app->SaveAs( stdDoc(), path ) == PCDM_SS_OK;
-#else
-      status = app->SaveAs( stdDoc(), path ) == CDF_SS_OK;
-#endif
     }
   }
   catch ( Standard_Failure ) {
@@ -233,9 +214,7 @@ bool CAF_Study::openTransaction()
 
   bool res = true;
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     if ( myStdDoc->HasOpenCommand() )
       myStdDoc->AbortCommand();
 
@@ -259,9 +238,7 @@ bool CAF_Study::abortTransaction()
 
   bool res = true;
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     myStdDoc->AbortCommand();
     update();
   }
@@ -282,9 +259,7 @@ bool CAF_Study::commitTransaction( const QString& name )
 
   bool res = true;
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     myStdDoc->CommitCommand();
 
     if ( canUndo() )
@@ -387,9 +362,7 @@ bool CAF_Study::undo()
     return false;
 
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     myStdDoc->Undo();
     undoModified();     /* decrement modification counter */
   }
@@ -411,9 +384,7 @@ bool CAF_Study::redo()
     return false;
 
   try {
-#if OCC_VERSION_LARGE > 0x06010000
     OCC_CATCH_SIGNALS;
-#endif
     myStdDoc->Redo();
     doModified();      /* increment modification counter */
   }
index 0f0d55708f40b0bd585532f6f594eac72d7d4012..2cba7bc1ed8f5f14137a37a04ceaee0a1bd26510 100755 (executable)
@@ -396,17 +396,18 @@ QtxActionToolMgr* CAM_Module::toolMgr() const
 
   If the toolbar has been already created, its ID is just returned.
 
-  \param name toolbar name
+  \param title toolbar title
+  \param name toolbar name (identifier)
   \return toolbar ID or -1 if toolbar could not be created
 */
-int CAM_Module::createTool( const QString& name )
+int CAM_Module::createTool( const QString& title, const QString& name )
 {
   if ( !toolMgr() )
     return -1;
 
   ActionMgrLocker lock( toolMgr(), !myToolShown );
 
-  return toolMgr()->createToolBar( name, myToolShown );
+  return toolMgr()->createToolBar( title, name );
 }
 
 /*!
index df0019f766424407ec012c475f95c3c46894c4ce..49fbaf4e702e8517be474e564231710e9ceeff9d 100755 (executable)
@@ -99,7 +99,7 @@ public:
                                        const bool = false, QObject* = 0, const char* = 0, const QString& = QString() );
   QtxActionGroup*        createActionGroup( const int, const bool = true );
 
-  int                    createTool( const QString& );
+  int                    createTool( const QString&, const QString& = QString() );
   int                    createTool( const int, const int, const int = -1 );
   int                    createTool( const int, const QString&, const int = -1 );
   int                    createTool( QAction*, const int, const int = -1, const int = -1 );
index 08c7b287ce6eba59788e9910ca81c472ba675e5d..54e4e19ad5386e60b806027dd0761ad9ab41906d 100755 (executable)
@@ -21,7 +21,7 @@
 # Common packages
 ##
 SET(SUBDIRS_COMMON
-  CASCatch Qtx Style DDS QDS ObjBrowser SUIT SUITApp STD CAF
+  CASCatch Qtx HelpBrowser Style DDS QDS ObjBrowser SUIT SUITApp STD CAF
   CAM LogWindow Prs Event OpenGLUtils ViewerData ViewerTools ImageComposer GUI_PY
 )
 
index f6530348d8cf6452853e1c967df6b63323011f2d..2d59c983d3503037bc2f552853225dfc4dbe5e6f 100644 (file)
@@ -26,7 +26,6 @@
 #include <TCollection_AsciiString.hxx>
 
 #include <NCollection_DefineDataMap.hxx>
-#include <NCollection_DefineBaseCollection.hxx>
 
 #define UNIT_SYSTEM_SI "SI"
 
@@ -34,6 +33,4 @@ typedef enum { DDS_MT_OK, DDS_MT_WARNING,
                DDS_MT_ERROR, DDS_MT_ALARM,
                DDS_MT_INFO, DDS_MT_NONE } DDS_MsgType;
 
-DEFINE_BASECOLLECTION(DDS_BaseColOfAsciiString,TCollection_AsciiString)
-
 #endif
index e8480beb88f1e7370900d04159c1808f7e233425..5822d8afbdd95b64a45bfc0b3b11e8d76dc85df8 100644 (file)
@@ -92,8 +92,6 @@ public:
   DEFINE_STANDARD_RTTI(DDS_DicGroup)
 };
 
-DEFINE_BASECOLLECTION(DDS_BaseCollectionOfDicGroups, Handle(DDS_DicGroup))
-DEFINE_INDEXEDDATAMAP(DDS_IndexedDataMapOfDicGroups, DDS_BaseCollectionOfDicGroups,
-                      TCollection_AsciiString, Handle(DDS_DicGroup))
+typedef NCollection_IndexedDataMap<TCollection_AsciiString, Handle(DDS_DicGroup)> DDS_IndexedDataMapOfDicGroups;
 
 #endif
index fa1f9db9ca79a3c402dcb69d9e3b0fc2e5c1d157..a7fbcaeb984011395c763800c8200c83f8b1975a 100644 (file)
@@ -258,8 +258,6 @@ public:
 
 DEFINE_STANDARD_HANDLE(DDS_DicItem, MMgt_TShared)
 
-DEFINE_BASECOLLECTION(DDS_BaseCollectionOfDicItems, Handle(DDS_DicItem))
-DEFINE_INDEXEDDATAMAP(DDS_IndexedDataMapOfDicItems, DDS_BaseCollectionOfDicItems,
-                      TCollection_AsciiString, Handle(DDS_DicItem))
+typedef NCollection_IndexedDataMap<TCollection_AsciiString, Handle(DDS_DicItem)> DDS_IndexedDataMapOfDicItems;
 
 #endif
index 6c99b77251439a5ca9c3548696c3ecf5e01da66d..823bfe1a881ae57b062102351ef331c55334a622 100644 (file)
@@ -555,9 +555,7 @@ Standard_Real DDS_Dictionary::ToSI( const Standard_Real theValue, const Standard
   if ( theUnits && *theUnits && strcmp( theUnits, "%" ) )
   {
     try {
-#if OCC_VERSION_LARGE > 0x06010000
       OCC_CATCH_SIGNALS;
-#endif
       aRetValue = UnitsAPI::AnyToSI( theValue, theUnits );
     }
     catch( Standard_Failure ) {
@@ -582,9 +580,7 @@ Standard_Real DDS_Dictionary::FromSI( const Standard_Real theValue, const Standa
   if ( theUnits && *theUnits && strcmp( theUnits, "%" ) )
   {
     try {
-#if OCC_VERSION_LARGE > 0x06010000
       OCC_CATCH_SIGNALS;
-#endif
       aRetValue = UnitsAPI::AnyFromSI( theValue, theUnits );
     }
     catch( Standard_Failure ) {
index ee40447d8a275059a4df1b1541ae2b5ebcdf0fd1..f0a23b919092c9f3c4bda14ed7a408ac00951d93 100644 (file)
@@ -148,7 +148,9 @@ void GLViewer_ViewFrame::createActions()
 */
 void GLViewer_ViewFrame::createToolBar()
 {
-  int tid = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), false );
+  int tid = toolMgr()->createToolBar( tr( "LBL_TOOLBAR_LABEL" ),             // title (language-dependant)
+                                     QString( "GLViewerViewOperations" ),   // name (language-independant)
+                                     false );                               // disable floatable toolbar
   toolMgr()->append( DumpId, tid );
 
   QtxMultiAction* aScaleAction = new QtxMultiAction( this );
index d99e2af4c218e827d122739caa2c5726b5f0a256..8a594b342970625b2ecb29aef92ec35b5c43313a 100644 (file)
@@ -2,23 +2,35 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="en_US">
 <context>
-    <name>@default</name>
+    <name>GLViewer_ViewFrame</name>
     <message>
-        <source>DSC_FITSELECT</source>
-        <translation>Fit area of selection within the view frame</translation>
+        <source>MNU_FITSELECT</source>
+        <translation>Fit Selection</translation>
     </message>
     <message>
-        <source>ERROR</source>
-        <translation>Error</translation>
+        <source>DSC_FITSELECT</source>
+        <translation>Fit area of selection within the view frame</translation>
     </message>
     <message>
         <source>MNU_DUMP_VIEW</source>
         <translation>Dump</translation>
     </message>
+    <message>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Saves the active view in the image file</translation>
+    </message>
     <message>
         <source>MNU_PAN_VIEW</source>
         <translation>Panning</translation>
     </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Panning the view</translation>
+    </message>
+    <message>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Global Panning</translation>
+    </message>
     <message>
         <source>DSC_GLOBALPAN_VIEW</source>
         <translation>Selection of a new center of the view</translation>
         <translation>Zoom</translation>
     </message>
     <message>
-        <source>DSC_PAN_VIEW</source>
-        <translation>Panning the view</translation>
-    </message>
-    <message>
-        <source>DSC_FITALL</source>
-        <translation>Fit all objects inside the view frame</translation>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoom the view</translation>
     </message>
     <message>
         <source>MNU_FITALL</source>
         <translation>Fit All</translation>
     </message>
     <message>
-        <source>MNU_GLOBALPAN_VIEW</source>
-        <translation>Global Panning</translation>
-    </message>
-    <message>
-        <source>INF_APP_DUMP_VIEW</source>
-        <translation>Dump view</translation>
-    </message>
-    <message>
-        <source>GL_IMAGE_FILES</source>
-        <translation>Images Files (*.bmp *.png)</translation>
+        <source>DSC_FITALL</source>
+        <translation>Fit all objects inside the view frame</translation>
     </message>
     <message>
         <source>MNU_RESET_VIEW</source>
         <translation>Reset</translation>
     </message>
     <message>
-        <source>DSC_FITRECT</source>
-        <translation>Fit area within the view frame</translation>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Reset View Point</translation>
     </message>
     <message>
         <source>MNU_FITRECT</source>
         <translation>Fit Area</translation>
     </message>
     <message>
-        <source>CHANGE_BGCOLOR</source>
-        <translation>Change background...</translation>
-    </message>
-    <message>
-        <source>DSC_DUMP_VIEW</source>
-        <translation>Saves the active view in the image file</translation>
-    </message>
-    <message>
-        <source>MNU_FITSELECT</source>
-        <translation>Fit Selection</translation>
-    </message>
-    <message>
-        <source>DSC_ZOOM_VIEW</source>
-        <translation>Zoom the view</translation>
-    </message>
-    <message>
-        <source>DSC_RESET_VIEW</source>
-        <translation>Reset View Point</translation>
-    </message>
-    <message>
-        <source>ERR_DOC_CANT_SAVE_FILE</source>
-        <translation>Cannot save file</translation>
+        <source>DSC_FITRECT</source>
+        <translation>Fit area within the view frame</translation>
     </message>
     <message>
         <source>LBL_TOOLBAR_LABEL</source>
     </message>
 </context>
 <context>
-    <name>GLViewer_ViewFrame</name>
-    <message>
-        <source>DUMP_VIEW_SAVE_FILE_DLG_CAPTION</source>
-        <translation>Save Dump View in file</translation>
-    </message>
-    <message>
-        <source>DUMP_VIEW_ERROR_DLG_TEXT</source>
-        <translation>Can&apos;t save Dump View in file</translation>
-    </message>
+    <name>GLViewer_ViewManager</name>
     <message>
-        <source>DUMP_VIEW_ERROR_DLG_CAPTION</source>
-        <translation>Error</translation>
+        <source>GL_VIEW_TITLE</source>
+        <translation>GL Scene:%M - viewer:%V</translation>
     </message>
 </context>
 <context>
-    <name>GLViewer_ViewManager</name>
+    <name>GLViewer_Viewer</name>
     <message>
-        <source>GL_VIEW_TITLE</source>
-        <translation>GL Scene:%M - viewer:%V</translation>
+        <source>CHANGE_BGCOLOR</source>
+        <translation>Change background...</translation>
     </message>
 </context>
 </TS>
index 32fea6fa18e5e61cef4fdc99adcbd20d4532df62..54e5816990b908e16decdc422f67b68c12aaf346 100755 (executable)
@@ -2,23 +2,35 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="fr_FR">
 <context>
-    <name>@default</name>
+    <name>GLViewer_ViewFrame</name>
     <message>
-        <source>DSC_FITSELECT</source>
-        <translation>Montrer la zone choisie dans la vue</translation>
+        <source>MNU_FITSELECT</source>
+        <translation>Afficher la sélection</translation>
     </message>
     <message>
-        <source>ERROR</source>
-        <translation>Erreur</translation>
+        <source>DSC_FITSELECT</source>
+        <translation>Montrer la zone choisie dans la vue</translation>
     </message>
     <message>
         <source>MNU_DUMP_VIEW</source>
         <translation>Sauvegarder</translation>
     </message>
+    <message>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Sauvegarder la vue en cours dans un fichier image</translation>
+    </message>
     <message>
         <source>MNU_PAN_VIEW</source>
         <translation>Déplacement</translation>
     </message>
+    <message>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Déplacer la vue</translation>
+    </message>
+    <message>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Déplacement global</translation>
+    </message>
     <message>
         <source>DSC_GLOBALPAN_VIEW</source>
         <translation>Sélection d&apos;un nouveau centre de vue</translation>
         <translation>Zoomer</translation>
     </message>
     <message>
-        <source>DSC_PAN_VIEW</source>
-        <translation>Déplacer la vue</translation>
-    </message>
-    <message>
-        <source>DSC_FITALL</source>
-        <translation>Montrer tous les objets dans la vue</translation>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoomer la vue</translation>
     </message>
     <message>
         <source>MNU_FITALL</source>
         <translation>Tout afficher</translation>
     </message>
     <message>
-        <source>MNU_GLOBALPAN_VIEW</source>
-        <translation>Déplacement global</translation>
-    </message>
-    <message>
-        <source>INF_APP_DUMP_VIEW</source>
-        <translation>Sauvegarder la vue</translation>
-    </message>
-    <message>
-        <source>GL_IMAGE_FILES</source>
-        <translation>Fichiers images (*.bmp *.png)</translation>
+        <source>DSC_FITALL</source>
+        <translation>Montrer tous les objets dans la vue</translation>
     </message>
     <message>
         <source>MNU_RESET_VIEW</source>
         <translation>Restaurer</translation>
     </message>
     <message>
-        <source>DSC_FITRECT</source>
-        <translation>Montrer la zone dans la vue</translation>
+        <source>DSC_RESET_VIEW</source>
+        <translation>Restaurer le point de vue</translation>
     </message>
     <message>
         <source>MNU_FITRECT</source>
         <translation>Afficher la zone</translation>
     </message>
     <message>
-        <source>CHANGE_BGCOLOR</source>
-        <translation>Changer la couleur d&apos;arrière-plan...</translation>
-    </message>
-    <message>
-        <source>DSC_DUMP_VIEW</source>
-        <translation>Sauvegarder la vue en cours dans un fichier image</translation>
-    </message>
-    <message>
-        <source>MNU_FITSELECT</source>
-        <translation>Afficher la sélection</translation>
-    </message>
-    <message>
-        <source>DSC_ZOOM_VIEW</source>
-        <translation>Zoomer la vue</translation>
-    </message>
-    <message>
-        <source>DSC_RESET_VIEW</source>
-        <translation>Restaurer le point de vue</translation>
-    </message>
-    <message>
-        <source>ERR_DOC_CANT_SAVE_FILE</source>
-        <translation>Impossible de sauvegarder le fichier</translation>
+        <source>DSC_FITRECT</source>
+        <translation>Montrer la zone dans la vue</translation>
     </message>
     <message>
         <source>LBL_TOOLBAR_LABEL</source>
     </message>
 </context>
 <context>
-    <name>GLViewer_ViewFrame</name>
-    <message>
-        <source>DUMP_VIEW_SAVE_FILE_DLG_CAPTION</source>
-        <translation>Sauvegarder la vue dans le fichier</translation>
-    </message>
-    <message>
-        <source>DUMP_VIEW_ERROR_DLG_TEXT</source>
-        <translation>Impossible de sauvegarder la vue dans le fichier</translation>
-    </message>
+    <name>GLViewer_ViewManager</name>
     <message>
-        <source>DUMP_VIEW_ERROR_DLG_CAPTION</source>
-        <translation>Erreur</translation>
+        <source>GL_VIEW_TITLE</source>
+        <translation>Scène GL:%M - visualiseur:%V</translation>
     </message>
 </context>
 <context>
-    <name>GLViewer_ViewManager</name>
+    <name>GLViewer_Viewer</name>
     <message>
-        <source>GL_VIEW_TITLE</source>
-        <translation>Scène GL:%M - visualiseur:%V</translation>
+        <source>CHANGE_BGCOLOR</source>
+        <translation>Changer la couleur d&apos;arrière-plan...</translation>
     </message>
 </context>
 </TS>
index f833a7930cd79f6cea27c946ba224fdd909a637b..14b0b6749c9cacde435fd521988dcdf418139c22 100644 (file)
@@ -2,23 +2,35 @@
 <!DOCTYPE TS>
 <TS version="2.0" language="ja" sourcelanguage="en">
   <context>
-    <name>@default</name>
+    <name>GLViewer_ViewFrame</name>
     <message>
-      <source>DSC_FITSELECT</source>
-      <translation>ã\83\93ã\83¥ã\83¼ã\81§é\81¸æ\8a\9eã\81\97ã\81\9fã\82¾ã\83¼ã\83³ã\82\92表示ã\81\97ã\81¾ã\81\99ã\80\82</translation>
+      <source>MNU_FITSELECT</source>
+      <translation>ã\83\87ã\82£ã\82¹ã\83\97ã\83¬ã\82¤ã\81®é\81¸æ\8a\9e</translation>
     </message>
     <message>
-      <source>ERROR</source>
-      <translation>ã\82¨ã\83©ã\83¼</translation>
+      <source>DSC_FITSELECT</source>
+      <translation>ã\83\93ã\83¥ã\83¼ã\81§é\81¸æ\8a\9eã\81\97ã\81\9fã\82¾ã\83¼ã\83³ã\82\92表示ã\81\97ã\81¾ã\81\99ã\80\82</translation>
     </message>
     <message>
       <source>MNU_DUMP_VIEW</source>
       <translation>保存</translation>
     </message>
+    <message>
+      <source>DSC_DUMP_VIEW</source>
+      <translation>現在のビューをイメージ ファイルに保存します。</translation>
+    </message>
     <message>
       <source>MNU_PAN_VIEW</source>
       <translation>パンニング</translation>
     </message>
+    <message>
+      <source>DSC_PAN_VIEW</source>
+      <translation>ビューを移動します。</translation>
+    </message>
+    <message>
+      <source>MNU_GLOBALPAN_VIEW</source>
+      <translation>グローバルパンニング</translation>
+    </message>
     <message>
       <source>DSC_GLOBALPAN_VIEW</source>
       <translation>ビューの新しい中心地の選択</translation>
       <translation>ズーム</translation>
     </message>
     <message>
-      <source>DSC_PAN_VIEW</source>
-      <translation>ビューを移動します。</translation>
-    </message>
-    <message>
-      <source>DSC_FITALL</source>
-      <translation>すべてのオブジェクトを表示します。</translation>
+      <source>DSC_ZOOM_VIEW</source>
+      <translation>ズーム</translation>
     </message>
     <message>
       <source>MNU_FITALL</source>
       <translation>すべて表示</translation>
     </message>
     <message>
-      <source>MNU_GLOBALPAN_VIEW</source>
-      <translation>グローバルパンニング</translation>
-    </message>
-    <message>
-      <source>INF_APP_DUMP_VIEW</source>
-      <translation>ビューを保存します。</translation>
-    </message>
-    <message>
-      <source>GL_IMAGE_FILES</source>
-      <translation>イメージ (*.bmp *.png) ファイル</translation>
+      <source>DSC_FITALL</source>
+      <translation>すべてのオブジェクトを表示します。</translation>
     </message>
     <message>
       <source>MNU_RESET_VIEW</source>
       <translation>復元</translation>
     </message>
     <message>
-      <source>DSC_FITRECT</source>
-      <translation>領域にビューを表示します。</translation>
+      <source>DSC_RESET_VIEW</source>
+      <translation>ビューのポイントを復元します。</translation>
     </message>
     <message>
       <source>MNU_FITRECT</source>
       <translation>表示エリア</translation>
     </message>
     <message>
-      <source>CHANGE_BGCOLOR</source>
-      <translation>背景色を変更.</translation>
-    </message>
-    <message>
-      <source>DSC_DUMP_VIEW</source>
-      <translation>現在のビューをイメージ ファイルに保存します。</translation>
-    </message>
-    <message>
-      <source>MNU_FITSELECT</source>
-      <translation>ディスプレイの選択</translation>
-    </message>
-    <message>
-      <source>DSC_ZOOM_VIEW</source>
-      <translation>ズーム</translation>
-    </message>
-    <message>
-      <source>DSC_RESET_VIEW</source>
-      <translation>ビューのポイントを復元します。</translation>
-    </message>
-    <message>
-      <source>ERR_DOC_CANT_SAVE_FILE</source>
-      <translation>ファイルを保存できませんでした。</translation>
+      <source>DSC_FITRECT</source>
+      <translation>領域にビューを表示します。</translation>
     </message>
     <message>
       <source>LBL_TOOLBAR_LABEL</source>
     </message>
   </context>
   <context>
-    <name>GLViewer_ViewFrame</name>
-    <message>
-      <source>DUMP_VIEW_SAVE_FILE_DLG_CAPTION</source>
-      <translation>ビューでファイルを保存します。</translation>
-    </message>
-    <message>
-      <source>DUMP_VIEW_ERROR_DLG_TEXT</source>
-      <translation>ビューでファイルを保存できませんでした。</translation>
-    </message>
+    <name>GLViewer_ViewManager</name>
     <message>
-      <source>DUMP_VIEW_ERROR_DLG_CAPTION</source>
-      <translation>ã\82¨ã\83©ã\83¼</translation>
+      <source>GL_VIEW_TITLE</source>
+      <translation>ã\82·ã\83¼ã\83³ GL: %M - ã\83\93ã\83¥ã\83¼ã\82¢ã\83¼: %V</translation>
     </message>
   </context>
   <context>
-    <name>GLViewer_ViewManager</name>
+    <name>GLViewer_Viewer</name>
     <message>
-      <source>GL_VIEW_TITLE</source>
-      <translation>シーン GL: %M - ビューアー: %V</translation>
+      <source>CHANGE_BGCOLOR</source>
+      <translation>背景色を変更.</translation>
     </message>
   </context>
 </TS>
index 496f5fa056da3fb335794d804060a61eb5eaf626..0c034e0d84f1f639b81ed8a9e35e34d226278be2 100755 (executable)
@@ -41,12 +41,17 @@ SET(_other_SCRIPTS
   helper.py
   mytestdialog.py
   selectvars.py
+  dockwidgets.py
+)
+SET(_bin_SCRIPTS
+  test_dockwidgets.py
 )
 
-# scritps / to install
+# scripts / to install
 
 SET(_all_SCRIPTS ${_other_SCRIPTS} ${_pyuic_SCRIPTS})
 
 # --- rules ---
 
 SALOME_INSTALL_SCRIPTS("${_all_SCRIPTS}" ${SALOME_INSTALL_PYTHON}/salome/gui)
+SALOME_INSTALL_SCRIPTS("${_bin_SCRIPTS}" ${SALOME_INSTALL_SCRIPT_DATA})
diff --git a/src/GUI_PY/dockwidgets.py b/src/GUI_PY/dockwidgets.py
new file mode 100644 (file)
index 0000000..8bd5797
--- /dev/null
@@ -0,0 +1,82 @@
+from PyQt4.QtCore import *
+from PyQt4.QtGui import *
+
+import SalomePyQt
+
+_dockWidgetNames = {
+    SalomePyQt.WT_ObjectBrowser : "objectBrowserDock",
+    SalomePyQt.WT_PyConsole     : "pythonConsoleDock",
+    SalomePyQt.WT_LogWindow     : "logWindowDock",
+    SalomePyQt.WT_NoteBook      : "noteBookDock",
+}
+
+def findDockWidgetByTitle( title ):
+    """
+    Find and return dock widget by its window title.
+    Returns None if dock widget does not exist or is not created yet.
+    
+    WARNING: this function is language-dependant as the title of the
+    dock widget is normally internationalized according to the currently
+    used language.
+
+    Example:
+      # get object browser
+      findDockWidgetByTitle( "Object Browser" )
+    """
+    sg = SalomePyQt.SalomePyQt()
+    dwl = sg.getDesktop().findChildren( QDockWidget )
+    dw = filter(lambda a: a.windowTitle() == QString( title ), dwl)
+    if dw: return dw[0]
+    return None
+
+def findDockWidgetByName( dwName ):
+    """
+    Find and return dock widget by its internal name
+    Returns None if dock widget does not exist or is not created yet
+    
+    Note: this function is language-independant: internal name
+    of the dock widget does not depend on the currently used language.
+
+    Example:
+      # get object browser
+      findDockWidgetByName( "objectBrowserDock" )
+    """
+    sg = SalomePyQt.SalomePyQt()
+    return sg.getDesktop().findChild( QDockWidget, dwName )
+
+def findDockWidgetById( dwId ):
+    """
+    Find and return dock widget by its id
+    Returns None if dock widget does not exist or is not created yet
+
+    WARNING: this function works only with dock widget ids
+    specified in SalomePyQt interface.
+    
+    Example:
+      # get object browser
+      findDockWidgetById( SalomePyQt.WT_ObjectBrowser )
+    """
+    try:
+        return findDockWidgetByName( _dockWidgetNames[ dwId ] )
+    except:
+        pass
+    return None
+
+def getAllDockWindows():
+    """
+    Get all dock widgets.
+    
+    WARNING: this function searches all dock widgets starting from the
+    top-level main window; thus, resulting list contains also dock windows
+    that belong to the lower-level windows (e.g. view windows).
+    """
+    sg = SalomePyQt.SalomePyQt()
+    return sg.getDesktop().findChildren( QDockWidget )
+
+def tabifyDockWidgets( dw1, dw2 ):
+    """
+    Tabify two dock widgets.
+    """
+    sg = SalomePyQt.SalomePyQt()
+    if dw1 and dw2: sg.getDesktop().tabifyDockWidget( dw1, dw2 )
+    pass
diff --git a/src/GUI_PY/test_dockwidgets.py b/src/GUI_PY/test_dockwidgets.py
new file mode 100644 (file)
index 0000000..d51d523
--- /dev/null
@@ -0,0 +1,45 @@
+from salome.gui.dockwidgets import *
+
+print "-- Search dock windows by title"
+ob = findDockWidgetByTitle( "Object Browser" )
+if ob:
+    print "object browser:", ob
+else:
+    print "object browser was not found"
+
+pc  = findDockWidgetByTitle( "Python Console" )
+if pc:
+    print "python console:", pc
+else:
+    print "python console was not found"
+print 
+
+print "-- Search dock windows by name"
+ob = findDockWidgetByName( "objectBrowserDock" )
+if ob:
+    print "object browser:", ob
+else:
+    print "object browser was not found"
+pc  = findDockWidgetByName( "pythonConsoleDock" )
+if pc:
+    print "python console:", pc
+else:
+    print "python console was not found"
+print 
+
+print "-- Search dock windows by id"
+ob = findDockWidgetById( SalomePyQt.WT_ObjectBrowser )
+if ob:
+    print "object browser:", ob
+else:
+    print "object browser was not found"
+pc  = findDockWidgetById( SalomePyQt.WT_PyConsole )
+if pc:
+    print "python console:", pc
+else:
+    print "python console was not found"
+print 
+
+print "-- Tabify dock windows"
+tabifyDockWidgets( findDockWidgetById( SalomePyQt.WT_ObjectBrowser ),
+                   findDockWidgetById( SalomePyQt.WT_PyConsole ) )
index 3e97c11401a050353c88037e824962d8d8c50ec6..1bc4f83ca69cd489384ae36d0f20f424a0af599d 100755 (executable)
@@ -65,6 +65,7 @@ SET(_ts_RESOURCES
   resources/GraphicsView_images.ts
   resources/GraphicsView_msg_en.ts
   resources/GraphicsView_msg_fr.ts
+  resources/GraphicsView_msg_ja.ts
 )
 
 # resource files / static
index 52447dcb53f372a8a4f9569840d436dd4229d2e1..3456d42403b6ca500feb6295f826cc8cebe000e3 100644 (file)
@@ -32,7 +32,8 @@ GraphicsView_Object::GraphicsView_Object( QGraphicsItem* theParent )
   myIsOnTop( false ),
   myIsHighlighted( false ),
   myIsSelected( false ),
-  myIsMoving( false )
+  myIsMoving( false ),
+  myIsMovable( true )
 {
 }
 
@@ -156,6 +157,9 @@ void GraphicsView_Object::unselect()
 //================================================================
 void GraphicsView_Object::move( double theDX, double theDY, bool theIsAtOnce )
 {
+  if( !myIsMovable )
+    return;
+
   if( theIsAtOnce )
   {
     finishMove( true );
index 2ead5a27b0cf5bc7b219e7e5d447222d78fe5a42..3f4fcfb7b458be4608460d95fe006b72a4e6ae18 100644 (file)
@@ -54,7 +54,9 @@ public:
   virtual bool               hasSpecificZValue() const { return false; }
 
   virtual bool               isSelectable() const { return true; }
-  virtual bool               isMovable() const { return true; }
+  
+  virtual bool               isMovable() const { return myIsMovable; }
+  virtual void               setMovable( bool theMovable ) { myIsMovable = theMovable; }
 
   virtual QRectF             getRect() const;
 
@@ -103,6 +105,7 @@ protected:
   bool                       myIsSelected;
 
   bool                       myIsMoving;
+  bool                       myIsMovable;
 
   QTransform                 myViewTransform;
 };
index 9e84bb2276a023685095fda8594f8e884fc8c0e8..9bc663af98ed44ad15ff86487a24da8123d89ad6 100644 (file)
@@ -47,7 +47,7 @@
 // Name    : GraphicsView_ViewFrame
 // Purpose : Constructor
 //=======================================================================
-GraphicsView_ViewFrame::GraphicsView_ViewFrame( SUIT_Desktop* d, GraphicsView_Viewer* vw )
+GraphicsView_ViewFrame::GraphicsView_ViewFrame( SUIT_Desktop* d, GraphicsView_Viewer* vw, QWidget* w )
 : SUIT_ViewWindow( d ),
   myViewer( vw )
 {
@@ -58,7 +58,11 @@ GraphicsView_ViewFrame::GraphicsView_ViewFrame( SUIT_Desktop* d, GraphicsView_Vi
   aLayout->setMargin( 0 );
   aLayout->setSpacing( 0 );
 
-  myViewPort = new GraphicsView_ViewPort( aFrame );
+  if( w )
+    myViewPort = dynamic_cast<GraphicsView_ViewPort*>(w);
+  else
+    myViewPort = new GraphicsView_ViewPort( aFrame );
+
   aLayout->addWidget( myViewPort );
 
   createActions();
@@ -167,7 +171,9 @@ void GraphicsView_ViewFrame::createActions()
 //================================================================
 int GraphicsView_ViewFrame::createToolBar()
 {
-  int tid = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL") );
+  int tid = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"),                 // title (language-dependant)
+                                     QString( "GraphicsViewViewOperations" ), // name (language-independant)
+                                     false );                                 // disable floatable toolbar
   toolMgr()->append( DumpId, tid );
 
   myScaleAction = new QtxMultiAction( this );
@@ -187,6 +193,15 @@ int GraphicsView_ViewFrame::createToolBar()
   return tid;
 }
 
+//================================================================
+// Function : getToolBarId
+// Purpose  :
+//================================================================
+int GraphicsView_ViewFrame::getToolBarId()
+{
+  return myToolBarId;
+}
+
 //================================================================
 // Function : dumpView
 // Purpose  : 
index 1335e93df9f8cf97d8e96de5b66ed9323851e861..088bdffc4a29abeb0ba8e57c3eb5438665a19768 100644 (file)
@@ -47,7 +47,7 @@ public:
   enum { DumpId, FitAllId, FitRectId, FitSelectId, ZoomId, PanId, GlobalPanId, ResetId };
 
 public:
-  GraphicsView_ViewFrame( SUIT_Desktop*, GraphicsView_Viewer* );
+  GraphicsView_ViewFrame( SUIT_Desktop*, GraphicsView_Viewer*, QWidget* w = NULL );
   ~GraphicsView_ViewFrame();
 
 public:
@@ -60,6 +60,7 @@ public:
   virtual void            setVisualParameters( const QString& theParameters );
 
   void                    expandToolBarActions();
+  int                     getToolBarId();
 
 protected slots:
   void                    onViewPan();
index 033bef87cef7db714101da317ab3e3d24d86e73f..9f79d180aafc60147456effcdc53e72fa0fd3cf8 100644 (file)
@@ -271,6 +271,26 @@ void GraphicsView_ViewPort::addItem( QGraphicsItem* theItem )
   onBoundingRectChanged();
 }
 
+//================================================================
+// Function : isItemAdded
+// Purpose  :
+//================================================================
+bool GraphicsView_ViewPort::isItemAdded( QGraphicsItem* theItem )
+{
+  if( GraphicsView_Object* anObject = dynamic_cast<GraphicsView_Object*>( theItem ) )
+  {
+    for( GraphicsView_ObjectList::iterator anIter = myObjects.begin(); anIter != myObjects.end(); anIter++ )
+      if( theItem == *anIter )
+        return true;
+  }
+  else {
+    for( int i = 0; i < myScene->items().size(); i++ )
+      if( theItem == myScene->items().at(i) )
+        return true;
+  }
+  return false;
+}
+
 //================================================================
 // Function : removeItem
 // Purpose  : 
index 2a011d1692fd2ddc139db38005f6083e5ee2340e..518598dd4f2f8b7ea117003d9818c85887257076 100644 (file)
@@ -82,6 +82,7 @@ public:
 public:
   GraphicsView_Scene*              getScene() { return myScene; }
   void                             addItem( QGraphicsItem* theItem );
+  bool                             isItemAdded( QGraphicsItem* theItem );
   void                             removeItem( QGraphicsItem* theItem );
 
   enum SortType { NoSorting, SelectedFirst, SortByZLevel };
index 0573ebb5e9c8b5b6a05676cc4feb543372a50cfa..5fb5eb0825e37e0fc6e9effec082b8115bac35d8 100644 (file)
 // Name    : GraphicsView_Viewer
 // Purpose : Constructor
 //=======================================================================
-GraphicsView_Viewer::GraphicsView_Viewer( const QString& title )
+GraphicsView_Viewer::GraphicsView_Viewer( const QString& title, QWidget* widget )
 : SUIT_ViewModel(),
   mySelector( 0 ),
   myTransformer( 0 ),
+  myWidget( widget ),
   myIsInitialized( false )
 {
 }
@@ -71,7 +72,7 @@ GraphicsView_Viewer::~GraphicsView_Viewer()
 //================================================================
 SUIT_ViewWindow* GraphicsView_Viewer::createView( SUIT_Desktop* theDesktop )
 {
-  GraphicsView_ViewFrame* aViewFrame = new GraphicsView_ViewFrame( theDesktop, this );
+  GraphicsView_ViewFrame* aViewFrame = new GraphicsView_ViewFrame( theDesktop, this, myWidget );
 
   connect( aViewFrame, SIGNAL( keyPressed( QKeyEvent* ) ),
            this, SLOT( onKeyEvent( QKeyEvent* ) ) );
index 9c864b8dfe1c9d6514b9a95f75a6289196dc4bb0..8b69d464cb87e00bab9975e87fefeb6e323490eb 100644 (file)
@@ -52,7 +52,7 @@ public:
   enum TransformType { NoTransform, Reset, FitAll, FitRect, FitSelect,
                        Zoom, PanGlobal, Pan, FitWidth, UserTransform = 100 };
 public:
-  GraphicsView_Viewer( const QString& title );
+  GraphicsView_Viewer( const QString& title, QWidget* widget = NULL );
   ~GraphicsView_Viewer();
 
 public:
@@ -126,6 +126,7 @@ private:
 protected:
   GraphicsView_Selector*        mySelector;
   GraphicsView_ViewTransformer* myTransformer;
+  QWidget*                      myWidget;
 
   bool                          myIsInitialized;
 };
index 089ed379c0b592fa699a38b4e02a5d5aa3dc5bfc..8917f75feae8ea49b4462961209c9f0ffa595393 100644 (file)
@@ -76,7 +76,7 @@ void StandardApp_Module::initialize( CAM_Application* app )
   // share/salome/resources/xsalome/SalomeApp.xml in the install
   // directory.
   _defaultMenuId = this->createMenu( QCHARSTAR(moduleName()), -1, -1, 30 );
-  _defaultToolbarId = this->createTool ( QCHARSTAR(moduleName()) );
+  _defaultToolbarId = this->createTool ( QCHARSTAR(moduleName()), moduleName() );
   _actionId_internalCount = StandardApp_Module::ACTIONID_DEFAULT_INIT_VALUE;
 
   //
diff --git a/src/HelpBrowser/CMakeLists.txt b/src/HelpBrowser/CMakeLists.txt
new file mode 100644 (file)
index 0000000..6a90e2e
--- /dev/null
@@ -0,0 +1,77 @@
+# Copyright (C) 2012-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+#
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+#
+# See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+#
+
+# --- options ---
+
+# additional include directories
+INCLUDE_DIRECTORIES(
+  ${QT_INCLUDES}
+  ${PROJECT_SOURCE_DIR}/src/Qtx
+)
+
+# additional preprocessor / compiler flags
+ADD_DEFINITIONS(
+  ${QT_DEFINITIONS}
+)
+
+# libraries to link to
+SET(_link_LIBRARIES
+  ${QT_LIBRARIES}
+  qtx
+)
+
+# --- headers ---
+
+SET(_moc_HEADERS
+  qtlocalpeer.h
+  qtsingleapplication.h
+)
+
+# --- resources ---
+
+# resource files / to be processed by rcc
+SET(_rcc_RESOURCES HelpBrowser.qrc)
+
+# --- sources ---
+
+# sources / rcc wrappings
+QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+
+# sources / moc wrappings
+QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
+
+# sources / to compile
+SET(_other_SOURCES
+  qtlocalpeer.cpp
+  qtsingleapplication.cpp
+  HelpBrowser.cxx
+)
+
+# sources / to compile
+SET(HelpBrowser_SOURCES
+  ${_other_SOURCES}
+  ${_moc_SOURCES}
+  ${_rcc_SOURCES}
+)
+
+# --- rules ---
+
+ADD_EXECUTABLE(HelpBrowser ${HelpBrowser_SOURCES})
+TARGET_LINK_LIBRARIES(HelpBrowser ${_link_LIBRARIES})
+INSTALL(TARGETS HelpBrowser EXPORT ${PROJECT_NAME}TargetGroup DESTINATION ${SALOME_INSTALL_BINS})
diff --git a/src/HelpBrowser/COPYING b/src/HelpBrowser/COPYING
new file mode 100644 (file)
index 0000000..53d5fb7
--- /dev/null
@@ -0,0 +1,36 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Solutions component.
+**
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+**     of its contributors may be used to endorse or promote products derived
+**     from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+****************************************************************************/
diff --git a/src/HelpBrowser/HelpBrowser.cxx b/src/HelpBrowser/HelpBrowser.cxx
new file mode 100644 (file)
index 0000000..0e77f63
--- /dev/null
@@ -0,0 +1,191 @@
+// Copyright (C) 2007-2013  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   : HelpBrowser.cxx
+// Author : Vadim SANDLER, OpenCASCADE S.A.S. (vadim.sandler@opencascade.com)
+
+#include "qtsingleapplication.h"
+#include <QDir>
+#include <QFile>
+#include <QFileInfo>
+#include <QLibraryInfo>
+#include <QMessageBox>
+#include <QTextStream>
+#include <QTimer>
+#include <QtxResourceMgr.h>
+#include <QtxTranslator.h>
+#include <QtxWebBrowser.h>
+
+#include <iostream>
+
+namespace
+{
+  void printHelp()
+  {
+    QFileInfo fi( QtSingleApplication::arguments().at(0) );
+
+    std::cout << std::endl;
+    std::cout << "SALOME Help Browser" << std::endl;
+    std::cout << std::endl;
+    std::cout << "usage: " << qPrintable( fi.fileName() ) << " [options] file" << std::endl;
+    std::cout << "    file is a help file to be opened" << std::endl;
+    std::cout << std::endl;
+    std::cout << "Options:" << std::endl;
+    std::cout << "-h, --help         Prints this help and quits." << std::endl;
+    std::cout << "--language=LANG    Use LANG language in menus." << std::endl;
+    std::cout << std::endl;
+  }
+}
+
+class RaiseWindowHelper: public QDialog
+{
+public:
+  RaiseWindowHelper( QWidget* parent ) : QDialog( parent, Qt::FramelessWindowHint )
+  {
+    setAttribute( Qt::WA_DeleteOnClose, true );
+    resize( 1, 1 );
+    show();
+    QTimer::singleShot( 100, this, SLOT( close() ) );
+    QTimer::singleShot( 500, parent, SLOT( setFocus() ) );
+  }
+};
+
+class HelpBrowser: public QtxWebBrowser
+{
+public:
+  HelpBrowser() : QtxWebBrowser()
+  {
+    setAttribute( Qt::WA_DeleteOnClose, false );
+  }
+  ~HelpBrowser()
+  {
+    if ( resourceMgr() )
+      resourceMgr()->save();
+  }
+  void about()
+  {
+    QStringList info;
+    QFile f( ":/COPYING" );
+    f.open( QIODevice::ReadOnly );
+    QTextStream in( &f );
+
+    info << QtxWebBrowser::tr( "%1 has been developed using %2" ).arg( QString( "SALOME %1").arg( tr( "Help Browser" ) ) ).arg( "Qt Solutions Component: Single Application." );
+    info << "";
+    info << in.readAll().split( "\n" );
+
+    QMessageBox::about( this, tr( "About %1" ).arg( tr( "Help Browser" ) ),
+                       info.join( "\n" ) );
+  }
+  void load( const QString& url )
+  {
+    QtxWebBrowser::load( url );
+    RaiseWindowHelper* helper = new RaiseWindowHelper( this );
+  }
+};
+
+int main( int argc, char **argv )
+{
+  // set application name (for preferences)
+  
+  QtSingleApplication::setApplicationName( "salome" );
+
+  // specify application identifier via its name
+  QFileInfo fi( argv[0] );
+
+  // create application instance
+
+  QtSingleApplication instance( fi.fileName(), argc, argv );
+
+  // parse command line arguments
+
+  bool showHelp = false;
+  QString language;
+  QString helpfile;
+
+  QRegExp rl( "--language=(.+)" );
+  rl.setMinimal( false );
+
+  for ( int a = 1; a < argc; ++a ) {
+    QString param = argv[a];
+    if ( param == "--help" || param == "-h" )
+      showHelp = true;
+    else if ( rl.exactMatch( param ) )
+      language = rl.cap( 1 );
+    else
+      helpfile = param;
+  }
+
+  // show help and exit if --help or -h option has been specified via command line
+
+  if ( showHelp ) {
+    printHelp();
+    exit( 0 );
+  }
+
+  if ( instance.sendMessage( helpfile ) )
+    return 0;
+
+  // load translations
+
+  QtxTranslator tqt, tsal;
+  if ( !language.isEmpty() ) {
+    if ( tqt.load( QString( "qt_%1" ).arg( language ), QLibraryInfo::location( QLibraryInfo::TranslationsPath ) ) )
+      instance.installTranslator( &tqt );
+
+    QDir appDir = QtSingleApplication::applicationDirPath();
+    appDir.cdUp(); appDir.cdUp(); 
+    
+    if ( tsal.load( QString( "Qtx_msg_%1" ).arg( language ), appDir.filePath( "share/salome/resources/gui" ) ) )
+      instance.installTranslator( &tsal );
+  }
+
+  // initialize resource manager (for preferences)
+
+  QtxResourceMgr* resMgr = new QtxResourceMgr( "HelpBrowser", "%1Config" );
+  resMgr->setCurrentFormat( "xml" );
+  QtxWebBrowser::setResourceMgr( resMgr );
+
+  // show main window
+
+  HelpBrowser browser;
+  browser.show();
+
+  // load file specified via command line
+
+  if ( helpfile.isEmpty() ) {
+    QString docdir = qgetenv( "DOCUMENTATION_ROOT_DIR" );
+    if ( !docdir.isEmpty() )
+      helpfile = QDir::toNativeSeparators( QString( "%1/index.html" ).arg( docdir ) );
+  }
+
+  if ( !helpfile.isEmpty() ) {
+    browser.load( helpfile );
+  }
+
+  // finalize main window activation
+
+  instance.setActivationWindow( &browser );
+  
+  QObject::connect( &instance, SIGNAL( messageReceived( QString ) ),
+                   &browser,  SLOT( load ( QString ) ) );
+
+  return instance.exec();
+}
diff --git a/src/HelpBrowser/HelpBrowser.qrc b/src/HelpBrowser/HelpBrowser.qrc
new file mode 100644 (file)
index 0000000..820e862
--- /dev/null
@@ -0,0 +1,6 @@
+<!DOCTYPE RCC><RCC version="1.0">
+<qresource>
+  <file>COPYING</file>
+</qresource>
+</RCC>
diff --git a/src/HelpBrowser/qtlocalpeer.cpp b/src/HelpBrowser/qtlocalpeer.cpp
new file mode 100644 (file)
index 0000000..332b064
--- /dev/null
@@ -0,0 +1,203 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Solutions component.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+**     of its contributors may be used to endorse or promote products derived
+**     from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "qtlocalpeer.h"
+#include <QCoreApplication>
+#include <QTime>
+
+#if defined(Q_OS_WIN)
+#include <QLibrary>
+#include <qt_windows.h>
+typedef BOOL(WINAPI*PProcessIdToSessionId)(DWORD,DWORD*);
+static PProcessIdToSessionId pProcessIdToSessionId = 0;
+#endif
+#if defined(Q_OS_UNIX)
+#include <sys/types.h>
+#include <time.h>
+#include <unistd.h>
+#endif
+
+namespace QtLP_Private {
+#include "qtlockedfile.cpp"
+#if defined(Q_OS_WIN)
+#include "qtlockedfile_win.cpp"
+#else
+#include "qtlockedfile_unix.cpp"
+#endif
+}
+
+const char* QtLocalPeer::ack = "ack";
+
+QtLocalPeer::QtLocalPeer(QObject* parent, const QString &appId)
+    : QObject(parent), id(appId)
+{
+    QString prefix = id;
+    if (id.isEmpty()) {
+        id = QCoreApplication::applicationFilePath();
+#if defined(Q_OS_WIN)
+        id = id.toLower();
+#endif
+        prefix = id.section(QLatin1Char('/'), -1);
+    }
+    prefix.remove(QRegExp("[^a-zA-Z]"));
+    prefix.truncate(6);
+
+    QByteArray idc = id.toUtf8();
+    quint16 idNum = qChecksum(idc.constData(), idc.size());
+    socketName = QLatin1String("qtsingleapp-") + prefix
+                 + QLatin1Char('-') + QString::number(idNum, 16);
+
+#if defined(Q_OS_WIN)
+    if (!pProcessIdToSessionId) {
+        QLibrary lib("kernel32");
+        pProcessIdToSessionId = (PProcessIdToSessionId)lib.resolve("ProcessIdToSessionId");
+    }
+    if (pProcessIdToSessionId) {
+        DWORD sessionId = 0;
+        pProcessIdToSessionId(GetCurrentProcessId(), &sessionId);
+        socketName += QLatin1Char('-') + QString::number(sessionId, 16);
+    }
+#else
+    socketName += QLatin1Char('-') + QString::number(::getuid(), 16);
+#endif
+
+    server = new QLocalServer(this);
+    QString lockName = QDir(QDir::tempPath()).absolutePath()
+                       + QLatin1Char('/') + socketName
+                       + QLatin1String("-lockfile");
+    lockFile.setFileName(lockName);
+    lockFile.open(QIODevice::ReadWrite);
+}
+
+
+
+bool QtLocalPeer::isClient()
+{
+    if (lockFile.isLocked())
+        return false;
+
+    if (!lockFile.lock(QtLP_Private::QtLockedFile::WriteLock, false))
+        return true;
+
+    bool res = server->listen(socketName);
+#if defined(Q_OS_UNIX) && (QT_VERSION >= QT_VERSION_CHECK(4,5,0))
+    // ### Workaround
+    if (!res && server->serverError() == QAbstractSocket::AddressInUseError) {
+        QFile::remove(QDir::cleanPath(QDir::tempPath())+QLatin1Char('/')+socketName);
+        res = server->listen(socketName);
+    }
+#endif
+    if (!res)
+        qWarning("QtSingleCoreApplication: listen on local socket failed, %s", qPrintable(server->errorString()));
+    QObject::connect(server, SIGNAL(newConnection()), SLOT(receiveConnection()));
+    return false;
+}
+
+
+bool QtLocalPeer::sendMessage(const QString &message, int timeout)
+{
+    if (!isClient())
+        return false;
+
+    QLocalSocket socket;
+    bool connOk = false;
+    for(int i = 0; i < 2; i++) {
+        // Try twice, in case the other instance is just starting up
+        socket.connectToServer(socketName);
+        connOk = socket.waitForConnected(timeout/2);
+        if (connOk || i)
+            break;
+        int ms = 250;
+#if defined(Q_OS_WIN)
+        Sleep(DWORD(ms));
+#else
+        struct timespec ts = { ms / 1000, (ms % 1000) * 1000 * 1000 };
+        nanosleep(&ts, NULL);
+#endif
+    }
+    if (!connOk)
+        return false;
+
+    QByteArray uMsg(message.toUtf8());
+    QDataStream ds(&socket);
+    ds.writeBytes(uMsg.constData(), uMsg.size());
+    bool res = socket.waitForBytesWritten(timeout);
+    if (res) {
+        res &= socket.waitForReadyRead(timeout);   // wait for ack
+        if (res)
+            res &= (socket.read(qstrlen(ack)) == ack);
+    }
+    return res;
+}
+
+
+void QtLocalPeer::receiveConnection()
+{
+    QLocalSocket* socket = server->nextPendingConnection();
+    if (!socket)
+        return;
+
+    while (socket->bytesAvailable() < (int)sizeof(quint32))
+        socket->waitForReadyRead();
+    QDataStream ds(socket);
+    QByteArray uMsg;
+    quint32 remaining;
+    ds >> remaining;
+    uMsg.resize(remaining);
+    int got = 0;
+    char* uMsgBuf = uMsg.data();
+    do {
+        got = ds.readRawData(uMsgBuf, remaining);
+        remaining -= got;
+        uMsgBuf += got;
+    } while (remaining && got >= 0 && socket->waitForReadyRead(2000));
+    if (got < 0) {
+        qWarning("QtLocalPeer: Message reception failed %s", socket->errorString().toLatin1().constData());
+        delete socket;
+        return;
+    }
+    QString message(QString::fromUtf8(uMsg));
+    socket->write(ack, qstrlen(ack));
+    socket->waitForBytesWritten(1000);
+    socket->waitForDisconnected(1000); // make sure client reads ack
+    delete socket;
+    emit messageReceived(message); //### (might take a long time to return)
+}
diff --git a/src/HelpBrowser/qtlocalpeer.h b/src/HelpBrowser/qtlocalpeer.h
new file mode 100644 (file)
index 0000000..1b533b1
--- /dev/null
@@ -0,0 +1,77 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Solutions component.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+**     of its contributors may be used to endorse or promote products derived
+**     from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTLOCALPEER_H
+#define QTLOCALPEER_H
+
+#include <QLocalServer>
+#include <QLocalSocket>
+#include <QDir>
+
+#include "qtlockedfile.h"
+
+class QtLocalPeer : public QObject
+{
+    Q_OBJECT
+
+public:
+    QtLocalPeer(QObject *parent = 0, const QString &appId = QString());
+    bool isClient();
+    bool sendMessage(const QString &message, int timeout);
+    QString applicationId() const
+        { return id; }
+
+Q_SIGNALS:
+    void messageReceived(const QString &message);
+
+protected Q_SLOTS:
+    void receiveConnection();
+
+protected:
+    QString id;
+    QString socketName;
+    QLocalServer* server;
+    QtLP_Private::QtLockedFile lockFile;
+
+private:
+    static const char* ack;
+};
+
+#endif // QTLOCALPEER_H
diff --git a/src/HelpBrowser/qtlockedfile.cpp b/src/HelpBrowser/qtlockedfile.cpp
new file mode 100644 (file)
index 0000000..c142a86
--- /dev/null
@@ -0,0 +1,193 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Solutions component.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+**     of its contributors may be used to endorse or promote products derived
+**     from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qtlockedfile.h"
+
+/*!
+    \class QtLockedFile
+
+    \brief The QtLockedFile class extends QFile with advisory locking
+    functions.
+
+    A file may be locked in read or write mode. Multiple instances of
+    \e QtLockedFile, created in multiple processes running on the same
+    machine, may have a file locked in read mode. Exactly one instance
+    may have it locked in write mode. A read and a write lock cannot
+    exist simultaneously on the same file.
+
+    The file locks are advisory. This means that nothing prevents
+    another process from manipulating a locked file using QFile or
+    file system functions offered by the OS. Serialization is only
+    guaranteed if all processes that access the file use
+    QLockedFile. Also, while holding a lock on a file, a process
+    must not open the same file again (through any API), or locks
+    can be unexpectedly lost.
+
+    The lock provided by an instance of \e QtLockedFile is released
+    whenever the program terminates. This is true even when the
+    program crashes and no destructors are called.
+*/
+
+/*! \enum QtLockedFile::LockMode
+
+    This enum describes the available lock modes.
+
+    \value ReadLock A read lock.
+    \value WriteLock A write lock.
+    \value NoLock Neither a read lock nor a write lock.
+*/
+
+/*!
+    Constructs an unlocked \e QtLockedFile object. This constructor
+    behaves in the same way as \e QFile::QFile().
+
+    \sa QFile::QFile()
+*/
+QtLockedFile::QtLockedFile()
+    : QFile()
+{
+#ifdef Q_OS_WIN
+    wmutex = 0;
+    rmutex = 0;
+#endif
+    m_lock_mode = NoLock;
+}
+
+/*!
+    Constructs an unlocked QtLockedFile object with file \a name. This
+    constructor behaves in the same way as \e QFile::QFile(const
+    QString&).
+
+    \sa QFile::QFile()
+*/
+QtLockedFile::QtLockedFile(const QString &name)
+    : QFile(name)
+{
+#ifdef Q_OS_WIN
+    wmutex = 0;
+    rmutex = 0;
+#endif
+    m_lock_mode = NoLock;
+}
+
+/*!
+  Opens the file in OpenMode \a mode.
+
+  This is identical to QFile::open(), with the one exception that the
+  Truncate mode flag is disallowed. Truncation would conflict with the
+  advisory file locking, since the file would be modified before the
+  write lock is obtained. If truncation is required, use resize(0)
+  after obtaining the write lock.
+
+  Returns true if successful; otherwise false.
+
+  \sa QFile::open(), QFile::resize()
+*/
+bool QtLockedFile::open(OpenMode mode)
+{
+    if (mode & QIODevice::Truncate) {
+        qWarning("QtLockedFile::open(): Truncate mode not allowed.");
+        return false;
+    }
+    return QFile::open(mode);
+}
+
+/*!
+    Returns \e true if this object has a in read or write lock;
+    otherwise returns \e false.
+
+    \sa lockMode()
+*/
+bool QtLockedFile::isLocked() const
+{
+    return m_lock_mode != NoLock;
+}
+
+/*!
+    Returns the type of lock currently held by this object, or \e
+    QtLockedFile::NoLock.
+
+    \sa isLocked()
+*/
+QtLockedFile::LockMode QtLockedFile::lockMode() const
+{
+    return m_lock_mode;
+}
+
+/*!
+    \fn bool QtLockedFile::lock(LockMode mode, bool block = true)
+
+    Obtains a lock of type \a mode. The file must be opened before it
+    can be locked.
+
+    If \a block is true, this function will block until the lock is
+    aquired. If \a block is false, this function returns \e false
+    immediately if the lock cannot be aquired.
+
+    If this object already has a lock of type \a mode, this function
+    returns \e true immediately. If this object has a lock of a
+    different type than \a mode, the lock is first released and then a
+    new lock is obtained.
+
+    This function returns \e true if, after it executes, the file is
+    locked by this object, and \e false otherwise.
+
+    \sa unlock(), isLocked(), lockMode()
+*/
+
+/*!
+    \fn bool QtLockedFile::unlock()
+
+    Releases a lock.
+
+    If the object has no lock, this function returns immediately.
+
+    This function returns \e true if, after it executes, the file is
+    not locked by this object, and \e false otherwise.
+
+    \sa lock(), isLocked(), lockMode()
+*/
+
+/*!
+    \fn QtLockedFile::~QtLockedFile()
+
+    Destroys the \e QtLockedFile object. If any locks were held, they
+    are released.
+*/
diff --git a/src/HelpBrowser/qtlockedfile.h b/src/HelpBrowser/qtlockedfile.h
new file mode 100644 (file)
index 0000000..84c18e5
--- /dev/null
@@ -0,0 +1,97 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Solutions component.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+**     of its contributors may be used to endorse or promote products derived
+**     from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTLOCKEDFILE_H
+#define QTLOCKEDFILE_H
+
+#include <QFile>
+#ifdef Q_OS_WIN
+#include <QVector>
+#endif
+
+#if defined(Q_OS_WIN)
+#  if !defined(QT_QTLOCKEDFILE_EXPORT) && !defined(QT_QTLOCKEDFILE_IMPORT)
+#    define QT_QTLOCKEDFILE_EXPORT
+#  elif defined(QT_QTLOCKEDFILE_IMPORT)
+#    if defined(QT_QTLOCKEDFILE_EXPORT)
+#      undef QT_QTLOCKEDFILE_EXPORT
+#    endif
+#    define QT_QTLOCKEDFILE_EXPORT __declspec(dllimport)
+#  elif defined(QT_QTLOCKEDFILE_EXPORT)
+#    undef QT_QTLOCKEDFILE_EXPORT
+#    define QT_QTLOCKEDFILE_EXPORT __declspec(dllexport)
+#  endif
+#else
+#  define QT_QTLOCKEDFILE_EXPORT
+#endif
+
+namespace QtLP_Private {
+
+class QT_QTLOCKEDFILE_EXPORT QtLockedFile : public QFile
+{
+public:
+    enum LockMode { NoLock = 0, ReadLock, WriteLock };
+
+    QtLockedFile();
+    QtLockedFile(const QString &name);
+    ~QtLockedFile();
+
+    bool open(OpenMode mode);
+
+    bool lock(LockMode mode, bool block = true);
+    bool unlock();
+    bool isLocked() const;
+    LockMode lockMode() const;
+
+private:
+#ifdef Q_OS_WIN
+    Qt::HANDLE wmutex;
+    Qt::HANDLE rmutex;
+    QVector<Qt::HANDLE> rmutexes;
+    QString mutexname;
+
+    Qt::HANDLE getMutexHandle(int idx, bool doCreate);
+    bool waitMutex(Qt::HANDLE mutex, bool doBlock);
+
+#endif
+    LockMode m_lock_mode;
+};
+}
+#endif
diff --git a/src/HelpBrowser/qtlockedfile_unix.cpp b/src/HelpBrowser/qtlockedfile_unix.cpp
new file mode 100644 (file)
index 0000000..976c1b9
--- /dev/null
@@ -0,0 +1,115 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Solutions component.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+**     of its contributors may be used to endorse or promote products derived
+**     from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include <string.h>
+#include <errno.h>
+#include <unistd.h>
+#include <fcntl.h>
+
+#include "qtlockedfile.h"
+
+bool QtLockedFile::lock(LockMode mode, bool block)
+{
+    if (!isOpen()) {
+        qWarning("QtLockedFile::lock(): file is not opened");
+        return false;
+    }
+    if (mode == NoLock)
+        return unlock();
+           
+    if (mode == m_lock_mode)
+        return true;
+
+    if (m_lock_mode != NoLock)
+        unlock();
+
+    struct flock fl;
+    fl.l_whence = SEEK_SET;
+    fl.l_start = 0;
+    fl.l_len = 0;
+    fl.l_type = (mode == ReadLock) ? F_RDLCK : F_WRLCK;
+    int cmd = block ? F_SETLKW : F_SETLK;
+    int ret = fcntl(handle(), cmd, &fl);
+    
+    if (ret == -1) {
+        if (errno != EINTR && errno != EAGAIN)
+            qWarning("QtLockedFile::lock(): fcntl: %s", strerror(errno));
+        return false;
+    }
+
+    
+    m_lock_mode = mode;
+    return true;
+}
+
+
+bool QtLockedFile::unlock()
+{
+    if (!isOpen()) {
+        qWarning("QtLockedFile::unlock(): file is not opened");
+        return false;
+    }
+
+    if (!isLocked())
+        return true;
+
+    struct flock fl;
+    fl.l_whence = SEEK_SET;
+    fl.l_start = 0;
+    fl.l_len = 0;
+    fl.l_type = F_UNLCK;
+    int ret = fcntl(handle(), F_SETLKW, &fl);
+    
+    if (ret == -1) {
+        qWarning("QtLockedFile::lock(): fcntl: %s", strerror(errno));
+        return false;
+    }
+    
+    m_lock_mode = NoLock;
+    return true;
+}
+
+QtLockedFile::~QtLockedFile()
+{
+    if (isOpen())
+        unlock();
+}
+
diff --git a/src/HelpBrowser/qtlockedfile_win.cpp b/src/HelpBrowser/qtlockedfile_win.cpp
new file mode 100644 (file)
index 0000000..049acaf
--- /dev/null
@@ -0,0 +1,211 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Solutions component.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+**     of its contributors may be used to endorse or promote products derived
+**     from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#include "qtlockedfile.h"
+#include <qt_windows.h>
+#include <QFileInfo>
+
+#define MUTEX_PREFIX "QtLockedFile mutex "
+// Maximum number of concurrent read locks. Must not be greater than MAXIMUM_WAIT_OBJECTS
+#define MAX_READERS MAXIMUM_WAIT_OBJECTS
+
+#if QT_VERSION >= 0x050000
+#define QT_WA(unicode, ansi) unicode
+#endif
+
+Qt::HANDLE QtLockedFile::getMutexHandle(int idx, bool doCreate)
+{
+    if (mutexname.isEmpty()) {
+        QFileInfo fi(*this);
+        mutexname = QString::fromLatin1(MUTEX_PREFIX)
+                    + fi.absoluteFilePath().toLower();
+    }
+    QString mname(mutexname);
+    if (idx >= 0)
+        mname += QString::number(idx);
+
+    Qt::HANDLE mutex;
+    if (doCreate) {
+        QT_WA( { mutex = CreateMutexW(NULL, FALSE, (LPCWSTR)mname.utf16()); },
+               { mutex = CreateMutexA(NULL, FALSE, mname.toLocal8Bit().constData()); } );
+        if (!mutex) {
+            qErrnoWarning("QtLockedFile::lock(): CreateMutex failed");
+            return 0;
+        }
+    }
+    else {
+        QT_WA( { mutex = OpenMutexW(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, (LPCWSTR)mname.utf16()); },
+               { mutex = OpenMutexA(SYNCHRONIZE | MUTEX_MODIFY_STATE, FALSE, mname.toLocal8Bit().constData()); } );
+        if (!mutex) {
+            if (GetLastError() != ERROR_FILE_NOT_FOUND)
+                qErrnoWarning("QtLockedFile::lock(): OpenMutex failed");
+            return 0;
+        }
+    }
+    return mutex;
+}
+
+bool QtLockedFile::waitMutex(Qt::HANDLE mutex, bool doBlock)
+{
+    Q_ASSERT(mutex);
+    DWORD res = WaitForSingleObject(mutex, doBlock ? INFINITE : 0);
+    switch (res) {
+    case WAIT_OBJECT_0:
+    case WAIT_ABANDONED:
+        return true;
+        break;
+    case WAIT_TIMEOUT:
+        break;
+    default:
+        qErrnoWarning("QtLockedFile::lock(): WaitForSingleObject failed");
+    }
+    return false;
+}
+
+
+
+bool QtLockedFile::lock(LockMode mode, bool block)
+{
+    if (!isOpen()) {
+        qWarning("QtLockedFile::lock(): file is not opened");
+        return false;
+    }
+
+    if (mode == NoLock)
+        return unlock();
+
+    if (mode == m_lock_mode)
+        return true;
+
+    if (m_lock_mode != NoLock)
+        unlock();
+
+    if (!wmutex && !(wmutex = getMutexHandle(-1, true)))
+        return false;
+
+    if (!waitMutex(wmutex, block))
+        return false;
+
+    if (mode == ReadLock) {
+        int idx = 0;
+        for (; idx < MAX_READERS; idx++) {
+            rmutex = getMutexHandle(idx, false);
+            if (!rmutex || waitMutex(rmutex, false))
+                break;
+            CloseHandle(rmutex);
+        }
+        bool ok = true;
+        if (idx >= MAX_READERS) {
+            qWarning("QtLockedFile::lock(): too many readers");
+            rmutex = 0;
+            ok = false;
+        }
+        else if (!rmutex) {
+            rmutex = getMutexHandle(idx, true);
+            if (!rmutex || !waitMutex(rmutex, false))
+                ok = false;
+        }
+        if (!ok && rmutex) {
+            CloseHandle(rmutex);
+            rmutex = 0;
+        }
+        ReleaseMutex(wmutex);
+        if (!ok)
+            return false;
+    }
+    else {
+        Q_ASSERT(rmutexes.isEmpty());
+        for (int i = 0; i < MAX_READERS; i++) {
+            Qt::HANDLE mutex = getMutexHandle(i, false);
+            if (mutex)
+                rmutexes.append(mutex);
+        }
+        if (rmutexes.size()) {
+            DWORD res = WaitForMultipleObjects(rmutexes.size(), rmutexes.constData(),
+                                               TRUE, block ? INFINITE : 0);
+            if (res != WAIT_OBJECT_0 && res != WAIT_ABANDONED) {
+                if (res != WAIT_TIMEOUT)
+                    qErrnoWarning("QtLockedFile::lock(): WaitForMultipleObjects failed");
+                m_lock_mode = WriteLock;  // trick unlock() to clean up - semiyucky
+                unlock();
+                return false;
+            }
+        }
+    }
+
+    m_lock_mode = mode;
+    return true;
+}
+
+bool QtLockedFile::unlock()
+{
+    if (!isOpen()) {
+        qWarning("QtLockedFile::unlock(): file is not opened");
+        return false;
+    }
+
+    if (!isLocked())
+        return true;
+
+    if (m_lock_mode == ReadLock) {
+        ReleaseMutex(rmutex);
+        CloseHandle(rmutex);
+        rmutex = 0;
+    }
+    else {
+        foreach(Qt::HANDLE mutex, rmutexes) {
+            ReleaseMutex(mutex);
+            CloseHandle(mutex);
+        }
+        rmutexes.clear();
+        ReleaseMutex(wmutex);
+    }
+
+    m_lock_mode = QtLockedFile::NoLock;
+    return true;
+}
+
+QtLockedFile::~QtLockedFile()
+{
+    if (isOpen())
+        unlock();
+    if (wmutex)
+        CloseHandle(wmutex);
+}
diff --git a/src/HelpBrowser/qtsingleapplication.cpp b/src/HelpBrowser/qtsingleapplication.cpp
new file mode 100644 (file)
index 0000000..d0fb15d
--- /dev/null
@@ -0,0 +1,347 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Solutions component.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+**     of its contributors may be used to endorse or promote products derived
+**     from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+
+#include "qtsingleapplication.h"
+#include "qtlocalpeer.h"
+#include <QWidget>
+
+
+/*!
+    \class QtSingleApplication qtsingleapplication.h
+    \brief The QtSingleApplication class provides an API to detect and
+    communicate with running instances of an application.
+
+    This class allows you to create applications where only one
+    instance should be running at a time. I.e., if the user tries to
+    launch another instance, the already running instance will be
+    activated instead. Another usecase is a client-server system,
+    where the first started instance will assume the role of server,
+    and the later instances will act as clients of that server.
+
+    By default, the full path of the executable file is used to
+    determine whether two processes are instances of the same
+    application. You can also provide an explicit identifier string
+    that will be compared instead.
+
+    The application should create the QtSingleApplication object early
+    in the startup phase, and call isRunning() to find out if another
+    instance of this application is already running. If isRunning()
+    returns false, it means that no other instance is running, and
+    this instance has assumed the role as the running instance. In
+    this case, the application should continue with the initialization
+    of the application user interface before entering the event loop
+    with exec(), as normal.
+
+    The messageReceived() signal will be emitted when the running
+    application receives messages from another instance of the same
+    application. When a message is received it might be helpful to the
+    user to raise the application so that it becomes visible. To
+    facilitate this, QtSingleApplication provides the
+    setActivationWindow() function and the activateWindow() slot.
+
+    If isRunning() returns true, another instance is already
+    running. It may be alerted to the fact that another instance has
+    started by using the sendMessage() function. Also data such as
+    startup parameters (e.g. the name of the file the user wanted this
+    new instance to open) can be passed to the running instance with
+    this function. Then, the application should terminate (or enter
+    client mode).
+
+    If isRunning() returns true, but sendMessage() fails, that is an
+    indication that the running instance is frozen.
+
+    Here's an example that shows how to convert an existing
+    application to use QtSingleApplication. It is very simple and does
+    not make use of all QtSingleApplication's functionality (see the
+    examples for that).
+
+    \code
+    // Original
+    int main(int argc, char **argv)
+    {
+        QApplication app(argc, argv);
+
+        MyMainWidget mmw;
+        mmw.show();
+        return app.exec();
+    }
+
+    // Single instance
+    int main(int argc, char **argv)
+    {
+        QtSingleApplication app(argc, argv);
+
+        if (app.isRunning())
+            return !app.sendMessage(someDataString);
+
+        MyMainWidget mmw;
+        app.setActivationWindow(&mmw);
+        mmw.show();
+        return app.exec();
+    }
+    \endcode
+
+    Once this QtSingleApplication instance is destroyed (normally when
+    the process exits or crashes), when the user next attempts to run the
+    application this instance will not, of course, be encountered. The
+    next instance to call isRunning() or sendMessage() will assume the
+    role as the new running instance.
+
+    For console (non-GUI) applications, QtSingleCoreApplication may be
+    used instead of this class, to avoid the dependency on the QtGui
+    library.
+
+    \sa QtSingleCoreApplication
+*/
+
+
+void QtSingleApplication::sysInit(const QString &appId)
+{
+    actWin = 0;
+    peer = new QtLocalPeer(this, appId);
+    connect(peer, SIGNAL(messageReceived(const QString&)), SIGNAL(messageReceived(const QString&)));
+}
+
+
+/*!
+    Creates a QtSingleApplication object. The application identifier
+    will be QCoreApplication::applicationFilePath(). \a argc, \a
+    argv, and \a GUIenabled are passed on to the QAppliation constructor.
+
+    If you are creating a console application (i.e. setting \a
+    GUIenabled to false), you may consider using
+    QtSingleCoreApplication instead.
+*/
+
+QtSingleApplication::QtSingleApplication(int &argc, char **argv, bool GUIenabled)
+    : QApplication(argc, argv, GUIenabled)
+{
+    sysInit();
+}
+
+
+/*!
+    Creates a QtSingleApplication object with the application
+    identifier \a appId. \a argc and \a argv are passed on to the
+    QAppliation constructor.
+*/
+
+QtSingleApplication::QtSingleApplication(const QString &appId, int &argc, char **argv)
+    : QApplication(argc, argv)
+{
+    sysInit(appId);
+}
+
+#if QT_VERSION < 0x050000
+
+/*!
+    Creates a QtSingleApplication object. The application identifier
+    will be QCoreApplication::applicationFilePath(). \a argc, \a
+    argv, and \a type are passed on to the QAppliation constructor.
+*/
+QtSingleApplication::QtSingleApplication(int &argc, char **argv, Type type)
+    : QApplication(argc, argv, type)
+{
+    sysInit();
+}
+
+
+#  if defined(Q_WS_X11)
+/*!
+  Special constructor for X11, ref. the documentation of
+  QApplication's corresponding constructor. The application identifier
+  will be QCoreApplication::applicationFilePath(). \a dpy, \a visual,
+  and \a cmap are passed on to the QApplication constructor.
+*/
+QtSingleApplication::QtSingleApplication(Display* dpy, Qt::HANDLE visual, Qt::HANDLE cmap)
+    : QApplication(dpy, visual, cmap)
+{
+    sysInit();
+}
+
+/*!
+  Special constructor for X11, ref. the documentation of
+  QApplication's corresponding constructor. The application identifier
+  will be QCoreApplication::applicationFilePath(). \a dpy, \a argc, \a
+  argv, \a visual, and \a cmap are passed on to the QApplication
+  constructor.
+*/
+QtSingleApplication::QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual, Qt::HANDLE cmap)
+    : QApplication(dpy, argc, argv, visual, cmap)
+{
+    sysInit();
+}
+
+/*!
+  Special constructor for X11, ref. the documentation of
+  QApplication's corresponding constructor. The application identifier
+  will be \a appId. \a dpy, \a argc, \a
+  argv, \a visual, and \a cmap are passed on to the QApplication
+  constructor.
+*/
+QtSingleApplication::QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual, Qt::HANDLE cmap)
+    : QApplication(dpy, argc, argv, visual, cmap)
+{
+    sysInit(appId);
+}
+#  endif // Q_WS_X11
+#endif // QT_VERSION < 0x050000
+
+
+/*!
+    Returns true if another instance of this application is running;
+    otherwise false.
+
+    This function does not find instances of this application that are
+    being run by a different user (on Windows: that are running in
+    another session).
+
+    \sa sendMessage()
+*/
+
+bool QtSingleApplication::isRunning()
+{
+    return peer->isClient();
+}
+
+
+/*!
+    Tries to send the text \a message to the currently running
+    instance. The QtSingleApplication object in the running instance
+    will emit the messageReceived() signal when it receives the
+    message.
+
+    This function returns true if the message has been sent to, and
+    processed by, the current instance. If there is no instance
+    currently running, or if the running instance fails to process the
+    message within \a timeout milliseconds, this function return false.
+
+    \sa isRunning(), messageReceived()
+*/
+bool QtSingleApplication::sendMessage(const QString &message, int timeout)
+{
+    return peer->sendMessage(message, timeout);
+}
+
+
+/*!
+    Returns the application identifier. Two processes with the same
+    identifier will be regarded as instances of the same application.
+*/
+QString QtSingleApplication::id() const
+{
+    return peer->applicationId();
+}
+
+
+/*!
+  Sets the activation window of this application to \a aw. The
+  activation window is the widget that will be activated by
+  activateWindow(). This is typically the application's main window.
+
+  If \a activateOnMessage is true (the default), the window will be
+  activated automatically every time a message is received, just prior
+  to the messageReceived() signal being emitted.
+
+  \sa activateWindow(), messageReceived()
+*/
+
+void QtSingleApplication::setActivationWindow(QWidget* aw, bool activateOnMessage)
+{
+    actWin = aw;
+    if (activateOnMessage)
+        connect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow()));
+    else
+        disconnect(peer, SIGNAL(messageReceived(const QString&)), this, SLOT(activateWindow()));
+}
+
+
+/*!
+    Returns the applications activation window if one has been set by
+    calling setActivationWindow(), otherwise returns 0.
+
+    \sa setActivationWindow()
+*/
+QWidget* QtSingleApplication::activationWindow() const
+{
+    return actWin;
+}
+
+
+/*!
+  De-minimizes, raises, and activates this application's activation window.
+  This function does nothing if no activation window has been set.
+
+  This is a convenience function to show the user that this
+  application instance has been activated when he has tried to start
+  another instance.
+
+  This function should typically be called in response to the
+  messageReceived() signal. By default, that will happen
+  automatically, if an activation window has been set.
+
+  \sa setActivationWindow(), messageReceived(), initialize()
+*/
+void QtSingleApplication::activateWindow()
+{
+    if (actWin) {
+        actWin->setWindowState(actWin->windowState() & ~Qt::WindowMinimized);
+        actWin->raise();
+        actWin->activateWindow();
+    }
+}
+
+
+/*!
+    \fn void QtSingleApplication::messageReceived(const QString& message)
+
+    This signal is emitted when the current instance receives a \a
+    message from another instance of this application.
+
+    \sa sendMessage(), setActivationWindow(), activateWindow()
+*/
+
+
+/*!
+    \fn void QtSingleApplication::initialize(bool dummy = true)
+
+    \obsolete
+*/
diff --git a/src/HelpBrowser/qtsingleapplication.h b/src/HelpBrowser/qtsingleapplication.h
new file mode 100644 (file)
index 0000000..049406f
--- /dev/null
@@ -0,0 +1,105 @@
+/****************************************************************************
+**
+** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies).
+** Contact: http://www.qt-project.org/legal
+**
+** This file is part of the Qt Solutions component.
+**
+** $QT_BEGIN_LICENSE:BSD$
+** You may use this file under the terms of the BSD license as follows:
+**
+** "Redistribution and use in source and binary forms, with or without
+** modification, are permitted provided that the following conditions are
+** met:
+**   * Redistributions of source code must retain the above copyright
+**     notice, this list of conditions and the following disclaimer.
+**   * Redistributions in binary form must reproduce the above copyright
+**     notice, this list of conditions and the following disclaimer in
+**     the documentation and/or other materials provided with the
+**     distribution.
+**   * Neither the name of Digia Plc and its Subsidiary(-ies) nor the names
+**     of its contributors may be used to endorse or promote products derived
+**     from this software without specific prior written permission.
+**
+**
+** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
+**
+** $QT_END_LICENSE$
+**
+****************************************************************************/
+
+#ifndef QTSINGLEAPPLICATION_H
+#define QTSINGLEAPPLICATION_H
+
+#include <QApplication>
+
+class QtLocalPeer;
+
+#if defined(Q_OS_WIN)
+#  if !defined(QT_QTSINGLEAPPLICATION_EXPORT) && !defined(QT_QTSINGLEAPPLICATION_IMPORT)
+#    define QT_QTSINGLEAPPLICATION_EXPORT
+#  elif defined(QT_QTSINGLEAPPLICATION_IMPORT)
+#    if defined(QT_QTSINGLEAPPLICATION_EXPORT)
+#      undef QT_QTSINGLEAPPLICATION_EXPORT
+#    endif
+#    define QT_QTSINGLEAPPLICATION_EXPORT __declspec(dllimport)
+#  elif defined(QT_QTSINGLEAPPLICATION_EXPORT)
+#    undef QT_QTSINGLEAPPLICATION_EXPORT
+#    define QT_QTSINGLEAPPLICATION_EXPORT __declspec(dllexport)
+#  endif
+#else
+#  define QT_QTSINGLEAPPLICATION_EXPORT
+#endif
+
+class QT_QTSINGLEAPPLICATION_EXPORT QtSingleApplication : public QApplication
+{
+    Q_OBJECT
+
+public:
+    QtSingleApplication(int &argc, char **argv, bool GUIenabled = true);
+    QtSingleApplication(const QString &id, int &argc, char **argv);
+#if QT_VERSION < 0x050000
+    QtSingleApplication(int &argc, char **argv, Type type);
+#  if defined(Q_WS_X11)
+    QtSingleApplication(Display* dpy, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
+    QtSingleApplication(Display *dpy, int &argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE cmap= 0);
+    QtSingleApplication(Display* dpy, const QString &appId, int argc, char **argv, Qt::HANDLE visual = 0, Qt::HANDLE colormap = 0);
+#  endif // Q_WS_X11
+#endif // QT_VERSION < 0x050000
+
+    bool isRunning();
+    QString id() const;
+
+    void setActivationWindow(QWidget* aw, bool activateOnMessage = true);
+    QWidget* activationWindow() const;
+
+    // Obsolete:
+    void initialize(bool dummy = true)
+        { isRunning(); Q_UNUSED(dummy) }
+
+public Q_SLOTS:
+    bool sendMessage(const QString &message, int timeout = 5000);
+    void activateWindow();
+
+
+Q_SIGNALS:
+    void messageReceived(const QString &message);
+
+
+private:
+    void sysInit(const QString &appId = QString());
+    QtLocalPeer *peer;
+    QWidget *actWin;
+};
+
+#endif // QTSINGLEAPPLICATION_H
index 2640effb99ec3c32e32fc75c8a33035a1a0491ee..e4dd2537ab0fddc8b716f8889adba39539104de8 100644 (file)
@@ -93,7 +93,6 @@
 #include <QtxSearchTool.h>
 #include <QtxWorkstack.h>
 #include <QtxMap.h>
-#include <QtxWebBrowser.h>
 
 #include <LogWindow.h>
 
@@ -311,19 +310,6 @@ LightApp_Application::LightApp_Application()
   SUIT_ResourceMgr* aResMgr = SUIT_Session::session()->resourceMgr();
   QPixmap aLogo = aResMgr->loadPixmap( "LightApp", tr( "APP_DEFAULT_ICO" ), false );
 
-  QtxWebBrowser::setResourceManager( aResMgr );
-  QtxWebBrowser::setData("browser:icon",          aResMgr->loadPixmap( "LightApp", tr( "BROWSER_ICON" ) ) );
-  QtxWebBrowser::setData("browser:title",         tr( "BROWSER_TITLE" ) );
-  QtxWebBrowser::setData("toolbar:title",         tr( "BROWSER_TOOLBAR_TITLE" ) );
-  QtxWebBrowser::setData("menu:file:title",       tr( "BROWSER_FILEMENU" ) );
-  QtxWebBrowser::setData("action:close:title",    tr( "BROWSER_CLOSE" ) );
-  QtxWebBrowser::setData("action:close:icon",     aResMgr->loadPixmap( "LightApp", tr( "BROWSER_CLOSE_ICON" ) ) );
-  QtxWebBrowser::setData("action:back:title",     tr( "BROWSER_BACK" ) );
-  QtxWebBrowser::setData("action:forward:title",  tr( "BROWSER_FORWARD" ) );
-  QtxWebBrowser::setData("action:find:title",     tr( "BROWSER_FIND" ) );
-  QtxWebBrowser::setData("action:findnext:title", tr( "BROWSER_FINDNEXT" ) );
-  QtxWebBrowser::setData("action:findprev:title", tr( "BROWSER_FINDPREV" ) );
-
   desktop()->setWindowIcon( aLogo );
   desktop()->setDockableMenuBar( false );
   desktop()->setDockableStatusBar( false );
@@ -429,6 +415,7 @@ void LightApp_Application::start()
 
   updateWindows();
   updateViewManagers();
+  updateCommandsStatus();
 
   putInfo( "" );
   desktop()->statusBar()->showMessage( "" );
@@ -768,7 +755,8 @@ void LightApp_Application::createActions()
   createMenu( StyleId, viewMenu, 20, -1 );
   createMenu( FullScreenId, viewMenu, 20, -1 );
 
-  int modTBar = createTool( tr( "INF_TOOLBAR_MODULES" ) );
+  int modTBar = createTool( tr( "INF_TOOLBAR_MODULES" ),    // title (language-dependant)
+                           QString( "SalomeModules" ) );   // name (language-independant)
   createTool( ModulesListId, modTBar );
 }
 
@@ -873,16 +861,14 @@ void LightApp_Application::onNewWindow()
 */
 void LightApp_Application::onNewDoc()
 {
-  //asl: fix for 0020515
-  if ( activeStudy() ) {
-    saveDockWindowsState();
-  }
-  
 #ifdef SINGLE_DESKTOP
   if ( !checkExistingDoc() )
     return;
 #endif
 
+  //asl: fix for 0020515
+  saveDockWindowsState();
+  
   CAM_Application::onNewDoc();
 }
 
@@ -892,7 +878,6 @@ void LightApp_Application::onNewDoc()
 void LightApp_Application::onOpenDoc()
 {
   SUIT_Study* study = activeStudy();
-  saveDockWindowsState();
   
 #ifdef SINGLE_DESKTOP
   if ( !checkExistingDoc() )
@@ -918,6 +903,9 @@ bool LightApp_Application::onOpenDoc( const QString& aName )
   if ( !checkExistingDoc() )
     return false;
 #endif
+
+  saveDockWindowsState();
+
   // We should take mru action first because this application instance can be deleted later.
   QtxMRUAction* mru = ::qobject_cast<QtxMRUAction*>( action( MRUId ) );
   
@@ -1096,13 +1084,10 @@ void LightApp_Application::onHelpContentsModule()
     }
   }
   else {
-#ifdef WIN32
-    // On Win32 platform QWebKit of the Qt 4.6.3 hang up in case 'file://' protocol 
-    // is defined. On Linux platform QWebKit doesn't work correctly without 'file://' protocol.
-    QtxWebBrowser::loadUrl(helpFile);
-#else
-    QtxWebBrowser::loadUrl(QString("file://%1").arg(helpFile));
-#endif
+    QStringList parameters;
+    parameters << QString( "--language=%1" ).arg( resMgr->stringValue( "language", "language" ) );
+    parameters << helpFile;
+    QProcess::startDetached( "HelpBrowser", parameters );
   }
 }
 
@@ -1169,14 +1154,10 @@ void LightApp_Application::onHelpContextModule( const QString& theComponentName,
     }
   }
   else {
-#ifdef WIN32
-    // On Win32 platform QWebKit of the Qt 4.6.3 hang up in case 'file://' protocol 
-    // is defined. On Linux platform QWebKit doesn't work correctly without 'file://' protocol.
-    QtxWebBrowser::loadUrl(helpFile, context);
-#else
-    QtxWebBrowser::loadUrl(QString("file://%1").arg(helpFile), context);
-#endif
-    
+    QStringList parameters;
+    parameters << QString( "--language=%1" ).arg( resMgr->stringValue( "language", "language" ) );
+    parameters << QString( "%1#%2" ).arg( helpFile ).arg( context );
+    QProcess::startDetached( "HelpBrowser", parameters );
   }
 }
 
@@ -1193,74 +1174,6 @@ void LightApp_Application::onSelectionChanged()
   action( EditPasteId )->setEnabled(canPaste);
 }
 
-/*!
-  Adds window to application.
-  \param wid - QWidget
-  \param flag - key for window
-  \param studyId - study id
-  Flag used how identificator of window in windows list.
-*/
-/*
-void LightApp_Application::addWindow( QWidget* wid, const int flag, const int studyId )
-{
-  if ( !wid )
-    return;
-
-  int sId = studyId;
-  if ( sId < 0 )
-  {
-    if ( !activeStudy() )
-      return;
-    else
-      sId = activeStudy()->id();
-  }
-
-  if ( !myWindows.contains( flag ) )
-  {
-    QMap<int, int> winMap;
-    currentWindows( winMap );
-
-    LightApp_WidgetContainer* newWC = new LightApp_WidgetContainer( flag, desktop() );
-    connect( newWC, SIGNAL(  destroyed ( QObject* ) ), this, SLOT( onWCDestroyed( QObject* ) ) );
-    // asv: connecting a slot for storing visibility flag of a window
-    connect( newWC, SIGNAL( visibilityChanged ( bool ) ), SLOT( onVisibilityChanged( bool ) ) );
-    myWindows.insert( flag, newWC );
-    if ( winMap.contains( flag ) ) {
-      //desktop()->removeDockWidget( myWindows[flag] );
-      desktop()->addDockWidget( (Qt::DockWidgetArea)winMap[flag], myWindows[flag] );
-    }
-
-    //myWindows[flag]->setResizeEnabled( true );
-    myWindows[flag]->setFeatures( QDockWidget::AllDockWidgetFeatures );
-    myWindows[flag]->setObjectName( QString( "dock_window_%1" ).arg( flag ) );
-    //myWindows[flag]->setFixedExtentWidth( wid->width() );
-    //myWindows[flag]->setFixedExtentHeight( wid->height() );
-    myWindows[flag]->resize( wid->width(), wid->height() );
-  }
-
-  QFont f;
-#ifndef DISABLE_PYCONSOLE
-  if( wid->inherits( "PyConsole_Console" ) )
-  {
-    if( resourceMgr()->hasValue( "PyConsole", "font" ) )
-      f = resourceMgr()->fontValue( "PyConsole", "font" );
-    else
-      {
-        f = ( ( PyConsole_Console* )wid )->font();
-        resourceMgr()->setValue( "PyConsole", "font", f );
-      }
-  }
-  else
-#endif
-    f = wid->font();
-
-  myWindows[flag]->insert( sId, wid );
-  wid->setFont( f );
-
-  setWindowShown( flag, !myWindows[flag]->isEmpty() );
-}
-*/
-
 QWidget* LightApp_Application::dockWindow( const int id ) const
 {
   QWidget* wid = 0;
@@ -1298,7 +1211,8 @@ void LightApp_Application::insertDockWindow( const int id, QWidget* wid )
   connect( dock, SIGNAL(  destroyed( QObject* ) ), this, SLOT( onWCDestroyed( QObject* ) ) );
 
   dock->setFeatures( QDockWidget::AllDockWidgetFeatures );
-  dock->setObjectName( QString( "window_%1" ).arg( id ) );
+  dock->setObjectName( wid->objectName().isEmpty() ? QString( "window_%1" ).arg( id ) : 
+                      QString( "%1Dock" ).arg( wid->objectName() ) );
   dock->setWidget( wid );
 
   QKeySequence accel = wid->property( "shortcut" ).value<QKeySequence>();
@@ -1617,6 +1531,31 @@ SUIT_ViewManager* LightApp_Application::createViewManager( const QString& vmType
   return vm;
 }
 
+SUIT_ViewManager* LightApp_Application::createViewManager( SUIT_ViewModel* theModel )
+{
+  SUIT_ResourceMgr* resMgr = resourceMgr();
+
+  SUIT_ViewManager* vm = new SUIT_ViewManager( activeStudy(),
+                                               desktop(),
+                                               theModel );
+
+  QString vmType = vm->getType();
+
+  vm->setTitle( QString( "%1: %M - viewer %V" ).arg( vmType ) );
+
+  addViewManager( vm );
+  SUIT_ViewWindow* vw = vm->createViewWindow();
+  if ( vw && desktop() ) {
+    vw->resize( (int)( desktop()->width() * 0.6 ), (int)( desktop()->height() * 0.6 ) );
+    vw->setDropDownButtons( resMgr->booleanValue( "viewers", "drop_down_buttons", true ) );
+  }
+
+  if ( !vmType.isEmpty() && !myUserWmTypes.contains( vmType ) )
+    myUserWmTypes << vmType;
+
+  return vm;
+}
+
 /*!
   SLOT: Removes view manager from application
 */
@@ -1649,6 +1588,11 @@ void LightApp_Application::onStudyCreated( SUIT_Study* theStudy )
 
   if ( objectBrowser() )
     objectBrowser()->openLevels();
+
+#ifndef DISABLE_PYCONSOLE
+  if( pythonConsole() )
+    pythonConsole()->getInterp()->initStudy();
+#endif
 }
 
 /*!
@@ -1676,6 +1620,11 @@ void LightApp_Application::onStudyOpened( SUIT_Study* theStudy )
   if ( objectBrowser() )
     objectBrowser()->openLevels();
 
+#ifndef DISABLE_PYCONSOLE
+  if( pythonConsole() )
+    pythonConsole()->getInterp()->initStudy();
+#endif
+
   emit studyOpened();
 }
 
@@ -1854,6 +1803,8 @@ void LightApp_Application::onPreferenceChanged( QString& modName, QString& secti
 /*!Remove all windows from study.*/
 void LightApp_Application::beforeCloseDoc( SUIT_Study* s )
 {
+  saveDockWindowsState();
+
   if ( SUIT_DataBrowser* ob = objectBrowser() )
     ob->setModel(0);
 
@@ -1897,6 +1848,7 @@ QWidget* LightApp_Application::createWindow( const int flag )
   if ( flag == WT_ObjectBrowser )
   {
     SUIT_DataBrowser* ob = new SUIT_DataBrowser( new LightApp_DataObject(), desktop() );
+    ob->setObjectName( "objectBrowser" );
     ob->setSortMenuEnabled( true );
     ob->setAutoUpdate( true );
     if ( resMgr->hasValue( "ObjectBrowser", "auto_hide_search_tool" ) )
@@ -1940,6 +1892,7 @@ QWidget* LightApp_Application::createWindow( const int flag )
   else  if ( flag == WT_PyConsole )
   {
     PyConsole_Console* pyCons = new PyConsole_EnhConsole( desktop(),new LightApp_PyInterp());
+    pyCons->setObjectName( "pythonConsole" );
     pyCons->setWindowTitle( tr( "PYTHON_CONSOLE" ) );
     pyCons->setFont(resourceMgr()->fontValue( "PyConsole", "font" ));
     pyCons->setIsShowBanner(resourceMgr()->booleanValue( "PyConsole", "show_banner", true ));
@@ -1952,6 +1905,7 @@ QWidget* LightApp_Application::createWindow( const int flag )
   else if ( flag == WT_LogWindow )
   {
     LogWindow* logWin = new LogWindow( desktop() );
+    logWin->setObjectName( "logWindow" );
     logWin->setWindowTitle( tr( "LOG_WINDOW" ) );
     logWin->setProperty( "shortcut", QKeySequence( "Alt+Shift+L" ) );
     wid = logWin;
@@ -1966,11 +1920,13 @@ QWidget* LightApp_Application::createWindow( const int flag )
  */
 void LightApp_Application::defaultWindows( QMap<int, int>& aMap ) const
 {
-  aMap.insert( WT_ObjectBrowser, Qt::LeftDockWidgetArea );
 #ifndef DISABLE_PYCONSOLE
   aMap.insert( WT_PyConsole, Qt::BottomDockWidgetArea );
 #endif
-  //  aMap.insert( WT_LogWindow, Qt::DockBottom );
+  if ( activeStudy() ) {
+    aMap.insert( WT_ObjectBrowser, Qt::LeftDockWidgetArea );
+    //  aMap.insert( WT_LogWindow, Qt::DockBottom );
+  }
 }
 
 /*!Default view managers*/
@@ -2211,16 +2167,14 @@ void LightApp_Application::createPreferences( LightApp_Preferences* pref )
   pref->setItemProperty( "strings", aValuesList,   vtkStyleMode );
   pref->setItemProperty( "indexes", anIndicesList, vtkStyleMode );
   // ... -> zooming mode
-  #if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
-    int occZoomingStyleMode = pref->addPreference( tr( "PREF_ZOOMING" ), Viewer3DGroup,
-                                                   LightApp_Preferences::Selector, "3DViewer", "zooming_mode" );
-    aValuesList.clear();
-    anIndicesList.clear();
-    aValuesList   << tr("PREF_ZOOMING_AT_CENTER") << tr("PREF_ZOOMING_AT_CURSOR");
-    anIndicesList << 0                            << 1;
-    pref->setItemProperty( "strings", aValuesList,   occZoomingStyleMode );
-    pref->setItemProperty( "indexes", anIndicesList, occZoomingStyleMode );
-  #endif
+  int occZoomingStyleMode = pref->addPreference( tr( "PREF_ZOOMING" ), Viewer3DGroup,
+                                                 LightApp_Preferences::Selector, "3DViewer", "zooming_mode" );
+  aValuesList.clear();
+  anIndicesList.clear();
+  aValuesList   << tr("PREF_ZOOMING_AT_CENTER") << tr("PREF_ZOOMING_AT_CURSOR");
+  anIndicesList << 0                            << 1;
+  pref->setItemProperty( "strings", aValuesList,   occZoomingStyleMode );
+  pref->setItemProperty( "indexes", anIndicesList, occZoomingStyleMode );
   // ... "Trihedron" group <<start>>
   int occTriGroup = pref->addPreference( tr( "PREF_TRIHEDRON" ), Viewer3DGroup );
   pref->setItemProperty( "columns", 2, occTriGroup );
@@ -3010,13 +2964,6 @@ void LightApp_Application::preferencesChanged( const QString& sec, const QString
       dynamic_cast<STD_TabDesktop*>( desktop() )->workstack()->setOpaqueResize( opaqueResize );
   }
 
-  if ( sec == "ExternalBrowser" && param == "use_external_browser" ) {
-    if ( resMgr->booleanValue("ExternalBrowser", "use_external_browser", false ) )
-    {
-      QtxWebBrowser::shutdown();
-    }
-  }
-
 #ifndef DISABLE_PLOT2DVIEWER
   QList<SUIT_ViewManager*> lst;
   viewManagers( Plot2d_Viewer::Type(), lst );
@@ -3113,6 +3060,12 @@ void LightApp_Application::savePreferences()
   if ( desktop() )
     aResMgr->setValue( "desktop", "geometry", desktop()->storeGeometry() );
 
+#if GUI_DEVELOPMENT > 0
+  aResMgr->setValue( "salome", "version", QString(GUI_VERSION_STR)+"dev" );
+#else
+  aResMgr->setValue( "salome", "version", QString(GUI_VERSION_STR) );
+#endif
+
   aResMgr->save();
 }
 
@@ -3229,9 +3182,6 @@ void LightApp_Application::removeModuleAction( const QString& modName )
 void LightApp_Application::currentWindows( QMap<int, int>& winMap ) const
 {
   winMap.clear();
-  if ( !activeStudy() )
-    return;
-
   if ( activeModule() && activeModule()->inherits( "LightApp_Module" ) )
     ((LightApp_Module*)activeModule())->windows( winMap );
   else
@@ -3262,28 +3212,22 @@ void LightApp_Application::updateWindows()
   QMap<int, int> winMap;
   currentWindows( winMap );
 
-  if ( activeStudy() )
+  for ( QMap<int, int>::ConstIterator it = winMap.begin(); it != winMap.end(); ++it )
   {
-    for ( QMap<int, int>::ConstIterator it = winMap.begin(); it != winMap.end(); ++it )
-    {
-      if ( !dockWindow( it.key() ) )
-        getWindow( it.key() );
-    }
+    if ( !dockWindow( it.key() ) )
+      getWindow( it.key() );
   }
 
   for ( WinMap::ConstIterator it = myWin.begin(); it != myWin.end(); ++it )
   {
     QWidget* wid = it.value();
-    if ( activeStudy() )
-      wid->setVisible( winMap.contains( it.key() ) );
+    if ( winMap.contains( it.key() ) )
+      wid->setVisible( true );
     else
       delete wid;
   }
 
-  if ( activeStudy() )
-    loadDockWindowsState();
-  else
-    myWin.clear();
+  loadDockWindowsState();
 }
 
 /*!
@@ -3312,13 +3256,15 @@ void LightApp_Application::loadDockWindowsState()
   QString modName;
   if ( activeModule() )
     modName = activeModule()->name();
+  else if ( activeStudy() )
+    modName = "nomodule";
 
   QtxResourceMgr::WorkingMode prevMode = aResMgr->workingMode();
-  aResMgr->setWorkingMode(QtxResourceMgr::IgnoreUserValues);
+  aResMgr->setWorkingMode( QtxResourceMgr::IgnoreUserValues );
   QByteArray aDefaultState;
-  aResMgr->value("windows_geometry", modName , aDefaultState );
+  aResMgr->value( "windows_geometry", modName, aDefaultState );
   QByteArray aDefaultVisibility;
-  aResMgr->value("windows_visibility", modName , aDefaultVisibility );
+  aResMgr->value( "windows_visibility", modName, aDefaultVisibility );
   bool hasDefaultVisibility = !aDefaultVisibility.isEmpty();
   aResMgr->setWorkingMode(prevMode);
   
@@ -3326,12 +3272,20 @@ void LightApp_Application::loadDockWindowsState()
     return;
 
   if ( aResMgr->hasValue("windows_geometry" ,modName ) ) {
+    long version = Qtx::versionToId( aResMgr->stringValue( "windows_geometry_version", modName, "" ) );
     QByteArray arr;
-    aResMgr->value("windows_geometry", modName , arr );
+    if ( version > Qtx::versionToId( "7.4.1" ) )
+      aResMgr->value( "windows_geometry", modName , arr );
+    else
+      arr = aDefaultState;
     QByteArray aTargetArray = processState(arr, storeWin, storeTb, true, aDefaultState);
     desktop()->restoreState( aTargetArray );
   }
 
+  QStringList mainToolbarsNames;
+  mainToolbarsNames << "SalomeStandard" << "SalomeModules";
+  QList<QToolBar*> mainToolbars = findToolBars( mainToolbarsNames );
+  foreach( QToolBar* tb, mainToolbars ) tb->setVisible( true );
   /*
   if ( !myWinVis.contains( modName ) && aDefaultVisibility.isEmpty())
     return;
@@ -3409,9 +3363,17 @@ void LightApp_Application::saveDockWindowsState()
   QString modName;
   if ( activeModule() )
     modName = activeModule()->name();
+  else if ( activeStudy() )
+    modName = "nomodule";
+
+  QString versionId = GUI_VERSION_STR;
+#if GUI_DEVELOPMENT > 0
+  versionId += "dev";
+#endif
 
   QByteArray arr = desktop()->saveState();
   resourceMgr()->setValue( "windows_geometry", modName, processState(arr, storeWin, storeTb, false) );
+  resourceMgr()->setValue( "windows_geometry_version", modName, versionId );
 
   QByteArray visArr;
   if ( myWinVis.contains( modName ) )
@@ -4198,7 +4160,8 @@ void LightApp_Application::onDesktopMessage( const QString& message )
   Returns all top level toolbars.
   Note : Result list contains only main window toolbars, not including toolbars from viewers.
 */
-QList<QToolBar*> LightApp_Application::findToolBars() {
+QList<QToolBar*> LightApp_Application::findToolBars( const QStringList& names )
+{
   QList<QToolBar*> aResult;
   QList<QToolBar*> tbList = qFindChildren<QToolBar*>( desktop() );
   for ( QList<QToolBar*>::iterator tit = tbList.begin(); tit != tbList.end(); ++tit ) {
@@ -4206,7 +4169,8 @@ QList<QToolBar*> LightApp_Application::findToolBars() {
     QObject* po = Qtx::findParent( tb, "QMainWindow" );
     if ( po != desktop() )
       continue;        
-    aResult.append(tb);
+    if ( names.isEmpty() || names.contains( tb->objectName() ) )
+      aResult.append(tb);
   }
   return aResult;
 }
@@ -4250,9 +4214,9 @@ QByteArray LightApp_Application::processState(QByteArray& input,
     }
 
     int toolBarMarkerIndex = getToolbarMarkerIndex(input,aNames);
-    QDataStream anInputData(&input, QIODevice::ReadOnly);
     if(toolBarMarkerIndex < 0)
       return aRes;
+    QDataStream anInputData(&input, QIODevice::ReadOnly);
 
     int toolBarMarkerIndexDef;
     if(hasDefaultState) {
@@ -4427,7 +4391,34 @@ void LightApp_Application::onViewManagerRemoved( SUIT_ViewManager* )
 /*!
   Check existing document.
 */
-bool LightApp_Application::checkExistingDoc() {
-  return true;
+bool LightApp_Application::checkExistingDoc()
+{
+  bool result = true;
+  if( activeStudy() ) {
+    int answer = SUIT_MessageBox::question( desktop(), 
+                                           tr( "APPCLOSE_CAPTION" ), 
+                                           tr( "STUDYCLOSE_DESCRIPTION" ),
+                                           tr( "APPCLOSE_SAVE" ), 
+                                           tr( "APPCLOSE_CLOSE" ),
+                                           tr( "APPCLOSE_CANCEL" ), 0 );
+    if(answer == 0) {
+      if ( activeStudy()->isSaved() ) {
+       onSaveDoc();
+       closeDoc( false );
+      } else if ( onSaveAsDoc() ) {
+       if( !closeDoc( false ) ) {
+         result = false;
+       }
+      } else {
+       result = false;
+      }        
+    }
+    else if( answer == 1 ) {
+      closeDoc( false );
+    } else if( answer == 2 ) {
+      result = false;
+    }
+  }
+  return result;
 }
 
index 93b325c8a7e60d20989efbe6fedf476b371128bb..3e43869f4defdd53be0815de85ba0b128d06cb3a 100644 (file)
@@ -132,6 +132,7 @@ public:
   virtual void                        removeViewManager( SUIT_ViewManager* );
   virtual SUIT_ViewManager*           createViewManager( const QString& vmType );
   virtual SUIT_ViewManager*           createViewManager( const QString& vmType, QWidget* w );
+  virtual SUIT_ViewManager*           createViewManager( SUIT_ViewModel* );
 
   QWidget*                            getWindow( const int, const int = -1 );
   QWidget*                            dockWindow( const int ) const;
@@ -296,7 +297,7 @@ protected:
 
 private:
   void                                emptyPreferences( const QString& );
-  QList<QToolBar*>                    findToolBars();
+  QList<QToolBar*>                    findToolBars( const QStringList& names = QStringList() );
   
   QByteArray                          processState(QByteArray& input, 
                                                   const bool processWin,
index 4588f9ae979190009f22608fb6714c7920bcdc0c..9fcf985aa30c6bb4a62ac9b397da99ce8948a7c8 100644 (file)
     <parameter name="Developer resources"  value="${DOCUMENTATION_ROOT_DIR}/index.html" />
   </section>
  <section name="windows_geometry">
-  <parameter value="#00 #00 #00 #FF #00 #00 #00 #00 #FD #00 #00 #00 #02 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #02 #88 #FC #02 #00 #00 #00 #01 #FC #00 #00 #00 #37 #00 #00 #02 #88 #00 #00 #00 #97 #01 #00 #00 #14 #FA #00 #00 #00 #00 #01 #00 #00 #00 #02 #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #30 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #46 #00 #FF #FF #FF #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #33 #01 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #00 #C0 #00 #FF #FF #FF #00 #00 #00 #03 #00 #00 #05 #40 #00 #00 #00 #53 #FC #01 #00 #00 #00 #01 #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #01 #00 #00 #00 #00 #00 #00 #05 #40 #00 #00 #00 #46 #00 #FF #FF #FF #00 #00 #04 #38 #00 #00 #02 #88 #00 #00 #00 #04 #00 #00 #00 #04 #00 #00 #00 #08 #00 #00 #00 #08 #FC #00 #00 #00 #01 #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #CE #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00" name=""/>
+  <parameter name="nomodule" value="#00 #00 #00 #FF #00 #00 #00 #00 #FD #00 #00 #00 #02 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #02 #8D #FC #02 #00 #00 #00 #01 #FB #00 #00 #00 #22 #00 #6F #00 #62 #00 #6A #00 #65 #00 #63 #00 #74 #00 #42 #00 #72 #00 #6F #00 #77 #00 #73 #00 #65 #00 #72 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #37 #00 #00 #02 #8D #00 #00 #00 #53 #00 #FF #FF #FF #00 #00 #00 #03 #00 #00 #05 #40 #00 #00 #00 #53 #FC #01 #00 #00 #00 #01 #FB #00 #00 #00 #22 #00 #70 #00 #79 #00 #74 #00 #68 #00 #6F #00 #6E #00 #43 #00 #6F #00 #6E #00 #73 #00 #6F #00 #6C #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #00 #00 #00 #05 #40 #00 #00 #00 #46 #00 #FF #FF #FF #00 #00 #04 #38 #00 #00 #02 #8D #00 #00 #00 #04 #00 #00 #00 #04 #00 #00 #00 #08 #00 #00 #00 #08 #FC #00 #00 #00 #01 #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #1C #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1A #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #CE #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00" />
+  <parameter name=""         value="#00 #00 #00 #FF #00 #00 #00 #00 #FD #00 #00 #00 #02 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #02 #8D #FC #02 #00 #00 #00 #01 #FB #00 #00 #00 #22 #00 #6F #00 #62 #00 #6A #00 #65 #00 #63 #00 #74 #00 #42 #00 #72 #00 #6F #00 #77 #00 #73 #00 #65 #00 #72 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #37 #00 #00 #02 #8D #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #03 #00 #00 #05 #40 #00 #00 #00 #74 #FC #01 #00 #00 #00 #01 #FB #00 #00 #00 #22 #00 #70 #00 #79 #00 #74 #00 #68 #00 #6F #00 #6E #00 #43 #00 #6F #00 #6E #00 #73 #00 #6F #00 #6C #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #00 #00 #00 #05 #40 #00 #00 #00 #46 #00 #FF #FF #FF #00 #00 #05 #40 #00 #00 #02 #6C #00 #00 #00 #04 #00 #00 #00 #04 #00 #00 #00 #08 #00 #00 #00 #08 #FC #00 #00 #00 #01 #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #1C #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #1A #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #CE #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00" />
  </section>
  <section name="windows_visibility">
-  <parameter value="#00 #00 #00 #00 #02 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #01 #00 #00 #00 #03 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #30 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #33 #01" name=""/>
+  <parameter name="nomodule" value="#00 #00 #00 #00 #04 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #1A #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #1C #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #01 #00 #00 #00 #05 #00 #00 #00 #22 #00 #6F #00 #62 #00 #6A #00 #65 #00 #63 #00 #74 #00 #42 #00 #72 #00 #6F #00 #77 #00 #73 #00 #65 #00 #72 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #22 #00 #70 #00 #79 #00 #74 #00 #68 #00 #6F #00 #6E #00 #43 #00 #6F #00 #6E #00 #73 #00 #6F #00 #6C #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #30 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #33 #01" />
+  <parameter name=""         value="#00 #00 #00 #00 #04 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #1A #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #1C #00 #53 #00 #61 #00 #6C #00 #6F #00 #6D #00 #65 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #01 #00 #00 #00 #05 #00 #00 #00 #22 #00 #6F #00 #62 #00 #6A #00 #65 #00 #63 #00 #74 #00 #42 #00 #72 #00 #6F #00 #77 #00 #73 #00 #65 #00 #72 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #22 #00 #70 #00 #79 #00 #74 #00 #68 #00 #6F #00 #6E #00 #43 #00 #6F #00 #6E #00 #73 #00 #6F #00 #6C #00 #65 #00 #44 #00 #6F #00 #63 #00 #6B #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #30 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #33 #01" />
  </section>
 </document>
index dae481992c9b814a6d48f654a49ef55d725e0faf..98d12bcfce270973b2abee1de6502b38931ca4ee 100644 (file)
         <source>APP_MODULE_ICO</source>
         <translation>icon_module.png</translation>
     </message>
-    <message>
-        <source>BROWSER_ICON</source>
-        <translation>icon_default.png</translation>
-    </message>    
-    <message>
-        <source>BROWSER_CLOSE_ICON</source>
-        <translation>close.png</translation>
-    </message>    
 </context>
 </TS>
index 306362bd5aad07ffd43610007a5495fcc209c468..3d775c1eea910197d83d624e777e334d860d7099 100644 (file)
@@ -33,7 +33,7 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
     <message>
         <source>ABOUT_CLOSE</source>
         <translation>&amp;Close</translation>
-    </message>    
+    </message>
     <message>
         <source>APP_NAME</source>
         <translation>SALOME</translation>
@@ -51,41 +51,25 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
         <translation>Entry</translation>
     </message>
     <message>
-        <source>BROWSER_TITLE</source>
-        <translation>SALOME Help Browser</translation>
-    </message>    
-    <message>
-        <source>BROWSER_TOOLBAR_TITLE</source>
-        <translation>Navigation</translation>
-    </message>    
-    <message>
-        <source>BROWSER_FILEMENU</source>
-        <translation>&amp;File</translation>
-    </message>    
-    <message>
-        <source>BROWSER_CLOSE</source>
-        <translation>&amp;Close</translation>
-    </message>    
-    <message>
-        <source>BROWSER_BACK</source>
-        <translation>Go Back</translation>
-    </message>    
+        <source>APPCLOSE_CAPTION</source>
+        <translation>Close active study</translation>
+    </message>
     <message>
-        <source>BROWSER_FORWARD</source>
-        <translation>Go Forward</translation>
-    </message>    
+        <source>STUDYCLOSE_DESCRIPTION</source>
+        <translation>You already have an active study in your session. It has to be closed before working with another study.</translation>
+    </message>
     <message>
-        <source>BROWSER_FIND</source>
-        <translation>&amp;Find...</translation>
-    </message>    
+        <source>APPCLOSE_SAVE</source>
+        <translation>&amp;Save &amp;&amp; Close</translation>
+    </message>
     <message>
-        <source>BROWSER_FINDNEXT</source>
-        <translation>Find &amp;next</translation>
-    </message>    
+        <source>APPCLOSE_CLOSE</source>
+        <translation>Close &amp;w/o saving</translation>
+    </message>
     <message>
-        <source>BROWSER_FINDPREV</source>
-        <translation>Find &amp;previous</translation>
-    </message>    
+        <source>APPCLOSE_CANCEL</source>
+        <translation>&amp;Cancel</translation>
+    </message>
 </context>
 <context>
     <name>LightApp_Application</name>
@@ -178,7 +162,7 @@ The changes will be applied on the next application session.</translation>
     <message>
         <source>PREF_STORE_TOOL_POS</source>
         <translation>Store positions of toolbars</translation>
-        </message>
+    </message>
     <message>
         <source>PREF_AUTO_SAVE</source>
         <translation>Auto-save interval (min)</translation>
@@ -390,7 +374,7 @@ The changes will be applied on the next application session.</translation>
     <message>
         <source>MEN_RENAME_OBJ</source>
         <translation>Rename</translation>
-    </message>         
+    </message>
     <message>
         <source>LOG_WINDOW</source>
         <translation>Message Window</translation>
@@ -453,7 +437,7 @@ The changes will be applied on the next application session.</translation>
     </message>
     <message>
         <source>PREF_AUTO_SIZE_FIRST</source>
-        <translation>Auto size for "Name" column</translation>
+        <translation>Auto size for &quot;Name&quot; column</translation>
     </message>
     <message>
         <source>PREF_RESIZE_ON_EXPAND_ITEM</source>
@@ -534,7 +518,7 @@ The changes will be applied on the next application session.</translation>
     <message>
         <source>PREF_VIEWER_SELECTION</source>
         <translation>Selection color</translation>
-    </message>    
+    </message>
     <message>
         <source>PREF_XYVIEWER_BACKGROUND</source>
         <translation>XY View</translation>
@@ -566,7 +550,7 @@ The changes will be applied on the next application session.</translation>
     <message>
         <source>PREF_SELECTED_FONT_COLOR</source>
         <translation>Highlighted legend font color</translation>
-    </message>                         
+    </message>
     <message>
         <source>PREF_LEFT</source>
         <translation>Left</translation>
index e07ece124def1ebf94b7638c207522267086144d..1dc76dc2a32d7e2226e86d682d4cca3f4543d3c1 100755 (executable)
@@ -51,40 +51,24 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
         <translation>Entrée</translation>
     </message>
     <message>
-        <source>BROWSER_TITLE</source>
-        <translation>Aide de SALOME</translation>
+        <source>APPCLOSE_CAPTION</source>
+        <translation>Fermer l&apos;étude actuelle</translation>
     </message>
     <message>
-        <source>BROWSER_TOOLBAR_TITLE</source>
-        <translation>Navigation</translation>
+        <source>STUDYCLOSE_DESCRIPTION</source>
+        <translation>Une étude est déjà ouverte. Elle doit être fermée avant d&apos;en ouvrir une autre.</translation>
     </message>
     <message>
-        <source>BROWSER_FILEMENU</source>
-        <translation>&amp;Fichier</translation>
+        <source>APPCLOSE_SAVE</source>
+        <translation>&amp;Sauvegarder &amp;&amp; Fermer</translation>
     </message>
     <message>
-        <source>BROWSER_CLOSE</source>
-        <translation>&amp;Fermer</translation>
-    </message>
-    <message>
-        <source>BROWSER_BACK</source>
-        <translation>Reculer</translation>
-    </message>
-    <message>
-        <source>BROWSER_FORWARD</source>
-        <translation>Avancer</translation>
+        <source>APPCLOSE_CLOSE</source>
+        <translation>&amp;Fermer sans sauvegarder</translation>
     </message>
     <message>
-        <source>BROWSER_FIND</source>
-        <translation>&amp;Chercher...</translation>
-    </message>
-    <message>
-        <source>BROWSER_FINDNEXT</source>
-        <translation>Chercher &amp;suivant</translation>
-    </message>
-    <message>
-        <source>BROWSER_FINDPREV</source>
-        <translation>Chercher &amp;précédent</translation>
+        <source>APPCLOSE_CANCEL</source>
+        <translation>&amp;Annuler</translation>
     </message>
 </context>
 <context>
index 3253f1ea65fb2a4547bc6e7b834c221ed599b9ee..d90b91b081bf8fb39f62f7c6028088069e5db58f 100644 (file)
@@ -51,40 +51,25 @@ CEA/DEN, CEDRAT, EDF R&amp;D, LEG, PRINCIPIA R&amp;D, BUREAU VERITAS</translatio
       <translation>エントリ</translation>
     </message>
     <message>
-      <source>BROWSER_TITLE</source>
-      <translation>Salome ヘルプ ・ ブラウザー</translation>
+      <source>APPCLOSE_CAPTION</source>
+      <translation>現在のスタディを閉じる</translation>
     </message>
     <message>
-      <source>BROWSER_TOOLBAR_TITLE</source>
-      <translation>ナビゲーション</translation>
+      <source>STUDYCLOSE_DESCRIPTION</source>
+        <translation type="unfinished">You already have an active study in your 
+session. It has to be closed before working with another study.</translation>
     </message>
     <message>
-      <source>BROWSER_FILEMENU</source>
-      <translation>ファイル(&amp;F)</translation>
+      <source>APPCLOSE_SAVE</source>
+      <translation>保存して閉じる(&amp;S)</translation>
     </message>
     <message>
-      <source>BROWSER_CLOSE</source>
-      <translation>閉じる(&amp;C)</translation>
-    </message>
-    <message>
-      <source>BROWSER_BACK</source>
-      <translation>戻る</translation>
-    </message>
-    <message>
-      <source>BROWSER_FORWARD</source>
-      <translation>進む</translation>
+      <source>APPCLOSE_CLOSE</source>
+      <translation>保存せずに閉じる(&amp;C)</translation>
     </message>
     <message>
-      <source>BROWSER_FIND</source>
-      <translation>検索(&amp;F)</translation>
-    </message>
-    <message>
-      <source>BROWSER_FINDNEXT</source>
-      <translation>次を検索(&amp;n)</translation>
-    </message>
-    <message>
-      <source>BROWSER_FINDPREV</source>
-      <translation>前を検索(&amp;p)</translation>
+      <source>APPCLOSE_CANCEL</source>
+      <translation>キャンセル(&amp;C)</translation>
     </message>
   </context>
   <context>
index 1cabc85f0dc624ff6b819c843ab8ab3456daab4a..9b60f4546c408fd8134b11fe1cadf41168bbbb97 100644 (file)
@@ -108,10 +108,8 @@ Standard_EXPORT   TColStd_IndexedMapOfInteger& ChangeFind(const Handle(SALOME_In
   return ChangeFind(K);
 }
 
-#if OCC_VERSION_LARGE > 0x06050100 // for OCC-6.5.2 and higher version
 Standard_EXPORT   Standard_Address Find1 (const Handle(SALOME_InteractiveObject)& K) const;
 Standard_EXPORT   Standard_Address ChangeFind1 (const Handle(SALOME_InteractiveObject)& K);
-#endif
 
 private: 
 Standard_EXPORT SALOME_DataMapOfIOMapOfInteger(const SALOME_DataMapOfIOMapOfInteger& Other);
index a7cc4289c97b762e21f19a14615f9c0e5d21ab25..c1476ed9344a350a97a94b7269c072720e59e276 100755 (executable)
@@ -44,7 +44,7 @@ ADD_DEFINITIONS(${QT_DEFINITIONS} ${CAS_DEFINITIONS} ${OGL_DEFINITIONS})
 # libraries to link to
 SET(_link_LIBRARIES
   ${OPENGL_LIBRARIES} ${QT_LIBRARIES} ${CAS_KERNEL} ${CAS_VIEWER} ${CAS_TKGeomAlgo}
-  ${CAS_TKTopAlgo} ${CAS_TKG2d}
+  ${CAS_TKTopAlgo} ${CAS_TKG2d} ${CAS_TKOpenGl}
   CASCatch qtx suit OpenGLUtils ViewerTools ViewerData
 )
 
@@ -76,8 +76,8 @@ SET(_other_HEADERS
   OCCViewer.h
   OCCViewer_ClipPlane.h
   OCCViewer_Trihedron.h 
-  OCCViewer_Utilities.h
   OCCViewer_VService.h
+  OCCViewer_Utilities.h
 )
 
 # header files / no moc processing / internal
@@ -91,6 +91,9 @@ SET(OCCViewer_HEADERS ${_moc_HEADERS} ${_other_HEADERS})
 
 # --- resources ---
 
+# resource files / to be processed by rcc
+SET(_rcc_RESOURCES OCCViewer.qrc)
+
 # resource files / to be processed by lrelease
 SET(_ts_RESOURCES
   resources/OCCViewer_images.ts
@@ -141,6 +144,9 @@ SET(_other_RESOURCES
 # sources / moc wrappings
 QT4_WRAP_CPP(_moc_SOURCES ${_moc_HEADERS})
 
+# sources / rcc wrappings
+QT4_ADD_RESOURCES(_rcc_SOURCES ${_rcc_RESOURCES})
+
 # sources / static
 SET(_other_SOURCES
   OCCViewer_AISSelector.cxx
@@ -153,7 +159,6 @@ SET(_other_SOURCES
   OCCViewer_SetRotationPointDlg.cxx
   OCCViewer_ToolTip.cxx
   OCCViewer_Trihedron.cxx
-  OCCViewer_Utilities.cxx
   OCCViewer_VService.cxx
   OCCViewer_ViewFrame.cxx
   OCCViewer_ViewManager.cxx
@@ -164,10 +169,11 @@ SET(_other_SOURCES
   OCCViewer_ViewWindow.cxx
   OCCViewer_ViewportInputFilter.cxx
   OCCViewer_ClipPlaneInteractor.cxx
+  OCCViewer_Utilities.cxx
 )
 
 # sources / to compile
-SET(OCCViewer_SOURCES ${_other_SOURCES} ${_moc_SOURCES})
+SET(OCCViewer_SOURCES ${_other_SOURCES} ${_moc_SOURCES} ${_rcc_SOURCES})
 
 # --- rules ---
 
diff --git a/src/OCCViewer/OCCViewer.qrc b/src/OCCViewer/OCCViewer.qrc
new file mode 100644 (file)
index 0000000..cc4c167
--- /dev/null
@@ -0,0 +1,5 @@
+ <!DOCTYPE RCC><RCC version="1.0">
+ <qresource>
+     <file>images/hatch.png</file>
+ </qresource>
+ </RCC>
index 9275eb7d3e6620feed2fd5ed378e81ed87e9f2d5..bc42157645e85ed219d0a8ea8892fa07a1ff1a83 100644 (file)
@@ -520,7 +520,7 @@ bool OCCViewer_ClipPlaneInteractor::mousePress( QMouseEvent* theEvent,
   myIsClickable = isClickable( aPlane );
 
   // process mouse click on the object
-  if ( myIsClickable );
+  if ( myIsClickable )
   {
     myViewer->getAISContext()->SetSelected( aPlane );
     emit planeClicked( aPlane );
index 40ee9ad4611b7746b5fe6d0a71b195eb4b0dac62..ec75a10529ccbf4c4e93c1cfaddddf4078b41f33 100644 (file)
@@ -571,7 +571,7 @@ OCCViewer_ClippingDlg::OCCViewer_ClippingDlg(OCCViewer_ViewWindow* parent , OCCV
   buttonClose->setAutoDefault( TRUE );
   GroupButtonsLayout->addWidget( buttonClose );
 
-  QPushButton* buttonHelp = new QPushButton( tr( "SMESH_BUT_HELP" ), GroupButtons );
+  QPushButton* buttonHelp = new QPushButton( tr( "HELP" ), GroupButtons );
   buttonHelp->setAutoDefault( TRUE );
   GroupButtonsLayout->addWidget( buttonHelp );
 
index 86cade97c6b468d6358581c2202057abd10ad5d2..31561c3a5893a5c5396acecf28e1adf77777f373 100644 (file)
@@ -244,7 +244,6 @@ void OCCViewer_CubeAxesDlg::SetData( bool theIsVisible, OCCViewer_AxisWidget::Ax
 */
 void OCCViewer_CubeAxesDlg::ApplyData( const Handle(V3d_View)& theView )
 {
-#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 and higher version
   if( theView.IsNull() )
     return;
 
@@ -317,5 +316,4 @@ void OCCViewer_CubeAxesDlg::ApplyData( const Handle(V3d_View)& theView )
     theView->GraduatedTrihedronErase();
 
   theView->Redraw();
-#endif
 }
old mode 100755 (executable)
new mode 100644 (file)
index 6ffb841..14ac128
@@ -69,11 +69,21 @@ OCCViewer_Trihedron::~OCCViewer_Trihedron()
 /*!
  * Sets the bounding box (MinMax values).
  */
+#if OCC_VERSION_LARGE > 0x06070100 // for OCC-6.7.2 and higher version
+void OCCViewer_Trihedron::bounds( Graphic3d_BndBox4f& theMinMax ) const
+{
+  Graphic3d_Vec4 aMinPt (-1.f, -1.f, -1.f, 1.f);
+  Graphic3d_Vec4 aMaxPt (1.f, 1.f, 1.f, 1.f);
+
+  theMinMax.Add (aMinPt);
+  theMinMax.Add (aMaxPt);
+}
+#else
 void OCCViewer_Trihedron::bounds( Graphic3d_CBounds& aMinMax ) const
 {
   Standard_Real aXMin = -1, aYMin = -1, aZMin = -1;
   Standard_Real aXMax =  1, aYMax =  1, aZMax =  1;
-  
+
   if( aMinMax.XMin > aXMin ) aMinMax.XMin = aXMin;
   if( aMinMax.YMin > aYMin ) aMinMax.YMin = aYMin;
   if( aMinMax.ZMin > aZMin ) aMinMax.ZMin = aZMin;
@@ -81,6 +91,7 @@ void OCCViewer_Trihedron::bounds( Graphic3d_CBounds& aMinMax ) const
   if( aMinMax.YMax < aYMax ) aMinMax.YMax = aYMax;
   if( aMinMax.ZMax < aZMax ) aMinMax.ZMax = aZMax;
 }
+#endif
 
 /*!
  * Redefined method. Calculates the object presentation.
index 6cddc578dd23e868feb83777e64db78a01483b25..72c7382b5047872a9f9c11a950120e1d0bddf884 100644 (file)
 #include "OCCViewer.h"
 
 #include <AIS_InteractiveObject.hxx>
-#include <Graphic3d_CBounds.hxx>
+#include <Basics_OCCTVersion.hxx>
+#if OCC_VERSION_LARGE > 0x06070100 // for OCC-6.7.2 and higher version
+  #include <Graphic3d_BndBox4f.hxx>
+#else
+  #include <Graphic3d_CBounds.hxx>
+#endif
 #include <Standard_DefineHandle.hxx>
 
 /*!
@@ -43,7 +48,11 @@ public:
   virtual void           ComputeSelection( const Handle( SelectMgr_Selection )&,
                                            const Standard_Integer );
 
+#if OCC_VERSION_LARGE > 0x06070100
+  virtual void           bounds( Graphic3d_BndBox4f& ) const;
+#else
   virtual void           bounds( Graphic3d_CBounds& ) const;
+#endif
 
   virtual void           display();
 
old mode 100644 (file)
new mode 100755 (executable)
index a908918..5b9a879
@@ -1,4 +1,23 @@
+// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
 
+// internal includes
 #include "OCCViewer_Utilities.h"
 #include "OCCViewer_ViewFrame.h"
 #include "OCCViewer_ViewModel.h"
 
 #include "SUIT_ViewManager.h"
 #include "QtxActionToolMgr.h"
-#include <QtxMultiAction.h>
+#include "QtxMultiAction.h"
+
+// KERNEL includes
+#include <Basics_OCCTVersion.hxx>
+
+// OCC includes
 #include <V3d_View.hxx>
 
+// QT includes
+#include <QImage>
 #include <QAction>
 
+Handle(Image_PixMap) OCCViewer_Utilities::imageToPixmap( const QImage& anImage )
+{
+  Handle(Image_PixMap) aPixmap = new Image_PixMap();
+  if ( !anImage.isNull() ) {
+    aPixmap->InitTrash( Image_PixMap::ImgBGRA, anImage.width(), anImage.height() );
+    aPixmap->SetTopDown( Standard_True );
+
+    const uchar* aImageBytes = anImage.bits();
+      
+    for ( int aLine = anImage.height() - 1; aLine >= 0; --aLine ) {
+#if OCC_VERSION_LARGE > 0x06070100
+      // convert pixels from ARGB to renderer-compatible RGBA
+      for ( int aByte = 0; aByte < anImage.width(); ++aByte ) {
+           Image_ColorBGRA& aPixmapBytes = aPixmap->ChangeValue<Image_ColorBGRA>(aLine, aByte);
+
+           aPixmapBytes.b() = (Standard_Byte) *aImageBytes++;
+           aPixmapBytes.g() = (Standard_Byte) *aImageBytes++;
+           aPixmapBytes.r() = (Standard_Byte) *aImageBytes++;
+           aPixmapBytes.a() = (Standard_Byte) *aImageBytes++;
+         }
+#else
+         Image_ColorBGRA* aPixmapBytes = aPixmap->EditData<Image_ColorBGRA>().ChangeRow(aLine);
+       
+      // convert pixels from ARGB to renderer-compatible RGBA
+      for ( int aByte = 0; aByte < anImage.width(); ++aByte ) {
+           aPixmapBytes->b() = (Standard_Byte) *aImageBytes++;
+           aPixmapBytes->g() = (Standard_Byte) *aImageBytes++;
+           aPixmapBytes->r() = (Standard_Byte) *aImageBytes++;
+           aPixmapBytes->a() = (Standard_Byte) *aImageBytes++;
+           aPixmapBytes++;
+      }
+#endif
+    }
+  }
+  return aPixmap;
+}
+
 void OCCViewer_Utilities::setViewer2DMode( OCCViewer_Viewer* theViewer,
                                            const OCCViewer_ViewWindow::Mode2dType& theMode )
 {
old mode 100644 (file)
new mode 100755 (executable)
index 8460f3c..1cbbacf
@@ -1,9 +1,33 @@
+// Copyright (C) 2014  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+
 #ifndef OCCVIEWER_UTILITIES_H
 #define OCCVIEWER_UTILITIES_H
 
+// internal includes
 #include "OCCViewer.h"
 #include "OCCViewer_ViewWindow.h"
 
+// OCC includes
+#include <Image_PixMap.hxx>
+
+class QImage;
 class OCCViewer_Viewer;
 
 #ifdef WIN32
@@ -14,6 +38,13 @@ class OCCVIEWER_EXPORT OCCViewer_Utilities
 {
 public:
 
+  /*!
+   * Convert Qt image to OCCT pixmap
+   * \param theImage Qt source image
+   * \return resulting OCCT pixmap
+   */
+  static Handle(Image_PixMap) imageToPixmap( const QImage& theImage );
+
   /*!
    * Set 2D mode for the viewer. Hide or show 3D actions.
    * \param theViewer an OCC viewer
@@ -24,4 +55,4 @@ public:
 
 };
 
-#endif
+#endif // OCCVIEWER_UTILITIES_H
index b562813ada465cab1baa47fd3663b986217fb436..3b99fc0a0a377571574ed52622b2c34d530de0f6 100755 (executable)
 #include <V3d_View.hxx>
 
 #include <Aspect_DisplayConnection.hxx>
+#include <Basics_OCCTVersion.hxx>
+#if OCC_VERSION_LARGE > 0x06070200 // for OCC-6.7.3 and higher version
+#include <OpenGl_GraphicDriver.hxx>
+#else
 #include <Graphic3d.hxx>
 #include <Graphic3d_GraphicDriver.hxx>
+#endif
+
 #ifdef WIN32
 #include <WNT_Window.hxx>
 #else
@@ -61,7 +67,11 @@ Handle(V3d_Viewer) OCCViewer_VService::CreateViewer( const Standard_ExtString na
                                                     const Standard_Boolean computedMode,
                                                     const Standard_Boolean defaultComputedMode )
 {
+#if OCC_VERSION_LARGE > 0x06070200 // for OCC-6.7.3 and higher version
+  static Handle(OpenGl_GraphicDriver) aGraphicDriver;
+#else
   static Handle(Graphic3d_GraphicDriver) aGraphicDriver;
+#endif
   if (aGraphicDriver.IsNull())
   {
     Handle(Aspect_DisplayConnection) aDisplayConnection;
@@ -70,7 +80,11 @@ Handle(V3d_Viewer) OCCViewer_VService::CreateViewer( const Standard_ExtString na
 #else
     aDisplayConnection = new Aspect_DisplayConnection();
 #endif
+#if OCC_VERSION_LARGE > 0x06070200 // for OCC-6.7.3 and higher version
+    aGraphicDriver = new OpenGl_GraphicDriver(aDisplayConnection);
+#else
     aGraphicDriver = Graphic3d::InitGraphicDriver( aDisplayConnection );
+#endif
   }
 
   return new V3d_Viewer( aGraphicDriver, name, domain, viewSize, viewProjection,
index cc20fd47394a9f9160a871aae4e57df86719a88a..33e1a4d6403cb45021ca7fc96247ede2633e0668 100644 (file)
@@ -131,9 +131,7 @@ void OCCViewer_ViewFrame::onMaximizedView( OCCViewer_ViewWindow* theView, bool i
       mySplitMode = CreateSubViewsDlg.getSplitMode();
       myViewsMode = CreateSubViewsDlg.getViewsMode();
       splitSubViews();
-    }
-    else {
-      myMaximizedView->setMaximized(true);
+      myMaximizedView->setMaximized(false, false);
     }
   }
   myLayout->invalidate();
index 366d3bb0cc53954d530318213857a9872fda4120..64e558564f96c8a5acfbaad70984d93c67b91ce4 100755 (executable)
@@ -26,6 +26,7 @@
 #include "OCCViewer_VService.h"
 #include "OCCViewer_ViewPort3d.h"
 #include "OCCViewer_ClippingDlg.h"
+#include "OCCViewer_Utilities.h"
 
 #include "SUIT_ViewWindow.h"
 #include "SUIT_ViewManager.h"
@@ -54,6 +55,9 @@
 #include <AIS_ListOfInteractive.hxx>
 #include <AIS_ListIteratorOfListOfInteractive.hxx>
 
+#include <Graphic3d_Texture2Dmanual.hxx>
+#include <Graphic3d_TextureParams.hxx>
+
 #include <Geom_Axis2Placement.hxx>
 #include <Prs3d_Drawer.hxx>
 #include <Prs3d_DatumAspect.hxx>
 
 #include <Visual3d_View.hxx>
 
-
-// VSR: Uncomment below line to allow texture background support in OCC viewer
-#define OCC_ENABLE_TEXTURED_BACKGROUND
-
 /*!
   Get data for supported background modes: gradient types, identifiers and supported image formats
 */
@@ -79,11 +79,7 @@ QString OCCViewer_Viewer::backgroundData( QStringList& gradList, QIntList& idLis
               Diagonal1Gradient              << Diagonal2Gradient <<
               Corner1Gradient                << Corner2Gradient   <<
               Corner3Gradient                << Corner4Gradient;
-#if OCC_VERSION_LARGE > 0x06050200 // enabled since OCCT 6.5.3, since in previous version this functionality is buggy
-#ifdef OCC_ENABLE_TEXTURED_BACKGROUND
   txtList  << Qtx::CenterTexture << Qtx::TileTexture << Qtx::StretchTexture;
-#endif
-#endif
   return tr("BG_IMAGE_FILES");
 }
 
@@ -104,18 +100,8 @@ OCCViewer_Viewer::OCCViewer_Viewer( bool DisplayTrihedron)
   //myV3dViewer->Init(); // to avoid creation of the useless perspective view (see OCCT issue 0024267)
   myV3dViewer->SetDefaultLights();
 
-#if OCC_VERSION_LARGE <= 0x06060000 // Porting to OCCT higher 6.6.0 version
-  myV3dCollector = OCCViewer_VService::CreateViewer( TCollection_ExtendedString("Collector3d").ToExtString() );
-  //myV3dCollector->Init(); // to avoid creation of the useless perspective view (see OCCT issue 0024267)
-  myV3dCollector->SetDefaultLights();
-#endif
-
   // init selector
-#if OCC_VERSION_LARGE <= 0x06060000 
-  myAISContext = new AIS_InteractiveContext( myV3dViewer, myV3dCollector );
-#else
   myAISContext = new AIS_InteractiveContext( myV3dViewer );
-#endif
   myAISContext->SelectionColor( Quantity_NOC_WHITE );
   
   // display isoline on planar faces (box for ex.)
@@ -162,9 +148,6 @@ OCCViewer_Viewer::~OCCViewer_Viewer()
 {
   myAISContext.Nullify();
   myV3dViewer.Nullify();
-#if OCC_VERSION_LARGE <= 0x06060000
-  myV3dCollector.Nullify();
-#endif
 }
 
 /*!
@@ -411,10 +394,8 @@ void OCCViewer_Viewer::onViewMapped(OCCViewer_ViewPort3d* viewPort)
 
 int OCCViewer_Viewer::getTopLayerId()
 {
-#if OCC_VERSION_LARGE > 0x06050200
   if ( myTopLayerId == 0 && !myAISContext->CurrentViewer().IsNull() )    
     myAISContext->CurrentViewer()->AddZLayer( myTopLayerId );
-#endif
 
   return myTopLayerId;
 }
@@ -727,15 +708,6 @@ bool OCCViewer_Viewer::isInViewer( const Handle(AIS_InteractiveObject)& obj,
   AIS_ListOfInteractive List;
   myAISContext->DisplayedObjects(List);
 
-#if OCC_VERSION_LARGE <= 0x06060000
-  if( !onlyInViewer )
-  {
-    AIS_ListOfInteractive List1;
-    myAISContext->ObjectsInCollector(List1);
-    List.Append(List1);
-  }
-#endif
-
   AIS_ListIteratorOfListOfInteractive ite(List);
   for ( ; ite.More(); ite.Next() )
     if( ite.Value()==obj )
@@ -1031,7 +1003,29 @@ void OCCViewer_Viewer::setSelectionOptions( bool isPreselectionEnabled, bool isS
   }
 }
 
-
+/*!
+  Creates clipping plane based on the incoming plane
+*/
+Handle(Graphic3d_ClipPlane) OCCViewer_Viewer::createClipPlane(const gp_Pln& thePlane, const Standard_Boolean theIsOn)
+{
+  Handle(Graphic3d_ClipPlane) aGraphic3dPlane = new Graphic3d_ClipPlane( thePlane );
+  aGraphic3dPlane->SetOn( theIsOn );
+  aGraphic3dPlane->SetCapping( Standard_True );
+
+  // load capping texture
+  QPixmap px( ":images/hatch.png" );
+  if( !px.isNull() ) {
+    const Handle(Image_PixMap) aPixmap = OCCViewer_Utilities::imageToPixmap( px.toImage() );
+    Handle(Graphic3d_Texture2Dmanual) aTexture = new Graphic3d_Texture2Dmanual( aPixmap );
+    if( aTexture->IsDone() ) {
+      aTexture->EnableModulate();
+      aTexture->EnableRepeat();
+      aTexture->GetParams()->SetScale( Graphic3d_Vec2( 0.01, 0.01 ) );
+      aGraphic3dPlane->SetCappingTexture( aTexture );
+    }
+  }
+  return aGraphic3dPlane;
+}
 /*!
   Applies clipping planes to clippable objects
 */
@@ -1053,10 +1047,7 @@ void OCCViewer_Viewer::setClipPlanes(ClipPlanesList theList)
     gp_Pnt anOrigin( aPlane.X, aPlane.Y, aPlane.Z );
     gp_Dir aDirection( aDx, aDy, aDz );
 
-    Handle(Graphic3d_ClipPlane) aGraphic3dPlane = new Graphic3d_ClipPlane( gp_Pln( anOrigin, aDirection ) );
-    aGraphic3dPlane->SetOn( aPlane.IsOn );
-
-    myInternalClipPlanes.Append( aGraphic3dPlane );
+    myInternalClipPlanes.Append( createClipPlane( gp_Pln( anOrigin, aDirection ), aPlane.IsOn ) );
     myClipPlanes.push_back( aPlane );
   }
 
index 5e2e955b38192864e1c8435dddc3266ddb8b44d4..5ca95ef263c4f5a70746d9c00cef6ddd9983b605 100755 (executable)
@@ -126,9 +126,6 @@ public:
 
 public:
   Handle(V3d_Viewer)              getViewer3d()    const { return myV3dViewer;}
-#if OCC_VERSION_LARGE <= 0x06060000 
-  Handle(V3d_Viewer)              getCollector3d() const { return myV3dCollector; }
-#endif
   Handle(AIS_InteractiveContext)  getAISContext()  const { return myAISContext; }
   Handle(AIS_Trihedron)           getTrihedron()   const { return myTrihedron; }
 
@@ -156,6 +153,7 @@ public:
   void                            setStaticTrihedronDisplayed(const bool on);
 
   /* Clip planes management */
+  Handle(Graphic3d_ClipPlane)     createClipPlane(const gp_Pln& thePlane, const Standard_Boolean theIsOn);
   void                            setClipPlanes (ClipPlanesList theList);
   ClipPlanesList                  getClipPlanes() const;
   void                            applyExistingClipPlanesToObject (const Handle(AIS_InteractiveObject)& theObject);
@@ -196,11 +194,6 @@ protected slots:
 protected:
   Handle(V3d_Viewer)              myV3dViewer;
 
-#if OCC_VERSION_LARGE <= 0x06060000
-  Handle(V3d_Viewer)              myV3dCollector;
-#endif
-
-
   Handle(AIS_Trihedron)           myTrihedron;
   Handle(AIS_InteractiveContext)  myAISContext;
 
index 110076d130317b883b1b8da214efd33904cf9065..b0df1877e4e2526f1316a735432d498a5ab3707f 100755 (executable)
@@ -313,22 +313,6 @@ void OCCViewer_ViewPort3d::updateBackground()
   if ( activeView().IsNull() ) return;
   if ( !myBackground.isValid() ) return;
 
-  // VSR: Important note on below code.
-  // In OCCT (in version 6.5.2), things about the background drawing
-  // are not straightforward and not clearly understandable:
-  // - Horizontal gradient is drawn vertically (!), well ok, from top side to bottom one.
-  // - Vertical gradient is drawn horizontally (!), from right side to left one (!!!).
-  // - First and second diagonal gradients are confused.
-  // - Image texture, once set, can not be removed (!).
-  // - Texture image fill mode Aspect_FM_NONE is not taken into account (and means the same
-  //   as Aspect_FM_CENTERED).
-  // - The only way to cancel gradient background (and get back to single colored) is to
-  //   set gradient background style to Aspect_GFM_NONE while passing two colors is also needed
-  //   (see V3d_View::SetBgGradientColors() function).
-  // - Also, it is impossible to draw texture image above the gradiented background (only above
-  //   single-colored).
-  // In OCCT 6.5.3 all above mentioned problems are fixed; so, above comment should be removed as soon
-  // as SALOME is migrated to OCCT 6.5.3. The same concerns #ifdef statements in the below code
   switch ( myBackground.mode() ) {
   case Qtx::ColorBackground:
     {
@@ -337,13 +321,8 @@ void OCCViewer_ViewPort3d::updateBackground()
        // Unset texture should be done here
        // ...
        Quantity_Color qCol( c.red()/255., c.green()/255., c.blue()/255., Quantity_TOC_RGB );
-#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
        activeView()->SetBgGradientStyle( Aspect_GFM_NONE ); // cancel gradient background
        activeView()->SetBgImageStyle( Aspect_FM_NONE );     // cancel texture background
-#else
-       // cancel gradient background (in OCC before v6.5.3 the only way to do this is to set it to NONE type passing arbitrary colors as parameters)
-       activeView()->SetBgGradientColors( qCol, qCol, Aspect_GFM_NONE );
-#endif
        // then change background color
        activeView()->SetBackgroundColor( qCol );
        // update viewer
@@ -365,38 +344,16 @@ void OCCViewer_ViewPort3d::updateBackground()
        activeView()->SetBgImageStyle( Aspect_FM_NONE );    // cancel texture background
        switch ( type ) {
        case OCCViewer_Viewer::HorizontalGradient:
-#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
          activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_HOR, Standard_True );
-#else
-         // in OCCT before v6.5.3, to draw horizontal gradient it's necessary to use Aspect_GFM_VER type
-         // and interchange the colors
-         activeView()->SetBgGradientColors( qCol2, qCol1, Aspect_GFM_VER, Standard_True );
-#endif
          break;
        case OCCViewer_Viewer::VerticalGradient:
-#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
          activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_VER, Standard_True );
-#else
-         // in OCCT before v6.5.3, to draw vertical gradient it's necessary to use Aspect_GFM_HOR type
-         activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_HOR, Standard_True );
-#endif
          break;
        case OCCViewer_Viewer::Diagonal1Gradient:
-#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
          activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG1, Standard_True );
-#else
-         // in OCCT before v6.5.3, to draw 1st dialognal gradient it's necessary to use Aspect_GFM_DIAG2 type
-         // and interchange the colors
-         activeView()->SetBgGradientColors( qCol2, qCol1, Aspect_GFM_DIAG2, Standard_True );
-#endif
          break;
        case OCCViewer_Viewer::Diagonal2Gradient:
-#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
          activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG2, Standard_True );
-#else
-         // in OCCT before v6.5.3, to draw 2nd dialognal gradient it's necessary to use Aspect_GFM_DIAG1 type
-         activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_DIAG1, Standard_True );
-#endif
          break;
        case OCCViewer_Viewer::Corner1Gradient:
          activeView()->SetBgGradientColors( qCol1, qCol2, Aspect_GFM_CORNER1, Standard_True );
@@ -424,9 +381,6 @@ void OCCViewer_ViewPort3d::updateBackground()
   default:
     break;
   }
-#if OCC_VERSION_LARGE > 0x06050200 // available since OCCT 6.5.3
-  // VSR: In OCCT before v6.5.3 below code can't be used because of very ugly bug - it has been impossible to
-  // clear the background texture image as soon as it was once set to the viewer.
   if ( myBackground.isTextureShown() ) {
     QString fileName;
     int textureMode = myBackground.texture( fileName );
@@ -449,7 +403,6 @@ void OCCViewer_ViewPort3d::updateBackground()
       activeView()->Update();
     }
   }
-#endif
 }
 
 /*!
@@ -477,10 +430,8 @@ void OCCViewer_ViewPort3d::fitRect( const QRect& rect )
 */
 void OCCViewer_ViewPort3d::startZoomAtPoint( int x, int y )
 {
-#if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
   if ( !activeView().IsNull() && isAdvancedZoomingEnabled() )
     activeView()->StartZoomAtPoint( x, y );
-#endif
 }
 
 /*!
@@ -492,11 +443,9 @@ void OCCViewer_ViewPort3d::zoom( int x0, int y0, int x, int y )
     // as OCCT respects a sign of only dx,
     // but we want both signes to be taken into account
     //activeView()->Zoom( x0, y0, x, y );
-#if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
     if ( isAdvancedZoomingEnabled() )
       activeView()->ZoomAtPoint( x0, y0, x, y );
     else
-#endif
       activeView()->Zoom( x0 + y0, 0, x + y, 0 );
     emit vpTransformed( this );
   }
index ed1d3c1dbec0275b88cd84086b872940b26797b8..4f38b4110457ec4c72197a4a339772a760272b08 100755 (executable)
 #include <gp_GTrsf.hxx>
 #include <TColgp_Array1OfPnt2d.hxx>
 
-#if OCC_VERSION_LARGE > 0x06060000 
 #include <Graphic3d_SequenceOfHClipPlane.hxx>
 #include <Graphic3d_ClipPlane.hxx>
 
-#endif
+#include <Image_PixMap.hxx>
 
 #include <Standard_Version.hxx>
 
@@ -1261,9 +1260,9 @@ void OCCViewer_ViewWindow::createActions()
   connect(aAction, SIGNAL(triggered()), this, SLOT(onCloneView()));
   toolMgr()->registerAction( aAction, CloneId );
 
-  aAction = new QtxAction (tr ("MNU_CLIPPING"), aResMgr->loadPixmap ("OCCViewer", tr ("ICON_OCCVIEWER_CLIPPING")),
-                                      tr ("MNU_CLIPPING"), 0, this);
-  aAction->setStatusTip (tr ("DSC_CLIPPING"));
+  aAction = new QtxAction (tr("MNU_CLIPPING"), aResMgr->loadPixmap ("OCCViewer", tr("ICON_OCCVIEWER_CLIPPING")),
+                                      tr("MNU_CLIPPING"), 0, this);
+  aAction->setStatusTip (tr("DSC_CLIPPING"));
   aAction->setCheckable (true);
   connect (aAction, SIGNAL (toggled (bool)), this, SLOT (onClipping (bool)));
   toolMgr()->registerAction (aAction, ClippingId);
@@ -1368,31 +1367,28 @@ void OCCViewer_ViewWindow::createActions()
 */
 void OCCViewer_ViewWindow::createToolBar()
 {
-  QString aToolbarName;
-  switch (my2dMode) {
-  case XYPlane:
-    aToolbarName = tr( "LBL_XYTOOLBAR_LABEL" );
-    break;
-  case XZPlane:
-    aToolbarName = tr( "LBL_XZTOOLBAR_LABEL" );
-    break;
-  case YZPlane:
-    aToolbarName = tr( "LBL_YZTOOLBAR_LABEL" );
-    break;
-  default:
-    aToolbarName = tr( "LBL_3DTOOLBAR_LABEL" );
-  }
-  
-  int tid = toolMgr()->createToolBar( aToolbarName, false );
+  static const char* titles[] = {
+    "LBL_3DTOOLBAR_LABEL",
+    "LBL_XYTOOLBAR_LABEL",
+    "LBL_XZTOOLBAR_LABEL",
+    "LBL_YZTOOLBAR_LABEL",
+  };
+  static const char* names[] = {
+    "OCCViewer3DViewOperations",
+    "OCCViewerXYViewOperations",
+    "OCCViewerXZViewOperations",
+    "OCCViewerYZViewOperations",
+  };
+  int tid = toolMgr()->createToolBar( tr( titles[my2dMode] ),        // title (language-dependant)
+                                     QString( names[my2dMode] ),    // name (language-independant)
+                                     false );                       // disable floatable toolbar
   if ( my2dMode != No2dMode ){
     toolMgr()->append( ReturnTo3dViewId, tid );
     toolMgr()->append( toolMgr()->separator(), tid );
   }
   toolMgr()->append( DumpId, tid );
   toolMgr()->append( SwitchInteractionStyleId, tid );
-#if OCC_VERSION_LARGE > 0x0603000A // available only with OCC-6.3-sp11 and higher version
   toolMgr()->append( SwitchZoomingStyleId, tid );
-#endif
   toolMgr()->append( SwitchPreselectionId, tid );
   toolMgr()->append( SwitchSelectionId, tid );
   if( myModel->trihedronActivated() )
@@ -1439,9 +1435,7 @@ void OCCViewer_ViewWindow::createToolBar()
   toolMgr()->append( toolMgr()->separator(), tid );
   toolMgr()->append( ClippingId, tid );
   toolMgr()->append( AxialScaleId, tid );
-#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 and higher version
   toolMgr()->append( GraduatedAxesId, tid );
-#endif
   toolMgr()->append( AmbientId, tid );
 
   toolMgr()->append( MaximizedId, tid );
@@ -1728,7 +1722,6 @@ void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem, bool base
     myModel->setTrihedronShown( anItem.isVisible );
     myModel->setTrihedronSize( anItem.size );
         
-#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 and higher version
     // graduated trihedron
     bool anIsVisible = anItem.gtIsVisible;
     OCCViewer_AxisWidget::AxisData anAxisData[3];
@@ -1774,7 +1767,6 @@ void OCCViewer_ViewWindow::performRestoring( const viewAspect& anItem, bool base
 
     myCubeAxesDlg->SetData( anIsVisible, anAxisData );
     myCubeAxesDlg->ApplyData( aView3d );
-#endif
 
   } // if ( !baseParamsOnly )
 
@@ -1914,6 +1906,10 @@ QImage OCCViewer_ViewWindow::dumpView()
   
   int aWidth = myViewPort->width();
   int aHeight = myViewPort->height();
+
+  // rnv: An old approach to dump the OCCViewer content
+  //      Now used OCCT built-in procedure.
+  /*     
   QApplication::syncX();
   view->Redraw(); // In order to reactivate GL context
   //view->Update();
@@ -1950,10 +1946,13 @@ QImage OCCViewer_ViewWindow::dumpView()
 
   glReadPixels( p.x(), p.y(), aWidth, aHeight, GL_RGBA, GL_UNSIGNED_BYTE,
                 data);
+  */
+  
+  Image_PixMap aPix;
+  view->ToPixMap(aPix,aWidth, aHeight,Graphic3d_BT_RGBA);
 
-  QImage anImage( data, aWidth, aHeight, QImage::Format_ARGB32 );
+  QImage anImage( aPix.Data(), aWidth, aHeight, QImage::Format_ARGB32 );
   anImage = anImage.mirrored();
-  anImage = anImage.rgbSwapped();
   return anImage;
 }
 
@@ -2010,16 +2009,13 @@ void OCCViewer_ViewWindow::setCuttingPlane( bool on, const double x,  const doub
     pln.Coefficients(a, b, c, d);
     
     Graphic3d_SequenceOfHClipPlane aPlanes = view->GetClipPlanes();
-    Handle(Graphic3d_ClipPlane) aClipPlane;
     if(aPlanes.Size() > 0 ) {
       Graphic3d_SequenceOfHClipPlane::Iterator anIter (aPlanes);
-      aClipPlane = anIter.Value();
+      Handle(Graphic3d_ClipPlane) aClipPlane = anIter.Value();
       aClipPlane->SetEquation(pln);
       aClipPlane->SetOn(Standard_True);
     } else {
-      aClipPlane = new Graphic3d_ClipPlane(pln);
-      view->AddClipPlane(aClipPlane);
-      aClipPlane->SetOn(Standard_True);
+      view->AddClipPlane( myModel->createClipPlane( pln, Standard_True ) );
     }
   }
   else {
@@ -2110,7 +2106,6 @@ viewAspect OCCViewer_ViewWindow::getViewParams() const
   aView3d->Center( params.centerX, params.centerY );
 #endif
 
-#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 and higher version
   // graduated trihedron
   bool anIsVisible = false;
   OCCViewer_AxisWidget::AxisData anAxisData[3];
@@ -2156,7 +2151,6 @@ viewAspect OCCViewer_ViewWindow::getViewParams() const
   params.gtTickmarkLengthX = anAxisData[0].TickmarkLength;
   params.gtTickmarkLengthY = anAxisData[1].TickmarkLength;
   params.gtTickmarkLengthZ = anAxisData[2].TickmarkLength;
-#endif
 
   return params;
 }
@@ -2233,8 +2227,6 @@ QString OCCViewer_ViewWindow::getVisualParameters()
     data << ClippingPlane;
   }
 
-
-#if OCC_VERSION_LARGE > 0x06030009 // available only with OCC-6.3-sp10 or newer version
   // graduated trihedron
   data << QString( "gtIsVisible=%1" )      .arg( params.gtIsVisible );
   data << QString( "gtDrawNameX=%1" )      .arg( params.gtDrawNameX );
@@ -2276,7 +2268,6 @@ QString OCCViewer_ViewWindow::getVisualParameters()
   data << QString( "gtTickmarkLengthX=%1" ).arg( params.gtTickmarkLengthX );
   data << QString( "gtTickmarkLengthY=%1" ).arg( params.gtTickmarkLengthY );
   data << QString( "gtTickmarkLengthZ=%1" ).arg( params.gtTickmarkLengthZ );
-#endif
   QString bg = Qtx::backgroundToString( background() ).replace( "=", "$" );
   data << QString( "background=%1" ).arg( bg );
 
diff --git a/src/OCCViewer/images/hatch.png b/src/OCCViewer/images/hatch.png
new file mode 100644 (file)
index 0000000..97232a7
Binary files /dev/null and b/src/OCCViewer/images/hatch.png differ
index ffeee2b0faa43c285eb700f3ea9251e949d2ae9a..09bd1217e41edecffe60a1b181930960b8f1df09 100644 (file)
 <TS version="2.0" language="en_US">
 <context>
     <name>@default</name>
+    <message>
+        <!-- used in GEOM module: to be moved there? -->
+        <source>OCC_TEXTURE_FILES</source>
+        <translatorcomment>Update to new supported format (see OCCT Image_AlienPixMap documentation)</translatorcomment>
+        <translation>Image files (*.jpeg *jpg *.jpe *.png *.bmp *.gif *.ppm *.tif *.tiff* .tga *.exr)</translation>
+    </message>
+</context>
+<context>
+    <name>OCCViewer_ViewWindow</name>
     <message>
         <source>MNU_FRONT_VIEW</source>
         <translation>Front</translation>
     </message>
     <message>
-        <source>ERROR</source>
-        <translation>Error</translation>
+        <source>DSC_FRONT_VIEW</source>
+        <translation>Front View</translation>
     </message>
     <message>
-        <source>MNU_DUMP_VIEW</source>
-        <translation>Dump view</translation>
+        <source>MNU_TOP_VIEW</source>
+        <translation>Top</translation>
     </message>
     <message>
         <source>DSC_TOP_VIEW</source>
         <translation>Top View</translation>
     </message>
     <message>
-        <source>MNU_PAN_VIEW</source>
-        <translation>Panning</translation>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Dump view</translation>
     </message>
     <message>
-        <source>MNU_CLONE_VIEW</source>
-        <translation>Clone View</translation>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Saves the active view in the image file</translation>
     </message>
     <message>
-        <source>DSC_SHOW_TRIHEDRE</source>
-        <translation>Show/Hide trihedron in the current view</translation>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Panning</translation>
     </message>
     <message>
-        <source>MNU_SHOW_TRIHEDRE</source>
-        <translation>Show/Hide trihedron</translation>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Panning the view</translation>
     </message>
     <message>
-        <source>MNU_TOP_VIEW</source>
-        <translation>Top</translation>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Global Panning</translation>
     </message>
     <message>
         <source>DSC_GLOBALPAN_VIEW</source>
         <translation>Selection of a new center of the view</translation>
     </message>
     <message>
-        <source>DSC_ROTATE_VIEW</source>
-        <translation>Rotation of the point of view around the scene center</translation>
-    </message>
-    <message>
-        <source>MNU_ZOOM_VIEW</source>
-        <translation>Zoom</translation>
-    </message>
-    <message>
-        <source>DSC_PAN_VIEW</source>
-        <translation>Panning the view</translation>
-    </message>
-    <message>
-        <source>DSC_LEFT_VIEW</source>
-        <translation>Left View</translation>
+        <source>MNU_CLONE_VIEW</source>
+        <translation>Clone View</translation>
     </message>
     <message>
-        <source>DSC_SHOOT_VIEW</source>
-        <translation>Memorizes the state of the active view and adds it to the list</translation>
+        <source>DSC_CLONE_VIEW</source>
+        <translation>Create new OCC viewer for the active scene</translation>
     </message>
     <message>
-        <source>DSC_FITALL</source>
-        <translation>Fit all objects inside the view frame</translation>
+        <source>MNU_SHOW_TRIHEDRE</source>
+        <translation>Show/Hide trihedron</translation>
     </message>
     <message>
-        <source>MNU_FITALL</source>
-        <translation>Fit All</translation>
+        <source>DSC_SHOW_TRIHEDRE</source>
+        <translation>Show/Hide trihedron in the current view</translation>
     </message>
     <message>
         <source>MNU_ROTATE_VIEW</source>
         <translation>Rotation</translation>
     </message>
     <message>
-        <source>DSC_FRONT_VIEW</source>
-        <translation>Front View</translation>
-    </message>
-    <message>
-        <source>MNU_ROTATIONPOINTGRAVITY_VIEW</source>
-        <translation>Rotation Point : the gravity center</translation>
-    </message>
-    <message>
-        <source>MNU_GLOBALPAN_VIEW</source>
-        <translation>Global Panning</translation>
-    </message>
-    <message>
-        <source>INF_APP_DUMP_VIEW</source>
-        <translation>Dump view</translation>
-    </message>
-    <message>
-        <source>DSC_CLIPPING</source>
-        <translation>Set clipping plane</translation>
+        <source>DSC_ROTATE_VIEW</source>
+        <translation>Rotation of the point of view around the scene center</translation>
     </message>
     <message>
-        <source>DSC_CLONE_VIEW</source>
-        <translation>Create new OCC viewer for the active scene</translation>
+        <source>MNU_ZOOM_VIEW</source>
+        <translation>Zoom</translation>
     </message>
     <message>
-        <source>INF_APP_SHOOT_VIEW</source>
-        <translation>Memorize view</translation>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoom the view</translation>
     </message>
     <message>
-        <source>MNU_CLIPPING</source>
-        <translation>Clipping</translation>
+        <source>MNU_LEFT_VIEW</source>
+        <translation>Left</translation>
     </message>
     <message>
-        <source>MNU_BACK_VIEW</source>
-        <translation>Back</translation>
+        <source>DSC_LEFT_VIEW</source>
+        <translation>Left View</translation>
     </message>
     <message>
         <source>MNU_SHOOT_VIEW</source>
         <translation>Memorize View</translation>
     </message>
     <message>
-        <source>DSC_CHANGINGROTATIONPOINT_VIEW</source>
-        <translation>Change the point, around which the rotation is performed</translation>
+        <source>DSC_SHOOT_VIEW</source>
+        <translation>Memorizes the state of the active view and adds it to the list</translation>
     </message>
     <message>
-        <source>MNU_BOTTOM_VIEW</source>
-        <translation>Bottom</translation>
+        <source>MNU_FITALL</source>
+        <translation>Fit All</translation>
     </message>
     <message>
-        <source>MNU_RESET_VIEW</source>
-        <translation>Reset</translation>
+        <source>DSC_FITALL</source>
+        <translation>Fit all objects inside the view frame</translation>
     </message>
     <message>
-        <source>MNU_LEFT_VIEW</source>
-        <translation>Left</translation>
+        <source>MNU_CLIPPING</source>
+        <translation>Clipping</translation>
     </message>
     <message>
-        <source>DSC_RIGHT_VIEW</source>
-        <translation>Right View</translation>
+        <source>DSC_CLIPPING</source>
+        <translation>Set clipping plane</translation>
     </message>
     <message>
-        <source>DSC_ANTICLOCKWISE_VIEW</source>
-        <translation>Rotate view counterclockwise</translation>
+        <source>MNU_BACK_VIEW</source>
+        <translation>Back</translation>
     </message>
     <message>
-        <source>DSC_CLOCKWISE_VIEW</source>
-        <translation>Rotate View Clockwise</translation>
+        <source>DSC_BACK_VIEW</source>
+        <translation>Back View</translation>
     </message>
     <message>
         <source>MNU_CHANGINGROTATIONPOINT_VIEW</source>
         <translation>Change Rotation Point</translation>
     </message>
     <message>
-        <source>DSC_FITRECT</source>
-        <translation>Fit area within the view frame</translation>
+        <source>DSC_CHANGINGROTATIONPOINT_VIEW</source>
+        <translation>Change the point, around which the rotation is performed</translation>
     </message>
     <message>
-        <source>MNU_FITRECT</source>
-        <translation>Fit Area</translation>
+        <source>MNU_BOTTOM_VIEW</source>
+        <translation>Bottom</translation>
     </message>
     <message>
         <source>DSC_BOTTOM_VIEW</source>
         <translation>Bottom View</translation>
     </message>
     <message>
-        <source>DSC_DUMP_VIEW</source>
-        <translation>Saves the active view in the image file</translation>
-    </message>
-    <message>
-        <source>DSC_ZOOM_VIEW</source>
-        <translation>Zoom the view</translation>
-    </message>
-    <message>
-        <source>MNU_ROTATIONPOINT000_VIEW</source>
-        <translation>Rotation Point : (0,0,0)</translation>
-    </message>
-    <message>
-        <source>MNU_ROTATIONPOINTSELECTED_VIEW</source>
-        <translation>Rotation Point : the point selected by the user</translation>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Reset</translation>
     </message>
     <message>
         <source>DSC_RESET_VIEW</source>
         <translation>Reset View Point</translation>
     </message>
     <message>
-        <source>ERR_DOC_CANT_SAVE_FILE</source>
-        <translation>Cannot save file</translation>
-    </message>
-    <message>
-        <source>DSC_PRESETS_VIEW</source>
-        <translation>Selection of the memorized state of the active view</translation>
+        <source>MNU_RIGHT_VIEW</source>
+        <translation>Right</translation>
     </message>
     <message>
-        <source>MNU_PRESETS_VIEW</source>
-        <translation>Restore View</translation>
+        <source>DSC_RIGHT_VIEW</source>
+        <translation>Right View</translation>
     </message>
     <message>
         <source>MNU_ANTICLOCKWISE_VIEW</source>
         <translation>Rotate counterclockwise</translation>
     </message>
     <message>
-        <source>MNU_CLOCKWISE_VIEW</source>
-        <translation>Rotate clockwise</translation>
-    </message>
-    <message>
-        <source>MNU_RIGHT_VIEW</source>
-        <translation>Right</translation>
-    </message>
-    <message>
-        <source>INF_APP_PRESETS_VIEW</source>
-        <translation>Restore view</translation>
+        <source>DSC_ANTICLOCKWISE_VIEW</source>
+        <translation>Rotate view counterclockwise</translation>
     </message>
     <message>
-        <source>LBL_XYTOOLBAR_LABEL</source>
-        <translation>XY View Operations</translation>
+        <source>MNU_CLOCKWISE_VIEW</source>
+        <translation>Rotate clockwise</translation>
     </message>
     <message>
-        <source>LBL_XZTOOLBAR_LABEL</source>
-        <translation>XZ View Operations</translation>
+        <source>DSC_CLOCKWISE_VIEW</source>
+        <translation>Rotate View Clockwise</translation>
     </message>
     <message>
-        <source>LBL_YZTOOLBAR_LABEL</source>
-        <translation>YZ View Operations</translation>
+        <source>MNU_FITRECT</source>
+        <translation>Fit Area</translation>
     </message>
     <message>
-        <source>LBL_3DTOOLBAR_LABEL</source>
-        <translation>3D View Operations</translation>
+        <source>DSC_FITRECT</source>
+        <translation>Fit area within the view frame</translation>
     </message>
     <message>
-        <source>DSC_BACK_VIEW</source>
-        <translation>Back View</translation>
+        <source>MNU_PRESETS_VIEW</source>
+        <translation>Restore View</translation>
     </message>
     <message>
-        <source>DSC_SCALING</source>
-        <translation>Change scale of axes</translation>
+        <source>DSC_PRESETS_VIEW</source>
+        <translation>Selection of the memorized state of the active view</translation>
     </message>
     <message>
         <source>MNU_SCALING</source>
         <translation>Scaling</translation>
     </message>
     <message>
-        <source>DSC_GRADUATED_AXES</source>
-        <translation>Graduated axes</translation>
+        <source>DSC_SCALING</source>
+        <translation>Change scale of axes</translation>
     </message>
     <message>
         <source>MNU_GRADUATED_AXES</source>
         <translation>Graduated axes</translation>
     </message>
     <message>
-        <source>DSC_AMBIENT</source>
-        <translation>Toogle keep only ambient light</translation>
+        <source>DSC_GRADUATED_AXES</source>
+        <translation>Graduated axes</translation>
     </message>
     <message>
         <source>MNU_AMBIENT</source>
         <translation>Toogle keep only ambient light</translation>
     </message>
     <message>
-        <source>DSC_STYLE_SWITCH</source>
-        <translation>Interaction style switch</translation>
+        <source>DSC_AMBIENT</source>
+        <translation>Toogle keep only ambient light</translation>
     </message>
     <message>
         <source>MNU_STYLE_SWITCH</source>
         <translation>Interaction style switch</translation>
     </message>
     <message>
-        <source>DSC_ZOOMING_STYLE_SWITCH</source>
-        <translation>Zooming style switch</translation>
+        <source>DSC_STYLE_SWITCH</source>
+        <translation>Interaction style switch</translation>
     </message>
     <message>
         <source>MNU_ZOOMING_STYLE_SWITCH</source>
         <translation>Zooming style switch</translation>
     </message>
     <message>
-        <source>DSC_ENABLE_PRESELECTION</source>
-        <translation>Enable/disable preselection</translation>
+        <source>DSC_ZOOMING_STYLE_SWITCH</source>
+        <translation>Zooming style switch</translation>
     </message>
     <message>
         <source>MNU_ENABLE_PRESELECTION</source>
         <translation>Enable/disable preselection</translation>
     </message>
     <message>
-        <source>DSC_ENABLE_SELECTION</source>
-        <translation>Enable/disable selection</translation>
+        <source>DSC_ENABLE_PRESELECTION</source>
+        <translation>Enable/disable preselection</translation>
     </message>
     <message>
         <source>MNU_ENABLE_SELECTION</source>
         <translation>Enable/disable selection</translation>
     </message>
     <message>
-        <source>OCC_IMAGE_FILES</source>
-        <translation>Images Files (*.bmp *.png *.jpg *.jpeg *.eps *.ps)</translation>
+        <source>DSC_ENABLE_SELECTION</source>
+        <translation>Enable/disable selection</translation>
     </message>
     <message>
-        <source>OCC_TEXTURE_FILES</source>
-        <translatorcomment>Update to new supported format (see OCCT Image_AlienPixMap documentation)</translatorcomment>
-        <translation>Image files (*.jpeg *jpg *.jpe *.png *.bmp *.gif *.ppm *.tif *.tiff* .tga *.exr)</translation>
+        <source>MNU_MAXIMIZE_VIEW</source>
+        <translation>Maximize</translation>
     </message>
     <message>
         <source>DSC_MAXIMIZE_VIEW</source>
         <translation>Maximize view</translation>
     </message>
+    <message>
+        <source>MNU_MINIMIZE_VIEW</source>
+        <translation>Minimize</translation>
+    </message>
     <message>
         <source>DSC_MINIMIZE_VIEW</source>
         <translation>Minimize view</translation>
     </message>
+    <message>
+        <source>MNU_RETURN_3D_VIEW</source>
+        <translation>Return to 3D</translation>
+    </message>
     <message>
         <source>DSC_RETURN_3D_VIEW</source>
         <translation>Return to 3D view</translation>
     </message>
     <message>
-        <source>MNU_MAXIMIZE_VIEW</source>
-        <translation>Maximize</translation>
+        <source>OCC_IMAGE_FILES</source>
+        <translation>Images Files (*.bmp *.png *.jpg *.jpeg *.eps *.ps)</translation>
     </message>
     <message>
-        <source>MNU_MINIMIZE_VIEW</source>
-        <translation>Minimize</translation>
+        <source>LBL_XYTOOLBAR_LABEL</source>
+        <translation>XY View Operations</translation>
     </message>
     <message>
-        <source>MNU_RETURN_3D_VIEW</source>
-        <translation>Return to 3D</translation>
+        <source>LBL_XZTOOLBAR_LABEL</source>
+        <translation>XZ View Operations</translation>
+    </message>
+    <message>
+        <source>LBL_YZTOOLBAR_LABEL</source>
+        <translation>YZ View Operations</translation>
+    </message>
+    <message>
+        <source>LBL_3DTOOLBAR_LABEL</source>
+        <translation>3D View Operations</translation>
     </message>
 </context>
 <context>
         <source>PARAMETERS</source>
         <translation>Parameters</translation>
     </message>
+    <message>
+        <source>HELP</source>
+        <translation>&amp;Help</translation>
+    </message>
 </context>
 </TS>
index ba56fdcdd858b4a44f6d8c2cfe23d128e7ca6ae9..1ffde87ee234c063758e0662a2496ee7ee3744e4 100755 (executable)
 <TS version="2.0" language="fr_FR" sourcelanguage="en_US">
 <context>
     <name>@default</name>
+    <message>
+        <!-- used in GEOM module: to be moved there? -->
+        <source>OCC_TEXTURE_FILES</source>
+        <translatorcomment>Update to new supported format (see OCCT Image_AlienPixMap documentation)</translatorcomment>
+        <translation>Fichiers images (*.jpeg *jpg *.jpe *.png *.bmp *.gif *.ppm *.tif *.tiff* .tga *.exr)</translation>
+    </message>
+</context>
+<context>
+    <name>OCCViewer_ViewWindow</name>
     <message>
         <source>MNU_FRONT_VIEW</source>
         <translation>Avant</translation>
     </message>
     <message>
-        <source>ERROR</source>
-        <translation>Erreur</translation>
+        <source>DSC_FRONT_VIEW</source>
+        <translation>Vue de devant</translation>
     </message>
     <message>
-        <source>MNU_DUMP_VIEW</source>
-        <translation>Sauvegarder la scène</translation>
+        <source>MNU_TOP_VIEW</source>
+        <translation>Dessus</translation>
     </message>
     <message>
         <source>DSC_TOP_VIEW</source>
         <translation>Vue de dessus</translation>
     </message>
     <message>
-        <source>MNU_PAN_VIEW</source>
-        <translation>Panoramique</translation>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Sauvegarder la scène</translation>
     </message>
     <message>
-        <source>MNU_CLONE_VIEW</source>
-        <translation>Dupliquer la scène</translation>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Sauvegarder la scène en cours dans un fichier image</translation>
     </message>
     <message>
-        <source>DSC_SHOW_TRIHEDRE</source>
-        <translation>Afficher/cacher le trièdre dans la scène</translation>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Panoramique</translation>
     </message>
     <message>
-        <source>MNU_SHOW_TRIHEDRE</source>
-        <translation>Afficher/cacher le trièdre</translation>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Déplacer la vue</translation>
     </message>
     <message>
-        <source>MNU_TOP_VIEW</source>
-        <translation>Dessus</translation>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Panoramique global</translation>
     </message>
     <message>
         <source>DSC_GLOBALPAN_VIEW</source>
         <translation>Sélection d&apos;un nouveau centre de vue</translation>
     </message>
     <message>
-        <source>DSC_ROTATE_VIEW</source>
-        <translation>Tourner le point de vue autour du centre de la scène</translation>
-    </message>
-    <message>
-        <source>MNU_ZOOM_VIEW</source>
-        <translation>Zoom</translation>
-    </message>
-    <message>
-        <source>DSC_PAN_VIEW</source>
-        <translation>Déplacer la vue</translation>
-    </message>
-    <message>
-        <source>DSC_LEFT_VIEW</source>
-        <translation>Vue de gauche</translation>
+        <source>MNU_CLONE_VIEW</source>
+        <translation>Dupliquer la scène</translation>
     </message>
     <message>
-        <source>DSC_SHOOT_VIEW</source>
-        <translation>Memoriser l&apos;état courant de la scène et l&apos;ajouter dans la liste</translation>
+        <source>DSC_CLONE_VIEW</source>
+        <translation>Ouvrir une nouvelle fenêtre de visualisation pour la scène en cours</translation>
     </message>
     <message>
-        <source>DSC_FITALL</source>
-        <translation>Redimentionner la scène pour montrer tous les objets</translation>
+        <source>MNU_SHOW_TRIHEDRE</source>
+        <translation>Afficher/cacher le trièdre</translation>
     </message>
     <message>
-        <source>MNU_FITALL</source>
-        <translation>Tout afficher</translation>
+        <source>DSC_SHOW_TRIHEDRE</source>
+        <translation>Afficher/cacher le trièdre dans la scène</translation>
     </message>
     <message>
         <source>MNU_ROTATE_VIEW</source>
         <translation>Rotation</translation>
     </message>
     <message>
-        <source>DSC_FRONT_VIEW</source>
-        <translation>Vue de devant</translation>
-    </message>
-    <message>
-        <source>MNU_ROTATIONPOINTGRAVITY_VIEW</source>
-        <translation>Point de Rotation : le centre de gravité</translation>
-    </message>
-    <message>
-        <source>MNU_GLOBALPAN_VIEW</source>
-        <translation>Panoramique global</translation>
-    </message>
-    <message>
-        <source>INF_APP_DUMP_VIEW</source>
-        <translation>Sauvegarder la vue</translation>
-    </message>
-    <message>
-        <source>DSC_CLIPPING</source>
-        <translation>Définir le plan de coupe</translation>
+        <source>DSC_ROTATE_VIEW</source>
+        <translation>Tourner le point de vue autour du centre de la scène</translation>
     </message>
     <message>
-        <source>DSC_CLONE_VIEW</source>
-        <translation>Ouvrir une nouvelle fenêtre de visualisation pour la scène en cours</translation>
+        <source>MNU_ZOOM_VIEW</source>
+        <translation>Zoom</translation>
     </message>
     <message>
-        <source>INF_APP_SHOOT_VIEW</source>
-        <translation>Mémoriser la scène</translation>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoom la vue</translation>
     </message>
     <message>
-        <source>MNU_CLIPPING</source>
-        <translation>Plan de coupe</translation>
+        <source>MNU_LEFT_VIEW</source>
+        <translation>Gauche</translation>
     </message>
     <message>
-        <source>MNU_BACK_VIEW</source>
-        <translation>Arrière</translation>
+        <source>DSC_LEFT_VIEW</source>
+        <translation>Vue de gauche</translation>
     </message>
     <message>
         <source>MNU_SHOOT_VIEW</source>
         <translation>Memoriser la vue</translation>
     </message>
     <message>
-        <source>DSC_CHANGINGROTATIONPOINT_VIEW</source>
-        <translation>Changer le point autour duquel la scène est tournée</translation>
+        <source>DSC_SHOOT_VIEW</source>
+        <translation>Memoriser l&apos;état courant de la scène et l&apos;ajouter dans la liste</translation>
     </message>
     <message>
-        <source>MNU_BOTTOM_VIEW</source>
-        <translation>Dessous</translation>
+        <source>MNU_FITALL</source>
+        <translation>Tout afficher</translation>
     </message>
     <message>
-        <source>MNU_RESET_VIEW</source>
-        <translation>Restaurer le point de vue</translation>
+        <source>DSC_FITALL</source>
+        <translation>Redimentionner la scène pour montrer tous les objets</translation>
     </message>
     <message>
-        <source>MNU_LEFT_VIEW</source>
-        <translation>Gauche</translation>
+        <source>MNU_CLIPPING</source>
+        <translation>Plan de coupe</translation>
     </message>
     <message>
-        <source>DSC_RIGHT_VIEW</source>
-        <translation>Vue de droite</translation>
+        <source>DSC_CLIPPING</source>
+        <translation>Définir le plan de coupe</translation>
     </message>
     <message>
-        <source>DSC_ANTICLOCKWISE_VIEW</source>
-        <translation>Tourner la vue à gauche</translation>
+        <source>MNU_BACK_VIEW</source>
+        <translation>Arrière</translation>
     </message>
     <message>
-        <source>DSC_CLOCKWISE_VIEW</source>
-        <translation>Tourner la vue à droite</translation>
+        <source>DSC_BACK_VIEW</source>
+        <translation>Vue arrière</translation>
     </message>
     <message>
         <source>MNU_CHANGINGROTATIONPOINT_VIEW</source>
         <translation>Changer le point de rotation</translation>
     </message>
     <message>
-        <source>DSC_FITRECT</source>
-        <translation>Redimensionner la scène pour ne montrer que sa partie choisie par l&apos;encadré</translation>
+        <source>DSC_CHANGINGROTATIONPOINT_VIEW</source>
+        <translation>Changer le point autour duquel la scène est tournée</translation>
     </message>
     <message>
-        <source>MNU_FITRECT</source>
-        <translation>Afficher la zone</translation>
+        <source>MNU_BOTTOM_VIEW</source>
+        <translation>Dessous</translation>
     </message>
     <message>
         <source>DSC_BOTTOM_VIEW</source>
         <translation>Vue de dessous</translation>
     </message>
     <message>
-        <source>DSC_DUMP_VIEW</source>
-        <translation>Sauvegarder la scène en cours dans un fichier image</translation>
-    </message>
-    <message>
-        <source>DSC_ZOOM_VIEW</source>
-        <translation>Zoom la vue</translation>
-    </message>
-    <message>
-        <source>MNU_ROTATIONPOINT000_VIEW</source>
-        <translation>Point de Rotation : (0,0,0)</translation>
-    </message>
-    <message>
-        <source>MNU_ROTATIONPOINTSELECTED_VIEW</source>
-        <translation>Point de Rotation : le point choisi par l&apos;utilisateur</translation>
+        <source>MNU_RESET_VIEW</source>
+        <translation>Restaurer le point de vue</translation>
     </message>
     <message>
         <source>DSC_RESET_VIEW</source>
         <translation>Restaurer le point de vue</translation>
     </message>
     <message>
-        <source>ERR_DOC_CANT_SAVE_FILE</source>
-        <translation>Impossible de sauvegarder le fichier</translation>
-    </message>
-    <message>
-        <source>DSC_PRESETS_VIEW</source>
-        <translation>Restaurer d&apos;un état mémorisé de la scène courante</translation>
+        <source>MNU_RIGHT_VIEW</source>
+        <translation>Droit</translation>
     </message>
     <message>
-        <source>MNU_PRESETS_VIEW</source>
-        <translation>Restaurer la vue</translation>
+        <source>DSC_RIGHT_VIEW</source>
+        <translation>Vue de droite</translation>
     </message>
     <message>
         <source>MNU_ANTICLOCKWISE_VIEW</source>
         <translation>Tourner à gauche</translation>
     </message>
     <message>
-        <source>MNU_CLOCKWISE_VIEW</source>
-        <translation>Tourner à droite</translation>
-    </message>
-    <message>
-        <source>MNU_RIGHT_VIEW</source>
-        <translation>Droit</translation>
-    </message>
-    <message>
-        <source>INF_APP_PRESETS_VIEW</source>
-        <translation>Restaurer la scène</translation>
+        <source>DSC_ANTICLOCKWISE_VIEW</source>
+        <translation>Tourner la vue à gauche</translation>
     </message>
     <message>
-        <source>LBL_XYTOOLBAR_LABEL</source>
-        <translation>Opérations sur la vue XY</translation>
+        <source>MNU_CLOCKWISE_VIEW</source>
+        <translation>Tourner à droite</translation>
     </message>
     <message>
-        <source>LBL_XZTOOLBAR_LABEL</source>
-        <translation>Opérations sur la vue XZ</translation>
+        <source>DSC_CLOCKWISE_VIEW</source>
+        <translation>Tourner la vue à droite</translation>
     </message>
     <message>
-        <source>LBL_YZTOOLBAR_LABEL</source>
-        <translation>Opérations sur la vue YZ</translation>
+        <source>MNU_FITRECT</source>
+        <translation>Afficher la zone</translation>
     </message>
     <message>
-        <source>LBL_3DTOOLBAR_LABEL</source>
-        <translation>Opérations sur la vue 3D</translation>
+        <source>DSC_FITRECT</source>
+        <translation>Redimensionner la scène pour ne montrer que sa partie choisie par l&apos;encadré</translation>
     </message>
     <message>
-        <source>DSC_BACK_VIEW</source>
-        <translation>Vue arrière</translation>
+        <source>MNU_PRESETS_VIEW</source>
+        <translation>Restaurer la vue</translation>
     </message>
     <message>
-        <source>DSC_SCALING</source>
-        <translation>Changer l&apos;échelle des axes de coordonnées</translation>
+        <source>DSC_PRESETS_VIEW</source>
+        <translation>Restaurer d&apos;un état mémorisé de la scène courante</translation>
     </message>
     <message>
         <source>MNU_SCALING</source>
         <translation>Changer l&apos;échelle</translation>
     </message>
     <message>
-        <source>DSC_GRADUATED_AXES</source>
-        <translation>Axes gradués</translation>
+        <source>DSC_SCALING</source>
+        <translation>Changer l&apos;échelle des axes de coordonnées</translation>
     </message>
     <message>
         <source>MNU_GRADUATED_AXES</source>
         <translation>Axes gradués</translation>
     </message>
     <message>
-        <source>DSC_AMBIENT</source>
-        <translation>Ne montrer que la lumière d&apos;ambiance</translation>
+        <source>DSC_GRADUATED_AXES</source>
+        <translation>Axes gradués</translation>
     </message>
     <message>
         <source>MNU_AMBIENT</source>
         <translation>Ne montrer que la lumière d&apos;ambiance</translation>
     </message>
     <message>
-        <source>DSC_STYLE_SWITCH</source>
-        <translation>Changer le style d&apos;intéraction</translation>
+        <source>DSC_AMBIENT</source>
+        <translation>Ne montrer que la lumière d&apos;ambiance</translation>
     </message>
     <message>
         <source>MNU_STYLE_SWITCH</source>
         <translation>Changer le style d&apos;intéraction</translation>
     </message>
     <message>
-        <source>DSC_ZOOMING_STYLE_SWITCH</source>
-        <translation>Changer le style de zoom</translation>
+        <source>DSC_STYLE_SWITCH</source>
+        <translation>Changer le style d&apos;intéraction</translation>
     </message>
     <message>
         <source>MNU_ZOOMING_STYLE_SWITCH</source>
         <translation>Changer le style de zoom</translation>
     </message>
     <message>
-        <source>DSC_ENABLE_PRESELECTION</source>
-        <translation>Activer/Désactiver la préselection</translation>
+        <source>DSC_ZOOMING_STYLE_SWITCH</source>
+        <translation>Changer le style de zoom</translation>
     </message>
     <message>
         <source>MNU_ENABLE_PRESELECTION</source>
         <translation>Activer/Désactiver préselection</translation>
     </message>
     <message>
-        <source>DSC_ENABLE_SELECTION</source>
-        <translation>Activer/Désactiver la selection</translation>
+        <source>DSC_ENABLE_PRESELECTION</source>
+        <translation>Activer/Désactiver la préselection</translation>
     </message>
     <message>
         <source>MNU_ENABLE_SELECTION</source>
         <translation>Activer/Désactiver selection</translation>
     </message>
     <message>
-        <source>OCC_IMAGE_FILES</source>
-        <translation>Fichiers images (*.bmp *.png *.jpg *.jpeg *.eps *.ps)</translation>
+        <source>DSC_ENABLE_SELECTION</source>
+        <translation>Activer/Désactiver la selection</translation>
     </message>
     <message>
-        <source>OCC_TEXTURE_FILES</source>
-        <translation>Fichiers images (*.jpeg *jpg *.jpe *.png *.bmp *.gif *.ppm *.tif *.tiff* .tga *.exr)</translation>
+        <source>MNU_MAXIMIZE_VIEW</source>
+        <translation>Maximiser</translation>
     </message>
     <message>
         <source>DSC_MAXIMIZE_VIEW</source>
         <translation>Maximiser la vue</translation>
     </message>
+    <message>
+        <source>MNU_MINIMIZE_VIEW</source>
+        <translation>Minimiser</translation>
+    </message>
     <message>
         <source>DSC_MINIMIZE_VIEW</source>
         <translation>Minimiser la vue</translation>
     </message>
+    <message>
+        <source>MNU_RETURN_3D_VIEW</source>
+        <translation>Retour à la vue 3D</translation>
+    </message>
     <message>
         <source>DSC_RETURN_3D_VIEW</source>
         <translation>Retour à la vue 3D</translation>
     </message>
     <message>
-        <source>MNU_MAXIMIZE_VIEW</source>
-        <translation>Maximiser</translation>
+        <source>OCC_IMAGE_FILES</source>
+        <translation>Fichiers images (*.bmp *.png *.jpg *.jpeg *.eps *.ps)</translation>
     </message>
     <message>
-        <source>MNU_MINIMIZE_VIEW</source>
-        <translation>Minimiser</translation>
+        <source>LBL_XYTOOLBAR_LABEL</source>
+        <translation>Opérations sur la vue XY</translation>
     </message>
     <message>
-        <source>MNU_RETURN_3D_VIEW</source>
-        <translation>Retour à la vue 3D</translation>
+        <source>LBL_XZTOOLBAR_LABEL</source>
+        <translation>Opérations sur la vue XZ</translation>
+    </message>
+    <message>
+        <source>>LBL_YZTOOLBAR_LABEL</source>
+        <translation>Opérations sur la vue YZ</translation>
+    </message>
+    <message>
+        <source>LBL_3DTOOLBAR_LABEL</source>
+        <translation>Opérations sur la vue 3D</translation>
     </message>
 </context>
 <context>
         <source>PARAMETERS</source>
         <translation>Paramètres</translation>
     </message>
+    <message>
+        <source>HELP</source>
+        <translation>Ai&amp;de</translation>
+    </message>
 </context>
 </TS>
index f5afea2c963e5bc099de785b5ae11088394610bc..dc12be6ddca1c371d2ce4c26779e5d6f853608ee 100644 (file)
 <TS version="2.0" language="ja" sourcelanguage="en">
   <context>
     <name>@default</name>
+    <message>
+      <!-- used in GEOM module: to be moved there? -->
+      <source>OCC_TEXTURE_FILES</source>
+      <translatorcomment>Update to new supported format (see OCCT Image_AlienPixMap documentation)</translatorcomment>
+      <translation>イメージファイル (*.bmp *.gif *.pix *.xwd *.rgb *.rs)</translation>
+    </message>
+  </context>
+  <context>
+    <name>OCCViewer_ViewWindow</name>
     <message>
       <source>MNU_FRONT_VIEW</source>
       <translation>正面</translation>
     </message>
     <message>
-      <source>ERROR</source>
-      <translation>エラー</translation>
+      <source>DSC_FRONT_VIEW</source>
+      <translation>正面</translation>
     </message>
     <message>
-      <source>MNU_DUMP_VIEW</source>
-      <translation>シーンを保存します。</translation>
+      <source>MNU_TOP_VIEW</source>
+      <translation>上面</translation>
     </message>
     <message>
       <source>DSC_TOP_VIEW</source>
       <translation>上から見る</translation>
     </message>
     <message>
-      <source>MNU_PAN_VIEW</source>
-      <translation>並進移動</translation>
+      <source>MNU_DUMP_VIEW</source>
+      <translation>シーンを保存します。</translation>
     </message>
     <message>
-      <source>MNU_CLONE_VIEW</source>
-      <translation>ビューの複製</translation>
+      <source>DSC_DUMP_VIEW</source>
+      <translation>現在のシーンをイメージ ファイルに保存します。</translation>
     </message>
     <message>
-      <source>DSC_SHOW_TRIHEDRE</source>
-      <translation>表示/非表示の三面体をシーンに</translation>
+      <source>MNU_PAN_VIEW</source>
+      <translation>並進移動</translation>
     </message>
     <message>
-      <source>MNU_SHOW_TRIHEDRE</source>
-      <translation>軸の表示/非表示</translation>
+      <source>DSC_PAN_VIEW</source>
+      <translation>ビューを移動します。</translation>
     </message>
     <message>
-      <source>MNU_TOP_VIEW</source>
-      <translation>上面</translation>
+      <source>MNU_GLOBALPAN_VIEW</source>
+      <translation>グローバルパンニング</translation>
     </message>
     <message>
       <source>DSC_GLOBALPAN_VIEW</source>
       <translation>ビューの新しい中心地の選択</translation>
     </message>
     <message>
-      <source>DSC_ROTATE_VIEW</source>
-      <translation>ステージの中心の周りを回転します。</translation>
-    </message>
-    <message>
-      <source>MNU_ZOOM_VIEW</source>
-      <translation>ズーム</translation>
-    </message>
-    <message>
-      <source>DSC_PAN_VIEW</source>
-      <translation>ビューを移動します。</translation>
-    </message>
-    <message>
-      <source>DSC_LEFT_VIEW</source>
-      <translation>左側のビュー</translation>
+      <source>MNU_CLONE_VIEW</source>
+      <translation>ビューの複製</translation>
     </message>
     <message>
-      <source>DSC_SHOOT_VIEW</source>
-      <translation>ç\8a¶æ\85\8bã\81®ç\8f¾å\9c¨ã\81®ã\82·ã\83¼ã\83³ã\82\92ä¿\9då­\98ã\81\97ã\80\81ä¸\80覧ã\81«è¿½å\8a </translation>
+      <source>DSC_CLONE_VIEW</source>
+      <translation>ç\8f¾å\9c¨ã\81®ã\82¹ã\83\86ã\83¼ã\82¸ã\81®å\8f¯è¦\96å\8c\96ã\81®æ\96°ã\81\97ã\81\84ã\82¦ã\82£ã\83³ã\83\89ã\82¦ã\82\92é\96\8bã\81\8f</translation>
     </message>
     <message>
-      <source>DSC_FITALL</source>
-      <translation>すべてのオブジェクトを表示するには、シーンを Redimentionner</translation>
+      <source>MNU_SHOW_TRIHEDRE</source>
+      <translation>軸の表示/非表示</translation>
     </message>
     <message>
-      <source>MNU_FITALL</source>
-      <translation>全体表示</translation>
+      <source>DSC_SHOW_TRIHEDRE</source>
+      <translation>表示/非表示の三面体をシーンに</translation>
     </message>
     <message>
       <source>MNU_ROTATE_VIEW</source>
       <translation>回転</translation>
     </message>
     <message>
-      <source>DSC_FRONT_VIEW</source>
-      <translation>正面</translation>
-    </message>
-    <message>
-      <source>MNU_ROTATIONPOINTGRAVITY_VIEW</source>
-      <translation>回転点: 重力の中心部</translation>
-    </message>
-    <message>
-      <source>MNU_GLOBALPAN_VIEW</source>
-      <translation>グローバルパンニング</translation>
-    </message>
-    <message>
-      <source>INF_APP_DUMP_VIEW</source>
-      <translation>ビューを保存します。</translation>
-    </message>
-    <message>
-      <source>DSC_CLIPPING</source>
-      <translation>クリップ平面を定義します。</translation>
+      <source>DSC_ROTATE_VIEW</source>
+      <translation>ステージの中心の周りを回転します。</translation>
     </message>
     <message>
-      <source>DSC_CLONE_VIEW</source>
-      <translation>現在のステージの可視化の新しいウィンドウを開く</translation>
+      <source>MNU_ZOOM_VIEW</source>
+      <translation>ズーム</translation>
     </message>
     <message>
-      <source>INF_APP_SHOOT_VIEW</source>
-      <translation>場面を覚えています。</translation>
+      <source>DSC_ZOOM_VIEW</source>
+      <translation>ズーム</translation>
     </message>
     <message>
-      <source>MNU_CLIPPING</source>
-      <translation>面</translation>
+      <source>MNU_LEFT_VIEW</source>
+      <translation>左側面</translation>
     </message>
     <message>
-      <source>MNU_BACK_VIEW</source>
-      <translation>背面</translation>
+      <source>DSC_LEFT_VIEW</source>
+      <translation>左側のビュー</translation>
     </message>
     <message>
       <source>MNU_SHOOT_VIEW</source>
       <translation>ビューの保存</translation>
     </message>
     <message>
-      <source>DSC_CHANGINGROTATIONPOINT_VIEW</source>
-      <translation>シーンになってポイントを変更します。</translation>
+      <source>DSC_SHOOT_VIEW</source>
+      <translation>状態の現在のシーンを保存し、一覧に追加</translation>
     </message>
     <message>
-      <source>MNU_BOTTOM_VIEW</source>
-      <translation>åº\95é\9d¢</translation>
+      <source>MNU_FITALL</source>
+      <translation>å\85¨ä½\93表示</translation>
     </message>
     <message>
-      <source>MNU_RESET_VIEW</source>
-      <translation>表示リセット</translation>
+      <source>DSC_FITALL</source>
+      <translation>すべてのオブジェクトを表示するには、シーンを Redimentionner</translation>
     </message>
     <message>
-      <source>MNU_LEFT_VIEW</source>
-      <translation>左側面</translation>
+      <source>MNU_CLIPPING</source>
+      <translation>面</translation>
     </message>
     <message>
-      <source>DSC_RIGHT_VIEW</source>
-      <translation>右側のビュー</translation>
+      <source>DSC_CLIPPING</source>
+      <translation>クリップ平面を定義します。</translation>
     </message>
     <message>
-      <source>DSC_ANTICLOCKWISE_VIEW</source>
-      <translation>表示ã\82\92å·¦ã\81«</translation>
+      <source>MNU_BACK_VIEW</source>
+      <translation>è\83\8cé\9d¢</translation>
     </message>
     <message>
-      <source>DSC_CLOCKWISE_VIEW</source>
-      <translation>右のビューを回転させる</translation>
+      <source>DSC_BACK_VIEW</source>
+      <translation>背面図</translation>
     </message>
     <message>
       <source>MNU_CHANGINGROTATIONPOINT_VIEW</source>
       <translation>回転の基準点を変更</translation>
     </message>
     <message>
-      <source>DSC_FITRECT</source>
-      <translation>彼の党をボックスで選択を表示するには、ステージのサイズを変更します。</translation>
+      <source>DSC_CHANGINGROTATIONPOINT_VIEW</source>
+      <translation>シーンになってポイントを変更します。</translation>
     </message>
     <message>
-      <source>MNU_FITRECT</source>
-      <translation>表示ã\82¨ã\83ªã\82¢</translation>
+      <source>MNU_BOTTOM_VIEW</source>
+      <translation>åº\95é\9d¢</translation>
     </message>
     <message>
       <source>DSC_BOTTOM_VIEW</source>
       <translation>下から表示します。</translation>
     </message>
     <message>
-      <source>DSC_DUMP_VIEW</source>
-      <translation>現在のシーンをイメージ ファイルに保存します。</translation>
-    </message>
-    <message>
-      <source>DSC_ZOOM_VIEW</source>
-      <translation>ズーム</translation>
-    </message>
-    <message>
-      <source>MNU_ROTATIONPOINT000_VIEW</source>
-      <translation>回転点: (0,0,0)</translation>
-    </message>
-    <message>
-      <source>MNU_ROTATIONPOINTSELECTED_VIEW</source>
-      <translation>回転点: ユーザーが選択したポイント</translation>
+      <source>MNU_RESET_VIEW</source>
+      <translation>表示リセット</translation>
     </message>
     <message>
       <source>DSC_RESET_VIEW</source>
       <translation>ビューのポイントを復元します。</translation>
     </message>
     <message>
-      <source>ERR_DOC_CANT_SAVE_FILE</source>
-      <translation>ファイルを保存できませんでした。</translation>
-    </message>
-    <message>
-      <source>DSC_PRESETS_VIEW</source>
-      <translation>状態の復元は、現在のシーンの記憶</translation>
+      <source>MNU_RIGHT_VIEW</source>
+      <translation>右側面</translation>
     </message>
     <message>
-      <source>MNU_PRESETS_VIEW</source>
-      <translation>ビューの読み込み</translation>
+      <source>DSC_RIGHT_VIEW</source>
+      <translation>右側のビュー</translation>
     </message>
     <message>
       <source>MNU_ANTICLOCKWISE_VIEW</source>
       <translation>左回転</translation>
     </message>
     <message>
-      <source>MNU_CLOCKWISE_VIEW</source>
-      <translation>右回転</translation>
-    </message>
-    <message>
-      <source>MNU_RIGHT_VIEW</source>
-      <translation>右側面</translation>
-    </message>
-    <message>
-      <source>INF_APP_PRESETS_VIEW</source>
-      <translation>ビューの復元</translation>
+      <source>DSC_ANTICLOCKWISE_VIEW</source>
+      <translation>表示を左に</translation>
     </message>
     <message>
-      <source>LBL_XYTOOLBAR_LABEL</source>
-      <translation>XY ビューの操作</translation>
+      <source>MNU_CLOCKWISE_VIEW</source>
+      <translation>右回転</translation>
     </message>
     <message>
-      <source>LBL_XZTOOLBAR_LABEL</source>
-      <translation>XZ ビューの操作</translation>
+      <source>DSC_CLOCKWISE_VIEW</source>
+      <translation>右のビューを回転させる</translation>
     </message>
     <message>
-      <source>LBL_YZTOOLBAR_LABEL</source>
-      <translation>YZ ビューの操作</translation>
+      <source>MNU_FITRECT</source>
+      <translation>表示エリア</translation>
     </message>
     <message>
-      <source>LBL_3DTOOLBAR_LABEL</source>
-      <translation>3D ビューの操作</translation>
+      <source>DSC_FITRECT</source>
+      <translation>彼の党をボックスで選択を表示するには、ステージのサイズを変更します。</translation>
     </message>
     <message>
-      <source>DSC_BACK_VIEW</source>
-      <translation>背面図</translation>
+      <source>MNU_PRESETS_VIEW</source>
+      <translation>ビューの読み込み</translation>
     </message>
     <message>
-      <source>DSC_SCALING</source>
-      <translation>座標のスケールの軸を変更します。</translation>
+      <source>DSC_PRESETS_VIEW</source>
+      <translation>状態の復元は、現在のシーンの記憶</translation>
     </message>
     <message>
       <source>MNU_SCALING</source>
       <translation>軸のスケーリング</translation>
     </message>
     <message>
-      <source>DSC_GRADUATED_AXES</source>
-      <translation>目盛付軸</translation>
+      <source>DSC_SCALING</source>
+      <translation>座標のスケールの軸を変更します。</translation>
     </message>
     <message>
       <source>MNU_GRADUATED_AXES</source>
       <translation>目盛付軸</translation>
     </message>
     <message>
-      <source>DSC_AMBIENT</source>
-      <translation>ç\92°å¢\83å\85\89ã\81®ã\81¿ã\81®è¡¨ç¤º</translation>
+      <source>DSC_GRADUATED_AXES</source>
+      <translation>ç\9b®ç\9b\9bä»\98軸</translation>
     </message>
     <message>
       <source>MNU_AMBIENT</source>
       <translation>アンビエント ライトを表示します。</translation>
     </message>
     <message>
-      <source>DSC_STYLE_SWITCH</source>
-      <translation>ç\9b¸äº\92ä½\9cç\94¨ã\81®ã\82¹ã\82¿ã\82¤ã\83«ã\82\92å¤\89æ\9b´ã\81\97ã\81¾ã\81\99ã\80\82</translation>
+      <source>DSC_AMBIENT</source>
+      <translation>ç\92°å¢\83å\85\89ã\81®ã\81¿ã\81®è¡¨ç¤º</translation>
     </message>
     <message>
       <source>MNU_STYLE_SWITCH</source>
       <translation>相互作用のスタイルを変更します。</translation>
     </message>
     <message>
-      <source>DSC_ZOOMING_STYLE_SWITCH</source>
-      <translation>ズームのスタイルを変更します。</translation>
+      <source>DSC_STYLE_SWITCH</source>
+      <translation>相互作用のスタイルを変更します。</translation>
     </message>
     <message>
       <source>MNU_ZOOMING_STYLE_SWITCH</source>
       <translation>ズームのスタイルを変更します。</translation>
     </message>
     <message>
-      <source>DSC_ENABLE_PRESELECTION</source>
-      <translation>予選の有効/無効にします。</translation>
+      <source>DSC_ZOOMING_STYLE_SWITCH</source>
+      <translation>ズームのスタイルを変更します。</translation>
     </message>
     <message>
       <source>MNU_ENABLE_PRESELECTION</source>
       <translation>予選の有効/無効にします。</translation>
     </message>
     <message>
-      <source>DSC_ENABLE_SELECTION</source>
-      <translation>選択を有効/無効にします。</translation>
+      <source>DSC_ENABLE_PRESELECTION</source>
+      <translation>予選の有効/無効にします。</translation>
     </message>
     <message>
       <source>MNU_ENABLE_SELECTION</source>
       <translation>選択を有効/無効にします。</translation>
     </message>
     <message>
-      <source>OCC_IMAGE_FILES</source>
-      <translation>イメージファイル (*.bmp *.png *.jpg *.jpeg *.eps *.ps)</translation>
+      <source>DSC_ENABLE_SELECTION</source>
+      <translation>選択を有効/無効にします。</translation>
     </message>
     <message>
-      <source>OCC_TEXTURE_FILES</source>
-      <translatorcomment>Update to new supported format (see OCCT Image_AlienPixMap documentation)</translatorcomment>
-      <translation>イメージファイル (*.bmp *.gif *.pix *.xwd *.rgb *.rs)</translation>
+      <source>MNU_MAXIMIZE_VIEW</source>
+      <translation>ビューの最大化</translation>
     </message>
     <message>
       <source>DSC_MAXIMIZE_VIEW</source>
       <translation>ビューの最大化</translation>
     </message>
+    <message>
+      <source>MNU_MINIMIZE_VIEW</source>
+      <translation>ビューの最小化</translation>
+    </message>
     <message>
       <source>DSC_MINIMIZE_VIEW</source>
       <translation>ビューの最小化</translation>
     </message>
+    <message>
+      <source>MNU_RETURN_3D_VIEW</source>
+      <translation>3D に戻る</translation>
+    </message>
     <message>
       <source>DSC_RETURN_3D_VIEW</source>
       <translation>3D view に戻る</translation>
     </message>
     <message>
-      <source>MNU_MAXIMIZE_VIEW</source>
-      <translation>ã\83\93ã\83¥ã\83¼ã\81®æ\9c\80大å\8c\96</translation>
+      <source>OCC_IMAGE_FILES</source>
+      <translation>ã\82¤ã\83¡ã\83¼ã\82¸ã\83\95ã\82¡ã\82¤ã\83« (*.bmp *.png *.jpg *.jpeg *.eps *.ps)</translation>
     </message>
     <message>
-      <source>MNU_MINIMIZE_VIEW</source>
-      <translation>ビューの最小化</translation>
+      <source>LBL_XYTOOLBAR_LABEL</source>
+      <translation>XY ビューの操作</translation>
     </message>
     <message>
-      <source>MNU_RETURN_3D_VIEW</source>
-      <translation>3D に戻る</translation>
+      <source>LBL_XZTOOLBAR_LABEL</source>
+      <translation>XZ ビューの操作</translation>
+    </message>
+    <message>
+      <source>LBL_YZTOOLBAR_LABEL</source>
+      <translation>YZ ビューの操作</translation>
+    </message>
+    <message>
+      <source>LBL_3DTOOLBAR_LABEL</source>
+      <translation>3D ビューの操作</translation>
     </message>
   </context>
   <context>
       <source>PARAMETERS</source>
       <translation>パラメータ</translation>
     </message>
+    <message>
+        <source>HELP</source>
+        <translation>ヘルプ(&amp;H)</translation>
+    </message>
   </context>
 </TS>
index a2222caa553ce03cfc55d44cd2c3ead0d106032c..73fd3b40c90db4af00109e293bc1bd618a1d76e5 100644 (file)
@@ -349,26 +349,28 @@ void Plot2d_QwtPlotCurve::updateLegend( const QwtPlotItem* thePlotItem,
 
   QwtPlotCurve::updateLegend( thePlotItem, theLegendData );
 
-  const QVariant itemInfo = thePlotItem->plot()->itemToInfo( const_cast< QwtPlotItem *>( thePlotItem ) );
-  QwtLegend* legend = dynamic_cast<QwtLegend*>( thePlotItem->plot()->legend() );
-  QWidget* widget = legend->legendWidget( itemInfo );
-  QwtLegendLabel* label = dynamic_cast<QwtLegendLabel*>( widget );
-  if( Plot2d_QwtLegendLabel* anItem = (Plot2d_QwtLegendLabel*)label ) {
-    int aMode = Plot2d_QwtLegendLabel::IM_None;
-    if( myYAxisIdentifierEnabled )
-      aMode = myYAxis == QwtPlot::yRight ?
-              Plot2d_QwtLegendLabel::IM_Right :
-              Plot2d_QwtLegendLabel::IM_Left;
-    anItem->setYAxisIdentifierMode( aMode );
-
-    anItem->setSymbol( legendSymbol() );
-    if( Plot2d_Plot2d* plot = dynamic_cast<Plot2d_Plot2d*>( thePlotItem->plot() ) )
-      anItem->setSymbolType( plot->getLegendSymbolType() );
-    anItem->setPen( legendPen() );
-
-    anItem->setSelected( isSelected() );
-    anItem->updateHighlit();
-    anItem->repaint();
+  const QVariant itemInfo = thePlotItem->plot()->itemToInfo( const_cast< QwtPlotItem *>( thePlotItem ) );  
+  if( QwtLegend* legend = dynamic_cast<QwtLegend*>( thePlotItem->plot()->legend() ) ) {
+    if( QWidget* widget = legend->legendWidget( itemInfo ) ) {
+      QwtLegendLabel* label = dynamic_cast<QwtLegendLabel*>( widget );
+      if( Plot2d_QwtLegendLabel* anItem = (Plot2d_QwtLegendLabel*)label ) {
+       int aMode = Plot2d_QwtLegendLabel::IM_None;
+       if( myYAxisIdentifierEnabled )
+         aMode = myYAxis == QwtPlot::yRight ?
+           Plot2d_QwtLegendLabel::IM_Right :
+           Plot2d_QwtLegendLabel::IM_Left;
+       anItem->setYAxisIdentifierMode( aMode );
+       
+       anItem->setSymbol( legendSymbol() );
+       if( Plot2d_Plot2d* plot = dynamic_cast<Plot2d_Plot2d*>( thePlotItem->plot() ) )
+         anItem->setSymbolType( plot->getLegendSymbolType() );
+       anItem->setPen( legendPen() );
+       
+       anItem->setSelected( isSelected() );
+       anItem->updateHighlit();
+       anItem->repaint();
+      }
+    }
   }
 }
 
index a52a6ab9920cad7859601be58d22cd2b6482c500..1fd36d09b9a0d48de6fe6ef805860d634ef37935 100755 (executable)
@@ -1094,7 +1094,7 @@ QwtPlotCurve *Plot2d_ViewFrame::createSegment( double *X, double *Y, int nbPoint
   aPCurve->setSamples( X, Y, nbPoint);
 
   aPCurve->setPen( QPen( lineColor, lineWidth, lineKind));
-  QwtSymbol* aSymbol;
+  QwtSymbol* aSymbol = new QwtSymbol();
   aSymbol->setStyle( markerKind );
   aPCurve->setSymbol( aSymbol );
 
@@ -2419,9 +2419,9 @@ void Plot2d_ViewFrame::setHorScaleMode( const int mode, bool update )
   // non-positive X/Y coordinate
   if ( mode && !isXLogEnabled() ){
 #ifndef NO_SUIT
-    SUIT_MessageBox::warning(this, tr("WARNING"), tr("WRN_XLOG_NOT_ALLOWED"));
+    SUIT_MessageBox::warning(this, tr("WRN_WARNING"), tr("WRN_XLOG_NOT_ALLOWED"));
 #else
-    QMessageBox::warning(this, tr("WARNING"), tr("WRN_XLOG_NOT_ALLOWED"));
+    QMessageBox::warning(this, tr("WRN_WARNING"), tr("WRN_XLOG_NOT_ALLOWED"));
 #endif
     return;
   }
@@ -2462,9 +2462,9 @@ void Plot2d_ViewFrame::setVerScaleMode( const int mode, bool update )
   // non-positive X/Y coordinate
   if ( mode && !isYLogEnabled() ){
 #ifndef NO_SUIT
-    SUIT_MessageBox::warning(this, tr("WARNING"), tr("WRN_YLOG_NOT_ALLOWED"));
+    SUIT_MessageBox::warning(this, tr("WRN_WARNING"), tr("WRN_YLOG_NOT_ALLOWED"));
 #else
-    QMessageBox::warning(this, tr("WARNING"), tr("WRN_YLOG_NOT_ALLOWED"));
+    QMessageBox::warning(this, tr("WRN_WARNING"), tr("WRN_YLOG_NOT_ALLOWED"));
 #endif
     return;
   }
index 98ce2d862c220e0f1565cf3599d998bb137777a2..9b3629d50a5b1e17a64a930cccb14298fec6efc1 100755 (executable)
@@ -475,7 +475,9 @@ void Plot2d_ViewWindow::createActions()
 void Plot2d_ViewWindow::createToolBar()
 {
   QtxActionToolMgr* mgr = toolMgr();
-  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ), false );
+  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ),          // title (language-dependant)
+                                 QString( "Plot2dViewOperations" ),  // name (language-independant)
+                                 false );                            // disable floatable toolbar
   mgr->append( DumpId, myToolBar );
   mgr->append( ScaleOpId, myToolBar );
   mgr->append( MoveOpId, myToolBar );
index ff29205857c08b5da5218e5549ad72612a423414..1edcb27b481f1403091ef3011f53488fc5550be2 100644 (file)
 <context>
     <name>@default</name>
     <message>
-        <source>PLOT2D_CURVE_TYPE_LBL</source>
-        <translation>Curve type:</translation>
+        <source>DASHDOT_LINE_LBL</source>
+        <translation>DashDot</translation>
     </message>
     <message>
-        <source>ERROR</source>
-        <translation>Error</translation>
+        <source>DASH_LINE_LBL</source>
+        <translation>Dash</translation>
     </message>
     <message>
-        <source>PLOT2D_SET_AS_DEFAULT_CHECK</source>
-        <translation>Save settings as default</translation>
+        <source>SOLID_LINE_LBL</source>
+        <translation>Solid</translation>
     </message>
     <message>
-        <source>TLT_SETUP_CURVE</source>
-        <translation>Setup Curve</translation>
+        <source>DOT_LINE_LBL</source>
+        <translation>Dot</translation>
     </message>
     <message>
-        <source>MNU_DUMP_VIEW</source>
-        <translation>Dump view...</translation>
+        <source>DAHSDOTDOT_LINE_LBL</source>
+        <translation>DashDotDot</translation>
     </message>
     <message>
-        <source>PLOT2D_SCALE_MODE_HOR</source>
-        <translation>Horizontal axis:</translation>
+        <source>NONE_LINE_LBL</source>
+        <translation>None</translation>
     </message>
     <message>
-        <source>PLOT2D_NORMALIZE_TLT</source>
-        <translation>Normalization</translation>
+        <source>DTRIANGLE_MARKER_LBL</source>
+        <translation>Downward triangle</translation>
     </message>
     <message>
-        <source>PLOT2D_NORMALIZE_MODE_MIN</source>
-        <translation>Normalize to minimum</translation>
+        <source>UTRIANGLE_MARKER_LBL</source>
+        <translation>Upward triangle</translation>
     </message>
     <message>
-        <source>PLOT2D_NORMALIZE_MODE_MAX</source>
-        <translation>Normalize to maximum</translation>
+        <source>LTRIANGLE_MARKER_LBL</source>
+        <translation>Leftward triangle</translation>
     </message>
     <message>
-        <source>PLOT2D_NORMALIZE_LEFT_AXIS</source>
-        <translation>Left Y Axis: </translation>
+        <source>RTRIANGLE_MARKER_LBL</source>
+        <translation>Rightward triangle</translation>
     </message>
     <message>
-        <source>PLOT2D_NORMALIZE_RIGHT_AXIS</source>
-        <translation>Right Y Axis: </translation>
+        <source>RECTANGLE_MARKER_LBL</source>
+        <translation>Rectangle</translation>
     </message>
     <message>
-        <source>PLOT2D_SCALE_MODE_VER</source>
-        <translation>Vertical axis:</translation>
+        <source>CROSS_MARKER_LBL</source>
+        <translation>Cross</translation>
     </message>
     <message>
-        <source>MNU_PAN_VIEW</source>
-        <translation>Panning</translation>
+        <source>XCROSS_MARKER_LBL</source>
+        <translation>Diagonal cross</translation>
     </message>
     <message>
-        <source>MNU_CLONE_VIEW</source>
-        <translation>Clone View</translation>
+        <source>DIAMOND_MARKER_LBL</source>
+        <translation>Diamond</translation>
     </message>
     <message>
-        <source>MNU_PRINT_VIEW</source>
-        <translation>Print View</translation>
+        <source>CIRCLE_MARKER_LBL</source>
+        <translation>Circle</translation>
     </message>
     <message>
-        <source>POSTSCRIPT_FILES</source>
-        <translation>PostScript files (*.ps)</translation>
+        <source>NONE_MARKER_LBL</source>
+        <translation>None</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_FitDataDlg</name>
     <message>
-        <source>ENCAPSULATED_POSTSCRIPT_FILES</source>
-        <translation>Encapsulated PostScript files (*.eps)</translation>
+        <source>FIT_DATA_TLT</source>
+        <translation>Fit Data Range</translation>
     </message>
     <message>
-        <source>PDF_FILES</source>
-        <translation>PDF files (*.pdf)</translation>
+        <source>FIT_HORIZONTAL</source>
+        <translation>Fit horizontally</translation>
     </message>
     <message>
-        <source>DSC_GLOBALPAN_VIEW</source>
-        <translation>Selection of a new center of the view</translation>
+        <source>MIN_VALUE_LAB</source>
+        <translation>Min:</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_MODE_LINEAR_VER</source>
-        <translation>Switches view to linear scaling mode along vertical axis</translation>
+        <source>VERTICAL_AXIS</source>
+        <translation>Vertical axis</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_MODE_LINEAR_HOR</source>
-        <translation>Switches view to linear scaling mode along horizontal axis</translation>
+        <source>MAX_VALUE_LAB</source>
+        <translation>Max:</translation>
     </message>
     <message>
-        <source>CURVE_LINE_WIDTH_LAB</source>
-        <translation>Line width:</translation>
+        <source>HORIZONTAL_AXIS</source>
+        <translation>Horizontal axis</translation>
     </message>
     <message>
-        <source>CURVE_TYPE_POPUP</source>
-        <translation>Curve type</translation>
+        <source>VERTICAL_LEFT_AXIS</source>
+        <translation>Vertical left axis</translation>
     </message>
     <message>
-        <source>NORMALIZATION_TYPE_POPUP</source>
-        <translation>Normalization</translation>
+        <source>FIT_ALL</source>
+        <translation>Fit both</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_MODE_LINEAR_VER</source>
-        <translation>Vertical axis: linear</translation>
+        <source>VERTICAL_RIGHT_AXIS</source>
+        <translation>Vertical right axis</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_MODE_LINEAR_HOR</source>
-        <translation>Horizontal axis: linear</translation>
+        <source>FIT_VERTICAL</source>
+        <translation>Fit vertically</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_ViewManager</name>
     <message>
-        <source>FIT_DATA_TLT</source>
-        <translation>Fit Data Range</translation>
+        <source>PLOT2D_VIEW_TITLE</source>
+        <translation>Plot2d scene:%M - viewer:%V</translation>
     </message>
     <message>
-        <source>MNU_ZOOM_VIEW</source>
-        <translation>Zoom</translation>
+        <source>PREF_GROUP_PLOT2DVIEWER</source>
+        <translation>Plot2d Viewer</translation>
     </message>
     <message>
-        <source>PLOT2D_GRID_TLT</source>
-        <translation>Grid / Axes marks</translation>
+        <source>PREF_SHOW_LEGEND</source>
+        <translation>Show legend</translation>
     </message>
     <message>
-        <source>DSC_PAN_VIEW</source>
-        <translation>Panning the view</translation>
+        <source>PREF_LEGEND_POSITION</source>
+        <translation>Legend position:</translation>
     </message>
     <message>
-        <source>DASHDOT_LINE_LBL</source>
-        <translation>DashDot</translation>
+        <source>PREF_LEFT</source>
+        <translation>Left</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_CURVES_SPLINES</source>
-        <translation>Switches view to splines mode</translation>
+        <source>PREF_RIGHT</source>
+        <translation>Right</translation>
     </message>
     <message>
-        <source>INF_AXES_X</source>
-        <translation>Axis X</translation>
+        <source>PREF_TOP</source>
+        <translation>Top</translation>
     </message>
     <message>
-        <source>PLOT2D_SCALE_TLT</source>
-        <translation>Scale mode</translation>
+        <source>PREF_BOTTOM</source>
+        <translation>Bottom</translation>
     </message>
     <message>
-        <source>DSC_FITALL</source>
-        <translation>Fit all objects inside the view frame</translation>
+        <source>PREF_CURVE_TYPE</source>
+        <translation>Curve type:</translation>
     </message>
     <message>
-        <source>MNU_FITALL</source>
-        <translation>Fit All</translation>
+        <source>PREF_POINTS</source>
+        <translation>Points</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_MODE_LOGARITHMIC_HOR</source>
-        <translation>Horizontal axis: logarithmic</translation>
+        <source>PREF_LINES</source>
+        <translation>Lines</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_MODE_LOGARITHMIC_VER</source>
-        <translation>Vertical axis: logarithmic</translation>
+        <source>PREF_SPLINE</source>
+        <translation>Spline</translation>
     </message>
     <message>
-        <source>MNU_GLOBALPAN_VIEW</source>
-        <translation>Global Panning</translation>
+        <source>PREF_MARKER_SIZE</source>
+        <translation>Marker size:</translation>
     </message>
     <message>
-        <source>INF_APP_DUMP_VIEW</source>
-        <translation>Dump view</translation>
+        <source>PREF_LINEAR</source>
+        <translation>Linear</translation>
     </message>
     <message>
-        <source>PLOT2D_LEGEND_POSITION_BOTTOM</source>
-        <translation>Bottom</translation>
+        <source>PREF_LOGARITHMIC</source>
+        <translation>Logarithmic</translation>
     </message>
     <message>
-        <source>INF_COORDINATES</source>
-        <translation>Coordinates: X : %1, Y : %2</translation>
+        <source>PREF_HOR_AXIS_SCALE</source>
+        <translation>Horizontal axis scale:</translation>
     </message>
     <message>
-        <source>DSC_CLONE_VIEW</source>
-        <translation>Create new OCC viewer for the active scene</translation>
+        <source>PREF_VERT_AXIS_SCALE</source>
+        <translation>Vertical axis scale:</translation>
     </message>
     <message>
-        <source>DSC_PRINT_VIEW</source>
-        <translation>Print active view</translation>
+        <source>PREF_VIEWER_BACKGROUND</source>
+        <translation>Background color</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_AnalyticalCurveDlg</name>
     <message>
-        <source>DASH_LINE_LBL</source>
-        <translation>Dash</translation>
+        <source>ANALYTICAL_CURVE_TLT</source>
+        <translation>Analytical curves properties</translation>
     </message>
     <message>
-        <source>DTRIANGLE_MARKER_LBL</source>
-        <translation>Downward triangle</translation>
-    </message>
+        <source>AC_CURVE_PARAMS</source>
+        <translation>Curve parameters</translation>
+    </message>    
     <message>
-        <source>UTRIANGLE_MARKER_LBL</source>
-        <translation>Upward triangle</translation>
-    </message>
+        <source>AC_CURVE_PROPS</source>
+        <translation>Curve properties</translation>
+    </message>        
     <message>
-        <source>LTRIANGLE_MARKER_LBL</source>
-        <translation>Leftward triangle</translation>
-    </message>
+        <source>AC_FORMULA</source>
+        <translation>y(x) = </translation>
+    </message>            
     <message>
-        <source>RTRIANGLE_MARKER_LBL</source>
-        <translation>Rightward triangle</translation>
+        <source>AC_NB_INTERVALS</source>
+        <translation>Nb. intervals</translation>
     </message>
     <message>
-        <source>RECTANGLE_MARKER_LBL</source>
-        <translation>Rectangle</translation>
+        <source>AC_AUTO_ASSIGN</source>
+        <translation>Auto assign</translation>
     </message>
     <message>
-        <source>TLT_SETUP_PLOT2D_VIEW</source>
-        <translation>Plot 2d View Settings</translation>
+        <source>AC_MARKER_TYPE</source>
+        <translation>Marker type</translation>
     </message>
     <message>
-        <source>CURVE_LINE_TYPE_LAB</source>
-        <translation>Line type:</translation>
+        <source>AC_LINE_TYPE</source>
+        <translation>Line type</translation>
     </message>
     <message>
-        <source>CROSS_MARKER_LBL</source>
-        <translation>Cross</translation>
+        <source>AC_LINE_WIDTH</source>
+        <translation>Line Width</translation>
     </message>
     <message>
-        <source>XCROSS_MARKER_LBL</source>
-        <translation>Diagonal cross</translation>
+        <source>AC_CURVE_COLOR</source>
+        <translation>Curve color</translation>
     </message>
     <message>
-        <source>PLOT2D_ENABLE_VER_TITLE</source>
-        <translation>Vertical axis title</translation>
-    </message>
+        <source>AC_ADD_BTN</source>
+        <translation>Add curve</translation>
+    </message>                
     <message>
-        <source>PLOT2D_ENABLE_HOR_TITLE</source>
-        <translation>Horizontal axis title</translation>
+        <source>AC_REM_BTN</source>
+        <translation>Remove curve</translation>
+    </message>                    
+    <message>
+        <source>AC_OK_BTN</source>
+        <translation>Ok</translation>
+    </message>                    
+    <message>
+        <source>AC_APPLY_BTN</source>
+        <translation>Apply</translation>
+    </message>                                        
+    <message>
+        <source>AC_CANT_CALCULATE</source>
+        <translation>Can't calculate curve. 
+Please, check input parameters!!!</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_SETTINGS</source>
-        <translation>Settings</translation>
+        <source>AC_CLOSE_BTN</source>
+        <translation>&amp;Close</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_ANALYTICAL_CURVES</source>
-        <translation>Analytical curves</translation>
-    </message>    
+        <source>AC_HELP_BTN</source>
+        <translation>Help</translation>
+    </message>
+</context>
+<context>
+    <name>Plot2d_SetupCurveScaleDlg</name>
     <message>
-        <source>TOT_PLOT2D_NORMALIZE_MODE_LMAX</source>
-        <translation>Left Y Axis: Normalize to global maximum</translation>
-    </message>    
+        <source>TLT_SETUP_CURVE_SCALE</source>
+        <translation>Curve(s) scale</translation>
+    </message>
     <message>
-        <source>TOT_PLOT2D_NORMALIZE_MODE_LMIN</source>
-        <translation>Left Y Axis: Normalize to global minimum</translation>
-    </message>    
+        <source>CURVE_SCALE_FACTOR</source>
+        <translation>Scale factor</translation>
+    </message>
+</context>
+<context>
+    <name>Plot2d_SetupViewDlg</name>
     <message>
-        <source>TOT_PLOT2D_NORMALIZE_MODE_RMAX</source>
-        <translation>Right Y Axis: Normalize to global maximum</translation>
-    </message>    
+        <source>PLOT2D_CURVE_TYPE_LBL</source>
+        <translation>Curve type:</translation>
+    </message>
     <message>
-        <source>TOT_PLOT2D_NORMALIZE_MODE_RMIN</source>
-        <translation>Right Y Axis: Normalize to global minimum</translation>
-    </message>    
+        <source>PLOT2D_SET_AS_DEFAULT_CHECK</source>
+        <translation>Save settings as default</translation>
+    </message>
     <message>
-        <source>PLOT2D_CURVE_TYPE_LINES</source>
-        <translation>Lines</translation>
+        <source>PLOT2D_SCALE_MODE_HOR</source>
+        <translation>Horizontal axis:</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_CURVES_SPLINES</source>
-        <translation>Draw Splines</translation>
+        <source>PLOT2D_NORMALIZE_TLT</source>
+        <translation>Normalization</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_MODE_LOGARITHMIC_HOR</source>
-        <translation>Switches view to logarithmic scaling mode along horizontal axis</translation>
+        <source>PLOT2D_NORMALIZE_MODE_MIN</source>
+        <translation>Normalize to minimum</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_MODE_LOGARITHMIC_VER</source>
-        <translation>Switches view to logarithmic scaling mode along vertical axis</translation>
+        <source>PLOT2D_NORMALIZE_MODE_MAX</source>
+        <translation>Normalize to maximum</translation>
     </message>
     <message>
-        <source>PLOT2D_IMAGE_FILES</source>
-        <translation>Images Files (*.bmp *.png *.jpg *.jpeg)</translation>
+        <source>PLOT2D_NORMALIZE_LEFT_AXIS</source>
+        <translation>Left Y Axis: </translation>
     </message>
     <message>
-        <source>PLOT2D_MAX_INTERVALS</source>
-        <translation>Max intervals</translation>
+        <source>PLOT2D_NORMALIZE_RIGHT_AXIS</source>
+        <translation>Right Y Axis: </translation>
     </message>
     <message>
-        <source>INF_AXES_Y_LEFT</source>
-        <translation>Axis Y Left</translation>
+        <source>PLOT2D_SCALE_MODE_VER</source>
+        <translation>Vertical axis:</translation>
     </message>
     <message>
-        <source>CURVE_COLOR_LAB</source>
-        <translation>Color:</translation>
+        <source>PLOT2D_GRID_TLT</source>
+        <translation>Grid / Axes marks</translation>
     </message>
     <message>
-        <source>CURVE_PREVIEW_LAB</source>
-        <translation>Preview:</translation>
+        <source>INF_AXES_X</source>
+        <translation>Axis X</translation>
     </message>
     <message>
-        <source>DIAMOND_MARKER_LBL</source>
-        <translation>Diamond</translation>
+        <source>PLOT2D_SCALE_TLT</source>
+        <translation>Scale mode</translation>
     </message>
     <message>
-        <source>PLOT2D_LEGEND_POSITION_TOP</source>
-        <translation>Top</translation>
+        <source>PLOT2D_LEGEND_POSITION_BOTTOM</source>
+        <translation>Bottom</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_CHANGE_BACKGROUND</source>
-        <translation>Change background</translation>
+        <source>TLT_SETUP_PLOT2D_VIEW</source>
+        <translation>Plot 2d View Settings</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_CHANGE_BACKGROUND</source>
-        <translation>Change Background...</translation>
+        <source>PLOT2D_ENABLE_VER_TITLE</source>
+        <translation>Vertical axis title</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_CHANGE_BACKGROUND</source>
-        <translation>Change background color</translation>
+        <source>PLOT2D_ENABLE_HOR_TITLE</source>
+        <translation>Horizontal axis title</translation>
     </message>
     <message>
-        <source>SOLID_LINE_LBL</source>
-        <translation>Solid</translation>
+        <source>PLOT2D_CURVE_TYPE_LINES</source>
+        <translation>Lines</translation>
+    </message>
+    <message>
+        <source>PLOT2D_MAX_INTERVALS</source>
+        <translation>Max intervals</translation>
+    </message>
+    <message>
+        <source>INF_AXES_Y_LEFT</source>
+        <translation>Axis Y Left</translation>
+    </message>
+    <message>
+        <source>PLOT2D_LEGEND_POSITION_TOP</source>
+        <translation>Top</translation>
     </message>
     <message>
         <source>PLOT2D_GRID_ENABLE_VER_MAJOR</source>
         <source>PLOT2D_GRID_ENABLE_VER_MINOR</source>
         <translation>Vertical minor</translation>
     </message>
-    <message>
-        <source>TOT_PLOT2D_CURVES_POINTS</source>
-        <translation>Draw points</translation>
-    </message>
     <message>
         <source>PLOT2D_GRID_ENABLE_HOR_MINOR</source>
         <translation>Horizontal minor</translation>
         <source>PLOT2D_DEVIATION_CL_LBL</source>
         <translation>Color</translation>
     </message>
-    <message>
-        <source>WRN_XLOG_NOT_ALLOWED</source>
-        <translation>Some points with non-positive abscissa values have been detected.
-Logarithmic scale for abscissa axis is not allowed.</translation>
-    </message>
-    <message>
-        <source>WRN_YLOG_NOT_ALLOWED</source>
-        <translation>Some points with non-positive ordinate values have been detected.
-Logarithmic scale for ordinate axis is not allowed.</translation>
-    </message>
-    <message>
-        <source>DSC_FITRECT</source>
-        <translation>Fit area within the view frame</translation>
-    </message>
     <message>
         <source>PLOT2D_LEGEND_POSITION_LEFT</source>
         <translation>Left</translation>
     </message>
-    <message>
-        <source>MNU_FITRECT</source>
-        <translation>Fit Area</translation>
-    </message>
-    <message>
-        <source>DOT_LINE_LBL</source>
-        <translation>Dot</translation>
-    </message>
-    <message>
-        <source>MEN_PLOT2D_CURVES_POINTS</source>
-        <translation>Draw Points</translation>
-    </message>
-    <message>
-        <source>PRP_PLOT2D_CURVES_POINTS</source>
-        <translation>Switches view to points mode</translation>
-    </message>
     <message>
         <source>PLOT2D_SCALE_MODE_LOGARITHMIC</source>
         <translation>Logarithmic</translation>
@@ -397,14 +403,6 @@ Logarithmic scale for ordinate axis is not allowed.</translation>
         <source>PLOT2D_LEGEND_POSITION_RIGHT</source>
         <translation>Right</translation>
     </message>
-    <message>
-        <source>DSC_DUMP_VIEW</source>
-        <translation>Saves the active view in the image file</translation>
-    </message>
-    <message>
-        <source>WARNING</source>
-        <translation>Warning</translation>
-    </message>
     <message>
         <source>PLOT2D_ENABLE_LEGEND</source>
         <translation>Show legend</translation>
@@ -414,397 +412,390 @@ Logarithmic scale for ordinate axis is not allowed.</translation>
         <translation>Legend font</translation>
     </message>
     <message>
-        <source>DSC_ZOOM_VIEW</source>
-        <translation>Zoom the view</translation>
+        <source>PLOT2D_SCALE_MODE_LINEAR</source>
+        <translation>Linear</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_ANALYTICAL_CURVES</source>
-        <translation>Setups analytical curves properties</translation>
+        <source>PLOT2D_CURVE_TYPE_POINTS</source>
+        <translation>Points</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_NORMALIZE_MODE_LMAX</source>
-        <translation>Switches view to maximum normalization mode by left Y axis</translation>
+        <source>PLOT2D_CURVE_TYPE_SPLINE</source>
+        <translation>Spline</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_NORMALIZE_MODE_LMIN</source>
-        <translation>Switches view to minimum normalization mode by left Y axis</translation>
+        <source>INF_AXES_Y_RIGHT</source>
+        <translation>Axis Y Right</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_NORMALIZE_MODE_RMAX</source>
-        <translation>Switches view to maximum normalization mode by right Y axis</translation>
+        <source>PLOT2D_MARKER_SIZE_LBL</source>
+        <translation>Marker size:</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_NORMALIZE_MODE_RMIN</source>
-        <translation>Switches view to minimum normalization mode by right Y axis</translation>
+        <source>PLOT2D_ENABLE_MAIN_TITLE</source>
+        <translation>Main title</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_SETTINGS</source>
-        <translation>Setups view properties</translation>
-    </message>    
-    <message>
-        <source>INF_COORDINATES_SOME_Y</source>
-        <translation>Coordinates: X : %1, Y : %2 ( %3 )</translation>
+        <source>PLOT2D_LEGEND_GROUP</source>
+        <translation>Legend</translation>
     </message>
     <message>
-        <source>SCALING_POPUP</source>
-        <translation>Scaling</translation>
+        <source>PLOT2D_LEGEND_POSITION</source>
+        <translation>Legend position:</translation>
     </message>
     <message>
-        <source>PLOT2D_SCALE_MODE_LINEAR</source>
-        <translation>Linear</translation>
+        <source>PLOT2D_LEGEND_SYMBOL_TYPE</source>
+        <translation>Symbol type:</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_FITDATA</source>
-        <translation>Fit range</translation>
+        <source>PLOT2D_MARKER_ABOVE_LINE</source>
+        <translation>Marker above line</translation>
     </message>
     <message>
-        <source>PLOT2D_CURVE_TYPE_POINTS</source>
-        <translation>Points</translation>
+        <source>PLOT2D_MARKER_ON_LINE</source>
+        <translation>Marker on line</translation>
     </message>
     <message>
-        <source>PLOT2D_CURVE_TYPE_SPLINE</source>
-        <translation>Spline</translation>
+        <source>PLOT2D_LEGEND_FONT_COLOR</source>
+        <translation>Legend font color:</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_FITDATA</source>
-        <translation>Fit &amp;Range</translation>
-    </message>
+        <source>PLOT2D_SELECTED_LEGEND_FONT_COLOR</source>
+        <translation>Highlighted legend font color:</translation>
+    </message> 
+</context>
+<context>
+    <name>Plot2d_SetupCurveDlg</name>
     <message>
-        <source>MEN_PLOT2D_MODE_LOGARITHMIC_HOR</source>
-        <translation>Horizontal Axis: Logarithmic</translation>
+        <source>TLT_SETUP_CURVE</source>
+        <translation>Setup Curve</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_MODE_LOGARITHMIC_VER</source>
-        <translation>Vertical Axis: Logarithmic</translation>
+        <source>CURVE_LINE_WIDTH_LAB</source>
+        <translation>Line width:</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_NORMALIZE_MODE_LMIN</source>
-        <translation>Left Y Axis: Minimum</translation>
+        <source>CURVE_LINE_TYPE_LAB</source>
+        <translation>Line type:</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_NORMALIZE_MODE_LMAX</source>
-        <translation>Left Y Axis: Maximum</translation>
+        <source>CURVE_COLOR_LAB</source>
+        <translation>Color:</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_NORMALIZE_MODE_RMIN</source>
-        <translation>Right Y Axis: Minimum</translation>
+        <source>CURVE_PREVIEW_LAB</source>
+        <translation>Preview:</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_NORMALIZE_MODE_RMAX</source>
-        <translation>Right Y Axis: Maximum</translation>
+        <source>CURVE_MARKER_TYPE_LAB</source>
+        <translation>Marker type:</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_ViewWindow</name>
     <message>
-        <source>PRP_PLOT2D_FITDATA</source>
-        <translation>Fits view to the given data range</translation>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Dump view...</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_MODE_LINEAR_VER</source>
-        <translation>Vertical Axis: Linear</translation>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Panning</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_MODE_LINEAR_HOR</source>
-        <translation>Horizontal Axis: Linear</translation>
+        <source>MNU_CLONE_VIEW</source>
+        <translation>Clone View</translation>
     </message>
     <message>
-        <source>NONE_MARKER_LBL</source>
-        <translation>None</translation>
+        <source>MNU_PRINT_VIEW</source>
+        <translation>Print View</translation>
     </message>
     <message>
-        <source>ERR_DOC_CANT_SAVE_FILE</source>
-        <translation>Cannot save file</translation>
+        <source>POSTSCRIPT_FILES</source>
+        <translation>PostScript files (*.ps)</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_SHOW_LEGEND</source>
-        <translation>Show &amp;Legend</translation>
+        <source>ENCAPSULATED_POSTSCRIPT_FILES</source>
+        <translation>Encapsulated PostScript files (*.eps)</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_SHOW_LEGEND</source>
-        <translation>Enables/disables legend</translation>
+        <source>PDF_FILES</source>
+        <translation>PDF files (*.pdf)</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_SHOW_LEGEND</source>
-        <translation>Show Legend</translation>
+        <source>DSC_GLOBALPAN_VIEW</source>
+        <translation>Selection of a new center of the view</translation>
     </message>
     <message>
-        <source>INF_AXES_Y_RIGHT</source>
-        <translation>Axis Y Right</translation>
+        <source>PRP_PLOT2D_MODE_LINEAR_VER</source>
+        <translation>Switches view to linear scaling mode along vertical axis</translation>
     </message>
     <message>
-        <source>DAHSDOTDOT_LINE_LBL</source>
-        <translation>DashDotDot</translation>
+        <source>PRP_PLOT2D_MODE_LINEAR_HOR</source>
+        <translation>Switches view to linear scaling mode along horizontal axis</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_CURVES_SPLINES</source>
-        <translation>Draw splines</translation>
+        <source>CURVE_TYPE_POPUP</source>
+        <translation>Curve type</translation>
     </message>
     <message>
-        <source>CURVE_MARKER_TYPE_LAB</source>
-        <translation>Marker type:</translation>
+        <source>NORMALIZATION_TYPE_POPUP</source>
+        <translation>Normalization</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_SETTINGS</source>
-        <translation>&amp;Settings</translation>
+        <source>TOT_PLOT2D_MODE_LINEAR_VER</source>
+        <translation>Vertical axis: linear</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_ANALYTICAL_CURVES</source>
-        <translation>Analytical curves</translation>
+        <source>TOT_PLOT2D_MODE_LINEAR_HOR</source>
+        <translation>Horizontal axis: linear</translation>
     </message>
     <message>
-        <source>CIRCLE_MARKER_LBL</source>
-        <translation>Circle</translation>
+        <source>MNU_ZOOM_VIEW</source>
+        <translation>Zoom</translation>
     </message>
     <message>
-        <source>LBL_TOOLBAR_LABEL</source>
-        <translation>View Operations</translation>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Panning the view</translation>
     </message>
     <message>
-        <source>NONE_LINE_LBL</source>
-        <translation>None</translation>
+        <source>PRP_PLOT2D_CURVES_SPLINES</source>
+        <translation>Switches view to splines mode</translation>
     </message>
     <message>
-        <source>PLOT2D_MARKER_SIZE_LBL</source>
-        <translation>Marker size:</translation>
+        <source>DSC_FITALL</source>
+        <translation>Fit all objects inside the view frame</translation>
     </message>
     <message>
-        <source>PLOT2D_ENABLE_MAIN_TITLE</source>
-        <translation>Main title</translation>
+        <source>MNU_FITALL</source>
+        <translation>Fit All</translation>
     </message>
     <message>
-        <source>PLOT2D_LEGEND_GROUP</source>
-        <translation>Legend</translation>
+        <source>TOT_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+        <translation>Horizontal axis: logarithmic</translation>
     </message>
     <message>
-        <source>PLOT2D_LEGEND_POSITION</source>
-        <translation>Legend position:</translation>
+        <source>TOT_PLOT2D_MODE_LOGARITHMIC_VER</source>
+        <translation>Vertical axis: logarithmic</translation>
     </message>
     <message>
-        <source>PLOT2D_LEGEND_SYMBOL_TYPE</source>
-        <translation>Symbol type:</translation>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Global Panning</translation>
     </message>
     <message>
-        <source>PLOT2D_MARKER_ABOVE_LINE</source>
-        <translation>Marker above line</translation>
+        <source>DSC_CLONE_VIEW</source>
+        <translation>Create new OCC viewer for the active scene</translation>
     </message>
     <message>
-        <source>PLOT2D_MARKER_ON_LINE</source>
-        <translation>Marker on line</translation>
+        <source>DSC_PRINT_VIEW</source>
+        <translation>Print active view</translation>
     </message>
     <message>
-        <source>PLOT2D_LEGEND_FONT_COLOR</source>
-        <translation>Legend font color:</translation>
+        <source>TOT_PLOT2D_SETTINGS</source>
+        <translation>Settings</translation>
     </message>
     <message>
-        <source>PLOT2D_SELECTED_LEGEND_FONT_COLOR</source>
-        <translation>Highlighted legend font color:</translation>
-    </message> 
+        <source>TOT_PLOT2D_ANALYTICAL_CURVES</source>
+        <translation>Analytical curves</translation>
+    </message>    
     <message>
-        <source>TOT_PLOT2D_CURVES_LINES</source>
-        <translation>Draw lines</translation>
-    </message>
+        <source>TOT_PLOT2D_NORMALIZE_MODE_LMAX</source>
+        <translation>Left Y Axis: Normalize to global maximum</translation>
+    </message>    
     <message>
-        <source>PRP_PLOT2D_CURVES_LINES</source>
-        <translation>Switches view to lines mode</translation>
-    </message>
+        <source>TOT_PLOT2D_NORMALIZE_MODE_LMIN</source>
+        <translation>Left Y Axis: Normalize to global minimum</translation>
+    </message>    
     <message>
-        <source>MEN_PLOT2D_CURVES_LINES</source>
-        <translation>Draw Lines</translation>
-    </message>
-</context>
-<context>
-    <name>Plot2d_FitDataDlg</name>
+        <source>TOT_PLOT2D_NORMALIZE_MODE_RMAX</source>
+        <translation>Right Y Axis: Normalize to global maximum</translation>
+    </message>    
     <message>
-        <source>FIT_HORIZONTAL</source>
-        <translation>Fit horizontally</translation>
-    </message>
+        <source>TOT_PLOT2D_NORMALIZE_MODE_RMIN</source>
+        <translation>Right Y Axis: Normalize to global minimum</translation>
+    </message>    
     <message>
-        <source>MIN_VALUE_LAB</source>
-        <translation>Min:</translation>
+        <source>MEN_PLOT2D_CURVES_SPLINES</source>
+        <translation>Draw Splines</translation>
     </message>
     <message>
-        <source>VERTICAL_AXIS</source>
-        <translation>Vertical axis</translation>
+        <source>PRP_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+        <translation>Switches view to logarithmic scaling mode along horizontal axis</translation>
     </message>
     <message>
-        <source>MAX_VALUE_LAB</source>
-        <translation>Max:</translation>
+        <source>PRP_PLOT2D_MODE_LOGARITHMIC_VER</source>
+        <translation>Switches view to logarithmic scaling mode along vertical axis</translation>
     </message>
     <message>
-        <source>HORIZONTAL_AXIS</source>
-        <translation>Horizontal axis</translation>
+        <source>TOT_PLOT2D_CURVES_POINTS</source>
+        <translation>Draw points</translation>
     </message>
     <message>
-        <source>VERTICAL_LEFT_AXIS</source>
-        <translation>Vertical left axis</translation>
+        <source>DSC_FITRECT</source>
+        <translation>Fit area within the view frame</translation>
     </message>
     <message>
-        <source>FIT_ALL</source>
-        <translation>Fit both</translation>
+        <source>MNU_FITRECT</source>
+        <translation>Fit Area</translation>
     </message>
     <message>
-        <source>VERTICAL_RIGHT_AXIS</source>
-        <translation>Vertical right axis</translation>
+        <source>MEN_PLOT2D_CURVES_POINTS</source>
+        <translation>Draw Points</translation>
     </message>
     <message>
-        <source>FIT_VERTICAL</source>
-        <translation>Fit vertically</translation>
+        <source>PRP_PLOT2D_CURVES_POINTS</source>
+        <translation>Switches view to points mode</translation>
     </message>
-</context>
-<context>
-    <name>Plot2d_ViewManager</name>
     <message>
-        <source>PLOT2D_VIEW_TITLE</source>
-        <translation>Plot2d scene:%M - viewer:%V</translation>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Saves the active view in the image file</translation>
     </message>
     <message>
-        <source>PREF_GROUP_PLOT2DVIEWER</source>
-        <translation>Plot2d Viewer</translation>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoom the view</translation>
     </message>
     <message>
-        <source>PREF_SHOW_LEGEND</source>
-        <translation>Show legend</translation>
+        <source>PRP_PLOT2D_ANALYTICAL_CURVES</source>
+        <translation>Setups analytical curves properties</translation>
     </message>
     <message>
-        <source>PREF_LEGEND_POSITION</source>
-        <translation>Legend position:</translation>
+        <source>PRP_PLOT2D_NORMALIZE_MODE_LMAX</source>
+        <translation>Switches view to maximum normalization mode by left Y axis</translation>
     </message>
     <message>
-        <source>PREF_LEFT</source>
-        <translation>Left</translation>
+        <source>PRP_PLOT2D_NORMALIZE_MODE_LMIN</source>
+        <translation>Switches view to minimum normalization mode by left Y axis</translation>
     </message>
     <message>
-        <source>PREF_RIGHT</source>
-        <translation>Right</translation>
+        <source>PRP_PLOT2D_NORMALIZE_MODE_RMAX</source>
+        <translation>Switches view to maximum normalization mode by right Y axis</translation>
     </message>
     <message>
-        <source>PREF_TOP</source>
-        <translation>Top</translation>
+        <source>PRP_PLOT2D_NORMALIZE_MODE_RMIN</source>
+        <translation>Switches view to minimum normalization mode by right Y axis</translation>
     </message>
     <message>
-        <source>PREF_BOTTOM</source>
-        <translation>Bottom</translation>
-    </message>
+        <source>PRP_PLOT2D_SETTINGS</source>
+        <translation>Setups view properties</translation>
+    </message>    
     <message>
-        <source>PREF_CURVE_TYPE</source>
-        <translation>Curve type:</translation>
+        <source>SCALING_POPUP</source>
+        <translation>Scaling</translation>
     </message>
     <message>
-        <source>PREF_POINTS</source>
-        <translation>Points</translation>
+        <source>TOT_PLOT2D_FITDATA</source>
+        <translation>Fit range</translation>
     </message>
     <message>
-        <source>PREF_LINES</source>
-        <translation>Lines</translation>
+        <source>MEN_PLOT2D_FITDATA</source>
+        <translation>Fit &amp;Range</translation>
     </message>
     <message>
-        <source>PREF_SPLINE</source>
-        <translation>Spline</translation>
+        <source>PRP_PLOT2D_FITDATA</source>
+        <translation>Fits view to the given data range</translation>
     </message>
     <message>
-        <source>PREF_MARKER_SIZE</source>
-        <translation>Marker size:</translation>
+        <source>MEN_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+        <translation>Horizontal Axis: Logarithmic</translation>
     </message>
     <message>
-        <source>PREF_LINEAR</source>
-        <translation>Linear</translation>
+        <source>MEN_PLOT2D_MODE_LOGARITHMIC_VER</source>
+        <translation>Vertical Axis: Logarithmic</translation>
     </message>
     <message>
-        <source>PREF_LOGARITHMIC</source>
-        <translation>Logarithmic</translation>
+        <source>MEN_PLOT2D_NORMALIZE_MODE_LMIN</source>
+        <translation>Left Y Axis: Minimum</translation>
     </message>
     <message>
-        <source>PREF_HOR_AXIS_SCALE</source>
-        <translation>Horizontal axis scale:</translation>
+        <source>MEN_PLOT2D_NORMALIZE_MODE_LMAX</source>
+        <translation>Left Y Axis: Maximum</translation>
     </message>
     <message>
-        <source>PREF_VERT_AXIS_SCALE</source>
-        <translation>Vertical axis scale:</translation>
+        <source>MEN_PLOT2D_NORMALIZE_MODE_RMIN</source>
+        <translation>Right Y Axis: Minimum</translation>
     </message>
     <message>
-        <source>PREF_VIEWER_BACKGROUND</source>
-        <translation>Background color</translation>
+        <source>MEN_PLOT2D_NORMALIZE_MODE_RMAX</source>
+        <translation>Right Y Axis: Maximum</translation>
     </message>
-</context>
-<context>
-    <name>Plot2d_AnalyticalCurveDlg</name>
     <message>
-        <source>ANALYTICAL_CURVE_TLT</source>
-        <translation>Analytical curves properties</translation>
+        <source>MEN_PLOT2D_MODE_LINEAR_VER</source>
+        <translation>Vertical Axis: Linear</translation>
     </message>
     <message>
-        <source>AC_CURVE_PARAMS</source>
-        <translation>Curve parameters</translation>
-    </message>    
-    <message>
-        <source>AC_CURVE_PROPS</source>
-        <translation>Curve properties</translation>
-    </message>        
-    <message>
-        <source>AC_FORMULA</source>
-        <translation>y(x) = </translation>
-    </message>            
-    <message>
-        <source>AC_NB_INTERVALS</source>
-        <translation>Nb. intervals</translation>
+        <source>MEN_PLOT2D_MODE_LINEAR_HOR</source>
+        <translation>Horizontal Axis: Linear</translation>
     </message>
     <message>
-        <source>AC_AUTO_ASSIGN</source>
-        <translation>Auto assign</translation>
+        <source>MEN_PLOT2D_SHOW_LEGEND</source>
+        <translation>Show &amp;Legend</translation>
     </message>
     <message>
-        <source>AC_MARKER_TYPE</source>
-        <translation>Marker type</translation>
+        <source>PRP_PLOT2D_SHOW_LEGEND</source>
+        <translation>Enables/disables legend</translation>
     </message>
     <message>
-        <source>AC_LINE_TYPE</source>
-        <translation>Line type</translation>
+        <source>TOT_PLOT2D_SHOW_LEGEND</source>
+        <translation>Show Legend</translation>
     </message>
     <message>
-        <source>AC_LINE_WIDTH</source>
-        <translation>Line Width</translation>
+        <source>TOT_PLOT2D_CURVES_SPLINES</source>
+        <translation>Draw splines</translation>
     </message>
     <message>
-        <source>AC_CURVE_COLOR</source>
-        <translation>Curve color</translation>
+        <source>MEN_PLOT2D_SETTINGS</source>
+        <translation>&amp;Settings</translation>
     </message>
     <message>
-        <source>AC_ADD_BTN</source>
-        <translation>Add curve</translation>
-    </message>                
+        <source>MEN_PLOT2D_ANALYTICAL_CURVES</source>
+        <translation>Analytical curves</translation>
+    </message>
     <message>
-        <source>AC_REM_BTN</source>
-        <translation>Remove curve</translation>
-    </message>                    
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>View Operations</translation>
+    </message>
     <message>
-        <source>AC_OK_BTN</source>
-        <translation>Ok</translation>
-    </message>                    
+        <source>TOT_PLOT2D_CURVES_LINES</source>
+        <translation>Draw lines</translation>
+    </message>
     <message>
-        <source>AC_APPLY_BTN</source>
-        <translation>Apply</translation>
-    </message>                                        
+        <source>PRP_PLOT2D_CURVES_LINES</source>
+        <translation>Switches view to lines mode</translation>
+    </message>
     <message>
-        <source>AC_CANT_CALCULATE</source>
-        <translation>Can't calculate curve. 
-Please, check input parameters!!!</translation>
+        <source>MEN_PLOT2D_CURVES_LINES</source>
+        <translation>Draw Lines</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_Viewer</name>
     <message>
-        <source>AC_CLOSE_BTN</source>
-        <translation>&amp;Close</translation>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Dump view...</translation>
     </message>
     <message>
-        <source>AC_HELP_BTN</source>
-        <translation>Help</translation>
+        <source>MEN_PLOT2D_CHANGE_BACKGROUND</source>
+        <translation>Change Background...</translation>
     </message>
 </context>
 <context>
-    <name>Plot2d_SetupCurveScaleDlg</name>
+    <name>Plot2d_ViewFrame</name>
     <message>
-        <source>TLT_SETUP_CURVE_SCALE</source>
-        <translation>Curve(s) scale</translation>
+        <source>INF_COORDINATES</source>
+        <translation>Coordinates: X : %1, Y : %2</translation>
     </message>
     <message>
-        <source>CURVE_SCALE_FACTOR</source>
-        <translation>Scale factor</translation>
+        <source>WRN_XLOG_NOT_ALLOWED</source>
+        <translation>Some points with non-positive abscissa values have been detected.
+Logarithmic scale for abscissa axis is not allowed.</translation>
+    </message>
+    <message>
+        <source>WRN_YLOG_NOT_ALLOWED</source>
+        <translation>Some points with non-positive ordinate values have been detected.
+Logarithmic scale for ordinate axis is not allowed.</translation>
+    </message>
+    <message>
+        <source>INF_COORDINATES_SOME_Y</source>
+        <translation>Coordinates: X : %1, Y : %2 ( %3 )</translation>
     </message>
 </context>
 </TS>
index adf71c2728195de9fbf5999f06523e9f86c6508a..0a11be761f0e6a2ea14cfb592f062f3a83f91ffe 100755 (executable)
 <context>
     <name>@default</name>
     <message>
-        <source>PLOT2D_CURVE_TYPE_LBL</source>
-        <translation>Type de courbe:</translation>
+        <source>DASHDOT_LINE_LBL</source>
+        <translation>TiretPoint</translation>
     </message>
     <message>
-        <source>ERROR</source>
-        <translation>Erreur</translation>
+        <source>DASH_LINE_LBL</source>
+        <translation>Tiret</translation>
     </message>
     <message>
-        <source>PLOT2D_SET_AS_DEFAULT_CHECK</source>
-        <translation>Enregistrer comme paramètres par défaut</translation>
+        <source>SOLID_LINE_LBL</source>
+        <translation>Solide</translation>
     </message>
     <message>
-        <source>TLT_SETUP_CURVE</source>
-        <translation>Initialiser une courbe</translation>
+        <source>DOT_LINE_LBL</source>
+        <translation>Point</translation>
     </message>
     <message>
-        <source>MNU_DUMP_VIEW</source>
-        <translation>Enregistrer la vue...</translation>
+        <source>DAHSDOTDOT_LINE_LBL</source>
+        <translation>TiretPointPoint</translation>
     </message>
     <message>
-        <source>PLOT2D_SCALE_MODE_HOR</source>
-        <translation>Axe horizontal:</translation>
+        <source>NONE_LINE_LBL</source>
+        <translation>Aucun</translation>
     </message>
     <message>
-        <source>PLOT2D_NORMALIZE_TLT</source>
-        <translation>Normalisation</translation>
+        <source>DTRIANGLE_MARKER_LBL</source>
+        <translation>Triangle orienté vers le bas</translation>
     </message>
     <message>
-        <source>PLOT2D_NORMALIZE_MODE_MIN</source>
-        <translation>Normaliser sur le minimum</translation>
+        <source>UTRIANGLE_MARKER_LBL</source>
+        <translation>Triangle orienté en haut</translation>
     </message>
     <message>
-        <source>PLOT2D_NORMALIZE_MODE_MAX</source>
-        <translation>Normaliser sur le maximum</translation>
+        <source>LTRIANGLE_MARKER_LBL</source>
+        <translation>Triangle orienté à gauche </translation>
     </message>
     <message>
-        <source>PLOT2D_NORMALIZE_LEFT_AXIS</source>
-        <translation>Axe Y gauche: </translation>
+        <source>RTRIANGLE_MARKER_LBL</source>
+        <translation>Triangle orienté à droite</translation>
     </message>
     <message>
-        <source>PLOT2D_NORMALIZE_RIGHT_AXIS</source>
-        <translation>Axe Y droite: </translation>
+        <source>RECTANGLE_MARKER_LBL</source>
+        <translation>Rectangle</translation>
     </message>
     <message>
-        <source>PLOT2D_SCALE_MODE_VER</source>
-        <translation>Axe vertical:</translation>
+        <source>CROSS_MARKER_LBL</source>
+        <translation>Croix</translation>
     </message>
     <message>
-        <source>MNU_PAN_VIEW</source>
-        <translation>Déplacement</translation>
+        <source>XCROSS_MARKER_LBL</source>
+        <translation>Croix diagonale</translation>
     </message>
     <message>
-        <source>MNU_CLONE_VIEW</source>
-        <translation>Dupliquer la vue</translation>
+        <source>DIAMOND_MARKER_LBL</source>
+        <translation>Diamant</translation>
     </message>
     <message>
-        <source>MNU_PRINT_VIEW</source>
-        <translation>Imprimer la vue</translation>
+        <source>CIRCLE_MARKER_LBL</source>
+        <translation>Cercle</translation>
     </message>
     <message>
-        <source>POSTSCRIPT_FILES</source>
-        <translation>Fichiers PostScript (*.ps)</translation>
+        <source>NONE_MARKER_LBL</source>
+        <translation>Aucun</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_FitDataDlg</name>
     <message>
-        <source>ENCAPSULATED_POSTSCRIPT_FILES</source>
-        <translation>Fichiers PostScript encapsulés (*.eps)</translation>
+        <source>FIT_DATA_TLT</source>
+        <translation>Ajuster à la plage de données</translation>
     </message>
     <message>
-        <source>PDF_FILES</source>
-        <translation>Fichiers PDF (*.pdf)</translation>
+        <source>FIT_HORIZONTAL</source>
+        <translation>Ajuster horizontalement</translation>
     </message>
     <message>
-        <source>DSC_GLOBALPAN_VIEW</source>
-        <translation>Sélection d&apos;un nouveau centre de vue</translation>
+        <source>MIN_VALUE_LAB</source>
+        <translation>Min:</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_MODE_LINEAR_VER</source>
-        <translation>Changer la vue de l&apos;axe vertical au mode d&apos;échelle linéaire</translation>
+        <source>VERTICAL_AXIS</source>
+        <translation>Axe vertical</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_MODE_LINEAR_HOR</source>
-        <translation>Changer la vue de l&apos;axe horizontal au mode d&apos;échelle linéaire</translation>
+        <source>MAX_VALUE_LAB</source>
+        <translation>Max:</translation>
     </message>
     <message>
-        <source>CURVE_LINE_WIDTH_LAB</source>
-        <translation>Epaisseur du trait:</translation>
+        <source>HORIZONTAL_AXIS</source>
+        <translation>Axe horizontal</translation>
     </message>
     <message>
-        <source>CURVE_TYPE_POPUP</source>
-        <translation>Type de courbe</translation>
+        <source>VERTICAL_LEFT_AXIS</source>
+        <translation>Axe vertical gauche</translation>
     </message>
     <message>
-        <source>NORMALIZATION_TYPE_POPUP</source>
-        <translation>Normalisation</translation>
+        <source>FIT_ALL</source>
+        <translation>Tout ajuster</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_MODE_LINEAR_VER</source>
-        <translation>Axe vertical: linéaire</translation>
+        <source>VERTICAL_RIGHT_AXIS</source>
+        <translation>Axe vertical droite</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_MODE_LINEAR_HOR</source>
-        <translation>Axe horizontal: linéaire</translation>
+        <source>FIT_VERTICAL</source>
+        <translation>Ajuster verticalement</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_ViewManager</name>
     <message>
-        <source>FIT_DATA_TLT</source>
-        <translation>Ajuster à la plage de données</translation>
+        <source>PLOT2D_VIEW_TITLE</source>
+        <translation>Scène Plot2d:%M - visualiseur:%V</translation>
     </message>
     <message>
-        <source>MNU_ZOOM_VIEW</source>
-        <translation>Zoom</translation>
+        <source>PREF_GROUP_PLOT2DVIEWER</source>
+        <translation>Visualiseur Plot2d</translation>
     </message>
     <message>
-        <source>PLOT2D_GRID_TLT</source>
-        <translation>Marques de la grille et des axes</translation>
+        <source>PREF_SHOW_LEGEND</source>
+        <translation>Afficher la légende</translation>
     </message>
     <message>
-        <source>DSC_PAN_VIEW</source>
-        <translation>Déplacer la vue</translation>
+        <source>PREF_LEGEND_POSITION</source>
+        <translation>Position de la légende:</translation>
     </message>
     <message>
-        <source>DASHDOT_LINE_LBL</source>
-        <translation>TiretPoint</translation>
+        <source>PREF_LEFT</source>
+        <translation>Gauche</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_CURVES_SPLINES</source>
-        <translation>Changer la vue en mode splines</translation>
+        <source>PREF_RIGHT</source>
+        <translation>Droite</translation>
     </message>
     <message>
-        <source>INF_AXES_X</source>
-        <translation>Axe X</translation>
+        <source>PREF_TOP</source>
+        <translation>Haut</translation>
     </message>
     <message>
-        <source>PLOT2D_SCALE_TLT</source>
-        <translation>Mode d&apos;échelle</translation>
+        <source>PREF_BOTTOM</source>
+        <translation>Bas</translation>
     </message>
     <message>
-        <source>DSC_FITALL</source>
-        <translation>Ajuster la scène pour afficher tous les objets</translation>
+        <source>PREF_CURVE_TYPE</source>
+        <translation>Type de courbe:</translation>
     </message>
     <message>
-        <source>MNU_FITALL</source>
-        <translation>Tout afficher</translation>
+        <source>PREF_POINTS</source>
+        <translation>Points</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_MODE_LOGARITHMIC_HOR</source>
-        <translation>Axe horizontal: logarithmique</translation>
+        <source>PREF_LINES</source>
+        <translation>Lignes</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_MODE_LOGARITHMIC_VER</source>
-        <translation>Axe vertical: logarithmique</translation>
+        <source>PREF_SPLINE</source>
+        <translation>Spline</translation>
     </message>
     <message>
-        <source>MNU_GLOBALPAN_VIEW</source>
-        <translation>Déplacement global</translation>
+        <source>PREF_MARKER_SIZE</source>
+        <translation>Taille du repère:</translation>
     </message>
     <message>
-        <source>INF_APP_DUMP_VIEW</source>
-        <translation>Enregistrer la vue</translation>
+        <source>PREF_LINEAR</source>
+        <translation>Linéaire</translation>
     </message>
     <message>
-        <source>PLOT2D_LEGEND_POSITION_BOTTOM</source>
-        <translation>Dessous</translation>
+        <source>PREF_LOGARITHMIC</source>
+        <translation>Logarithmique</translation>
     </message>
     <message>
-        <source>INF_COORDINATES</source>
-        <translation>Coordonnées: X : %1, Y : %2</translation>
+        <source>PREF_HOR_AXIS_SCALE</source>
+        <translation>Echelle de l&apos;axe horizontal:</translation>
     </message>
     <message>
-        <source>DSC_CLONE_VIEW</source>
-        <translation>Ouvrir un nouveau visualiseur OCC pour la scène actuelle</translation>
+        <source>PREF_VERT_AXIS_SCALE</source>
+        <translation>Echelle de l&apos;axe vertical:</translation>
     </message>
     <message>
-        <source>DSC_PRINT_VIEW</source>
-        <translation>Imprimer la vue actuelle</translation>
+        <source>PREF_VIEWER_BACKGROUND</source>
+        <translation>Couleur du fond</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_AnalyticalCurveDlg</name>
     <message>
-        <source>DASH_LINE_LBL</source>
-        <translation>Tiret</translation>
+        <source>ANALYTICAL_CURVE_TLT</source>
+        <translation>Propriétés des courbes analytiques</translation>
     </message>
     <message>
-        <source>DTRIANGLE_MARKER_LBL</source>
-        <translation>Triangle orienté vers le bas</translation>
+        <source>AC_CURVE_PARAMS</source>
+        <translation>Paramètres de la courbe</translation>
     </message>
     <message>
-        <source>UTRIANGLE_MARKER_LBL</source>
-        <translation>Triangle orienté en haut</translation>
+        <source>AC_CURVE_PROPS</source>
+        <translation>Propriétés de la courbe</translation>
     </message>
     <message>
-        <source>LTRIANGLE_MARKER_LBL</source>
-        <translation>Triangle orienté à gauche </translation>
+        <source>AC_FORMULA</source>
+        <translation>y(x) = </translation>
     </message>
     <message>
-        <source>RTRIANGLE_MARKER_LBL</source>
-        <translation>Triangle orienté à droite</translation>
+        <source>AC_NB_INTERVALS</source>
+        <translation>Nb. intervalles</translation>
     </message>
     <message>
-        <source>RECTANGLE_MARKER_LBL</source>
-        <translation>Rectangle</translation>
+        <source>AC_AUTO_ASSIGN</source>
+        <translation>Affectation auto.</translation>
     </message>
     <message>
-        <source>TLT_SETUP_PLOT2D_VIEW</source>
-        <translation>Paramètres de visualisation Plot 2d</translation>
+        <source>AC_MARKER_TYPE</source>
+        <translation>Type de marqueur</translation>
     </message>
     <message>
-        <source>CURVE_LINE_TYPE_LAB</source>
-        <translation>Type de trait:</translation>
+        <source>AC_LINE_TYPE</source>
+        <translation>Type de ligne</translation>
     </message>
     <message>
-        <source>CROSS_MARKER_LBL</source>
-        <translation>Croix</translation>
+        <source>AC_LINE_WIDTH</source>
+        <translation>Epaisseur de ligne</translation>
     </message>
     <message>
-        <source>XCROSS_MARKER_LBL</source>
-        <translation>Croix diagonale</translation>
+        <source>AC_CURVE_COLOR</source>
+        <translation>Couleur de la courbe</translation>
     </message>
     <message>
-        <source>PLOT2D_ENABLE_VER_TITLE</source>
-        <translation>Titre de l&apos;axe vertical</translation>
+        <source>AC_ADD_BTN</source>
+        <translation>Ajouter une courbe</translation>
     </message>
     <message>
-        <source>PLOT2D_ENABLE_HOR_TITLE</source>
-        <translation>Titre de l&apos;axe horizontal</translation>
+        <source>AC_REM_BTN</source>
+        <translation>Supprimer une courbe</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_SETTINGS</source>
-        <translation>Paramètres</translation>
+        <source>AC_OK_BTN</source>
+        <translation>Ok</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_ANALYTICAL_CURVES</source>
-        <translation>Courbes analytiques</translation>
+        <source>AC_APPLY_BTN</source>
+        <translation>Appliquer</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_NORMALIZE_MODE_LMAX</source>
-        <translation>Axe Y gauche: Normaliser sur le maximum global</translation>
+        <source>AC_CANT_CALCULATE</source>
+        <translation>La courbe ne peut pas être calculée. 
+Merci de vérifier les paramètres d&apos;entrée</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_NORMALIZE_MODE_LMIN</source>
-        <translation>Axe Y gauche: Normaliser sur le minimum global</translation>
+        <source>AC_CLOSE_BTN</source>
+        <translation>&amp;Fermer</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_NORMALIZE_MODE_RMAX</source>
-        <translation>Axe Y droite: Normaliser sur le maximum global</translation>
+        <source>AC_HELP_BTN</source>
+        <translation>Aide</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_SetupCurveScaleDlg</name>
     <message>
-        <source>TOT_PLOT2D_NORMALIZE_MODE_RMIN</source>
-        <translation>Axe Y droite: Normaliser sur le minimum global</translation>
-    </message>
+        <source>TLT_SETUP_CURVE_SCALE</source>
+        <translation>Mise à l&apos;échelle de courbe(s)</translation>
+    </message>
     <message>
-        <source>PLOT2D_CURVE_TYPE_LINES</source>
-        <translation>Lignes</translation>
+        <source>CURVE_SCALE_FACTOR</source>
+        <translation>Facteur d&apos;échelle</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_SetupViewDlg</name>
     <message>
-        <source>MEN_PLOT2D_CURVES_SPLINES</source>
-        <translation>Dessiner les splines</translation>
+        <source>PLOT2D_CURVE_TYPE_LBL</source>
+        <translation>Type de courbe:</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_MODE_LOGARITHMIC_HOR</source>
-        <translation>Changer la vue de l&apos;axe horizontal au mode d&apos;échelle logarithmique</translation>
+        <source>PLOT2D_SET_AS_DEFAULT_CHECK</source>
+        <translation>Enregistrer comme paramètres par défaut</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_MODE_LOGARITHMIC_VER</source>
-        <translation>Changer la vue de l&apos;axe vertical au mode d&apos;échelle logarithmique</translation>
+        <source>PLOT2D_SCALE_MODE_HOR</source>
+        <translation>Axe horizontal:</translation>
     </message>
     <message>
-        <source>PLOT2D_IMAGE_FILES</source>
-        <translation>Fichiers images (*.bmp *.png *.jpg *.jpeg)</translation>
+        <source>PLOT2D_NORMALIZE_TLT</source>
+        <translation>Normalisation</translation>
     </message>
     <message>
-        <source>PLOT2D_MAX_INTERVALS</source>
-        <translation>Intervalles max</translation>
+        <source>PLOT2D_NORMALIZE_MODE_MIN</source>
+        <translation>Normaliser sur le minimum</translation>
     </message>
     <message>
-        <source>INF_AXES_Y_LEFT</source>
-        <translation>Axe Y gauche</translation>
+        <source>PLOT2D_NORMALIZE_MODE_MAX</source>
+        <translation>Normaliser sur le maximum</translation>
     </message>
     <message>
-        <source>CURVE_COLOR_LAB</source>
-        <translation>Couleur:</translation>
+        <source>PLOT2D_NORMALIZE_LEFT_AXIS</source>
+        <translation>Axe Y gauche: </translation>
     </message>
     <message>
-        <source>CURVE_PREVIEW_LAB</source>
-        <translation>Prévisualiser</translation>
+        <source>PLOT2D_NORMALIZE_RIGHT_AXIS</source>
+        <translation>Axe Y droite: </translation>
     </message>
     <message>
-        <source>DIAMOND_MARKER_LBL</source>
-        <translation>Diamant</translation>
+        <source>PLOT2D_SCALE_MODE_VER</source>
+        <translation>Axe vertical:</translation>
     </message>
     <message>
-        <source>PLOT2D_LEGEND_POSITION_TOP</source>
-        <translation>Dessus</translation>
+        <source>PLOT2D_GRID_TLT</source>
+        <translation>Marques de la grille et des axes</translation>
+    </message>
+    <message>
+        <source>INF_AXES_X</source>
+        <translation>Axe X</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_CHANGE_BACKGROUND</source>
-        <translation>Changer l&apos;arrière-plan</translation>
+        <source>PLOT2D_SCALE_TLT</source>
+        <translation>Mode d&apos;échelle</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_CHANGE_BACKGROUND</source>
-        <translation>Changer l&apos;arrière-plan...</translation>
+        <source>PLOT2D_LEGEND_POSITION_BOTTOM</source>
+        <translation>Dessous</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_CHANGE_BACKGROUND</source>
-        <translation>Changer la couleur d&apos;arrière plan</translation>
+        <source>TLT_SETUP_PLOT2D_VIEW</source>
+        <translation>Paramètres de visualisation Plot 2d</translation>
     </message>
     <message>
-        <source>SOLID_LINE_LBL</source>
-        <translation>Solide</translation>
+        <source>PLOT2D_ENABLE_VER_TITLE</source>
+        <translation>Titre de l&apos;axe vertical</translation>
+    </message>
+    <message>
+        <source>PLOT2D_ENABLE_HOR_TITLE</source>
+        <translation>Titre de l&apos;axe horizontal</translation>
+    </message>
+    <message>
+        <source>PLOT2D_CURVE_TYPE_LINES</source>
+        <translation>Lignes</translation>
+    </message>
+    <message>
+        <source>PLOT2D_MAX_INTERVALS</source>
+        <translation>Intervalles max</translation>
+    </message>
+    <message>
+        <source>INF_AXES_Y_LEFT</source>
+        <translation>Axe Y gauche</translation>
+    </message>
+    <message>
+        <source>PLOT2D_LEGEND_POSITION_TOP</source>
+        <translation>Dessus</translation>
     </message>
     <message>
         <source>PLOT2D_GRID_ENABLE_VER_MAJOR</source>
         <source>PLOT2D_GRID_ENABLE_VER_MINOR</source>
         <translation>Verticale secondaire</translation>
     </message>
-    <message>
-        <source>TOT_PLOT2D_CURVES_POINTS</source>
-        <translation>Dessiner des points</translation>
-    </message>
     <message>
         <source>PLOT2D_GRID_ENABLE_HOR_MINOR</source>
         <translation>Horizontale secondaire</translation>
         <source>PLOT2D_DEVIATION_CL_LBL</source>
         <translation>Couleur</translation>
     </message>
-    <message>
-        <source>WRN_XLOG_NOT_ALLOWED</source>
-        <translation>On a détecté des points avec les valeurs non-positives sur l&apos;abscisse.
-L&apos;échelle logarithmique de l&apos;abscisse n&apos;est pas permise.</translation>
-    </message>
-    <message>
-        <source>WRN_YLOG_NOT_ALLOWED</source>
-        <translation>On a détecté des points avec les valeurs non-positives sur l&apos;ordonnée.
-L&apos;échelle logarithmique de l&apos;ordonnée n&apos;est pas permise.</translation>
-    </message>
-    <message>
-        <source>DSC_FITRECT</source>
-        <translation>Ajuster la scène à la zone choisie par l&apos;encadré</translation>
-    </message>
     <message>
         <source>PLOT2D_LEGEND_POSITION_LEFT</source>
         <translation>Gauche</translation>
     </message>
-    <message>
-        <source>MNU_FITRECT</source>
-        <translation>Afficher la zone</translation>
-    </message>
-    <message>
-        <source>DOT_LINE_LBL</source>
-        <translation>Point</translation>
-    </message>
-    <message>
-        <source>MEN_PLOT2D_CURVES_POINTS</source>
-        <translation>Dessiner les points</translation>
-    </message>
-    <message>
-        <source>PRP_PLOT2D_CURVES_POINTS</source>
-        <translation>Changer la vue en mode points</translation>
-    </message>
     <message>
         <source>PLOT2D_SCALE_MODE_LOGARITHMIC</source>
         <translation>Logarithmique</translation>
@@ -397,14 +403,6 @@ L&apos;échelle logarithmique de l&apos;ordonnée n&apos;est pas permise.</trans
         <source>PLOT2D_LEGEND_POSITION_RIGHT</source>
         <translation>Droite</translation>
     </message>
-    <message>
-        <source>DSC_DUMP_VIEW</source>
-        <translation>Sauvegarder la vue actuelle dans un fichier image</translation>
-    </message>
-    <message>
-        <source>WARNING</source>
-        <translation>Avertissement</translation>
-    </message>
     <message>
         <source>PLOT2D_ENABLE_LEGEND</source>
         <translation>Afficher la légende</translation>
@@ -414,401 +412,390 @@ L&apos;échelle logarithmique de l&apos;ordonnée n&apos;est pas permise.</trans
         <translation>Police de la légende</translation>
     </message>
     <message>
-        <source>DSC_ZOOM_VIEW</source>
-        <translation>Zoomer la vue</translation>
+        <source>PLOT2D_SCALE_MODE_LINEAR</source>
+        <translation>Linéaire</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_ANALYTICAL_CURVES</source>
-        <translation>Réglage des propriétés des courbes analytiques</translation>
+        <source>PLOT2D_CURVE_TYPE_POINTS</source>
+        <translation>Points</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_NORMALIZE_MODE_LMAX</source>
-        <translation>Bascule la vue vers le mode de normalisation sur le maximum pour l&apos;axe Y gauche</translation>
+        <source>PLOT2D_CURVE_TYPE_SPLINE</source>
+        <translation>Spline</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_NORMALIZE_MODE_LMIN</source>
-        <translation>Bascule la vue vers le mode de normalisation sur le minimum pour l&apos;axe Y gauche</translation>
+        <source>INF_AXES_Y_RIGHT</source>
+        <translation>Axe Y droite</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_NORMALIZE_MODE_RMAX</source>
-        <translation>Bascule la vue vers le mode de normalisation sur le maximum pour l&apos;axe Y droite</translation>
+        <source>PLOT2D_MARKER_SIZE_LBL</source>
+        <translation>Taille du marqueur:</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_NORMALIZE_MODE_RMIN</source>
-        <translation>Bascule la vue vers le mode de normalisation sur le minimum pour l&apos;axe Y droite</translation>
+        <source>PLOT2D_ENABLE_MAIN_TITLE</source>
+        <translation>Titre principal</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_SETTINGS</source>
-        <translation>Définit les paramètres de visualisation</translation>
+        <source>PLOT2D_LEGEND_GROUP</source>
+        <translation>Légende</translation>
     </message>
     <message>
-        <source>INF_COORDINATES_SOME_Y</source>
-        <translation>Coordonnées: X : %1, Y : %2 ( %3 )</translation>
+        <source>PLOT2D_LEGEND_POSITION</source>
+        <translation>Position de la Légende:</translation>
     </message>
     <message>
-        <source>SCALING_POPUP</source>
-        <translation>Echelle</translation>
+        <source>PLOT2D_LEGEND_SYMBOL_TYPE</source>
+        <translation>Type de symbole:</translation>
     </message>
     <message>
-        <source>PLOT2D_SCALE_MODE_LINEAR</source>
-        <translation>Linéaire</translation>
+        <source>PLOT2D_MARKER_ABOVE_LINE</source>
+        <translation>Marqueur dessus de la ligne</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_FITDATA</source>
-        <translation>Ajuster à l&apos;intervalle</translation>
+        <source>PLOT2D_MARKER_ON_LINE</source>
+        <translation>Marqueur sur la ligne</translation>
     </message>
     <message>
-        <source>PLOT2D_CURVE_TYPE_POINTS</source>
-        <translation>Points</translation>
+        <source>PLOT2D_LEGEND_FONT_COLOR</source>
+        <translation>Couleur de police de la légende:</translation>
     </message>
     <message>
-        <source>PLOT2D_CURVE_TYPE_SPLINE</source>
-        <translation>Spline</translation>
+        <source>PLOT2D_SELECTED_LEGEND_FONT_COLOR</source>
+        <translation>Couleur de surlignement de la légende:</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_SetupCurveDlg</name>
     <message>
-        <source>MEN_PLOT2D_FITDATA</source>
-        <translation>&amp;Ajuster à l&apos;intervalle</translation>
+        <source>TLT_SETUP_CURVE</source>
+        <translation>Initialiser une courbe</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_MODE_LOGARITHMIC_HOR</source>
-        <translation>Axe horizontal: logarithmique</translation>
+        <source>CURVE_LINE_WIDTH_LAB</source>
+        <translation>Epaisseur du trait:</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_MODE_LOGARITHMIC_VER</source>
-        <translation>Axe vertical: logarithmique</translation>
+        <source>CURVE_LINE_TYPE_LAB</source>
+        <translation>Type de trait:</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_NORMALIZE_MODE_LMIN</source>
-        <translation>Axe Y gauche: Minimum</translation>
+        <source>CURVE_COLOR_LAB</source>
+        <translation>Couleur:</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_NORMALIZE_MODE_LMAX</source>
-        <translation>Axe Y gauche: Maximum</translation>
+        <source>CURVE_PREVIEW_LAB</source>
+        <translation>Prévisualiser</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_NORMALIZE_MODE_RMIN</source>
-        <translation>Axe Y droite: Minimum</translation>
+        <source>CURVE_MARKER_TYPE_LAB</source>
+        <translation>Type de marqueur:</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_ViewWindow</name>
     <message>
-        <source>MEN_PLOT2D_NORMALIZE_MODE_RMAX</source>
-        <translation>Axe Y droite: Maximum</translation>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Enregistrer la vue...</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_FITDATA</source>
-        <translation>Ajuster la vue à la plage de données indiquée</translation>
+        <source>MNU_PAN_VIEW</source>
+        <translation>Déplacement</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_MODE_LINEAR_VER</source>
-        <translation>Axe vertical: linéaire</translation>
+        <source>MNU_CLONE_VIEW</source>
+        <translation>Dupliquer la vue</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_MODE_LINEAR_HOR</source>
-        <translation>Axe horizontal: linéaire</translation>
+        <source>MNU_PRINT_VIEW</source>
+        <translation>Imprimer la vue</translation>
     </message>
     <message>
-        <source>NONE_MARKER_LBL</source>
-        <translation>Aucun</translation>
+        <source>POSTSCRIPT_FILES</source>
+        <translation>Fichiers PostScript (*.ps)</translation>
     </message>
     <message>
-        <source>ERR_DOC_CANT_SAVE_FILE</source>
-        <translation>Impossible de sauvegarder le fichier</translation>
+        <source>ENCAPSULATED_POSTSCRIPT_FILES</source>
+        <translation>Fichiers PostScript encapsulés (*.eps)</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_SHOW_LEGEND</source>
-        <translation>Afficher la &amp;légende</translation>
+        <source>PDF_FILES</source>
+        <translation>Fichiers PDF (*.pdf)</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_SHOW_LEGEND</source>
-        <translation>Activer/désactiver la légende</translation>
+        <source>DSC_GLOBALPAN_VIEW</source>
+        <translation>Sélection d&apos;un nouveau centre de vue</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_SHOW_LEGEND</source>
-        <translation>Afficher la légende</translation>
+        <source>PRP_PLOT2D_MODE_LINEAR_VER</source>
+        <translation>Changer la vue de l&apos;axe vertical au mode d&apos;échelle linéaire</translation>
     </message>
     <message>
-        <source>INF_AXES_Y_RIGHT</source>
-        <translation>Axe Y droite</translation>
+        <source>PRP_PLOT2D_MODE_LINEAR_HOR</source>
+        <translation>Changer la vue de l&apos;axe horizontal au mode d&apos;échelle linéaire</translation>
     </message>
     <message>
-        <source>DAHSDOTDOT_LINE_LBL</source>
-        <translation>TiretPointPoint</translation>
+        <source>CURVE_TYPE_POPUP</source>
+        <translation>Type de courbe</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_CURVES_SPLINES</source>
-        <translation>Dessiner des splines</translation>
+        <source>NORMALIZATION_TYPE_POPUP</source>
+        <translation>Normalisation</translation>
     </message>
     <message>
-        <source>CURVE_MARKER_TYPE_LAB</source>
-        <translation>Type de marqueur:</translation>
+        <source>TOT_PLOT2D_MODE_LINEAR_VER</source>
+        <translation>Axe vertical: linéaire</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_SETTINGS</source>
-        <translation>&amp;Paramètres</translation>
-    </message>
-    <message>
-        <source>MEN_PLOT2D_ANALYTICAL_CURVES</source>
-        <translation>Courbes analytiques</translation>
-    </message>
-    <message>
-        <source>CIRCLE_MARKER_LBL</source>
-        <translation>Cercle</translation>
-    </message>
-    <message>
-        <source>LBL_TOOLBAR_LABEL</source>
-        <translation>Opérations de visualisation</translation>
+        <source>TOT_PLOT2D_MODE_LINEAR_HOR</source>
+        <translation>Axe horizontal: linéaire</translation>
     </message>
     <message>
-        <source>NONE_LINE_LBL</source>
-        <translation>Aucun</translation>
+        <source>MNU_ZOOM_VIEW</source>
+        <translation>Zoom</translation>
     </message>
     <message>
-        <source>PLOT2D_MARKER_SIZE_LBL</source>
-        <translation>Taille du marqueur:</translation>
+        <source>DSC_PAN_VIEW</source>
+        <translation>Déplacer la vue</translation>
     </message>
     <message>
-        <source>PLOT2D_ENABLE_MAIN_TITLE</source>
-        <translation>Titre principal</translation>
+        <source>PRP_PLOT2D_CURVES_SPLINES</source>
+        <translation>Changer la vue en mode splines</translation>
     </message>
     <message>
-        <source>PLOT2D_LEGEND_GROUP</source>
-        <translation>Légende</translation>
+        <source>DSC_FITALL</source>
+        <translation>Ajuster la scène pour afficher tous les objets</translation>
     </message>
     <message>
-        <source>PLOT2D_LEGEND_POSITION</source>
-        <translation>Position de la Légende:</translation>
+        <source>MNU_FITALL</source>
+        <translation>Tout afficher</translation>
     </message>
     <message>
-        <source>PLOT2D_LEGEND_SYMBOL_TYPE</source>
-        <translation>Type de symbole:</translation>
+        <source>TOT_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+        <translation>Axe horizontal: logarithmique</translation>
     </message>
     <message>
-        <source>PLOT2D_MARKER_ABOVE_LINE</source>
-        <translation>Marqueur dessus de la ligne</translation>
+        <source>TOT_PLOT2D_MODE_LOGARITHMIC_VER</source>
+        <translation>Axe vertical: logarithmique</translation>
     </message>
     <message>
-        <source>PLOT2D_MARKER_ON_LINE</source>
-        <translation>Marqueur sur la ligne</translation>
+        <source>MNU_GLOBALPAN_VIEW</source>
+        <translation>Déplacement global</translation>
     </message>
     <message>
-        <source>PLOT2D_LEGEND_FONT_COLOR</source>
-        <translation>Couleur de police de la légende:</translation>
+        <source>DSC_CLONE_VIEW</source>
+        <translation>Ouvrir un nouveau visualiseur OCC pour la scène actuelle</translation>
     </message>
     <message>
-        <source>PLOT2D_SELECTED_LEGEND_FONT_COLOR</source>
-        <translation>Couleur de surlignement de la légende:</translation>
+        <source>DSC_PRINT_VIEW</source>
+        <translation>Imprimer la vue actuelle</translation>
     </message>
     <message>
-        <source>TOT_PLOT2D_CURVES_LINES</source>
-        <translation>Dessiner des lignes</translation>
+        <source>TOT_PLOT2D_SETTINGS</source>
+        <translation>Paramètres</translation>
     </message>
     <message>
-        <source>PRP_PLOT2D_CURVES_LINES</source>
-        <translation>Changer la vue en mode lignes</translation>
+        <source>TOT_PLOT2D_ANALYTICAL_CURVES</source>
+        <translation>Courbes analytiques</translation>
     </message>
     <message>
-        <source>MEN_PLOT2D_CURVES_LINES</source>
-        <translation>Dessiner les lignes</translation>
+        <source>TOT_PLOT2D_NORMALIZE_MODE_LMAX</source>
+        <translation>Axe Y gauche: Normaliser sur le maximum global</translation>
     </message>
-</context>
-<context>
-    <name>Plot2d_FitDataDlg</name>
     <message>
-        <source>FIT_HORIZONTAL</source>
-        <translation>Ajuster horizontalement</translation>
+        <source>TOT_PLOT2D_NORMALIZE_MODE_LMIN</source>
+        <translation>Axe Y gauche: Normaliser sur le minimum global</translation>
     </message>
     <message>
-        <source>MIN_VALUE_LAB</source>
-        <translation>Min:</translation>
+        <source>TOT_PLOT2D_NORMALIZE_MODE_RMAX</source>
+        <translation>Axe Y droite: Normaliser sur le maximum global</translation>
     </message>
     <message>
-        <source>VERTICAL_AXIS</source>
-        <translation>Axe vertical</translation>
+        <source>TOT_PLOT2D_NORMALIZE_MODE_RMIN</source>
+        <translation>Axe Y droite: Normaliser sur le minimum global</translation>
     </message>
     <message>
-        <source>MAX_VALUE_LAB</source>
-        <translation>Max:</translation>
+        <source>MEN_PLOT2D_CURVES_SPLINES</source>
+        <translation>Dessiner les splines</translation>
     </message>
     <message>
-        <source>HORIZONTAL_AXIS</source>
-        <translation>Axe horizontal</translation>
+        <source>PRP_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+        <translation>Changer la vue de l&apos;axe horizontal au mode d&apos;échelle logarithmique</translation>
     </message>
     <message>
-        <source>VERTICAL_LEFT_AXIS</source>
-        <translation>Axe vertical gauche</translation>
+        <source>PRP_PLOT2D_MODE_LOGARITHMIC_VER</source>
+        <translation>Changer la vue de l&apos;axe vertical au mode d&apos;échelle logarithmique</translation>
     </message>
     <message>
-        <source>FIT_ALL</source>
-        <translation>Tout ajuster</translation>
+        <source>TOT_PLOT2D_CURVES_POINTS</source>
+        <translation>Dessiner des points</translation>
     </message>
     <message>
-        <source>VERTICAL_RIGHT_AXIS</source>
-        <translation>Axe vertical droite</translation>
+        <source>DSC_FITRECT</source>
+        <translation>Ajuster la scène à la zone choisie par l&apos;encadré</translation>
     </message>
     <message>
-        <source>FIT_VERTICAL</source>
-        <translation>Ajuster verticalement</translation>
+        <source>MNU_FITRECT</source>
+        <translation>Afficher la zone</translation>
     </message>
-</context>
-<context>
-    <name>Plot2d_ViewManager</name>
     <message>
-        <source>PLOT2D_VIEW_TITLE</source>
-        <translation>Scène Plot2d:%M - visualiseur:%V</translation>
+        <source>MEN_PLOT2D_CURVES_POINTS</source>
+        <translation>Dessiner les points</translation>
     </message>
     <message>
-        <source>PREF_GROUP_PLOT2DVIEWER</source>
-        <translation>Visualiseur Plot2d</translation>
+        <source>PRP_PLOT2D_CURVES_POINTS</source>
+        <translation>Changer la vue en mode points</translation>
     </message>
     <message>
-        <source>PREF_SHOW_LEGEND</source>
-        <translation>Afficher la légende</translation>
+        <source>DSC_DUMP_VIEW</source>
+        <translation>Sauvegarder la vue actuelle dans un fichier image</translation>
     </message>
     <message>
-        <source>PREF_LEGEND_POSITION</source>
-        <translation>Position de la légende:</translation>
+        <source>DSC_ZOOM_VIEW</source>
+        <translation>Zoomer la vue</translation>
     </message>
     <message>
-        <source>PREF_LEFT</source>
-        <translation>Gauche</translation>
+        <source>PRP_PLOT2D_ANALYTICAL_CURVES</source>
+        <translation>Réglage des propriétés des courbes analytiques</translation>
     </message>
     <message>
-        <source>PREF_RIGHT</source>
-        <translation>Droite</translation>
+        <source>PRP_PLOT2D_NORMALIZE_MODE_LMAX</source>
+        <translation>Bascule la vue vers le mode de normalisation sur le maximum pour l&apos;axe Y gauche</translation>
     </message>
     <message>
-        <source>PREF_TOP</source>
-        <translation>Haut</translation>
+        <source>PRP_PLOT2D_NORMALIZE_MODE_LMIN</source>
+        <translation>Bascule la vue vers le mode de normalisation sur le minimum pour l&apos;axe Y gauche</translation>
     </message>
     <message>
-        <source>PREF_BOTTOM</source>
-        <translation>Bas</translation>
+        <source>PRP_PLOT2D_NORMALIZE_MODE_RMAX</source>
+        <translation>Bascule la vue vers le mode de normalisation sur le maximum pour l&apos;axe Y droite</translation>
     </message>
     <message>
-        <source>PREF_CURVE_TYPE</source>
-        <translation>Type de courbe:</translation>
+        <source>PRP_PLOT2D_NORMALIZE_MODE_RMIN</source>
+        <translation>Bascule la vue vers le mode de normalisation sur le minimum pour l&apos;axe Y droite</translation>
     </message>
     <message>
-        <source>PREF_POINTS</source>
-        <translation>Points</translation>
+        <source>PRP_PLOT2D_SETTINGS</source>
+        <translation>Définit les paramètres de visualisation</translation>
     </message>
     <message>
-        <source>PREF_LINES</source>
-        <translation>Lignes</translation>
+        <source>SCALING_POPUP</source>
+        <translation>Echelle</translation>
     </message>
     <message>
-        <source>PREF_SPLINE</source>
-        <translation>Spline</translation>
+        <source>TOT_PLOT2D_FITDATA</source>
+        <translation>Ajuster à l&apos;intervalle</translation>
     </message>
     <message>
-        <source>PREF_MARKER_SIZE</source>
-        <translation>Taille du repère:</translation>
+        <source>MEN_PLOT2D_FITDATA</source>
+        <translation>&amp;Ajuster à l&apos;intervalle</translation>
     </message>
     <message>
-        <source>PREF_LINEAR</source>
-        <translation>Linéaire</translation>
+        <source>PRP_PLOT2D_FITDATA</source>
+        <translation>Ajuster la vue à la plage de données indiquée</translation>
     </message>
     <message>
-        <source>PREF_LOGARITHMIC</source>
-        <translation>Logarithmique</translation>
+        <source>MEN_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+        <translation>Axe horizontal: logarithmique</translation>
     </message>
     <message>
-        <source>PREF_HOR_AXIS_SCALE</source>
-        <translation>Echelle de l&apos;axe horizontal:</translation>
+        <source>MEN_PLOT2D_MODE_LOGARITHMIC_VER</source>
+        <translation>Axe vertical: logarithmique</translation>
     </message>
     <message>
-        <source>PREF_VERT_AXIS_SCALE</source>
-        <translation>Echelle de l&apos;axe vertical:</translation>
+        <source>MEN_PLOT2D_NORMALIZE_MODE_LMIN</source>
+        <translation>Axe Y gauche: Minimum</translation>
     </message>
     <message>
-        <source>PREF_VIEWER_BACKGROUND</source>
-        <translation>Couleur du fond</translation>
+        <source>MEN_PLOT2D_NORMALIZE_MODE_LMAX</source>
+        <translation>Axe Y gauche: Maximum</translation>
     </message>
-</context>
-<context>
-    <name>Plot2d_AnalyticalCurveDlg</name>
     <message>
-        <source>AC_OK_BTN</source>
-        <translation>Ok</translation>
+        <source>MEN_PLOT2D_NORMALIZE_MODE_RMIN</source>
+        <translation>Axe Y droite: Minimum</translation>
     </message>
     <message>
-        <source>ANALYTICAL_CURVE_TLT</source>
-        <translation>Propriétés des courbes analytiques</translation>
+        <source>MEN_PLOT2D_NORMALIZE_MODE_RMAX</source>
+        <translation>Axe Y droite: Maximum</translation>
     </message>
     <message>
-        <source>AC_CURVE_PARAMS</source>
-        <translation>Paramètres de la courbe</translation>
+        <source>MEN_PLOT2D_MODE_LINEAR_VER</source>
+        <translation>Axe vertical: linéaire</translation>
     </message>
     <message>
-        <source>AC_CURVE_PROPS</source>
-        <translation>Propriétés de la courbe</translation>
+        <source>MEN_PLOT2D_MODE_LINEAR_HOR</source>
+        <translation>Axe horizontal: linéaire</translation>
     </message>
     <message>
-        <source>AC_FORMULA</source>
-        <translation>y(x) = </translation>
+        <source>MEN_PLOT2D_SHOW_LEGEND</source>
+        <translation>Afficher la &amp;légende</translation>
     </message>
     <message>
-        <source>AC_NB_INTERVALS</source>
-        <translation>Nb. intervalles</translation>
+        <source>PRP_PLOT2D_SHOW_LEGEND</source>
+        <translation>Activer/désactiver la légende</translation>
     </message>
     <message>
-        <source>AC_AUTO_ASSIGN</source>
-        <translation>Affectation auto.</translation>
+        <source>TOT_PLOT2D_SHOW_LEGEND</source>
+        <translation>Afficher la légende</translation>
     </message>
     <message>
-        <source>AC_MARKER_TYPE</source>
-        <translation>Type de marqueur</translation>
+        <source>TOT_PLOT2D_CURVES_SPLINES</source>
+        <translation>Dessiner des splines</translation>
     </message>
     <message>
-        <source>AC_LINE_TYPE</source>
-        <translation>Type de ligne</translation>
+        <source>MEN_PLOT2D_SETTINGS</source>
+        <translation>&amp;Paramètres</translation>
     </message>
     <message>
-        <source>AC_LINE_WIDTH</source>
-        <translation>Epaisseur de ligne</translation>
+        <source>MEN_PLOT2D_ANALYTICAL_CURVES</source>
+        <translation>Courbes analytiques</translation>
     </message>
     <message>
-        <source>AC_CURVE_COLOR</source>
-        <translation>Couleur de la courbe</translation>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>Opérations de visualisation</translation>
     </message>
     <message>
-        <source>AC_ADD_BTN</source>
-        <translation>Ajouter une courbe</translation>
+        <source>TOT_PLOT2D_CURVES_LINES</source>
+        <translation>Dessiner des lignes</translation>
     </message>
     <message>
-        <source>AC_REM_BTN</source>
-        <translation>Supprimer une courbe</translation>
+        <source>PRP_PLOT2D_CURVES_LINES</source>
+        <translation>Changer la vue en mode lignes</translation>
     </message>
     <message>
-        <source>AC_UPD_BTN</source>
-        <translation>Mettre à jour la courbe</translation>
+        <source>MEN_PLOT2D_CURVES_LINES</source>
+        <translation>Dessiner les lignes</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_Viewer</name>
     <message>
-        <source>AC_APPLY_BTN</source>
-        <translation>Appliquer</translation>
+        <source>MNU_DUMP_VIEW</source>
+        <translation>Enregistrer la vue...</translation>
     </message>
     <message>
-        <source>AC_CANT_CALCULATE</source>
-        <translation>La courbe ne peut pas être calculée. 
-Merci de vérifier les paramètres d&apos;entrée</translation>
+        <source>MEN_PLOT2D_CHANGE_BACKGROUND</source>
+        <translation>Changer l&apos;arrière-plan...</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_ViewFrame</name>
     <message>
-        <source>AC_CLOSE_BTN</source>
-        <translation>&amp;Fermer</translation>
+        <source>INF_COORDINATES</source>
+        <translation>Coordonnées: X : %1, Y : %2</translation>
     </message>
     <message>
-        <source>AC_HELP_BTN</source>
-        <translation>Aide</translation>
+        <source>WRN_XLOG_NOT_ALLOWED</source>
+        <translation>On a détecté des points avec les valeurs non-positives sur l&apos;abscisse.
+L&apos;échelle logarithmique de l&apos;abscisse n&apos;est pas permise.</translation>
     </message>
-</context>
-<context>
-    <name>Plot2d_SetupCurveScaleDlg</name>
     <message>
-        <source>TLT_SETUP_CURVE_SCALE</source>
-        <translation>Mise à l&apos;échelle de courbe(s)</translation>
+        <source>WRN_YLOG_NOT_ALLOWED</source>
+        <translation>On a détecté des points avec les valeurs non-positives sur l&apos;ordonnée.
+L&apos;échelle logarithmique de l&apos;ordonnée n&apos;est pas permise.</translation>
     </message>
     <message>
-        <source>CURVE_SCALE_FACTOR</source>
-        <translation>Facteur d&apos;échelle</translation>
+        <source>INF_COORDINATES_SOME_Y</source>
+        <translation>Coordonnées: X : %1, Y : %2 ( %3 )</translation>
     </message>
 </context>
 </TS>
index c9f34f528f9a7615e9bf4779ea3128a9c413b5d3..85907998583288f902895f332f618589179c21f8 100644 (file)
   <context>
     <name>@default</name>
     <message>
-      <source>PLOT2D_CURVE_TYPE_LBL</source>
-      <translation>曲線の種類:</translation>
+      <source>DASHDOT_LINE_LBL</source>
+      <translation>TiretPoint</translation>
     </message>
     <message>
-      <source>ERROR</source>
-      <translation>ã\82¨ã\83©ã\83¼</translation>
+      <source>DASH_LINE_LBL</source>
+      <translation>ã\82¤ã\83³ã\83\87ã\83³ã\83\88ã\82\92設å®\9aã\81\97ã\81¾ã\81\99ã\80\82</translation>
     </message>
     <message>
-      <source>PLOT2D_SET_AS_DEFAULT_CHECK</source>
-      <translation>既定の設定として保存します。</translation>
+      <source>SOLID_LINE_LBL</source>
+      <translation>ソリッド</translation>
     </message>
     <message>
-      <source>TLT_SETUP_CURVE</source>
-      <translation>曲線を初期化します。</translation>
+      <source>DOT_LINE_LBL</source>
+      <translation>基準点</translation>
     </message>
     <message>
-      <source>MNU_DUMP_VIEW</source>
-      <translation>ビューを保存.</translation>
+      <source>DAHSDOTDOT_LINE_LBL</source>
+      <translation>TiretPointPoint</translation>
     </message>
     <message>
-      <source>PLOT2D_SCALE_MODE_HOR</source>
-      <translation>水平軸:</translation>
+      <source>NONE_LINE_LBL</source>
+      <translation>[なし]</translation>
     </message>
     <message>
-      <source>PLOT2D_NORMALIZE_TLT</source>
-      <translation>標準化</translation>
+      <source>DTRIANGLE_MARKER_LBL</source>
+      <translation>下向きの三角形</translation>
     </message>
     <message>
-      <source>PLOT2D_NORMALIZE_MODE_MIN</source>
-      <translation>最小を標準化します。</translation>
+      <source>UTRIANGLE_MARKER_LBL</source>
+      <translation>三角形のトップ指向</translation>
     </message>
     <message>
-      <source>PLOT2D_NORMALIZE_MODE_MAX</source>
-      <translation>最大値を標準化します。</translation>
+      <source>LTRIANGLE_MARKER_LBL</source>
+      <translation>左の三角形を指向</translation>
     </message>
     <message>
-      <source>PLOT2D_NORMALIZE_LEFT_AXIS</source>
-      <translation>å·¦ã\81® Y è»¸:</translation>
+      <source>RTRIANGLE_MARKER_LBL</source>
+      <translation>å\8f³å\90\91ã\81\8dä¸\89è§\92å½¢ã\82\92æ\8c\87å\90\91</translation>
     </message>
     <message>
-      <source>PLOT2D_NORMALIZE_RIGHT_AXIS</source>
-      <translation>å\8f³ã\81® Y è»¸:</translation>
+      <source>RECTANGLE_MARKER_LBL</source>
+      <translation>å\9b\9bè§\92å½¢ã\81®ä½\9cæ\88\90</translation>
     </message>
     <message>
-      <source>PLOT2D_SCALE_MODE_VER</source>
-      <translation>垂直軸:</translation>
+      <source>CROSS_MARKER_LBL</source>
+      <translation>クロス</translation>
     </message>
     <message>
-      <source>MNU_PAN_VIEW</source>
-      <translation>パンニング</translation>
+      <source>XCROSS_MARKER_LBL</source>
+      <translation>斜め十字</translation>
     </message>
     <message>
-      <source>MNU_CLONE_VIEW</source>
-      <translation>ã\83\93ã\83¥ã\83¼ã\81®è¤\87製</translation>
+      <source>DIAMOND_MARKER_LBL</source>
+      <translation>ã\83\80ã\82¤ã\83¤ã\83¢ã\83³ã\83\89</translation>
     </message>
     <message>
-      <source>MNU_PRINT_VIEW</source>
-      <translation>印刷ビュー</translation>
+      <source>NONE_MARKER_LBL</source>
+      <translation>[なし]</translation>
     </message>
     <message>
-      <source>POSTSCRIPT_FILES</source>
-      <translation>PostScript ファイル (* .ps)</translation>
+      <source>CIRCLE_MARKER_LBL</source>
+      <translation></translation>
     </message>
+  </context>
+  <context>
+    <name>Plot2d_FitDataDlg</name>
     <message>
-      <source>ENCAPSULATED_POSTSCRIPT_FILES</source>
-      <translation>ã\82«ã\83\97ã\82»ã\83«å\8c\96ã\81\95ã\82\8cã\81\9f PostScript (*.eps) ã\83\95ã\82¡ã\82¤ã\83«</translation>
+      <source>FIT_DATA_TLT</source>
+      <translation>ã\83\87ã\83¼ã\82¿ã\81®ç¯\84å\9b²ã\82\92調æ\95´ã\81\97ã\81¾ã\81\99ã\80\82</translation>
     </message>
     <message>
-      <source>PDF_FILES</source>
-      <translation>PDF files (*.pdf)</translation>
+      <source>FIT_HORIZONTAL</source>
+      <translation>水平調整します。</translation>
     </message>
     <message>
-      <source>DSC_GLOBALPAN_VIEW</source>
-      <translation>ビューの新しい中心地の選択</translation>
+      <source>MIN_VALUE_LAB</source>
+      <translation>最小:</translation>
     </message>
     <message>
-      <source>PRP_PLOT2D_MODE_LINEAR_VER</source>
-      <translation>線形スケールのモードには、垂直軸の表示を変更します。</translation>
+      <source>VERTICAL_AXIS</source>
+      <translation>垂直軸</translation>
     </message>
     <message>
-      <source>PRP_PLOT2D_MODE_LINEAR_HOR</source>
-      <translation>線形スケールのモードに、ビューの水平方向の軸を変更します。</translation>
+      <source>MAX_VALUE_LAB</source>
+      <translation>最大:</translation>
     </message>
     <message>
-      <source>CURVE_LINE_WIDTH_LAB</source>
-      <translation>線の太さ:</translation>
+      <source>HORIZONTAL_AXIS</source>
+      <translation>水平軸</translation>
     </message>
     <message>
-      <source>CURVE_TYPE_POPUP</source>
-      <translation>曲線の種類</translation>
+      <source>VERTICAL_LEFT_AXIS</source>
+      <translation>左側の垂直軸</translation>
     </message>
     <message>
-      <source>NORMALIZATION_TYPE_POPUP</source>
-      <translation>標準化</translation>
+      <source>FIT_ALL</source>
+      <translation>すべてを調整します。</translation>
     </message>
     <message>
-      <source>TOT_PLOT2D_MODE_LINEAR_VER</source>
-      <translation>å\9e\82ç\9b´è»¸: ç·\9aå½¢</translation>
+      <source>VERTICAL_RIGHT_AXIS</source>
+      <translation>å\8f³æ\95°å\80¤è»¸</translation>
     </message>
     <message>
-      <source>TOT_PLOT2D_MODE_LINEAR_HOR</source>
-      <translation>水平軸: 線形</translation>
+      <source>FIT_VERTICAL</source>
+      <translation>垂直方向に調整します。</translation>
     </message>
+  </context>
+  <context>
+    <name>Plot2d_ViewManager</name>
     <message>
-      <source>FIT_DATA_TLT</source>
-      <translation>ã\83\87ã\83¼ã\82¿ã\81®ç¯\84å\9b²ã\82\92調æ\95´ã\81\97ã\81¾ã\81\99ã\80\82</translation>
+      <source>PLOT2D_VIEW_TITLE</source>
+      <translation>ã\82·ã\83¼ã\83³ Plot2d: %M - ã\83\93ã\83¥ã\83¼ã\82¢ã\83¼: %V</translation>
     </message>
     <message>
-      <source>MNU_ZOOM_VIEW</source>
-      <translation>ズーム</translation>
+      <source>PREF_GROUP_PLOT2DVIEWER</source>
+      <translation>Plot 2D Viewer</translation>
     </message>
     <message>
-      <source>PLOT2D_GRID_TLT</source>
-      <translation>ã\82°ã\83ªã\83\83ã\83\89ã\80\81軸ã\81®ã\83\9eã\83¼ã\82¯</translation>
+      <source>PREF_SHOW_LEGEND</source>
+      <translation>ã\82­ã\83£ã\83\97ã\82·ã\83§ã\83³ã\82\92表示ã\81\97ã\81¾ã\81\99ã\80\82</translation>
     </message>
     <message>
-      <source>DSC_PAN_VIEW</source>
-      <translation>ビューを移動します。</translation>
+      <source>PREF_LEGEND_POSITION</source>
+      <translation>凡例の位置:</translation>
     </message>
     <message>
-      <source>DASHDOT_LINE_LBL</source>
-      <translation>TiretPoint</translation>
+      <source>PREF_LEFT</source>
+      <translation></translation>
     </message>
     <message>
-      <source>PRP_PLOT2D_CURVES_SPLINES</source>
-      <translation>表示モードのスプラインを変更します。</translation>
+      <source>PREF_RIGHT</source>
+      <translation></translation>
     </message>
     <message>
-      <source>INF_AXES_X</source>
-      <translation>X è»¸</translation>
+      <source>PREF_TOP</source>
+      <translation>ã\83\9aã\83¼ã\82¸ã\81®ã\83\88ã\83\83ã\83\97ã\81¸</translation>
     </message>
     <message>
-      <source>PLOT2D_SCALE_TLT</source>
-      <translation>スケール モード</translation>
+      <source>PREF_BOTTOM</source>
+      <translation type="unfinished">Bottom</translation>
     </message>
     <message>
-      <source>DSC_FITALL</source>
-      <translation>すべてのオブジェクトを表示するには、シーンを調整します。</translation>
+      <source>PREF_CURVE_TYPE</source>
+      <translation>曲線の種類:</translation>
     </message>
     <message>
-      <source>MNU_FITALL</source>
-      <translation>ã\81\99ã\81¹ã\81¦è¡¨ç¤º</translation>
+      <source>PREF_POINTS</source>
+      <translation>ã\83\9dã\82¤ã\83³ã\83\88</translation>
     </message>
     <message>
-      <source>TOT_PLOT2D_MODE_LOGARITHMIC_HOR</source>
-      <translation>水平軸: 対数</translation>
+      <source>PREF_LINES</source>
+      <translation>ライン</translation>
     </message>
     <message>
-      <source>TOT_PLOT2D_MODE_LOGARITHMIC_VER</source>
-      <translation>垂直軸: 対数</translation>
+      <source>PREF_SPLINE</source>
+      <translation>スプライン</translation>
     </message>
     <message>
-      <source>MNU_GLOBALPAN_VIEW</source>
-      <translation>グローバルパンニング</translation>
+      <source>PREF_MARKER_SIZE</source>
+      <translation>座標系のサイズ:</translation>
     </message>
     <message>
-      <source>INF_APP_DUMP_VIEW</source>
-      <translation>ビューを保存します。</translation>
+      <source>PREF_LINEAR</source>
+      <translation>線形</translation>
     </message>
     <message>
-      <source>PLOT2D_LEGEND_POSITION_BOTTOM</source>
-      <translation>Bottom</translation>
+      <source>PREF_LOGARITHMIC</source>
+      <translation>対数</translation>
     </message>
     <message>
-      <source>INF_COORDINATES</source>
-      <translation>お問い合わせ: x: %1、y: %2</translation>
+      <source>PREF_HOR_AXIS_SCALE</source>
+      <translation>水平方向の軸のスケール:</translation>
     </message>
     <message>
-      <source>DSC_CLONE_VIEW</source>
-      <translation>現在のステージの新しいビューアー OCC を開く</translation>
+      <source>PREF_VERT_AXIS_SCALE</source>
+      <translation>垂直軸のスケール:</translation>
     </message>
     <message>
-      <source>DSC_PRINT_VIEW</source>
-      <translation>現在のビューを印刷します。</translation>
+      <source>PREF_VIEWER_BACKGROUND</source>
+      <translation>背景色</translation>
     </message>
+  </context>
+  <context>
+    <name>Plot2d_AnalyticalCurveDlg</name>
     <message>
-      <source>DASH_LINE_LBL</source>
-      <translation>インデントを設定します。</translation>
+      <source>ANALYTICAL_CURVE_TLT</source>
+      <translation>分析曲線のプロパティ</translation>
     </message>
     <message>
-      <source>DTRIANGLE_MARKER_LBL</source>
-      <translation>下向きの三角形</translation>
+      <source>AC_CURVE_PARAMS</source>
+      <translation>曲線のパラメーター</translation>
     </message>
     <message>
-      <source>UTRIANGLE_MARKER_LBL</source>
-      <translation>三角形のトップ指向</translation>
+      <source>AC_CURVE_PROPS</source>
+      <translation>曲線のプロパティ</translation>
     </message>
     <message>
-      <source>LTRIANGLE_MARKER_LBL</source>
-      <translation>左の三角形を指向</translation>
+      <source>AC_FORMULA</source>
+      <translation>y (x) =</translation>
     </message>
     <message>
-      <source>RTRIANGLE_MARKER_LBL</source>
-      <translation>右向き三角形を指向</translation>
+      <source>AC_NB_INTERVALS</source>
+      <translation>Nb に登録間隔</translation>
     </message>
     <message>
-      <source>RECTANGLE_MARKER_LBL</source>
-      <translation>四角形の作成</translation>
+      <source>AC_AUTO_ASSIGN</source>
+      <translation>自動割り当て。</translation>
     </message>
     <message>
-      <source>TLT_SETUP_PLOT2D_VIEW</source>
-      <translation>2次元可視化設定をプロットします。</translation>
+      <source>AC_MARKER_TYPE</source>
+      <translation>マーカーの種類</translation>
     </message>
     <message>
-      <source>CURVE_LINE_TYPE_LAB</source>
-      <translation>回線の種類:</translation>
+      <source>AC_LINE_TYPE</source>
+      <translation>行の種類</translation>
     </message>
     <message>
-      <source>CROSS_MARKER_LBL</source>
-      <translation>クロス</translation>
+      <source>AC_LINE_WIDTH</source>
+      <translation>線の太さ</translation>
     </message>
     <message>
-      <source>XCROSS_MARKER_LBL</source>
-      <translation>æ\96\9cã\82\81å\8d\81å­\97</translation>
+      <source>AC_CURVE_COLOR</source>
+      <translation>æ\9b²ç·\9aã\81®è\89²</translation>
     </message>
     <message>
-      <source>PLOT2D_ENABLE_VER_TITLE</source>
-      <translation>垂直軸のタイトル</translation>
+      <source>AC_ADD_BTN</source>
+      <translation>カーブを追加します。</translation>
     </message>
     <message>
-      <source>PLOT2D_ENABLE_HOR_TITLE</source>
-      <translation>水平軸のタイトル</translation>
+      <source>AC_REM_BTN</source>
+      <translation>カーブを削除します。</translation>
     </message>
     <message>
-      <source>TOT_PLOT2D_SETTINGS</source>
-      <translation>ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\83¼</translation>
+      <source>AC_OK_BTN</source>
+      <translation>ã\82\8fã\81\8bã\82\8aã\81¾ã\81\97ã\81\9f</translation>
     </message>
     <message>
-      <source>TOT_PLOT2D_ANALYTICAL_CURVES</source>
-      <translation>分析曲線</translation>
+      <source>AC_APPLY_BTN</source>
+      <translation>適用</translation>
     </message>
     <message>
-      <source>TOT_PLOT2D_NORMALIZE_MODE_LMAX</source>
-      <translation>左の Y 軸: グローバルの最大値を標準化します。</translation>
+      <source>AC_CANT_CALCULATE</source>
+      <translation>曲線は計算できません。入力パラメーターを確認してください。</translation>
     </message>
     <message>
-      <source>TOT_PLOT2D_NORMALIZE_MODE_LMIN</source>
-      <translation>左の Y 軸: 世界最小の標準化</translation>
+      <source>AC_CLOSE_BTN</source>
+      <translation>閉じる(&amp;C)</translation>
     </message>
     <message>
-      <source>TOT_PLOT2D_NORMALIZE_MODE_RMAX</source>
-      <translation>右の Y 軸: グローバルの最大値を標準化します。</translation>
+      <source>AC_HELP_BTN</source>
+      <translation>ヘルプ</translation>
     </message>
+  </context>
+  <context>
+    <name>Plot2d_SetupCurveScaleDlg</name>
     <message>
-      <source>TOT_PLOT2D_NORMALIZE_MODE_RMIN</source>
-      <translation>右の Y 軸: 世界最小の標準化</translation>
+      <source>TLT_SETUP_CURVE_SCALE</source>
+      <translation>スケールの曲線 (s)</translation>
     </message>
     <message>
-      <source>PLOT2D_CURVE_TYPE_LINES</source>
-      <translation>ã\83©ã\82¤ã\83³</translation>
+      <source>CURVE_SCALE_FACTOR</source>
+      <translation>ã\82¹ã\82±ã\83¼ã\83« ã\83\95ã\82¡ã\82¯ã\82¿ã\83¼</translation>
     </message>
+  </context>
+  <context>
+    <name>Plot2d_SetupViewDlg</name>
     <message>
-      <source>MEN_PLOT2D_CURVES_SPLINES</source>
-      <translation>スプラインを描画します。</translation>
+      <source>PLOT2D_CURVE_TYPE_LBL</source>
+      <translation>曲線の種類:</translation>
     </message>
     <message>
-      <source>PRP_PLOT2D_MODE_LOGARITHMIC_HOR</source>
-      <translation>横軸ã\81«å¯¾æ\95°ã\82¹ã\82±ã\83¼ã\83« ã\83¢ã\83¼ã\83\89ã\81®è¡¨ç¤ºæ\96¹æ³\95ã\82\92å¤\89æ\9b´</translation>
+      <source>PLOT2D_SET_AS_DEFAULT_CHECK</source>
+      <translation>æ\97¢å®\9aã\81®è¨­å®\9aã\81¨ã\81\97ã\81¦ä¿\9då­\98ã\81\97ã\81¾ã\81\99ã\80\82</translation>
     </message>
     <message>
-      <source>PRP_PLOT2D_MODE_LOGARITHMIC_VER</source>
-      <translation>垂直軸を対数スケール モードの表示方法を変更</translation>
+      <source>PLOT2D_SCALE_MODE_HOR</source>
+      <translation>水平軸:</translation>
     </message>
     <message>
-      <source>PLOT2D_IMAGE_FILES</source>
-      <translation>イメージ (*.bmp *.png *.jpg *.jpeg) ファイル</translation>
+      <source>PLOT2D_NORMALIZE_TLT</source>
+      <translation>標準化</translation>
     </message>
     <message>
-      <source>PLOT2D_MAX_INTERVALS</source>
-      <translation>æ\9c\80大é\96\93é\9a\94</translation>
+      <source>PLOT2D_NORMALIZE_MODE_MIN</source>
+      <translation>æ\9c\80å°\8fã\82\92æ¨\99æº\96å\8c\96ã\81\97ã\81¾ã\81\99ã\80\82</translation>
     </message>
     <message>
-      <source>INF_AXES_Y_LEFT</source>
-      <translation>左の Y 軸</translation>
+      <source>PLOT2D_NORMALIZE_MODE_MAX</source>
+      <translation>最大値を標準化します。</translation>
     </message>
     <message>
-      <source>CURVE_COLOR_LAB</source>
-      <translation>色:</translation>
+      <source>PLOT2D_NORMALIZE_LEFT_AXIS</source>
+      <translation>左の Y 軸:</translation>
     </message>
     <message>
-      <source>CURVE_PREVIEW_LAB</source>
-      <translation>プレビュー</translation>
+      <source>PLOT2D_NORMALIZE_RIGHT_AXIS</source>
+      <translation>右の Y 軸:</translation>
     </message>
     <message>
-      <source>DIAMOND_MARKER_LBL</source>
-      <translation>ダイヤモンド</translation>
+      <source>PLOT2D_SCALE_MODE_VER</source>
+      <translation>垂直軸:</translation>
     </message>
     <message>
-      <source>PLOT2D_LEGEND_POSITION_TOP</source>
-      <translation>ã\83\88ã\83\83ã\83\97</translation>
+      <source>PLOT2D_GRID_TLT</source>
+      <translation>ã\82°ã\83ªã\83\83ã\83\89ã\80\81軸ã\81®ã\83\9eã\83¼ã\82¯</translation>
     </message>
     <message>
-      <source>TOT_PLOT2D_CHANGE_BACKGROUND</source>
-      <translation>背景を変更</translation>
+      <source>INF_AXES_X</source>
+      <translation>X 軸</translation>
     </message>
     <message>
-      <source>MEN_PLOT2D_CHANGE_BACKGROUND</source>
-      <translation>背景を変更する.</translation>
+      <source>PLOT2D_SCALE_TLT</source>
+      <translation>スケール モード</translation>
     </message>
     <message>
-      <source>PRP_PLOT2D_CHANGE_BACKGROUND</source>
-      <translation>背景の色を変更します。</translation>
+      <source>PLOT2D_LEGEND_POSITION_BOTTOM</source>
+      <translation type="unfinished">Bottom</translation>
     </message>
     <message>
-      <source>SOLID_LINE_LBL</source>
-      <translation>ソリッド</translation>
+      <source>TLT_SETUP_PLOT2D_VIEW</source>
+      <translation>2次元可視化設定をプロットします。</translation>
+    </message>
+    <message>
+      <source>PLOT2D_ENABLE_VER_TITLE</source>
+      <translation>垂直軸のタイトル</translation>
+    </message>
+    <message>
+      <source>PLOT2D_ENABLE_HOR_TITLE</source>
+      <translation>水平軸のタイトル</translation>
+    </message>
+    <message>
+      <source>PLOT2D_CURVE_TYPE_LINES</source>
+      <translation>ライン</translation>
+    </message>
+    <message>
+      <source>PLOT2D_MAX_INTERVALS</source>
+      <translation>最大間隔</translation>
+    </message>
+    <message>
+      <source>INF_AXES_Y_LEFT</source>
+      <translation>左の Y 軸</translation>
+    </message>
+    <message>
+      <source>PLOT2D_LEGEND_POSITION_TOP</source>
+      <translation>トップ</translation>
     </message>
     <message>
       <source>PLOT2D_GRID_ENABLE_VER_MAJOR</source>
       <source>PLOT2D_GRID_ENABLE_VER_MINOR</source>
       <translation>セカンダリ垂直</translation>
     </message>
-    <message>
-      <source>TOT_PLOT2D_CURVES_POINTS</source>
-      <translation>ポイントを描画します。</translation>
-    </message>
     <message>
       <source>PLOT2D_GRID_ENABLE_HOR_MINOR</source>
       <translation>セカンダリ水平</translation>
       <source>PLOT2D_DEVIATION_CL_LBL</source>
       <translation>色</translation>
     </message>
-    <message>
-      <source>WRN_XLOG_NOT_ALLOWED</source>
-      <translation>X 軸上非陽性値を持つポイントが検出されました。カテゴリの対数目盛は許可されていません。</translation>
-    </message>
-    <message>
-      <source>WRN_YLOG_NOT_ALLOWED</source>
-      <translation>Y 軸上非陽性値を持つポイントが検出されました。切片の対数目盛は許可されていません。</translation>
-    </message>
-    <message>
-      <source>DSC_FITRECT</source>
-      <translation>シーンのボックスで選択した領域を調整します。</translation>
-    </message>
     <message>
       <source>PLOT2D_LEGEND_POSITION_LEFT</source>
       <translation>左</translation>
     </message>
-    <message>
-      <source>MNU_FITRECT</source>
-      <translation>表示エリア</translation>
-    </message>
-    <message>
-      <source>DOT_LINE_LBL</source>
-      <translation>基準点</translation>
-    </message>
-    <message>
-      <source>MEN_PLOT2D_CURVES_POINTS</source>
-      <translation>ポイントを描画します。</translation>
-    </message>
-    <message>
-      <source>PRP_PLOT2D_CURVES_POINTS</source>
-      <translation>表示モードのポイントを変更します。</translation>
-    </message>
     <message>
       <source>PLOT2D_SCALE_MODE_LOGARITHMIC</source>
       <translation>対数</translation>
       <source>PLOT2D_LEGEND_POSITION_RIGHT</source>
       <translation>右</translation>
     </message>
-    <message>
-      <source>DSC_DUMP_VIEW</source>
-      <translation>現在のビューをイメージ ファイルに保存します。</translation>
-    </message>
-    <message>
-      <source>WARNING</source>
-      <translation>警告</translation>
-    </message>
     <message>
       <source>PLOT2D_ENABLE_LEGEND</source>
       <translation>キャプションを表示します。</translation>
       <translation>凡例のフォント</translation>
     </message>
     <message>
-      <source>DSC_ZOOM_VIEW</source>
-      <translation>ズーム</translation>
-    </message>
-    <message>
-      <source>PRP_PLOT2D_ANALYTICAL_CURVES</source>
-      <translation>分析曲線のプロパティを設定します。</translation>
-    </message>
-    <message>
-      <source>PRP_PLOT2D_NORMALIZE_MODE_LMAX</source>
-      <translation>左側の Y 軸の最大の標準化の方法に、ビューを切り替える</translation>
+      <source>PLOT2D_SCALE_MODE_LINEAR</source>
+      <translation>線形</translation>
     </message>
     <message>
-      <source>PRP_PLOT2D_NORMALIZE_MODE_LMIN</source>
-      <translation>左側の Y 軸の最小の標準化の方法に、ビューを切り替える</translation>
+      <source>PLOT2D_CURVE_TYPE_POINTS</source>
+      <translation>ポイント</translation>
     </message>
     <message>
-      <source>PRP_PLOT2D_NORMALIZE_MODE_RMAX</source>
-      <translation>右側の Y 軸の最大の標準化の方法に、ビューを切り替える</translation>
+      <source>PLOT2D_CURVE_TYPE_SPLINE</source>
+      <translation>スプライン</translation>
     </message>
     <message>
-      <source>PRP_PLOT2D_NORMALIZE_MODE_RMIN</source>
-      <translation>右側の Y 軸の最小の標準化の方法に、ビューを切り替える</translation>
+      <source>INF_AXES_Y_RIGHT</source>
+      <translation>右の Y 軸</translation>
     </message>
     <message>
-      <source>PRP_PLOT2D_SETTINGS</source>
-      <translation>可視化を設定します。</translation>
+      <source>PLOT2D_MARKER_SIZE_LBL</source>
+      <translation>マーカーのサイズ:</translation>
     </message>
     <message>
-      <source>INF_COORDINATES_SOME_Y</source>
-      <translation>お問い合わせ: x: %1、y: %2 ( %3 )</translation>
+      <source>PLOT2D_ENABLE_MAIN_TITLE</source>
+      <translation>主なタイトル</translation>
     </message>
     <message>
-      <source>SCALING_POPUP</source>
-      <translation>スケール</translation>
+      <source>PLOT2D_LEGEND_GROUP</source>
+      <translation>凡例</translation>
     </message>
     <message>
-      <source>PLOT2D_SCALE_MODE_LINEAR</source>
-      <translation>線形</translation>
+      <source>PLOT2D_LEGEND_POSITION</source>
+      <translation>凡例の位置</translation>
     </message>
     <message>
-      <source>TOT_PLOT2D_FITDATA</source>
-      <translation>間隔を調整します。</translation>
+      <source>PLOT2D_LEGEND_SYMBOL_TYPE</source>
+      <translation>シンボルタイプ:</translation>
     </message>
     <message>
-      <source>PLOT2D_CURVE_TYPE_POINTS</source>
-      <translation>ポイント</translation>
+      <source>PLOT2D_MARKER_ABOVE_LINE</source>
+      <translation>線の上のマーカー</translation>
     </message>
     <message>
-      <source>PLOT2D_CURVE_TYPE_SPLINE</source>
-      <translation>スプライン</translation>
+      <source>PLOT2D_MARKER_ON_LINE</source>
+      <translation>線上のマーカー</translation>
     </message>
     <message>
-      <source>MEN_PLOT2D_FITDATA</source>
-      <translation>間隔を調整します。(&amp;R)</translation>
+      <source>PLOT2D_LEGEND_FONT_COLOR</source>
+      <translation>凡例フォントの色:</translation>
     </message>
     <message>
-      <source>MEN_PLOT2D_MODE_LOGARITHMIC_HOR</source>
-      <translation>水平軸: 対数</translation>
+      <source>PLOT2D_SELECTED_LEGEND_FONT_COLOR</source>
+      <translation>ハイライト凡例フォントの色:</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_SetupCurveDlg</name>
     <message>
-      <source>MEN_PLOT2D_MODE_LOGARITHMIC_VER</source>
-      <translation>垂直軸: 対数</translation>
+      <source>TLT_SETUP_CURVE</source>
+      <translation>曲線を初期化します。</translation>
     </message>
     <message>
-      <source>MEN_PLOT2D_NORMALIZE_MODE_LMIN</source>
-      <translation>左の Y 軸: 最小</translation>
+      <source>CURVE_LINE_WIDTH_LAB</source>
+      <translation>線の太さ:</translation>
     </message>
     <message>
-      <source>MEN_PLOT2D_NORMALIZE_MODE_LMAX</source>
-      <translation>å·¦ã\81® Y è»¸: æ\9c\80大</translation>
+      <source>CURVE_LINE_TYPE_LAB</source>
+      <translation>å\9b\9eç·\9aã\81®ç¨®é¡\9e:</translation>
     </message>
     <message>
-      <source>MEN_PLOT2D_NORMALIZE_MODE_RMIN</source>
-      <translation>右の Y 軸: 最小</translation>
+      <source>CURVE_COLOR_LAB</source>
+      <translation>色:</translation>
     </message>
     <message>
-      <source>MEN_PLOT2D_NORMALIZE_MODE_RMAX</source>
-      <translation>右の Y 軸: 最大</translation>
+      <source>CURVE_PREVIEW_LAB</source>
+      <translation>プレビュー</translation>
     </message>
     <message>
-      <source>PRP_PLOT2D_FITDATA</source>
-      <translation>指定したデータ範囲を調整します。</translation>
+      <source>CURVE_MARKER_TYPE_LAB</source>
+      <translation>マーカーの種類:</translation>
     </message>
+</context>
+<context>
+    <name>Plot2d_ViewWindow</name>
     <message>
-      <source>MEN_PLOT2D_MODE_LINEAR_VER</source>
-      <translation>垂直軸: 線形</translation>
+      <source>MNU_DUMP_VIEW</source>
+      <translation>ビューを保存.</translation>
     </message>
     <message>
-      <source>MEN_PLOT2D_MODE_LINEAR_HOR</source>
-      <translation>水平軸: 線形</translation>
+      <source>MNU_PAN_VIEW</source>
+      <translation>パンニング</translation>
     </message>
     <message>
-      <source>NONE_MARKER_LBL</source>
-      <translation>[なし]</translation>
+      <source>MNU_CLONE_VIEW</source>
+      <translation>ビューの複製</translation>
     </message>
     <message>
-      <source>ERR_DOC_CANT_SAVE_FILE</source>
-      <translation>ファイルを保存できませんでした。</translation>
+      <source>MNU_PRINT_VIEW</source>
+      <translation>印刷ビュー</translation>
     </message>
     <message>
-      <source>MEN_PLOT2D_SHOW_LEGEND</source>
-      <translation>キャプションを表示します。(&amp;L)</translation>
+      <source>POSTSCRIPT_FILES</source>
+      <translation>PostScript ファイル (* .ps)</translation>
     </message>
     <message>
-      <source>PRP_PLOT2D_SHOW_LEGEND</source>
-      <translation>凡例を有効または無効</translation>
+      <source>ENCAPSULATED_POSTSCRIPT_FILES</source>
+      <translation>カプセル化された PostScript (*.eps) ファイル</translation>
     </message>
     <message>
-      <source>TOT_PLOT2D_SHOW_LEGEND</source>
-      <translation>キャプションを表示します。</translation>
+      <source>PDF_FILES</source>
+      <translation>PDF files (*.pdf)</translation>
     </message>
     <message>
-      <source>INF_AXES_Y_RIGHT</source>
-      <translation>右の Y 軸</translation>
+      <source>DSC_GLOBALPAN_VIEW</source>
+      <translation>ビューの新しい中心地の選択</translation>
     </message>
     <message>
-      <source>DAHSDOTDOT_LINE_LBL</source>
-      <translation>TiretPointPoint</translation>
+      <source>PRP_PLOT2D_MODE_LINEAR_VER</source>
+      <translation>線形スケールのモードには、垂直軸の表示を変更します。</translation>
     </message>
     <message>
-      <source>TOT_PLOT2D_CURVES_SPLINES</source>
-      <translation>スプラインを描画します。</translation>
+      <source>PRP_PLOT2D_MODE_LINEAR_HOR</source>
+      <translation>線形スケールのモードに、ビューの水平方向の軸を変更します。</translation>
     </message>
     <message>
-      <source>CURVE_MARKER_TYPE_LAB</source>
-      <translation>マーカーの種類:</translation>
+      <source>CURVE_TYPE_POPUP</source>
+      <translation>曲線の種類</translation>
     </message>
     <message>
-      <source>MEN_PLOT2D_SETTINGS</source>
-      <translation>パラメーター(&amp;S)</translation>
+      <source>NORMALIZATION_TYPE_POPUP</source>
+      <translation>標準化</translation>
     </message>
     <message>
-      <source>MEN_PLOT2D_ANALYTICAL_CURVES</source>
-      <translation>å\88\86æ\9e\90æ\9b²ç·\9a</translation>
+      <source>TOT_PLOT2D_MODE_LINEAR_VER</source>
+      <translation>å\9e\82ç\9b´è»¸: ç·\9aå½¢</translation>
     </message>
     <message>
-      <source>CIRCLE_MARKER_LBL</source>
-      <translation></translation>
+      <source>TOT_PLOT2D_MODE_LINEAR_HOR</source>
+      <translation>水平軸: 線形</translation>
     </message>
     <message>
-      <source>LBL_TOOLBAR_LABEL</source>
-      <translation>表示操作</translation>
+      <source>MNU_ZOOM_VIEW</source>
+      <translation>ズーム</translation>
     </message>
     <message>
-      <source>NONE_LINE_LBL</source>
-      <translation>[なし]</translation>
+      <source>DSC_PAN_VIEW</source>
+      <translation>ビューを移動します。</translation>
     </message>
     <message>
-      <source>PLOT2D_MARKER_SIZE_LBL</source>
-      <translation>マーカーのサイズ:</translation>
+      <source>PRP_PLOT2D_CURVES_SPLINES</source>
+      <translation>表示モードのスプラインを変更します。</translation>
     </message>
     <message>
-      <source>PLOT2D_ENABLE_MAIN_TITLE</source>
-      <translation>主なタイトル</translation>
+      <source>DSC_FITALL</source>
+      <translation>すべてのオブジェクトを表示するには、シーンを調整します。</translation>
     </message>
     <message>
-      <source>PLOT2D_LEGEND_GROUP</source>
-      <translation>凡例</translation>
+      <source>MNU_FITALL</source>
+      <translation>すべて表示</translation>
     </message>
     <message>
-      <source>PLOT2D_LEGEND_POSITION</source>
-      <translation>凡例の位置</translation>
+      <source>TOT_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+      <translation>水平軸: 対数</translation>
     </message>
     <message>
-      <source>PLOT2D_LEGEND_SYMBOL_TYPE</source>
-      <translation>シンボルタイプ:</translation>
+      <source>TOT_PLOT2D_MODE_LOGARITHMIC_VER</source>
+      <translation>垂直軸: 対数</translation>
     </message>
     <message>
-      <source>PLOT2D_MARKER_ABOVE_LINE</source>
-      <translation>線の上のマーカー</translation>
+      <source>MNU_GLOBALPAN_VIEW</source>
+      <translation>グローバルパンニング</translation>
     </message>
     <message>
-      <source>PLOT2D_MARKER_ON_LINE</source>
-      <translation>ç·\9aä¸\8aã\81®ã\83\9eã\83¼ã\82«ã\83¼</translation>
+      <source>DSC_CLONE_VIEW</source>
+      <translation>ç\8f¾å\9c¨ã\81®ã\82¹ã\83\86ã\83¼ã\82¸ã\81®æ\96°ã\81\97ã\81\84ã\83\93ã\83¥ã\83¼ã\82¢ã\83¼ OCC ã\82\92é\96\8bã\81\8f</translation>
     </message>
     <message>
-      <source>PLOT2D_LEGEND_FONT_COLOR</source>
-      <translation>凡例フォントの色:</translation>
+      <source>DSC_PRINT_VIEW</source>
+      <translation>現在のビューを印刷します。</translation>
     </message>
     <message>
-      <source>PLOT2D_SELECTED_LEGEND_FONT_COLOR</source>
-      <translation>ã\83\8fã\82¤ã\83©ã\82¤ã\83\88å\87¡ä¾\8bã\83\95ã\82©ã\83³ã\83\88ã\81®è\89²:</translation>
+      <source>TOT_PLOT2D_SETTINGS</source>
+      <translation>ã\83\91ã\83©ã\83¡ã\83¼ã\82¿ã\83¼</translation>
     </message>
     <message>
-      <source>TOT_PLOT2D_CURVES_LINES</source>
-      <translation>線を描く</translation>
+      <source>TOT_PLOT2D_ANALYTICAL_CURVES</source>
+      <translation>分析曲線</translation>
     </message>
     <message>
-      <source>PRP_PLOT2D_CURVES_LINES</source>
-      <translation>表示モードの行を変更します。</translation>
+      <source>TOT_PLOT2D_NORMALIZE_MODE_LMAX</source>
+      <translation>左の Y 軸: グローバルの最大値を標準化します。</translation>
     </message>
     <message>
-      <source>MEN_PLOT2D_CURVES_LINES</source>
-      <translation>線を描く</translation>
+      <source>TOT_PLOT2D_NORMALIZE_MODE_LMIN</source>
+      <translation>左の Y 軸: 世界最小の標準化</translation>
     </message>
-  </context>
-  <context>
-    <name>Plot2d_FitDataDlg</name>
     <message>
-      <source>FIT_HORIZONTAL</source>
-      <translation>水平調整します。</translation>
+      <source>TOT_PLOT2D_NORMALIZE_MODE_RMAX</source>
+      <translation>右の Y 軸: グローバルの最大値を標準化します。</translation>
     </message>
     <message>
-      <source>MIN_VALUE_LAB</source>
-      <translation>最小:</translation>
+      <source>TOT_PLOT2D_NORMALIZE_MODE_RMIN</source>
+      <translation>右の Y 軸: 世界最小の標準化</translation>
     </message>
     <message>
-      <source>VERTICAL_AXIS</source>
-      <translation>垂直軸</translation>
+      <source>MEN_PLOT2D_CURVES_SPLINES</source>
+      <translation>スプラインを描画します。</translation>
     </message>
     <message>
-      <source>MAX_VALUE_LAB</source>
-      <translation>æ\9c\80大:</translation>
+      <source>PRP_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+      <translation>横軸ã\81«å¯¾æ\95°ã\82¹ã\82±ã\83¼ã\83« ã\83¢ã\83¼ã\83\89ã\81®è¡¨ç¤ºæ\96¹æ³\95ã\82\92å¤\89æ\9b´</translation>
     </message>
     <message>
-      <source>HORIZONTAL_AXIS</source>
-      <translation>水平軸</translation>
+      <source>PRP_PLOT2D_MODE_LOGARITHMIC_VER</source>
+      <translation>垂直軸を対数スケール モードの表示方法を変更</translation>
     </message>
     <message>
-      <source>VERTICAL_LEFT_AXIS</source>
-      <translation>左側の垂直軸</translation>
+      <source>TOT_PLOT2D_CURVES_POINTS</source>
+      <translation>ポイントを描画します。</translation>
     </message>
     <message>
-      <source>FIT_ALL</source>
-      <translation>ã\81\99ã\81¹ã\81¦を調整します。</translation>
+      <source>DSC_FITRECT</source>
+      <translation>ã\82·ã\83¼ã\83³ã\81®ã\83\9cã\83\83ã\82¯ã\82¹ã\81§é\81¸æ\8a\9eã\81\97ã\81\9fé \98å\9f\9fを調整します。</translation>
     </message>
     <message>
-      <source>VERTICAL_RIGHT_AXIS</source>
-      <translation>右数値軸</translation>
+      <source>MNU_FITRECT</source>
+      <translation>表示エリア</translation>
     </message>
     <message>
-      <source>FIT_VERTICAL</source>
-      <translation>垂直方向に調整します。</translation>
+      <source>MEN_PLOT2D_CURVES_POINTS</source>
+      <translation>ポイントを描画します。</translation>
     </message>
-  </context>
-  <context>
-    <name>Plot2d_ViewManager</name>
     <message>
-      <source>PLOT2D_VIEW_TITLE</source>
-      <translation>シーン Plot2d: %M - ビューアー: %V</translation>
+      <source>PRP_PLOT2D_CURVES_POINTS</source>
+      <translation>表示モードのポイントを変更します。</translation>
     </message>
     <message>
-      <source>PREF_GROUP_PLOT2DVIEWER</source>
-      <translation>Plot 2D Viewer</translation>
+      <source>DSC_DUMP_VIEW</source>
+      <translation>現在のビューをイメージ ファイルに保存します。</translation>
     </message>
     <message>
-      <source>PREF_SHOW_LEGEND</source>
-      <translation>ã\82­ã\83£ã\83\97ã\82·ã\83§ã\83³ã\82\92表示ã\81\97ã\81¾ã\81\99ã\80\82</translation>
+      <source>DSC_ZOOM_VIEW</source>
+      <translation>ã\82ºã\83¼ã\83 </translation>
     </message>
     <message>
-      <source>PREF_LEGEND_POSITION</source>
-      <translation>å\87¡ä¾\8bã\81®ä½\8dç½®:</translation>
+      <source>PRP_PLOT2D_ANALYTICAL_CURVES</source>
+      <translation>å\88\86æ\9e\90æ\9b²ç·\9aã\81®ã\83\97ã\83­ã\83\91ã\83\86ã\82£ã\82\92設å®\9aã\81\97ã\81¾ã\81\99ã\80\82</translation>
     </message>
     <message>
-      <source>PREF_LEFT</source>
-      <translation>左</translation>
+      <source>PRP_PLOT2D_NORMALIZE_MODE_LMAX</source>
+      <translation>左側の Y 軸の最大の標準化の方法に、ビューを切り替える</translation>
     </message>
     <message>
-      <source>PREF_RIGHT</source>
-      <translation>å\8f³</translation>
+      <source>PRP_PLOT2D_NORMALIZE_MODE_LMIN</source>
+      <translation>å·¦å\81´ã\81® Y è»¸ã\81®æ\9c\80å°\8fã\81®æ¨\99æº\96å\8c\96ã\81®æ\96¹æ³\95ã\81«ã\80\81ã\83\93ã\83¥ã\83¼ã\82\92å\88\87ã\82\8aæ\9b¿ã\81\88ã\82\8b</translation>
     </message>
     <message>
-      <source>PREF_TOP</source>
-      <translation>ページのトップへ</translation>
+      <source>PRP_PLOT2D_NORMALIZE_MODE_RMAX</source>
+      <translation>右側の Y 軸の最大の標準化の方法に、ビューを切り替える</translation>
     </message>
     <message>
-      <source>PREF_BOTTOM</source>
-      <translation>BAS</translation>
+      <source>PRP_PLOT2D_NORMALIZE_MODE_RMIN</source>
+      <translation>右側の Y 軸の最小の標準化の方法に、ビューを切り替える</translation>
     </message>
     <message>
-      <source>PREF_CURVE_TYPE</source>
-      <translation>曲線の種類:</translation>
+      <source>PRP_PLOT2D_SETTINGS</source>
+      <translation>可視化を設定します。</translation>
     </message>
     <message>
-      <source>PREF_POINTS</source>
-      <translation>ã\83\9dã\82¤ã\83³ã\83\88</translation>
+      <source>SCALING_POPUP</source>
+      <translation>ã\82¹ã\82±ã\83¼ã\83«</translation>
     </message>
     <message>
-      <source>PREF_LINES</source>
-      <translation>ライン</translation>
+      <source>TOT_PLOT2D_FITDATA</source>
+      <translation>間隔を調整します。</translation>
     </message>
     <message>
-      <source>PREF_SPLINE</source>
-      <translation>スプライン</translation>
+      <source>MEN_PLOT2D_FITDATA</source>
+      <translation>間隔を調整します。(&amp;R)</translation>
     </message>
     <message>
-      <source>PREF_MARKER_SIZE</source>
-      <translation>座標系のサイズ:</translation>
+      <source>PRP_PLOT2D_FITDATA</source>
+      <translation>指定したデータ範囲を調整します。</translation>
     </message>
     <message>
-      <source>PREF_LINEAR</source>
-      <translation>線形</translation>
+      <source>MEN_PLOT2D_MODE_LOGARITHMIC_HOR</source>
+      <translation>水平軸: 対数</translation>
     </message>
     <message>
-      <source>PREF_LOGARITHMIC</source>
-      <translation>対数</translation>
+      <source>MEN_PLOT2D_MODE_LOGARITHMIC_VER</source>
+      <translation>å\9e\82ç\9b´è»¸: å¯¾æ\95°</translation>
     </message>
     <message>
-      <source>PREF_HOR_AXIS_SCALE</source>
-      <translation>水平方向の軸のスケール:</translation>
+      <source>MEN_PLOT2D_NORMALIZE_MODE_LMIN</source>
+      <translation>左の Y 軸: 最小</translation>
     </message>
     <message>
-      <source>PREF_VERT_AXIS_SCALE</source>
-      <translation>å\9e\82ç\9b´è»¸ã\81®ã\82¹ã\82±ã\83¼ã\83«:</translation>
+      <source>MEN_PLOT2D_NORMALIZE_MODE_LMAX</source>
+      <translation>å·¦ã\81® Y è»¸: æ\9c\80大</translation>
     </message>
     <message>
-      <source>PREF_VIEWER_BACKGROUND</source>
-      <translation>背景色</translation>
+      <source>MEN_PLOT2D_NORMALIZE_MODE_RMIN</source>
+      <translation>右の Y 軸: 最小</translation>
     </message>
-  </context>
-  <context>
-    <name>Plot2d_AnalyticalCurveDlg</name>
     <message>
-      <source>ANALYTICAL_CURVE_TLT</source>
-      <translation>å\88\86æ\9e\90æ\9b²ç·\9aã\81®ã\83\97ã\83­ã\83\91ã\83\86ã\82£</translation>
+      <source>MEN_PLOT2D_NORMALIZE_MODE_RMAX</source>
+      <translation>å\8f³ã\81® Y è»¸: æ\9c\80大</translation>
     </message>
     <message>
-      <source>AC_CURVE_PARAMS</source>
-      <translation>曲線のパラメーター</translation>
+      <source>MEN_PLOT2D_MODE_LINEAR_VER</source>
+      <translation>垂直軸: 線形</translation>
     </message>
     <message>
-      <source>AC_CURVE_PROPS</source>
-      <translation>æ\9b²ç·\9aã\81®ã\83\97ã\83­ã\83\91ã\83\86ã\82£</translation>
+      <source>MEN_PLOT2D_MODE_LINEAR_HOR</source>
+      <translation>水平軸: ç·\9aå½¢</translation>
     </message>
     <message>
-      <source>AC_FORMULA</source>
-      <translation>y (x) =</translation>
+      <source>MEN_PLOT2D_SHOW_LEGEND</source>
+      <translation>キャプションを表示します。(&amp;L)</translation>
     </message>
     <message>
-      <source>AC_NB_INTERVALS</source>
-      <translation>Nb に登録間隔</translation>
+      <source>PRP_PLOT2D_SHOW_LEGEND</source>
+      <translation>凡例を有効または無効</translation>
     </message>
     <message>
-      <source>AC_AUTO_ASSIGN</source>
-      <translation>自動割り当て。</translation>
+      <source>TOT_PLOT2D_SHOW_LEGEND</source>
+      <translation>キャプションを表示します。</translation>
     </message>
     <message>
-      <source>AC_MARKER_TYPE</source>
-      <translation>ã\83\9eã\83¼ã\82«ã\83¼ã\81®ç¨®é¡\9e</translation>
+      <source>TOT_PLOT2D_CURVES_SPLINES</source>
+      <translation>ã\82¹ã\83\97ã\83©ã\82¤ã\83³ã\82\92æ\8f\8fç\94»ã\81\97ã\81¾ã\81\99ã\80\82</translation>
     </message>
     <message>
-      <source>AC_LINE_TYPE</source>
-      <translation>行の種類</translation>
+      <source>MEN_PLOT2D_SETTINGS</source>
+      <translation>パラメーター(&amp;S)</translation>
     </message>
     <message>
-      <source>AC_LINE_WIDTH</source>
-      <translation>線の太さ</translation>
+      <source>MEN_PLOT2D_ANALYTICAL_CURVES</source>
+      <translation>分析曲線</translation>
     </message>
     <message>
-      <source>AC_CURVE_COLOR</source>
-      <translation>曲線の色</translation>
+      <source>LBL_TOOLBAR_LABEL</source>
+      <translation>表示操作</translation>
     </message>
     <message>
-      <source>AC_ADD_BTN</source>
-      <translation>カーブを追加します。</translation>
+      <source>TOT_PLOT2D_CURVES_LINES</source>
+      <translation>線を描く</translation>
     </message>
     <message>
-      <source>AC_REM_BTN</source>
-      <translation>カーブを削除します。</translation>
+      <source>PRP_PLOT2D_CURVES_LINES</source>
+      <translation>表示モードの行を変更します。</translation>
     </message>
     <message>
-      <source>AC_OK_BTN</source>
-      <translation>わかりました</translation>
+      <source>MEN_PLOT2D_CURVES_LINES</source>
+      <translation>線を描く</translation>
     </message>
+  </context>
+  <context>
+    <name>Plot2d_Viewer</name>
     <message>
-      <source>AC_APPLY_BTN</source>
-      <translation>適用</translation>
+      <source>MNU_DUMP_VIEW</source>
+      <translation>ビューを保存.</translation>
     </message>
     <message>
-      <source>AC_CANT_CALCULATE</source>
-      <translation>曲線は計算できません。入力パラメーターを確認してください。</translation>
+      <source>MEN_PLOT2D_CHANGE_BACKGROUND</source>
+      <translation>背景を変更する.</translation>
     </message>
+  </context>
+  <context>
+    <name>Plot2d_ViewFrame</name>
     <message>
-      <source>AC_CLOSE_BTN</source>
-      <translation>閉じる(&amp;C)</translation>
+      <source>INF_COORDINATES</source>
+      <translation>お問い合わせ: x: %1、y: %2</translation>
     </message>
     <message>
-      <source>AC_HELP_BTN</source>
-      <translation>ã\83\98ã\83«ã\83\97</translation>
+      <source>INF_COORDINATES_SOME_Y</source>
+      <translation>ã\81\8aå\95\8fã\81\84å\90\88ã\82\8fã\81\9b: x: %1ã\80\81y: %2 ( %3 )</translation>
     </message>
-  </context>
-  <context>
-    <name>Plot2d_SetupCurveScaleDlg</name>
     <message>
-      <source>TLT_SETUP_CURVE_SCALE</source>
-      <translation>スケールの曲線 (s)</translation>
+      <source>WRN_XLOG_NOT_ALLOWED</source>
+      <translation>X 軸上非陽性値を持つポイントが検出されました。カテゴリの対数目盛は許可されていません。</translation>
     </message>
     <message>
-      <source>CURVE_SCALE_FACTOR</source>
-      <translation>スケール ファクター</translation>
+      <source>WRN_YLOG_NOT_ALLOWED</source>
+      <translation>Y 軸上非陽性値を持つポイントが検出されました。切片の対数目盛は許可されていません。</translation>
     </message>
   </context>
 </TS>
index a14eca1d0c976acb9dff9d577030187b23421e8a..a3991bf88a8885103e52a684776b8716e737f344 100644 (file)
@@ -248,6 +248,10 @@ void PyConsole_Console::contextMenuPopup( QMenu* menu )
   menu->addAction( myActions[SelectAllId] );
   menu->addSeparator();
   menu->addAction( myActions[DumpCommandsId] );
+  if ( !myEditor->isLogging() )
+    menu->addAction( myActions[StartLogId] );
+  else
+    menu->addAction( myActions[StopLogId] );
 
   Qtx::simplifySeparators( menu );
 
@@ -269,6 +273,8 @@ void PyConsole_Console::setMenuActions( const int flags )
   myActions[ClearId]->setVisible( flags & ClearId );
   myActions[SelectAllId]->setVisible( flags & SelectAllId );
   myActions[DumpCommandsId]->setVisible( flags & DumpCommandsId );
+  myActions[StartLogId]->setVisible( flags & StartLogId );
+  myActions[StopLogId]->setVisible( flags & StopLogId );
 }
 
 /*!
@@ -284,6 +290,8 @@ int PyConsole_Console::menuActions() const
   ret = ret | ( myActions[ClearId]->isVisible() ? ClearId : 0 );
   ret = ret | ( myActions[SelectAllId]->isVisible() ? SelectAllId : 0 );
   ret = ret | ( myActions[DumpCommandsId]->isVisible() ? DumpCommandsId : 0 );
+  ret = ret | ( myActions[StartLogId]->isVisible() ? StartLogId : 0 );
+  ret = ret | ( myActions[StopLogId]->isVisible() ? StopLogId : 0 );
   return ret;
 }
 
@@ -318,6 +326,16 @@ void PyConsole_Console::createActions()
   a->setStatusTip( tr( "EDIT_DUMPCOMMANDS_CMD" ) );
   connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( dump() ) );
   myActions.insert( DumpCommandsId, a );
+
+  a = new QAction( tr( "EDIT_STARTLOG_CMD" ), this );
+  a->setStatusTip( tr( "EDIT_STARTLOG_CMD" ) );
+  connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( startLog() ) );
+  myActions.insert( StartLogId, a );
+
+  a = new QAction( tr( "EDIT_STOPLOG_CMD" ), this );
+  a->setStatusTip( tr( "EDIT_STOPLOG_CMD" ) );
+  connect( a, SIGNAL( triggered( bool ) ), myEditor, SLOT( stopLog() ) );
+  myActions.insert( StopLogId, a );
 }
 
 /*!
@@ -332,6 +350,23 @@ void PyConsole_Console::updateActions()
   myActions[SelectAllId]->setEnabled( !myEditor->document()->isEmpty() );
 }
 
+/*!
+  \brief Start python trace logging
+  \param fileName the path to the log file
+*/
+void PyConsole_Console::startLog( const QString& fileName )
+{
+  myEditor->startLog( fileName );
+}
+
+/*!
+  \brief Stop python trace logging
+*/
+void PyConsole_Console::stopLog()
+{
+  myEditor->stopLog();
+}
+
 /**
  * Similar to constructor of the base class but using enhanced objects.
  * TODO: this should really be done in a factory to avoid code duplication.
index 75163a9ae1e4b877d34412f3e82f31ae4a0c1f95..54442c2cd9c162cf2ed847410406789064866075 100644 (file)
@@ -44,12 +44,14 @@ public:
   //! Context popup menu actions flags
   enum
   {
-    CopyId         = 0x01,                                           //!< "Copy" menu action
-    PasteId        = 0x02,                                           //!< "Paste" menu action
-    ClearId        = 0x04,                                           //!< "Clear" menu action
-    SelectAllId    = 0x08,                                           //!< "Select All" menu action
-    DumpCommandsId = 0x16,                                           //!< "DumpCommands" menu action
-    All = CopyId | PasteId | ClearId | SelectAllId | DumpCommandsId  //!< all menu actions
+    CopyId         = 0x01,  //!< "Copy" menu action
+    PasteId        = 0x02,  //!< "Paste" menu action
+    ClearId        = 0x04,  //!< "Clear" menu action
+    SelectAllId    = 0x08,  //!< "Select All" menu action
+    DumpCommandsId = 0x10,  //!< "DumpCommands" menu action
+    StartLogId     = 0x20,  //!< "Start log" menu action
+    StopLogId      = 0x40,  //!< "Stop log" menu action
+    All            = 0xFF,  //!< all menu actions 
   };
 
 public:
@@ -82,6 +84,9 @@ public:
   void                setMenuActions( const int );
   int                 menuActions() const;
 
+  void                startLog( const QString& );
+  void                stopLog();
+
 protected:
   void                createActions();
   void                updateActions();
index adb5a6d7ae9b72da5b2098272464734ee04d20ed..300915c70af1ed2098ebefdb08b1874f5b7db456 100644 (file)
@@ -138,14 +138,20 @@ bool DumpCommandsFileValidator::canSave(const QString& file, bool permissions)
 
 void staticCallbackStdout( void* data, char* c )
 {
-  if(!((PyConsole_Editor*)data)->isSuppressOutput())
-    QApplication::postEvent( (PyConsole_Editor*)data, new PrintEvent( c, false ) );
+  if(!((PyConsole_Editor*)data)->isSuppressOutput()) {
+    PyConsole_Editor* e = (PyConsole_Editor*)data;
+    e->putLog( QString::fromUtf8(c) );
+    QApplication::postEvent( e, new PrintEvent( QString::fromUtf8(c), false ) );
+  }
 }
 
 void staticCallbackStderr( void* data, char* c )
 {
-  if(!((PyConsole_Editor*)data)->isSuppressOutput())
-    QApplication::postEvent( (PyConsole_Editor*)data, new PrintEvent( c, true ) );
+  if(!((PyConsole_Editor*)data)->isSuppressOutput()) {
+    PyConsole_Editor* e = (PyConsole_Editor*)data;
+    e->putLog( QString::fromUtf8(c) );
+    QApplication::postEvent( e, new PrintEvent( QString::fromUtf8(c), true ) );
+  }
 }
 
 
@@ -272,6 +278,17 @@ void PyConsole_Editor::setIsShowBanner( const bool on )
   }
 }
 
+/*!
+  \brief Check if trace logging is switched on.
+  
+  \sa startLog(), stopLog()
+  \return \c true if trace logging is switched on
+*/
+bool PyConsole_Editor::isLogging() const
+{
+  return !myLogFile.isEmpty();
+}
+
 /*!
   \brief Get size hint for the Python console window
   \return size hint value
@@ -342,6 +359,7 @@ void PyConsole_Editor::exec( const QString& command )
     if ( !lines[i].trimmed().isEmpty() )
       myHistory.push_back( lines[i] );
     addText( ( i == 0 ? READY_PROMPT : DOTS_PROMPT ) + lines[i], i != 0 );
+    putLog( QString( "%1%2\n" ).arg( i == 0 ? READY_PROMPT : DOTS_PROMPT ).arg( lines[i] ) );
   }
   // IPAL20182
   addText( "", true );
@@ -411,6 +429,7 @@ void PyConsole_Editor::handleReturn()
   // add command to the history
   if ( !cmd.trimmed().isEmpty() )
     myHistory.push_back( cmd );
+  putLog( QString( "%1%2\n" ).arg( myPrompt ).arg( cmd ) );
 
   // IPAL19397
   addText( "", true ); 
@@ -1116,18 +1135,90 @@ void PyConsole_Editor::dump()
   aFilters.append( tr( "PYTHON_FILES_FILTER" ) );
   
   QString fileName = SUIT_FileDlg::getFileName( this, QString(),
-                                    aFilters, tr( "TOT_DUMP_PYCOMMANDS" ),
-                                    false, true, new DumpCommandsFileValidator( this ) );
-  if ( fileName != "" ) {
+                                               aFilters, tr( "TOT_DUMP_PYCOMMANDS" ),
+                                               false, true, new DumpCommandsFileValidator( this ) );
+  if ( !fileName.isEmpty() ) {
     QFile file( fileName ); 
     if ( !file.open( QFile::WriteOnly ) )
       return;
 
     QTextStream out (&file);
   
-    for( int i=0; i<myHistory.count(); i++ ) {
-         out<<myHistory[i]<<endl;
+    for ( int i=0; i<myHistory.count(); i++ ) {
+      out << myHistory[i] << endl;
+    }
+    file.close();
+  }
+}
+/*!
+  \brief "Start log" operation.
+ */
+void PyConsole_Editor::startLog()
+{
+  QStringList aFilters;
+  aFilters.append( tr( "LOG_FILES_FILTER" ) );
+
+  while (1) {
+    QString fileName = SUIT_FileDlg::getFileName( this, QString(),
+                                                 aFilters, tr( "TOT_SAVE_PYLOG" ),
+                                                 false, true );
+    if ( !fileName.isEmpty() ) {
+      if ( startLog( fileName ) ) {
+       break;
+      }
+      else {
+       SUIT_MessageBox::critical( this,
+                                  QObject::tr("ERR_ERROR"),
+                                  QObject::tr("ERR_FILE_NOT_WRITABLE") );
+      }
+    }
+    else {
+      break;
     }
+  }
+}
+
+/*!
+  \brief Start python trace logging
+  \param fileName the path to the log file
+  \sa stopLog()
+ */
+bool PyConsole_Editor::startLog( const QString& fileName )
+{
+  bool ok = false;
+  if ( !fileName.isEmpty() ) {
+    QFile file( fileName );
+    if ( file.open( QFile::WriteOnly ) ) {
+      file.close();
+      myLogFile = fileName;
+      ok = true;
+    }
+  }
+  return ok;
+}
+
+/*!
+  \brief "Stop log" operation.
+  \sa startLog()
+ */
+void PyConsole_Editor::stopLog()
+{
+  myLogFile = QString();
+}
+
+/*!
+  \brief Put string to the log file
+ */
+void PyConsole_Editor::putLog( const QString& s )
+{
+  if ( !myLogFile.isEmpty() ) {
+    QFile file( myLogFile );
+    if ( !file.open( QFile::Append ) )
+      return;
+    
+    QTextStream out (&file);
+    out << s;
+    
     file.close();
   }
 }
index c3e5ca1dd59e43ac0f8031ff8fc97611ee26510f..c939ef1b7da3e9fd78f947738427b11222426a42 100644 (file)
@@ -58,6 +58,8 @@ public:
   bool           isShowBanner() const;
   void           setIsShowBanner( const bool );
 
+  bool           isLogging() const;
+
   virtual QSize  sizeHint() const;
 
 public slots:
@@ -67,6 +69,10 @@ public slots:
     void           handleReturn();
     void           onPyInterpChanged( PyConsole_Interp* );
     void           dump();
+    bool           startLog( const QString& );
+    void           startLog();
+    void           stopLog();
+    void           putLog( const QString& );
 
 protected:
   virtual void   dropEvent( QDropEvent* event );
@@ -85,6 +91,7 @@ protected:
   QString           myCurrentCommand;   //!< currently being printed command
   QString           myPrompt;           //!< current command line prompt
   int               myCmdInHistory;     //!< current history command index
+  QString           myLogFile;          //!< current output log
   QStringList       myHistory;          //!< commands history buffer
   QEventLoop*       myEventLoop;        //!< internal event loop
   QString           myBanner;           //!< current banner
index 8915f07656c90eef32e14f840f735a86a2d49e6c..1f5defe0714bde0bcf29d7593ffcae097c4fcab9 100644 (file)
@@ -73,7 +73,7 @@ int PyConsole_EnhInterp::runDirCommand(const QString & dirArgument, const QStrin
       if (dirArgument.trimmed() != "")
         cmd = dirArgument + ".";
       cmd += _last_matches[0] + ".__doc__";
-      PyObject * str = PyRun_String(cmd.toStdString().c_str(), Py_eval_input, _context, _context);
+      PyObject * str = PyRun_String(cmd.toStdString().c_str(), Py_eval_input, _global_context, _local_context);
       if (!str || str == Py_None || !PyString_Check(str))
         {
           if (!str)
@@ -104,7 +104,7 @@ int PyConsole_EnhInterp::runDirAndExtract(const QString& dirArgument,
 {
   QRegExp re("^[A-Z].+_[A-Z]+[a-z]+.+$");  // discard SWIG static method, e.g. MEDCouplingUMesh_Blabla
   QString command("dir(" + dirArgument + ")");
-  PyObject * plst = PyRun_String(command.toStdString().c_str(), Py_eval_input, _context, _context);
+  PyObject * plst = PyRun_String(command.toStdString().c_str(), Py_eval_input, _global_context, _local_context);
   if(!plst || plst == Py_None) {
     if(!plst)
       PyErr_Clear();
index 0db05600e940d51033f992b4d3f64fd86dd6bfdf..be9c158695b922fca7de6485b4f85a81cff771f2 100644 (file)
@@ -44,7 +44,7 @@ public:
     \param c message text (python trace)
     \param isError default to false - if true indicates that an error is being printed.
   */
-  PrintEvent( const char* c, bool isError = false) :
+  PrintEvent( const QString& c, bool isError = false) :
     QEvent( (QEvent::Type)EVENT_ID ), myText( c ), errorFlag(isError)
   {}
 
index c4b208180bb5c4a8d1c23cfe21bd4606afda42f9..c200a85c091d2e94bfa7d73a532fdca2db705c44 100644 (file)
@@ -22,7 +22,7 @@
 
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : PyConsole_Interp.cxx
-//  Author : Nicolas REJNERI
+//  Author : Nicolas REJNERI, Adrien BRUNETON
 //  Module : SALOME
 //
 #include "PyConsole_Interp.h"
@@ -38,7 +38,6 @@
 
   The method initialize() calls virtuals methods
   - initPython()  to initialize global Python interpreter
-  //- initState()   to initialize embedded interpreter state (OBSOLETE)
   - initContext() to initialize interpreter internal context
   - initRun()     to prepare interpreter for running commands
 */
@@ -61,23 +60,3 @@ PyConsole_Interp::~PyConsole_Interp()
 {
 }
  
-/*!
-  \brief Initialize python interpeter context.
-
-  The GIL is assumed to be held.
-  It is the caller responsability to acquire the GIL.
-  It must still be held on initContext() exit.
-
-  \return \c true on success
-*/
-bool PyConsole_Interp::initContext()
-{
-  PyObject *m = PyImport_AddModule("__main__");  // interpreter main module (module context)
-  if(!m){
-    PyErr_Print();
-    return false;
-  }  
-  PyObject* global_dict = PyModule_GetDict(m);          // get interpreter dictionnary context
-  _context = PyDict_Copy(global_dict);
-  return true;
-}
index d122db0a6cd307f8130156a48df753938c79db23..0b929332efdcb5a6961a7eee085d29966d528938 100644 (file)
@@ -22,7 +22,7 @@
 
 //  SALOME SALOMEGUI : implementation of desktop and GUI kernel
 //  File   : PyConsole_Interp.h
-//  Author : Nicolas REJNERI
+//  Author : Nicolas REJNERI, Adrien BRUNETON
 //  Module : SALOME
 //
 #ifndef PYCONSOLE_INTERP_H
@@ -37,9 +37,6 @@ class PYCONSOLE_EXPORT PyConsole_Interp : public PyInterp_Interp
 public:
   PyConsole_Interp();
   ~PyConsole_Interp();
-
-protected:
-  virtual bool initContext();  
 };
 
 #endif // PYCONSOLE_INTERP_H
index 85393a2bf43151b66038132a164f075b373c5955..3a3b89bd94a077e4af5f6f7e2b2a10674d86dfbf 100644 (file)
     </message>
     <message>
         <source>EDIT_DUMPCOMMANDS_CMD</source>
-        <translation>D&amp;ump commands</translation>
+        <translation>D&amp;ump Commands</translation>
+    </message>
+    <message>
+      <source>EDIT_STARTLOG_CMD</source>
+        <translation>Start &amp;Log</translation>
+    </message>
+    <message>
+      <source>EDIT_STOPLOG_CMD</source>
+        <translation>Stop &amp;Log</translation>
     </message>
 </context>
 <context>
         <source>TOT_DUMP_PYCOMMANDS</source>
         <translation>Dump commands</translation>
     </message>
+    <message>
+        <source>TOT_SAVE_PYLOG</source>
+        <translation>Save log</translation>
+    </message>
     <message>
         <source>PYTHON_FILES_FILTER</source>
         <translation>PYTHON Files (*.py)</translation>
     </message>
+    <message>
+        <source>LOG_FILES_FILTER</source>
+        <translation>Log files (*.log *.txt)</translation>
+    </message>
+    <message>
+        <source>ERR_FILE_NOT_WRITABLE</source>
+        <translation>File is not writable!</translation>
+    </message>
 </context>
 </TS>
index 91091156235c46f2acc544d096440651a337557b..4446aa9bdd2857109409b613bdc82733cd76cb74 100755 (executable)
         <source>EDIT_DUMPCOMMANDS_CMD</source>
         <translation>&amp;Générer le script des commandes</translation>
     </message>
+    <message>
+        <source>EDIT_STARTLOG_CMD</source>
+        <translation type="unfinished">Start &amp;Log</translation>
+    </message>
+    <message>
+        <source>EDIT_STOPLOG_CMD</source>
+        <translation type="unfinished">Stop &amp;Log</translation>
+    </message>
 </context>
 <context>
     <name>PyConsole_Editor</name>
         <source>TOT_DUMP_PYCOMMANDS</source>
         <translation>&amp;Générer le script des commandes</translation>
     </message>
+    <message>
+        <source>TOT_SAVE_PYLOG</source>
+        <translation type="unfinished">Save log</translation>
+    </message>
     <message>
         <source>PYTHON_FILES_FILTER</source>
         <translation>Fichiers PYTHON (*.py)</translation>
     </message>
+    <message>
+        <source>LOG_FILES_FILTER</source>
+        <translation type="unfinished">Log files (*.log *.txt)</translation>
+    </message>
+    <message>
+        <source>ERR_FILE_NOT_WRITABLE</source>
+        <translation type="unfinished">File is not writable!</translation>
+    </message>
 </context>
 </TS>
index dde0da06bddca9533ee8f63b5959df4c74dcacd1..c993c7cc5e3b735b80514c4e0f1eec75eb837cc6 100644 (file)
       <source>EDIT_DUMPCOMMANDS_CMD</source>
       <translation>スクリプト コマンドを生成します。(&amp;u)</translation>
     </message>
+    <message>
+        <source>EDIT_STARTLOG_CMD</source>
+        <translation type="unfinished">Start &amp;Log</translation>
+    </message>
+    <message>
+        <source>EDIT_STOPLOG_CMD</source>
+        <translation type="unfinished">Stop &amp;Log</translation>
+    </message>
   </context>
   <context>
     <name>PyConsole_Editor</name>
       <source>TOT_DUMP_PYCOMMANDS</source>
       <translation>スクリプト コマンドを生成します。</translation>
     </message>
+    <message>
+        <source>TOT_SAVE_PYLOG</source>
+        <translation type="unfinished">Save log</translation>
+    </message>
     <message>
       <source>PYTHON_FILES_FILTER</source>
       <translation>ファイル (*.py) PYTHON</translation>
     </message>
+    <message>
+        <source>LOG_FILES_FILTER</source>
+        <translation type="unfinished">Log files (*.log *.txt)</translation>
+    </message>
+    <message>
+        <source>ERR_FILE_NOT_WRITABLE</source>
+        <translation type="unfinished">File is not writable!</translation>
+    </message>
   </context>
 </TS>
index 584eb0f7ddce49f475c996504b13705f1a4976f7..f85d651f28fa03c2c95fd136252499f9fd229553 100755 (executable)
@@ -47,6 +47,7 @@ SET(_other_HEADERS
   PyInterp_Event.h
   PyInterp_Interp.h
   PyInterp_Request.h
+  PyInterp_Utils.h
 )
 
 # header files / to install
@@ -63,6 +64,7 @@ SET(_other_SOURCES
   PyInterp_Event.cxx
   PyInterp_Interp.cxx
   PyInterp_Request.cxx
+  PyInterp_Utils.cxx
 )
 
 # sources / to compile
index 73898b53dfff115b721d53c78be82c60853b8c3f..40b0059e834e6bed488cf10d452fc2ecdd1d4d03 100755 (executable)
 
 PyInterp_Dispatcher* PyInterp_Dispatcher::myInstance = 0;
 
-void PyInterp_Request::process()
-{
-  safeExecute();
-
-  bool isSync = IsSync();
-
-  if ( !isSync )
-    myMutex.lock();
-
-  if ( listener() )
-    processEvent( listener() );
-
-  if ( !isSync )
-    myMutex.unlock();
-}
-
-void PyInterp_Request::safeExecute()
-{
-  //ProcessVoidEvent( new PyInterp_ExecuteEvent( this ) );
-  execute();
-}
-
-void PyInterp_Request::Destroy( PyInterp_Request* request )
-{
-  // Lock and unlock the mutex to avoid errors on its deletion
-  request->myMutex.lock();
-  request->myMutex.unlock();
-  delete request;
-}
-
-QEvent* PyInterp_Request::createEvent()
-{
-  return new PyInterp_Event( PyInterp_Event::ES_NOTIFY, this );
-}
-
-void PyInterp_Request::processEvent( QObject* o )
-{
-  if ( !o )
-    return;
-
-  QEvent* e = createEvent();
-  if ( !e )
-    return;
-
-  if ( !IsSync() )
-    QCoreApplication::postEvent( o, e );
-  else
-  {
-    QCoreApplication::sendEvent( o, e );
-    delete e;
-  }
-}
-
-void PyInterp_Request::setListener( QObject* o )
-{
-  myMutex.lock();
-  myListener = o;
-  myMutex.unlock();
-}
-
-void PyInterp_LockRequest::safeExecute()
-{
-  //if ( getInterp() ){  // No need to have an interpreter now! we can simply run in a empty context
-    PyLockWrapper aLock; // Acquire GIL
-    //ProcessVoidEvent( new PyInterp_ExecuteEvent( this ) );
-    execute();
-  //}
-}
-
-PyInterp_Event::~PyInterp_Event()
-{
-  PyInterp_Request::Destroy( myRequest );
-  myRequest = 0;
-}
-
 PyInterp_Dispatcher* PyInterp_Dispatcher::Get()
 {
   if ( !myInstance )
index 398b73e16a4ccec8a26de5ddc01c926d000ea68f..0bdfddac29e4e4320bb3562ed5bce0f8b821309d 100644 (file)
 #include "PyInterp_Event.h"
 #include "PyInterp_Request.h"
 
+PyInterp_Event::~PyInterp_Event()
+{
+  PyInterp_Request::Destroy( myRequest );
+  myRequest = 0;
+}
+
 void PyInterp_ExecuteEvent::Execute()
 {
   myRequest->execute();
index ba1a386fdb1c4a3de2dad8778017e613059715df..f76c3c69ef7d4f64b7a10e75368982a43567f641 100644 (file)
 //
 
 //  File   : PyInterp_Interp.cxx
-//  Author : Christian CAREMOLI, Paul RASCLE, EDF
+//  Author : Christian CAREMOLI, Paul RASCLE, Adrien BRUNETON
 //  Module : SALOME
 //
 #include "PyInterp_Interp.h"  // !!! WARNING !!! THIS INCLUDE MUST BE THE VERY FIRST !!!
+#include "PyInterp_Utils.h"
 #include <pythread.h>
 
 #include <cStringIO.h>
 #define TOP_HISTORY_PY   "--- top of history ---"
 #define BEGIN_HISTORY_PY "--- begin of history ---"
 
-/*!
-  \class PyLockWrapper
-  \brief Python GIL wrapper.
-*/
-
-/*!
-  \brief Constructor. Automatically acquires GIL.
-*/
-PyLockWrapper::PyLockWrapper()
-{
-  _gil_state = PyGILState_Ensure();
-}
-
-/*!
-  \brief Destructor. Automatically releases GIL.
-*/
-PyLockWrapper::~PyLockWrapper()
-{
-//  if (myThreadState->interp == PyInterp_Interp::_interp)
-//    PyGILState_Release(_savestate);
-//  else
-//    PyEval_ReleaseThread(myThreadState);
-
-  /* The destructor can never be called concurrently by two threads since it is called
-   * when the GIL is held - the below test should never run concurrently in two threads.
-   */
-  PyGILState_Release(_gil_state);
-}
-
 /*
   The following functions are used to hook the Python
   interpreter output.
@@ -187,9 +159,6 @@ static PyStdOut* newPyStdOut( bool iscerr )
 
 int   PyInterp_Interp::_argc   = 1;
 char* PyInterp_Interp::_argv[] = {(char*)""};
-//PyObject*           PyInterp_Interp::builtinmodule = NULL;
-//PyThreadState*      PyInterp_Interp::_gtstate      = NULL;
-//PyInterpreterState* PyInterp_Interp::_interp       = NULL;
 
 /*!
   \brief Basic constructor.
@@ -198,7 +167,7 @@ char* PyInterp_Interp::_argv[] = {(char*)""};
   must call virtual method initalize().
 */
 PyInterp_Interp::PyInterp_Interp():
-  _vout(0), _verr(0), _context(0)
+  _vout(0), _verr(0), _local_context(0), _global_context(0)
 {
 }
 
@@ -209,6 +178,7 @@ PyInterp_Interp::PyInterp_Interp():
 */
 PyInterp_Interp::~PyInterp_Interp()
 {
+  destroy();
 }
 
 /*!
@@ -217,7 +187,6 @@ PyInterp_Interp::~PyInterp_Interp()
   This method shoud be called after construction of the interpreter.
   The method initialize() calls virtuals methods
   - initPython()  to initialize global Python interpreter
-  - initState()   to initialize embedded interpreter state
   - initContext() to initialize interpreter internal context
   - initRun()     to prepare interpreter for running commands
   which should be implemented in the successor classes, according to the
@@ -242,7 +211,6 @@ void PyInterp_Interp::initialize()
   PyObjWrapper m(PyImport_ImportModule("codeop"));
   if(!m) {
     PyErr_Print();
-    PyEval_ReleaseLock();
     return;
   }
 
@@ -308,27 +276,54 @@ bool PyInterp_Interp::initRun()
   return true;
 }
 
+/*!
+ * Initialize context dictionaries. GIL is held already.
+ * The code executed in an embedded interpreter is expected to be run at the module
+ * level, in which case local and global context have to be the same dictionary.
+ * See: http://stackoverflow.com/questions/12265756/c-python-running-python-code-within-a-context
+ * for an explanation.
+ */
+bool PyInterp_Interp::initContext()
+{
+  PyObject *m = PyImport_AddModule("__main__");  // interpreter main module (module context)
+  if(!m){
+    PyErr_Print();
+    return false;
+  }
+  _global_context = PyModule_GetDict(m);          // get interpreter global variable context
+  Py_INCREF(_global_context);
+  _local_context = _global_context;
+  return true;
+}
+
+/*!
+ * Destroy context dictionaries. GIL is held already.
+ */
 void PyInterp_Interp::closeContext()
 {
+  Py_XDECREF(_global_context);
+  // both _global and _local point to the same Python object:
+  // Py_XDECREF(_local_context);
 }
 
 /*!
   \brief Compile Python command and evaluate it in the
-         python dictionary context if possible. This is not thread-safe.
+         python dictionary contexts if possible. This is not thread-safe.
          This is the caller's responsability to make this thread-safe.
   \internal
   \param command Python command string
-  \param context Python context (dictionary)
   \return -1 on fatal error, 1 if command is incomplete and 0
          if command is executed successfully
  */
-static int run_command(const char *command, PyObject *context)
+static int run_command(const char *command, PyObject * global_ctxt, PyObject * local_ctxt)
 {
   PyObject *m = PyImport_AddModule("codeop");
   if(!m) { // Fatal error. No way to go on.
     PyErr_Print();
     return -1;
   }
+
+//  PyObjWrapper v(Py_CompileString(command, "<salome_input>", Py_file_input));
   PyObjWrapper v(PyObject_CallMethod(m,(char*)"compile_command",(char*)"s",command));
   if(!v) {
     // Error encountered. It should be SyntaxError,
@@ -344,7 +339,7 @@ static int run_command(const char *command, PyObject *context)
     return 1;
   }
   else {
-    PyObjWrapper r(PyEval_EvalCode((PyCodeObject *)(void *)v,context,context));
+    PyObjWrapper r(PyEval_EvalCode((PyCodeObject *)(void *)v,global_ctxt, local_ctxt));
     if(!r) {
       // Execution error. We return -1
       PyErr_Print();
@@ -376,7 +371,7 @@ void replaceAll(std::string& str, const std::string& from, const std::string& to
   \return -1 on fatal error, 1 if command is incomplete and 0
          if command is executed successfully
  */
-static int compile_command(const char *command, PyObject *context)
+static int compile_command(const char *command, PyObject * global_ctxt, PyObject * local_ctxt)
 {
   // First guess if command is execution of a script with args, or a simple Python command
   std::string singleCommand = command;
@@ -392,7 +387,7 @@ static int compile_command(const char *command, PyObject *context)
   if (commandArgs.empty()) {
     // process command: expression
     // process command: execfile(r"/absolute/path/to/script.py") (no args)
-    return run_command(singleCommand.c_str(), context);
+    return run_command(singleCommand.c_str(), global_ctxt, local_ctxt);
   }
   else {
     // process command: execfile(r"/absolute/path/to/script.py [args:arg1,...,argn]")
@@ -404,7 +399,7 @@ static int compile_command(const char *command, PyObject *context)
     replaceAll(commandArgs, ",", "\",\"");
     commandArgs = "\""+commandArgs+"\"";
     std::string completeCommand = preCommandBegin+"\""+script+"\","+commandArgs+preCommandEnd+singleCommand+";sys.argv=save_argv";
-    return run_command(completeCommand.c_str(), context);
+    return run_command(completeCommand.c_str(), global_ctxt, local_ctxt);
   }
 }
 
@@ -453,7 +448,7 @@ int PyInterp_Interp::simpleRun(const char *command, const bool addToHistory)
   PySys_SetObject((char*)"stderr",_verr);
   PySys_SetObject((char*)"stdout",_vout);
 
-  int ier = compile_command(command,_context);
+  int ier = compile_command(command, _global_context, _local_context);
 
   // Outputs are redirected to what they were before
   PySys_SetObject((char*)"stdout",oldOut);
index 766f02a5e72ded74c206ecd05e13ac568f71d19d..33c6a2d4762a4dc8edefb94cc4d314b47ff38a92 100644 (file)
 //
 
 //  File   : PyInterp_Interp.h
-//  Author : Christian CAREMOLI, Paul RASCLE, EDF
+//  Author : Christian CAREMOLI, Paul RASCLE, Adrien BRUNETON
 //  Module : SALOME
 //
 #ifndef PYINTERP_INTERP_H
 #define PYINTERP_INTERP_H
 
 #include "PyInterp.h"   // !!! WARNING !!! THIS INCLUDE MUST BE THE VERY FIRST !!!
+#include "PyInterp_Utils.h"
 
 #include <list>
 #include <string>
 
-/**
- * Utility class wrappin the Python GIL acquisition. This makes use of the high level
- * API (PyGILState_Ensure and PyGILState_Release), and is hence compatible with only
- * one running Python interpreter (no call to Py_NewInterpreter()).
- * When the class is instanciated the lock is acquired. It is released at destruction time.
- * Copy construction (and hence assignation) is forbidden.
- */
-class PYINTERP_EXPORT PyLockWrapper
-{
-  PyGILState_STATE _gil_state;
-public:
-  PyLockWrapper();
-  ~PyLockWrapper();
-
-private:
-  // "Rule of 3" - Forbid usage of copy operator and copy-constructor
-  PyLockWrapper(const PyLockWrapper & another);
-  const PyLockWrapper & operator=(const PyLockWrapper & another);
-};
-
 typedef void PyOutChanged(void* data,char * c);
 
+typedef struct {
+  PyObject_HEAD
+  int softspace;
+  PyOutChanged* _cb;
+  void* _data;
+  bool _iscerr;
+} PyStdOut;
+
 /**
  * Main class representing a *virtual* Python interpreter. There is really only one true
  * Python interpreter in the whole application (no call to Py_NewInterpreter),
@@ -76,6 +65,7 @@ public:
   void destroy();
 
   virtual int run(const char *command); 
+  virtual void initStudy(){};
 
   // [ABN] - the PyLockWrapper is no more attached to the interpreter
   // PyLockWrapper GetLockWrapper() const;
@@ -92,8 +82,9 @@ protected:
   PyObject * _vout;
   PyObject * _verr;
   /** Execution context (local and global variables) */
-  PyObject * _context;
-  PyObject * _codeop;
+  PyObject * _global_context;
+  PyObject * _local_context;
+
   std::list<std::string> _history;
   std::list<std::string>::iterator _ith;
 
@@ -101,46 +92,11 @@ protected:
   int simpleRun(const char* command, const bool addToHistory = true);
 
   virtual void initPython();
-  /** OBSOLETE - should'nt be called anymore */
-  //virtual bool initState() = 0;
 
-  /** Initialize execution context. Must set the member _context, and return True on success. */
-  virtual bool initContext() = 0;
+  /** Initialize execution context. */
+  virtual bool initContext();
   virtual bool initRun();
   virtual void closeContext();
 };
 
-/**
- * Utility class to properly handle the reference counting required on Python objects.
- */
-class PYINTERP_EXPORT PyObjWrapper
-{
-  PyObject* myObject;
-public:
-  PyObjWrapper(PyObject* theObject) : myObject(theObject) {}
-  PyObjWrapper() : myObject(0) {}
-  virtual ~PyObjWrapper() { Py_XDECREF(myObject); }
-
-  operator PyObject*()    { return myObject;  }
-  PyObject* operator->()  { return myObject;  }
-  PyObject* get()         { return myObject;  }
-  bool operator!()        { return !myObject; }
-  bool operator==(PyObject* theObject) { return myObject == theObject; }
-  PyObject** operator&()  { return &myObject; }
-  PyObjWrapper& operator=(PyObjWrapper* theObjWrapper)
-  {
-    Py_XDECREF(myObject);
-    myObject = theObjWrapper->myObject;
-    return *this;
-  }
-};
-
-typedef struct {
-  PyObject_HEAD
-  int softspace;
-  PyOutChanged* _cb;
-  void* _data;
-  bool _iscerr;
-} PyStdOut;
-
 #endif // PYINTERP_INTERP_H
index eab188f7afb536417de6c6d1046e9bd450f246b9..f541a1a06119abe87cd1d42dd513ee62cf35c7da 100644 (file)
 //  Module : GUI
 
 #include "PyInterp_Request.h"
+#include "PyInterp_Utils.h"
+#include <QCoreApplication>
 
+void PyInterp_Request::process()
+{
+  safeExecute();
+
+  bool isSync = IsSync();
+
+  if ( !isSync )
+    myMutex.lock();
+
+  if ( listener() )
+    processEvent( listener() );
+
+  if ( !isSync )
+    myMutex.unlock();
+}
+
+void PyInterp_Request::safeExecute()
+{
+  //ProcessVoidEvent( new PyInterp_ExecuteEvent( this ) );
+  execute();
+}
+
+void PyInterp_Request::Destroy( PyInterp_Request* request )
+{
+  // Lock and unlock the mutex to avoid errors on its deletion
+  request->myMutex.lock();
+  request->myMutex.unlock();
+  delete request;
+}
+
+QEvent* PyInterp_Request::createEvent()
+{
+  return new PyInterp_Event( PyInterp_Event::ES_NOTIFY, this );
+}
+
+void PyInterp_Request::processEvent( QObject* o )
+{
+  if ( !o )
+    return;
+
+  QEvent* e = createEvent();
+  if ( !e )
+    return;
+
+  if ( !IsSync() )
+    QCoreApplication::postEvent( o, e );
+  else
+  {
+    QCoreApplication::sendEvent( o, e );
+    delete e;
+  }
+}
+
+void PyInterp_Request::setListener( QObject* o )
+{
+  myMutex.lock();
+  myListener = o;
+  myMutex.unlock();
+}
+
+void PyInterp_LockRequest::safeExecute()
+{
+  //if ( getInterp() ){  // No need to have an interpreter now! we can simply run in a empty context
+    PyLockWrapper aLock; // Acquire GIL
+    //ProcessVoidEvent( new PyInterp_ExecuteEvent( this ) );
+    execute();
+  //}
+}
index 4ceacd3e0160fb7c28c484d4f72c3e33ed697b3f..56046869fe3c0f26eb912999bbcfb80300a4b9df 100644 (file)
@@ -43,6 +43,7 @@ class PYINTERP_EXPORT PyInterp_Request
   friend class PyInterp_Dispatcher;
   friend class PyInterp_ExecuteEvent;
 
+private:
   PyInterp_Request();
   PyInterp_Request( const PyInterp_Request& );
 
@@ -51,7 +52,7 @@ protected:
   // protected destructor - to control deletion of requests
 
 public:
-  PyInterp_Request( QObject* listener, bool sync = false )
+  PyInterp_Request( QObject* listener, bool sync = true )
     : myIsSync( sync ), myListener( listener ) {};
 
   static void     Destroy( PyInterp_Request* );
@@ -88,7 +89,7 @@ class PYINTERP_EXPORT PyInterp_LockRequest : public PyInterp_Request
 {
 public:
 
-  PyInterp_LockRequest( PyInterp_Interp* interp, QObject* listener=0, bool sync=false )
+  PyInterp_LockRequest( PyInterp_Interp* interp, QObject* listener=0, bool sync=true )
     : PyInterp_Request( listener, sync ), myInterp( interp )
   {}
 
diff --git a/src/PyInterp/PyInterp_Utils.cxx b/src/PyInterp/PyInterp_Utils.cxx
new file mode 100644 (file)
index 0000000..4fa3bc2
--- /dev/null
@@ -0,0 +1,47 @@
+// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  Author : Adrien BRUNETON
+//
+
+#include "PyInterp_Utils.h"
+
+/*!
+  \class PyLockWrapper
+  \brief Python GIL wrapper.
+*/
+
+/*!
+  \brief Constructor. Automatically acquires GIL.
+*/
+PyLockWrapper::PyLockWrapper()
+{
+  _gil_state = PyGILState_Ensure();
+}
+
+/*!
+  \brief Destructor. Automatically releases GIL.
+*/
+PyLockWrapper::~PyLockWrapper()
+{
+  PyGILState_Release(_gil_state);
+}
+
diff --git a/src/PyInterp/PyInterp_Utils.h b/src/PyInterp/PyInterp_Utils.h
new file mode 100644 (file)
index 0000000..c9866ba
--- /dev/null
@@ -0,0 +1,78 @@
+// Copyright (C) 2007-2014  CEA/DEN, EDF R&D, OPEN CASCADE
+//
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License, or (at your option) any later version.
+//
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
+//
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//
+//  Author : Adrien BRUNETON
+//
+
+#ifndef PYINTERP_UTILS_H
+#define PYINTERP_UTILS_H
+
+#include "PyInterp.h"
+#include <Python.h>
+
+/**
+ * Utility class wrapping the Python GIL acquisition. This makes use of the high level
+ * API (PyGILState_Ensure and PyGILState_Release), and is hence compatible with only
+ * one running Python interpreter (no call to Py_NewInterpreter()).
+ * When the class is instanciated the lock is acquired. It is released at destruction time.
+ * Copy construction (and hence assignation) is forbidden.
+ */
+class PYINTERP_EXPORT PyLockWrapper
+{
+  PyGILState_STATE _gil_state;
+public:
+  PyLockWrapper();
+  ~PyLockWrapper();
+
+private:
+  // "Rule of 3" - Forbid usage of copy operator and copy-constructor
+  PyLockWrapper(const PyLockWrapper & another);
+  const PyLockWrapper & operator=(const PyLockWrapper & another);
+};
+
+
+/**
+ * Utility class to properly handle the reference counting required on Python objects.
+ */
+class PYINTERP_EXPORT PyObjWrapper
+{
+  PyObject* myObject;
+public:
+  PyObjWrapper(PyObject* theObject) : myObject(theObject) {}
+  PyObjWrapper() : myObject(0) {}
+  virtual ~PyObjWrapper() { Py_XDECREF(myObject); }
+
+  operator PyObject*()    { return myObject;  }
+  PyObject* operator->()  { return myObject;  }
+  PyObject* get()         { return myObject;  }
+  bool operator!()        { return !myObject; }
+  bool operator==(PyObject* theObject) { return myObject == theObject; }
+  PyObject** operator&()  { return &myObject; }
+  PyObjWrapper& operator=(PyObjWrapper* theObjWrapper)
+  {
+    Py_XDECREF(myObject);
+    myObject = theObjWrapper->myObject;
+    return *this;
+  }
+};
+
+#endif
+
index 0dc508b54c2a4864c4659a58f67102f528ea6aa2..9036354bcd14060a56b51e02bee345c7add06567 100755 (executable)
@@ -1991,7 +1991,83 @@ void Qtx::BackgroundData::setGradient( const QGradient& grad )
   myGradient = grad;
   setMode( Qtx::CustomGradientBackground );
 }
+
+/*!
+  \brief Convert string representation of version identifier to the numerical value.
+  Resulting value can be used for comparison of different versions (lower, higher, equal).
+
+  String representation of the version consists of zero or more components:
+
+  [major[.minor[.release[patchid]]]]
+  where
+  - major is version major number
+  - minor is version minor number
+  - release is version release number
+  - patchid is a version dev identifier which is one of the following
+    * 1 letter optionally followed by 1 or 2 digits, e.g. "a" for "alpha", "b1" for "beta 1"
+    * "rc" optionally followed by 1 or 2 digits, e.g. "rc1" for "release candidate 1"
+    * "dev" for development version (note: 7.4.0dev > 7.4.0, 7.4.0dev < 7.4.1, 7.4.0dev < 7.4.0a1)
+
+  If version string does not include any component or has invalid format, the function returns 0.
+
+  Examples:
+    1.0      - version 1.0
+    1.2.3a   - version 1.2.3 alpha
+    3.3.3b1  - version 3.3.3 beta 1
+    7.4.0rc1 - version 7.4.0 release candidate 1
+    7.4.0dev - dev version, i.e. future version 7.4.1 (or 7.5.0)
+
+  \param version string representation of version
+  \return numerical identifier of the version
+*/
+long Qtx::versionToId( const QString& version )
+{
+  long id = 0;
+
+  QRegExp vers_exp( "^([0-9]+)([A-Z]|RC|DEV)?([0-9]{0,2})$", Qt::CaseInsensitive );
+  
+  QStringList vers = version.split( ".", QString::SkipEmptyParts );
+  int major=0, minor=0;
+  int release = 0, dev1 = 0, dev2 = 0;
+  if ( vers.count() > 0 ) major = vers[0].toInt();
+  if ( vers.count() > 1 ) minor = vers[1].toInt();
+  if ( vers.count() > 2 ) {
+    if ( vers_exp.indexIn( vers[2] ) != -1 ) {
+      release = vers_exp.cap( 1 ).toInt();
+      QString tag = vers_exp.cap( 2 ).toLower();
+      if ( !tag.isEmpty() ) {
+       // patchid is subtracted from version number
+       // a   = 55 --> -(55 * 100) + patch number --> 4500..4599, e.g. 7.4.1a1  -> 704004501
+       // b   = 54 --> -(54 * 100) + patch number --> 4600..4699, e.g. 7.4.1b1  -> 704004601
+       // c   = 53 --> -(53 * 100) + patch number --> 4700..4799, e.g. 7.4.1c1  -> 704004701
+       // ...
+       // z   = 30 --> -( 1 * 100) + patch number --> 7000..7099, e.g. 7.4.1z1  -> 704007001
+       // rc  =  1 --> -( 1 * 100) + patch number --> 9900..9999, e.g. 7.4.1rc1 -> 704009901
+       // dev = -1 --> +( 1 * 100) + patch number --> 0100..0199, e.g. 7.4.1dev -> 704010100
+       // ---
+       // i.e. "a" < "b" < ... < "z" < "rc" < [stable] < "dev"
+       if ( tag == "rc" )
+         dev1 = 1;
+       else if ( tag == "dev" )
+         dev1 = -1;
+       else
+         dev1 = (int)( QChar('z').toLatin1() ) - (int)( tag[ 0 ].toLatin1() ) + 30;
+      }
+      if ( !vers_exp.cap( 3 ).isEmpty() )
+       dev2 = vers_exp.cap( 3 ).toInt();
+    }
+  }
   
+  int dev = dev1*100-dev2;
+  id = major;
+  id*=100; id+=minor;
+  id*=100; id+=release;
+  id*=10000;
+  id-=dev;
+
+  return id;
+}
 
 #ifndef WIN32
 
index d4c66b3fdb41ea43116f493671d56d3789abb53c..429653bc1d012acfbcd6b7eb6b431d80b65c961f 100755 (executable)
@@ -258,6 +258,8 @@ public:
   static QString        backgroundToString( const BackgroundData& );
   static BackgroundData stringToBackground( const QString& );
 
+  static long        versionToId( const QString& );
+
 #ifndef WIN32
   static void*       getDisplay();
   static Qt::HANDLE  getVisual();
index 15aa9c4671c8b779bbaca1f05f16157aabdf4158..e5017a8eba99cca8188126016b6b583910079a32 100644 (file)
@@ -29,6 +29,9 @@
   <file>images/qtx_split4_19.png</file>
   <file>images/qtx_split4_20.png</file>
   <file>images/qtx_split4_21.png</file>
+  <file>images/open.png</file>
+  <file>images/close.png</file>
+  <file>images/appicon.png</file>
 </qresource>
 </RCC>
  
index d127286c803393e21fce46a623fb4b85f2513ddf..729f4d9d70ce2bc1699322c263d31524d33bceb5 100644 (file)
@@ -113,7 +113,36 @@ int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainW
   If \a tid is less than 0, the identifier is generated automatically.
   If toolbar with given \a tid is already registered, the toolbar will not be created.
 
+  The parameter \a name can be specified to give an unique string identifier to the toolbar.
+  This can be useful in the multi-language environment where identifier of the toolbar should
+  not be dependant on the language chosen (e.g. to store positions of toolbars of main menu
+  in the preferences).
+
   \param title toolbar title
+  \param name toolbar name (identifier)
+  \param tid requested toolbar ID
+  \param mw parent main window; if it is null, the tool manager's main window is used
+  \param vis show toolbar visible immediately after creation (true by default)
+  \return id of created/found toolbar
+*/
+int QtxActionToolMgr::createToolBar( const QString& title, const QString& name, const int tid, QMainWindow* mw, bool vis )
+{
+  return createToolBar( title, name, true, Qt::AllToolBarAreas, tid, mw, vis );
+}
+
+/*!
+  \brief Create toolbar and assign \a id to it.
+
+  If \a tid is less than 0, the identifier is generated automatically.
+  If toolbar with given \a tid is already registered, the toolbar will not be created.
+
+  The parameter \a name can be specified to give an unique string identifier to the toolbar.
+  This can be useful in the multi-language environment where identifier of the toolbar should
+  not be dependant on the language chosen (e.g. to store positions of toolbars of main menu
+  in the preferences).
+
+  \param title toolbar title
+  \param name toolbar name (identifier)
   \param floatable if \c true, new toolbar is made floatable
   \param dockAreas dock areas of the main window where the new toolbar can be situated
   \param tid requested toolbar ID
@@ -121,7 +150,7 @@ int QtxActionToolMgr::createToolBar( const QString& title, const int tid, QMainW
   \param vis show toolbar visible immediately after creation (true by default)
   \return id of created/found toolbar
 */
-int QtxActionToolMgr::createToolBar( const QString& title, bool floatable, Qt::ToolBarAreas dockAreas, 
+int QtxActionToolMgr::createToolBar( const QString& title, const QString& name, bool floatable, Qt::ToolBarAreas dockAreas, 
                                      int tid, QMainWindow* mw, bool vis )
 {
   static int _toolBarId = -1;
@@ -154,7 +183,7 @@ int QtxActionToolMgr::createToolBar( const QString& title, bool floatable, Qt::T
     tb->setMovable( dockAreas & Qt::AllToolBarAreas );
     //mainWindow()->addToolBar( tb );
     tb->setWindowTitle( title );
-    tb->setObjectName( title );
+    tb->setObjectName( name.isEmpty() ? title : name );
     tb->setToolTip( title );
     if ( !vis )
       QApplication::postEvent( tb, new QHideEvent());
@@ -166,6 +195,26 @@ int QtxActionToolMgr::createToolBar( const QString& title, bool floatable, Qt::T
   return tbId;
 }
 
+/*!
+  \brief Create toolbar and assign \a id to it.
+
+  If \a tid is less than 0, the identifier is generated automatically.
+  If toolbar with given \a tid is already registered, the toolbar will not be created.
+
+  \param title toolbar title
+  \param floatable if \c true, new toolbar is made floatable
+  \param dockAreas dock areas of the main window where the new toolbar can be situated
+  \param tid requested toolbar ID
+  \param mw parent main window; if it is null, the tool manager's main window is used
+  \param vis show toolbar visible immediately after creation (true by default)
+  \return id of created/found toolbar
+*/
+int QtxActionToolMgr::createToolBar( const QString& title, bool floatable, Qt::ToolBarAreas dockAreas, 
+                                     int tid, QMainWindow* mw, bool vis )
+{
+  return createToolBar( title, QString(), floatable, dockAreas, tid, mw, vis );
+}
+
 /*!
   \brief Search toolbar with given \a title owned by main window \mw. 
   \param title toolbar title
@@ -700,8 +749,10 @@ void QtxActionToolMgr::setVisible( const int id, const int tid, const bool on )
     }
   }
 
-  if ( changed )
+  if ( changed ) {
     triggerUpdate( tid );
+    updateContent();
+  }
 }
 
 /*!
index 783fad4f32947d58dc42450d9d3f33fb87567685..5f2b6e1368c5be520b0ba89a7c14256c5091db95 100644 (file)
@@ -66,8 +66,11 @@ public:
   QMainWindow*    mainWindow() const;
 
   int             createToolBar( const QString&, int = -1, QMainWindow* = 0, bool = true );
+  int             createToolBar( const QString&, const QString&, int = -1, QMainWindow* = 0, bool = true );
   int             createToolBar( const QString&, bool, Qt::ToolBarAreas = Qt::AllToolBarAreas, 
                                  int = -1, QMainWindow* = 0, bool = true );
+  int             createToolBar( const QString&, const QString&, bool, Qt::ToolBarAreas = Qt::AllToolBarAreas, 
+                                 int = -1, QMainWindow* = 0, bool = true );
   void            removeToolBar( const QString& );
   void            removeToolBar( const int );
 
index 154f98b9cf450302e2d46b9bc475f215fe9af849..f3e5af4f7462f7008674e7584e6a56be77dd65bc 100644 (file)
 #ifndef QTXTRANSLATOR_H
 #define QTXTRANSLATOR_H
 
+#include "Qtx.h"
+
 #include <QTranslator>
 
-class QtxTranslator : public QTranslator
+class QTX_EXPORT QtxTranslator : public QTranslator
 {
 public:
   QtxTranslator( QObject* parent = 0 );
index 32963733e9cf678921a0f5740b1e5d1095b39bdb..1dc8a053181ed8ff82559e4c28e96e28260a383b 100644 (file)
 #include <QToolBar>
 #include <QVBoxLayout>
 #include <QWebView>
+#include <QProcess>
+
+namespace
+{
+  bool isLocalFile( const QUrl& url )
+  {
+    QFileInfo fi( url.path() );
+    return fi.exists();
+  }
+}
 
 /*!
   \class QtxWebBrowser::Searcher
@@ -169,21 +179,21 @@ QtxWebBrowser::Downloader::Downloader( const QString& fileName, int action, cons
   : QDialog( parent ), myProgram( program )
 {
   setModal( true );
-  setWindowTitle( tr( "Open URL" ) );
+  setWindowTitle( QtxWebBrowser::tr( "Open URL" ) );
   setSizeGripEnabled( true );
 
   myFileName = new QLabel( this );
-  QRadioButton* rbOpen = new QRadioButton( tr( "Open in" ), this );
-  QRadioButton* rbSave = new QRadioButton( tr( "Save file" ), this );
-  myBrowse = new QPushButton( tr( "&Browse..." ),     this );
-  myRepeat = new QCheckBox( tr( "Use this program for all files of this type" ), this );
+  QRadioButton* rbOpen = new QRadioButton( QtxWebBrowser::tr( "Open in" ), this );
+  QRadioButton* rbSave = new QRadioButton( QtxWebBrowser::tr( "Save file" ), this );
+  myBrowse = new QPushButton( QtxWebBrowser::tr( "&Browse..." ),     this );
+  myRepeat = new QCheckBox( QtxWebBrowser::tr( "Use this program for all files of this type" ), this );
 
   myAction = new QButtonGroup( this );
   myAction->addButton( rbOpen, mOpen );
   myAction->addButton( rbSave, mSave );
 
-  QPushButton* btnOk     = new QPushButton( tr( "&OK" ),     this );
-  QPushButton* btnCancel = new QPushButton( tr( "&Cancel" ), this );
+  QPushButton* btnOk     = new QPushButton( QtxWebBrowser::tr( "&OK" ),     this );
+  QPushButton* btnCancel = new QPushButton( QtxWebBrowser::tr( "&Cancel" ), this );
 
   QFont f = myFileName->font(); f.setBold( true ); myFileName->setFont( f );
 
@@ -193,10 +203,10 @@ QtxWebBrowser::Downloader::Downloader( const QString& fileName, int action, cons
   btnLayout->addWidget( btnCancel );
 
   QGridLayout* l = new QGridLayout( this );
-  l->addWidget( new QLabel( tr( "You are opening the file" ), this ), 
+  l->addWidget( new QLabel( QtxWebBrowser::tr( "You are opening the file" ), this ), 
                            0, 0, 1, 4 );
   l->addWidget( myFileName, 1, 1, 1, 3 );
-  l->addWidget( new QLabel( tr( "Please choose the action to be done" ), this ), 
+  l->addWidget( new QLabel( QtxWebBrowser::tr( "Please choose the action to be done" ), this ), 
                            3, 0, 1, 4 );
   l->addWidget( rbOpen,     4, 1, 1, 1 );
   l->addWidget( myBrowse,   4, 2, 1, 1 );
@@ -267,7 +277,7 @@ void QtxWebBrowser::Downloader::setAction( int action )
 */
 void QtxWebBrowser::Downloader::browse()
 {
-  QString program = QFileDialog::getOpenFileName( this, tr( "Choose program" ), myProgram );
+  QString program = QFileDialog::getOpenFileName( this, QtxWebBrowser::tr( "Choose program" ), myProgram );
   if ( !program.isEmpty() ) myProgram = program;
 }
 
@@ -275,7 +285,7 @@ void QtxWebBrowser::Downloader::browse()
 /*!
   \class QtxWebBrowser
 
-  \brief The QtxWebBrowser provides a window that can display html pages.
+  \brief The QtxWebBrowser provides a window that can display html pages from local file system.
   
   Only one instance of the QtxWebBrowser class can be created. To access the browser 
   window, use static method QtxWebBrowser::webBrowser(), which creates an
@@ -286,36 +296,22 @@ void QtxWebBrowser::Downloader::browse()
   closing of the browser window. To close window programmatically use 
   method close().
 
-  To set visual properties of the browser use static method setData().
-
   Optionally resource manager can be specified to automatically store
-  action (open/save) and program to be used to download files to the
-  user preferences.
+  action (open/save) and program to be used to download files in the
+  application preferences.
 
   The following sample demonstrates how to use web browser.
   In this code the browser window is created, /data/index.html file is opened
   and scrolled to the "anchor1" anchor on this page.
 
   \code
-  int main(int argc, char *argv[])
-  {
-    QApplication app(argc, argv);    
-
-    // set resource manager
-    QtxWebBrowser::setResourceManager(myResourceMgr);
-    // set icon, title and menu items
-    QtxWebBrowser::setData("browser:title",      tr("Web Browser"));
-    QtxWebBrowser::setData("browser:icon",       QPixmap(":/icon.png"));
-    QtxWebBrowser::setData("menu:file:title",    tr("&File"));
-    QtxWebBrowser::setData("action:close:title", tr("&Close"));
-
-    // show HTML page
-    QtxWebBrowser::loadUrl("file:///data/index.html", "anchor1");
-    
-    return app.exec();
-  }
+  // initialize application
+  // - set resource manager
+  QtxWebBrowser::setResourceMgr(myResourceMgr);
+  // ...
+  // show HTML page
+  QtxWebBrowser::loadUrl("file:///data/index.html", "anchor1");
   \endcode
-
 */
 
 //! The only one instance of web browser
@@ -324,15 +320,14 @@ QtxWebBrowser* QtxWebBrowser::myBrowser = 0;
 //! Resources manager
 QtxResourceMgr* QtxWebBrowser::myResourceMgr = 0;
 
-//! Internal data map to store resources of the browser.
-QMap<QString, QVariant> QtxWebBrowser::myData;
-
 /*!
   \brief Constructor.
   Construct the web browser.
 */
 QtxWebBrowser::QtxWebBrowser( ) : QMainWindow( 0 )
 {
+  Q_INIT_RESOURCE( Qtx );
+
   setAttribute( Qt::WA_DeleteOnClose );
   statusBar();
 
@@ -340,12 +335,13 @@ QtxWebBrowser::QtxWebBrowser( ) : QMainWindow( 0 )
 
   myWebView = new QWebView( frame );
 
-  QAction *copyAction = myWebView->pageAction(QWebPage::Copy);
-  copyAction->setShortcut(QKeySequence::Copy);
-  myWebView->addAction(copyAction);
-
-
+  myWebView->pageAction( QWebPage::Copy )->setShortcut( QKeySequence::Copy );
+  myWebView->addAction( myWebView->pageAction( QWebPage::Copy ) );
+  myWebView->pageAction( QWebPage::OpenLinkInNewWindow )->setVisible( false );
+  myWebView->pageAction( QWebPage::Back )->setText( tr( "Go Back" ) );
+  myWebView->pageAction( QWebPage::Forward )->setText( tr( "Go Forward" ) );
   myWebView->page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
+
   myFindPanel = new QtxSearchTool( frame, myWebView,
                                   QtxSearchTool::Basic | QtxSearchTool::Case | QtxSearchTool::Wrap, 
                                   Qt::Horizontal );
@@ -354,17 +350,32 @@ QtxWebBrowser::QtxWebBrowser( ) : QMainWindow( 0 )
   myFindPanel->setSearcher( new Searcher( myWebView ) );
   myFindPanel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
 
-  myToolbar = addToolBar( tr( "Navigation" ) );
-  myToolbar->addAction( myWebView->pageAction( QWebPage::Back ) );
-  myToolbar->addAction( myWebView->pageAction( QWebPage::Forward ) );
-
-  myMenus[ File ]        = menuBar()->addMenu( tr( "&File" ) );
-  myActions[ Find ]      = myMenus[ File ]->addAction( tr( "&Find in text..." ), myFindPanel, SLOT( find() ),         QKeySequence( QKeySequence::Find ) );
-  myActions[ FindNext ]  = myMenus[ File ]->addAction( tr( "&Find next" ),       myFindPanel, SLOT( findNext() ),     QKeySequence( QKeySequence::FindNext ) );
-  myActions[ FindPrev ]  = myMenus[ File ]->addAction( tr( "&Find previous" ),   myFindPanel, SLOT( findPrevious() ), QKeySequence( QKeySequence::FindPrevious ) );
-  myMenus[ File ]->addSeparator();
-  myActions[ Close ]     = myMenus[ File ]->addAction( tr( "&Close" ),           this, SLOT( close() ) );
-
+  QToolBar* toolbar = addToolBar( tr( "Navigation" ) );
+  toolbar->addAction( myWebView->pageAction( QWebPage::Back ) );
+  toolbar->addAction( myWebView->pageAction( QWebPage::Forward ) );
+
+  QMenu* fileMenu = menuBar()->addMenu( tr( "&File" ) );
+  fileMenu->addAction( QPixmap( ":/images/open.png" ), tr( "&Open..." ), 
+                      this, SLOT( open() ),
+                      QKeySequence( QKeySequence::Open ) );
+  fileMenu->addSeparator();
+  fileMenu->addAction( tr( "&Find in text..." ),
+                      myFindPanel, SLOT( find() ),
+                      QKeySequence( QKeySequence::Find ) );
+  fileMenu->addAction( tr( "&Find next" ),
+                      myFindPanel, SLOT( findNext() ),
+                      QKeySequence( QKeySequence::FindNext ) );
+  fileMenu->addAction( tr( "&Find previous" ),
+                      myFindPanel, SLOT( findPrevious() ),
+                      QKeySequence( QKeySequence::FindPrevious ) );
+  fileMenu->addSeparator();
+  fileMenu->addAction( QPixmap( ":/images/close.png" ), tr( "&Close" ),
+                      this, SLOT( close() ) );
+
+  QMenu* helpMenu = menuBar()->addMenu( tr( "&Help" ) );
+  helpMenu->addAction( tr( "&About..." ),
+                      this, SLOT( about() ) );
+  
   QVBoxLayout* main = new QVBoxLayout( frame );
   main->addWidget( myWebView );
   main->addWidget( myFindPanel );
@@ -382,13 +393,10 @@ QtxWebBrowser::QtxWebBrowser( ) : QMainWindow( 0 )
   connect( myWebView->pageAction( QWebPage::OpenLink ), SIGNAL( activated() ),
           SLOT( linkAction() ) );
   
-
-  myWebView->pageAction( QWebPage::OpenLinkInNewWindow )->setVisible( false );
-
   setCentralWidget( frame );
   setFocusProxy( myWebView );
-  updateData();
-  qAddPostRoutine( QtxWebBrowser::clearData );
+  setWindowIcon( QPixmap( ":/images/appicon.png" ) );
+  adjustTitle();
 }
 
 /*!
@@ -419,53 +427,17 @@ void QtxWebBrowser::loadUrl( const QString& url, const QString& anchor )
 {
   QString anUrl = url;
   if( !anchor.isEmpty() ) anUrl += "#" + anchor;
-  anUrl.replace('\\', '/');
 
   Qtx::alignWidget( webBrowser(), (QWidget*)QApplication::desktop(), Qtx::AlignCenter );
 
   QtxWebBrowser* browser = webBrowser();
   browser->show();
-  browser->myWebView->load( QUrl( anUrl ) );
+  browser->load( anUrl );
   browser->setFocus();
   browser->activateWindow();
   browser->raise();
 }
 
-/*!
-  \brief  Set browser settings from.
-
-  This method can be used to setup the browser properties.
-  - \c "browser:title"         : title of the browser window
-  - \c "browser:icon"          : icon of the browser window
-  - \c "toolbar:title"         : title of the toolbar
-  - \c "menu:file:title"       : File menu of the browser
-  - \c "action:close:title"    : File/Close menu item title
-  - \c "action:close:icon"     : File/Close menu item icon
-  - \c "action:back:title"     : Navigation/Back menu item title
-  - \c "action:back:icon"      : Navigation/Back menu item icon
-  - \c "action:forward:title"  : Navigation/Forward menu item title
-  - \c "action:forward:icon"   : Navigation/Forward menu item icon
-  - \c "action:find:title"     : File/Find menu item title
-  - \c "action:find:icon"      : File/Find menu item icon
-  - \c "action:findnext:title" : File/Find Next menu item title
-  - \c "action:findnext:icon"  : File/Find Next menu item icon
-  - \c "action:findprev:title" : File/Find Previous menu item title
-  - \c "action:findprev:icon"  : File/Find Previous menu item icon
-  - \c "preferences:section"   : Preferences file section (base, used as prefix to the file extension)
-  - \c "preferences:action"    : Preferences file parameter name for action
-  - \c "preferences:program"   : Preferences file parameter name for program
-  - \c "preferences:repeat"    : Preferences file parameter name for repeat action flag
-  
-  \param key name of the property
-  \param val value of the property
-  
-*/
-void QtxWebBrowser::setData( const QString& key, const QVariant& val )
-{
-  myData.insert( key, val );
-  if ( myBrowser ) myBrowser->updateData();
-}
-
 /*!
   \brief Shutdown help browser
 */
@@ -476,134 +448,30 @@ void QtxWebBrowser::shutdown()
 }
 
 /*!
-  \brief Get string value by key from the internal data map
-  \param key data key identifier
-  \param def default value
-  \return string value assigned to the key (null string if data is not assigned to the key)
-  \internal
-*/
-QString QtxWebBrowser::getStringValue( const QString& key, const QString& def )
-{
-  QString val = def;
-  if ( myData.contains( key ) && myData[key].canConvert( QVariant::String ) )
-    val = myData[key].toString();
-  return val;
-}
-
-/*!
-  \brief Get icon value by key from the internal data map
-  \param key data key identifier
-  \param def default value
-  \return icon assigned to the key (null icon if data is not assigned to the key)
-  \internal
-*/
-QIcon QtxWebBrowser::getIconValue( const QString& key, const QIcon& def )
-{
-  QIcon val = def;
-  if ( myData.contains( key ) ) {
-    if ( myData[key].canConvert( QVariant::Pixmap ) )
-      val = myData[key].value<QPixmap>();
-    else if ( myData[key].canConvert( QVariant::Icon ) )
-      val = myData[key].value<QIcon>();
-  }
-  return val;
-}
-
-/*!
-  \brief Update web browser properties from internal data map
+  \brief Set resource manager
+  \param resMgr resource manager
 */
-void QtxWebBrowser::updateData()
+void QtxWebBrowser::setResourceMgr( QtxResourceMgr* resMgr )
 {
-  // main title
-  adjustTitle();
-
-  // window icon
-  QIcon icon = getIconValue( "browser:icon" );
-  if ( !icon.isNull() )
-    setWindowIcon( icon );
-
-  // toolbar title
-  QString tbTitle = getStringValue( "toolbar:title" );
-  if ( myToolbar && !tbTitle.isEmpty() )
-    myToolbar->setWindowTitle( tbTitle );
-
-  // File menu
-  QString fmenu = getStringValue( "menu:file:title" );
-  if ( myMenus.contains( File ) && !fmenu.isEmpty() )
-    myMenus[ File ]->setTitle( fmenu );
-
-  // File/Close menu
-  QString closeTlt = getStringValue( "action:close:title" );
-  QIcon closeIco = getIconValue( "action:close:icon" );
-  if ( myActions.contains( Close ) ) {
-    if ( !closeTlt.isEmpty() )
-      myActions[ Close ]->setText( closeTlt );
-    if ( !closeIco.isNull() )
-      myActions[ Close ]->setIcon( closeIco );
-  }
-
-  // Navigation/Go Back menu
-  QString backTlt = getStringValue( "action:back:title" );
-  QIcon backIco = getIconValue( "action:back:icon" );
-  if ( !backTlt.isEmpty() )
-    myWebView->pageAction( QWebPage::Back )->setText( backTlt );
-  if ( !backIco.isNull() )
-    myWebView->pageAction( QWebPage::Back )->setIcon( backIco );
-
-  // Navigation/Go Forward menu
-  QString fwdTlt = getStringValue( "action:forward:title" );
-  QIcon fwdIco = getIconValue( "action:forward:icon" );
-  if ( !fwdTlt.isEmpty() )
-    myWebView->pageAction( QWebPage::Forward )->setText( fwdTlt );
-  if ( !fwdIco.isNull() )
-    myWebView->pageAction( QWebPage::Forward )->setIcon( fwdIco );
-
-  // File/Find menu
-  QString findTlt = getStringValue( "action:find:title" );
-  QIcon findIco = getIconValue( "action:find:icon" );
-  if ( myActions.contains( Find ) ) {
-    if ( !findTlt.isEmpty() )
-      myActions[ Find ]->setText( findTlt );
-    if ( !findIco.isNull() )
-      myActions[ Find ]->setIcon( findIco );
-  }
-
-  // File/Find Next menu
-  QString findNextTlt = getStringValue( "action:findnext:title" );
-  QIcon findNextIco = getIconValue( "action:findnext:icon" );
-  if ( myActions.contains( FindNext ) ) {
-    if ( !findNextTlt.isEmpty() )
-      myActions[ FindNext ]->setText( findNextTlt );
-    if ( !findNextIco.isNull() )
-      myActions[ FindNext ]->setIcon( findNextIco );
-  }
-
-  // File/Find Previous menu
-  QString findPrevTlt = getStringValue( "action:findprev:title" );
-  QIcon findPrevIco = getIconValue( "action:findprev:icon" );
-  if ( myActions.contains( FindPrev ) ) {
-    if ( !findPrevTlt.isEmpty() )
-      myActions[ FindPrev ]->setText( findPrevTlt );
-    if ( !findPrevIco.isNull() )
-      myActions[ FindPrev ]->setIcon( findPrevIco );
-  }
+  myResourceMgr = resMgr;
 }
 
 /*!
-  \brief Clear internal data map
-  \internal
+  \brief Get resource manager
+  \return resource manager
 */
-void QtxWebBrowser::clearData()
+QtxResourceMgr* QtxWebBrowser::resourceMgr() const
 {
-  myData.clear();
+  return myResourceMgr;
 }
 
 /*!
-  \brief Set resource manager
+  Shows About dialog box
 */
-void QtxWebBrowser::setResourceManager( QtxResourceMgr* resMgr )
+void QtxWebBrowser::about()
 {
-  myResourceMgr = resMgr;
+  QMessageBox::about( this, tr( "About %1" ).arg( tr( "Help Browser" ) ),
+                     QString( "SALOME %1" ).arg( tr( "Help Browser" ) ) );
 }
 
 /*!
@@ -628,7 +496,7 @@ void QtxWebBrowser::linkClicked( const QUrl& url )
 void QtxWebBrowser::linkHovered( const QString& link, const QString& /*title*/, const QString& /*context*/ )
 {
   QUrl url = link;
-  if ( !link.isEmpty() && url.scheme() == "file" ) myLastUrl = url;
+  if ( !link.isEmpty() && isLocalFile( url ) ) myLastUrl = url;
   statusBar()->showMessage( link );
 }
 
@@ -638,8 +506,9 @@ void QtxWebBrowser::linkHovered( const QString& link, const QString& /*title*/,
 */
 void QtxWebBrowser::adjustTitle()
 {
-  QString title = getStringValue( "browser:title" );
-  setWindowTitle( title.isEmpty() ? myWebView->title() : title + QString( " [%1]" ).arg( myWebView->title() ) );
+  QString title = tr( "Help Browser" );
+  if ( !myWebView->title().isEmpty() ) title += QString( " [%1]" ).arg( myWebView->title() );
+  setWindowTitle( title );
 }
 
 /*
@@ -649,8 +518,8 @@ void QtxWebBrowser::adjustTitle()
 void QtxWebBrowser::finished( bool ok )
 {
   if ( !ok && !myLastUrl.isEmpty() ) {
-    if ( myLastUrl.scheme() == "file" ) {
-      QString filename = myLastUrl.toLocalFile();
+    if ( isLocalFile( myLastUrl ) ) {
+      QString filename = myLastUrl.path();
       QString extension = QFileInfo( filename ).suffix();
       if ( extension == "html" || extension == "htm" ) return;
       openLink( filename );
@@ -665,10 +534,10 @@ void QtxWebBrowser::linkAction()
 {
   QObject* s = sender();
   if ( s == myWebView->pageAction( QWebPage::DownloadLinkToDisk ) ) {
-    saveLink( myLastUrl.toLocalFile() );
+    saveLink( myLastUrl.path() );
   }
   else if ( s == myWebView->pageAction( QWebPage::OpenLink ) ) {
-    QString fileName  = myLastUrl.toLocalFile();
+    QString fileName  = myLastUrl.path();
     QString extension = QFileInfo( fileName ).suffix();
     if ( extension != "html" && extension != "htm" ) {
       openLink( fileName, true );
@@ -690,10 +559,10 @@ void QtxWebBrowser::openLink( const QString& fileName, bool force )
   int defAction = Downloader::mOpen;
   bool defRepeat = false;
   QString defProgram;
-  QString resSection   = QString( "%1:%2" ).arg( getStringValue( "preferences:section", "web_browser" ) ).arg( extension );
-  QString actionParam  = getStringValue( "preferences:action",  "action" );
-  QString programParam = getStringValue( "preferences:program", "program" );
-  QString repeatParam  = getStringValue( "preferences:repeat",  "repeat" );
+  QString resSection   = QString( "%1:%2" ).arg( "web_browser" ).arg( extension );
+  QString actionParam  = "action";
+  QString programParam = "program";
+  QString repeatParam  = "repeat";
   
   if ( !extension.isEmpty() && myResourceMgr ) {
     defAction  = myResourceMgr->integerValue( resSection, actionParam, defAction );
@@ -717,14 +586,18 @@ void QtxWebBrowser::openLink( const QString& fileName, bool force )
   switch( defAction ) {
   case Downloader::mOpen:
     if ( !defProgram.isEmpty() ) {
+      QStringList parameters;
 #ifdef WIN32
-      QString cmd = "";
+      QString cmd = defProgram;
 #else
       // If Salome Qt version is lower than the system one, on KDE an unresolved symbol is raised
       // In this case, we can try to launch the pdf viewer after unsetting the LD_LIBRARY_PATH environnement variable
-      QString cmd = "env LD_LIBRARY_PATH=/usr/lib:/usr/lib64";
+      QString cmd = "env";
+      parameters << "LD_LIBRARY_PATH=/usr/lib:/usr/lib64";
+      parameters << defProgram;
 #endif
-      int r = ::system( QString( "%1 %2 %3 &" ).arg( cmd ).arg( defProgram ).arg( myLastUrl.toLocalFile() ).toLatin1().constData() );
+      parameters << QFileInfo( myLastUrl.path() ).absoluteFilePath();
+      QProcess::startDetached( cmd, parameters );
     }
     break;
   case Downloader::mSave:
@@ -737,6 +610,17 @@ void QtxWebBrowser::openLink( const QString& fileName, bool force )
   }
 }
 
+/*!
+  \brief Load URL
+  \param url path to the file to be opened in the browser
+*/
+void QtxWebBrowser::load( const QString& url )
+{
+  QString u = url;
+  if ( !u.isEmpty() )
+    myWebView->load( QUrl( u.replace('\\', '/') ) );
+}
+
 /*!
   \brief Save file
   \param fileName link to the file being saved
@@ -744,7 +628,7 @@ void QtxWebBrowser::openLink( const QString& fileName, bool force )
 */
 void QtxWebBrowser::saveLink( const QString& fileName )
 {
-  QString newFileName = QFileDialog::getSaveFileName( this, tr( "Save File" ), fileName, 
+  QString newFileName = QFileDialog::getSaveFileName( this, tr( "Save file" ), fileName, 
                                                      QString( "*.%1" ).arg( QFileInfo( fileName ).suffix() ) );
   if ( !newFileName.isEmpty() && 
        QFileInfo( newFileName ).canonicalFilePath() != QFileInfo( fileName ).canonicalFilePath() ) {
@@ -754,3 +638,15 @@ void QtxWebBrowser::saveLink( const QString& fileName )
       QMessageBox::warning( this, tr( "Error"), tr( "Can't save file:\n%1" ).arg( newFileName ) );
   }
 }
+
+/*!
+  \brief Open file
+  Shows "Open file" standard dialog box to allow user to choose file to open.
+*/
+void QtxWebBrowser::open()
+{
+  QString url;
+  if ( isLocalFile( myWebView->url() ) ) url = myWebView->url().path();
+  url = QFileDialog::getOpenFileName( this, tr( "Open file" ), url, "HTML files (*.html *.htm);; All files (*)" );
+  if ( !url.isEmpty() ) load( url );
+}
index b1adf3f459b7a51eaacbf87d68f3d3d976a7bce6..bbe43d2d58cf29a2c6e7a011e06110fc62d054a0 100644 (file)
 
 #include <QDialog>
 #include <QMainWindow>
-#include <QMap>
 #include <QUrl>
 
-class QAction;
 class QButtonGroup;
 class QCheckBox;
 class QLabel;
-class QMenu;
 class QPushButton;
-class QToolBar;
 class QWebView;
 class QtxResourceMgr;
 class QtxSearchTool;
@@ -49,49 +45,43 @@ class QTX_EXPORT QtxWebBrowser : public QMainWindow
 {
   Q_OBJECT
 
-  enum { File };
-  enum { Find, FindNext, FindPrev, Close };
-
   class Downloader;
   class Searcher;
 
-private:
-  QtxWebBrowser();
-  
 public:
   virtual ~QtxWebBrowser();
   
   static QtxWebBrowser*           webBrowser();
   static void                     loadUrl( const QString&, const QString& = QString() );
-  static void                     setData( const QString&, const QVariant& );
-  static void                     setResourceManager( QtxResourceMgr* );
+  static void                     setResourceMgr( QtxResourceMgr* );
   static void                     shutdown();
 
+protected:
+  QtxWebBrowser();
+  QtxResourceMgr*                 resourceMgr() const;
+
 private:
-  static QString                  getStringValue( const QString&, const QString& = QString() );
-  static QIcon                    getIconValue( const QString&, const QIcon& = QIcon() );
-  void                            updateData();
-  static void                     clearData();
   void                            saveLink( const QString& );
   void                            openLink( const QString&, bool = false );
 
-protected slots:
+public Q_SLOTS:
+  virtual void                    load( const QString& );
+
+protected Q_SLOTS:
+  virtual void                    about();
   virtual void                    linkClicked( const QUrl& );
   virtual void                    linkHovered( const QString&, const QString&, const QString& );
 
-private slots:
+private Q_SLOTS:
+  void                            open();
   void                            adjustTitle();
   void                            finished( bool );
   void                            linkAction();
   
 private:
-  static QMap<QString, QVariant>  myData;
   static QtxWebBrowser*           myBrowser;
   static QtxResourceMgr*          myResourceMgr;
   QWebView*                       myWebView;
-  QToolBar*                       myToolbar;
-  QMap<int, QMenu*>               myMenus;
-  QMap<int, QAction*>             myActions;
   QtxSearchTool*                  myFindPanel;
   QUrl                            myLastUrl;
 };
@@ -110,7 +100,7 @@ public:
   bool         isRepeatAction() const;
   QString      program() const;
 
-private slots:
+private Q_SLOTS:
   void         setAction( int );
   void         browse();
 
diff --git a/src/Qtx/images/appicon.png b/src/Qtx/images/appicon.png
new file mode 100644 (file)
index 0000000..0140a66
Binary files /dev/null and b/src/Qtx/images/appicon.png differ
diff --git a/src/Qtx/images/close.png b/src/Qtx/images/close.png
new file mode 100644 (file)
index 0000000..4364ce7
Binary files /dev/null and b/src/Qtx/images/close.png differ
diff --git a/src/Qtx/images/open.png b/src/Qtx/images/open.png
new file mode 100644 (file)
index 0000000..8ed143e
Binary files /dev/null and b/src/Qtx/images/open.png differ
index 48d7c6d8794bfd2ea639d77c7f82dbe5c9143b5e..bb99d984831dba0fdb70fde8faf68a4f2317ba75 100644 (file)
         <translation>&amp;Fermer</translation>
     </message>
 </context>
+<context>
+    <name>QtxWebBrowser</name>
+    <message>
+        <source>Open URL</source>
+        <translation>Ouvrir le URL</translation>
+    </message>
+    <message>
+        <source>Open in</source>
+        <translation type="unfinished">Open in</translation>
+    </message>
+    <message>
+        <source>Save file</source>
+        <translation>Sauvegarder le fichier</translation>
+    </message>
+    <message>
+        <source>&amp;Browse...</source>
+        <translation>&amp;Parcourir...</translation>
+    </message>
+    <message>
+        <source>Use this program for all files of this type</source>
+        <translation type="unfinished">Use this program for all files of this type</translation>
+    </message>
+    <message>
+        <source>&amp;OK</source>
+        <translation>&amp;OK</translation>
+    </message>
+    <message>
+        <source>&amp;Cancel</source>
+        <translation>&amp;Annuler</translation>
+    </message>
+    <message>
+        <source>You are opening the file</source>
+        <translation type="unfinished">You are opening the file</translation>
+    </message>
+    <message>
+        <source>Please choose the action to be done</source>
+        <translation type="unfinished">Please choose the action to be done</translation>
+    </message>
+    <message>
+        <source>Choose program</source>
+        <translation type="unfinished">Choose program</translation>
+    </message>
+    <message>
+        <source>Go Back</source>
+        <translation>Reculer</translation>
+    </message>
+    <message>
+        <source>Go Forward</source>
+        <translation>Avancer</translation>
+    </message>
+    <message>
+        <source>Navigation</source>
+        <translation>Navigation</translation>
+    </message>
+    <message>
+        <source>&amp;File</source>
+        <translation>&amp;Fichier</translation>
+    </message>
+    <message>
+        <source>&amp;Open...</source>
+        <translation>&amp;Ouvrir...</translation>
+    </message>
+    <message>
+        <source>&amp;Find in text...</source>
+        <translation>&amp;Chercher...</translation>
+    </message>
+    <message>
+        <source>&amp;Find next</source>
+        <translation>Chercher &amp;suivant</translation>
+    </message>
+    <message>
+        <source>&amp;Find previous</source>
+        <translation>Chercher &amp;précédent</translation>
+    </message>
+    <message>
+        <source>&amp;Close</source>
+        <translation>&amp;Fermer</translation>
+    </message>
+    <message>
+        <source>&amp;Help</source>
+        <translation>&amp;Aide</translation>
+    </message>
+    <message>
+        <source>&amp;About...</source>
+        <translation>&amp;A propos de...</translation>
+    </message>
+    <message>
+        <source>About %1</source>
+        <translation>A propos de %1</translation>
+    </message>
+    <message>
+        <source>Help Browser</source>
+        <translation type="unfinished">Help Browser</translation>
+    </message>
+    <message>
+        <source>Error</source>
+        <translation>Erreur</translation>
+    </message>
+    <message>
+        <source>Can't save file:\n%1</source>
+        <translation>Impossible de sauvegarder le fichier:\n%1</translation>
+    </message>
+    <message>
+        <source>Open file</source>
+        <translation>Ouvrir le fichier</translation>
+    </message>
+    <message>
+        <source>%1 has been developed using %2</source>
+        <translation type="unfinished">%1 has been developed using %2</translation>
+    </message>
+</context>
 </TS>
index 47ab64cf2570863122fc7441aed33b96a5b3d806..8272a4d60e4786d29109d52f5377585436415543 100644 (file)
@@ -157,7 +157,9 @@ void QxScene_ViewWindow::createToolBar()
 {
   DEBTRACE("QxScene_ViewWindow::createToolBar");
   QtxActionToolMgr* mgr = toolMgr();
-  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ), false );
+  myToolBar = mgr->createToolBar( tr( "LBL_TOOLBAR_LABEL" ),          // title (language-dependant)
+                                 QString( "QxSceneViewOperations" ), // name (language-independant)
+                                 false );                            // disable floatable toolbar
   mgr->append( ScaleOpId, myToolBar );
   mgr->append( MoveOpId, myToolBar );
   mgr->append( ResetId, myToolBar );
index fe62d243d54c5c46262edf2324167dce42f59c7c..a8dc9c1acd682aa28ddfce314aff82b646e712bd 100644 (file)
@@ -23,6 +23,9 @@
         <source>DSC_RESET_VIEW</source>
         <translation>Reset View Point</translation>
     </message>
+</context>
+<context>
+    <name>QxScene_ViewWindow</name>
     <message>
         <source>LBL_TOOLBAR_LABEL</source>
         <translation>View Operations</translation>
index e122d707857cc5ff53e0bbe8b873c4039dce92dd..6f431ef8a296b9c59f3dbc0fa882487f8811139f 100755 (executable)
@@ -23,6 +23,9 @@
         <source>DSC_RESET_VIEW</source>
         <translation>Restaurer le point de vue</translation>
     </message>
+</context>
+<context>
+    <name>QxScene_ViewWindow</name>
     <message>
         <source>LBL_TOOLBAR_LABEL</source>
         <translation>Opérations de visualisation</translation>
index 06eec21a418f11da51061843513371f649bb5c34..eddd612324cce21c10ce1d73561fc52e3c66d5a1 100644 (file)
@@ -23,6 +23,9 @@
       <source>DSC_RESET_VIEW</source>
       <translation>ビューのポイントを復元します。</translation>
     </message>
+  </context>
+  <context>
+    <name>QxScene_ViewWindow</name>
     <message>
       <source>LBL_TOOLBAR_LABEL</source>
       <translation>表示操作</translation>
index bb72bb2b65604c85a365f80b8a9b91616f3dbd7d..c473793934549622e6664f5f0f467978a7e28ebf 100644 (file)
@@ -52,6 +52,10 @@ void SALOME_PYQT_PyInterp::initPython()
   MESSAGE("SALOME_PYQT_PyInterp::initPython - does nothing");
 }
 
+/*!
+ * Override. Create a distinct context from the SALOME Python console.
+ * Especially the global context is not connected to __main__ as in PyInterp_Interp
+ */
 bool SALOME_PYQT_PyInterp::initContext()
 {
   /*
@@ -59,7 +63,8 @@ bool SALOME_PYQT_PyInterp::initContext()
    * It is the caller responsability to acquire the GIL before calling initContext
    * It will still be held on initContext exit
    */
-  _context = PyDict_New();          // create interpreter dictionnary context
+  _local_context = PyDict_New();
+  _global_context = PyDict_New();
   return true;
 }
 
@@ -72,7 +77,7 @@ int SALOME_PYQT_PyInterp::run(const char *command)
     PyErr_Print();
     return -1;
   }
-  PyObject *r = PyEval_EvalCode((PyCodeObject *)code,_context,_context);
+  PyObject *r = PyEval_EvalCode((PyCodeObject *)code,_global_context,_local_context);
 
   Py_DECREF(code);
   if(!r){
index 5857ffe8d81e8b17fd14f55051380bbd64a1a45f..795c0770cedaad464fda914e4866af286bf79d57 100644 (file)
@@ -34,7 +34,7 @@ class SALOME_PYQT_LIGHT_EXPORT SALOME_PYQT_PyInterp : public PyInterp_Interp
   SALOME_PYQT_PyInterp();
   ~SALOME_PYQT_PyInterp();
   
-  int run(const char *command);
+  virtual int run(const char *command);
   
  protected:
   virtual void initPython();
index 4a21a408591b1eb287ef66e1b05e11faf242fa28..30bd9616e86d17ff13836ca5ea8bda47258a939b 100644 (file)
@@ -476,9 +476,10 @@ void PyModuleHelper::XmlHandler::createToolBar( QDomNode& parentNode )
   QDomElement parentElement = parentNode.toElement();
   if ( !parentElement.isNull() ) {
     QString aLabel = attribute( parentElement, "label-id" );
+    QString aName  = attribute( parentElement, "name-id" );
     if ( !aLabel.isEmpty() ) {
       // create toolbar
-      int tbId = module()->createTool( aLabel );
+      int tbId = module()->createTool( aLabel, aName );
       QDomNode node = parentNode.firstChild();
       while ( !node.isNull() ) {
         if ( node.isElement() ) {
@@ -1095,7 +1096,7 @@ void PyModuleHelper::studyActivated( SUIT_Study* study )
   public:
     StudyChangedReq( PyModuleHelper* _helper,
                      SUIT_Study*     _study )
-      : PyInterp_Request( 0, true ), // this request should be processed synchronously (sync == true)
+      : PyInterp_Request(0, true ), // this request should be processed synchronously (sync == true)
         myHelper( _helper ), 
         myStudy ( _study )
     {}
index 692883aac15a6d27a3e49a917d4082a23ff5ab23..540c27514ec55ce3f4c40b9fec443d482e0fcdfa 100755 (executable)
@@ -42,6 +42,7 @@ INCLUDE_DIRECTORIES(
   ${PROJECT_SOURCE_DIR}/src/ObjBrowser
   ${PROJECT_SOURCE_DIR}/src/Plot2d
   ${PROJECT_SOURCE_DIR}/src/PyInterp
+  ${PROJECT_SOURCE_DIR}/src/PyConsole
   ${PROJECT_SOURCE_DIR}/src/Qtx
   ${PROJECT_SOURCE_DIR}/src/SALOME_PYQT/SALOME_PYQT_GUILight
   ${PROJECT_SOURCE_DIR}/src/STD
index e8ace541f6d893a61a68dee4f4eda8fbfda408d3..75642bf48cc6c3bfe231bdb2af8d4748e37954e6 100644 (file)
@@ -50,6 +50,7 @@
 #include "SUIT_ResourceMgr.h"
 #include "SUIT_Session.h"
 #include "SUIT_Tools.h"
+#include "PyConsole_Console.h"
 
 #include <QAction>
 #include <QApplication>
@@ -1549,37 +1550,38 @@ int SalomePyQt::defaultMenuGroup()
 class CrTool
 {
 public:
-  CrTool( const QString& tBar ) 
-    : myCase( 0 ), myTbName( tBar ) {}
+  CrTool( const QString& tBar, const QString& nBar ) 
+    : myCase( 0 ), myTbTitle( tBar ), myTbName( nBar)  {}
   CrTool( const int id, const int tBar, const int idx ) 
     : myCase( 1 ), myId( id ), myTbId( tBar ), myIndex( idx ) {}
   CrTool( const int id, const QString& tBar, const int idx )
-    : myCase( 2 ), myId( id ), myTbName( tBar ), myIndex( idx ) {}
+    : myCase( 2 ), myId( id ), myTbTitle( tBar ), myIndex( idx ) {}
   CrTool( QAction* action, const int tbId, const int id, const int idx )
     : myCase( 3 ), myAction( action ), myTbId( tbId ), myId( id ), myIndex( idx ) {}
   CrTool( QAction* action, const QString& tBar, const int id, const int idx )
-    : myCase( 4 ), myAction( action ), myTbName( tBar ), myId( id ), myIndex( idx ) {}
+    : myCase( 4 ), myAction( action ), myTbTitle( tBar ), myId( id ), myIndex( idx ) {}
 
   int execute( LightApp_Module* module ) const
   {
     if ( module ) {
       switch ( myCase ) {
       case 0:
-        return module->createTool( myTbName );
+        return module->createTool( myTbTitle, myTbName );
       case 1:
         return module->createTool( myId, myTbId, myIndex );
       case 2:
-        return module->createTool( myId, myTbName, myIndex );
+        return module->createTool( myId, myTbTitle, myIndex );
       case 3:
         return module->createTool( myAction, myTbId, myId, myIndex );
       case 4:
-        return module->createTool( myAction, myTbName, myId, myIndex );
+        return module->createTool( myAction, myTbTitle, myId, myIndex );
       }
     }
     return -1;
   }
 private:
    int        myCase;
+   QString    myTbTitle;
    QString    myTbName;
    int        myTbId;
    QAction*   myAction;
@@ -1605,12 +1607,13 @@ public:
 
 /*!
   \brief Create toolbar with specified name.
-  \param tBar toolbar name
+  \param tBar toolbar title (language-dependent)
+  \param nBar toolbar name (language-independent) [optional]
   \return toolbar ID or -1 if toolbar creation is failed
 */
-int SalomePyQt::createTool( const QString& tBar )
+int SalomePyQt::createTool( const QString& tBar, const QString& nBar )
 {
-  return ProcessEvent( new TCreateToolEvent( CrTool( tBar ) ) );
+  return ProcessEvent( new TCreateToolEvent( CrTool( tBar, nBar ) ) );
 }
 
 /*! 
@@ -3905,3 +3908,39 @@ int SalomePyQt::getObjectPosition( const QString& theEntry )
 {
   return ProcessEvent( new TGetObjectPositionEvent(theEntry) );
 }
+
+void SalomePyQt::startPyLog(const QString& theFileName)
+{
+  class TEvent: public SALOME_Event
+  {
+    QString myFileName;
+  public:
+    TEvent( const QString& theFileName ):
+      myFileName( theFileName ) {}
+    virtual void Execute() 
+    {
+      if ( getApplication() ) {
+       PyConsole_Console* pyConsole = getApplication()->pythonConsole( false );
+       if ( pyConsole ) pyConsole->startLog( myFileName );
+      }
+    }
+  };
+  ProcessVoidEvent( new TEvent( theFileName ) );
+}
+
+void SalomePyQt::stopPyLog()
+{
+  class TEvent: public SALOME_Event
+  {
+  public:
+    TEvent() {}
+    virtual void Execute() 
+    {
+      if ( getApplication() ) {
+       PyConsole_Console* pyConsole = getApplication()->pythonConsole( false );
+       if ( pyConsole ) pyConsole->stopLog();
+      }
+    }
+  };
+  ProcessVoidEvent( new TEvent() );
+}
index e9956afd4ffb74fb541d7a5774a602d6420f90fe..68be1fafcdec7d4e9629dd94d6fab7cbaf0f6510 100644 (file)
@@ -208,7 +208,7 @@ public:
 
   static int               defaultMenuGroup();
 
-  static int               createTool( const QString& );
+  static int               createTool( const QString&, const QString& = QString() );
   static int               createTool( const int,  const int,      const int = -1 );
   static int               createTool( const int,  const QString&, const int = -1 );
   static int               createTool( QAction*, const int,      const int = -1, const int = -1 );
@@ -304,6 +304,9 @@ public:
   static QString           getSetting      ( const QString& );
 
   static void              removeChild( const QString& = QString() );
+
+  static void              startPyLog(const QString&);
+  static void              stopPyLog();
 };
 
 #endif // SALOME_PYQT_H
index 2919a905d8086a3e4161b51dd4a87cb22ac32405..7759940000deba804a487e38807df5f65b448832 100644 (file)
@@ -366,7 +366,7 @@ public:
 
   static int               defaultMenuGroup() /ReleaseGIL/ ;
 
-  static int               createTool( const QString& ) /ReleaseGIL/ ;
+  static int               createTool( const QString&, const QString& = QString() ) /ReleaseGIL/ ;
   static int               createTool( const int,  const int,      const int = -1 ) /ReleaseGIL/ ;
   static int               createTool( const int,  const QString&, const int = -1 ) /ReleaseGIL/ ;
   static int               createTool( QAction*,   const int,      const int = -1, const int = -1 ) /ReleaseGIL/ ;
@@ -464,4 +464,7 @@ public:
   static QList<double>     getPlot2dFitRangeByCurves(const int) /ReleaseGIL/ ;
   static QList<double>     getPlot2dFitRangeCurrent(const int) /ReleaseGIL/ ;
   static void              setPlot2dFitRange(const int, const double XMin, const double XMax, const double YMin, const double YMax ) /ReleaseGIL/ ;
+
+  static void              startPyLog(const QString&) /ReleaseGIL/ ;
+  static void              stopPyLog() /ReleaseGIL/ ;
 };
index 98d11c99de40a22756d70cbc1e91cc296dcdcdf5..eb14a5384a020ffc8d73e80f7bcf9404fac28e93 100644 (file)
@@ -227,7 +227,7 @@ public:
   virtual void Execute()
   {
     if ( LightApp_Study* aStudy = getActiveStudy() ) {
-      myResult = aStudy->id();
+      myResult = aStudy->studyName().toUtf8().constData();
     }
   }
 };
index 25fdb6547d146cb9301f7e8666a8154838f63033..985d1fed7a87d3bc415d62321e8619974926ba18 100755 (executable)
@@ -158,16 +158,6 @@ bool SOCC_Viewer::isInViewer( const Handle(SALOME_InteractiveObject)& obj,
 {
   AIS_ListOfInteractive List;
   getAISContext()->DisplayedObjects(List);
-
-#if OCC_VERSION_LARGE <= 0x06060000
-  if( !onlyInViewer ) {
-    AIS_ListOfInteractive List1;
-    getAISContext()->ObjectsInCollector(List1);
-    List.Append(List1);
-}
-#endif
-
-
   AIS_ListIteratorOfListOfInteractive ite(List);
   for ( ; ite.More(); ite.Next() )
   {
@@ -362,29 +352,6 @@ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs )
           continue;
         }
 
-#if OCC_VERSION_LARGE <= 0x06060000
-      // then try to find presentation in the collector
-      if(ic->IsInCollector(anAIS))
-        {
-          ic->DisplayFromCollector( anAIS, false );
-          // Deactivate object if necessary
-          if ( !anOCCPrs->ToActivate() )
-            ic->Deactivate( anAIS );
-
-          // Set visibility flag
-          // Temporarily commented to avoid awful dependecy on SALOMEDS
-          // TODO: better mechanism of storing display/erse status in a study
-          // should be provided...
-          //Handle(SALOME_InteractiveObject) anObj =
-          //  Handle(SALOME_InteractiveObject)::DownCast( anAIS->GetOwner() );
-          //if ( !anObj.IsNull() && anObj->hasEntry() )
-          //{
-          //  if ( study )
-          //    ToolsGUI::SetVisibility( study, anObj->getEntry(), true, this );
-          //}
-          continue;
-        }
-#endif
       // if object is not displayed and not found in the collector - display it
       if ( anAIS->IsKind( STANDARD_TYPE(AIS_Trihedron) ) )
       {
@@ -400,14 +367,12 @@ void SOCC_Viewer::Display( const SALOME_OCCPrs* prs )
       {
         aSh->SetClippable (prs->IsClippable());
         applyExistingClipPlanesToObject (anAIS);
-#if OCC_VERSION_LARGE > 0x06050200
         bool top = (aSh->isTopLevel() && aSh->switchTopLevel());
              ic->SetZLayer( aSh, top ? getTopLayerId() : 0 );
                    if(!aSh->toActivate())
         {
                            ic->Deactivate( aSh );
                    }
-#endif
       }
 
       //Register anAIS (if it has an entry) in entry2aisobjects map
@@ -481,11 +446,7 @@ void SOCC_Viewer::Erase( const SALOME_OCCPrs* prs, const bool forced )
     Handle(AIS_InteractiveObject) anAIS = aIter.Value();
     if ( !anAIS.IsNull() ) {
       // erase the object from context : move it to collector
-#if OCC_VERSION_LARGE <= 0x06060000
-      ic->Erase( anAIS, false, forced ? false : true );
-#else
       ic->Erase( anAIS, false );
-#endif
       // Set visibility flag if necessary
       // Temporarily commented to avoid awful dependecy on SALOMEDS
       // TODO: better mechanism of storing display/erse status in a study
@@ -535,11 +496,7 @@ void SOCC_Viewer::EraseAll( const bool forced )
 
     // erase an object
     Handle(AIS_InteractiveObject) anIO = anIter.Value();
-#if OCC_VERSION_LARGE <= 0x06060000
-    ic->Erase( anIO, false, forced ? false : true );
-#else
     ic->Erase( anIO, false );
-#endif
     
     // Set visibility flag if necessary
     // Temporarily commented to avoid awful dependecy on SALOMEDS
@@ -579,11 +536,7 @@ SALOME_Prs* SOCC_Viewer::CreatePrs( const char* entry )
         for ( unsigned int ind = 0; ind < List.size(); ind++ )
           {
             Handle(AIS_InteractiveObject) anAIS=List[ind];
-            if(ic->IsDisplayed(anAIS)
-#if OCC_VERSION_LARGE <= 0x06060000
-               || ic->IsInCollector(anAIS)
-#endif
-              )
+            if(ic->IsDisplayed(anAIS))
               {
                 prs->AddObject( anAIS );
               }
index 9539d7ee38edfc5200fba71dfaafe2d7af57bc18..51354196a3206ef9b134cf0a9dca08ab68e1e18e 100755 (executable)
@@ -229,10 +229,9 @@ void STD_Application::createActions()
   createMenu( FileNewId,    fileMenu, 0 );
   createMenu( FileOpenId,   fileMenu, 0 );
   createMenu( FileReopenId, fileMenu, 0 ); 
-  createMenu( FileCloseId,  fileMenu, 5 );
-  createMenu( separator(),  fileMenu, -1, 5 );
   createMenu( FileSaveId,   fileMenu, 5 );
   createMenu( FileSaveAsId, fileMenu, 5 );
+  createMenu( FileCloseId,  fileMenu, 5 );
   createMenu( separator(),  fileMenu, -1, 5 );
 
   createMenu( separator(),  fileMenu );
@@ -253,7 +252,8 @@ void STD_Application::createActions()
 
   // Create tool bars
 
-  int stdTBar = createTool( tr( "INF_DESK_TOOLBAR_STANDARD" ) );
+  int stdTBar = createTool( tr( "INF_DESK_TOOLBAR_STANDARD" ),  // title (language-dependant)
+                           QString( "SalomeStandard" ) );      // name (language-independant)
 
   // Create tool items
 
@@ -402,12 +402,18 @@ bool STD_Application::closeDoc( bool ask )
   if ( ask && !isPossibleToClose( closePermanently ) )
     return false;
 
+  return closeActiveDoc( closePermanently );
+}
+
+/*!Close document.*/
+bool STD_Application::closeActiveDoc( bool permanently )
+{
   SUIT_Study* study = activeStudy();
 
   beforeCloseDoc( study );
 
   if ( study )
-    study->closeDocument( closePermanently );
+    study->closeDocument( permanently );
 
   clearViewManagers();
 
@@ -458,7 +464,7 @@ bool STD_Application::isPossibleToClose( bool& closePermanently )
 
 int STD_Application::closeChoice( const QString& docName )
 {
-  int answer = SUIT_MessageBox::question( desktop(), tr( "CLOSE_STUDY" ), tr( "CLOSE_QUESTION" ).arg( docName ),
+  int answer = SUIT_MessageBox::question( desktop(), tr( "CLOSE_STUDY" ), tr( "CLOSE_QUESTION" ),
                                           SUIT_MessageBox::Save | SUIT_MessageBox::Discard | SUIT_MessageBox::Cancel,
                                           SUIT_MessageBox::Save );
 
index 8e5703b01f9e6b6b8ab6d6ed29fd0ec8385d5597..8073407c369927d1438d3404fc90d056145c5472 100755 (executable)
@@ -168,6 +168,7 @@ protected:
   virtual int           closeChoice( const QString& );
   virtual bool          closeAction( const int, bool& );
   virtual bool          closeDoc( bool ask = true );
+  virtual bool          closeActiveDoc( bool permanently = true );
 
 private:
   ViewManagerList       myViewMgrs;
index dd91f9b929e6c16ce8d789719d6e5aa4a43edef1..382d9db5ab00f1852c41e8a87448d31f6fa3d7c9 100644 (file)
@@ -362,10 +362,6 @@ Do you want to overwrite it?</translation>
         <source>TOT_DESK_FILE_EXIT</source>
         <translation>Exit from application</translation>
     </message>
-    <message>
-        <source>TOT_DESK_FILE_LOAD</source>
-        <translation>Load document</translation>
-    </message>
     <message>
         <source>TOT_DESK_FILE_OPEN</source>
         <translation>Open document</translation>
@@ -390,10 +386,6 @@ Do you want to overwrite it?</translation>
         <source>PRP_DESK_FILE_SAVE</source>
         <translation>Saves the active document</translation>
     </message>
-    <message>
-        <source>PRP_DESK_FILE_LOAD</source>
-        <translation>Loads a document</translation>
-    </message>
     <message>
         <source>PRP_DESK_WINDOW_HTILE</source>
         <translation>Arranges the windows as nonoverlapping horizontal tiles</translation>
@@ -418,10 +410,6 @@ Do you want to overwrite it?</translation>
         <source>MEN_DESK_FILE_REOPEN</source>
         <translation>Reopen</translation>
     </message>
-    <message>
-        <source>MEN_DESK_FILE_LOAD</source>
-        <translation>Conn&amp;ect...</translation>
-    </message>
     <message>
         <source>MEN_DESK_FILE_SAVE</source>
         <translation>&amp;Save</translation>
index 87c71765e33b467f4c8cd3c0c72b255ebb6e5b7d..4b2aa2a992d7d73b3cc1cc063f5af63457a7165a 100755 (executable)
@@ -362,10 +362,6 @@ Voulez-vous l&apos;écraser ?</translation>
         <source>TOT_DESK_FILE_EXIT</source>
         <translation>Quitter l&apos;application</translation>
     </message>
-    <message>
-        <source>TOT_DESK_FILE_LOAD</source>
-        <translation>Charger le document</translation>
-    </message>
     <message>
         <source>TOT_DESK_FILE_OPEN</source>
         <translation>Ouvrir un document</translation>
@@ -390,10 +386,6 @@ Voulez-vous l&apos;écraser ?</translation>
         <source>PRP_DESK_FILE_SAVE</source>
         <translation>Sauvegarder le document actuel</translation>
     </message>
-    <message>
-        <source>PRP_DESK_FILE_LOAD</source>
-        <translation>Charge un document</translation>
-    </message>
     <message>
         <source>PRP_DESK_WINDOW_HTILE</source>
         <translation>Ranger les fenêtres en mosaïque horizontale</translation>
@@ -418,10 +410,6 @@ Voulez-vous l&apos;écraser ?</translation>
         <source>MEN_DESK_FILE_REOPEN</source>
         <translation>&amp;Réouvrir</translation>
     </message>
-    <message>
-        <source>MEN_DESK_FILE_LOAD</source>
-        <translation>Connec&amp;ter...</translation>
-    </message>
     <message>
         <source>MEN_DESK_FILE_SAVE</source>
         <translation>&amp;Enregistrer</translation>
index 6f7dbd730d3c0d43f69de527400bbd9b05c02714..476d9c71608f8445ccb11a5a5586411cd2da4f14 100644 (file)
       <source>TOT_DESK_FILE_EXIT</source>
       <translation>アプリケーションを終了</translation>
     </message>
-    <message>
-      <source>TOT_DESK_FILE_LOAD</source>
-      <translation>ドキュメントを読み込む</translation>
-    </message>
     <message>
       <source>TOT_DESK_FILE_OPEN</source>
       <translation>文書を開く</translation>
       <source>PRP_DESK_FILE_SAVE</source>
       <translation>現在のドキュメントを保存</translation>
     </message>
-    <message>
-      <source>PRP_DESK_FILE_LOAD</source>
-      <translation>ドキュメントを読み込み</translation>
-    </message>
     <message>
       <source>PRP_DESK_WINDOW_HTILE</source>
       <translation>ウィンドウを左右に並べて表示</translation>
       <source>MEN_DESK_FILE_REOPEN</source>
       <translation>再読み込み</translation>
     </message>
-    <message>
-      <source>MEN_DESK_FILE_LOAD</source>
-      <translation>接続...(&amp;e)</translation>
-    </message>
     <message>
       <source>MEN_DESK_FILE_SAVE</source>
       <translation>保存(&amp;S)</translation>
index 61276cbaa4b695769112ea0368bdebdb512071e3..d169503cbc8e677a03f912ed4b33083eaffff3f6 100755 (executable)
@@ -315,14 +315,15 @@ void SUIT_Application::setActiveStudy( SUIT_Study* study )
 /*!
   Creates new toolbar
   \return identificator of new toolbar in tool manager
-  \param name - name of new toolbar
+  \param title - title of new toolbar
+  \param name - name (identifier) of new toolbar
 */
-int SUIT_Application::createTool( const QString& name )
+int SUIT_Application::createTool( const QString& title, const QString& name )
 {
   if ( !desktop() || !desktop()->toolMgr() )
     return -1;
 
-  return desktop()->toolMgr()->createToolBar( name );
+  return desktop()->toolMgr()->createToolBar( title, name );
 }
 
 /*!
index 8150634547262988d99312f9de6287ed559142d0..8b5d9d031315d391ca4d3e343f7e7fde127298e9 100755 (executable)
@@ -138,7 +138,7 @@ protected:
   virtual void          setActiveStudy( SUIT_Study* );
   
   /** @name Create tool functions*/ //@{
-  int                   createTool( const QString& );
+  int                   createTool( const QString&, const QString& = QString() );
   int                   createTool( const int, const int, const int = -1 );
   int                   createTool( const int, const QString&, const int = -1 );
   int                   createTool( QAction*, const int, const int = -1, const int = -1 );
index bbc7701d718dfd372b7827a1e643aacd5e1f637e..77e244fd6a0daf3ea8706737acdf6483b2696d54 100755 (executable)
@@ -762,6 +762,150 @@ int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QStr
                      defaultButton, escapeButton );
 }
 
+/*!
+  \brief Show critical message box with arbitrary number of user-specified
+         buttons.
+
+  List of buttons to be shown is specified via \a buttons parameter.
+  
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \param buttons list of buttons to be shown
+  \return button used button id
+*/
+int SUIT_MessageBox::critical( QWidget* parent, const QString& title, const QString& text,
+                              const QStringList& buttons,
+                              const int defaultButton, const int escapeButton )
+{
+  ButtonInfos lst;
+  int id = 0;
+  Q_FOREACH( QString button, buttons )
+    lst.append( ButtonInfo( id++, button ) );
+  return messageBox( SUIT_MessageBox::Critical, parent, title, text, lst,
+                     defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show warning message box with arbitrary number of user-specified
+         buttons.
+
+  List of buttons to be shown is specified via \a buttons parameter.
+  
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \param buttons list of buttons to be shown
+  \return button used button id
+*/
+int SUIT_MessageBox::warning( QWidget* parent, const QString& title, const QString& text,
+                             const QStringList& buttons,
+                             const int defaultButton, const int escapeButton )
+{
+  ButtonInfos lst;
+  int id = 0;
+  Q_FOREACH( QString button, buttons )
+    lst.append( ButtonInfo( id++, button ) );
+  return messageBox( SUIT_MessageBox::Warning, parent, title, text, lst,
+                     defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show information message box with arbitrary number of user-specified
+         buttons.
+
+  List of buttons to be shown is specified via \a buttons parameter.
+  
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \param buttons list of buttons to be shown
+  \return button used button id
+*/
+int SUIT_MessageBox::information( QWidget* parent, const QString& title, const QString& text,
+                                 const QStringList& buttons,
+                                 const int defaultButton, const int escapeButton )
+{
+  ButtonInfos lst;
+  int id = 0;
+  Q_FOREACH( QString button, buttons )
+    lst.append( ButtonInfo( id++, button ) );
+  return messageBox( SUIT_MessageBox::Information, parent, title, text, lst,
+                     defaultButton, escapeButton );
+}
+
+/*!
+  \brief Show question message box with arbitrary number of user-specified
+         buttons.
+
+  List of buttons to be shown is specified via \a buttons parameter.
+  
+  The function returns clicked button id. The identifiers for the buttons
+  are assigned automatically. The first button is identified as 0, the
+  second one as 1, etc.
+
+  The \a defaultButton parameter allows to specify the button which is assigned
+  for the \c Return or \c Enter key. Similarly, \a escapeButton parameter
+  allows specifing the button which is assigned for \c Escape key.
+  If these parameters are not specified (-1 by default), the first button
+  is set as default button and the last one is defined as escape button.
+
+  \param parent parent widget
+  \param title message box title
+  \param text message box text
+  \param defaultButton default button
+  \param escapeButton escape button
+  \param buttons list of buttons to be shown
+  \return button used button id
+*/
+int SUIT_MessageBox::question( QWidget* parent, const QString& title, const QString& text,
+                              const QStringList& buttons,
+                              const int defaultButton, const int escapeButton )
+{
+  ButtonInfos lst;
+  int id = 0;
+  Q_FOREACH( QString button, buttons )
+    lst.append( ButtonInfo( id++, button ) );
+  return messageBox( SUIT_MessageBox::Question, parent, title, text, lst,
+                     defaultButton, escapeButton );
+}
+
 /*!
   \brief Show critical message box with arbitrary number of user-specified
          buttons.
index d52308833ed25b0cf21c8521a1dc47fc6a8c99f2..29bfc10f8edafa966b619cfbed4e86b61ac543d2 100755 (executable)
@@ -110,6 +110,19 @@ public:
                                   const int defaultButton = -1, const int escapeButton = -1 );
   
   // message boxes with arbitrary number of buttons
+  static int            critical( QWidget* parent, const QString& title, const QString& text,
+                                  const QStringList& buttons,
+                                  const int defaultButton = -1, const int escapeButton = -1 );
+  static int            warning( QWidget* parent, const QString& title, const QString& text,
+                                const QStringList& buttons,
+                                 const int defaultButton = -1, const int escapeButton = -1 );
+  static int            information( QWidget* parent, const QString& title, const QString& text,
+                                    const QStringList& buttons,
+                                     const int defaultButton = -1, const int escapeButton = -1 );
+  static int            question( QWidget* parent, const QString& title, const QString& text,
+                                  const QStringList& buttons,
+                                  const int defaultButton = -1, const int escapeButton = -1 );
+
   static int            critical( QWidget* parent, const QString& title, const QString& text, 
                                   const int defaultButton, const int escapeButton, 
                                   char*, ... );
index fd4e7b72d1da197c0feddf5b5c3578496d1c33e9..dd2d9024f1e497208006f7f08dc5e7530d7fcd43 100755 (executable)
@@ -85,7 +85,7 @@ QString SUIT_ResourceMgr::userFileName( const QString& appName, const bool for_l
   // Try config file, given in arguments
   for (int i = 1; i < arguments.count(); i++) {
     QRegExp rx ("--resources=(.+)");
-    if ( rx.indexIn( arguments[i] ) >= 0 && rx.numCaptures() > 1 ) {
+    if ( rx.indexIn( arguments[i] ) >= 0 && rx.numCaptures() > 0 ) {
       QString file = rx.cap(1);
       QFileInfo fi (file);
       pathName = fi.absoluteFilePath();
index ee301cb25fce7f9bae9cf61ea1fbc5e786851da6..1f693f34b506aa56787ea30a2a9079245ca23e06 100644 (file)
@@ -252,7 +252,6 @@ int main( int argc, char* argv[] )
     int   _argc   = 1;
     char* _argv[] = {(char*)""};
     SUIT_PYTHON::init_python(_argc,_argv);
-    PyEval_ReleaseLock();
 #endif
 
     SUIT_Application* theApp = aSession->startApplication( argList.first() );
index 504bd14d8fcee83c2ec1080baa617f3010cd8a37..6bf01ab0ee6f0dd1378d06cbb79b7e35ff53bdea 100644 (file)
@@ -34,6 +34,10 @@ void SUIT_PYTHON::init_python(int argc, char **argv)
   Py_Initialize(); // Initialize the interpreter
   PySys_SetArgv(argc, argv);
   PyEval_InitThreads(); // Create (and acquire) the interpreter lock - can be called many times
+
+  // Py_InitThreads acquires the GIL
+  PyThreadState *pts = PyGILState_GetThisThreadState(); 
+  PyEval_ReleaseThread(pts);
   SUIT_PYTHON::initialized = true;
 }
 
index 3f4383692dffb3cdce47aefeeb5f1aeee6fbff3f..20fafbeae10a3b3b7f4a144926496d6c871dcb29 100644 (file)
@@ -924,7 +924,7 @@ SALOME_Actor
 */
 void
 SALOME_Actor
-::SetNameActorOffset(int theOffset[2])
+::SetNameActorOffset(double theOffset[2])
 {
   myNameActor->SetOffset(theOffset);
 }
@@ -936,7 +936,7 @@ SALOME_Actor
 */
 void
 SALOME_Actor
-::GetNameActorSize(vtkRenderer* theRenderer, int theSize[2]) const
+::GetNameActorSize(vtkRenderer* theRenderer, double theSize[2]) const
 {
   myNameActor->GetSize(theRenderer, theSize);
 }
@@ -950,7 +950,7 @@ SALOME_Actor
 {
   if( vtkRenderer* aRenderer = GetRenderer() )
   {
-    int anOffset[2] = { 0, 0 };
+    double anOffset[2] = { 0, 0 };
     VTK::ActorCollectionCopy aCopy(aRenderer->GetActors());
     vtkActorCollection* aCollection = aCopy.GetActors();
     for( int anIndex = 0, aNbItems = aCollection->GetNumberOfItems(); anIndex < aNbItems; anIndex++ )
@@ -962,7 +962,7 @@ SALOME_Actor
           anActor->SetNameActorOffset( anOffset );
           if( anActor->GetVisibility() )
           {
-            int aSize[2];
+            double aSize[2];
             anActor->GetNameActorSize( aRenderer, aSize );
             anOffset[0] = anOffset[0] + aSize[0];
             anOffset[1] = anOffset[1] + aSize[1];
index 57340054983f8e99877d5c141425a4da76af35e9..bac5d9ae5ccee4d98e5b7aeb8957d0eb58b28dbb 100644 (file)
@@ -202,12 +202,12 @@ class SVTK_EXPORT SALOME_Actor : public VTKViewer_Actor
   //! To set offset of name actor
   virtual
   void
-  SetNameActorOffset(int theOffset[2]);
+  SetNameActorOffset(double theOffset[2]);
 
   //! To get size of name actor
   virtual
   void
-  GetNameActorSize(vtkRenderer* theRenderer, int theSize[2]) const;
+  GetNameActorSize(vtkRenderer* theRenderer, double theSize[2]) const;
 
   //! To update visibility of name actors
   virtual
index d56dde955cb163a7d2ecb1ae12e500e2f75d6d9c..bd64d9aa803b6ab189e9d846ed5f4220e080f512 100755 (executable)
@@ -173,8 +173,13 @@ void SVTK_ViewWindow::Initialize(SVTK_ViewModelBase* theModel)
   aRenderer->Delete();
   aSelector->Delete();
   
-  myToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"), false, Qt::AllToolBarAreas, -1, this );
-  myRecordingToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_RECORD_LABEL"), false, Qt::AllToolBarAreas, -1, this );
+  myToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_LABEL"),                       // title (language-dependant)
+                                       QString( "VTKViewerViewOperations" ),          // name (language-independant)
+                                       false );                                       // disable floatable toolbar
+
+  myRecordingToolBar = toolMgr()->createToolBar( tr("LBL_TOOLBAR_RECORD_LABEL"),       // title (language-dependant)
+                                                QString( "VTKRecordingOperations" ),  // name (language-independant)
+                                                false );                              // disable floatable toolbar
   
   createActions( SUIT_Session::session()->resourceMgr() );
   createToolBar();
index dd996207cb68dd7c19dbdbec3fd8e98d16168ae2..a21b2d92d745c588b197d114533bebb2472f4295 100644 (file)
         <source>MNU_RIGHT_VIEW</source>
         <translation>-OY</translation>
     </message>
-    <message>
-        <source>LBL_TOOLBAR_LABEL</source>
-        <translation>View Operations</translation>
-    </message>
     <message>
         <source>DSC_BACK_VIEW</source>
         <translation>+OX View</translation>
         <source>MNU_SVTK_RECORDING_STOP</source>
         <translation>Stop recording</translation>
     </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>View Operations</translation>
+    </message>
     <message>
         <source>LBL_TOOLBAR_RECORD_LABEL</source>
         <translation>Recording Operations</translation>
index a6b8cdc5bd07096b27f56a7dd718cf854ff1f2db..15f55eca950f2f738473969d09b8926ffb2eb144 100755 (executable)
         <source>MNU_RIGHT_VIEW</source>
         <translation>-OY</translation>
     </message>
-    <message>
-        <source>LBL_TOOLBAR_LABEL</source>
-        <translation>Opérations de visualisation</translation>
-    </message>
     <message>
         <source>DSC_BACK_VIEW</source>
         <translation>Vue +OX</translation>
         <source>MNU_SVTK_RECORDING_STOP</source>
         <translation>Arrêter l&apos;enregistrement</translation>
     </message>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>Opérations de visualisation</translation>
+    </message>
     <message>
         <source>LBL_TOOLBAR_RECORD_LABEL</source>
         <translation>Opérations d&apos;enregistrement</translation>
index 3fec5f98de0870ea904f6e0bb546cadef35afc24..11d36a3ef14f61e8b6ca7c2a3244172b41938dd8 100644 (file)
       <source>MNU_RIGHT_VIEW</source>
       <translation>-OY</translation>
     </message>
-    <message>
-      <source>LBL_TOOLBAR_LABEL</source>
-      <translation>表示操作</translation>
-    </message>
     <message>
       <source>DSC_BACK_VIEW</source>
       <translation>+OX View</translation>
       <source>MNU_SVTK_RECORDING_STOP</source>
       <translation>記録を停止します。</translation>
     </message>
+    <message>
+      <source>LBL_TOOLBAR_LABEL</source>
+      <translation>表示操作</translation>
+    </message>
     <message>
       <source>LBL_TOOLBAR_RECORD_LABEL</source>
       <translation>登録</translation>
index 4182bfcb145eb352d8fe696b0e722b86999e625a..d8a18ca83015b944200ff88255fd6c762bcf6716 100644 (file)
@@ -162,11 +162,10 @@ extern "C" SALOMEAPP_EXPORT SUIT_Application* createApplication()
 
 /*!Constructor.*/
 SalomeApp_Application::SalomeApp_Application()
-  : LightApp_Application()
+  : LightApp_Application(), 
+    myIsSiman( false ),
+    myIsCloseFromExit( false )
 {
-  connect( desktop(), SIGNAL( message( const QString& ) ),
-           this, SLOT( onLoadDocMessage( const QString& ) ), Qt::UniqueConnection );
-  myIsSiman = false; // default
 }
 
 /*!Destructor.
@@ -320,12 +319,13 @@ void SalomeApp_Application::createActions()
                 tr( "MEN_DESK_REGISTRY_DISPLAY" ), tr( "PRP_DESK_REGISTRY_DISPLAY" ),
                 /*Qt::SHIFT+Qt::Key_D*/0, desk, false, this, SLOT( onRegDisplay() ) );
 
-  //rnv commented : implementation of the mono-study in GUI
-  //
-  //createAction( FileLoadId, tr( "TOT_DESK_FILE_LOAD" ),
-  //              resourceMgr()->loadPixmap( "STD", tr( "ICON_FILE_OPEN" ) ),
-  //              tr( "MEN_DESK_FILE_LOAD" ), tr( "PRP_DESK_FILE_LOAD" ),
-  //              Qt::CTRL+Qt::Key_L, desk, false, this, SLOT( onLoadDoc() ) );
+  createAction( ConnectId, tr( "TOT_DESK_CONNECT_STUDY" ), QIcon(),
+                tr( "MEN_DESK_CONNECT" ), tr( "PRP_DESK_CONNECT" ),
+                Qt::CTRL+Qt::Key_L, desk, false, this, SLOT( onLoadDoc() ) );
+
+  createAction( DisconnectId, tr( "TOT_DESK_DISCONNECT_STUDY" ), QIcon(),
+                tr( "MEN_DESK_DISCONNECT" ), tr( "PRP_DESK_DISCONNECT" ),
+                Qt::CTRL+Qt::Key_U, desk, false, this, SLOT( onUnloadDoc() ) );
 
 
 #ifdef WITH_SIMANIO
@@ -346,7 +346,9 @@ void SalomeApp_Application::createActions()
   // creation of menu item is moved to VISU
   //  createMenu( SaveGUIStateId, fileMenu, 10, -1 );
 
-  // createMenu( FileLoadId,   fileMenu, 0 );
+  createMenu( ConnectId,    fileMenu, 5 );
+  createMenu( DisconnectId, fileMenu, 5 );
+  createMenu( separator(),  fileMenu, -1, 5 );
 
 #ifdef WITH_SIMANIO
   if (myIsSiman) {
@@ -358,7 +360,6 @@ void SalomeApp_Application::createActions()
   }
 #endif
   createMenu( DumpStudyId, fileMenu, 10, -1 );
-  createMenu( separator(), fileMenu, -1, 10, -1 );
   createMenu( LoadScriptId, fileMenu, 10, -1 );
   createMenu( separator(), fileMenu, -1, 10, -1 );
   createMenu( PropertiesId, fileMenu, 10, -1 );
@@ -387,18 +388,6 @@ void SalomeApp_Application::createActions()
 
 }
 
-
-/*!Set desktop:*/
-void SalomeApp_Application::setDesktop( SUIT_Desktop* desk )
-{
-  LightApp_Application::setDesktop( desk );
-
-  if ( desk ) {
-    connect( desk, SIGNAL( message( const QString& ) ),
-             this, SLOT( onLoadDocMessage( const QString& ) ), Qt::UniqueConnection );
-  }
-}
-
 /*!
   \brief Close application.
 */
@@ -413,8 +402,11 @@ void SalomeApp_Application::onExit()
     killServers = dlg.isServersShutdown();
   }
 
-  if ( result )
+  if ( result ) {
+    if ( !killServers ) myIsCloseFromExit = true;
     SUIT_Session::session()->closeSession( SUIT_Session::ASK, killServers );
+    myIsCloseFromExit = false;
+  }
 }
 
 /*!SLOT. Load document.*/
@@ -477,6 +469,31 @@ void SalomeApp_Application::onLoadDoc()
   }
 }
 
+/*!SLOT. Unload document.*/
+void SalomeApp_Application::onUnloadDoc( bool ask )
+{
+  if ( ask ) {
+    activeStudy()->abortAllOperations();
+    if ( activeStudy()->isModified() ) {
+      QString docName = activeStudy()->studyName().trimmed();
+      int answer = SUIT_MessageBox::question( desktop(), tr( "DISCONNECT_CAPTION" ),
+                                           tr( "DISCONNECT_DESCRIPTION" ),
+                                           tr( "DISCONNECT_SAVE" ), 
+                                           tr( "DISCONNECT_WO_SAVE" ),
+                                           tr( "APPCLOSE_CANCEL" ), 0 );
+      if ( answer == 0 ) { // save before unload
+       if ( activeStudy()->isSaved() )
+         onSaveDoc();
+       else if ( !onSaveAsDoc() )
+         return;
+      }
+      else if ( answer == 2 ) // Cancel
+       return;
+    }
+  }
+  closeActiveDoc( false );
+}
+
 /*!SLOT. Create new study and load script*/
 void SalomeApp_Application::onNewWithScript()
 {
@@ -543,18 +560,36 @@ bool SalomeApp_Application::onLoadDoc( const QString& aName )
   return res;
 }
 
-/*!SLOT. Load document with a name, specified in \a aMessage.*/
-void SalomeApp_Application::onLoadDocMessage(const QString& aMessage)
+/*!SLOT. Parse message for desktop.*/
+void SalomeApp_Application::onDesktopMessage( const QString& message )
 {
-  if (aMessage.indexOf("simanCheckoutDone ") == 0) {
+  if (message.indexOf("simanCheckoutDone ") == 0) {
 #ifdef WITH_SIMANIO
-    onLoadDoc(aMessage.section(' ', 1));
+    // Load document with a name, specified in aMessage.
+    onLoadDoc(message.section(' ', 1));
 #else
     printf( "****************************************************************\n" );
     printf( "*    Warning: SALOME is built without SIMAN support.\n" );
     printf( "****************************************************************\n" );
 #endif
   }
+  else if (message.indexOf("studyCreated:") == 0) {
+    // Enable 'Connect' action
+    updateCommandsStatus();
+  }
+  else if (message.indexOf("studyClosed:") == 0) {
+    /* message also contains ID of the closed study,
+       but as soon as SALOME is mono-study application for the moment,
+       this ID is not needed now.*/
+    //long aStudyId = message.section(':', 1).toLong();
+    // Disconnect GUI from active study, because it was closed on DS side.
+    closeActiveDoc( false );
+    // Disable 'Connect' action
+    QAction* a = action( ConnectId );
+    if ( a )
+      a->setEnabled( false );
+  }
+  LightApp_Application::onDesktopMessage( message );
 }
 
 /*!SLOT. Copy objects to study maneger from selection maneger..*/
@@ -641,7 +676,6 @@ void SalomeApp_Application::onCloseDoc( bool ask )
 
     }
   }
-
   LightApp_Application::onCloseDoc( ask );
 }
 
@@ -760,8 +794,8 @@ void SalomeApp_Application::updateCommandsStatus()
 
   // Load script menu
   a = action( LoadScriptId );
-  if ( a )
-    a->setEnabled( activeStudy() );
+  if( a )
+    a->setEnabled( pythonConsole() );
 
   // Properties menu
   a = action( PropertiesId );
@@ -773,6 +807,16 @@ void SalomeApp_Application::updateCommandsStatus()
   if( a )
     a->setEnabled( activeStudy() );
 
+  // Connect study menu
+  a = action( ConnectId );
+  if( a )
+    a->setEnabled( !activeStudy() && studyMgr()->GetOpenStudies().size() > 0 );
+
+  // Disconnect study menu
+  a = action( DisconnectId );
+  if( a )
+    a->setEnabled( activeStudy() );
+
   // update state of Copy/Paste menu items
   onSelectionChanged();
 }
@@ -894,14 +938,14 @@ void SalomeApp_Application::onDumpStudy( )
 void SalomeApp_Application::onLoadScript( )
 {
   SalomeApp_Study* appStudy = dynamic_cast<SalomeApp_Study*>( activeStudy() );
-  if ( !appStudy ) return;
-  _PTR(Study) aStudy = appStudy->studyDS();
-
-  if ( aStudy->GetProperties()->IsLocked() ) {
-    SUIT_MessageBox::warning( desktop(),
-                              QObject::tr("WRN_WARNING"),
-                              QObject::tr("WRN_STUDY_LOCKED") );
-    return;
+  if ( appStudy ) {
+    _PTR(Study) aStudy = appStudy->studyDS();
+    if ( aStudy->GetProperties()->IsLocked() ) {
+      SUIT_MessageBox::warning( desktop(),
+                                QObject::tr("WRN_WARNING"),
+                                QObject::tr("WRN_STUDY_LOCKED") );
+      return;
+    }
   }
 
   QStringList filtersList;
@@ -1067,6 +1111,7 @@ QWidget* SalomeApp_Application::createWindow( const int flag )
   else if ( flag == WT_PyConsole )
   {
     PyConsole_Console* pyCons = new PyConsole_EnhConsole( desktop(), new SalomeApp_PyInterp() );
+    pyCons->setObjectName( "pythonConsole" );
     pyCons->setWindowTitle( tr( "PYTHON_CONSOLE" ) );
     pyCons->setFont(resourceMgr()->fontValue( "PyConsole", "font" ));
     pyCons->setIsShowBanner(resourceMgr()->booleanValue( "PyConsole", "show_banner", true ));
@@ -1086,6 +1131,7 @@ QWidget* SalomeApp_Application::createWindow( const int flag )
                getNoteBook(), SLOT( onVarUpdate( QString ) ) );
     }
     wid = getNoteBook();
+    wid->setObjectName( "noteBook" );
   }
 #endif
   return wid;
@@ -1151,20 +1197,25 @@ void SalomeApp_Application::updateDesktopTitle() {
 
 int SalomeApp_Application::closeChoice( const QString& docName )
 {
-  int answer = SUIT_MessageBox::question( desktop(), tr( "APPCLOSE_CAPTION" ), tr( "APPCLOSE_DESCRIPTION" ).arg( docName ),
-                                          tr ("APPCLOSE_SAVE"), tr ("APPCLOSE_CLOSE"),
-                                         //tr ("APPCLOSE_UNLOAD"), 
-                                         tr ("APPCLOSE_CANCEL"), 0 );
-
-  int res = CloseCancel;
-  if ( answer == 0 )
-    res = CloseSave;
-  else if ( answer == 1 )
-    res = CloseDiscard;
-  // else if ( answer == 2 )
-  //   res = CloseUnload;
+  QStringList buttons;
+  QMap<int, int> choices;
+  int idx = 0;
+  buttons << tr ("APPCLOSE_SAVE");                // Save & Close
+  choices.insert( idx++, CloseSave );             // ...
+  buttons << tr ("APPCLOSE_CLOSE");               // Close w/o saving
+  choices.insert( idx++, CloseDiscard );          // ...
+  if ( myIsCloseFromExit ) {
+    buttons << tr ("APPCLOSE_UNLOAD_SAVE");       // Save & Disconnect
+    choices.insert( idx++, CloseDisconnectSave );     // ...
+    buttons << tr ("APPCLOSE_UNLOAD");            // Disconnect
+    choices.insert( idx++, CloseDisconnect );         // ...
+  }
+  buttons << tr ("APPCLOSE_CANCEL");              // Cancel
+  choices.insert( idx++, CloseCancel );           // ...
 
-  return res;
+  int answer = SUIT_MessageBox::question( desktop(), tr( "APPCLOSE_CAPTION" ),
+                                         tr( "APPCLOSE_DESCRIPTION" ), buttons, 0 );
+  return choices[answer];
 }
 
 bool SalomeApp_Application::closeAction( const int choice, bool& closePermanently )
@@ -1180,14 +1231,19 @@ bool SalomeApp_Application::closeAction( const int choice, bool& closePermanentl
     break;
   case CloseDiscard:
     break;
-  case CloseUnload:
+  case CloseDisconnectSave:
+    if ( activeStudy()->isSaved() )
+      onSaveDoc();
+    else if ( !onSaveAsDoc() )
+      res = false;
+  case CloseDisconnect:
+    closeActiveDoc( false );
     closePermanently = false;
     break;
   case CloseCancel:
   default:
     res = false;
   }
-
   return res;
 }
 
@@ -1266,8 +1322,7 @@ QMap<int, QString> SalomeApp_Application::activateModuleActions() const
 {
   QMap<int, QString> opmap = LightApp_Application::activateModuleActions();
 
-  // rnv commented : implementation of the mono-study in GUI
-  // opmap.insert( LoadStudyId,     tr( "ACTIVATE_MODULE_OP_LOAD" ) );
+  opmap.insert( LoadStudyId,     tr( "ACTIVATE_MODULE_OP_LOAD" ) );
 
   opmap.insert( NewAndScriptId,  tr( "ACTIVATE_MODULE_OP_SCRIPT" ) );
   return opmap;
@@ -2048,42 +2103,15 @@ void SalomeApp_Application::afterCloseDoc()
 /*
   Asks to close existing document.
 */
-bool SalomeApp_Application::checkExistingDoc() {
-  bool result = true;
-  if( activeStudy() ) {
-    int answer = SUIT_MessageBox::question( desktop(), 
-                                           tr( "APPCLOSE_CAPTION" ), 
-                                           tr( "STUDYCLOSE_DESCRIPTION" ),
-                                           tr( "APPCLOSE_SAVE" ), 
-                                           tr( "APPCLOSE_CLOSE" ),
-                                           tr( "APPCLOSE_CANCEL" ), 0 );
-    if(answer == 0) {
-      if ( activeStudy()->isSaved() ) {
-       onSaveDoc();
-       closeDoc( false );
-      } else if ( onSaveAsDoc() ) {
-       if( !closeDoc( false ) ) {
-         result = false;
-       }
-      } else {
-       result = false;
-      }        
-    }
-    else if( answer == 1 ) {
-      closeDoc( false );
-    } else if( answer == 2 ) {
-      result = false;
-    }
-  } else {
+bool SalomeApp_Application::checkExistingDoc()
+{
+  bool result = LightApp_Application::checkExistingDoc();
+  if ( result && !activeStudy() ) {
     SALOMEDSClient_StudyManager* aMgr = studyMgr();
-    if( aMgr ) {
+    if ( aMgr ) {
       std::vector<std::string> List = studyMgr()->GetOpenStudies();
       if( List.size() > 0 ) {
-        int answer = SUIT_MessageBox::question( desktop(), tr( "WRN_WARNING" ), tr( "QUE_ACTIVEDOC_LOAD" ),
-                                                SUIT_MessageBox::Yes | SUIT_MessageBox::No, SUIT_MessageBox::No );
-        if ( answer == SUIT_MessageBox::Yes ) {
-         onLoadDoc();
-       }
+        SUIT_MessageBox::critical( desktop(), tr( "WRN_WARNING" ), tr( "ERR_ACTIVEDOC_LOAD" ));
        result = false;
       }
     }
index 5d999d1a9135e8fb063d7929021e4e9880fe34c8..b9833a1dcdb797d96bd2f549adbfcf19db157cb6 100644 (file)
@@ -69,8 +69,9 @@ class SALOMEAPP_EXPORT SalomeApp_Application : public LightApp_Application
 public:
   enum { MenuToolsId = 5 };
   enum { DumpStudyId = LightApp_Application::UserID, LoadScriptId, PropertiesId,
-         CatalogGenId, RegDisplayId, SaveGUIStateId, FileLoadId, UserID,
-         SimanCheckInId, SimanLocalCheckInId };
+         CatalogGenId, RegDisplayId, SaveGUIStateId, ConnectId, DisconnectId,
+         SimanCheckInId, SimanLocalCheckInId,
+         UserID };
 
   typedef enum { WT_NoteBook = LightApp_Application::WT_User,
                  WT_User
@@ -78,7 +79,7 @@ public:
 
 protected:
   enum { OpenRefresh = LightApp_Application::OpenReload + 1 };
-  enum { CloseUnload = LightApp_Application::CloseDiscard + 1 };
+  enum { CloseDisconnectSave = LightApp_Application::CloseDiscard + 1, CloseDisconnect };
   enum { LoadStudyId = LightApp_Application::OpenStudyId + 1, NewAndScriptId };
 
 public:
@@ -94,8 +95,6 @@ public:
   virtual void                        contextMenuPopup( const QString&, QMenu*, QString& );
 
   virtual bool                        checkDataObject(LightApp_DataObject* theObj);
-
-  virtual void                        setDesktop( SUIT_Desktop* );
   
   virtual bool                        checkExistingDoc();
 
@@ -124,8 +123,8 @@ public slots:
   virtual void                        onLoadDoc();
   virtual void                        onNewWithScript();
   virtual bool                        onLoadDoc( const QString& );
+  virtual void                        onUnloadDoc( bool ask = true);
   virtual void                        onCloseDoc( bool ask = true);
-  virtual void                        onLoadDocMessage(const QString&);
 
   virtual void                        onExit();
   virtual void                        onCopy();
@@ -144,6 +143,7 @@ public slots:
 protected slots:
   void                                onStudyCreated( SUIT_Study* );
   void                                onStudyOpened( SUIT_Study* );
+  void                                onDesktopMessage( const QString& );
   
 protected:
   virtual void                        createActions();
@@ -192,10 +192,11 @@ private:
 
 private:
 #ifndef DISABLE_PYCONSOLE
-  QPointer<SalomeApp_NoteBook>        myNoteBook;
+  QPointer<SalomeApp_NoteBook>        myNoteBook;        // Notebook instance
 #endif
-  QMap<QString, QAction*>             myExtActions; // Map <AttributeUserID, QAction>
-  bool                                myIsSiman; // application corresponds to the siman study flag
+  QMap<QString, QAction*>             myExtActions;      // Map <AttributeUserID, QAction>
+  bool                                myIsSiman;         // application corresponds to the siman study flag
+  bool                                myIsCloseFromExit; // "Close from Exit" flag
 
 signals:
   void                                dumpedStudyClosed( const QString& theDumpScript, 
index 28c4acebca7c642d5dfd67a7ce3b763f646ed078..468473a47773e2c0cff1b4e33b5103088cdd0424 100644 (file)
@@ -82,12 +82,12 @@ QString SalomeApp_DataObject::name() const
 {
   QString str;
   if ( myObject )
-    str = myObject->GetName().c_str();
+    str = QString::fromUtf8( myObject->GetName().c_str() );
   
   if ( str.isEmpty() ) {
     _PTR(SObject) refObj = referencedObject();
     if ( refObj )
-      str = refObj->GetName().c_str();
+      str = QString::fromUtf8( refObj->GetName().c_str() );
   }
   
   if ( isReference() ) {
@@ -164,7 +164,7 @@ QPixmap SalomeApp_DataObject::icon( const int id ) const
       _PTR(AttributePixMap) aPixAttr ( anAttr );
       if ( aPixAttr->HasPixMap() ) {
         QString componentType = componentDataType();
-        QString pixmapID      = aPixAttr->GetPixMap().c_str();
+        QString pixmapID      = QString::fromUtf8(aPixAttr->GetPixMap().c_str());
         // select a plugin within a component
         QStringList plugin_pixmap = pixmapID.split( "::", QString::KeepEmptyParts );
         if ( plugin_pixmap.size() == 2 ) {
@@ -517,7 +517,7 @@ QString SalomeApp_DataObject::value( const _PTR(SObject)& obj ) const
   {
     _PTR(AttributeString) strAttr = attr;
     std::string str = strAttr->Value();
-    QString aStrings = QString( str.c_str() );
+    QString aStrings = QString::fromUtf8( str.c_str() );
     
     //Special case to show NoteBook variables in the "Value" column of the OB 
     if ( LightApp_RootObject* aRoot = dynamic_cast<LightApp_RootObject*>( root() ) )
@@ -585,7 +585,7 @@ QString SalomeApp_DataObject::value( const _PTR(SObject)& obj ) const
   {
     _PTR(AttributeComment) comm = attr;
     std::string str = comm->Value();
-    val = QString( str.c_str() );
+    val = QString::fromUtf8( str.c_str() );
   }
 
   return val;
index 336ecad71ae7e6d8afbc6d78e894ba2f384211bf..5274494994295f72def591034ff1e459f65d9fd3 100644 (file)
@@ -508,7 +508,7 @@ bool SalomeApp_DoubleSpinBox::isAcceptNames() const
 */
 void SalomeApp_DoubleSpinBox::setShowTipOnValidate( const bool flag )
 {
-  myShowTip = myShowTip;
+  myShowTip = flag;
 }
 
 /*!
index d23eb4b044681d7afd0167b49836e51573ec587a..6c2184022d1ac1955fdd7b484844725d9595fff4 100644 (file)
 
 #include <QString>
 
-#if OCC_VERSION_LARGE > 0x06010000
-  #include <Standard_ErrorHandler.hxx>
-  #include <Standard_Failure.hxx>
-#else
-  #include "CASCatch.hxx"
-#endif
+#include <Standard_ErrorHandler.hxx>
+#include <Standard_Failure.hxx>
+
 
 /*!Constructor. Initialize by \a floatSignal.*/
 SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal )
@@ -57,19 +54,11 @@ SalomeApp_ExceptionHandler::SalomeApp_ExceptionHandler( const bool floatSignal )
 /*!Try to call SUIT_ExceptionHandler::internalHandle(o, e), catch if failure.*/
 bool SalomeApp_ExceptionHandler::handleSignals( QObject* o, QEvent* e )
 {
-#if OCC_VERSION_LARGE > 0x06010000
   try {
     OCC_CATCH_SIGNALS;
-#else
-  CASCatch_TRY {
-#endif
     SUIT_ExceptionHandler::internalHandle( o, e );
   }
-#if OCC_VERSION_LARGE > 0x06010000
   catch(Standard_Failure) {
-#else
-  CASCatch_CATCH(Standard_Failure) {
-#endif
     Handle(Standard_Failure) aFail = Standard_Failure::Caught();
     throw Standard_Failure( aFail->GetMessageString() );
   }
index 1e57bd3fafdae0079a2cc9bc8e8c110b16d68e82..2e8bcc78d90f607da37a2668af3fec4d428a157f 100644 (file)
@@ -456,7 +456,7 @@ bool SalomeApp_IntSpinBox::isAcceptNames() const
 */
 void SalomeApp_IntSpinBox::setShowTipOnValidate( const bool flag )
 {
-  myShowTip = myShowTip;
+  myShowTip = flag;
 }
 
 /*!
index 45d8dea5bbb5a7bddcd8b49c4461a4ba66410d8b..b5ecb767ad43ae4563cf3331481cb11da9def5fb 100644 (file)
@@ -21,8 +21,8 @@
 // Author : Roman NIKOLAEV, Open CASCADE S.A.S.
 // Module : GUI
 //
-#include <PyConsole_Interp.h> // this include must be first (see PyInterp_base.h)!
-#include <PyConsole_Console.h>
+#include "PyConsole_Interp.h" // this include must be first (see PyInterp_base.h)!
+#include "PyConsole_Console.h"
 
 #include "SalomeApp_NoteBook.h"
 #include "SalomeApp_Application.h"
index 3adde1b6be2c319e0192abedb15dd88242be7f0d..1107c03a36c6f8aee88052f18fac9233800efd5d 100755 (executable)
@@ -37,7 +37,7 @@
  * initstate & initcontext redefined here.
  */
 SalomeApp_PyInterp::SalomeApp_PyInterp(): 
-  PyConsole_EnhInterp(), myFirstRun( true )
+  PyConsole_EnhInterp(), myFirstRun( true ), myFirstInitStudy( false )
 {
 }
 
@@ -68,7 +68,10 @@ int SalomeApp_PyInterp::beforeRun()
     int ret = simpleRun( "from Help import *", false );
     if ( ret )
       return ret;
-    ret = simpleRun( "import salome", false );
+  }
+  if( myFirstInitStudy ) {
+    myFirstInitStudy = false;
+    int ret = simpleRun( "import salome", false );
     if (ret)
       return ret;
     ret = simpleRun( "salome.salome_init(0,1)", false );
@@ -78,8 +81,14 @@ int SalomeApp_PyInterp::beforeRun()
   return true;
 }
 
+void SalomeApp_PyInterp::initStudy()
+{
+  myFirstInitStudy = true;
+}
+
 void SalomeApp_PyInterp::closeContext()
 {
-    simpleRun( "import salome", false );
-    simpleRun( "salome.salome_close()", false );
+  myFirstInitStudy = false;
+  simpleRun( "import salome", false );
+  simpleRun( "salome.salome_close()", false );
 }
index 95855f3a4107fcfb041c5693cfb8349ce921e298..bf7bd8d500083006dbfdc8dc30d882969143f511 100755 (executable)
@@ -36,6 +36,7 @@ public:
   virtual ~SalomeApp_PyInterp();
 
   virtual void initPython();
+  virtual void initStudy();
   virtual void closeContext();
 
 protected:
@@ -43,6 +44,7 @@ protected:
 
 private:
   bool myFirstRun;
+  bool myFirstInitStudy;
 };
 
 #endif
index 70bd944cbdf7458bfc2b35f49957c6cbf107c4e3..2934889368ae8446a0f7c327f85641c628322024 100644 (file)
 
 #include <LightApp_Displayer.h>
 
+#ifndef DISABLE_PYCONSOLE
+  #include "SalomeApp_PyInterp.h" // WARNING! This include must be the first!
+  #include <PyConsole_Console.h>
+#endif
+
 #include "utilities.h"
 
 #include "SALOMEDS_Tool.hxx"
@@ -729,7 +734,16 @@ void SalomeApp_Study::closeDocument(bool permanently)
     if ( myObserver )
       myStudyDS->detach( myObserver->_this() );
     if ( permanently ) {
+      SUIT_Desktop* desk = SUIT_Session::session()->activeApplication()->desktop();
+      bool isBlocked = desk->signalsBlocked();
+      desk->blockSignals( true );
       SalomeApp_Application::studyMgr()->Close( studyPtr );
+      desk->blockSignals( isBlocked );
+#ifndef DISABLE_PYCONSOLE
+      SalomeApp_Application* app = dynamic_cast<SalomeApp_Application*>( application() );
+      if( app->pythonConsole() )
+        app->pythonConsole()->getInterp()->destroy();
+#endif
     }
     SALOMEDSClient_Study* aStudy = 0;
     setStudyDS( _PTR(Study)(aStudy) );
index d44f26515b57453cecf1a514af32e03c82b20076..de4077d2caeda698a559250bb038a0a406734c1d 100644 (file)
     <parameter name="multi_file_dump"     value="false" />
     <parameter name="pydump_save_gui"     value="false" />
   </section>
- <section name="windows_geometry">
-  <parameter value="#00 #00 #00 #FF #00 #00 #00 #00 #FD #00 #00 #00 #02 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #02 #88 #FC #02 #00 #00 #00 #01 #FC #00 #00 #00 #37 #00 #00 #02 #88 #00 #00 #00 #97 #01 #00 #00 #14 #FA #00 #00 #00 #00 #01 #00 #00 #00 #02 #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #30 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #46 #00 #FF #FF #FF #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #33 #01 #00 #00 #00 #00 #00 #00 #01 #00 #00 #00 #00 #C0 #00 #FF #FF #FF #00 #00 #00 #03 #00 #00 #05 #40 #00 #00 #00 #53 #FC #01 #00 #00 #00 #01 #FB #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #01 #00 #00 #00 #00 #00 #00 #05 #40 #00 #00 #00 #46 #00 #FF #FF #FF #00 #00 #04 #38 #00 #00 #02 #88 #00 #00 #00 #04 #00 #00 #00 #04 #00 #00 #00 #08 #00 #00 #00 #08 #FC #00 #00 #00 #01 #00 #00 #00 #02 #00 #00 #00 #02 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #00 #00 #00 #00 #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #CE #FF #FF #FF #FF #00 #00 #00 #00 #00 #00 #00 #00" name=""/>
- </section>
- <section name="windows_visibility">
-  <parameter value="#00 #00 #00 #00 #02 #00 #00 #00 #0E #00 #4D #00 #6F #00 #64 #00 #75 #00 #6C #00 #65 #00 #73 #01 #00 #00 #00 #10 #00 #53 #00 #74 #00 #61 #00 #6E #00 #64 #00 #61 #00 #72 #00 #64 #01 #01 #00 #00 #00 #03 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #30 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #31 #01 #00 #00 #00 #10 #00 #77 #00 #69 #00 #6E #00 #64 #00 #6F #00 #77 #00 #5F #00 #33 #01" name=""/>
- </section>
 </document>
index af08eef16692b0bf42dfe1cb6a040092c4d38cc8..8eaa1aaa7a90abe6b265c8b1dae1bf49ebea6c3d 100644 (file)
@@ -13,16 +13,8 @@ Python file must include only letters, digits and underscores and start from let
         <translation>The file %1 does not exist.</translation>
     </message>
     <message>
-        <source>QUE_ACTIVEDOC_LOAD</source>
-        <translation>There is an active study in the session.
-Do you want to load it?
-</translation>
-    </message>
-    <message>
-        <source>STUDYCLOSE_DESCRIPTION</source>
-        <translation>You should close an existing study before.
-Do you want to close it?
-</translation>
+        <source>ERR_ACTIVEDOC_LOAD</source>
+        <translation>A study is already active in your session, but you are not connected to it. Use the Connect button to load it in the interface.</translation>
     </message>
     <message>
         <source>WRN_STUDY_LOCKED</source>
@@ -118,6 +110,30 @@ Launch a new session or close the study.</translation>
         <source>CREATE_DOCUMENT_PROBLEM</source>
         <translation>Unknown problem during creation of the document</translation>
     </message>
+    <message>
+        <source>TOT_DESK_CONNECT_STUDY</source>
+        <translation>Connect study</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_DISCONNECT_STUDY</source>
+        <translation>Disconnect study</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_CONNECT</source>
+        <translation>Connect active study</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_DISCONNECT</source>
+        <translation>Disconnect the current study</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_CONNECT</source>
+        <translation>Conn&amp;ect</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_DISCONNECT</source>
+        <translation>D&amp;isconnect</translation>
+    </message>
 </context>
 <context>
     <name>SalomeApp_Application</name>
@@ -127,11 +143,11 @@ Launch a new session or close the study.</translation>
     </message>
     <message>
         <source>APPCLOSE_UNLOAD</source>
-        <translation>&amp;Unload</translation>
+        <translation>&amp;Disconnect w/o saving</translation>
     </message>
     <message>
-        <source>APPCLOSE_CLOSE</source>
-        <translation>&amp;Close w/o saving</translation>
+        <source>APPCLOSE_UNLOAD_SAVE</source>
+        <translation>S&amp;ave &amp;&amp; Disconnect</translation>
     </message>
     <message>
         <source>MEN_WINDOWS_NEW</source>
@@ -157,10 +173,6 @@ Launch a new session or close the study.</translation>
         <source>MEN_DESK_REGISTRY_DISPLAY</source>
         <translation>Registry &amp;Display</translation>
     </message>
-    <message>
-        <source>APPCLOSE_SAVE</source>
-        <translation>&amp;Save &amp;&amp; Close</translation>
-    </message>
     <message>
         <source>TOT_DESK_FILE_LOAD_SCRIPT</source>
         <translation>Load python script</translation>
@@ -254,10 +266,6 @@ Do you want to reload it ?</translation>
         <source>STUDY_LOCKED</source>
         <translation>LOCKED</translation>
     </message>
-    <message>
-        <source>APPCLOSE_CANCEL</source>
-        <translation>&amp;Cancel</translation>
-    </message>
     <message>
         <source>OBJ_BROWSER_NAME</source>
         <translation>Object</translation>
@@ -362,10 +370,6 @@ Do you want to reload it ?</translation>
         <source>MEN_DESK_ADD_VARS_TO_NOTEBOOK</source>
         <translation>Add vars to NoteBook</translation>
     </message>
-    <message>
-        <source>APPCLOSE_CAPTION</source>
-        <translation>Close active study</translation>
-    </message>
     <message>
         <source>MEN_DESK_MRU</source>
         <translation>Most Recently Used</translation>
@@ -376,7 +380,7 @@ Do you want to reload it ?</translation>
     </message>
     <message>
         <source>ACTIVATE_MODULE_OP_LOAD</source>
-        <translation>&amp;Load...</translation>
+        <translation>&amp;Connect</translation>
     </message>
     <message>
         <source>ACTIVATE_MODULE_OP_SCRIPT</source>
@@ -406,6 +410,22 @@ Do you want to reload it ?</translation>
         <source>PRP_SIMAN_LOCAL_CHECK_IN</source>
         <translation>Check In for module</translation>
     </message>
+    <message>
+        <source>DISCONNECT_CAPTION</source>
+        <translation>Disconnect active study</translation>
+    </message>
+    <message>
+        <source>DISCONNECT_DESCRIPTION</source>
+        <translation>Do you want to save study before disconnect?</translation>
+    </message>
+    <message>
+        <source>DISCONNECT_SAVE</source>
+        <translation>&amp;Save &amp;&amp; Disconnect</translation>
+    </message>
+    <message>
+        <source>DISCONNECT_WO_SAVE</source>
+        <translation>&amp;Disconnect w/o saving</translation>
+    </message>
 </context>
 <context>
     <name>SalomeApp_StudyPropertiesDlg</name>
index 345a295e0cf2070db2275f1d7affa982b2f1161e..7aa34a06be1f24d515ce6e7f7027c49f540fcf55 100755 (executable)
@@ -12,6 +12,10 @@ Un fichier Python ne doit être composé que de lettres, chiffres et tirets bas
         <source>WRN_FILE_NOT_EXIST</source>
         <translation>Le fichier %1 n&apos;existe pas.</translation>
     </message>
+    <message>
+        <source>ERR_ACTIVEDOC_LOAD</source>
+        <translation type="unfinished">A study is already active in your session, but you are not connected to it. Use the Connect button to load it in the interface.</translation>
+    </message>
     <message>
         <source>WRN_STUDY_LOCKED</source>
         <translation>L&apos;étude est verrouillée</translation>
@@ -94,6 +98,30 @@ Lancez une nouvelle session ou fermez l&apos;étude en cours.</translation>
         <translation>Impossible d&apos;ouvrir l&apos;étude car il y en a déjà une d&apos;active.
 Lancez une nouvelle session ou fermez l&apos;étude en cours.</translation>
     </message>
+    <message>
+        <source>TOT_DESK_CONNECT_STUDY</source>
+        <translation type="unfinished">Connect study</translation>
+    </message>
+    <message>
+        <source>TOT_DESK_DISCONNECT_STUDY</source>
+        <translation type="unfinished">Disconnect study</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_CONNECT</source>
+        <translation type="unfinished">Connect active study</translation>
+    </message>
+    <message>
+        <source>PRP_DESK_DISCONNECT</source>
+        <translation type="unfinished">Disconnect the current study</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_CONNECT</source>
+        <translation type="unfinished">Conn&amp;ect</translation>
+    </message>
+    <message>
+        <source>MEN_DESK_DISCONNECT</source>
+        <translation type="unfinished">D&amp;isconnect</translation>
+    </message>
 </context>
 <context>
     <name>SalomeApp_Application</name>
@@ -103,11 +131,11 @@ Lancez une nouvelle session ou fermez l&apos;étude en cours.</translation>
     </message>
     <message>
         <source>APPCLOSE_UNLOAD</source>
-        <translation>&amp;Déconnecter</translation>
+        <translation>&amp;Déconnecter sans sauvegarder</translation>
     </message>
     <message>
-        <source>APPCLOSE_CLOSE</source>
-        <translation>&amp;Fermer sans sauvegarder</translation>
+        <source>APPCLOSE_UNLOAD_SAVE</source>
+        <translation>Sauvegarder &amp;&amp; D&amp;éconnecter</translation>
     </message>
     <message>
         <source>MEN_WINDOWS_NEW</source>
@@ -133,10 +161,6 @@ Lancez une nouvelle session ou fermez l&apos;étude en cours.</translation>
         <source>MEN_DESK_REGISTRY_DISPLAY</source>
         <translation>Affichage du registre CORBA</translation>
     </message>
-    <message>
-        <source>APPCLOSE_SAVE</source>
-        <translation>&amp;Sauvegarder &amp;&amp; Fermer</translation>
-    </message>
     <message>
         <source>TOT_DESK_FILE_LOAD_SCRIPT</source>
         <translation>Exécuter un script python</translation>
@@ -230,10 +254,6 @@ Voulez-vous le recharger ?</translation>
         <source>STUDY_LOCKED</source>
         <translation>VERROUILLEE</translation>
     </message>
-    <message>
-        <source>APPCLOSE_CANCEL</source>
-        <translation>&amp;Annuler</translation>
-    </message>
     <message>
         <source>OBJ_BROWSER_NAME</source>
         <translation>Objet</translation>
@@ -338,10 +358,6 @@ Voulez-vous le recharger ?</translation>
         <source>MEN_DESK_ADD_VARS_TO_NOTEBOOK</source>
         <translation>Ajouter les variables au registre</translation>
     </message>
-    <message>
-        <source>APPCLOSE_CAPTION</source>
-        <translation>Fermer l&apos;étude actuelle</translation>
-    </message>
     <message>
         <source>MEN_DESK_MRU</source>
         <translation>Dernières études ouvertes</translation>
@@ -352,7 +368,7 @@ Voulez-vous le recharger ?</translation>
     </message>
     <message>
         <source>ACTIVATE_MODULE_OP_LOAD</source>
-        <translation>&amp;Charger...</translation>
+        <translation type="unfinished">&amp;Connect</translation>
     </message>
     <message>
         <source>ACTIVATE_MODULE_OP_SCRIPT</source>
@@ -382,6 +398,22 @@ Voulez-vous le recharger ?</translation>
         <source>PRP_SIMAN_LOCAL_CHECK_IN</source>
         <translation>Check In pour la module&quot;</translation>
     </message>
+    <message>
+        <source>DISCONNECT_CAPTION</source>
+        <translation type="unfinished">Disconnect active study</translation>
+    </message>
+    <message>
+        <source>DISCONNECT_DESCRIPTION</source>
+        <translation type="unfinished">Do you want to save study before disconnect?</translation>
+    </message>
+    <message>
+        <source>DISCONNECT_SAVE</source>
+        <translation type="unfinished">&amp;Save &amp;&amp; Disconnect</translation>
+    </message>
+    <message>
+        <source>DISCONNECT_WO_SAVE</source>
+        <translation type="unfinished">&amp;Disconnect w/o saving</translation>
+    </message>
 </context>
 <context>
     <name>SalomeApp_StudyPropertiesDlg</name>
index 4c0b3b96470f22c2803ecc40d65d337dfac6d151..3c4804f36b1383a7aa3b8f108d2478473560e038 100644 (file)
       <translation>ファイル %1 は存在しません。</translation>
     </message>
     <message>
-      <source>QUE_ACTIVEDOC_LOAD</source>
-      <translation>セッションにスタディがあります。読み込みますか?</translation>
-    </message>
-    <message>
-      <source>STUDYCLOSE_DESCRIPTION</source>
-      <translation>既存のスタディを閉じる必要があります。閉じますか?
-</translation>
+      <source>ERR_ACTIVEDOC_LOAD</source>
+      <translation type="unfinished">A study is already active in your session, but you are not connected to it. Use the Connect button to load it in the interface.</translation>
     </message>
     <message>
       <source>WRN_STUDY_LOCKED</source>
       <source>CREATE_DOCUMENT_PROBLEM</source>
       <translation>ドキュメント作成中に不明な問題が発生しました</translation>
     </message>
+    <message>
+      <source>TOT_DESK_CONNECT_STUDY</source>
+      <translation type="unfinished">Connect study</translation>
+    </message>
+    <message>
+      <source>TOT_DESK_DISCONNECT_STUDY</source>
+      <translation type="unfinished">Disconnect study</translation>
+    </message>
+    <message>
+      <source>PRP_DESK_CONNECT</source>
+      <translation type="unfinished">Connect active study</translation>
+    </message>
+    <message>
+      <source>PRP_DESK_DISCONNECT</source>
+      <translation type="unfinished">Disconnect the current study</translation>
+    </message>
+    <message>
+      <source>MEN_DESK_CONNECT</source>
+      <translation type="unfinished">Conn&amp;ect</translation>
+    </message>
+    <message>
+      <source>MEN_DESK_DISCONNECT</source>
+      <translation type="unfinished">D&amp;isconnect</translation>
+    </message>
   </context>
   <context>
     <name>SalomeApp_Application</name>
       <translation>すべてのファイル (*. *)</translation>
     </message>
     <message>
-      <source>APPCLOSE_UNLOAD</source>
-      <translation>アンロード(&amp;U)</translation>
+        <source>APPCLOSE_UNLOAD</source>
+        <translation type="unfinished">&amp;Disconnect w/o saving</translation>
     </message>
     <message>
-      <source>APPCLOSE_CLOSE</source>
-      <translation>保存せずに閉じる(&amp;C)</translation>
+        <source>APPCLOSE_UNLOAD_SAVE</source>
+        <translation type="unfinished">S&amp;ave &amp;&amp; Disconnect</translation>
     </message>
     <message>
       <source>MEN_WINDOWS_NEW</source>
       <source>MEN_DESK_REGISTRY_DISPLAY</source>
       <translation>レジストリの表示(&amp;D)</translation>
     </message>
-    <message>
-      <source>APPCLOSE_SAVE</source>
-      <translation>保存して閉じる(&amp;S)</translation>
-    </message>
     <message>
       <source>TOT_DESK_FILE_LOAD_SCRIPT</source>
       <translation>Python スクリプトを実行</translation>
       <source>STUDY_LOCKED</source>
       <translation>ロック</translation>
     </message>
-    <message>
-      <source>APPCLOSE_CANCEL</source>
-      <translation>キャンセル(&amp;C)</translation>
-    </message>
     <message>
       <source>OBJ_BROWSER_NAME</source>
       <translation>オブジェクト</translation>
       <source>MEN_DESK_ADD_VARS_TO_NOTEBOOK</source>
       <translation>変数をレジストリに追加します。</translation>
     </message>
-    <message>
-      <source>APPCLOSE_CAPTION</source>
-      <translation>現在のスタディを閉じる</translation>
-    </message>
     <message>
       <source>MEN_DESK_MRU</source>
       <translation>最近のスタディ</translation>
     </message>
     <message>
       <source>ACTIVATE_MODULE_OP_LOAD</source>
-      <translation>読込み(&amp;L)</translation>
+      <translation type="unfinished">&amp;Connect</translation>
     </message>
     <message>
       <source>ACTIVATE_MODULE_OP_SCRIPT</source>
       <source>PRP_SIMAN_LOCAL_CHECK_IN</source>
       <translation>モジュールにチェックイン</translation>
     </message>
+    <message>
+      <source>DISCONNECT_CAPTION</source>
+      <translation type="unfinished">Disconnect active study</translation>
+    </message>
+    <message>
+      <source>DISCONNECT_DESCRIPTION</source>
+      <translation type="unfinished">Do you want to save study before disconnect?</translation>
+    </message>
+    <message>
+      <source>DISCONNECT_SAVE</source>
+      <translation type="unfinished">&amp;Save &amp;&amp; Disconnect</translation>
+    </message>
+    <message>
+      <source>DISCONNECT_WO_SAVE</source>
+      <translation type="unfinished">&amp;Disconnect w/o saving</translation>
+    </message>
   </context>
   <context>
     <name>SalomeApp_StudyPropertiesDlg</name>
index 90a592db45c85e09fa126459e9d27e39a425bd09..fc63c95b4dfe480c37382519e64563197c797cf8 100644 (file)
@@ -111,9 +111,9 @@ def initialize(module,name,basemenuname,menuname):
     else:
       plugins[name]=[]
   if module:
-    studyId=sg.getActiveStudyId()
-    if plugins[name].has_key(studyId):return
-    plugins[name][studyId]=PluginsManager(module,name,basemenuname,menuname)
+    d=sgPyQt.getDesktop()
+    if plugins[name].has_key(d):return
+    plugins[name][d]=PluginsManager(module,name,basemenuname,menuname)
   else:
     plugins[name].append(PluginsManager(module,name,basemenuname,menuname))
 
index 42770dbfca724eb6ff84b328ac8365236e603a45..65284c93d644cf0f2b84c1f852b844b010d9e782 100755 (executable)
@@ -204,36 +204,10 @@ protected:
       // for backward compatibility we also check files prepended with "." with lower priority
       QRegExp exp( QString( "\\.?%1rc\\.([a-zA-Z0-9.]+)" ).arg( myExtAppName ) );
 #endif
-      QRegExp vers_exp( "^([0-9]+)([A-Z]|RC)?([0-9]*)", Qt::CaseInsensitive );
-      
       QString fname = QFileInfo( _fname ).fileName();
-      if( exp.exactMatch( fname ) ) {
-          QStringList vers = exp.cap( 1 ).split( ".", QString::SkipEmptyParts );
-          int major=0, minor=0;
-          int release = 0, dev1 = 0, dev2 = 0;
-          if ( vers.count() > 0 ) major = vers[0].toInt();
-          if ( vers.count() > 1 ) minor = vers[1].toInt();
-          if ( vers.count() > 2 ) {
-              if ( vers_exp.indexIn( vers[2] ) != -1 ) {
-                  release = vers_exp.cap( 1 ).toInt();
-                  QString tag = vers_exp.cap( 2 ).toLower();
-                  if ( !tag.isEmpty() ) {
-                      if ( tag == "rc" ) // release candidate
-                        dev1 = 49;       // 'rc'=49
-                      else               // a, b, c, ...
-                        dev1 = (int)( tag[ 0 ].toLatin1() ) - (int)( QChar('a').toLatin1() ) + 1; // 'a'=1, 'b'=2, ..., 'z'=26
-                  }
-                  if ( !vers_exp.cap( 3 ).isEmpty() )
-                    dev2 = vers_exp.cap( 3 ).toInt();
-              }
-          }
-
-          int dev = dev1*100+dev2;
-          id = major;
-          id*=100; id+=minor;
-          id*=100; id+=release;
-          id*=10000;
-          if ( dev > 0 ) id-=dev;
+      if ( exp.exactMatch( fname ) ) {
+       long fid = Qtx::versionToId( exp.cap( 1 ) );
+       if ( fid > 0 ) id = fid;
       }
     }
     return id;
@@ -285,19 +259,6 @@ public:
 
   virtual bool notify( QObject* receiver, QEvent* e )
   {
-#if OCC_VERSION_LARGE < 0x06010100
-    // Disable GUI user actions while python command is executed
-    if (SUIT_Session::IsPythonExecuted()) {
-      // Disable mouse and keyboard events
-      QEvent::Type aType = e->type();
-      if (aType == QEvent::MouseButtonPress || aType == QEvent::MouseButtonRelease ||
-          aType == QEvent::MouseButtonDblClick || aType == QEvent::MouseMove ||
-          aType == QEvent::Wheel || aType == QEvent::ContextMenu ||
-          aType == QEvent::KeyPress || aType == QEvent::KeyRelease ||
-          aType == QEvent::Accel || aType == QEvent::AccelOverride)
-        return false;
-    }
-#endif
 
 #ifdef ENABLE_TESTRECORDER
     return myHandler ? myHandler->handle( receiver, e ) :
@@ -680,12 +641,21 @@ int main( int argc, char **argv )
     abort(); //abort program to avoid deadlock in destructors or atexit when shutdown has been interrupted
   }
 
-  PyGILState_Ensure();
-  //Destroy orb from python (for chasing memory leaks)
+    //Destroy orb from python (for chasing memory leaks)
   //PyRun_SimpleString("from omniORB import CORBA");
   //PyRun_SimpleString("orb=CORBA.ORB_init([''], CORBA.ORB_ID)");
   //PyRun_SimpleString("orb.destroy()");
-  Py_Finalize();
+
+  // Destroy the ORB:
+  MESSAGE("Explicitely destroying the ORB (hoping to kill omniORB threads ...)");
+  ORB_INIT * init = SINGLETON_<ORB_INIT>::Instance();
+  if (init)
+    init->explicit_destroy();
+
+  // After ORB destruction
+  PyGILState_Ensure();
+  if(Py_IsInitialized())
+    Py_Finalize();
 
   if ( shutdownAll )
     killOmniNames();
index 3fda8715cb2f970ef0b68df37e5dbaa86b3150ba..8ed5b6551b36b5b0b32487438944b8ed9b3816b5 100644 (file)
 #include <SUIT_DataBrowser.h>
 #include <QtxTreeView.h>
 
+namespace
+{
+  QString toObjectName( const QString& s )
+  {
+    QStringList words = s.split( QRegExp("\\s+") );
+    QStringList result;
+    if ( words.count() > 0 )
+      result.append( words[0].left(1).toLower() + words[0].mid(1) );
+    for ( int i = 1; i < words.count(); i++ )
+      result.append( words[i].left(1).toUpper() + words[i].mid(1) );
+    return result.join( "" );
+  }
+}
+
 /*!
  * This create a gui container to hold widgets dedicated to the XCAD
  * data model. By default, the dock widgets are not visible. Use the
@@ -49,7 +63,7 @@ DockWidgets::DockWidgets(SalomeApp_Application* salomeApp,
   _dwDataPanel = new QDockWidget(parent);
   _dwDataPanel->setVisible(false);
   _dwDataPanel->setWindowTitle(title);
-  _dwDataPanel->setObjectName(title);
+  _dwDataPanel->setObjectName(toObjectName(title)+"Dock");
   parent->addDockWidget(Qt::LeftDockWidgetArea, _dwDataPanel);
   //
   // At this step, the _dwDataPanel is located side by side with the object
@@ -105,3 +119,10 @@ void DockWidgets::setDataView(QTreeView * dataView) {
 void DockWidgets::setPropertiesView(QTreeView * propertiesView) {
   // Not implemented yet
 }
+
+/*!
+ * This function returns dock widget
+ */
+QDockWidget * DockWidgets::getDockWidget() {
+  return _dwDataPanel;
+}
index 5925b58e80893d76b64ca8a96c3a67553e32ed58..56da156c08a4f47a065d311681f90797eefd7f99 100644 (file)
@@ -42,6 +42,8 @@ class TREEDATA_EXPORT DockWidgets {
   void setDataView(QTreeView * dataView);
   void setPropertiesView(QTreeView * propertyView);
 
+  QDockWidget * getDockWidget();
+
  private:
   SalomeApp_Application* _salomeApp;
   QDockWidget * _dwDataPanel;
index 380c451bb3f024eac18bb506b4046cefe9db2e1c..82a91d949b1667f4386351bba53324d41eae02c7 100644 (file)
@@ -113,6 +113,12 @@ TreeView * TreeGuiManager::getDataTreeView() {
   return _dataTreeView;
 }
 
+/*!
+ * This returns the dock widgets manager
+ */
+DockWidgets * TreeGuiManager::getDockWidgets() {
+  return _dockWidgets;
+}
 
 /*!
  * This function specifies the data model to be used by the
index 3321071f24b9bd034d6c98b141c07e23e601c5c8..b2cb0d1c937dc0bac98087aaa02afc719c67d8bc 100644 (file)
@@ -44,6 +44,7 @@ public:
   
   TreeModel * getDataTreeModel();
   TreeView * getDataTreeView();
+  DockWidgets * getDockWidgets();
   
   void setDataModel(DataModel * dataModel);
   DataModel * getDataModel();
index 9f9b6dd485ccba5210a1544dd116afa18dd5cf05..3de2711f132fc6dafbcc4a588d52f31457de9589 100644 (file)
@@ -64,12 +64,9 @@ VTKViewer_FramedTextActor::VTKViewer_FramedTextActor()
   myTextProperty->SetItalic(0);
   myTextProperty->SetShadow(1);
   myTextProperty->SetFontFamilyToArial();
-
-  myTextMapper=vtkTextMapper::New();
-  myTextMapper->SetInput("");
-  myTextMapper->GetTextProperty()->ShallowCopy(myTextProperty);
-  myTextActor=vtkActor2D::New();
-  myTextActor->SetMapper(myTextMapper);
+  
+  myTextActor=vtkTextActor::New();
+  myTextActor->SetTextProperty(myTextProperty);
 
   myBarActor->SetVisibility(1);
   myTextActor->SetVisibility(1);
@@ -99,7 +96,6 @@ VTKViewer_FramedTextActor::VTKViewer_FramedTextActor()
 VTKViewer_FramedTextActor::~VTKViewer_FramedTextActor()
 {
   myTextActor->Delete();
-  myTextMapper->Delete();
   myTextProperty->Delete();
   myBarActor->Delete();
   myBarMapper->Delete();
@@ -148,9 +144,9 @@ int VTKViewer_FramedTextActor::GetPickable()
 // function : GetSize
 // purpose  :
 //==================================================================
-void VTKViewer_FramedTextActor::GetSize(vtkRenderer* theRenderer, int theSize[2]) const
+void VTKViewer_FramedTextActor::GetSize(vtkRenderer* vport, double theSize[2]) const
 {
-  myTextMapper->GetSize(theRenderer, theSize);
+  myTextActor->GetSize(vport, theSize);
   theSize[0] = theSize[0] + 2 * GetTextMargin() + OFFSET_SPACING;
   theSize[1] = theSize[1] + 2 * GetTextMargin() + OFFSET_SPACING;
 }
@@ -164,7 +160,7 @@ void VTKViewer_FramedTextActor::SetForegroundColor(const double r,
                                                    const double b)
 {
   myTextProperty->SetColor(r, g, b);
-  myTextMapper->GetTextProperty()->ShallowCopy(myTextProperty);
+  myTextActor->GetTextProperty()->ShallowCopy(myTextProperty);
   Modified();
 }
 
@@ -257,7 +253,7 @@ int VTKViewer_FramedTextActor::GetTextMargin() const
 // function : SetOffset
 // purpose  :
 //==================================================================
-void VTKViewer_FramedTextActor::SetOffset(const int theOffset[2])
+void VTKViewer_FramedTextActor::SetOffset(const double theOffset[2])
 {
   myHorizontalOffset = theOffset[0];
   myVerticalOffset = theOffset[1];
@@ -272,7 +268,7 @@ void VTKViewer_FramedTextActor::SetText(const char* theText)
 {
   // remove whitespaces from from the start and the end
   // additionally, consider a case of multi-string text
-  QString aString(theText);
+  QString aString(QString::fromUtf8(theText));
 
   QStringList aTrimmedStringList;
   QStringList aStringList = aString.split("\n");
@@ -280,7 +276,7 @@ void VTKViewer_FramedTextActor::SetText(const char* theText)
   while(anIter.hasNext())
     aTrimmedStringList.append(anIter.next().trimmed());
 
-  myTextMapper->SetInput(aTrimmedStringList.join("\n").toLatin1().constData());
+  myTextActor->SetInput(aTrimmedStringList.join("\n").toUtf8().constData());
   Modified();
 }
 
@@ -290,7 +286,7 @@ void VTKViewer_FramedTextActor::SetText(const char* theText)
 //==================================================================
 char* VTKViewer_FramedTextActor::GetText()
 {
-  return myTextMapper->GetInput();
+  return myTextActor->GetInput();
 }
 
 //==================================================================
@@ -410,8 +406,8 @@ void VTKViewer_FramedTextActor::ReleaseGraphicsResources(vtkWindow *win)
 int VTKViewer_FramedTextActor::RenderOverlay(vtkViewport *viewport)
 {
   int renderedSomething = 0;
-  myBarActor->RenderOverlay(viewport);
   renderedSomething +=myTextActor->RenderOverlay(viewport);
+  renderedSomething +=myBarActor->RenderOverlay(viewport);
   return renderedSomething;
 }
 
@@ -431,7 +427,7 @@ VTKViewer_FramedTextActor
   if(aViewPortWidth == 1 || aViewPortHeight == 1)
     return anIsRenderedSomething;
 
-  if(!myTextMapper->GetInput())
+  if(!myTextActor->GetInput())
     return anIsRenderedSomething;
 
   myBar->Initialize();
@@ -449,8 +445,8 @@ VTKViewer_FramedTextActor
   myBar->SetPolys(aPolys);
   aPolys->Delete(); 
 
-  int aTextSize[2]; 
-  myTextMapper->GetSize(theViewport, aTextSize);
+  double aTextSize[2]; 
+  myTextActor->GetSize(theViewport, aTextSize);
   int aBarWidth = aTextSize[0];
   int aBarHeight = aTextSize[1];
 
@@ -511,6 +507,7 @@ VTKViewer_FramedTextActor
                                  y / (double)aViewPortHeight);
   }
 
+
   aPoints->SetPoint(0, xMin, yMax, 0.0);
   aPoints->SetPoint(1, xMin, yMin, 0.0);
   aPoints->SetPoint(2, xMax, yMax, 0.0);
@@ -518,7 +515,6 @@ VTKViewer_FramedTextActor
 
   myTextProperty->SetVerticalJustificationToCentered();
 
-  myTextMapper->GetTextProperty()->ShallowCopy(myTextProperty);
   myBarActor ->GetPositionCoordinate()->SetReferenceCoordinate(PositionCoordinate);
   myTextActor->GetPositionCoordinate()->SetReferenceCoordinate(PositionCoordinate);
 
index 5c4ed01f5edb4ecfc861555e96f622b58cb230f5..78873a86ee301d0e36a53ffb69d3426164c47522 100644 (file)
@@ -32,6 +32,7 @@ class vtkTextMapper;
 class vtkTextProperty;
 class vtkViewport;
 class vtkWindow;
+class vtkTextActor;
 
 class VTKVIEWER_EXPORT VTKViewer_FramedTextActor : public vtkActor2D
 {
@@ -53,7 +54,7 @@ public:
   virtual void                SetPickable(int);
   virtual int                 GetPickable();
 
-  virtual void                GetSize(vtkRenderer* theRenderer, int theSize[2]) const;
+  virtual void                GetSize(vtkRenderer* vport, double theSize[2]) const;
 
   void                        SetText(const char* theText);
   char*                       GetText();
@@ -93,7 +94,7 @@ public:
   void                        SetTextMargin(const int theMargin);
   int                         GetTextMargin() const;
 
-  void                        SetOffset(const int theOffset[2]);
+  void                        SetOffset(const double theOffset[2]);
 
 protected:
   VTKViewer_FramedTextActor();
@@ -105,8 +106,7 @@ protected:
   vtkActor2D*                 myBarActor;
 
   vtkTextProperty*            myTextProperty;
-  vtkTextMapper*              myTextMapper;
-  vtkActor2D*                 myTextActor;
+  vtkTextActor*               myTextActor;
 
   vtkTimeStamp                myBuildTime;
 
index 0f1f19587d18142b2e2b8dd4e85b431454515d0a..91cc9207403e3df0f7c4e4e544ef167c640f7dad 100644 (file)
@@ -522,9 +522,15 @@ void VTKViewer_PolyDataMapper::InitTextures()
   if( !this->ImageData.GetPointer() )
     return;
 
+  glEnable( GL_TEXTURE_2D );
+  if( this->PointSpriteTexture == 0 ) {
+    glGenTextures( 1, &this->PointSpriteTexture );
+  }
+  glBindTexture( GL_TEXTURE_2D, this->PointSpriteTexture );
+  glTexEnvf( GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE );
   glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_REPEAT );
   glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_REPEAT );
-
+  
   if(this->BallEnabled) {
     glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR );
     glTexParameterf( GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_LINEAR );
@@ -537,11 +543,6 @@ void VTKViewer_PolyDataMapper::InitTextures()
   unsigned char* dataPtr = (unsigned char*)this->ImageData->GetScalarPointer();
   glTexImage2D( GL_TEXTURE_2D, 0, GL_RGBA, aSize[0], aSize[1], 0,
                 GL_RGBA, GL_UNSIGNED_BYTE, dataPtr );
-
-  //glClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );
-  glEnable( GL_TEXTURE_2D );
-  glTexEnvf( GL_POINT_SPRITE_ARB, GL_COORD_REPLACE_ARB, GL_TRUE );
-  glBindTexture( GL_TEXTURE_2D, this->PointSpriteTexture );
 }
 
 //-----------------------------------------------------------------------------
@@ -561,6 +562,7 @@ void VTKViewer_PolyDataMapper::RenderPiece( vtkRenderer* ren, vtkActor* act )
     MAPPER_SUPERCLASS::RenderPiece( ren, act );
     if( isUsePointSprites )
       this->CleanupPointSprites();
+    glBindTexture( GL_TEXTURE_2D, 0 );
   } else {
     vtkIdType numPts;
     vtkPolyData *input= this->GetInput();
@@ -670,8 +672,8 @@ void VTKViewer_PolyDataMapper::RenderPiece( vtkRenderer* ren, vtkActor* act )
       this->TimeToDraw = 0.0001;
 
     vglUseProgramObjectARB( 0 );
-
     this->CleanupPointSprites();
+    glBindTexture( GL_TEXTURE_2D, 0 );
   }  
 }
 
index 721173c2a78fec3ed855ad5307b04b7c6af83094..b82a8a44fcac3cd163269f40447590b2d8ed610a 100755 (executable)
@@ -92,6 +92,7 @@ VTKViewer_ViewWindow::VTKViewer_ViewWindow( SUIT_Desktop* theDesktop,
   setCentralWidget( myRenderWindow );
 
   myToolBar = new QtxToolBar( true, tr("LBL_TOOLBAR_LABEL"), this );
+  myToolBar->setObjectName( "VTKViewerViewOperations" );
   myToolBar->setFloatable( false );
 
   createActions();
index 1a7f4191731c6797db11590254ce69d682eaf2f9..d06699e4d1ca4889b1d48d40cab7a41e3291fd8d 100644 (file)
         <source>MNU_RIGHT_VIEW</source>
         <translation>Right</translation>
     </message>
-    <message>
-        <source>LBL_TOOLBAR_LABEL</source>
-        <translation>View Operations</translation>
-    </message>
     <message>
         <source>DSC_BACK_VIEW</source>
         <translation>Back View</translation>
     </message>
 </context>
+<context>
+    <name>VTKViewer_ViewWindow</name>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>View Operations</translation>
+    </message>
+</context>
 <context>
     <name>VTKViewer_MarkerDlg</name>
     <message>
index 39c53eb83ac0b79d6d18517f2da8ab2cc6377673..2d2a9e45c5fb25259b9206d3f16ceff602b96990 100755 (executable)
         <source>MNU_RIGHT_VIEW</source>
         <translation>Droite</translation>
     </message>
-    <message>
-        <source>LBL_TOOLBAR_LABEL</source>
-        <translation>Opérations de visualisation</translation>
-    </message>
     <message>
         <source>DSC_BACK_VIEW</source>
         <translation>Vue de derrière</translation>
     </message>
 </context>
+<context>
+    <name>VTKViewer_ViewWindow</name>
+    <message>
+        <source>LBL_TOOLBAR_LABEL</source>
+        <translation>Opérations de visualisation</translation>
+    </message>
+</context>
 <context>
     <name>VTKViewer_MarkerDlg</name>
     <message>
index af17027b7b4c7771dbf834b5993954e78f8073c9..0e419361940470427a57edf0dc9d696d80c20a94 100644 (file)
       <source>MNU_RIGHT_VIEW</source>
       <translation>法律</translation>
     </message>
-    <message>
-      <source>LBL_TOOLBAR_LABEL</source>
-      <translation>表示操作</translation>
-    </message>
     <message>
       <source>DSC_BACK_VIEW</source>
       <translation>後側のビュー</translation>
     </message>
   </context>
+  <context>
+    <name>VTKViewer_ViewWindow</name>
+    <message>
+      <source>LBL_TOOLBAR_LABEL</source>
+      <translation>表示操作</translation>
+    </message>
+  </context>
   <context>
     <name>VTKViewer_MarkerDlg</name>
     <message>