mirror of
https://github.com/OPM/ResInsight.git
synced 2025-02-25 18:55:39 -06:00
Use caf property dialog and removed obsolete riuPreferencesDialog
This commit is contained in:
parent
ae38128969
commit
c0c78c8ada
@ -42,7 +42,6 @@ set( APPLICATION_FILES
|
|||||||
set( USER_INTERFACE_FILES
|
set( USER_INTERFACE_FILES
|
||||||
UserInterface/RiuCursors.cpp
|
UserInterface/RiuCursors.cpp
|
||||||
UserInterface/RiuMainWindow.cpp
|
UserInterface/RiuMainWindow.cpp
|
||||||
UserInterface/RiuPreferencesDialog.cpp
|
|
||||||
UserInterface/RiuResultInfoPanel.cpp
|
UserInterface/RiuResultInfoPanel.cpp
|
||||||
UserInterface/RiuViewer.cpp
|
UserInterface/RiuViewer.cpp
|
||||||
UserInterface/RiuSimpleHistogramWidget.cpp
|
UserInterface/RiuSimpleHistogramWidget.cpp
|
||||||
@ -97,7 +96,6 @@ set ( QT_MOC_HEADERS
|
|||||||
ProjectDataModel/RimMimeData.h
|
ProjectDataModel/RimMimeData.h
|
||||||
|
|
||||||
UserInterface/RiuMainWindow.h
|
UserInterface/RiuMainWindow.h
|
||||||
UserInterface/RiuPreferencesDialog.h
|
|
||||||
UserInterface/RiuResultInfoPanel.h
|
UserInterface/RiuResultInfoPanel.h
|
||||||
UserInterface/RiuViewer.h
|
UserInterface/RiuViewer.h
|
||||||
UserInterface/RiuProcessMonitor.h
|
UserInterface/RiuProcessMonitor.h
|
||||||
|
@ -19,6 +19,9 @@
|
|||||||
//#include "RiaStdInclude.h"
|
//#include "RiaStdInclude.h"
|
||||||
|
|
||||||
#include "cafPdmDocument.h"
|
#include "cafPdmDocument.h"
|
||||||
|
#include "cafPdmFieldCvfColor.h"
|
||||||
|
#include "cafPdmFieldCvfMat4d.h"
|
||||||
|
#include "cafPdmUiPropertyDialog.h"
|
||||||
|
|
||||||
#include <QAction>
|
#include <QAction>
|
||||||
#include <QMenu>
|
#include <QMenu>
|
||||||
@ -37,7 +40,6 @@
|
|||||||
#include "RimInputPropertyCollection.h"
|
#include "RimInputPropertyCollection.h"
|
||||||
#include "RimExportInputPropertySettings.h"
|
#include "RimExportInputPropertySettings.h"
|
||||||
#include "RiaPreferences.h"
|
#include "RiaPreferences.h"
|
||||||
#include "RiuPreferencesDialog.h"
|
|
||||||
#include "RifEclipseInputFileTools.h"
|
#include "RifEclipseInputFileTools.h"
|
||||||
#include "RimInputCase.h"
|
#include "RimInputCase.h"
|
||||||
#include "RimBinaryExportSettings.h"
|
#include "RimBinaryExportSettings.h"
|
||||||
@ -59,9 +61,6 @@
|
|||||||
#include "RimWellPathCollection.h"
|
#include "RimWellPathCollection.h"
|
||||||
#include "RimReservoirCellResultsCacher.h"
|
#include "RimReservoirCellResultsCacher.h"
|
||||||
#include "Rim3dOverlayInfoConfig.h"
|
#include "Rim3dOverlayInfoConfig.h"
|
||||||
|
|
||||||
#include "cafPdmFieldCvfColor.h"
|
|
||||||
#include "cafPdmFieldCvfMat4d.h"
|
|
||||||
#include "RimProject.h"
|
#include "RimProject.h"
|
||||||
#include "RimOilField.h"
|
#include "RimOilField.h"
|
||||||
#include "RimAnalysisModels.h"
|
#include "RimAnalysisModels.h"
|
||||||
@ -834,8 +833,8 @@ void RimUiTreeView::slotWriteInputProperty()
|
|||||||
exportSettings.fileName = outputFileName;
|
exportSettings.fileName = outputFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
RiuPreferencesDialog preferencesDialog(this, &exportSettings, "Export Eclipse Property to Text File");
|
caf::PdmUiPropertyDialog propertyDialog(this, &exportSettings, "Export Eclipse Property to Text File");
|
||||||
if (preferencesDialog.exec() == QDialog::Accepted)
|
if (propertyDialog.exec() == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
bool isOk = RifEclipseInputFileTools::writePropertyToTextFile(exportSettings.fileName, inputReservoir->reservoirData(), 0, inputProperty->resultName, exportSettings.eclipseKeyword);
|
bool isOk = RifEclipseInputFileTools::writePropertyToTextFile(exportSettings.fileName, inputReservoir->reservoirData(), 0, inputProperty->resultName, exportSettings.eclipseKeyword);
|
||||||
if (isOk)
|
if (isOk)
|
||||||
@ -887,8 +886,8 @@ void RimUiTreeView::slotWriteBinaryResultAsInputProperty()
|
|||||||
exportSettings.fileName = outputFileName;
|
exportSettings.fileName = outputFileName;
|
||||||
}
|
}
|
||||||
|
|
||||||
RiuPreferencesDialog preferencesDialog(this, &exportSettings, "Export Binary Eclipse Data to Text File");
|
caf::PdmUiPropertyDialog propertyDialog(this, &exportSettings, "Export Binary Eclipse Data to Text File");
|
||||||
if (preferencesDialog.exec() == QDialog::Accepted)
|
if (propertyDialog.exec() == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
size_t timeStep = resultSlot->reservoirView()->currentTimeStep();
|
size_t timeStep = resultSlot->reservoirView()->currentTimeStep();
|
||||||
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(resultSlot->porosityModel());
|
RifReaderInterface::PorosityModelResultType porosityModel = RigCaseCellResultsData::convertFromProjectModelPorosityModel(resultSlot->porosityModel());
|
||||||
|
@ -43,7 +43,6 @@
|
|||||||
#include "RiuMultiCaseImportDialog.h"
|
#include "RiuMultiCaseImportDialog.h"
|
||||||
|
|
||||||
#include "RiaPreferences.h"
|
#include "RiaPreferences.h"
|
||||||
#include "RiuPreferencesDialog.h"
|
|
||||||
|
|
||||||
#include "RigCaseCellResultsData.h"
|
#include "RigCaseCellResultsData.h"
|
||||||
|
|
||||||
@ -63,6 +62,7 @@
|
|||||||
#include "RimCalcScript.h"
|
#include "RimCalcScript.h"
|
||||||
#include "RimTools.h"
|
#include "RimTools.h"
|
||||||
#include "RiaRegressionTest.h"
|
#include "RiaRegressionTest.h"
|
||||||
|
#include "cafPdmUiPropertyDialog.h"
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -1214,8 +1214,8 @@ void RiuMainWindow::slotShowPerformanceInfo(bool enable)
|
|||||||
void RiuMainWindow::slotEditPreferences()
|
void RiuMainWindow::slotEditPreferences()
|
||||||
{
|
{
|
||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
RiuPreferencesDialog preferencesDialog(this, app->preferences(), "Preferences");
|
caf::PdmUiPropertyDialog propertyDialog(this, app->preferences(), "Preferences");
|
||||||
if (preferencesDialog.exec() == QDialog::Accepted)
|
if (propertyDialog.exec() == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
// Write preferences using QSettings and apply them to the application
|
// Write preferences using QSettings and apply them to the application
|
||||||
app->writeFieldsToApplicationStore(app->preferences());
|
app->writeFieldsToApplicationStore(app->preferences());
|
||||||
@ -1739,7 +1739,7 @@ void RiuMainWindow::slotShowRegressionTestDialog()
|
|||||||
RiaApplication* app = RiaApplication::instance();
|
RiaApplication* app = RiaApplication::instance();
|
||||||
app->readFieldsFromApplicationStore(®TestConfig);
|
app->readFieldsFromApplicationStore(®TestConfig);
|
||||||
|
|
||||||
RiuPreferencesDialog regressionTestDialog(this, ®TestConfig, "Regression Test");
|
caf::PdmUiPropertyDialog regressionTestDialog(this, ®TestConfig, "Regression Test");
|
||||||
if (regressionTestDialog.exec() == QDialog::Accepted)
|
if (regressionTestDialog.exec() == QDialog::Accepted)
|
||||||
{
|
{
|
||||||
// Write preferences using QSettings and apply them to the application
|
// Write preferences using QSettings and apply them to the application
|
||||||
|
@ -1,67 +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 "RiaStdInclude.h"
|
|
||||||
#include "RiuPreferencesDialog.h"
|
|
||||||
|
|
||||||
#include "cafAppEnum.h"
|
|
||||||
#include "cafPdmObject.h"
|
|
||||||
|
|
||||||
#include "RimUiTreeModelPdm.h"
|
|
||||||
#include "cafPdmUiPropertyView.h"
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
RiuPreferencesDialog::RiuPreferencesDialog(QWidget* parent, caf::PdmObject* object, const QString& windowTitle)
|
|
||||||
: QDialog(parent)
|
|
||||||
{
|
|
||||||
CVF_ASSERT(object);
|
|
||||||
|
|
||||||
m_pdmObject = object;
|
|
||||||
m_windowTitle = windowTitle;
|
|
||||||
|
|
||||||
setupUi();
|
|
||||||
}
|
|
||||||
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
///
|
|
||||||
//--------------------------------------------------------------------------------------------------
|
|
||||||
void RiuPreferencesDialog::setupUi()
|
|
||||||
{
|
|
||||||
setWindowTitle(m_windowTitle);
|
|
||||||
|
|
||||||
m_pdmUiPropertyView = new caf::PdmUiPropertyView(this);
|
|
||||||
|
|
||||||
QVBoxLayout* dialogLayout = new QVBoxLayout;
|
|
||||||
setLayout(dialogLayout);
|
|
||||||
|
|
||||||
dialogLayout->addWidget(m_pdmUiPropertyView);
|
|
||||||
m_pdmUiPropertyView->showProperties(m_pdmObject);
|
|
||||||
|
|
||||||
// Buttons
|
|
||||||
QDialogButtonBox* buttonBox = new QDialogButtonBox(QDialogButtonBox::Ok | QDialogButtonBox::Cancel);
|
|
||||||
connect(buttonBox, SIGNAL(accepted()), this, SLOT(accept()));
|
|
||||||
connect(buttonBox, SIGNAL(rejected()), this, SLOT(reject()));
|
|
||||||
|
|
||||||
dialogLayout->addWidget(buttonBox);
|
|
||||||
|
|
||||||
this->resize(400, 200);
|
|
||||||
}
|
|
@ -1,49 +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 caf
|
|
||||||
{
|
|
||||||
class PdmObject;
|
|
||||||
class PdmUiPropertyView;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
//==================================================================================================
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//
|
|
||||||
//==================================================================================================
|
|
||||||
class RiuPreferencesDialog : public QDialog
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
RiuPreferencesDialog(QWidget* parent, caf::PdmObject* object, const QString& windowTitle);
|
|
||||||
|
|
||||||
private:
|
|
||||||
void setupUi();
|
|
||||||
|
|
||||||
private:
|
|
||||||
QString m_windowTitle;
|
|
||||||
caf::PdmObject* m_pdmObject;
|
|
||||||
caf::PdmUiPropertyView* m_pdmUiPropertyView;
|
|
||||||
};
|
|
Loading…
Reference in New Issue
Block a user