mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#1668 Use "Export" instead of "OK" in export dialogs
This commit is contained in:
parent
286ec08b05
commit
70d3c501a4
@ -36,6 +36,8 @@ ${CEE_CURRENT_LIST_DIR}RicImportSummaryCaseFeature.h
|
||||
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFaultsFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicExportMultipleSnapshotsFeature.h
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFeatureImpl.h
|
||||
|
||||
|
||||
|
||||
# General delete of any object in a child array field
|
||||
@ -79,6 +81,8 @@ ${CEE_CURRENT_LIST_DIR}RicImportSummaryCaseFeature.cpp
|
||||
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFaultsFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicExportMultipleSnapshotsFeature.cpp
|
||||
${CEE_CURRENT_LIST_DIR}RicExportFeatureImpl.cpp
|
||||
|
||||
|
||||
# General delete of any object in a child array field
|
||||
${CEE_CURRENT_LIST_DIR}RicDeleteItemExec.cpp
|
||||
|
@ -21,6 +21,8 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RicExportFeatureImpl.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimFishboneWellPathCollection.h"
|
||||
#include "RimFishbonesCollection.h"
|
||||
@ -77,6 +79,8 @@ void RicExportFishbonesWellSegmentsFeature::onActionTriggered(bool isChecked)
|
||||
exportSettings.folder = defaultDir;
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), &exportSettings, "Export Well Segments", "");
|
||||
RicExportFeatureImpl::configureForExport(&propertyDialog);
|
||||
|
||||
if (propertyDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
RiaApplication::instance()->setLastUsedDialogDirectory("COMPLETIONS", QFileInfo(exportSettings.folder).absolutePath());
|
||||
|
@ -21,40 +21,41 @@
|
||||
#include "RiaApplication.h"
|
||||
#include "RiaLogging.h"
|
||||
|
||||
#include "RimProject.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
#include "RimFishbonesCollection.h"
|
||||
#include "RicExportCompletionDataSettingsUi.h"
|
||||
#include "RicExportFeatureImpl.h"
|
||||
#include "RicFishbonesTransmissibilityCalculationFeatureImp.h"
|
||||
|
||||
#include "RigActiveCellInfo.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
#include "RigTransmissibilityEquations.h"
|
||||
#include "RigWellLogExtractionTools.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "RigWellPathIntersectionTools.h"
|
||||
|
||||
#include "RimFishboneWellPath.h"
|
||||
#include "RimFishboneWellPathCollection.h"
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimFishbonesCollection.h"
|
||||
#include "RimFishbonesMultipleSubs.h"
|
||||
#include "RimPerforationCollection.h"
|
||||
#include "RimPerforationInterval.h"
|
||||
#include "RimProject.h"
|
||||
#include "RimReservoirCellResultsStorage.h"
|
||||
#include "RimWellPath.h"
|
||||
#include "RimWellPathCollection.h"
|
||||
#include "RimWellPathCompletions.h"
|
||||
|
||||
#include "RicExportCompletionDataSettingsUi.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "RigWellLogExtractionTools.h"
|
||||
#include "RigWellPathIntersectionTools.h"
|
||||
#include "RigEclipseCaseData.h"
|
||||
#include "RigMainGrid.h"
|
||||
#include "RigWellPath.h"
|
||||
#include "RigResultAccessorFactory.h"
|
||||
#include "RigTransmissibilityEquations.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include "cvfPlane.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QFileDialog>
|
||||
#include <QMessageBox>
|
||||
#include "RicFishbonesTransmissibilityCalculationFeatureImp.h"
|
||||
#include "RigActiveCellInfo.h"
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicWellPathExportCompletionDataFeature, "RicWellPathExportCompletionDataFeature");
|
||||
|
||||
@ -98,6 +99,8 @@ void RicWellPathExportCompletionDataFeature::onActionTriggered(bool isChecked)
|
||||
exportSettings.folder = defaultDir;
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), &exportSettings, "Export Completion Data", "");
|
||||
RicExportFeatureImpl::configureForExport(&propertyDialog);
|
||||
|
||||
if (propertyDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
RiaApplication::instance()->setLastUsedDialogDirectory("COMPLETIONS", exportSettings.folder);
|
||||
|
@ -19,22 +19,25 @@
|
||||
|
||||
#include "RicSaveEclipseInputPropertyFeature.h"
|
||||
|
||||
#include "RimEclipseInputProperty.h"
|
||||
#include "RimEclipseInputPropertyCollection.h"
|
||||
#include "RimExportInputPropertySettings.h"
|
||||
#include "RimEclipseInputCase.h"
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RicExportFeatureImpl.h"
|
||||
|
||||
#include "RifEclipseInputFileTools.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RimEclipseInputCase.h"
|
||||
#include "RimEclipseInputProperty.h"
|
||||
#include "RimEclipseInputPropertyCollection.h"
|
||||
#include "RimExportInputPropertySettings.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "cafSelectionManager.h"
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
#include "cafSelectionManager.h"
|
||||
|
||||
#include <QAction>
|
||||
#include <QMessageBox>
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicSaveEclipseInputPropertyFeature, "RicSaveEclipseInputPropertyFeature");
|
||||
|
||||
@ -99,6 +102,8 @@ void RicSaveEclipseInputPropertyFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), &exportSettings, "Export Eclipse Property to Text File", "");
|
||||
RicExportFeatureImpl::configureForExport(&propertyDialog);
|
||||
|
||||
if (propertyDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
bool isOk = RifEclipseInputFileTools::writePropertyToTextFile(exportSettings.fileName, inputReservoir->eclipseCaseData(), 0, inputProperty->resultName, exportSettings.eclipseKeyword);
|
||||
|
@ -19,25 +19,27 @@
|
||||
|
||||
#include "RicSaveEclipseResultAsInputPropertyExec.h"
|
||||
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimBinaryExportSettings.h"
|
||||
#include "RimEclipseView.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RiaApplication.h"
|
||||
|
||||
#include "RigCaseCellResultsData.h"
|
||||
#include "RicExportFeatureImpl.h"
|
||||
|
||||
#include "RifEclipseInputFileTools.h"
|
||||
#include "RifReaderInterface.h"
|
||||
|
||||
#include "RiaApplication.h"
|
||||
#include "RigCaseCellResultsData.h"
|
||||
|
||||
#include "RimBinaryExportSettings.h"
|
||||
#include "RimEclipseCase.h"
|
||||
#include "RimEclipseCellColors.h"
|
||||
#include "RimEclipseView.h"
|
||||
|
||||
#include "RiuMainWindow.h"
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
#include "cafUtils.h"
|
||||
|
||||
#include <QMessageBox>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -90,6 +92,7 @@ void RicSaveEclipseResultAsInputPropertyExec::redo()
|
||||
}
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), &exportSettings, "Export Binary Eclipse Data to Text File", "");
|
||||
RicExportFeatureImpl::configureForExport(&propertyDialog);
|
||||
|
||||
if (propertyDialog.exec() == QDialog::Accepted)
|
||||
{
|
||||
|
37
ApplicationCode/Commands/RicExportFeatureImpl.cpp
Normal file
37
ApplicationCode/Commands/RicExportFeatureImpl.cpp
Normal file
@ -0,0 +1,37 @@
|
||||
#include "QDialogButtonBox"
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight 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 General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#include "RicExportFeatureImpl.h"
|
||||
|
||||
#include "cafPdmUiPropertyViewDialog.h"
|
||||
|
||||
#include <QDialogButtonBox>
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicExportFeatureImpl::configureForExport(caf::PdmUiPropertyViewDialog* propertyViewDialog)
|
||||
{
|
||||
QDialogButtonBox* dialogButtonBox = propertyViewDialog->dialogButtonBox();
|
||||
|
||||
dialogButtonBox->clear();
|
||||
|
||||
dialogButtonBox->addButton("Export", QDialogButtonBox::AcceptRole);
|
||||
dialogButtonBox->addButton("Cancel", QDialogButtonBox::RejectRole);
|
||||
}
|
32
ApplicationCode/Commands/RicExportFeatureImpl.h
Normal file
32
ApplicationCode/Commands/RicExportFeatureImpl.h
Normal file
@ -0,0 +1,32 @@
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
//
|
||||
// Copyright (C) 2017- Statoil ASA
|
||||
//
|
||||
// ResInsight is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// (at your option) any later version.
|
||||
//
|
||||
// ResInsight 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 General Public License at <http://www.gnu.org/licenses/gpl.html>
|
||||
// for more details.
|
||||
//
|
||||
/////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
#pragma once
|
||||
|
||||
namespace caf {
|
||||
class PdmUiPropertyViewDialog;
|
||||
}
|
||||
|
||||
//==================================================================================================
|
||||
///
|
||||
//==================================================================================================
|
||||
class RicExportFeatureImpl
|
||||
{
|
||||
public:
|
||||
static void configureForExport(caf::PdmUiPropertyViewDialog* propertyViewDialog);
|
||||
};
|
@ -19,6 +19,7 @@
|
||||
|
||||
#include "RicExportToLasFileFeature.h"
|
||||
|
||||
#include "RicExportFeatureImpl.h"
|
||||
#include "RicExportToLasFileResampleUi.h"
|
||||
#include "WellLogCommands/RicWellLogPlotCurveFeatureImpl.h"
|
||||
|
||||
@ -78,6 +79,7 @@ void RicExportToLasFileFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
|
||||
caf::PdmUiPropertyViewDialog propertyDialog(NULL, &featureUi, "Export Curve Data to LAS file(s)", "", QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
RicExportFeatureImpl::configureForExport(&propertyDialog);
|
||||
propertyDialog.resize(QSize(400, 200));
|
||||
|
||||
if (propertyDialog.exec() == QDialog::Accepted &&
|
||||
|
@ -52,7 +52,9 @@ namespace caf
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
PdmUiPropertyViewDialog::PdmUiPropertyViewDialog(QWidget* parent, PdmObject* object, const QString& windowTitle, const QString& uiConfigName)
|
||||
{
|
||||
initialize(parent, object, windowTitle, uiConfigName, QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
m_buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
||||
|
||||
initialize(parent, object, windowTitle, uiConfigName);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -61,7 +63,9 @@ PdmUiPropertyViewDialog::PdmUiPropertyViewDialog(QWidget* parent, PdmObject* obj
|
||||
PdmUiPropertyViewDialog::PdmUiPropertyViewDialog(QWidget* parent, PdmObject* object, const QString& windowTitle,
|
||||
const QString& uiConfigName, const QDialogButtonBox::StandardButtons& standardButtons)
|
||||
{
|
||||
initialize(parent, object, windowTitle, uiConfigName, standardButtons);
|
||||
m_buttonBox = new QDialogButtonBox(standardButtons);
|
||||
|
||||
initialize(parent, object, windowTitle, uiConfigName);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@ -75,20 +79,28 @@ PdmUiPropertyViewDialog::~PdmUiPropertyViewDialog()
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiPropertyViewDialog::initialize(QWidget* parent, PdmObject* object, const QString& windowTitle,
|
||||
const QString& uiConfigName, const QDialogButtonBox::StandardButtons& standardButtons)
|
||||
QDialogButtonBox* PdmUiPropertyViewDialog::dialogButtonBox()
|
||||
{
|
||||
m_pdmObject = object;
|
||||
m_windowTitle = windowTitle;
|
||||
m_uiConfigName = uiConfigName;
|
||||
|
||||
setupUi(standardButtons);
|
||||
return m_buttonBox;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiPropertyViewDialog::setupUi(const QDialogButtonBox::StandardButtons& standardButtons)
|
||||
void PdmUiPropertyViewDialog::initialize(QWidget* parent, PdmObject* object, const QString& windowTitle,
|
||||
const QString& uiConfigName)
|
||||
{
|
||||
m_pdmObject = object;
|
||||
m_windowTitle = windowTitle;
|
||||
m_uiConfigName = uiConfigName;
|
||||
|
||||
setupUi();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void PdmUiPropertyViewDialog::setupUi()
|
||||
{
|
||||
setWindowTitle(m_windowTitle);
|
||||
|
||||
@ -102,11 +114,12 @@ void PdmUiPropertyViewDialog::setupUi(const QDialogButtonBox::StandardButtons& s
|
||||
m_pdmUiPropertyView->showProperties(m_pdmObject);
|
||||
|
||||
// Buttons
|
||||
QDialogButtonBox* buttonBox = new QDialogButtonBox(standardButtons);
|
||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
//CAF_ASSERT(m_buttonBox->buttons().size() > 0);
|
||||
|
||||
dialogLayout->addWidget(buttonBox);
|
||||
connect(m_buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
||||
connect(m_buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
||||
|
||||
dialogLayout->addWidget(m_buttonBox);
|
||||
}
|
||||
|
||||
|
||||
|
@ -54,15 +54,18 @@ public:
|
||||
PdmUiPropertyViewDialog(QWidget* parent, PdmObject* object, const QString& windowTitle, const QString& uiConfigName, const QDialogButtonBox::StandardButtons& standardButtons);
|
||||
~PdmUiPropertyViewDialog();
|
||||
|
||||
QDialogButtonBox* dialogButtonBox();
|
||||
|
||||
private:
|
||||
void initialize(QWidget* parent, PdmObject* object, const QString& windowTitle, const QString& uiConfigName, const QDialogButtonBox::StandardButtons& standardButtons);
|
||||
void setupUi(const QDialogButtonBox::StandardButtons& standardButtons);
|
||||
void initialize(QWidget* parent, PdmObject* object, const QString& windowTitle, const QString& uiConfigName);
|
||||
void setupUi();
|
||||
|
||||
private:
|
||||
QString m_windowTitle;
|
||||
QString m_uiConfigName;
|
||||
PdmObject* m_pdmObject;
|
||||
PdmUiPropertyView* m_pdmUiPropertyView;
|
||||
QDialogButtonBox* m_buttonBox;
|
||||
};
|
||||
|
||||
} // End of namespace caf
|
||||
|
Loading…
Reference in New Issue
Block a user