mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
(#339) Added RicImportEclipseCaseFeature
This commit is contained in:
@@ -899,26 +899,10 @@ void RiuMainWindow::slotImportEclipseCase()
|
||||
{
|
||||
if (checkForDocumentModifications())
|
||||
{
|
||||
RiaApplication* app = RiaApplication::instance();
|
||||
QAction* action = caf::CmdFeatureManager::instance()->action("RicImportEclipseCaseFeature");
|
||||
CVF_ASSERT(action);
|
||||
|
||||
QString defaultDir = app->defaultFileDialogDirectory("BINARY_GRID");
|
||||
QStringList fileNames = QFileDialog::getOpenFileNames(this, "Import Eclipse File", defaultDir, "Eclipse Grid Files (*.GRID *.EGRID)");
|
||||
if (fileNames.size()) defaultDir = QFileInfo(fileNames.last()).absolutePath();
|
||||
app->setDefaultFileDialogDirectory("BINARY_GRID", defaultDir);
|
||||
|
||||
int i;
|
||||
for (i = 0; i < fileNames.size(); i++)
|
||||
{
|
||||
QString fileName = fileNames[i];
|
||||
|
||||
if (!fileNames.isEmpty())
|
||||
{
|
||||
if (app->openEclipseCaseFromFile(fileName))
|
||||
{
|
||||
addRecentFiles(fileName);
|
||||
}
|
||||
}
|
||||
}
|
||||
action->trigger();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -108,6 +108,9 @@ public:
|
||||
|
||||
void setExpanded(const caf::PdmUiItem* uiItem, bool expanded);
|
||||
|
||||
void addRecentFiles(const QString& file);
|
||||
void removeRecentFiles(const QString& file);
|
||||
|
||||
protected:
|
||||
virtual void closeEvent(QCloseEvent* event);
|
||||
|
||||
@@ -121,9 +124,7 @@ private:
|
||||
bool checkForDocumentModifications();
|
||||
|
||||
void updateRecentFileActions();
|
||||
void addRecentFiles(const QString& file);
|
||||
void removeRecentFiles(const QString& file);
|
||||
|
||||
|
||||
QMdiSubWindow* findMdiSubWindow(RiuViewer* viewer);
|
||||
|
||||
void storeTreeViewState();
|
||||
|
||||
Reference in New Issue
Block a user