From bd804ee82197f66e83daada8c48861a609a13a1b Mon Sep 17 00:00:00 2001 From: Kristian Bendiksen Date: Tue, 22 Oct 2019 10:36:23 +0200 Subject: [PATCH] #4819 #4820 Rename action to avoid confusing user with ascii. Command menu item is now "Export Contour Map to Text". Also update file names to match. --- .../Commands/CMakeLists_files.cmake | 8 ++-- ...p => RicExportContourMapToTextFeature.cpp} | 42 +++++++++---------- ...e.h => RicExportContourMapToTextFeature.h} | 4 +- ...Ui.cpp => RicExportContourMapToTextUi.cpp} | 22 +++++----- ...sciiUi.h => RicExportContourMapToTextUi.h} | 4 +- .../RimContextCommandBuilder.cpp | 4 +- 6 files changed, 42 insertions(+), 42 deletions(-) rename ApplicationCode/Commands/{RicExportContourMapToAsciiFeature.cpp => RicExportContourMapToTextFeature.cpp} (87%) rename ApplicationCode/Commands/{RicExportContourMapToAsciiFeature.h => RicExportContourMapToTextFeature.h} (94%) rename ApplicationCode/Commands/{RicExportContourMapToAsciiUi.cpp => RicExportContourMapToTextUi.cpp} (74%) rename ApplicationCode/Commands/{RicExportContourMapToAsciiUi.h => RicExportContourMapToTextUi.h} (94%) diff --git a/ApplicationCode/Commands/CMakeLists_files.cmake b/ApplicationCode/Commands/CMakeLists_files.cmake index a766ef0381..ec638e9743 100644 --- a/ApplicationCode/Commands/CMakeLists_files.cmake +++ b/ApplicationCode/Commands/CMakeLists_files.cmake @@ -81,8 +81,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.h ${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.h ${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToAsciiFeature.h -${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToAsciiUi.h +${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextFeature.h +${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextUi.h ) @@ -162,8 +162,8 @@ ${CMAKE_CURRENT_LIST_DIR}/RicConvertGroupToEnsembleFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicResampleDialog.cpp ${CMAKE_CURRENT_LIST_DIR}/RicCreateTemporaryLgrFeature.cpp ${CMAKE_CURRENT_LIST_DIR}/RicDeleteTemporaryLgrsFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToAsciiFeature.cpp -${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToAsciiUi.cpp +${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextFeature.cpp +${CMAKE_CURRENT_LIST_DIR}/RicExportContourMapToTextUi.cpp ) diff --git a/ApplicationCode/Commands/RicExportContourMapToAsciiFeature.cpp b/ApplicationCode/Commands/RicExportContourMapToTextFeature.cpp similarity index 87% rename from ApplicationCode/Commands/RicExportContourMapToAsciiFeature.cpp rename to ApplicationCode/Commands/RicExportContourMapToTextFeature.cpp index 99be6e4f67..1e6fac1c49 100644 --- a/ApplicationCode/Commands/RicExportContourMapToAsciiFeature.cpp +++ b/ApplicationCode/Commands/RicExportContourMapToTextFeature.cpp @@ -15,11 +15,11 @@ // for more details. // ///////////////////////////////////////////////////////////////////////////////// -#include "RicExportContourMapToAsciiFeature.h" +#include "RicExportContourMapToTextFeature.h" #include "RiaGuiApplication.h" #include "RiaLogging.h" -#include "RicExportContourMapToAsciiUi.h" +#include "RicExportContourMapToTextUi.h" #include "RifTextDataTableFormatter.h" #include "RimContourMapProjection.h" #include "RimEclipseContourMapProjection.h" @@ -38,9 +38,9 @@ #include -RICF_SOURCE_INIT( RicExportContourMapToAsciiFeature, "RicExportContourMapToAsciiFeature", "exportContourMapToText" ); +RICF_SOURCE_INIT( RicExportContourMapToTextFeature, "RicExportContourMapToTextFeature", "exportContourMapToText" ); -RicExportContourMapToAsciiFeature::RicExportContourMapToAsciiFeature() +RicExportContourMapToTextFeature::RicExportContourMapToTextFeature() { RICF_InitFieldNoDefault( &m_exportFileName, "exportFileName", "", "", "", "" ); RICF_InitFieldNoDefault( &m_exportLocalCoordinates, "exportLocalCoordinates", "", "", "", "" ); @@ -52,7 +52,7 @@ RicExportContourMapToAsciiFeature::RicExportContourMapToAsciiFeature() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RicExportContourMapToAsciiFeature::isCommandEnabled() +bool RicExportContourMapToTextFeature::isCommandEnabled() { RimEclipseContourMapView* existingEclipseContourMap = caf::SelectionManager::instance() ->selectedItemOfType(); @@ -64,7 +64,7 @@ bool RicExportContourMapToAsciiFeature::isCommandEnabled() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicExportContourMapToAsciiFeature::onActionTriggered( bool isChecked ) +void RicExportContourMapToTextFeature::onActionTriggered( bool isChecked ) { RimContourMapProjection* contourMapProjection = nullptr; RimEclipseContourMapView* existingEclipseContourMap = caf::SelectionManager::instance() @@ -98,12 +98,12 @@ void RicExportContourMapToAsciiFeature::onActionTriggered( bool isChecked ) startPath = startPath + "/" + fileBaseName + ".txt"; - RicExportContourMapToAsciiUi featureUi; + RicExportContourMapToTextUi featureUi; featureUi.setExportFileName( startPath ); caf::PdmUiPropertyViewDialog propertyDialog( nullptr, &featureUi, - "Export Contour Map as Text", + "Export Contour Map to Text", "", QDialogButtonBox::Ok | QDialogButtonBox::Cancel ); @@ -138,10 +138,10 @@ void RicExportContourMapToAsciiFeature::onActionTriggered( bool isChecked ) //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicExportContourMapToAsciiFeature::writeMetaDataToStream( QTextStream& stream, - const RimContourMapProjection* contourMapProjection, - const QString& caseName, - bool exportLocalCoordinates ) +void RicExportContourMapToTextFeature::writeMetaDataToStream( QTextStream& stream, + const RimContourMapProjection* contourMapProjection, + const QString& caseName, + bool exportLocalCoordinates ) { cvf::Vec2ui numVerticesIJ = contourMapProjection->numberOfVerticesIJ(); stream << "# case name : " << contourMapProjection->caseName() << "\n"; @@ -159,11 +159,11 @@ void RicExportContourMapToAsciiFeature::writeMetaDataToStream( QTextStream& //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicExportContourMapToAsciiFeature::writeContourMapToStream( QTextStream& stream, - const RimContourMapProjection* contourMapProjection, - bool exportLocalCoordinates, - const QString& undefinedValueLabel, - bool excludeUndefinedValues ) +void RicExportContourMapToTextFeature::writeContourMapToStream( QTextStream& stream, + const RimContourMapProjection* contourMapProjection, + bool exportLocalCoordinates, + const QString& undefinedValueLabel, + bool excludeUndefinedValues ) { RifTextDataTableFormatter formatter( stream ); formatter.setTableRowLineAppendText( "" ); @@ -215,12 +215,12 @@ void RicExportContourMapToAsciiFeature::writeContourMapToStream( QTextStream& //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicExportContourMapToAsciiFeature::setupActionLook( QAction* actionToSetup ) +void RicExportContourMapToTextFeature::setupActionLook( QAction* actionToSetup ) { - actionToSetup->setText( "Export Contour Map to Ascii" ); + actionToSetup->setText( "Export Contour Map to Text" ); } -RicfCommandResponse RicExportContourMapToAsciiFeature::execute() +RicfCommandResponse RicExportContourMapToTextFeature::execute() { RicfCommandResponse response; QStringList errorMessages, warningMessages; @@ -264,7 +264,7 @@ RicfCommandResponse RicExportContourMapToAsciiFeature::execute() QFile exportFile( m_exportFileName ); if ( !exportFile.open( QIODevice::WriteOnly | QIODevice::Text ) ) { - errorMessages << QString( "Export Contour Map as Text : Could not open the file: %1" ).arg( m_exportFileName ); + errorMessages << QString( "Export Contour Map to Text : Could not open the file: %1" ).arg( m_exportFileName ); } else { diff --git a/ApplicationCode/Commands/RicExportContourMapToAsciiFeature.h b/ApplicationCode/Commands/RicExportContourMapToTextFeature.h similarity index 94% rename from ApplicationCode/Commands/RicExportContourMapToAsciiFeature.h rename to ApplicationCode/Commands/RicExportContourMapToTextFeature.h index 2a7d7ba448..fb861b0751 100644 --- a/ApplicationCode/Commands/RicExportContourMapToAsciiFeature.h +++ b/ApplicationCode/Commands/RicExportContourMapToTextFeature.h @@ -28,12 +28,12 @@ class QTextStream; //================================================================================================== /// //================================================================================================== -class RicExportContourMapToAsciiFeature : public caf::CmdFeature, public RicfCommandObject +class RicExportContourMapToTextFeature : public caf::CmdFeature, public RicfCommandObject { RICF_HEADER_INIT; public: - RicExportContourMapToAsciiFeature(); + RicExportContourMapToTextFeature(); RicfCommandResponse execute() override; protected: diff --git a/ApplicationCode/Commands/RicExportContourMapToAsciiUi.cpp b/ApplicationCode/Commands/RicExportContourMapToTextUi.cpp similarity index 74% rename from ApplicationCode/Commands/RicExportContourMapToAsciiUi.cpp rename to ApplicationCode/Commands/RicExportContourMapToTextUi.cpp index 4d0a393381..9c43e007b8 100644 --- a/ApplicationCode/Commands/RicExportContourMapToAsciiUi.cpp +++ b/ApplicationCode/Commands/RicExportContourMapToTextUi.cpp @@ -1,12 +1,12 @@ -#include "RicExportContourMapToAsciiUi.h" +#include "RicExportContourMapToTextUi.h" #include "RiaApplication.h" #include "cafPdmUiFilePathEditor.h" -CAF_PDM_SOURCE_INIT( RicExportContourMapToAsciiUi, "RicExportContourMapToAsciiUi" ); +CAF_PDM_SOURCE_INIT( RicExportContourMapToTextUi, "RicExportContourMapToTextUi" ); -RicExportContourMapToAsciiUi::RicExportContourMapToAsciiUi() +RicExportContourMapToTextUi::RicExportContourMapToTextUi() { CAF_PDM_InitObject( "Export Contour Map to Text", "", "", "" ); @@ -21,7 +21,7 @@ RicExportContourMapToAsciiUi::RicExportContourMapToAsciiUi() //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString RicExportContourMapToAsciiUi::exportFileName() const +QString RicExportContourMapToTextUi::exportFileName() const { return m_exportFileName; } @@ -29,7 +29,7 @@ QString RicExportContourMapToAsciiUi::exportFileName() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicExportContourMapToAsciiUi::setExportFileName( const QString& exportFileName ) +void RicExportContourMapToTextUi::setExportFileName( const QString& exportFileName ) { m_exportFileName = exportFileName; } @@ -37,7 +37,7 @@ void RicExportContourMapToAsciiUi::setExportFileName( const QString& exportFileN //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RicExportContourMapToAsciiUi::exportLocalCoordinates() const +bool RicExportContourMapToTextUi::exportLocalCoordinates() const { return m_exportLocalCoordinates; } @@ -45,7 +45,7 @@ bool RicExportContourMapToAsciiUi::exportLocalCoordinates() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -QString RicExportContourMapToAsciiUi::undefinedValueLabel() const +QString RicExportContourMapToTextUi::undefinedValueLabel() const { return m_undefinedValueLabel; } @@ -53,7 +53,7 @@ QString RicExportContourMapToAsciiUi::undefinedValueLabel() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -bool RicExportContourMapToAsciiUi::excludeUndefinedValues() const +bool RicExportContourMapToTextUi::excludeUndefinedValues() const { return m_excludeUndefinedValues; } @@ -61,9 +61,9 @@ bool RicExportContourMapToAsciiUi::excludeUndefinedValues() const //-------------------------------------------------------------------------------------------------- /// //-------------------------------------------------------------------------------------------------- -void RicExportContourMapToAsciiUi::defineEditorAttribute( const caf::PdmFieldHandle* field, - QString uiConfigName, - caf::PdmUiEditorAttribute* attribute ) +void RicExportContourMapToTextUi::defineEditorAttribute( const caf::PdmFieldHandle* field, + QString uiConfigName, + caf::PdmUiEditorAttribute* attribute ) { if ( field == &m_exportFileName ) { diff --git a/ApplicationCode/Commands/RicExportContourMapToAsciiUi.h b/ApplicationCode/Commands/RicExportContourMapToTextUi.h similarity index 94% rename from ApplicationCode/Commands/RicExportContourMapToAsciiUi.h rename to ApplicationCode/Commands/RicExportContourMapToTextUi.h index 3715a98ad0..02c7d49471 100644 --- a/ApplicationCode/Commands/RicExportContourMapToAsciiUi.h +++ b/ApplicationCode/Commands/RicExportContourMapToTextUi.h @@ -24,12 +24,12 @@ //================================================================================================== /// //================================================================================================== -class RicExportContourMapToAsciiUi : public caf::PdmObject +class RicExportContourMapToTextUi : public caf::PdmObject { CAF_PDM_HEADER_INIT; public: - RicExportContourMapToAsciiUi(); + RicExportContourMapToTextUi(); QString exportFileName() const; void setExportFileName( const QString& exportFileName ); diff --git a/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp b/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp index 81f3f63c63..3dd174a72a 100644 --- a/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp +++ b/ApplicationCode/ProjectDataModel/RimContextCommandBuilder.cpp @@ -176,7 +176,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() menuBuilder << "Separator"; menuBuilder << "RicCopyReferencesToClipboardFeature"; - menuBuilder << "RicExportContourMapToAsciiFeature"; + menuBuilder << "RicExportContourMapToTextFeature"; } else if ( dynamic_cast( uiItem ) ) { @@ -189,7 +189,7 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection() menuBuilder << "Separator"; menuBuilder << "RicCopyReferencesToClipboardFeature"; menuBuilder << "RicExportEclipseInputGridFeature"; - menuBuilder << "RicExportContourMapToAsciiFeature"; + menuBuilder << "RicExportContourMapToTextFeature"; menuBuilder << "RicSaveEclipseInputVisibleCellsFeature"; } else if ( dynamic_cast( uiItem ) )