From: boulant Date: Tue, 16 Apr 2013 15:29:01 +0000 (+0000) Subject: Application of the patch of Cedric Aguere branch concerning the internationalization X-Git-Tag: B4Mrg1804~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=458549cd64698045821197390eaddde433450030;p=modules%2Fmed.git Application of the patch of Cedric Aguere branch concerning the internationalization --- diff --git a/src/MEDOP/gui/CMakeLists.txt b/src/MEDOP/gui/CMakeLists.txt index 5958e600b..2797efd63 100644 --- a/src/MEDOP/gui/CMakeLists.txt +++ b/src/MEDOP/gui/CMakeLists.txt @@ -53,27 +53,28 @@ INCLUDE_DIRECTORIES( ) SET(MEDOPGUITS_SOURCES - MEDOP_msg_en.ts - MEDOP_msg_fr.ts + MED_images.ts + MED_msg_en.ts + MED_msg_fr.ts ) SET(COMMON_DEFINITIONS "${MED3_DEFINITIONS} ${XDR_DEFINITIONS} ${CAS_DEFINITIONS} ${BOOST_DEFINITIONS} ${PLATFORM_DEFINITIONS} ${OMNIORB_DEFINITIONS}") -SET(COMMON_FLAGS +SET(COMMON_FLAGS ${CAS_KERNEL} - ${QT_MT_LIBS} - ${OMNIORB_LIBS} - ${PLATFORM_LIBS} + ${QT_MT_LIBS} + ${OMNIORB_LIBS} + ${PLATFORM_LIBS} ${BOOST_LIBS} - SalomeIDLMED - MEDOPGUI_dialogs - MEDOPFactoryEngine + SalomeIDLMED + MEDOPGUI_dialogs + MEDOPFactoryEngine ${qtx} - ${suit} + ${suit} ${SalomeObject} - ${SalomeLifeCycleCORBA} - ${SalomeKernelHelpers} - ${SalomeApp} - ${SalomeGuiHelpers} - ${SalomeTreeData} + ${SalomeLifeCycleCORBA} + ${SalomeKernelHelpers} + ${SalomeApp} + ${SalomeGuiHelpers} + ${SalomeTreeData} ${OpUtil} ${CAM} ${LightApp} @@ -96,4 +97,3 @@ QT4_INSTALL_TS_RESOURCES("${MEDOPGUITS_SOURCES}" "${MED_salomeres_DATA}") FILE(GLOB COMMON_HEADERS_HXX "${CMAKE_CURRENT_SOURCE_DIR}/*.hxx") INSTALL(FILES ${COMMON_HEADERS_HXX} DESTINATION ${MED_salomeinclude_HEADERS}) - diff --git a/src/MEDOP/gui/DatasourceController.cxx b/src/MEDOP/gui/DatasourceController.cxx index c9e9149ea..6ca29b223 100644 --- a/src/MEDOP/gui/DatasourceController.cxx +++ b/src/MEDOP/gui/DatasourceController.cxx @@ -17,7 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// Author : Guillaume Boulant (EDF) +// Author : Guillaume Boulant (EDF) #include "DatasourceController.hxx" #include "DatasourceConstants.hxx" @@ -57,48 +57,48 @@ DatasourceController::~DatasourceController() { } void DatasourceController::createActions() { - // + // // Main actions (toolbar and menubar) // - QString label = QString("Add Data Source"); - QString tooltip = QString("Add a file data source (file providing med data)"); - QString icon = QString("datasource_add.png"); + QString label = tr("LAB_ADD_DATA_SOURCE"); + QString tooltip = tr("TIP_ADD_DATA_SOURCE"); + QString icon = tr("ICO_DATASOURCE_ADD"); int actionId; actionId = _salomeModule->createStandardAction(label,this, SLOT(OnAddDatasource()),icon,tooltip); _salomeModule->addActionInToolbar(actionId); - label = QString("Add Image Source"); - tooltip = QString("Create a Data Source from an image file"); - icon = QString("image_add.png"); + label = tr("LAB_ADD_IMAGE_SOURCE"); + tooltip = tr("TIP_ADD_IMAGE_SOURCE"); + icon = tr("ICO_IMAGE_ADD"); actionId = _salomeModule->createStandardAction(label,this, SLOT(OnAddImagesource()),icon,tooltip); _salomeModule->addActionInToolbar(actionId); - + // // Actions for popup menu only // // Expand field timeseries - label = QString("Expand field timeseries"); - icon = QString("datasource_expandfield.png"); + label = tr("LAB_EXPAND_FIELD"); + icon = tr("ICO_DATASOURCE_EXPAND_FIELD"); actionId = _salomeModule->createStandardAction(label,this,SLOT(OnExpandField()),icon); _salomeModule->addActionInPopupMenu(actionId); - + // Create a control view - label = QString("Visualize"); - icon = QString("datasource_view.png"); + label = tr("LAB_VISUALIZE"); + icon = tr("ICO_DATASOURCE_VIEW"); actionId = _salomeModule->createStandardAction(label,this,SLOT(OnVisualize()),icon); _salomeModule->addActionInPopupMenu(actionId); // Use in workspace - label = QString("Use in workspace"); - icon = QString("datasource_use.png"); + label = tr("LAB_USE_IN_WORKSPACE"); + icon = tr("ICO_DATASOURCE_USE"); actionId = _salomeModule->createStandardAction(label,this,SLOT(OnUseInWorkspace()),icon); _salomeModule->addActionInPopupMenu(actionId); // Change underlying mesh (note that this action creates a new field in // the workspace that corresponds to a copy of the selected field // modified by the change of the underlying mesh. - label = QString("Change underlying mesh"); - icon = QString("datasource_changeUnderlyingMesh.png"); + label = tr("LAB_CHANGE_MESH"); + icon = tr("ICO_DATASOURCE_CHANGE_MESH"); actionId = _salomeModule->createStandardAction(label,this,SLOT(OnChangeUnderlyingMesh()),icon); _salomeModule->addActionInPopupMenu(actionId); } @@ -122,28 +122,28 @@ MEDOP::DatasourceHandler * DatasourceController::addDatasource(const char * file SALOMEDS::SComponent_var root = _studyEditor->findRoot(QCHARSTAR(_salomeModule->moduleName())); SALOMEDS::SObject_var soDatasource = _studyEditor->newObject(root); _studyEditor->setName(soDatasource,datasourceHandler->name); - _studyEditor->setIcon(soDatasource,"datasource.png"); + _studyEditor->setIcon(soDatasource,tr("ICO_DATASOURCE").toStdString().c_str()); _studyEditor->setParameterInt(soDatasource,OBJECT_ID,datasourceHandler->id); - + // We can add the meshes as children of the datasource - MEDOP::MeshHandlerList * meshHandlerList = + MEDOP::MeshHandlerList * meshHandlerList = MEDOPFactoryClient::getDataManager()->getMeshList(datasourceHandler->id); - + for(CORBA::ULong iMesh=0; iMeshlength(); iMesh++) { MEDOP::MeshHandler meshHandler = (*meshHandlerList)[iMesh]; SALOMEDS::SObject_var soMesh = _studyEditor->newObject(soDatasource); _studyEditor->setName(soMesh,meshHandler.name); - _studyEditor->setIcon(soMesh,"datasource_mesh.png"); + _studyEditor->setIcon(soMesh,tr("ICO_DATASOURCE_MESH").toStdString().c_str()); _studyEditor->setParameterInt(soMesh,OBJECT_ID,meshHandler.id); _studyEditor->setParameterBool(soMesh,OBJECT_IS_IN_WORKSPACE,false); - + // We add the field timeseries defined on this mesh, as children // of the mesh SObject MEDOP::FieldseriesHandlerList * fieldseriesHandlerList = MEDOPFactoryClient::getDataManager()->getFieldseriesListOnMesh(meshHandler.id); - + for(CORBA::ULong iFieldseries=0; iFieldserieslength(); iFieldseries++) { MEDOP::FieldseriesHandler fieldseriesHandler = (*fieldseriesHandlerList)[iFieldseries]; SALOMEDS::SObject_var soFieldseries = _studyEditor->newObject(soMesh); @@ -152,7 +152,7 @@ MEDOP::DatasourceHandler * DatasourceController::addDatasource(const char * file label +=" ("+std::string(XmedDataObject::mapTypeOfFieldLabel[fieldseriesHandler.type])+")"; _studyEditor->setName(soFieldseries,label.c_str()); - _studyEditor->setIcon(soFieldseries,"datasource_field.png"); + _studyEditor->setIcon(soFieldseries,tr("ICO_DATASOURCE_FIELD").toStdString().c_str()); _studyEditor->setParameterInt(soFieldseries,OBJECT_ID,fieldseriesHandler.id); _studyEditor->setParameterBool(soFieldseries,OBJECT_IS_IN_WORKSPACE,false); } @@ -166,12 +166,12 @@ void DatasourceController::OnAddDatasource() { // Dialog to get the filename where the input data are read from QStringList filter; - filter.append(QObject::tr("MED files (*.med)")); + filter.append(tr("FILE_FILTER_MED")); QString filename = SUIT_FileDlg::getFileName(_salomeModule->getApp()->desktop(), "", filter, - QObject::tr("Import MED fields"), + tr("IMPORT_MED_FIELDS"), true); if ( filename.isEmpty() ) return; @@ -197,7 +197,7 @@ void DatasourceController::OnAddImagesource() QString imageFilename = dialog.getImageFilepath(); QString medFilename = dialog.getMedFilepath(); bool autoLoad = dialog.isAutoLoaded(); - + std::string ROOT_DIR(getenv("MED_ROOT_DIR")); std::string command(ROOT_DIR+"/bin/salome/med/image2med.py"); command += " -i "+QS2S(imageFilename); @@ -224,10 +224,10 @@ void DatasourceController::OnExpandField() // Get the selected objects in the study (SObject) SALOME_StudyEditor::SObjectList * listOfSObject = _studyEditor->getSelectedObjects(); - for (int i=0; isize(); i++) { + for (int i=0; isize(); i++) { SALOMEDS::SObject_var soFieldseries = listOfSObject->at(i); - // First retrieve the fieldseries id associated to this study object + // First retrieve the fieldseries id associated to this study object long fieldseriesId = _studyEditor->getParameterInt(soFieldseries,OBJECT_ID); STDLOG("Expand the field timeseries "<setFieldHandler(*fieldHandler); event->objectdata = dataObject; - emit datasourceSignal(event); + emit datasourceSignal(event); } } @@ -302,7 +302,7 @@ void DatasourceController::OnUseInWorkspace() { // _GBO_ Note that it works only for a single field but the // XmedDataObject will be improved to deal with mesh, timeseries // and single field in a futur version. We suppose here that a - // single field has been selected. + // single field has been selected. // <<< SALOMEDS::SObject_var soField = listOfSObject->at(0); @@ -398,7 +398,7 @@ void DatasourceController::OnChangeUnderlyingMesh() { SALOME_StudyEditor::SObjectList * listOfSObject = _studyEditor->getSelectedObjects(); if ( listOfSObject->size() > 0 ) { SALOMEDS::SObject_var soField = listOfSObject->at(0); - int fieldId = _studyEditor->getParameterInt(soField,OBJECT_ID); + int fieldId = _studyEditor->getParameterInt(soField,OBJECT_ID); // _GBO_ : the dialog should not be modal, so that we can choose a // mesh in the browser. Then we have to emit a signal from the // dialog.accept, connected to a slot of the DatasourceControler @@ -415,7 +415,7 @@ void DatasourceController::OnChangeUnderlyingMeshInputValidated() { int fieldId = _dlgChangeUnderlyingMesh->getFieldId(); MEDOP::FieldHandler * fieldHandler = MEDOPFactoryClient::getDataManager()->getFieldHandler(fieldId); - + // We don't modify the original field but create first a duplicate MEDOP::FieldHandler * duplicate = MEDOPFactoryClient::getCalculator()->dup(*fieldHandler); MEDOPFactoryClient::getDataManager()->changeUnderlyingMesh(duplicate->id, meshId); @@ -434,9 +434,9 @@ void DatasourceController::OnChangeUnderlyingMeshInputValidated() { event->objectdata = dataObject; emit datasourceSignal(event); // Note that this signal is processed by the WorkspaceController - + // Tag the item to prevent double import //_studyEditor->setParameterBool(soField,OBJECT_IS_IN_WORKSPACE,true); - - + + } diff --git a/src/MEDOP/gui/MEDOPModule.cxx b/src/MEDOP/gui/MEDOPModule.cxx index 18137129d..2f580bcf1 100644 --- a/src/MEDOP/gui/MEDOPModule.cxx +++ b/src/MEDOP/gui/MEDOPModule.cxx @@ -17,7 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// Author : Guillaume Boulant (EDF) +// Author : Guillaume Boulant (EDF) #include "MEDOPModule.hxx" #include "QtHelper.hxx" @@ -27,6 +27,17 @@ #include "MEDOPFactoryClient.hxx" +#include + +#include +#include +#include +#include + +enum { + MEDOP_MENU_ACTION_ID_IMPORT_MED = 100 +}; + MEDOPModule::MEDOPModule() : StandardApp_Module() { @@ -41,6 +52,25 @@ MEDOPModule::MEDOPModule() : // This part implements the mandatory interface // ===================================================================== // +//======================================================================= +// function : initialize +// purpose : +//======================================================================= +void MEDOPModule::initialize( CAM_Application* app ) { + StandardApp_Module::initialize( app ); + + QWidget* aParent = application()->desktop(); + SUIT_ResourceMgr* resMgr = dynamic_cast( SUIT_Session::session()->resourceMgr() ); + + QPixmap aPixmap = resMgr->loadPixmap("XMED", tr("ICO_IMPORT_MED")); + createAction( MEDOP_MENU_ACTION_ID_IMPORT_MED, tr("IMPORT_FROM_FILE"), QIcon(aPixmap), + tr("IMPORT_MED_FILE"), "", (Qt::CTRL + Qt::Key_M), aParent, false, + this, SLOT(onImportMedFile())); + + int xmedId = createMenu( tr( "MEN_FILE" ), -1, 1 ); + createMenu( MEDOP_MENU_ACTION_ID_IMPORT_MED, xmedId, 10 ); +} + /*! * Returns the engine of the XMED module, i.e. the SALOME component @@ -56,7 +86,7 @@ Engines::EngineComponent_ptr MEDOPModule::getEngine() const { * directory of the module. */ QString MEDOPModule::studyIconName() { - return QString("MEDOP_small.png"); + return tr("ICO_MEDOP_SMALL"); } // @@ -102,3 +132,33 @@ void MEDOPModule::createModuleActions() { // Creating actions concerning the workspace _workspaceController->createActions(); } + +void MEDOPModule::onImportMedFile() +{ + SalomeApp_Application* app = dynamic_cast( SUIT_Session::session()->activeApplication() ); + if( !app ) + return; + SUIT_Desktop* desktop = app->desktop(); + + QStringList filter; + filter.append( tr( "FILE_FILTER_MED" ) ); + + QString anInitialPath = ""; + if ( SUIT_FileDlg::getLastVisitedPath().isEmpty() ) + anInitialPath = QDir::currentPath(); + + QString caption = tr( "IMPORT_FROM_FILE" ); + QStringList filenames = SUIT_FileDlg::getOpenFileNames( desktop, + anInitialPath, + filter, + caption ); + + if ( filenames.count() <= 0 ) + return; + + for ( QStringList::ConstIterator itFile = filenames.begin(); itFile != filenames.end(); ++itFile ) { + QString filename = *itFile; + _datasourceController->addDatasource(QCHARSTAR(filename)); + updateObjBrowser(true); + } +} diff --git a/src/MEDOP/gui/MEDOPModule.hxx b/src/MEDOP/gui/MEDOPModule.hxx index 5bc8852c6..578480ea6 100644 --- a/src/MEDOP/gui/MEDOPModule.hxx +++ b/src/MEDOP/gui/MEDOPModule.hxx @@ -17,7 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// Author : Guillaume Boulant (EDF) +// Author : Guillaume Boulant (EDF) #ifndef _MEDOP_MODULE_HXX_ #define _MEDOP_MODULE_HXX_ @@ -47,6 +47,8 @@ class MEDOPGUI_EXPORT MEDOPModule: public StandardApp_Module public: MEDOPModule(); + virtual void initialize( CAM_Application* ); + protected: virtual Engines::EngineComponent_ptr getEngine() const; virtual QString studyIconName(); @@ -55,6 +57,9 @@ protected: virtual bool activateModule( SUIT_Study* theStudy ); virtual bool deactivateModule( SUIT_Study* theStudy ); + private slots: + void onImportMedFile(); + private: DatasourceController * _datasourceController; WorkspaceController * _workspaceController; diff --git a/src/MEDOP/gui/MED_images.ts b/src/MEDOP/gui/MED_images.ts new file mode 100644 index 000000000..50a15a5d4 --- /dev/null +++ b/src/MEDOP/gui/MED_images.ts @@ -0,0 +1,67 @@ + + + + + @default + + ICO_IMPORT_MED + fileimport-32.png + + + ICO_DATASOURCE + datasource.png + + + ICO_DATASOURCE_ADD + datasource_add.png + + + ICO_DATASOURCE_CHANGE_MESH + datasource_changeUnderlyingMesh.png + + + ICO_DATASOURCE_EXPAND_FIELD + datasource_expandfield.png + + + ICO_DATASOURCE_FIELD + datasource_field.png + + + ICO_DATASOURCE_MESH + datasource_mesh.png + + + ICO_DATASOURCE_USE + datasource_use.png + + + ICO_DATASOURCE_VIEW + datasource_view.png + + + ICO_FOLDER + folder.png + + + ICO_IMAGE_ADD + image_add.png + + + ICO_MEDOP + MEDOP.png + + + ICO_MEDOP_SMALL + MEDOP_small.png + + + ICO_WORKSPACE_CLEAN + workspace_clean.png + + + ICO_WORKSPACE_SAVE + workspace_save.png + + + diff --git a/src/MEDOP/gui/MED_msg_en.ts b/src/MEDOP/gui/MED_msg_en.ts new file mode 100644 index 000000000..259d25ed6 --- /dev/null +++ b/src/MEDOP/gui/MED_msg_en.ts @@ -0,0 +1,306 @@ + + + + + DatasourceController + + + LAB_ADD_DATA_SOURCE + Add Data Source + + + + TIP_ADD_DATA_SOURCE + Add a file data source (file providing med data) + + + + LAB_ADD_IMAGE_SOURCE + Add Image Source + + + + TIP_ADD_IMAGE_SOURCE + Create a Data Source from an image file + + + + LAB_EXPAND_FIELD + Expand field timeseries + + + + LAB_VISUALIZE + Visualize + + + + LAB_USE_IN_WORKSPACE + Use in workspace + + + + LAB_CHANGE_MESH + Change underlying mesh + + + + IMPORT_MED_FIELDS + Import MED fields + + + + OPERATION_FAILED + Operation failed + + + + CREATION_FAILED + The creation of med data from the image file failed + + + + OPERATION_NOT_ALLOWED + Operation not allowed + + + + FIELD_ALREADY_DEFINED + This field is already defined in the workspace + + + + DlgAlias + + + SELECT_AN_ALIAS_FOR_THE_FIELD + Select an alias for the field + + + + DEFINE_AN_ALIAS + You can define an alias to manipulate the field in console: + + + + ALIAS + Alias + + + + MSG_OPERATION_DEFINES_VARIABLE + (this operation defines a variable named <alias> in TUI console. Enter "<alias>.help()" to see available functions, or simply "doc") + + + + DlgChangeUnderlyingMesh + + + FORM + Form + + + + SELECT_MESH + Select a mesh in explorer: + + + + MESH_GT + Mesh -> + + + + MSG_EXPLORER + (Explorer provides a view on MED data sources (mesh and fields) referenced in data space) + + + + DATA_VERIFICATION + Data verification + + + + SELECT_MESH + You must select a mesh in the explorer and clic the button Mesh + + + + DlgImageToMed + + + FORM + Form + + + + IMAGE_FILE + Image file: + + + + MED_FILE + MED file: + + + + SELECT_IMAGE_FILE + Select image file + + + + SPECIFY_MED_FILE + Specify a MED file + + + + LOAD_AUTOMATICALLY + Load automatically + + + + DlgUseInWorkspace + + + FORM + Form + + + + PRESSURE + Pressure: + + + + TEMPERATURE + Temperature: + + + + GenericDialog + + + DIALOG + Dialog + + + + MEDOPModule + + + + IMPORT_FROM_FILE + Import from File + + + + IMPORT_MED_FILE + Import MED file + + + + MEN_FILE + &File + + + + WorkspaceController + + + VISUALIZE_SCALAR_MAP + Visualize (scalar map) + + + + USE_IN_CONSOLE + Use (in console) + + + + EXPORT_TO_PARAVIS + Export (to PARAVIS) + + + + SAVE_AS_MED + Save (as MED file) + + + + REMOVE_FROM_WORKSPACE + Remove (from workspace) + + + + LAB_SAVE_WORKSPACE + Save workspace + + + + TIP_SAVE_WORKSPACE + Save the workspace (fields and meshes) in a MED file + + + + LAB_CLEAN_WORKSPACE + Clean workspace + + + + TIP_CLEAN_WORKSPACE + Clean all data in the workspace + + + + SAVE_SELECTED_FIELDS + Save selected fields + + + + SAVE_WORKSPACE_DATA + Save workspace data + + + + NOT_IMPLEMENTED_YET + Not implemented yet + + + + FUNCTION_NOT_IMPLEMENTED + This function is not implemented yet + + + + @default + + + + + + + FILE_FILTER_MED + MED files (*.med) + + + + FILE_FILTER_PNG + PNG image (*.png) + + + + FILE_FILTER_JPG + JPG image (*.jpg) + + + + FILE_FILTER_PGM + PGM image (*.jpg) + + + + FILE_FILTER_ALL + All files (*.*) + + + diff --git a/src/MEDOP/gui/MED_msg_fr.ts b/src/MEDOP/gui/MED_msg_fr.ts new file mode 100644 index 000000000..9578ff576 --- /dev/null +++ b/src/MEDOP/gui/MED_msg_fr.ts @@ -0,0 +1,306 @@ + + + + + DatasourceController + + + LAB_ADD_DATA_SOURCE + Ajouter des données + + + + TIP_ADD_DATA_SOURCE + Ajouter un fichier de données (au format MED) + + + + LAB_ADD_IMAGE_SOURCE + Ajouter une image + + + + TIP_ADD_IMAGE_SOURCE + Créer des données à partir d'un fichier image + + + + LAB_EXPAND_FIELD + Étendre les series temporelles du champ + + + + LAB_VISUALIZE + Visualiser + + + + LAB_USE_IN_WORKSPACE + Utiliser dans l'espace de travail + + + + LAB_CHANGE_MESH + Changer le maillage sous-jacent + + + + IMPORT_MED_FIELDS + Importer des champs (format MED) + + + + OPERATION_FAILED + L'opération a échoué + + + + CREATION_FAILED + La création des données MED à partir d'un fichier image a échoué + + + + OPERATION_NOT_ALLOWED + Opération non autorisée + + + + FIELD_ALREADY_DEFINED + Ce champ est déjà défini dans l'espace de travail + + + + DlgAlias + + + SELECT_AN_ALIAS_FOR_THE_FIELD + Selectionner un alias pour ce champ + + + + DEFINE_AN_ALIAS + Vous pouvez définir un alias pour manipuler le champs dans la console: + + + + ALIAS + Alias + + + + MSG_OPERATION_DEFINES_VARIABLE + (cette opération définit une variable nommée <alias> dans la console texte. Tapez "<alias>.help()" pour voir les fonctions disponibles, ou simplement "doc") + + + + DlgChangeUnderlyingMesh + + + FORM + Formulaire + + + + SELECT_MESH + Selectionner un maillage dans l'explorateur: + + + + MESH_GT + Maillage -> + + + + MSG_EXPLORER + (L'explorateur fournit une vue des données MED (maillage et champs) référencées dans l'espace des données) + + + + DATA_VERIFICATION + Vérification des données + + + + SELECT_MESH + Vous devez sélectionner un maillage dans l'explorateur et cliquer sur le bouton Maillage + + + + DlgImageToMed + + + FORM + Formulaire + + + + IMAGE_FILE + Fichier image : + + + + MED_FILE + Fichier MED : + + + + SELECT_IMAGE_FILE + Selectionner un fichier image + + + + SPECIFY_MED_FILE + Spécifier un fichier MED + + + + LOAD_AUTOMATICALLY + Charger automatiquement + + + + DlgUseInWorkspace + + + FORM + Formulaire + + + + PRESSURE + Pression : + + + + TEMPERATURE + Température : + + + + GenericDialog + + + DIALOG + Dialogue + + + + MEDOPModule + + + + IMPORT_FROM_FILE + Importer depuis un fichier + + + + IMPORT_MED_FILE + Importer un fichier MED + + + + MEN_FILE + &Fichier + + + + WorkspaceController + + + VISUALIZE_SCALAR_MAP + Visualiser (carte scalaire) + + + + USE_IN_CONSOLE + Utiliser (dans la console) + + + + EXPORT_TO_PARAVIS + Exporter (vers PARAVIS) + + + + SAVE_AS_MED + Sauvegarder (dans un fichier MED) + + + + REMOVE_FROM_WORKSPACE + Supprimer (de l'espace de travail) + + + + LAB_SAVE_WORKSPACE + Sauvegarder l'espace de travail + + + + TIP_SAVE_WORKSPACE + Sauvegarder l'espace de travail (champs et maillages) dans un fichier MED + + + + LAB_CLEAN_WORKSPACE + Nettoyer l'espace de travail + + + + TIP_CLEAN_WORKSPACE + Effacer toute les données de l'espace de travail + + + + SAVE_SELECTED_FIELDS + Sauvegarder les champs sélectionnés + + + + SAVE_WORKSPACE_DATA + Sauvegarder les données de l'espace de travail + + + + NOT_IMPLEMENTED_YET + Non implémenté + + + + FUNCTION_NOT_IMPLEMENTED + Cette function n'est pas encore implémentée + + + + @default + + + + + + + FILE_FILTER_MED + Fichiers MED (*.med) + + + + FILE_FILTER_PNG + Image PNG (*.png) + + + + FILE_FILTER_JPG + Image JPG (*.jpg) + + + + FILE_FILTER_PGM + Image PGM (*.jpg) + + + + FILE_FILTER_ALL + Tous les fichiers (*.*) + + + diff --git a/src/MEDOP/gui/Makefile.am b/src/MEDOP/gui/Makefile.am index 1d7e311d1..ca3aeb265 100644 --- a/src/MEDOP/gui/Makefile.am +++ b/src/MEDOP/gui/Makefile.am @@ -37,7 +37,7 @@ SUBDIRS = dialogs %.qm: %.ts $(LRELEASE) $< -qm $@ -EXTRA_DIST+=$(MOC_FILES:%_moc.cxx=%.hxx) $(nodist_salomeres_DATA:%.qm=%.ts) test +EXTRA_DIST+=$(MOC_FILES:%_moc.cxx=%.hxx) $(dist_salomeres_DATA:%.qm=%.ts) test mostlyclean-local: rm -f @builddir@/*_moc.cxx @@ -115,11 +115,12 @@ libMEDOPGUI_la_LIBADD = \ ../cmp/libMEDOPFactoryEngine.la if WITH_MEDMEMGUI -libMEDOPGUI_la_CPPFLAGS += "-D__WITH_MEDMEMGUI__" -I$(top_srcdir)/src/MEDGUI -libMEDOPGUI_la_LIBADD += $(top_builddir)/src/MEDGUI/libMEDGUI.la + libMEDOPGUI_la_CPPFLAGS += "-D__WITH_MEDMEMGUI__" -I$(top_srcdir)/src/MEDGUI + libMEDOPGUI_la_LIBADD += $(top_builddir)/src/MEDGUI/libMEDGUI.la endif # resources files -nodist_salomeres_DATA = \ - MEDOP_msg_en.qm \ - MEDOP_msg_fr.qm +dist_salomeres_DATA = \ + MED_images.qm \ + MED_msg_en.qm \ + MED_msg_fr.qm diff --git a/src/MEDOP/gui/WorkspaceController.cxx b/src/MEDOP/gui/WorkspaceController.cxx index cf3fe99c0..ab48d85a9 100644 --- a/src/MEDOP/gui/WorkspaceController.cxx +++ b/src/MEDOP/gui/WorkspaceController.cxx @@ -17,7 +17,7 @@ // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // -// Author : Guillaume Boulant (EDF) +// Author : Guillaume Boulant (EDF) #include "WorkspaceController.hxx" #include "QtHelper.hxx" @@ -64,7 +64,7 @@ WorkspaceController::WorkspaceController(StandardApp_Module * salomeModule) // console that could retrieve this IOR using the // getEventListenerIOR() function of the MEDDataManager. SalomeApp_Application * salomeApp = salomeModule->getApp(); - const char * medEventListenerIOR = + const char * medEventListenerIOR = salomeApp->orb()->object_to_string(medEventListenerServant); MEDOPFactoryClient::getDataManager()->setEventListenerIOR(medEventListenerIOR); @@ -81,12 +81,12 @@ WorkspaceController::WorkspaceController(StandardApp_Module * salomeModule) // Customize the treeview rendering the datamodel with specific // action for the popup menu this->getDataTreeView()->clearActions(); - _actionIds.display = this->getDataTreeView()->addAction(QObject::tr("Visualiser (une carte scalaire)")); - _actionIds.useInTui = this->getDataTreeView()->addAction(QObject::tr("Utiliser (dans la console)")); - _actionIds.exportToPv = this->getDataTreeView()->addAction(QObject::tr("Exporter (vers PARAVIS)")); - _actionIds.save = this->getDataTreeView()->addAction(QObject::tr("Sauvegarder (dans un fichier med)")); - _actionIds.remove = this->getDataTreeView()->addAction(QObject::tr("Supprimer (de lespace de travail)")); - + _actionIds.display = this->getDataTreeView()->addAction(tr("VISUALIZE_SCALAR_MAP")); + _actionIds.useInTui = this->getDataTreeView()->addAction(tr("USE_IN_CONSOLE")); + _actionIds.exportToPv = this->getDataTreeView()->addAction(tr("EXPORT_TO_PARAVIS")); + _actionIds.save = this->getDataTreeView()->addAction(tr("SAVE_AS_MED")); + _actionIds.remove = this->getDataTreeView()->addAction(tr("REMOVE_FROM_WORKSPACE")); + // ------------------------------------------------------------- // Initialize the python console. Note that this must be done at // last because the setup will try to initiate a connection to the @@ -96,25 +96,25 @@ WorkspaceController::WorkspaceController(StandardApp_Module * salomeModule) } WorkspaceController::~WorkspaceController() { - MEDEventListener_i::release(); + MEDEventListener_i::release(); } /** * This creates the GUI actions for driving the Workspace. The * WorkspaceController creates itself this actions and implements the - * connected slots. + * connected slots. */ void WorkspaceController::createActions() { - QString label = QString("Save workspace"); - QString tooltip = QString("Save the workspace (fields and meshes) in a med file"); - QString icon = QString("workspace_save.png"); + QString label = tr("LAB_SAVE_WORKSPACE"); + QString tooltip = tr("TIP_SAVE_WORKSPACE"); + QString icon = tr("ICO_WORKSPACE_SAVE"); int actionId = _salomeModule->createStandardAction(label,this,SLOT(OnSaveWorkspace()),icon,tooltip); _salomeModule->addActionInToolbar(actionId); - label = QString("Clean workspace"); - tooltip = QString("Clean all data in the workspace"); - icon = QString("workspace_clean.png"); + label = tr("LAB_CLEAN_WORKSPACE"); + tooltip = tr("TIP_CLEAN_WORKSPACE"); + icon = tr("ICO_WORKSPACE_CLEAN"); actionId = _salomeModule->createStandardAction(label,this,SLOT(OnCleanWorkspace()),icon,tooltip); _salomeModule->addActionInToolbar(actionId); } @@ -177,18 +177,18 @@ void WorkspaceController::_importItem(QString itemNameId) { // to this item (iteNameId is a TreeView id, Qt stuff only). XmedDataObject * dataObject = (XmedDataObject *)dataModel->getDataObject(QS2S(itemNameId)); - + if ( dataObject == NULL ) { LOG("WorkspaceController: WARN! No data object associated to the item "<getFieldHandler(); STDLOG("Field: mesh="<meshname<<" name="<fieldname); - - // Finally, we can import the field + + // Finally, we can import the field bool askForOptions = true; _importFieldIntoConsole(fieldHandler, askForOptions); } @@ -198,7 +198,7 @@ void WorkspaceController::_importItem(QString itemNameId) { * means to define a field proxy variable in the python context to * manipulate the field. We can raise a gui to specify some import * options or simply specify the alias (i.e. the name of the python - * variable). + * variable). */ void WorkspaceController::_importFieldIntoConsole(MEDOP::FieldHandler * fieldHandler, bool askForOptions, @@ -217,7 +217,7 @@ void WorkspaceController::_importFieldIntoConsole(MEDOP::FieldHandler * fieldHan // We can propose to the user to specify some additionnal // informations concerning what must be imported. - // + // // In this version, we just ask the alias the field will be // manipulated with. The default alias is the field name. This alias // should be asked to the user to get a short name to manipulate. @@ -258,12 +258,12 @@ void WorkspaceController::processMedEvent(const MEDOP::MedEvent * event) { STDLOG("No data model associated to this tree view"); return; } - + if ( event->type == MEDOP::EVENT_ADDNEW_FIELD ) { STDLOG("add new field"); MEDOP::FieldHandler * fieldHandler = MEDOPFactoryClient::getDataManager()->getFieldHandler(event->fieldid); - + XmedDataObject * dataObject = (XmedDataObject *)dataModel->newDataObject(); dataObject->setFieldHandler(*fieldHandler); this->getDataTreeModel()->addData(dataObject); @@ -273,7 +273,7 @@ void WorkspaceController::processMedEvent(const MEDOP::MedEvent * event) { /*! * This function save a list of fields in a med file. The med file - * name is requested to the user using a file chooser dialog box + * name is requested to the user using a file chooser dialog box */ void WorkspaceController::_saveItemList(QStringList itemNameIdList) { XmedDataProcessor * dataProcessor = new XmedDataProcessor(this->getDataModel()); @@ -282,11 +282,11 @@ void WorkspaceController::_saveItemList(QStringList itemNameIdList) { delete dataProcessor; QStringList filter; - filter.append(QObject::tr("MED files (*.med)")); + filter.append(tr("FILE_FILTER_MED")); QString filename = SUIT_FileDlg::getFileName(_salomeModule->getApp()->desktop(), "", filter, - QObject::tr("Save selected fields"), + tr("SAVE_SELECTED_FIELDS"), false); if ( filename.isEmpty() ) return; @@ -298,7 +298,7 @@ void WorkspaceController::_saveItemList(QStringList itemNameIdList) { * This function export the list of specified field item to PARAVIS * module. This consists in create a med file gathering the selected * items, then to import this file in PARAVIS, and finally to create a - * scalar map of the first item to start the job. + * scalar map of the first item to start the job. */ void WorkspaceController::_exportItemList(QStringList itemNameIdList) { XmedDataProcessor * dataProcessor = new XmedDataProcessor(this->getDataModel()); @@ -344,7 +344,7 @@ void WorkspaceController::_exportItemList(QStringList itemNameIdList) { * This function sends a request to the SALOME data visualisation * (module VISU or PARAVIS) for displaying a scalar map of the fields * associated to the model items in the specified list. - * + * */ void WorkspaceController::_viewItemList(QStringList itemNameIdList) { @@ -365,7 +365,7 @@ void WorkspaceController::_viewItemList(QStringList itemNameIdList) { LOG("WorkspaceController: WARN! No data object associated to the item "<getFieldHandler(); @@ -388,14 +388,14 @@ void WorkspaceController::processDatasourceEvent(const DatasourceEvent * event) STDLOG("No data model associated to this tree view"); return; } - + // >>> // __GBO__ To know what to do we should test the type, because the // object could be a mesh, a timeseries or a single field. We test // here the case of a single field. Moreover, there could have // options such that "change the underlying mesh". // <<< - + XmedDataObject * dataObject = event->objectdata; if ( event->eventtype == DatasourceEvent::EVENT_IMPORT_OBJECT ) { @@ -435,12 +435,12 @@ void WorkspaceController::OnSaveWorkspace() { // Dialog to get the filename where the workspace must be saved into QStringList filter; - filter.append(QObject::tr("MED files (*.med)")); + filter.append(tr("FILE_FILTER_MED")); QString filename = SUIT_FileDlg::getFileName(_salomeModule->getApp()->desktop(), "", filter, - QObject::tr("Save workspace data"), + tr("SAVE_WORKSPACE_DATA"), false); if ( filename.isEmpty() ) return; @@ -454,6 +454,6 @@ void WorkspaceController::OnSaveWorkspace() { #include void WorkspaceController::OnCleanWorkspace() { QMessageBox::warning(_salomeModule->getApp()->desktop(), - tr("Not implemented yet"), - tr("This function is not implemented yet")); + tr("NOT_IMPLEMENTED_YET"), + tr("FUNCTION_NOT_IMPLEMENTED")); } diff --git a/src/MEDOP/gui/dialogs/DlgAlias.ui b/src/MEDOP/gui/dialogs/DlgAlias.ui index 595c08e77..b52d95c60 100644 --- a/src/MEDOP/gui/dialogs/DlgAlias.ui +++ b/src/MEDOP/gui/dialogs/DlgAlias.ui @@ -11,7 +11,7 @@ - Sélection d'un alias pour le champ + SELECT_AN_ALIAS_FOR_THE_FIELD @@ -398,7 +398,7 @@ - Vous pouvez définir un alias pour manipuler le champ dans la console: + DEFINE_AN_ALIAS true @@ -416,7 +416,7 @@ - Alias + ALIAS @@ -433,7 +433,7 @@ - (cette operation définit une variable de nom <alias> dans la console TUI. Tapez "<alias>.help()" pour voir les fonctions à disposition, ou tou simplement "doc") + MSG_OPERATION_DEFINES_VARIABLE true diff --git a/src/MEDOP/gui/dialogs/DlgChangeUnderlyingMesh.ui b/src/MEDOP/gui/dialogs/DlgChangeUnderlyingMesh.ui index 2bd44ef51..cad5ce3cb 100644 --- a/src/MEDOP/gui/dialogs/DlgChangeUnderlyingMesh.ui +++ b/src/MEDOP/gui/dialogs/DlgChangeUnderlyingMesh.ui @@ -11,7 +11,7 @@ - Form + FORM @@ -388,7 +388,7 @@ - Sélectionnez un maillage dans l'explorateur: + SELECT_MESH true @@ -400,7 +400,7 @@ - Maillage -> + MESH_GT @@ -417,7 +417,7 @@ - (L'explorateur donne une vue des sources de données med (maillage et champs) référencés dans l'espace de données) + MSG_EXPLORER true diff --git a/src/MEDOP/gui/dialogs/DlgImageToMed.cxx b/src/MEDOP/gui/dialogs/DlgImageToMed.cxx index ba5880106..f47db649a 100644 --- a/src/MEDOP/gui/dialogs/DlgImageToMed.cxx +++ b/src/MEDOP/gui/dialogs/DlgImageToMed.cxx @@ -12,9 +12,9 @@ DlgImageToMed::DlgImageToMed(QDialog *parent) : GenericDialog(parent) { ui.setupUi(this->getPanel()); - + QString moduleName = "MED"; - QPixmap aPixmap = GUI::getResourcesManager()->loadPixmap( moduleName, "folder.png" ); + QPixmap aPixmap = GUI::getResourcesManager()->loadPixmap( moduleName, tr("ICO_FOLDER") ); QIcon icon(aPixmap); ui.btnImageFileChooser->setIcon(icon); ui.btnMedFileChooser->setIcon(icon); @@ -40,7 +40,7 @@ void DlgImageToMed::setAutoLoaded(bool autoloaded) { ui.chkAutoLoad->setCheckState(Qt::Checked); } else { - ui.chkAutoLoad->setCheckState(Qt::Unchecked); + ui.chkAutoLoad->setCheckState(Qt::Unchecked); } } @@ -54,14 +54,14 @@ bool DlgImageToMed::isAutoLoaded() { void DlgImageToMed::OnBtnImageFileChooser() { QStringList filter; - filter.append(QObject::tr("Image files (*.png)")); - filter.append(QObject::tr("Image files (*.jpg)")); - filter.append(QObject::tr("Image files (*.pgm)")); - filter.append(QObject::tr("All files (*.*)")); + filter.append(tr("FILE_FILTER_PNG")); + filter.append(tr("FILE_FILTER_JPG")); + filter.append(tr("FILE_FILTER_PGM")); + filter.append(tr("FILE_FILTER_ALL")); QString filename = SUIT_FileDlg::getFileName(ui.btnImageFileChooser, "", filter, - QObject::tr("Select image file"), + tr("SELECT_IMAGE_FILE"), true); if ( filename.isEmpty() ) return; ui.txtImageFile->setText(filename); @@ -72,11 +72,11 @@ void DlgImageToMed::OnBtnImageFileChooser() { void DlgImageToMed::OnBtnMedFileChooser() { QStringList filter; - filter.append(QObject::tr("MED files (*.med)")); + filter.append(tr("FILE_FILTER_MED")); QString filename = SUIT_FileDlg::getFileName(ui.btnMedFileChooser, "", filter, - QObject::tr("Specify a MED file"), + tr("SPECIFY_MED_FILE"), true); if ( filename.isEmpty() ) return; ui.txtMedFile->setText(filename); diff --git a/src/MEDOP/gui/dialogs/DlgImageToMed.ui b/src/MEDOP/gui/dialogs/DlgImageToMed.ui index 490b5bd2e..d51feab72 100644 --- a/src/MEDOP/gui/dialogs/DlgImageToMed.ui +++ b/src/MEDOP/gui/dialogs/DlgImageToMed.ui @@ -11,7 +11,7 @@ - Form + FORM @@ -25,14 +25,14 @@ - Fichier Image: + IMAGE_FILE - Fichier MED: + MED_FILE @@ -79,7 +79,7 @@ - Charger automatiquement + LOAD_AUTOMATICALLY diff --git a/src/MEDOP/gui/dialogs/DlgUseInWorkspace.ui b/src/MEDOP/gui/dialogs/DlgUseInWorkspace.ui index 73c22d49c..7e02f9f03 100644 --- a/src/MEDOP/gui/dialogs/DlgUseInWorkspace.ui +++ b/src/MEDOP/gui/dialogs/DlgUseInWorkspace.ui @@ -10,7 +10,7 @@ - Form + FORM @@ -46,14 +46,14 @@ - Pression : + PRESSURE - Température : + TEMPERATURE diff --git a/src/MEDOP/gui/dialogs/GenericDialog.ui b/src/MEDOP/gui/dialogs/GenericDialog.ui index 1fe7ae99e..c18fc4a69 100644 --- a/src/MEDOP/gui/dialogs/GenericDialog.ui +++ b/src/MEDOP/gui/dialogs/GenericDialog.ui @@ -10,7 +10,7 @@ - Dialog + DIALOG