mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
#2209 Use correct view in cmd "Export Visible Cells as FLUXNUM/MULTNUM"
This commit is contained in:
@@ -43,23 +43,15 @@
|
||||
#include <QFileInfo>
|
||||
#include <QMessageBox>
|
||||
|
||||
CAF_CMD_SOURCE_INIT(RicSaveEclipseInputActiveVisibleCellsFeature, "RicSaveEclipseInputActiveVisibleCellsFeature");
|
||||
CAF_CMD_SOURCE_INIT(RicSaveEclipseInputVisibleCellsFeature, "RicSaveEclipseInputVisibleCellsFeature");
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicSaveEclipseInputVisibleCellsFeature::isCommandEnabled()
|
||||
{
|
||||
return getSelectedEclipseView() != nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSaveEclipseInputVisibleCellsFeature::onActionTriggered(bool isChecked)
|
||||
void executeCommand(RimEclipseView* view)
|
||||
{
|
||||
RimEclipseView* view = getEclipseActiveView();
|
||||
|
||||
RicSaveEclipseInputVisibleCellsUi exportSettings;
|
||||
caf::PdmUiPropertyViewDialog propertyDialog(RiuMainWindow::instance(), &exportSettings, "Export FLUXNUM/MULTNUM", "");
|
||||
RicExportFeatureImpl::configureForExport(&propertyDialog);
|
||||
@@ -99,6 +91,23 @@ void RicSaveEclipseInputVisibleCellsFeature::onActionTriggered(bool isChecked)
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicSaveEclipseInputVisibleCellsFeature::isCommandEnabled()
|
||||
{
|
||||
return selectedView() != nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSaveEclipseInputVisibleCellsFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimEclipseView* view = RicSaveEclipseInputVisibleCellsFeature::selectedView();
|
||||
executeCommand(view);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
@@ -110,17 +119,50 @@ void RicSaveEclipseInputVisibleCellsFeature::setupActionLook(QAction* actionToSe
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseView* RicSaveEclipseInputVisibleCellsFeature::getEclipseActiveView()
|
||||
RimEclipseView* RicSaveEclipseInputVisibleCellsFeature::selectedView()
|
||||
{
|
||||
RimEclipseView* view = dynamic_cast<RimEclipseView*>(caf::SelectionManager::instance()->selectedItem());
|
||||
return view;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
bool RicSaveEclipseInputActiveVisibleCellsFeature::isCommandEnabled()
|
||||
{
|
||||
return getEclipseActiveView() != nullptr;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSaveEclipseInputActiveVisibleCellsFeature::onActionTriggered(bool isChecked)
|
||||
{
|
||||
RimEclipseView* view = RicSaveEclipseInputActiveVisibleCellsFeature::getEclipseActiveView();
|
||||
executeCommand(view);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
void RicSaveEclipseInputActiveVisibleCellsFeature::setupActionLook(QAction* actionToSetup)
|
||||
{
|
||||
actionToSetup->setText("Export Visible Cells as FLUXNUM/MULTNUM");
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseView* RicSaveEclipseInputActiveVisibleCellsFeature::getEclipseActiveView()
|
||||
{
|
||||
RimView* activeView = RiaApplication::instance()->activeReservoirView();
|
||||
|
||||
return dynamic_cast<RimEclipseView*>(activeView);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
///
|
||||
//--------------------------------------------------------------------------------------------------
|
||||
RimEclipseView * RicSaveEclipseInputVisibleCellsFeature::getSelectedEclipseView()
|
||||
{
|
||||
return dynamic_cast<RimEclipseView*>(caf::SelectionManager::instance()->selectedItem());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user