mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#4819 Minor review tweaks.
This commit is contained in:
parent
bd804ee821
commit
610535aecc
@ -19,8 +19,11 @@
|
||||
|
||||
#include "RiaGuiApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RicExportContourMapToTextUi.h"
|
||||
|
||||
#include "RifTextDataTableFormatter.h"
|
||||
|
||||
#include "RimContourMapProjection.h"
|
||||
#include "RimEclipseContourMapProjection.h"
|
||||
#include "RimEclipseContourMapView.h"
|
||||
@ -91,12 +94,9 @@ void RicExportContourMapToTextFeature::onActionTriggered( bool isChecked )
|
||||
|
||||
RiaGuiApplication* app = RiaGuiApplication::instance();
|
||||
CAF_ASSERT( app && "Must be gui mode" );
|
||||
|
||||
QString startPath = app->lastUsedDialogDirectoryWithFallbackToProjectFolder( "CONTOUR_EXPORT" );
|
||||
|
||||
QString startPath = app->lastUsedDialogDirectoryWithFallbackToProjectFolder( "CONTOUR_EXPORT" );
|
||||
QString fileBaseName = caf::Utils::makeValidFileBasename( contourMapName );
|
||||
|
||||
startPath = startPath + "/" + fileBaseName + ".txt";
|
||||
startPath = startPath + "/" + fileBaseName + ".txt";
|
||||
|
||||
RicExportContourMapToTextUi featureUi;
|
||||
featureUi.setExportFileName( startPath );
|
||||
@ -220,6 +220,9 @@ void RicExportContourMapToTextFeature::setupActionLook( QAction* actionToSetup )
|
||||
actionToSetup->setText( "Export Contour Map to Text" );
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicfCommandResponse RicExportContourMapToTextFeature::execute()
|
||||
{
|
||||
RicfCommandResponse response;
|
||||
@ -242,6 +245,12 @@ RicfCommandResponse RicExportContourMapToTextFeature::execute()
|
||||
}
|
||||
}
|
||||
|
||||
if ( !myView )
|
||||
{
|
||||
response.updateStatus( RicfCommandResponse::COMMAND_ERROR, "No contour map view found" );
|
||||
return response;
|
||||
}
|
||||
|
||||
RimContourMapProjection* contourMapProjection = nullptr;
|
||||
RimEclipseContourMapView* existingEclipseContourMap = dynamic_cast<RimEclipseContourMapView*>( myView );
|
||||
RimGeoMechContourMapView* existingGeoMechContourMap = dynamic_cast<RimGeoMechContourMapView*>( myView );
|
||||
|
@ -37,9 +37,9 @@ public:
|
||||
RicfCommandResponse execute() override;
|
||||
|
||||
protected:
|
||||
// Overrides
|
||||
bool isCommandEnabled() override;
|
||||
void onActionTriggered( bool isChecked ) override;
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
|
||||
static void writeMetaDataToStream( QTextStream& stream,
|
||||
const RimContourMapProjection* contourMapProjection,
|
||||
@ -52,8 +52,6 @@ protected:
|
||||
const QString& undefinedValueLabel,
|
||||
bool excludeUndefinedValues );
|
||||
|
||||
void setupActionLook( QAction* actionToSetup ) override;
|
||||
|
||||
private:
|
||||
caf::PdmField<QString> m_exportFileName;
|
||||
caf::PdmField<bool> m_exportLocalCoordinates;
|
||||
|
@ -6,6 +6,9 @@
|
||||
|
||||
CAF_PDM_SOURCE_INIT( RicExportContourMapToTextUi, "RicExportContourMapToTextUi" );
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RicExportContourMapToTextUi::RicExportContourMapToTextUi()
|
||||
{
|
||||
CAF_PDM_InitObject( "Export Contour Map to Text", "", "", "" );
|
||||
|
Loading…
Reference in New Issue
Block a user