mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Janitor : Remove Multi Case Import dialog and features
This commit is contained in:
parent
a8589efe23
commit
ff92f7b792
@ -2,7 +2,6 @@
|
|||||||
set (SOURCE_GROUP_HEADER_FILES
|
set (SOURCE_GROUP_HEADER_FILES
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicAddEclipseInputPropertyFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicAddEclipseInputPropertyFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicComputeStatisticsFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicComputeStatisticsFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCaseGroupFeature.h
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCaseGroupFromFilesFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCaseGroupFromFilesFeature.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupExec.h
|
${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupExec.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupFeature.h
|
${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupFeature.h
|
||||||
@ -24,7 +23,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RicEclipseHideFaultFeature.h
|
|||||||
set (SOURCE_GROUP_SOURCE_FILES
|
set (SOURCE_GROUP_SOURCE_FILES
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicAddEclipseInputPropertyFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicAddEclipseInputPropertyFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicComputeStatisticsFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicComputeStatisticsFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCaseGroupFeature.cpp
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCaseGroupFromFilesFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicCreateGridCaseGroupFromFilesFeature.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupExec.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupExec.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupFeature.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RicEclipseCaseNewGroupFeature.cpp
|
||||||
|
@ -1,62 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Copyright (C) 2015- Statoil ASA
|
|
||||||
// Copyright (C) 2015- Ceetron Solutions AS
|
|
||||||
//
|
|
||||||
// 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 "RicCreateGridCaseGroupFeature.h"
|
|
||||||
|
|
||||||
#include "RiaImportEclipseCaseTools.h"
|
|
||||||
|
|
||||||
#include "RimEclipseCaseCollection.h"
|
|
||||||
#include "RiuMultiCaseImportDialog.h"
|
|
||||||
|
|
||||||
#include "cafSelectionManager.h"
|
|
||||||
|
|
||||||
#include <QAction>
|
|
||||||
|
|
||||||
CAF_CMD_SOURCE_INIT( RicCreateGridCaseGroupFeature, "RicCreateGridCaseGroupFeature" );
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
bool RicCreateGridCaseGroupFeature::isCommandEnabled()
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RicCreateGridCaseGroupFeature::onActionTriggered( bool isChecked )
|
|
||||||
{
|
|
||||||
RiuMultiCaseImportDialog dialog;
|
|
||||||
int action = dialog.exec();
|
|
||||||
if ( action == QDialog::Accepted )
|
|
||||||
{
|
|
||||||
QStringList gridFileNames = dialog.eclipseCaseFileNames();
|
|
||||||
RiaImportEclipseCaseTools::addEclipseCases( gridFileNames );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RicCreateGridCaseGroupFeature::setupActionLook( QAction* actionToSetup )
|
|
||||||
{
|
|
||||||
actionToSetup->setIcon( QIcon( ":/CreateGridCaseGroup16x16.png" ) );
|
|
||||||
actionToSetup->setText( "&Create Grid Case Group from Files" );
|
|
||||||
}
|
|
@ -1,38 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Copyright (C) 2015- Statoil ASA
|
|
||||||
// Copyright (C) 2015- Ceetron Solutions AS
|
|
||||||
//
|
|
||||||
// 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
|
|
||||||
|
|
||||||
#include "cafCmdFeature.h"
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
|
|
||||||
//==================================================================================================
|
|
||||||
///
|
|
||||||
//==================================================================================================
|
|
||||||
class RicCreateGridCaseGroupFeature : public caf::CmdFeature
|
|
||||||
{
|
|
||||||
CAF_CMD_HEADER_INIT;
|
|
||||||
|
|
||||||
protected:
|
|
||||||
// Overrides
|
|
||||||
bool isCommandEnabled() override;
|
|
||||||
void onActionTriggered( bool isChecked ) override;
|
|
||||||
void setupActionLook( QAction* actionToSetup ) override;
|
|
||||||
};
|
|
@ -25,7 +25,6 @@
|
|||||||
#include "RicRecursiveFileSearchDialog.h"
|
#include "RicRecursiveFileSearchDialog.h"
|
||||||
|
|
||||||
#include "RimEclipseCaseCollection.h"
|
#include "RimEclipseCaseCollection.h"
|
||||||
#include "RiuMultiCaseImportDialog.h"
|
|
||||||
|
|
||||||
#include "cafSelectionManager.h"
|
#include "cafSelectionManager.h"
|
||||||
|
|
||||||
@ -52,7 +51,7 @@ void RicCreateGridCaseGroupFromFilesFeature::onActionTriggered( bool isChecked )
|
|||||||
|
|
||||||
RicRecursiveFileSearchDialogResult result =
|
RicRecursiveFileSearchDialogResult result =
|
||||||
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr,
|
RicRecursiveFileSearchDialog::runRecursiveSearchDialog( nullptr,
|
||||||
"Create Grid Case Group from Files",
|
"Create Grid Case Group",
|
||||||
defaultDir,
|
defaultDir,
|
||||||
m_pathFilter,
|
m_pathFilter,
|
||||||
m_fileNameFilter,
|
m_fileNameFilter,
|
||||||
@ -77,5 +76,5 @@ void RicCreateGridCaseGroupFromFilesFeature::onActionTriggered( bool isChecked )
|
|||||||
void RicCreateGridCaseGroupFromFilesFeature::setupActionLook( QAction* actionToSetup )
|
void RicCreateGridCaseGroupFromFilesFeature::setupActionLook( QAction* actionToSetup )
|
||||||
{
|
{
|
||||||
actionToSetup->setIcon( QIcon( ":/CreateGridCaseGroup16x16.png" ) );
|
actionToSetup->setIcon( QIcon( ":/CreateGridCaseGroup16x16.png" ) );
|
||||||
actionToSetup->setText( "&Create Grid Case Group from Files Recursively" );
|
actionToSetup->setText( "&Create Grid Case Group" );
|
||||||
}
|
}
|
||||||
|
@ -201,7 +201,6 @@ caf::CmdFeatureMenuBuilder RimContextCommandBuilder::commandsFromSelection()
|
|||||||
menuBuilder << "RicImportEclipseCaseFeature";
|
menuBuilder << "RicImportEclipseCaseFeature";
|
||||||
menuBuilder << "RicImportEclipseCasesFeature";
|
menuBuilder << "RicImportEclipseCasesFeature";
|
||||||
menuBuilder << "RicImportInputEclipseCaseFeature";
|
menuBuilder << "RicImportInputEclipseCaseFeature";
|
||||||
menuBuilder << "RicCreateGridCaseGroupFeature";
|
|
||||||
menuBuilder << "RicCreateGridCaseGroupFromFilesFeature";
|
menuBuilder << "RicCreateGridCaseGroupFromFilesFeature";
|
||||||
menuBuilder.subMenuEnd();
|
menuBuilder.subMenuEnd();
|
||||||
menuBuilder << "RicEclipseCaseNewGroupFeature";
|
menuBuilder << "RicEclipseCaseNewGroupFeature";
|
||||||
|
@ -15,7 +15,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RiuMainWindow.h
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowBase.h
|
${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowBase.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuMdiArea.h
|
${CMAKE_CURRENT_LIST_DIR}/RiuMdiArea.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuMdiSubWindow.h
|
${CMAKE_CURRENT_LIST_DIR}/RiuMdiSubWindow.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuMultiCaseImportDialog.h
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuProcessMonitor.h
|
${CMAKE_CURRENT_LIST_DIR}/RiuProcessMonitor.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuProjectPropertyView.h
|
${CMAKE_CURRENT_LIST_DIR}/RiuProjectPropertyView.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuPropertyViewTabWidget.h
|
${CMAKE_CURRENT_LIST_DIR}/RiuPropertyViewTabWidget.h
|
||||||
@ -113,7 +112,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RiuMainWindow.cpp
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowBase.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RiuMainWindowBase.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuMdiArea.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RiuMdiArea.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuMdiSubWindow.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RiuMdiSubWindow.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuMultiCaseImportDialog.cpp
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuProcessMonitor.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RiuProcessMonitor.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuProjectPropertyView.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RiuProjectPropertyView.cpp
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuPropertyViewTabWidget.cpp
|
${CMAKE_CURRENT_LIST_DIR}/RiuPropertyViewTabWidget.cpp
|
||||||
@ -229,7 +227,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RiuResultQwtPlot.h
|
|||||||
${CMAKE_CURRENT_LIST_DIR}/RiuTextDialog.h
|
${CMAKE_CURRENT_LIST_DIR}/RiuTextDialog.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuViewer.h
|
${CMAKE_CURRENT_LIST_DIR}/RiuViewer.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuProcessMonitor.h
|
${CMAKE_CURRENT_LIST_DIR}/RiuProcessMonitor.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuMultiCaseImportDialog.h
|
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuViewerCommands.h
|
${CMAKE_CURRENT_LIST_DIR}/RiuViewerCommands.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuTreeViewEventFilter.h
|
${CMAKE_CURRENT_LIST_DIR}/RiuTreeViewEventFilter.h
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuWellLogPlot.h
|
${CMAKE_CURRENT_LIST_DIR}/RiuWellLogPlot.h
|
||||||
@ -265,7 +262,6 @@ ${CMAKE_CURRENT_LIST_DIR}/RiuTextContentFrame.h
|
|||||||
)
|
)
|
||||||
|
|
||||||
list(APPEND QT_UI_FILES
|
list(APPEND QT_UI_FILES
|
||||||
${CMAKE_CURRENT_LIST_DIR}/RiuMultiCaseImportDialog.ui
|
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@ -433,7 +433,6 @@ void RiuMainWindow::createMenus()
|
|||||||
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicImportEclipseCasesFeature" ) );
|
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicImportEclipseCasesFeature" ) );
|
||||||
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicImportEclipseCaseTimeStepFilterFeature" ) );
|
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicImportEclipseCaseTimeStepFilterFeature" ) );
|
||||||
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicImportInputEclipseCaseFeature" ) );
|
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicImportInputEclipseCaseFeature" ) );
|
||||||
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicCreateGridCaseGroupFeature" ) );
|
|
||||||
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicCreateGridCaseGroupFromFilesFeature" ) );
|
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicCreateGridCaseGroupFromFilesFeature" ) );
|
||||||
|
|
||||||
importMenu->addSeparator();
|
importMenu->addSeparator();
|
||||||
|
@ -1,256 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
|
||||||
//
|
|
||||||
// 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 "RiuMultiCaseImportDialog.h"
|
|
||||||
|
|
||||||
#include "RiaApplication.h"
|
|
||||||
|
|
||||||
#include "RiuFileDialogTools.h"
|
|
||||||
#include "RiuTools.h"
|
|
||||||
|
|
||||||
#include "ui_RiuMultiCaseImportDialog.h"
|
|
||||||
|
|
||||||
#include <QFileIconProvider>
|
|
||||||
#include <QFileSystemModel>
|
|
||||||
#include <QStringListModel>
|
|
||||||
|
|
||||||
class FileListModel : public QStringListModel
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
explicit FileListModel( QObject* parent = nullptr )
|
|
||||||
: QStringListModel( parent )
|
|
||||||
, m_isItemsEditable( false )
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
Qt::ItemFlags flags( const QModelIndex& index ) const override
|
|
||||||
{
|
|
||||||
if ( m_isItemsEditable )
|
|
||||||
return Qt::ItemIsSelectable | Qt::ItemIsEnabled | Qt::ItemIsEditable;
|
|
||||||
else
|
|
||||||
return Qt::ItemIsSelectable | Qt::ItemIsEnabled;
|
|
||||||
}
|
|
||||||
|
|
||||||
QVariant data( const QModelIndex& index, int role ) const override
|
|
||||||
{
|
|
||||||
if ( role == Qt::DecorationRole )
|
|
||||||
{
|
|
||||||
QFileInfo fileInfo( stringList()[index.row()] );
|
|
||||||
QFileIconProvider iconProv;
|
|
||||||
return QVariant( iconProv.icon( fileInfo ) );
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
return QStringListModel::data( index, role );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void removeFileNames( const QModelIndexList& indexes )
|
|
||||||
{
|
|
||||||
for ( int i = indexes.size() - 1; i >= 0; i-- )
|
|
||||||
{
|
|
||||||
removeRow( indexes[i].row(), indexes[i].parent() );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private:
|
|
||||||
bool m_isItemsEditable;
|
|
||||||
};
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
RiuMultiCaseImportDialog::RiuMultiCaseImportDialog( QWidget* parent /*= 0*/ )
|
|
||||||
: QDialog( parent, RiuTools::defaultDialogFlags() )
|
|
||||||
{
|
|
||||||
ui = new Ui::RiuMultiCaseImportDialog;
|
|
||||||
ui->setupUi( this );
|
|
||||||
|
|
||||||
m_searchFolders = new FileListModel( this );
|
|
||||||
ui->m_searchFolderList->setModel( m_searchFolders );
|
|
||||||
|
|
||||||
m_eclipseGridFiles = new FileListModel( this );
|
|
||||||
ui->m_eclipseCasesList->setModel( m_eclipseGridFiles );
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
RiuMultiCaseImportDialog::~RiuMultiCaseImportDialog()
|
|
||||||
{
|
|
||||||
delete ui;
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RiuMultiCaseImportDialog::on_m_addSearchFolderButton_clicked()
|
|
||||||
{
|
|
||||||
QString selectedFolder = RiuFileDialogTools::getExistingDirectory( this,
|
|
||||||
"Select an Eclipse case search folder",
|
|
||||||
RiaApplication::instance()->lastUsedDialogDirectory(
|
|
||||||
"MULTICASEIMPORT" ) );
|
|
||||||
QStringList folderNames = m_searchFolders->stringList();
|
|
||||||
|
|
||||||
if ( !folderNames.contains( selectedFolder ) )
|
|
||||||
{
|
|
||||||
folderNames.push_back( selectedFolder );
|
|
||||||
m_searchFolders->setStringList( folderNames );
|
|
||||||
updateGridFileList();
|
|
||||||
}
|
|
||||||
|
|
||||||
RiaApplication::instance()->setLastUsedDialogDirectory( "MULTICASEIMPORT", selectedFolder );
|
|
||||||
|
|
||||||
QPushButton* okButton = ui->m_dialogButtons->button( QDialogButtonBox::Ok );
|
|
||||||
if ( okButton )
|
|
||||||
{
|
|
||||||
okButton->setFocus( Qt::OtherFocusReason );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RiuMultiCaseImportDialog::on_m_removeSearchFolderButton_clicked()
|
|
||||||
{
|
|
||||||
QModelIndexList selection = ui->m_searchFolderList->selectionModel()->selectedIndexes();
|
|
||||||
QStringList folderNames = m_searchFolders->stringList();
|
|
||||||
|
|
||||||
QStringList searchFoldersToRemove;
|
|
||||||
|
|
||||||
for ( int i = 0; i < selection.size(); ++i )
|
|
||||||
{
|
|
||||||
searchFoldersToRemove.push_back( folderNames[selection[i].row()] );
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( int i = 0; i < searchFoldersToRemove.size(); ++i )
|
|
||||||
{
|
|
||||||
folderNames.removeOne( searchFoldersToRemove[i] );
|
|
||||||
}
|
|
||||||
|
|
||||||
m_searchFolders->setStringList( folderNames );
|
|
||||||
|
|
||||||
if ( selection.size() )
|
|
||||||
{
|
|
||||||
updateGridFileList();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RiuMultiCaseImportDialog::updateGridFileList()
|
|
||||||
{
|
|
||||||
QStringList folderNames = m_searchFolders->stringList();
|
|
||||||
QStringList gridFileNames;
|
|
||||||
|
|
||||||
// Filter the search folders to remove subfolders of existing roots'
|
|
||||||
|
|
||||||
QStringList searchFoldersToRemove;
|
|
||||||
|
|
||||||
for ( int i = 0; i < folderNames.size(); ++i )
|
|
||||||
for ( int j = 0; j < folderNames.size(); ++j )
|
|
||||||
{
|
|
||||||
if ( i != j )
|
|
||||||
{
|
|
||||||
if ( folderNames[i].startsWith( folderNames[j] ) )
|
|
||||||
{
|
|
||||||
// Remove folderNames[i]
|
|
||||||
searchFoldersToRemove.push_back( folderNames[i] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Remove the subfolders when adding a root
|
|
||||||
|
|
||||||
for ( int i = 0; i < searchFoldersToRemove.size(); ++i )
|
|
||||||
{
|
|
||||||
folderNames.removeOne( searchFoldersToRemove[i] );
|
|
||||||
}
|
|
||||||
|
|
||||||
for ( int i = 0; i < folderNames.size(); i++ )
|
|
||||||
{
|
|
||||||
QString folderName = folderNames[i];
|
|
||||||
|
|
||||||
appendEGRIDFilesRecursively( folderName, gridFileNames );
|
|
||||||
}
|
|
||||||
|
|
||||||
m_eclipseGridFiles->setStringList( gridFileNames );
|
|
||||||
}
|
|
||||||
|
|
||||||
void RiuMultiCaseImportDialog::appendEGRIDFilesRecursively( const QString& folderName, QStringList& gridFileNames )
|
|
||||||
{
|
|
||||||
{
|
|
||||||
QDir baseDir( folderName );
|
|
||||||
baseDir.setFilter( QDir::Files );
|
|
||||||
|
|
||||||
QStringList nameFilters;
|
|
||||||
nameFilters << "*.egrid"
|
|
||||||
<< ".EGRID";
|
|
||||||
baseDir.setNameFilters( nameFilters );
|
|
||||||
|
|
||||||
QStringList fileNames = baseDir.entryList();
|
|
||||||
|
|
||||||
for ( int i = 0; i < fileNames.size(); ++i )
|
|
||||||
{
|
|
||||||
QString fileName = fileNames[i];
|
|
||||||
|
|
||||||
QString absoluteFolderName = baseDir.absoluteFilePath( fileName );
|
|
||||||
|
|
||||||
gridFileNames.append( absoluteFolderName );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
{
|
|
||||||
QDir baseDir( folderName );
|
|
||||||
baseDir.setFilter( QDir::Dirs | QDir::NoDotAndDotDot );
|
|
||||||
|
|
||||||
QStringList subFolders = baseDir.entryList();
|
|
||||||
|
|
||||||
for ( int i = 0; i < subFolders.size(); ++i )
|
|
||||||
{
|
|
||||||
QString subFolderName = subFolders[i];
|
|
||||||
|
|
||||||
QString absoluteFolderName = baseDir.absoluteFilePath( subFolderName );
|
|
||||||
appendEGRIDFilesRecursively( absoluteFolderName, gridFileNames );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
QStringList RiuMultiCaseImportDialog::eclipseCaseFileNames() const
|
|
||||||
{
|
|
||||||
return m_eclipseGridFiles->stringList();
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RiuMultiCaseImportDialog::on_m_removeEclipseCaseButton_clicked()
|
|
||||||
{
|
|
||||||
QModelIndexList selection = ui->m_eclipseCasesList->selectionModel()->selectedIndexes();
|
|
||||||
if ( selection.size() )
|
|
||||||
{
|
|
||||||
FileListModel* dataModel = static_cast<FileListModel*>( ui->m_eclipseCasesList->model() );
|
|
||||||
Q_ASSERT( dataModel );
|
|
||||||
|
|
||||||
dataModel->removeFileNames( selection );
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,58 +0,0 @@
|
|||||||
/////////////////////////////////////////////////////////////////////////////////
|
|
||||||
//
|
|
||||||
// Copyright (C) 2011-2012 Statoil ASA, Ceetron AS
|
|
||||||
//
|
|
||||||
// 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
|
|
||||||
|
|
||||||
#include <QDialog>
|
|
||||||
|
|
||||||
namespace Ui
|
|
||||||
{
|
|
||||||
class RiuMultiCaseImportDialog;
|
|
||||||
};
|
|
||||||
|
|
||||||
class FileListModel;
|
|
||||||
|
|
||||||
//==================================================================================================
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//==================================================================================================
|
|
||||||
|
|
||||||
class RiuMultiCaseImportDialog : public QDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
explicit RiuMultiCaseImportDialog( QWidget* parent = nullptr );
|
|
||||||
~RiuMultiCaseImportDialog() override;
|
|
||||||
|
|
||||||
QStringList eclipseCaseFileNames() const;
|
|
||||||
|
|
||||||
protected slots:
|
|
||||||
void on_m_addSearchFolderButton_clicked();
|
|
||||||
void on_m_removeSearchFolderButton_clicked();
|
|
||||||
void on_m_removeEclipseCaseButton_clicked();
|
|
||||||
|
|
||||||
private:
|
|
||||||
void updateGridFileList();
|
|
||||||
static void appendEGRIDFilesRecursively( const QString& folderName, QStringList& gridFileNames );
|
|
||||||
Ui::RiuMultiCaseImportDialog* ui;
|
|
||||||
|
|
||||||
FileListModel* m_searchFolders;
|
|
||||||
FileListModel* m_eclipseGridFiles;
|
|
||||||
};
|
|
@ -1,186 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<ui version="4.0">
|
|
||||||
<class>RiuMultiCaseImportDialog</class>
|
|
||||||
<widget class="QDialog" name="RiuMultiCaseImportDialog">
|
|
||||||
<property name="geometry">
|
|
||||||
<rect>
|
|
||||||
<x>0</x>
|
|
||||||
<y>0</y>
|
|
||||||
<width>755</width>
|
|
||||||
<height>736</height>
|
|
||||||
</rect>
|
|
||||||
</property>
|
|
||||||
<property name="windowTitle">
|
|
||||||
<string>Create Grid Case Group From Files</string>
|
|
||||||
</property>
|
|
||||||
<property name="modal">
|
|
||||||
<bool>true</bool>
|
|
||||||
</property>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<item>
|
|
||||||
<widget class="QSplitter" name="splitter">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<widget class="QWidget" name="layoutWidget">
|
|
||||||
<layout class="QGridLayout" name="gridLayout">
|
|
||||||
<item row="1" column="0" colspan="3">
|
|
||||||
<widget class="QListView" name="m_searchFolderList">
|
|
||||||
<property name="selectionMode">
|
|
||||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QPushButton" name="m_removeSearchFolderButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Remove</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="2">
|
|
||||||
<widget class="QPushButton" name="m_addSearchFolderButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Add</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<spacer name="horizontalSpacer_4">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>40</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="3">
|
|
||||||
<widget class="QLabel" name="m_searchFolderLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Search Folders</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="3" column="0" colspan="3">
|
|
||||||
<spacer name="verticalSpacer">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Vertical</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>20</width>
|
|
||||||
<height>222</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<widget class="QWidget" name="layoutWidget1">
|
|
||||||
<layout class="QGridLayout" name="gridLayout_2" columnstretch="0,0">
|
|
||||||
<item row="1" column="0" colspan="2">
|
|
||||||
<widget class="QListView" name="m_eclipseCasesList">
|
|
||||||
<property name="sizePolicy">
|
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Expanding">
|
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
|
||||||
<property name="selectionMode">
|
|
||||||
<enum>QAbstractItemView::ExtendedSelection</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="0" column="0" colspan="2">
|
|
||||||
<widget class="QLabel" name="m_eclipseCaseListLabel">
|
|
||||||
<property name="text">
|
|
||||||
<string>Selected Eclipse Cases</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="1">
|
|
||||||
<widget class="QPushButton" name="m_removeEclipseCaseButton">
|
|
||||||
<property name="text">
|
|
||||||
<string>Remove</string>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item row="2" column="0">
|
|
||||||
<spacer name="horizontalSpacer_3">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeType">
|
|
||||||
<enum>QSizePolicy::Minimum</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>400</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="Line" name="line">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<widget class="QDialogButtonBox" name="m_dialogButtons">
|
|
||||||
<property name="orientation">
|
|
||||||
<enum>Qt::Horizontal</enum>
|
|
||||||
</property>
|
|
||||||
<property name="standardButtons">
|
|
||||||
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
|
|
||||||
</property>
|
|
||||||
</widget>
|
|
||||||
</item>
|
|
||||||
</layout>
|
|
||||||
</widget>
|
|
||||||
<resources/>
|
|
||||||
<connections>
|
|
||||||
<connection>
|
|
||||||
<sender>m_dialogButtons</sender>
|
|
||||||
<signal>accepted()</signal>
|
|
||||||
<receiver>RiuMultiCaseImportDialog</receiver>
|
|
||||||
<slot>accept()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>248</x>
|
|
||||||
<y>254</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>157</x>
|
|
||||||
<y>274</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
<connection>
|
|
||||||
<sender>m_dialogButtons</sender>
|
|
||||||
<signal>rejected()</signal>
|
|
||||||
<receiver>RiuMultiCaseImportDialog</receiver>
|
|
||||||
<slot>reject()</slot>
|
|
||||||
<hints>
|
|
||||||
<hint type="sourcelabel">
|
|
||||||
<x>316</x>
|
|
||||||
<y>260</y>
|
|
||||||
</hint>
|
|
||||||
<hint type="destinationlabel">
|
|
||||||
<x>286</x>
|
|
||||||
<y>274</y>
|
|
||||||
</hint>
|
|
||||||
</hints>
|
|
||||||
</connection>
|
|
||||||
</connections>
|
|
||||||
</ui>
|
|
@ -251,7 +251,6 @@ void RiuPlotMainWindow::createMenus()
|
|||||||
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicImportEclipseCaseFeature" ) );
|
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicImportEclipseCaseFeature" ) );
|
||||||
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicImportEclipseCasesFeature" ) );
|
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicImportEclipseCasesFeature" ) );
|
||||||
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicImportInputEclipseCaseFeature" ) );
|
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicImportInputEclipseCaseFeature" ) );
|
||||||
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicCreateGridCaseGroupFeature" ) );
|
|
||||||
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicCreateGridCaseGroupFromFilesFeature" ) );
|
importEclipseMenu->addAction( cmdFeatureMgr->action( "RicCreateGridCaseGroupFromFilesFeature" ) );
|
||||||
|
|
||||||
#ifdef USE_ODB_API
|
#ifdef USE_ODB_API
|
||||||
|
Loading…
Reference in New Issue
Block a user